AMP for WordPress - Version 1.1.0

Version Description

Download this release

Release Info

Developer westonruter
Plugin Icon 128x128 AMP for WordPress
Version 1.1.0
Comparing to
See all releases

Code changes from version 1.0.2 to 1.1.0

Files changed (66) hide show
  1. amp.php +61 -16
  2. assets/css/amp-default.css +8 -3
  3. assets/js/amp-block-editor-toggle-compiled.js +1 -76
  4. assets/js/amp-block-validation.js +13 -20
  5. assets/js/amp-blocks-compiled.js +1 -167
  6. assets/js/amp-editor-blocks.js +2 -7
  7. assets/js/amp-service-worker-runtime-precaching.js +9 -0
  8. assets/js/amp-validated-url-post-edit-screen.js +1 -1
  9. assets/js/amp-validation-detail-toggle-compiled.js +1 -83
  10. assets/js/amp-validation-single-error-url-details-compiled.js +1 -75
  11. assets/js/wp-dom-ready-compiled.js +1 -84
  12. assets/js/wp-i18n-compiled.js +1 -450
  13. back-compat/back-compat.php +20 -3
  14. back-compat/templates-v0-3/header-bar.php +9 -1
  15. back-compat/templates-v0-3/meta-author.php +16 -4
  16. back-compat/templates-v0-3/meta-taxonomy.php +11 -3
  17. back-compat/templates-v0-3/meta-time.php +8 -0
  18. back-compat/templates-v0-3/single.php +9 -1
  19. back-compat/templates-v0-3/style.php +10 -0
  20. includes/admin/class-amp-admin-pointer.php +7 -1
  21. includes/admin/class-amp-customizer.php +45 -23
  22. includes/admin/class-amp-editor-blocks.php +13 -4
  23. includes/admin/class-amp-post-meta-box.php +33 -24
  24. includes/admin/functions.php +19 -14
  25. includes/amp-frontend-actions.php +11 -1
  26. includes/amp-helper-functions.php +175 -69
  27. includes/amp-post-template-actions.php +0 -139
  28. includes/amp-post-template-functions.php +136 -9
  29. includes/class-amp-autoloader.php +80 -84
  30. includes/class-amp-cli.php +31 -36
  31. includes/class-amp-comment-walker.php +6 -1
  32. includes/class-amp-http.php +29 -22
  33. includes/class-amp-post-type-support.php +16 -10
  34. includes/class-amp-service-worker.php +346 -0
  35. includes/class-amp-theme-support.php +316 -127
  36. includes/embeds/class-amp-base-embed-handler.php +10 -7
  37. includes/embeds/class-amp-core-block-handler.php +80 -66
  38. includes/embeds/class-amp-dailymotion-embed.php +6 -3
  39. includes/embeds/class-amp-facebook-embed.php +118 -17
  40. includes/embeds/class-amp-gallery-embed.php +53 -40
  41. includes/embeds/class-amp-imgur-embed-handler.php +6 -3
  42. includes/embeds/class-amp-instagram-embed.php +66 -11
  43. includes/embeds/class-amp-pinterest-embed.php +45 -9
  44. includes/embeds/class-amp-playlist-embed-handler.php +2 -2
  45. includes/embeds/class-amp-reddit-embed-handler.php +6 -3
  46. includes/embeds/class-amp-soundcloud-embed.php +15 -9
  47. includes/embeds/class-amp-twitter-embed.php +18 -11
  48. includes/embeds/class-amp-vimeo-embed.php +6 -3
  49. includes/embeds/class-amp-vine-embed.php +56 -9
  50. includes/embeds/class-amp-youtube-embed.php +8 -4
  51. includes/options/class-amp-analytics-options-submenu.php +33 -2
  52. includes/options/class-amp-options-manager.php +30 -21
  53. includes/options/class-amp-options-menu.php +44 -22
  54. includes/options/views/class-amp-analytics-options-submenu-page.php +18 -2
  55. includes/sanitizers/class-amp-allowed-tags-generated.php +2213 -124
  56. includes/sanitizers/class-amp-audio-sanitizer.php +91 -41
  57. includes/sanitizers/class-amp-base-sanitizer.php +9 -5
  58. includes/sanitizers/class-amp-blacklist-sanitizer.php +46 -37
  59. includes/sanitizers/class-amp-comments-sanitizer.php +68 -6
  60. includes/sanitizers/class-amp-core-theme-sanitizer.php +262 -379
  61. includes/sanitizers/class-amp-form-sanitizer.php +5 -15
  62. includes/sanitizers/class-amp-gallery-block-sanitizer.php +9 -5
  63. includes/sanitizers/class-amp-iframe-sanitizer.php +29 -7
  64. includes/sanitizers/class-amp-img-sanitizer.php +59 -78
  65. includes/sanitizers/class-amp-nav-menu-dropdown-sanitizer.php +164 -0
  66. includes/sanitizers/class-amp-nav-menu-toggle-sanitizer.php +15 -0
amp.php CHANGED
@@ -3,9 +3,9 @@
3
  * Plugin Name: AMP
4
  * Description: Enable AMP on your WordPress site, the WordPress way.
5
  * Plugin URI: https://amp-wp.org
6
- * Author: WordPress.com VIP, XWP, Google, and contributors
7
  * Author URI: https://github.com/ampproject/amp-wp/graphs/contributors
8
- * Version: 1.0.2
9
  * Text Domain: amp
10
  * Domain Path: /languages/
11
  * License: GPLv2 or later
@@ -21,11 +21,19 @@
21
  function _amp_print_php_version_admin_notice() {
22
  ?>
23
  <div class="notice notice-error">
24
- <p><?php esc_html_e( 'The AMP plugin requires PHP 5.3+. Please contact your host to update your PHP version.', 'amp' ); ?></p>
 
 
 
 
 
 
 
 
25
  </div>
26
  <?php
27
  }
28
- if ( version_compare( phpversion(), '5.3.6', '<' ) ) {
29
  add_action( 'admin_notices', '_amp_print_php_version_admin_notice' );
30
  return;
31
  }
@@ -38,7 +46,15 @@ if ( version_compare( phpversion(), '5.3.6', '<' ) ) {
38
  function _amp_print_php_dom_document_notice() {
39
  ?>
40
  <div class="notice notice-error">
41
- <p><?php esc_html_e( 'The AMP plugin requires DOM extension in PHP. Please contact your host to install this extension.', 'amp' ); ?></p>
 
 
 
 
 
 
 
 
42
  </div>
43
  <?php
44
  }
@@ -55,7 +71,15 @@ if ( ! class_exists( 'DOMDocument' ) ) {
55
  function _amp_print_php_missing_iconv_notice() {
56
  ?>
57
  <div class="notice notice-error">
58
- <p><?php esc_html_e( 'The AMP plugin requires iconv extension in PHP. Please contact your host to install this extension.', 'amp' ); ?></p>
 
 
 
 
 
 
 
 
59
  </div>
60
  <?php
61
  }
@@ -72,7 +96,15 @@ if ( ! function_exists( 'iconv' ) ) {
72
  function _amp_print_build_needed_notice() {
73
  ?>
74
  <div class="notice notice-error">
75
- <p><?php esc_html_e( 'You appear to be running the AMP plugin from source. Please do `composer install && npm install && npm run build` to finish installation.', 'amp' ); ?></p>
 
 
 
 
 
 
 
 
76
  </div>
77
  <?php
78
  }
@@ -83,7 +115,7 @@ if ( ! file_exists( __DIR__ . '/vendor/autoload.php' ) || ! file_exists( __DIR__
83
 
84
  define( 'AMP__FILE__', __FILE__ );
85
  define( 'AMP__DIR__', dirname( __FILE__ ) );
86
- define( 'AMP__VERSION', '1.0.2' );
87
 
88
  /**
89
  * Print admin notice if plugin installed with incorrect slug (which impacts WordPress's auto-update system).
@@ -215,9 +247,10 @@ function amp_init() {
215
  AMP_HTTP::handle_xhr_request();
216
  AMP_Theme_Support::init();
217
  AMP_Validation_Manager::init();
 
218
  add_action( 'init', array( 'AMP_Post_Type_Support', 'add_post_type_support' ), 1000 ); // After post types have been defined.
219
 
220
- if ( defined( 'WP_CLI' ) ) {
221
  WP_CLI::add_command( 'amp', new AMP_CLI() );
222
  }
223
 
@@ -277,7 +310,7 @@ function amp_force_query_var_value( $query_vars ) {
277
  }
278
 
279
  /**
280
- * Conditionally add AMP actions or render the 'paired mode' template(s).
281
  *
282
  * If the request is for an AMP page and this is in 'canonical mode,' redirect to the non-AMP page.
283
  * It won't need this plugin's template system, nor the frontend actions like the 'rel' link.
@@ -294,7 +327,7 @@ function amp_maybe_add_actions() {
294
  return;
295
  }
296
 
297
- // The remaining logic here is for paired mode running in themes that don't support AMP, the template system in AMP<=0.6.
298
  global $wp_query;
299
  if ( ! ( is_singular() || $wp_query->is_posts_page ) || is_feed() ) {
300
  return;
@@ -310,13 +343,26 @@ function amp_maybe_add_actions() {
310
  $post = get_queried_object();
311
  if ( ! post_supports_amp( $post ) ) {
312
  if ( $is_amp_endpoint ) {
313
- wp_safe_redirect( get_permalink( $post->ID ), 302 ); // Temporary redirect because AMP may be supported in future.
 
 
 
 
314
  exit;
315
  }
316
  return;
317
  }
318
 
319
  if ( $is_amp_endpoint ) {
 
 
 
 
 
 
 
 
 
320
  amp_prepare_render();
321
  } else {
322
  amp_add_frontend_actions();
@@ -371,13 +417,13 @@ function amp_correct_query_when_is_front_page( WP_Query $query ) {
371
  * add_theme_support( AMP_Theme_Support::SLUG );
372
  *
373
  * This will serve templates in native AMP, allowing you to use AMP components in your theme templates.
374
- * If you want to make available in paired mode, where templates are served in AMP or non-AMP documents, do:
375
  *
376
  * add_theme_support( AMP_Theme_Support::SLUG, array(
377
  * 'paired' => true,
378
  * ) );
379
  *
380
- * Paired mode is also implied if you define a template_dir:
381
  *
382
  * add_theme_support( AMP_Theme_Support::SLUG, array(
383
  * 'template_dir' => 'amp',
@@ -418,7 +464,7 @@ function amp_is_canonical() {
418
  return empty( $args['paired'] );
419
  }
420
 
421
- // If there is a template_dir, then paired mode is implied.
422
  return empty( $args['template_dir'] );
423
  }
424
 
@@ -448,7 +494,6 @@ function amp_add_frontend_actions() {
448
  * @deprecated This function is not used when 'amp' theme support is added.
449
  */
450
  function amp_add_post_template_actions() {
451
- require_once AMP__DIR__ . '/includes/amp-post-template-actions.php';
452
  require_once AMP__DIR__ . '/includes/amp-post-template-functions.php';
453
  amp_post_template_init_hooks();
454
  }
3
  * Plugin Name: AMP
4
  * Description: Enable AMP on your WordPress site, the WordPress way.
5
  * Plugin URI: https://amp-wp.org
6
+ * Author: AMP Project Contributors
7
  * Author URI: https://github.com/ampproject/amp-wp/graphs/contributors
8
+ * Version: 1.1.0
9
  * Text Domain: amp
10
  * Domain Path: /languages/
11
  * License: GPLv2 or later
21
  function _amp_print_php_version_admin_notice() {
22
  ?>
23
  <div class="notice notice-error">
24
+ <p>
25
+ <?php
26
+ printf(
27
+ /* translators: %s: required PHP version */
28
+ esc_html__( 'The AMP plugin requires PHP %s. Please contact your host to update your PHP version.', 'amp' ),
29
+ '5.4+'
30
+ );
31
+ ?>
32
+ </p>
33
  </div>
34
  <?php
35
  }
36
+ if ( version_compare( phpversion(), '5.4', '<' ) ) {
37
  add_action( 'admin_notices', '_amp_print_php_version_admin_notice' );
38
  return;
39
  }
46
  function _amp_print_php_dom_document_notice() {
47
  ?>
48
  <div class="notice notice-error">
49
+ <p>
50
+ <?php
51
+ printf(
52
+ /* translators: %s: PHP extension name */
53
+ esc_html__( 'The AMP plugin requires the %s extension in PHP. Please contact your host to install this extension.', 'amp' ),
54
+ 'DOM'
55
+ );
56
+ ?>
57
+ </p>
58
  </div>
59
  <?php
60
  }
71
  function _amp_print_php_missing_iconv_notice() {
72
  ?>
73
  <div class="notice notice-error">
74
+ <p>
75
+ <?php
76
+ printf(
77
+ /* translators: %s: PHP extension name */
78
+ esc_html__( 'The AMP plugin requires the %s extension in PHP. Please contact your host to install this extension.', 'amp' ),
79
+ 'iconv'
80
+ );
81
+ ?>
82
+ </p>
83
  </div>
84
  <?php
85
  }
96
  function _amp_print_build_needed_notice() {
97
  ?>
98
  <div class="notice notice-error">
99
+ <p>
100
+ <?php
101
+ printf(
102
+ /* translators: %s: composer install && npm install && npm run build */
103
+ __( 'You appear to be running the AMP plugin from source. Please do %s to finish installation.', 'amp' ), // phpcs:ignore WordPress.Security.EscapeOutput
104
+ '<code>composer install && npm install && npm run build</code>'
105
+ );
106
+ ?>
107
+ </p>
108
  </div>
109
  <?php
110
  }
115
 
116
  define( 'AMP__FILE__', __FILE__ );
117
  define( 'AMP__DIR__', dirname( __FILE__ ) );
118
+ define( 'AMP__VERSION', '1.1.0' );
119
 
120
  /**
121
  * Print admin notice if plugin installed with incorrect slug (which impacts WordPress's auto-update system).
247
  AMP_HTTP::handle_xhr_request();
248
  AMP_Theme_Support::init();
249
  AMP_Validation_Manager::init();
250
+ AMP_Service_Worker::init();
251
  add_action( 'init', array( 'AMP_Post_Type_Support', 'add_post_type_support' ), 1000 ); // After post types have been defined.
252
 
253
+ if ( defined( 'WP_CLI' ) && WP_CLI ) {
254
  WP_CLI::add_command( 'amp', new AMP_CLI() );
255
  }
256
 
310
  }
311
 
312
  /**
313
+ * Conditionally add AMP actions or render the transitional mode template(s).
314
  *
315
  * If the request is for an AMP page and this is in 'canonical mode,' redirect to the non-AMP page.
316
  * It won't need this plugin's template system, nor the frontend actions like the 'rel' link.
327
  return;
328
  }
329
 
330
+ // The remaining logic here is for transitional mode running in themes that don't support AMP, the template system in AMP<=0.6.
331
  global $wp_query;
332
  if ( ! ( is_singular() || $wp_query->is_posts_page ) || is_feed() ) {
333
  return;
343
  $post = get_queried_object();
344
  if ( ! post_supports_amp( $post ) ) {
345
  if ( $is_amp_endpoint ) {
346
+ /*
347
+ * Temporary redirect is used for admin users because reader mode and AMP support can be enabled by user at any time,
348
+ * so they will be able to make AMP available for this URL and see the change without wrestling with the redirect cache.
349
+ */
350
+ wp_safe_redirect( get_permalink( $post->ID ), current_user_can( 'manage_options' ) ? 302 : 301 );
351
  exit;
352
  }
353
  return;
354
  }
355
 
356
  if ( $is_amp_endpoint ) {
357
+
358
+ // Prevent infinite URL space under /amp/ endpoint.
359
+ global $wp;
360
+ wp_parse_str( $wp->matched_query, $path_args );
361
+ if ( isset( $path_args[ amp_get_slug() ] ) && '' !== $path_args[ amp_get_slug() ] ) {
362
+ wp_safe_redirect( amp_get_permalink( $post->ID ), 301 );
363
+ exit;
364
+ }
365
+
366
  amp_prepare_render();
367
  } else {
368
  amp_add_frontend_actions();
417
  * add_theme_support( AMP_Theme_Support::SLUG );
418
  *
419
  * This will serve templates in native AMP, allowing you to use AMP components in your theme templates.
420
+ * If you want to make available in transitional mode, where templates are served in AMP or non-AMP documents, do:
421
  *
422
  * add_theme_support( AMP_Theme_Support::SLUG, array(
423
  * 'paired' => true,
424
  * ) );
425
  *
426
+ * Transitional mode is also implied if you define a template_dir:
427
  *
428
  * add_theme_support( AMP_Theme_Support::SLUG, array(
429
  * 'template_dir' => 'amp',
464
  return empty( $args['paired'] );
465
  }
466
 
467
+ // If there is a template_dir, then transitional mode is implied.
468
  return empty( $args['template_dir'] );
469
  }
470
 
494
  * @deprecated This function is not used when 'amp' theme support is added.
495
  */
496
  function amp_add_post_template_actions() {
 
497
  require_once AMP__DIR__ . '/includes/amp-post-template-functions.php';
498
  amp_post_template_init_hooks();
499
  }
assets/css/amp-default.css CHANGED
@@ -1,6 +1,11 @@
1
- .amp-wp-unknown-size [src] {
2
- /** Worst case scenario when we can't figure out dimensions for an image. **/
3
- /** Force the image into a box of fixed dimensions and use object-fit to scale. **/
 
 
 
 
 
4
  object-fit: contain;
5
  }
6
 
1
+
2
+ /*
3
+ * Prevent cases of amp-img converted from img to appear with stretching by using object-fit to scale.
4
+ * See <https://github.com/ampproject/amphtml/issues/21371#issuecomment-475443219>.
5
+ * Also use object-fit:contain in worst case scenario when we can't figure out dimensions for an image.
6
+ */
7
+ amp-img.amp-wp-enforced-sizes[layout=intrinsic] > img,
8
+ .amp-wp-unknown-size > img {
9
  object-fit: contain;
10
  }
11
 
assets/js/amp-block-editor-toggle-compiled.js CHANGED
@@ -1,76 +1 @@
1
- /******/ (function(modules) { // webpackBootstrap
2
- /******/ // The module cache
3
- /******/ var installedModules = {};
4
- /******/
5
- /******/ // The require function
6
- /******/ function __webpack_require__(moduleId) {
7
- /******/
8
- /******/ // Check if module is in cache
9
- /******/ if(installedModules[moduleId]) {
10
- /******/ return installedModules[moduleId].exports;
11
- /******/ }
12
- /******/ // Create a new module (and put it into the cache)
13
- /******/ var module = installedModules[moduleId] = {
14
- /******/ i: moduleId,
15
- /******/ l: false,
16
- /******/ exports: {}
17
- /******/ };
18
- /******/
19
- /******/ // Execute the module function
20
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
21
- /******/
22
- /******/ // Flag the module as loaded
23
- /******/ module.l = true;
24
- /******/
25
- /******/ // Return the exports of the module
26
- /******/ return module.exports;
27
- /******/ }
28
- /******/
29
- /******/
30
- /******/ // expose the modules object (__webpack_modules__)
31
- /******/ __webpack_require__.m = modules;
32
- /******/
33
- /******/ // expose the module cache
34
- /******/ __webpack_require__.c = installedModules;
35
- /******/
36
- /******/ // define getter function for harmony exports
37
- /******/ __webpack_require__.d = function(exports, name, getter) {
38
- /******/ if(!__webpack_require__.o(exports, name)) {
39
- /******/ Object.defineProperty(exports, name, {
40
- /******/ configurable: false,
41
- /******/ enumerable: true,
42
- /******/ get: getter
43
- /******/ });
44
- /******/ }
45
- /******/ };
46
- /******/
47
- /******/ // getDefaultExport function for compatibility with non-harmony modules
48
- /******/ __webpack_require__.n = function(module) {
49
- /******/ var getter = module && module.__esModule ?
50
- /******/ function getDefault() { return module['default']; } :
51
- /******/ function getModuleExports() { return module; };
52
- /******/ __webpack_require__.d(getter, 'a', getter);
53
- /******/ return getter;
54
- /******/ };
55
- /******/
56
- /******/ // Object.prototype.hasOwnProperty.call
57
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
58
- /******/
59
- /******/ // __webpack_public_path__
60
- /******/ __webpack_require__.p = "";
61
- /******/
62
- /******/ // Load entry module and return exports
63
- /******/ return __webpack_require__(__webpack_require__.s = 75);
64
- /******/ })
65
- /************************************************************************/
66
- /******/ ({
67
-
68
- /***/ 75:
69
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
70
-
71
- "use strict";
72
- eval("Object.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/**\n * WordPress dependencies\n */\nvar __ = wp.i18n.__;\nvar _wp$components = wp.components,\n FormToggle = _wp$components.FormToggle,\n Notice = _wp$components.Notice;\nvar _wp$element = wp.element,\n Fragment = _wp$element.Fragment,\n RawHTML = _wp$element.RawHTML;\nvar _wp$data = wp.data,\n withSelect = _wp$data.withSelect,\n withDispatch = _wp$data.withDispatch;\nvar PluginPostStatusInfo = wp.editPost.PluginPostStatusInfo;\nvar _wp$compose = wp.compose,\n compose = _wp$compose.compose,\n withInstanceId = _wp$compose.withInstanceId;\n\n/**\n * Exported via wp_localize_script().\n */\n\nvar _window$wpAmpEditor = window.wpAmpEditor,\n possibleStati = _window$wpAmpEditor.possibleStati,\n defaultStatus = _window$wpAmpEditor.defaultStatus,\n errorMessages = _window$wpAmpEditor.errorMessages;\n\n/**\n * Adds an 'Enable AMP' toggle to the block editor 'Status & Visibility' section.\n *\n * If there are error(s) that block AMP from being enabled or disabled,\n * this only displays a Notice with the error(s), not a toggle.\n * Error(s) are imported as errorMessages via wp_localize_script().\n *\n * @return {Object} AMPToggle component.\n */\n\nfunction AMPToggle(_ref) {\n\tvar enabledStatus = _ref.enabledStatus,\n\t onAmpChange = _ref.onAmpChange;\n\n\treturn wp.element.createElement(\n\t\tFragment,\n\t\tnull,\n\t\twp.element.createElement(\n\t\t\tPluginPostStatusInfo,\n\t\t\tnull,\n\t\t\t!errorMessages.length && wp.element.createElement(\n\t\t\t\t'label',\n\t\t\t\t{ htmlFor: 'amp-enabled' },\n\t\t\t\t__('Enable AMP', 'amp')\n\t\t\t),\n\t\t\t!errorMessages.length && wp.element.createElement(FormToggle, {\n\t\t\t\tchecked: 'enabled' === enabledStatus,\n\t\t\t\tonChange: function onChange() {\n\t\t\t\t\treturn onAmpChange(enabledStatus);\n\t\t\t\t},\n\t\t\t\tid: 'amp-enabled'\n\t\t\t}),\n\t\t\t!!errorMessages.length && wp.element.createElement(\n\t\t\t\tNotice,\n\t\t\t\t{\n\t\t\t\t\tstatus: 'warning',\n\t\t\t\t\tisDismissible: false\n\t\t\t\t},\n\t\t\t\terrorMessages.map(function (message, index) {\n\t\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\t\tRawHTML,\n\t\t\t\t\t\t{ key: index },\n\t\t\t\t\t\tmessage\n\t\t\t\t\t);\n\t\t\t\t})\n\t\t\t)\n\t\t)\n\t);\n}\n\n/**\n * The AMP Toggle component, composed with the enabledStatus and a callback for when it's changed.\n *\n * @return {Object} The composed AMP toggle.\n */\nfunction ComposedAMPToggle() {\n\treturn compose([withSelect(function (select) {\n\t\t/**\n * Gets the AMP enabled status.\n *\n * Uses select from the enclosing function to get the meta value.\n * If it doesn't exist, it uses the default value.\n * This applies especially for a new post, where there probably won't be a meta value yet.\n *\n * @return {string} Enabled status, either 'enabled' or 'disabled'.\n */\n\t\tvar getEnabledStatus = function getEnabledStatus() {\n\t\t\tvar meta = select('core/editor').getEditedPostAttribute('meta');\n\t\t\tif (meta && meta.amp_status && possibleStati.includes(meta.amp_status)) {\n\t\t\t\treturn meta.amp_status;\n\t\t\t}\n\t\t\treturn defaultStatus;\n\t\t};\n\n\t\treturn { enabledStatus: getEnabledStatus() };\n\t}), withDispatch(function (dispatch) {\n\t\treturn {\n\t\t\tonAmpChange: function onAmpChange(enabledStatus) {\n\t\t\t\tvar newStatus = 'enabled' === enabledStatus ? 'disabled' : 'enabled';\n\t\t\t\tdispatch('core/editor').editPost({ meta: { amp_status: newStatus } });\n\t\t\t}\n\t\t};\n\t}), withInstanceId])(AMPToggle);\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (wp.plugins.registerPlugin('amp', {\n\ticon: 'hidden',\n\trender: ComposedAMPToggle()\n}));//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9hc3NldHMvc3JjL2FtcC1ibG9jay1lZGl0b3ItdG9nZ2xlLmpzPzVkMDkiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBXb3JkUHJlc3MgZGVwZW5kZW5jaWVzXG4gKi9cbnZhciBfXyA9IHdwLmkxOG4uX187XG52YXIgX3dwJGNvbXBvbmVudHMgPSB3cC5jb21wb25lbnRzLFxuICAgIEZvcm1Ub2dnbGUgPSBfd3AkY29tcG9uZW50cy5Gb3JtVG9nZ2xlLFxuICAgIE5vdGljZSA9IF93cCRjb21wb25lbnRzLk5vdGljZTtcbnZhciBfd3AkZWxlbWVudCA9IHdwLmVsZW1lbnQsXG4gICAgRnJhZ21lbnQgPSBfd3AkZWxlbWVudC5GcmFnbWVudCxcbiAgICBSYXdIVE1MID0gX3dwJGVsZW1lbnQuUmF3SFRNTDtcbnZhciBfd3AkZGF0YSA9IHdwLmRhdGEsXG4gICAgd2l0aFNlbGVjdCA9IF93cCRkYXRhLndpdGhTZWxlY3QsXG4gICAgd2l0aERpc3BhdGNoID0gX3dwJGRhdGEud2l0aERpc3BhdGNoO1xudmFyIFBsdWdpblBvc3RTdGF0dXNJbmZvID0gd3AuZWRpdFBvc3QuUGx1Z2luUG9zdFN0YXR1c0luZm87XG52YXIgX3dwJGNvbXBvc2Ug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/ });
1
+ !function(t){var e={};function n(c){if(e[c])return e[c].exports;var d=e[c]={i:c,l:!1,exports:{}};return t[c].call(d.exports,d,d.exports,n),d.l=!0,d.exports}n.m=t,n.c=e,n.d=function(t,e,c){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:c})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var c=Object.create(null);if(n.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var d in t)n.d(c,d,function(e){return t[e]}.bind(null,d));return c},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=4)}({4:function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/**\n * WordPress dependencies\n */\nvar __ = wp.i18n.__;\nvar _wp$components = wp.components,\n FormToggle = _wp$components.FormToggle,\n Notice = _wp$components.Notice;\nvar _wp$element = wp.element,\n Fragment = _wp$element.Fragment,\n RawHTML = _wp$element.RawHTML;\nvar _wp$data = wp.data,\n withSelect = _wp$data.withSelect,\n withDispatch = _wp$data.withDispatch;\nvar PluginPostStatusInfo = wp.editPost.PluginPostStatusInfo;\nvar _wp$compose = wp.compose,\n compose = _wp$compose.compose,\n withInstanceId = _wp$compose.withInstanceId;\n\n/**\n * Exported via wp_localize_script().\n */\n\nvar _window$wpAmpEditor = window.wpAmpEditor,\n possibleStati = _window$wpAmpEditor.possibleStati,\n defaultStatus = _window$wpAmpEditor.defaultStatus,\n errorMessages = _window$wpAmpEditor.errorMessages;\n\n/**\n * Adds an 'Enable AMP' toggle to the block editor 'Status & Visibility' section.\n *\n * If there are error(s) that block AMP from being enabled or disabled,\n * this only displays a Notice with the error(s), not a toggle.\n * Error(s) are imported as errorMessages via wp_localize_script().\n *\n * @return {Object} AMPToggle component.\n */\n\nfunction AMPToggle(_ref) {\n\tvar enabledStatus = _ref.enabledStatus,\n\t onAmpChange = _ref.onAmpChange;\n\n\treturn wp.element.createElement(\n\t\tFragment,\n\t\tnull,\n\t\twp.element.createElement(\n\t\t\tPluginPostStatusInfo,\n\t\t\tnull,\n\t\t\t!errorMessages.length && wp.element.createElement(\n\t\t\t\t'label',\n\t\t\t\t{ htmlFor: 'amp-enabled' },\n\t\t\t\t__('Enable AMP', 'amp')\n\t\t\t),\n\t\t\t!errorMessages.length && wp.element.createElement(FormToggle, {\n\t\t\t\tchecked: 'enabled' === enabledStatus,\n\t\t\t\tonChange: function onChange() {\n\t\t\t\t\treturn onAmpChange(enabledStatus);\n\t\t\t\t},\n\t\t\t\tid: 'amp-enabled'\n\t\t\t}),\n\t\t\t!!errorMessages.length && wp.element.createElement(\n\t\t\t\tNotice,\n\t\t\t\t{\n\t\t\t\t\tstatus: 'warning',\n\t\t\t\t\tisDismissible: false\n\t\t\t\t},\n\t\t\t\terrorMessages.map(function (message, index) {\n\t\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\t\tRawHTML,\n\t\t\t\t\t\t{ key: index },\n\t\t\t\t\t\tmessage\n\t\t\t\t\t);\n\t\t\t\t})\n\t\t\t)\n\t\t)\n\t);\n}\n\n/**\n * The AMP Toggle component, composed with the enabledStatus and a callback for when it's changed.\n *\n * @return {Object} The composed AMP toggle.\n */\nfunction ComposedAMPToggle() {\n\treturn compose([withSelect(function (select) {\n\t\t/**\n * Gets the AMP enabled status.\n *\n * Uses select from the enclosing function to get the meta value.\n * If it doesn't exist, it uses the default value.\n * This applies especially for a new post, where there probably won't be a meta value yet.\n *\n * @return {string} Enabled status, either 'enabled' or 'disabled'.\n */\n\t\tvar getEnabledStatus = function getEnabledStatus() {\n\t\t\tvar meta = select('core/editor').getEditedPostAttribute('meta');\n\t\t\tif (meta && meta.amp_status && possibleStati.includes(meta.amp_status)) {\n\t\t\t\treturn meta.amp_status;\n\t\t\t}\n\t\t\treturn defaultStatus;\n\t\t};\n\n\t\treturn { enabledStatus: getEnabledStatus() };\n\t}), withDispatch(function (dispatch) {\n\t\treturn {\n\t\t\tonAmpChange: function onAmpChange(enabledStatus) {\n\t\t\t\tvar newStatus = 'enabled' === enabledStatus ? 'disabled' : 'enabled';\n\t\t\t\tdispatch('core/editor').editPost({ meta: { amp_status: newStatus } });\n\t\t\t}\n\t\t};\n\t}), withInstanceId])(AMPToggle);\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (wp.plugins.registerPlugin('amp', {\n\ticon: 'hidden',\n\trender: ComposedAMPToggle()\n}));//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2Fzc2V0cy9zcmMvYW1wLWJsb2NrLWVkaXRvci10b2dnbGUuanM/MDllMSJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIFdvcmRQcmVzcyBkZXBlbmRlbmNpZXNcbiAqL1xudmFyIF9fID0gd3AuaTE4bi5fXztcbnZhciBfd3AkY29tcG9uZW50cyA9IHdwLmNvbXBvbmVudHMsXG4gICAgRm9ybVRvZ2dsZSA9IF93cCRjb21wb25lbnRzLkZvcm1Ub2dnbGUsXG4gICAgTm90aWNlID0gX3dwJGNvbXBvbmVudHMuTm90aWNlO1xudmFyIF93cCRlbGVtZW50ID0gd3AuZWxlbWVudCxcbiAgICBGcmFnbWVudCA9IF93cCRlbGVtZW50LkZyYWdtZW50LFxuICAgIFJhd0hUTUwgPSBfd3AkZWxlbWVudC5SYXdIVE1MO1xudmFyIF93cCRkYXRhID0gd3AuZGF0YSxcbiAgICB3aXRoU2VsZWN0ID0gX3dwJGRhdGEud2l0aFNlbGVjdCxcbiAgICB3aXRoRGlzc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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/amp-block-validation.js CHANGED
@@ -195,6 +195,7 @@ var ampBlockValidation = ( function() { // eslint-disable-line no-unused-vars
195
  module.resetWarningNotice();
196
 
197
  noticeMessage = wp.i18n.sprintf(
 
198
  wp.i18n._n(
199
  'There is %s issue from AMP validation which needs review.',
200
  'There are %s issues from AMP validation which need review.',
@@ -212,36 +213,29 @@ var ampBlockValidation = ( function() { // eslint-disable-line no-unused-vars
212
  blockErrorCount = validationErrors.length - blockValidationErrors.other.length;
213
  if ( blockErrorCount > 0 ) {
214
  noticeMessage += ' ' + wp.i18n.sprintf(
215
- /* translators: %s is the count of block errors. */
216
  wp.i18n._n(
217
- 'And %s is directly due to content here.',
218
- 'And %s are directly due to content here.',
219
  blockErrorCount,
220
  'amp'
221
  ),
222
  blockErrorCount
223
  );
 
 
224
  } else {
225
- noticeMessage += ' ' + wp.i18n.sprintf(
226
- wp.i18n._n(
227
- 'But it is not directly due to content here.',
228
- 'But none are directly due to content here.',
229
- validationErrors.length,
230
- 'amp'
231
- ),
232
- validationErrors.length
233
- );
234
  }
235
  } catch ( e ) {
236
  // Clear out block validation errors in case the block sand errors cannot be aligned.
237
  module.resetBlockNotices();
238
 
239
- noticeMessage += ' ' + wp.i18n._n(
240
- 'It may not be due to content here.',
241
- 'Some may be due to content here.',
242
- validationErrors.length,
243
- 'amp'
244
- );
245
  }
246
 
247
  rejectedErrors = _.filter( ampValidity.results, function( result ) {
@@ -300,8 +294,7 @@ var ampBlockValidation = ( function() { // eslint-disable-line no-unused-vars
300
  }
301
 
302
  return (
303
- module.lastStates.validationErrors.length !== validationErrors.length
304
- ||
305
  ( validationErrors && ! _.isEqual( module.lastStates.validationErrors, validationErrors ) )
306
  );
307
  },
195
  module.resetWarningNotice();
196
 
197
  noticeMessage = wp.i18n.sprintf(
198
+ /* translators: %s: number of issues */
199
  wp.i18n._n(
200
  'There is %s issue from AMP validation which needs review.',
201
  'There are %s issues from AMP validation which need review.',
213
  blockErrorCount = validationErrors.length - blockValidationErrors.other.length;
214
  if ( blockErrorCount > 0 ) {
215
  noticeMessage += ' ' + wp.i18n.sprintf(
216
+ /* translators: %s: number of block errors. */
217
  wp.i18n._n(
218
+ '%s issue is directly due to content here.',
219
+ '%s issues are directly due to content here.',
220
  blockErrorCount,
221
  'amp'
222
  ),
223
  blockErrorCount
224
  );
225
+ } else if ( validationErrors.length === 1 ) {
226
+ noticeMessage += ' ' + wp.i18n.__( 'The issue is not directly due to content here.', 'amp' );
227
  } else {
228
+ noticeMessage += ' ' + wp.i18n.__( 'The issues are not directly due to content here.', 'amp' );
 
 
 
 
 
 
 
 
229
  }
230
  } catch ( e ) {
231
  // Clear out block validation errors in case the block sand errors cannot be aligned.
232
  module.resetBlockNotices();
233
 
234
+ if ( validationErrors.length === 1 ) {
235
+ noticeMessage += ' ' + wp.i18n.__( 'The issue may not be due to content here', 'amp' );
236
+ } else {
237
+ noticeMessage += ' ' + wp.i18n.__( 'Some issues may be due to content here.', 'amp' );
238
+ }
 
239
  }
240
 
241
  rejectedErrors = _.filter( ampValidity.results, function( result ) {
294
  }
295
 
296
  return (
297
+ module.lastStates.validationErrors.length !== validationErrors.length ||
 
298
  ( validationErrors && ! _.isEqual( module.lastStates.validationErrors, validationErrors ) )
299
  );
300
  },
assets/js/amp-blocks-compiled.js CHANGED
@@ -1,167 +1 @@
1
- /******/ (function(modules) { // webpackBootstrap
2
- /******/ // The module cache
3
- /******/ var installedModules = {};
4
- /******/
5
- /******/ // The require function
6
- /******/ function __webpack_require__(moduleId) {
7
- /******/
8
- /******/ // Check if module is in cache
9
- /******/ if(installedModules[moduleId]) {
10
- /******/ return installedModules[moduleId].exports;
11
- /******/ }
12
- /******/ // Create a new module (and put it into the cache)
13
- /******/ var module = installedModules[moduleId] = {
14
- /******/ i: moduleId,
15
- /******/ l: false,
16
- /******/ exports: {}
17
- /******/ };
18
- /******/
19
- /******/ // Execute the module function
20
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
21
- /******/
22
- /******/ // Flag the module as loaded
23
- /******/ module.l = true;
24
- /******/
25
- /******/ // Return the exports of the module
26
- /******/ return module.exports;
27
- /******/ }
28
- /******/
29
- /******/
30
- /******/ // expose the modules object (__webpack_modules__)
31
- /******/ __webpack_require__.m = modules;
32
- /******/
33
- /******/ // expose the module cache
34
- /******/ __webpack_require__.c = installedModules;
35
- /******/
36
- /******/ // define getter function for harmony exports
37
- /******/ __webpack_require__.d = function(exports, name, getter) {
38
- /******/ if(!__webpack_require__.o(exports, name)) {
39
- /******/ Object.defineProperty(exports, name, {
40
- /******/ configurable: false,
41
- /******/ enumerable: true,
42
- /******/ get: getter
43
- /******/ });
44
- /******/ }
45
- /******/ };
46
- /******/
47
- /******/ // getDefaultExport function for compatibility with non-harmony modules
48
- /******/ __webpack_require__.n = function(module) {
49
- /******/ var getter = module && module.__esModule ?
50
- /******/ function getDefault() { return module['default']; } :
51
- /******/ function getModuleExports() { return module; };
52
- /******/ __webpack_require__.d(getter, 'a', getter);
53
- /******/ return getter;
54
- /******/ };
55
- /******/
56
- /******/ // Object.prototype.hasOwnProperty.call
57
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
58
- /******/
59
- /******/ // __webpack_public_path__
60
- /******/ __webpack_require__.p = "";
61
- /******/
62
- /******/ // Load entry module and return exports
63
- /******/ return __webpack_require__(__webpack_require__.s = 18);
64
- /******/ })
65
- /************************************************************************/
66
- /******/ ([
67
- /* 0 */
68
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
69
-
70
- "use strict";
71
- eval("/* harmony export (immutable) */ __webpack_exports__[\"b\"] = getMediaPlaceholder;\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = getLayoutControls;\nvar __ = wp.i18n.__;\nvar _wp$components = wp.components,\n TextControl = _wp$components.TextControl,\n SelectControl = _wp$components.SelectControl,\n Notice = _wp$components.Notice,\n Placeholder = _wp$components.Placeholder;\n\n/**\n * Display media placeholder.\n *\n * @param {string} name Block's name.\n * @param {string|boolean} url URL.\n * @return {XML} Placeholder.\n */\n\nfunction getMediaPlaceholder(name, url) {\n\treturn wp.element.createElement(\n\t\tPlaceholder,\n\t\t{ label: name },\n\t\twp.element.createElement(\n\t\t\t\"p\",\n\t\t\t{ className: \"components-placeholder__error\" },\n\t\t\turl\n\t\t),\n\t\twp.element.createElement(\n\t\t\t\"p\",\n\t\t\t{ className: \"components-placeholder__error\" },\n\t\t\t__('Previews for this are unavailable in the editor, sorry!', 'amp')\n\t\t)\n\t);\n}\n\n/**\n * Layout controls for AMP blocks' attributes: layout, width, height.\n *\n * @param {Object} props Props.\n * @param {Array} ampLayoutOptions Layout options.\n * @return {[XML,*,XML,*,XML]} Controls.\n */\nfunction getLayoutControls(props, ampLayoutOptions) {\n\t// @todo Move getting ampLayoutOptions to utils as well.\n\tvar attributes = props.attributes,\n\t setAttributes = props.setAttributes;\n\tvar ampLayout = attributes.ampLayout,\n\t height = attributes.height,\n\t width = attributes.width;\n\n\tvar showHeightNotice = !height && ('fixed' === ampLayout || 'fixed-height' === ampLayout);\n\tvar showWidthNotice = !width && 'fixed' === ampLayout;\n\n\treturn [wp.element.createElement(SelectControl, {\n\t\tkey: \"ampLayout\",\n\t\tlabel: __('Layout', 'amp'),\n\t\tvalue: ampLayout,\n\t\toptions: ampLayoutOptions,\n\t\tonChange: function onChange(value) {\n\t\t\treturn setAttributes({ ampLayout: value });\n\t\t}\n\t}), showWidthNotice && wp.element.createElement(\n\t\tNotice,\n\t\t{ key: \"showWidthNotice\", status: \"error\", isDismissible: false },\n\t\twp.i18n.sprintf(\n\t\t/* translators: %s is the layout name */\n\t\t__('Width is required for %s layout', 'amp'), ampLayout)\n\t), wp.element.createElement(TextControl, {\n\t\tkey: \"width\",\n\t\ttype: \"number\",\n\t\tlabel: __('Width (px)', 'amp'),\n\t\tvalue: width !== undefined ? width : '',\n\t\tonChange: function onChange(value) {\n\t\t\treturn setAttributes({ width: value });\n\t\t}\n\t}), showHeightNotice && wp.element.createElement(\n\t\tNotice,\n\t\t{ key: \"showHeightNotice\", status: \"error\", isDismissible: false },\n\t\twp.i18n.sprintf(\n\t\t/* translators: %s is the layout name */\n\t\t__('Height is required for %s layout', 'amp'), ampLayout)\n\t), wp.element.createElement(TextControl, {\n\t\tkey: \"height\",\n\t\ttype: \"number\",\n\t\tlabel: __('Height (px)', 'amp'),\n\t\tvalue: height,\n\t\tonChange: function onChange(value) {\n\t\t\treturn setAttributes({ height: value });\n\t\t}\n\t})];\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2Jsb2Nrcy91dGlscy5qcz8wOGNiIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBfXyA9IHdwLmkxOG4uX187XG52YXIgX3dwJGNvbXBvbmVudHMgPSB3cC5jb21wb25lbnRzLFxuICAgIFRleHRDb250cm9sID0gX3dwJGNvbXBvbmVudHMuVGV4dENvbnRyb2wsXG4gICAgU2VsZWN0Q29udHJvbCA9IF93cCRjb21wb25lbnRzLlNlbGVjdENvbnRyb2wsXG4gICAgTm90aWNlID0gX3dwJGNvbXBvbmVudHMuTm90aWNlLFxuICAgIFBsYWNlaG9sZGVyID0gX3dwJGNvbXBvbmVudHMuUGxhY2Vob2xkZXI7XG5cbi8qKlxuICogRGlzcGxheSBtZWRpYSBwbGFjZWhvbGRlci5cbiAqXG4gKiBAcGFyYW0ge3N0cmluZ30gbmFtZSBCbG9jaydzIG5hbWUuXG4gKiBAcGFyYW0ge3N0cmluZ3xib29sZWFufSB1cmwgVVJMLlxuICogQHJldHVybiB7WE1MfSBQbGFjZWhvbGRlci5cbiAqL1xuXG5leHBvcnQgZnVuY3Rpb24gZ2V0TWVkaWFQbGFjZWhvbGRlcihuYW1lLCB1cmwp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* 18 */
92
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
93
-
94
- "use strict";
95
- eval("Object.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__amp_mathml__ = __webpack_require__(19);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__amp_timeago__ = __webpack_require__(20);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__amp_o2_player__ = __webpack_require__(22);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__amp_ooyala_player__ = __webpack_require__(23);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__amp_reach_player__ = __webpack_require__(24);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__amp_springboard_player__ = __webpack_require__(25);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__amp_jwplayer__ = __webpack_require__(26);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__amp_brid_player__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__amp_ima_video__ = __webpack_require__(28);\n/**\n * Import blocks.\n */\n\n\n\n\n\n\n\n\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ibG9ja3MvaW5kZXguanM/ODE5MyJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEltcG9ydCBibG9ja3MuXG4gKi9cbmltcG9ydCAnLi9hbXAtbWF0aG1sJztcbmltcG9ydCAnLi9hbXAtdGltZWFnbyc7XG5pbXBvcnQgJy4vYW1wLW8yLXBsYXllcic7XG5pbXBvcnQgJy4vYW1wLW9veWFsYS1wbGF5ZXInO1xuaW1wb3J0ICcuL2FtcC1yZWFjaC1wbGF5ZXInO1xuaW1wb3J0ICcuL2FtcC1zcHJpbmdib2FyZC1wbGF5ZXInO1xuaW1wb3J0ICcuL2FtcC1qd3BsYXllcic7XG5pbXBvcnQgJy4vYW1wLWJyaWQtcGxheWVyJztcbmltcG9ydCAnLi9hbXAtaW1hLXZpZGVvJztcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL2Jsb2Nrcy9pbmRleC5qc1xuLy8gbW9kdWxlIGlkID0gMThcbi8vIG1vZHVsZSBjaHVua3MgPSAxIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///18\n");
96
-
97
- /***/ }),
98
- /* 19 */
99
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
100
-
101
- "use strict";
102
- eval("\n/**\n * Internal block libraries.\n */\nvar __ = wp.i18n.__;\nvar registerBlockType = wp.blocks.registerBlockType;\nvar PlainText = wp.editor.PlainText;\n\n/**\n * Register block.\n */\n\n/* unused harmony default export */ var _unused_webpack_default_export = (registerBlockType('amp/amp-mathml', {\n\ttitle: __('AMP MathML', 'amp'),\n\tcategory: 'common',\n\ticon: 'welcome-learn-more',\n\tkeywords: [__('Mathematical formula', 'amp'), __('Scientific content ', 'amp')],\n\n\tattributes: {\n\t\tdataFormula: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-mathml',\n\t\t\tattribute: 'data-formula'\n\t\t}\n\t},\n\n\tedit: function edit(_ref) {\n\t\tvar attributes = _ref.attributes,\n\t\t setAttributes = _ref.setAttributes;\n\t\tvar dataFormula = attributes.dataFormula;\n\n\n\t\treturn wp.element.createElement(PlainText, {\n\t\t\tkey: 'formula',\n\t\t\tvalue: dataFormula,\n\t\t\tplaceholder: __('Insert formula', 'amp'),\n\t\t\tonChange: function onChange(value) {\n\t\t\t\treturn setAttributes({ dataFormula: value });\n\t\t\t}\n\t\t});\n\t},\n\tsave: function save(_ref2) {\n\t\tvar attributes = _ref2.attributes;\n\n\t\tvar mathmlProps = {\n\t\t\t'data-formula': attributes.dataFormula,\n\t\t\tlayout: 'container'\n\t\t};\n\t\treturn wp.element.createElement('amp-mathml', mathmlProps);\n\t}\n}));//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ibG9ja3MvYW1wLW1hdGhtbC9pbmRleC5qcz9iYWYyIl0sInNvdXJjZXNDb250ZW50IjpbIlxuLyoqXG4gKiBJbnRlcm5hbCBibG9jayBsaWJyYXJpZXMuXG4gKi9cbnZhciBfXyA9IHdwLmkxOG4uX187XG52YXIgcmVnaXN0ZXJCbG9ja1R5cGUgPSB3cC5ibG9ja3MucmVnaXN0ZXJCbG9ja1R5cGU7XG52YXIgUGxhaW5UZXh0ID0gd3AuZWRpdG9yLlBsYWluVGV4dDtcblxuLyoqXG4gKiBSZWdpc3RlciBibG9jay5cbiAqL1xuXG5leHBvcnQgZGVmYXVsdCByZWdpc3RlckJsb2NrVHlwZSgnYW1wL2FtcC1tYXRobWwnLCB7XG5cdHRpdGxlOiBfXygnQU1QIE1hdGhNTCcsICdhbXAnKSxcblx0Y2F0ZWdvcnk6ICdjb21tb24nLFxuXHRpY29uOiAnd2VsY29tZS1sZWFybi1tb3JlJyxcblx0a2V5d29yZHM6IFtfXygnTWF0aGVtYXRpY2FsIGZvcm11bGEnLCAnYW1wJyksIF9fKCdTY2llbnRpZmljIGNvbnRlbnQgJywgJ2FtcCcpXSxcblxuXHRhdHRyaWJ1dGVzOiB7XG5cdFx0ZGF0YUZvcm11bGE6IHtcblx0XHRcdHNvdXJjZTogJ2F0dHJpYnV0ZScsXG5cdFx0XHRzZWxlY3RvcjogJ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sgRk9PVEVSXG4vLyAuL2Jsb2Nrcy9hbXAtbWF0aG1sL2luZGV4LmpzXG4vLyBtb2R1bGUgaWQgPSAxOVxuLy8gbW9kdWxlIGNodW5rcyA9IDEiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///19\n");
103
-
104
- /***/ }),
105
- /* 20 */
106
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
107
-
108
- "use strict";
109
- eval("/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_js__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_timeago_js__ = __webpack_require__(21);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_timeago_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_timeago_js__);\n/* global moment */\n\n/**\n * Helper methods for blocks.\n */\n\n\n/**\n * Internal block libraries.\n */\nvar __ = wp.i18n.__;\nvar registerBlockType = wp.blocks.registerBlockType;\nvar _wp$editor = wp.editor,\n InspectorControls = _wp$editor.InspectorControls,\n BlockAlignmentToolbar = _wp$editor.BlockAlignmentToolbar,\n BlockControls = _wp$editor.BlockControls;\nvar _wp$components = wp.components,\n DateTimePicker = _wp$components.DateTimePicker,\n PanelBody = _wp$components.PanelBody,\n TextControl = _wp$components.TextControl;\nvar Fragment = wp.element.Fragment;\n\n\n\n/**\n * Register block.\n */\n/* unused harmony default export */ var _unused_webpack_default_export = (registerBlockType('amp/amp-timeago', {\n\ttitle: __('AMP Timeago'),\n\tcategory: 'common',\n\ticon: 'backup',\n\tkeywords: [__('Time difference'), __('Time ago'), __('Date')],\n\n\tattributes: {\n\t\talign: {\n\t\t\ttype: 'string'\n\t\t},\n\t\tcutoff: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-timeago',\n\t\t\tattribute: 'cutoff'\n\t\t},\n\t\tdateTime: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-timeago',\n\t\t\tattribute: 'datetime'\n\t\t},\n\t\tampLayout: {\n\t\t\tdefault: 'fixed-height',\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-timeago',\n\t\t\tattribute: 'layout'\n\t\t},\n\t\twidth: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-timeago',\n\t\t\tattribute: 'width'\n\t\t},\n\t\theight: {\n\t\t\tdefault: 20,\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-timeago',\n\t\t\tattribute: 'height'\n\t\t}\n\t},\n\n\tgetEditWrapperProps: function getEditWrapperProps(attributes) {\n\t\tvar align = attributes.align;\n\n\t\tif ('left' === align || 'right' === align || 'center' === align) {\n\t\t\treturn { 'data-align': align };\n\t\t}\n\t},\n\tedit: function edit(props) {\n\t\tvar attributes = props.attributes,\n\t\t setAttributes = props.setAttributes;\n\t\tvar align = attributes.align,\n\t\t cutoff = attributes.cutoff;\n\n\t\tvar timeAgo = void 0;\n\t\tif (attributes.dateTime) {\n\t\t\tif (attributes.cutoff && parseInt(attributes.cutoff) < Math.abs(moment(attributes.dateTime).diff(moment(), 'seconds'))) {\n\t\t\t\ttimeAgo = moment(attributes.dateTime).format('dddd D MMMM HH:mm');\n\t\t\t} else {\n\t\t\t\ttimeAgo = __WEBPACK_IMPORTED_MODULE_1_timeago_js___default()().format(attributes.dateTime);\n\t\t\t}\n\t\t} else {\n\t\t\ttimeAgo = __WEBPACK_IMPORTED_MODULE_1_timeago_js___default()().format(new Date());\n\t\t\tsetAttributes({ dateTime: moment(moment(), moment.ISO_8601, true).format() });\n\t\t}\n\n\t\tvar ampLayoutOptions = [{ value: '', label: __('Responsive', 'amp') }, { value: 'fixed', label: __('Fixed', 'amp') }, { value: 'fixed-height', label: __('Fixed height', 'amp') }];\n\n\t\treturn wp.element.createElement(\n\t\t\tFragment,\n\t\t\tnull,\n\t\t\twp.element.createElement(\n\t\t\t\tInspectorControls,\n\t\t\t\t{ key: 'inspector' },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\tPanelBody,\n\t\t\t\t\t{ title: __('AMP Timeago Settings') },\n\t\t\t\t\twp.element.createElement(DateTimePicker, {\n\t\t\t\t\t\tlocale: 'en',\n\t\t\t\t\t\tcurrentDate: attributes.dateTime || moment(),\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dateTime: moment(value, moment.ISO_8601, true).format() });\n\t\t\t\t\t\t} // eslint-disable-line\n\t\t\t\t\t}),\n\t\t\t\t\tObject(__WEBPACK_IMPORTED_MODULE_0__utils_js__[\"a\" /* getLayoutControls */])(props, ampLayoutOptions),\n\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\tclassName: 'blocks-amp-timeout__cutoff',\n\t\t\t\t\t\tlabel: __('Cutoff (seconds)'),\n\t\t\t\t\t\tvalue: cutoff !== undefined ? cutoff : '',\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ cutoff: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t),\n\t\t\twp.element.createElement(\n\t\t\t\tBlockControls,\n\t\t\t\t{ key: 'controls' },\n\t\t\t\twp.element.createElement(BlockAlignmentToolbar, {\n\t\t\t\t\tvalue: align,\n\t\t\t\t\tonChange: function onChange(nextAlign) {\n\t\t\t\t\t\tsetAttributes({ align: nextAlign });\n\t\t\t\t\t},\n\t\t\t\t\tcontrols: ['left', 'center', 'right']\n\t\t\t\t})\n\t\t\t),\n\t\t\twp.element.createElement(\n\t\t\t\t'time',\n\t\t\t\t{ key: 'timeago', dateTime: attributes.dateTime },\n\t\t\t\ttimeAgo\n\t\t\t)\n\t\t);\n\t},\n\tsave: function save(_ref) {\n\t\tvar attributes = _ref.attributes;\n\n\t\tvar timeagoProps = {\n\t\t\tlayout: 'responsive',\n\t\t\tclassName: 'align' + (attributes.align || 'none'),\n\t\t\tdatetime: attributes.dateTime,\n\t\t\tlocale: 'en'\n\t\t};\n\t\tif (attributes.cutoff) {\n\t\t\ttimeagoProps.cutoff = attributes.cutoff;\n\t\t}\n\t\tif (attributes.ampLayout) {\n\t\t\tswitch (attributes.ampLayout) {\n\t\t\t\tcase 'fixed-height':\n\t\t\t\t\tif (attributes.height) {\n\t\t\t\t\t\ttimeagoProps.height = attributes.height;\n\t\t\t\t\t\ttimeagoProps.layout = attributes.ampLayout;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'fixed':\n\t\t\t\t\tif (attributes.height && attributes.width) {\n\t\t\t\t\t\ttimeagoProps.height = attributes.height;\n\t\t\t\t\t\ttimeagoProps.width = attributes.width;\n\t\t\t\t\t\ttimeagoProps.layout = attributes.ampLayout;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn wp.element.createElement(\n\t\t\t'amp-timeago',\n\t\t\ttimeagoProps,\n\t\t\tmoment(attributes.dateTime).format('dddd D MMMM HH:mm')\n\t\t);\n\t}\n}));//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ibG9ja3MvYW1wLXRpbWV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DQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///20\n");
110
-
111
- /***/ }),
112
- /* 21 */
113
- /***/ (function(module, exports) {
114
-
115
- eval("!function(t,e){\"object\"==typeof module&&module.exports?(module.exports=e(),module.exports.default=module.exports):t.timeago=e()}(\"undefined\"!=typeof window?window:this,function(){function t(t){return t instanceof Date?t:isNaN(t)?/^\\d+$/.test(t)?new Date(e(t)):(t=(t||\"\").trim().replace(/\\.\\d+/,\"\").replace(/-/,\"/\").replace(/-/,\"/\").replace(/(\\d)T(\\d)/,\"$1 $2\").replace(/Z/,\" UTC\").replace(/([\\+\\-]\\d\\d)\\:?(\\d\\d)/,\" $1$2\"),new Date(t)):new Date(e(t))}function e(t){return parseInt(t)}function n(t,n,r){n=l[n]?n:l[r]?r:\"en\";for(var o=0,i=t<0?1:0,a=t=Math.abs(t);t>=p[o]&&o<h;o++)t/=p[o];return t=e(t),o*=2,t>(0===o?9:1)&&(o+=1),l[n](t,o,a)[i].replace(\"%s\",t)}function r(e,n){return((n=n?t(n):new Date)-t(e))/1e3}function o(t){for(var e=1,n=0,r=Math.abs(t);t>=p[n]&&n<h;n++)t/=p[n],e*=p[n];return r%=e,r=r?e-r:e,Math.ceil(r)}function i(t){return a(t,\"data-timeago\")||a(t,\"datetime\")}function a(t,e){return t.getAttribute?t.getAttribute(e):t.attr?t.attr(e):void 0}function u(t,e){return t.setAttribute?t.setAttribute(m,e):t.attr?t.attr(m,e):void 0}function c(t,e){this.nowDate=t,this.defaultLocale=e||\"en\"}function d(t,e){return new c(t,e)}var f=\"second_minute_hour_day_week_month_year\".split(\"_\"),s=\"秒_分钟_小时_天_周_月_年\".split(\"_\"),l={en:function(t,e){if(0===e)return[\"just now\",\"right now\"];var n=f[parseInt(e/2)];return t>1&&(n+=\"s\"),[t+\" \"+n+\" ago\",\"in \"+t+\" \"+n]},zh_CN:function(t,e){if(0===e)return[\"刚刚\",\"片刻后\"];var n=s[parseInt(e/2)];return[t+n+\"前\",t+n+\"后\"]}},p=[60,60,24,7,365/7/12,12],h=6,m=\"data-tid\",w={};return c.prototype.doRender=function(t,e,i){var a,c=r(e,this.nowDate),d=this;t.innerHTML=n(c,i,this.defaultLocale),w[a=setTimeout(function(){d.doRender(t,e,i),delete w[a]},Math.min(1e3*o(c),2147483647))]=0,u(t,a)},c.prototype.format=function(t,e){return n(r(t,this.nowDate),e,this.defaultLocale)},c.prototype.render=function(t,e){void 0===t.length&&(t=[t]);for(var n=0,r=t.length;n<r;n++)this.doRender(t[n],i(t[n]),e)},c.prototype.setLocale=function(t){this.defaultLocale=t},d.register=function(t,e){l[t]=e},d.cancel=function(t){var e;if(t)(e=a(t,m))&&(clearTimeout(e),delete w[e]);else{for(e in w)clearTimeout(e);w={}}},d});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvdGltZWFnby5qcy9kaXN0L3RpbWVhZ28ubWluLmpzP2YwMGQiXSwic291cmNlc0NvbnRlbnQiOlsiIWZ1bmN0aW9uKHQsZSl7XCJvYmplY3RcIj09dHlwZW9mIG1vZHVsZSYmbW9kdWxlLmV4cG9ydHM/KG1vZHVsZS5leHBvcnRzPWUoKSxtb2R1bGUuZXhwb3J0cy5kZWZhdWx0PW1vZHVsZS5leHBvcnRzKTp0LnRpbWVhZ289ZSgpfShcInVuZGVmaW5lZFwiIT10eXBlb2Ygd2luZG93P3dpbmRvdzp0aGlzLGZ1bmN0aW9uKCl7ZnVuY3Rpb24gdCh0KXtyZXR1cm4gdCBpbnN0YW5jZW9mIERhdGU/dDppc05hTih0KT8vXlxcZCskLy50ZXN0KHQpP25ldyBEYX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Upe3JldHVybiBuKHIodCx0aGlzLm5vd0RhdGUpLGUsdGhpcy5kZWZhdWx0TG9jYWxlKX0sYy5wcm90b3R5cGUucmVuZGVyPWZ1bmN0aW9uKHQsZSl7dm9pZCAwPT09dC5sZW5ndGgmJih0PVt0XSk7Zm9yKHZhciBuPTAscj10Lmxlbmd0aDtuPHI7bisrKXRoaXMuZG9SZW5kZXIodFtuXSxpKHRbbl0pLGUpfSxjLnByb3RvdHlwZS5zZXRMb2NhbGU9ZnVuY3Rpb24odCl7dGhpcy5kZWZhdWx0TG9jYWxlPXR9LGQucmVnaXN0ZXI9ZnVuY3Rpb24odCxlKXtsW3RdPWV9LGQuY2FuY2VsPWZ1bmN0aW9uKHQpe3ZhciBlO2lmKHQpKGU9YSh0LG0pKSYmKGNsZWFyVGltZW91dChlKSxkZWxldGUgd1tlXSk7ZWxzZXtmb3IoZSBpbiB3KWNsZWFyVGltZW91dChlKTt3PXt9fX0sZH0pO1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL3RpbWVhZ28uanMvZGlzdC90aW1lYWdvLm1pbi5qc1xuLy8gbW9kdWxlIGlkID0gMjFcbi8vIG1vZHVsZSBjaHVua3MgPSAxIl0sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///21\n");
116
-
117
- /***/ }),
118
- /* 22 */
119
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
120
-
121
- "use strict";
122
- eval("/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_js__ = __webpack_require__(0);\n/**\n * Helper methods for blocks.\n */\n\n\n/**\n * Internal block libraries.\n */\nvar __ = wp.i18n.__;\nvar registerBlockType = wp.blocks.registerBlockType;\nvar InspectorControls = wp.editor.InspectorControls;\nvar Fragment = wp.element.Fragment;\nvar _wp$components = wp.components,\n PanelBody = _wp$components.PanelBody,\n TextControl = _wp$components.TextControl,\n Placeholder = _wp$components.Placeholder,\n ToggleControl = _wp$components.ToggleControl;\n\n/**\n * Register block.\n */\n\n/* unused harmony default export */ var _unused_webpack_default_export = (registerBlockType('amp/amp-o2-player', {\n\ttitle: __('AMP O2 Player', 'amp'),\n\tcategory: 'embed',\n\ticon: 'embed-generic',\n\tkeywords: [__('Embed', 'amp'), __('AOL O2Player', 'amp')],\n\n\t// @todo Add other useful macro toggles, e.g. showing relevant content.\n\tattributes: {\n\t\tdataPid: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-o2-player',\n\t\t\tattribute: 'data-pid'\n\t\t},\n\t\tdataVid: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-o2-player',\n\t\t\tattribute: 'data-vid'\n\t\t},\n\t\tdataBcid: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-o2-player',\n\t\t\tattribute: 'data-bcid'\n\t\t},\n\t\tdataBid: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-o2-player',\n\t\t\tattribute: 'data-bid'\n\t\t},\n\t\tautoPlay: {\n\t\t\tdefault: false\n\t\t},\n\t\tampLayout: {\n\t\t\tdefault: 'responsive',\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-o2-player',\n\t\t\tattribute: 'layout'\n\t\t},\n\t\twidth: {\n\t\t\tdefault: 600,\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-o2-player',\n\t\t\tattribute: 'width'\n\t\t},\n\t\theight: {\n\t\t\tdefault: 400,\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-o2-player',\n\t\t\tattribute: 'height'\n\t\t}\n\t},\n\n\tedit: function edit(props) {\n\t\tvar attributes = props.attributes,\n\t\t setAttributes = props.setAttributes;\n\t\tvar autoPlay = attributes.autoPlay,\n\t\t dataPid = attributes.dataPid,\n\t\t dataVid = attributes.dataVid,\n\t\t dataBcid = attributes.dataBcid,\n\t\t dataBid = attributes.dataBid;\n\n\t\tvar ampLayoutOptions = [{ value: 'responsive', label: __('Responsive', 'amp') }, { value: 'fixed-height', label: __('Fixed height', 'amp') }, { value: 'fixed', label: __('Fixed', 'amp') }, { value: 'fill', label: __('Fill', 'amp') }, { value: 'flex-item', label: __('Flex-item', 'amp') }, { value: 'nodisplay', label: __('No Display', 'amp') }];\n\t\tvar url = false;\n\t\tif (dataPid && (dataBcid || dataVid)) {\n\t\t\turl = 'https://delivery.vidible.tv/htmlembed/pid=' + dataPid + '/';\n\t\t}\n\t\treturn wp.element.createElement(\n\t\t\tFragment,\n\t\t\tnull,\n\t\t\twp.element.createElement(\n\t\t\t\tInspectorControls,\n\t\t\t\t{ key: 'inspector' },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\tPanelBody,\n\t\t\t\t\t{ title: __('O2 Player Settings', 'amp') },\n\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\tlabel: __('Player ID (required)', 'amp'),\n\t\t\t\t\t\tvalue: dataPid,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataPid: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\tlabel: __('Buyer Company ID (either buyer or video ID is required)', 'amp'),\n\t\t\t\t\t\tvalue: dataBcid,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataBcid: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\tlabel: __('Video ID (either buyer or video ID is required)', 'amp'),\n\t\t\t\t\t\tvalue: dataVid,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataVid: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\tlabel: __('Playlist ID', 'amp'),\n\t\t\t\t\t\tvalue: dataBid,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataBid: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(ToggleControl, {\n\t\t\t\t\t\tlabel: __('Autoplay', 'amp'),\n\t\t\t\t\t\tchecked: autoPlay,\n\t\t\t\t\t\tonChange: function onChange() {\n\t\t\t\t\t\t\treturn setAttributes({ autoPlay: !autoPlay });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\tObject(__WEBPACK_IMPORTED_MODULE_0__utils_js__[\"a\" /* getLayoutControls */])(props, ampLayoutOptions)\n\t\t\t\t)\n\t\t\t),\n\t\t\turl && Object(__WEBPACK_IMPORTED_MODULE_0__utils_js__[\"b\" /* getMediaPlaceholder */])(__('O2 Player', 'amp'), url),\n\t\t\t!url && wp.element.createElement(\n\t\t\t\tPlaceholder,\n\t\t\t\t{ label: __('O2 Player', 'amp') },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\t'p',\n\t\t\t\t\tnull,\n\t\t\t\t\t__('Add required data to use the block.', 'amp')\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t},\n\tsave: function save(_ref) {\n\t\tvar attributes = _ref.attributes;\n\n\t\tvar o2Props = {\n\t\t\tlayout: attributes.ampLayout,\n\t\t\theight: attributes.height,\n\t\t\t'data-pid': attributes.dataPid\n\t\t};\n\t\tif ('fixed-height' !== attributes.ampLayout && attributes.width) {\n\t\t\to2Props.width = attributes.width;\n\t\t}\n\t\tif (!attributes.autoPlay) {\n\t\t\to2Props['data-macros'] = 'm.playback=click';\n\t\t}\n\t\tif (attributes.dataVid) {\n\t\t\to2Props['data-vid'] = attributes.dataVid;\n\t\t} else if (attributes.dataBcid) {\n\t\t\to2Props['data-bcid'] = attributes.dataBcid;\n\t\t}\n\t\tif (attributes.dataBid) {\n\t\t\to2Props['data-bid'] = attributes.dataBid;\n\t\t}\n\t\treturn wp.element.createElement('amp-o2-player', o2Props);\n\t}\n}));//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ibG9ja3MvYW1wLW8yLXBsYXllci9pbmRleC5qcz8yMDBmIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogSGVscGVyIG1ldGhvZHMgZm9yIGJsb2Nrcy5cbiAqL1xuaW1wb3J0IHsgZ2V0TGF5b3V0Q29udHJvbHMsIGdldE1lZGlhUGxhY2Vob2xkZXIgfSBmcm9tICcuLi91dGlscy5qcyc7XG5cbi8qKlxuICogSW50ZXJuYWwgYmxvY2sgbGlicmFyaWVzLlxuICovXG52YXIgX18gPSB3cC5pMThuLl9fO1xudmFyIHJlZ2lzdGVyQmxvY2tUeXBlID0gd3AuYmxvY2tzLnJlZ2lzdGVyQmxvY2tUeXBlO1xudmFyIEluc3BlY3RvckNvbnRyb2xzID0gd3AuZWRpdG9yLkluc3BlY3RvckNvbnRyb2xzO1xudmFyIEZyYWdtZW50ID0gd3AuZWxlbWVudC5GcmFnbWVudDtcbnZhciBfd3AkY29tcG9uZW50cyA9IHdwLmNvbXBvbmVudHMsXG4gICAgUGFuZWxCb2R5ID0gX3dwJGNvbXBvbmVudHMuUGFuZWxCb2R5LFxuICAgIFRleHRDb250cm9sID0gX3dwJGNvbXBvbmVudHMuVGV4dENvbnRyb2wsXG4gICAgUGxhY2Vob2xkZXIgPSBfd3AkY29tcG9uZW50cy5QbGFjZWhvbGRlcixcbiAgICBUb2dnbGVDb250cm9sID0gX3dwJGNvbXBvbmVudHMuVG9nZ2xlQ29udHJvbDtcblxuLyoqXG4gKiBSZWdpc3RlciBibG9jay5cbiAqL1xuXG5leHBvcnQgZGVmYXVsdCByZWdpc3RlckJsb2NrVHlwZSgnYW1wL2FtcC1vMi1wbGF5ZXInLCB7XG5cdHRpdGxlOiBfXygnQU1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O0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///22\n");
123
-
124
- /***/ }),
125
- /* 23 */
126
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
127
-
128
- "use strict";
129
- eval("/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_js__ = __webpack_require__(0);\n/**\n * Helper methods for blocks.\n */\n\n\n/**\n * Internal block libraries.\n */\nvar __ = wp.i18n.__;\nvar registerBlockType = wp.blocks.registerBlockType;\nvar InspectorControls = wp.editor.InspectorControls;\nvar Fragment = wp.element.Fragment;\nvar _wp$components = wp.components,\n PanelBody = _wp$components.PanelBody,\n TextControl = _wp$components.TextControl,\n SelectControl = _wp$components.SelectControl,\n Placeholder = _wp$components.Placeholder;\n\n/**\n * Register block.\n */\n\n/* unused harmony default export */ var _unused_webpack_default_export = (registerBlockType('amp/amp-ooyala-player', {\n\ttitle: __('AMP Ooyala Player', 'amp'),\n\tdescription: __('Displays an Ooyala video.', 'amp'),\n\tcategory: 'embed',\n\ticon: 'embed-generic',\n\tkeywords: [__('Embed', 'amp'), __('Ooyala video', 'amp')],\n\n\t// @todo Add data-config attribute?\n\tattributes: {\n\t\tdataEmbedCode: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-ooyala-player',\n\t\t\tattribute: 'data-embedcode'\n\t\t},\n\t\tdataPlayerId: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-ooyala-player',\n\t\t\tattribute: 'data-playerid'\n\t\t},\n\t\tdataPcode: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-ooyala-player',\n\t\t\tattribute: 'data-pcode'\n\t\t},\n\t\tdataPlayerVersion: {\n\t\t\tdefault: 'v3',\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-ooyala-player',\n\t\t\tattribute: 'data-playerversion'\n\t\t},\n\t\tampLayout: {\n\t\t\tdefault: 'responsive',\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-ooyala-player',\n\t\t\tattribute: 'layout'\n\t\t},\n\t\twidth: {\n\t\t\tdefault: 600,\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-ooyala-player',\n\t\t\tattribute: 'width'\n\t\t},\n\t\theight: {\n\t\t\tdefault: 400,\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-ooyala-player',\n\t\t\tattribute: 'height'\n\t\t}\n\t},\n\n\tedit: function edit(props) {\n\t\tvar attributes = props.attributes,\n\t\t setAttributes = props.setAttributes;\n\t\tvar dataEmbedCode = attributes.dataEmbedCode,\n\t\t dataPlayerId = attributes.dataPlayerId,\n\t\t dataPcode = attributes.dataPcode,\n\t\t dataPlayerVersion = attributes.dataPlayerVersion;\n\n\t\tvar ampLayoutOptions = [{ value: 'responsive', label: __('Responsive', 'amp') }, { value: 'fixed', label: __('Fixed', 'amp') }, { value: 'fill', label: __('Fill', 'amp') }, { value: 'flex-item', label: __('Flex-item', 'amp') }];\n\t\tvar url = false;\n\t\tif (dataEmbedCode && dataPlayerId && dataPcode) {\n\t\t\turl = 'http://cf.c.ooyala.com/' + dataEmbedCode;\n\t\t}\n\t\treturn wp.element.createElement(\n\t\t\tFragment,\n\t\t\tnull,\n\t\t\twp.element.createElement(\n\t\t\t\tInspectorControls,\n\t\t\t\t{ key: 'inspector' },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\tPanelBody,\n\t\t\t\t\t{ title: __('Ooyala settings', 'amp') },\n\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\tlabel: __('Video embed code (required)', 'amp'),\n\t\t\t\t\t\tvalue: dataEmbedCode,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataEmbedCode: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\tlabel: __('Player ID (required)', 'amp'),\n\t\t\t\t\t\tvalue: dataPlayerId,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataPlayerId: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\tlabel: __('Provider code for the account (required)', 'amp'),\n\t\t\t\t\t\tvalue: dataPcode,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataPcode: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(SelectControl, {\n\t\t\t\t\t\tlabel: __('Player version', 'amp'),\n\t\t\t\t\t\tvalue: dataPlayerVersion,\n\t\t\t\t\t\toptions: [{ value: 'v3', label: __('V3', 'amp') }, { value: 'v4', label: __('V4', 'amp') }],\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataPlayerVersion: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\tObject(__WEBPACK_IMPORTED_MODULE_0__utils_js__[\"a\" /* getLayoutControls */])(props, ampLayoutOptions)\n\t\t\t\t)\n\t\t\t),\n\t\t\turl && Object(__WEBPACK_IMPORTED_MODULE_0__utils_js__[\"b\" /* getMediaPlaceholder */])(__('Ooyala Player', 'amp'), url),\n\t\t\t!url && wp.element.createElement(\n\t\t\t\tPlaceholder,\n\t\t\t\t{ label: __('Ooyala Player', 'amp') },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\t'p',\n\t\t\t\t\tnull,\n\t\t\t\t\t__('Add required data to use the block.', 'amp')\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t},\n\tsave: function save(_ref) {\n\t\tvar attributes = _ref.attributes;\n\t\tvar dataEmbedCode = attributes.dataEmbedCode,\n\t\t dataPlayerId = attributes.dataPlayerId,\n\t\t dataPcode = attributes.dataPcode,\n\t\t dataPlayerVersion = attributes.dataPlayerVersion,\n\t\t ampLayout = attributes.ampLayout,\n\t\t height = attributes.height,\n\t\t width = attributes.width;\n\n\n\t\tvar ooyalaProps = {\n\t\t\tlayout: ampLayout,\n\t\t\theight: height,\n\t\t\t'data-embedcode': dataEmbedCode,\n\t\t\t'data-playerid': dataPlayerId,\n\t\t\t'data-pcode': dataPcode,\n\t\t\t'data-playerversion': dataPlayerVersion\n\t\t};\n\t\tif ('fixed-height' !== ampLayout && width) {\n\t\t\tooyalaProps.width = width;\n\t\t}\n\t\treturn wp.element.createElement('amp-ooyala-player', ooyalaProps);\n\t}\n}));//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ibG9ja3MvYW1wLW9veWFsYS1wbGF5ZXIvaW5kZXguanM/NTZkZSJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEhlbHBlciBtZXRob2RzIGZvciBibG9ja3MuXG4gKi9cbmltcG9ydCB7IGdldExheW91dENvbnRyb2xzLCBnZXRNZWRpYVBsYWNlaG9sZGVyIH0gZnJvbSAnLi4vdXRpbHMuanMnO1xuXG4vKipc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TtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///23\n");
130
-
131
- /***/ }),
132
- /* 24 */
133
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
134
-
135
- "use strict";
136
- eval("/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_js__ = __webpack_require__(0);\n/**\n * Helper methods for blocks.\n */\n\n\n/**\n * Internal block libraries.\n */\nvar __ = wp.i18n.__;\nvar registerBlockType = wp.blocks.registerBlockType;\nvar InspectorControls = wp.editor.InspectorControls;\nvar Fragment = wp.element.Fragment;\nvar _wp$components = wp.components,\n PanelBody = _wp$components.PanelBody,\n TextControl = _wp$components.TextControl,\n Placeholder = _wp$components.Placeholder;\n\n/**\n * Register block.\n */\n\n/* unused harmony default export */ var _unused_webpack_default_export = (registerBlockType('amp/amp-reach-player', {\n\ttitle: __('AMP Reach Player', 'amp'),\n\tdescription: __('Displays the Reach Player configured in the Beachfront Reach platform.', 'amp'),\n\tcategory: 'embed',\n\ticon: 'embed-generic',\n\tkeywords: [__('Embed', 'amp'), __('Beachfront Reach video', 'amp')],\n\n\tattributes: {\n\t\tdataEmbedId: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-reach-player',\n\t\t\tattribute: 'data-embed-id'\n\t\t},\n\t\tampLayout: {\n\t\t\tdefault: 'fixed-height',\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-reach-player',\n\t\t\tattribute: 'layout'\n\t\t},\n\t\twidth: {\n\t\t\tdefault: 600,\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-reach-player',\n\t\t\tattribute: 'width'\n\t\t},\n\t\theight: {\n\t\t\tdefault: 400,\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-reach-player',\n\t\t\tattribute: 'height'\n\t\t}\n\t},\n\n\tedit: function edit(props) {\n\t\tvar attributes = props.attributes,\n\t\t setAttributes = props.setAttributes;\n\t\tvar dataEmbedId = attributes.dataEmbedId;\n\n\t\tvar ampLayoutOptions = [{ value: 'responsive', label: __('Responsive', 'amp') }, { value: 'fixed-height', label: __('Fixed Height', 'amp') }, { value: 'fixed', label: __('Fixed', 'amp') }, { value: 'fill', label: __('Fill', 'amp') }, { value: 'flex-item', label: __('Flex-item', 'amp') }];\n\t\tvar url = false;\n\t\tif (dataEmbedId) {\n\t\t\turl = 'https://media-cdn.beachfrontreach.com/acct_1/video/';\n\t\t}\n\t\treturn wp.element.createElement(\n\t\t\tFragment,\n\t\t\tnull,\n\t\t\twp.element.createElement(\n\t\t\t\tInspectorControls,\n\t\t\t\t{ key: 'inspector' },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\tPanelBody,\n\t\t\t\t\t{ title: __('Reach settings', 'amp') },\n\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\tlabel: __('The Reach player embed id (required)', 'amp'),\n\t\t\t\t\t\tvalue: dataEmbedId,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataEmbedId: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\tObject(__WEBPACK_IMPORTED_MODULE_0__utils_js__[\"a\" /* getLayoutControls */])(props, ampLayoutOptions)\n\t\t\t\t)\n\t\t\t),\n\t\t\turl && Object(__WEBPACK_IMPORTED_MODULE_0__utils_js__[\"b\" /* getMediaPlaceholder */])(__('Reach Player', 'amp'), url),\n\t\t\t!url && wp.element.createElement(\n\t\t\t\tPlaceholder,\n\t\t\t\t{ label: __('Reach Player', 'amp') },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\t'p',\n\t\t\t\t\tnull,\n\t\t\t\t\t__('Add Reach player embed ID to use the block.', 'amp')\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t},\n\tsave: function save(_ref) {\n\t\tvar attributes = _ref.attributes;\n\t\tvar dataEmbedId = attributes.dataEmbedId,\n\t\t ampLayout = attributes.ampLayout,\n\t\t height = attributes.height,\n\t\t width = attributes.width;\n\n\n\t\tvar reachProps = {\n\t\t\tlayout: ampLayout,\n\t\t\theight: height,\n\t\t\t'data-embed-id': dataEmbedId\n\t\t};\n\t\tif ('fixed-height' !== ampLayout && width) {\n\t\t\treachProps.width = width;\n\t\t}\n\t\treturn wp.element.createElement('amp-reach-player', reachProps);\n\t}\n}));//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-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0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///24\n");
137
-
138
- /***/ }),
139
- /* 25 */
140
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
141
-
142
- "use strict";
143
- eval("/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_js__ = __webpack_require__(0);\n/**\n * Helper methods for blocks.\n */\n\n\n/**\n * Internal block libraries.\n */\nvar __ = wp.i18n.__;\nvar registerBlockType = wp.blocks.registerBlockType;\nvar InspectorControls = wp.editor.InspectorControls;\nvar Fragment = wp.element.Fragment;\nvar _wp$components = wp.components,\n PanelBody = _wp$components.PanelBody,\n TextControl = _wp$components.TextControl,\n SelectControl = _wp$components.SelectControl,\n Placeholder = _wp$components.Placeholder;\n\n/**\n * Register block.\n */\n\n/* unused harmony default export */ var _unused_webpack_default_export = (registerBlockType('amp/amp-springboard-player', {\n\ttitle: __('AMP Springboard Player', 'amp'),\n\tdescription: __('Displays the Springboard Player used in the Springboard Video Platform', 'amp'),\n\tcategory: 'embed',\n\ticon: 'embed-generic',\n\tkeywords: [__('Embed', 'amp')],\n\n\tattributes: {\n\t\tdataSiteId: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-springboard-player',\n\t\t\tattribute: 'data-site-id'\n\t\t},\n\t\tdataContentId: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-springboard-player',\n\t\t\tattribute: 'data-content-id'\n\t\t},\n\t\tdataPlayerId: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-springboard-player',\n\t\t\tattribute: 'data-player-id'\n\t\t},\n\t\tdataDomain: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-springboard-player',\n\t\t\tattribute: 'data-domain'\n\t\t},\n\t\tdataMode: {\n\t\t\tdefault: 'video',\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-springboard-player',\n\t\t\tattribute: 'data-mode'\n\t\t},\n\t\tdataItems: {\n\t\t\tdefault: 1,\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-springboard-player',\n\t\t\tattribute: 'data-items'\n\t\t},\n\t\tampLayout: {\n\t\t\tdefault: 'responsive',\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-springboard-player',\n\t\t\tattribute: 'layout'\n\t\t},\n\t\twidth: {\n\t\t\tdefault: 600,\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-springboard-player',\n\t\t\tattribute: 'width'\n\t\t},\n\t\theight: {\n\t\t\tdefault: 400,\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-springboard-player',\n\t\t\tattribute: 'height'\n\t\t}\n\t},\n\n\tedit: function edit(props) {\n\t\tvar attributes = props.attributes,\n\t\t setAttributes = props.setAttributes;\n\t\tvar dataSiteId = attributes.dataSiteId,\n\t\t dataPlayerId = attributes.dataPlayerId,\n\t\t dataContentId = attributes.dataContentId,\n\t\t dataDomain = attributes.dataDomain,\n\t\t dataMode = attributes.dataMode,\n\t\t dataItems = attributes.dataItems;\n\n\t\tvar ampLayoutOptions = [{ value: 'responsive', label: __('Responsive', 'amp') }, { value: 'fixed', label: __('Fixed', 'amp') }, { value: 'fill', label: __('Fill', 'amp') }, { value: 'flex-item', label: __('Flex-item', 'amp') }];\n\t\tvar url = false;\n\t\tif (dataSiteId && dataContentId && dataDomain && dataMode && dataItems) {\n\t\t\turl = 'https://cms.springboardplatform.com/embed_iframe/';\n\t\t}\n\t\treturn wp.element.createElement(\n\t\t\tFragment,\n\t\t\tnull,\n\t\t\twp.element.createElement(\n\t\t\t\tInspectorControls,\n\t\t\t\t{ key: 'inspector' },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\tPanelBody,\n\t\t\t\t\t{ title: __('Springboard Player Settings', 'amp') },\n\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\tlabel: __('SprintBoard site ID (required)', 'amp'),\n\t\t\t\t\t\tvalue: dataSiteId,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataSiteId: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\tlabel: __('Player content ID (required)', 'amp'),\n\t\t\t\t\t\tvalue: dataContentId,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataContentId: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\tlabel: __('Player ID', 'amp'),\n\t\t\t\t\t\tvalue: dataPlayerId,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataPlayerId: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\tlabel: __('Springboard partner domain', 'amp'),\n\t\t\t\t\t\tvalue: dataDomain,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataDomain: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(SelectControl, {\n\t\t\t\t\t\tlabel: __('Mode (required)', 'amp'),\n\t\t\t\t\t\tvalue: dataMode,\n\t\t\t\t\t\toptions: [{ value: 'video', label: __('Video', 'amp') }, { value: 'playlist', label: __('Playlist', 'amp') }],\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataMode: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\tlabel: __('Number of video is playlist (required)', 'amp'),\n\t\t\t\t\t\tvalue: dataItems,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataItems: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\tObject(__WEBPACK_IMPORTED_MODULE_0__utils_js__[\"a\" /* getLayoutControls */])(props, ampLayoutOptions)\n\t\t\t\t)\n\t\t\t),\n\t\t\turl && Object(__WEBPACK_IMPORTED_MODULE_0__utils_js__[\"b\" /* getMediaPlaceholder */])(__('Springboard Player', 'amp'), url),\n\t\t\t!url && wp.element.createElement(\n\t\t\t\tPlaceholder,\n\t\t\t\t{ label: __('Springboard Player', 'amp') },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\t'p',\n\t\t\t\t\tnull,\n\t\t\t\t\t__('Add required data to use the block.', 'amp')\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t},\n\tsave: function save(_ref) {\n\t\tvar attributes = _ref.attributes;\n\t\tvar dataSiteId = attributes.dataSiteId,\n\t\t dataPlayerId = attributes.dataPlayerId,\n\t\t dataContentId = attributes.dataContentId,\n\t\t dataDomain = attributes.dataDomain,\n\t\t dataMode = attributes.dataMode,\n\t\t dataItems = attributes.dataItems,\n\t\t ampLayout = attributes.ampLayout,\n\t\t height = attributes.height,\n\t\t width = attributes.width;\n\n\t\tvar springboardProps = {\n\t\t\tlayout: ampLayout,\n\t\t\theight: height,\n\t\t\t'data-site-id': dataSiteId,\n\t\t\t'data-mode': dataMode,\n\t\t\t'data-content-id': dataContentId,\n\t\t\t'data-player-id': dataPlayerId,\n\t\t\t'data-domain': dataDomain,\n\t\t\t'data-items': dataItems\n\t\t};\n\t\tif ('fixed-height' !== ampLayout && width) {\n\t\t\tspringboardProps.width = attributes.width;\n\t\t}\n\t\treturn wp.element.createElement('amp-springboard-player', springboardProps);\n\t}\n}));//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ibG9ja3MvYW1wLXNwcmluZ2JvYXJkLXBsYXllci9pbmRleC5qcz83MmI4Il0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogSGVscGVyIG1ldGhvZHMgZm9yIGJsb2Nrcy5cbiAqL1xuaW1wb3J0IHsgZ2V0TGF5b3V0Q29udHJvbHMsIGdldE1lZGlhUGxhY2Vob2xkZXIgfSBmcm9tICcuLi91dGlscy5qcyc7XG5cbi8qKlxuICogSW50ZXJuYWwgYmxvY2sgbGlicmFyaWVzLlxuICovXG52YXIgX18gPSB3cC5pMThuLl9fO1xudmFyIHJlZ2lzdGVyQmxvY2tUeXBlID0gd3AuYmxvY2tzLnJlZ2lzdGVyQmxvY2tUeXBlO1xudmFyIEluc3BlY3RvckNvbnRyb2xzID0gd3AuZWRpdG9yLkluc3BlY3RvckNvbnRyb2xzO1xudmFyIEZyYWdtZW50ID0gd3AuZWxlbWVudC5GcmFnbWVudDtcbnZhciBfd3AkY29tcG9uZW50cyA9IHdwLmNvbXBvbmVudHMsXG4gICAgUGFuZWxCb2R5ID0gX3dwJGNvbXBvbmVudHMuUGFuZWxCb2R5LFxuICAgIFRleHRDb250cm9s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0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///25\n");
144
-
145
- /***/ }),
146
- /* 26 */
147
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
148
-
149
- "use strict";
150
- eval("/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_js__ = __webpack_require__(0);\n/**\n * Helper methods for blocks.\n */\n\n\n/**\n * Internal block libraries.\n */\nvar __ = wp.i18n.__;\nvar registerBlockType = wp.blocks.registerBlockType;\nvar InspectorControls = wp.editor.InspectorControls;\nvar Fragment = wp.element.Fragment;\nvar _wp$components = wp.components,\n PanelBody = _wp$components.PanelBody,\n TextControl = _wp$components.TextControl,\n Placeholder = _wp$components.Placeholder;\n\n/**\n * Register block.\n */\n\n/* unused harmony default export */ var _unused_webpack_default_export = (registerBlockType('amp/amp-jwplayer', {\n\ttitle: __('AMP JW Player', 'amp'),\n\tdescription: __('Displays a cloud-hosted JW Player.', 'amp'),\n\tcategory: 'embed',\n\ticon: 'embed-generic',\n\tkeywords: [__('Embed', 'amp')],\n\n\tattributes: {\n\t\tdataPlayerId: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-jwplayer',\n\t\t\tattribute: 'data-player-id'\n\t\t},\n\t\tdataMediaId: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-jwplayer',\n\t\t\tattribute: 'data-media-id'\n\t\t},\n\t\tdataPlaylistId: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-jwplayer',\n\t\t\tattribute: 'data-playlist-id'\n\t\t},\n\t\tampLayout: {\n\t\t\tdefault: 'responsive',\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-jwplayer',\n\t\t\tattribute: 'layout'\n\t\t},\n\t\twidth: {\n\t\t\tdefault: 600,\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-jwplayer',\n\t\t\tattribute: 'width'\n\t\t},\n\t\theight: {\n\t\t\tdefault: 400,\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-jwplayer',\n\t\t\tattribute: 'height'\n\t\t}\n\t},\n\n\tedit: function edit(props) {\n\t\tvar attributes = props.attributes,\n\t\t setAttributes = props.setAttributes;\n\t\tvar dataPlayerId = attributes.dataPlayerId,\n\t\t dataMediaId = attributes.dataMediaId,\n\t\t dataPlaylistId = attributes.dataPlaylistId;\n\n\t\tvar ampLayoutOptions = [{ value: 'responsive', label: __('Responsive', 'amp') }, { value: 'fixed-height', label: __('Fixed height', 'amp') }, { value: 'fixed', label: __('Fixed', 'amp') }, { value: 'fill', label: __('Fill', 'amp') }, { value: 'flex-item', label: __('Flex-item', 'amp') }, { value: 'nodisplay', label: __('No Display', 'amp') }];\n\t\tvar url = false;\n\t\tif (dataPlayerId && (dataMediaId || dataPlaylistId)) {\n\t\t\tif (dataPlaylistId) {\n\t\t\t\turl = 'https://content.jwplatform.com/players/' + dataPlaylistId + '-' + dataPlayerId;\n\t\t\t} else {\n\t\t\t\turl = 'https://content.jwplatform.com/players/' + dataMediaId + '-' + dataPlayerId;\n\t\t\t}\n\t\t}\n\t\treturn wp.element.createElement(\n\t\t\tFragment,\n\t\t\tnull,\n\t\t\twp.element.createElement(\n\t\t\t\tInspectorControls,\n\t\t\t\t{ key: 'inspector' },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\tPanelBody,\n\t\t\t\t\t{ title: __('JW Player Settings', 'amp') },\n\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\tlabel: __('Player ID (required)', 'amp'),\n\t\t\t\t\t\tvalue: dataPlayerId,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataPlayerId: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\tlabel: __('Media ID (required if playlist ID not set)', 'amp'),\n\t\t\t\t\t\tvalue: dataMediaId,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataMediaId: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\tlabel: __('Playlist ID (required if media ID not set)', 'amp'),\n\t\t\t\t\t\tvalue: dataPlaylistId,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataPlaylistId: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\tObject(__WEBPACK_IMPORTED_MODULE_0__utils_js__[\"a\" /* getLayoutControls */])(props, ampLayoutOptions)\n\t\t\t\t)\n\t\t\t),\n\t\t\turl && Object(__WEBPACK_IMPORTED_MODULE_0__utils_js__[\"b\" /* getMediaPlaceholder */])(__('JW Player', 'amp'), url),\n\t\t\t!url && wp.element.createElement(\n\t\t\t\tPlaceholder,\n\t\t\t\t{ label: __('JW Player', 'amp') },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\t'p',\n\t\t\t\t\tnull,\n\t\t\t\t\t__('Add required data to use the block.', 'amp')\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t},\n\tsave: function save(_ref) {\n\t\tvar attributes = _ref.attributes;\n\n\t\tvar jwProps = {\n\t\t\tlayout: attributes.ampLayout,\n\t\t\theight: attributes.height,\n\t\t\t'data-player-id': attributes.dataPlayerId\n\t\t};\n\t\tif ('fixed-height' !== attributes.ampLayout && attributes.width) {\n\t\t\tjwProps.width = attributes.width;\n\t\t}\n\t\tif (attributes.dataPlaylistId) {\n\t\t\tjwProps['data-playlist-id'] = attributes.dataPlaylistId;\n\t\t}\n\t\tif (attributes.dataMediaId) {\n\t\t\tjwProps['data-media-id'] = attributes.dataMediaId;\n\t\t}\n\t\treturn wp.element.createElement('amp-jwplayer', jwProps);\n\t}\n}));//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ibG9ja3MvYW1wLWp3cGxheWVyL2luZGV4LmpzP2E1ZDAiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBIZWxwZXIgbWV0aG9kcyBmb3IgYmxvY2tzLlxuICovXG5pbXBvcnQgeyBnZXRMYXlvdXRDb250cm9scywgZ2V0TWVkaWFQbGFjZWhvbGRlciB9IGZyb20gJy4uL3V0aWxzLmpzJztcblxuLyoqXG4gKiBJbnRlcm5hbCBibG9jayBsaWJyYXJpZXMuXG4gKi9cbnZhciBfXyA9IHdwLmkxOG4uX187XG52YXIgcmVnaXN0ZXJCbG9ja1R5cGUgPSB3cC5ibG9ja3MucmVnaXN0ZXJCbG9ja1R5cGU7XG52YXIgSW5zcGVjdG9yQ29udHJvbHMgPSB3cC5lZGl0b3IuSW5zcGVjdG9yQ29udHJvbHM7XG52YXIgRnJhZ21lbnQgPSB3cC5lbGVtZW50LkZyYWdtZW50O1xudmFyIF93cCRjb21wb25lbnRzID0gd3AuY29tcG9uZW50cyxcbiAgICBQYW5lbEJvZHkgPSBfd3AkY29tcG9uZW50cy5QYW5lbEJvZHksXG4gICAgVGV4dENvbnRyb2wgPSBfd3AkY29tcG9uZW50cy5UZXh0Q29udHJvbCxcbiAgICBQbGFjZWhvbGRlciA9IF93cCRjb21wb25lbnRzLlBsYWNlaG9sZGVyO1xuXG4vKipcbiAqIFJlZ2lzdGVyIGJsb2NrLlxuICovXG5cbmV4cG9ydCBkZWZhdWx0IHJlZ2lzdGVyQmxvY2tUeXBlKCdhbXAvYW1wLWp3cGxheWVyJywge1xuXHR0aXRsZTogX18oJ0FNUCBKVyBQbGF5ZXInLCAnYW1wJyksXG5cdGRlc2NyaXB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QTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///26\n");
151
-
152
- /***/ }),
153
- /* 27 */
154
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
155
-
156
- "use strict";
157
- eval("/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_js__ = __webpack_require__(0);\n/**\n * Helper methods for blocks.\n */\n\n\n/**\n * Internal block libraries.\n */\nvar __ = wp.i18n.__;\nvar registerBlockType = wp.blocks.registerBlockType;\nvar InspectorControls = wp.editor.InspectorControls;\nvar Fragment = wp.element.Fragment;\nvar _wp$components = wp.components,\n PanelBody = _wp$components.PanelBody,\n TextControl = _wp$components.TextControl,\n Placeholder = _wp$components.Placeholder,\n ToggleControl = _wp$components.ToggleControl;\n\n/**\n * Register block.\n */\n\n/* unused harmony default export */ var _unused_webpack_default_export = (registerBlockType('amp/amp-brid-player', {\n\ttitle: __('AMP Brid Player', 'amp'),\n\tdescription: __('Displays the Brid Player used in Brid.tv Video Platform.', 'amp'),\n\tcategory: 'embed',\n\ticon: 'embed-generic',\n\tkeywords: [__('Embed', 'amp')],\n\n\tattributes: {\n\t\tautoPlay: {\n\t\t\ttype: 'boolean'\n\t\t},\n\t\tdataPartner: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-brid-player',\n\t\t\tattribute: 'data-partner'\n\t\t},\n\t\tdataPlayer: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-brid-player',\n\t\t\tattribute: 'data-player'\n\t\t},\n\t\tdataVideo: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-brid-player',\n\t\t\tattribute: 'data-video'\n\t\t},\n\t\tdataPlaylist: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-brid-player',\n\t\t\tattribute: 'data-playlist'\n\t\t},\n\t\tdataOutstream: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-brid-player',\n\t\t\tattribute: 'data-outstream'\n\t\t},\n\t\tampLayout: {\n\t\t\tdefault: 'responsive',\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-brid-player',\n\t\t\tattribute: 'layout'\n\t\t},\n\t\twidth: {\n\t\t\ttype: 'number',\n\t\t\tdefault: 600\n\t\t},\n\t\theight: {\n\t\t\tdefault: 400,\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-brid-player',\n\t\t\tattribute: 'height'\n\t\t}\n\t},\n\n\tedit: function edit(props) {\n\t\tvar attributes = props.attributes,\n\t\t setAttributes = props.setAttributes;\n\t\tvar autoPlay = attributes.autoPlay,\n\t\t dataPartner = attributes.dataPartner,\n\t\t dataPlayer = attributes.dataPlayer,\n\t\t dataVideo = attributes.dataVideo,\n\t\t dataPlaylist = attributes.dataPlaylist,\n\t\t dataOutstream = attributes.dataOutstream;\n\n\t\tvar ampLayoutOptions = [{ value: 'responsive', label: __('Responsive', 'amp') }, { value: 'fixed-height', label: __('Fixed height', 'amp') }, { value: 'fixed', label: __('Fixed', 'amp') }, { value: 'fill', label: __('Fill', 'amp') }, { value: 'flex-item', label: __('Flex-item', 'amp') }, { value: 'nodisplay', label: __('No Display', 'amp') }];\n\t\tvar url = false;\n\t\tif (dataPartner && dataPlayer && (dataVideo || dataPlaylist || dataOutstream)) {\n\t\t\turl = 'http://cdn.brid.tv/live/partners/' + dataPartner;\n\t\t}\n\t\treturn wp.element.createElement(\n\t\t\tFragment,\n\t\t\tnull,\n\t\t\twp.element.createElement(\n\t\t\t\tInspectorControls,\n\t\t\t\t{ key: 'inspector' },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\tPanelBody,\n\t\t\t\t\t{ title: __('Brid Player Settings', 'amp') },\n\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\tlabel: __('Brid.tv partner ID (required)', 'amp'),\n\t\t\t\t\t\tvalue: dataPartner,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataPartner: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\tlabel: __('Brid.tv player ID (required)', 'amp'),\n\t\t\t\t\t\tvalue: dataPlayer,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataPlayer: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\tlabel: __('Video ID (one of video / playlist / outstream ID is required)', 'amp'),\n\t\t\t\t\t\tvalue: dataVideo,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataVideo: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\tlabel: __('Outstream unit ID (one of video / playlist / outstream ID is required)', 'amp'),\n\t\t\t\t\t\tvalue: dataOutstream,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataOutstream: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\tlabel: __('Playlist ID (one of video / playlist / outstream ID is required)', 'amp'),\n\t\t\t\t\t\tvalue: dataPlaylist,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataPlaylist: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(ToggleControl, {\n\t\t\t\t\t\tlabel: __('Autoplay', 'amp'),\n\t\t\t\t\t\tchecked: autoPlay,\n\t\t\t\t\t\tonChange: function onChange() {\n\t\t\t\t\t\t\treturn setAttributes({ autoPlay: !autoPlay });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\tObject(__WEBPACK_IMPORTED_MODULE_0__utils_js__[\"a\" /* getLayoutControls */])(props, ampLayoutOptions)\n\t\t\t\t)\n\t\t\t),\n\t\t\turl && Object(__WEBPACK_IMPORTED_MODULE_0__utils_js__[\"b\" /* getMediaPlaceholder */])(__('Brid Player', 'amp'), url),\n\t\t\t!url && wp.element.createElement(\n\t\t\t\tPlaceholder,\n\t\t\t\t{ label: __('Brid Player', 'amp') },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\t'p',\n\t\t\t\t\tnull,\n\t\t\t\t\t__('Add required data to use the block.', 'amp')\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t},\n\tsave: function save(_ref) {\n\t\tvar attributes = _ref.attributes;\n\n\t\tvar bridProps = {\n\t\t\tlayout: attributes.ampLayout,\n\t\t\theight: attributes.height,\n\t\t\t'data-player': attributes.dataPlayer,\n\t\t\t'data-partner': attributes.dataPartner\n\t\t};\n\t\tif ('fixed-height' !== attributes.ampLayout && attributes.width) {\n\t\t\tbridProps.width = attributes.width;\n\t\t}\n\t\tif (attributes.dataPlaylist) {\n\t\t\tbridProps['data-playlist'] = attributes.dataPlaylist;\n\t\t}\n\t\tif (attributes.dataVideo) {\n\t\t\tbridProps['data-video'] = attributes.dataVideo;\n\t\t}\n\t\tif (attributes.dataOutstream) {\n\t\t\tbridProps['data-outstream'] = attributes.dataOutstream;\n\t\t}\n\t\tif (attributes.autoPlay) {\n\t\t\tbridProps.autoplay = attributes.autoPlay;\n\t\t}\n\t\treturn wp.element.createElement('amp-brid-player', bridProps);\n\t}\n}));//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ibG9ja3MvYW1wLWJyaWQtcGxheWVyL2luZGV4LmpzPzEyYjkiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBIZWxwZXIgbWV0aG9kcyBmb3IgYmxvY2tzLlxuICovXG5pbXBvcnQgeyBnZXRMYXlvdXRDb250cm9scywgZ2V0TWVkaWFQbGFjZWhvbGRlciB9IGZyb20gJy4uL3V0aWxzLmpzJztcblxuLyoqXG4gKiBJbnRlcm5hbCBibG9jayBsaWJyYXJpZXMuXG4gKi9cbnZhciBfXyA9IHdwLmkxOG4uX187XG52YXIgcmVnaXN0ZXJCbG9ja1R5cGUgPSB3cC5ibG9ja3MucmVnaXN0ZXJCbG9ja1R5cGU7XG52YXIgSW5zcGVjdG9yQ29udHJvbHMgPSB3cC5lZGl0b3IuSW5zcGVjdG9yQ29udHJvbHM7XG52YXIgRnJhZ21lbnQgPSB3cC5lbGVtZW50LkZyYWdtZW50O1xudmFyIF93cCRjb21wb25lbnRzID0gd3AuY29tcG9uZW50cyxcbiAgICBQYW5lbEJvZHkgPSBfd3AkY29tcG9uZW50cy5QYW5lbEJvZHksXG4gICAgVGV4dENvbnRyb2wgPSBfd3AkY29tcG9uZW50cy5UZXh0Q29udHJvbCxcbiAgICBQbGFjZWhvbGRlciA9IF93cCRjb21wb25lbnRzLlBsYWNlaG9sZGVyLFxuICAgIFRvZ2dsZUNvbnRyb2wgPSBfd3AkY29tcG9uZW50cy5Ub2dnbGVDb250cm9sO1xuXG4vKipcbiAqIFJlZ2lzdGVyIGJsb2NrLlxuICovXG5cbmV4cG9ydCBkZWZhdWx0IHJlZ2lzdGVyQmxvY2tUeXBlKCdhbXAvYW1wLWJyaWQtcGxheWVyJywge1xuXHR0aXRsZTogX18o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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///27\n");
158
-
159
- /***/ }),
160
- /* 28 */
161
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
162
-
163
- "use strict";
164
- eval("/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_js__ = __webpack_require__(0);\n/**\n * Helper methods for blocks.\n */\n\n\n/**\n * Internal block libraries.\n */\nvar __ = wp.i18n.__;\nvar registerBlockType = wp.blocks.registerBlockType;\nvar InspectorControls = wp.editor.InspectorControls;\nvar Fragment = wp.element.Fragment;\nvar _wp$components = wp.components,\n PanelBody = _wp$components.PanelBody,\n TextControl = _wp$components.TextControl,\n Placeholder = _wp$components.Placeholder,\n ToggleControl = _wp$components.ToggleControl;\n\n/**\n * Register block.\n */\n\n/* unused harmony default export */ var _unused_webpack_default_export = (registerBlockType('amp/amp-ima-video', {\n\ttitle: __('AMP IMA Video', 'amp'),\n\tdescription: __('Embeds a video player for instream video ads that are integrated with the IMA SDK', 'amp'),\n\tcategory: 'embed',\n\ticon: 'embed-generic',\n\tkeywords: [__('Embed', 'amp')],\n\n\t// @todo Perhaps later add subtitles option and additional source options?\n\tattributes: {\n\t\tdataDelayAdRequest: {\n\t\t\tdefault: false,\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-ima-video',\n\t\t\tattribute: 'data-delay-ad-request'\n\t\t},\n\t\tdataTag: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-ima-video',\n\t\t\tattribute: 'data-tag'\n\t\t},\n\t\tdataSrc: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-ima-video',\n\t\t\tattribute: 'data-src'\n\t\t},\n\t\tdataPoster: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-ima-video',\n\t\t\tattribute: 'data-poster'\n\t\t},\n\t\tampLayout: {\n\t\t\tdefault: 'responsive',\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-ima-video',\n\t\t\tattribute: 'layout'\n\t\t},\n\t\twidth: {\n\t\t\tdefault: 600,\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-ima-video',\n\t\t\tattribute: 'width'\n\t\t},\n\t\theight: {\n\t\t\tdefault: 400,\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-ima-video',\n\t\t\tattribute: 'height'\n\t\t}\n\t},\n\n\tedit: function edit(props) {\n\t\tvar attributes = props.attributes,\n\t\t setAttributes = props.setAttributes;\n\t\tvar dataDelayAdRequest = attributes.dataDelayAdRequest,\n\t\t dataTag = attributes.dataTag,\n\t\t dataSrc = attributes.dataSrc,\n\t\t dataPoster = attributes.dataPoster;\n\n\t\tvar ampLayoutOptions = [{ value: 'responsive', label: __('Responsive', 'amp') }, { value: 'fixed', label: __('Fixed', 'amp') }];\n\t\tvar dataSet = false;\n\t\tif (dataTag && dataSrc) {\n\t\t\tdataSet = true;\n\t\t}\n\t\treturn wp.element.createElement(\n\t\t\tFragment,\n\t\t\tnull,\n\t\t\twp.element.createElement(\n\t\t\t\tInspectorControls,\n\t\t\t\t{ key: 'inspector' },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\tPanelBody,\n\t\t\t\t\t{ title: __('IMA Video Settings', 'amp') },\n\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\tlabel: __('Https URL for your VAST ad document (required)', 'amp'),\n\t\t\t\t\t\tvalue: dataTag,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataTag: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\tlabel: __('Https URL of your video content (required)', 'amp'),\n\t\t\t\t\t\tvalue: dataSrc,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataSrc: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\tlabel: __('Https URL to preview image', 'amp'),\n\t\t\t\t\t\tvalue: dataPoster,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataPoster: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(ToggleControl, {\n\t\t\t\t\t\tlabel: __('Delay Ad Request', 'amp'),\n\t\t\t\t\t\tchecked: dataDelayAdRequest,\n\t\t\t\t\t\tonChange: function onChange() {\n\t\t\t\t\t\t\treturn setAttributes({ dataDelayAdRequest: !dataDelayAdRequest });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\tObject(__WEBPACK_IMPORTED_MODULE_0__utils_js__[\"a\" /* getLayoutControls */])(props, ampLayoutOptions)\n\t\t\t\t)\n\t\t\t),\n\t\t\tdataSet && Object(__WEBPACK_IMPORTED_MODULE_0__utils_js__[\"b\" /* getMediaPlaceholder */])(__('IMA Video', 'amp'), dataSrc),\n\t\t\t!dataSet && wp.element.createElement(\n\t\t\t\tPlaceholder,\n\t\t\t\t{ label: __('IMA Video', 'amp') },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\t'p',\n\t\t\t\t\tnull,\n\t\t\t\t\t__('Add required data to use the block.', 'amp')\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t},\n\tsave: function save(_ref) {\n\t\tvar attributes = _ref.attributes;\n\n\t\tvar imaProps = {\n\t\t\tlayout: attributes.ampLayout,\n\t\t\theight: attributes.height,\n\t\t\twidth: attributes.width,\n\t\t\t'data-tag': attributes.dataTag,\n\t\t\t'data-src': attributes.dataSrc\n\t\t};\n\t\tif (attributes.dataPoster) {\n\t\t\timaProps['data-poster'] = attributes.dataPoster;\n\t\t}\n\t\tif (attributes.dataDelayAdRequest) {\n\t\t\timaProps['data-delay-ad-request'] = attributes.dataDelayAdRequest;\n\t\t}\n\t\treturn wp.element.createElement('amp-ima-video', imaProps);\n\t}\n}));//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ibG9ja3MvYW1wLWltYS12aWRlby9pbmRleC5qcz9kYzU1Il0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogSGVscGVyIG1ldGhvZHMgZm9yIGJsb2Nrcy5cbiAqL1xuaW1wb3J0IHsgZ2V0TGF5b3V0Q29udHJvbHMsIGdldE1lZGlhUGxhY2Vob2xkZXIgfSBmcm9tICcuLi91dGlscy5qcyc7XG5cbi8qKlxuICogSW50ZXJuYWwgYmxvY2sgbGlicmFyaWVzLlxuICovXG52YXIgX18gPSB3cC5pMThuLl9fO1xudmFyIHJlZ2lzdGVyQmxvY2tUeXBlID0gd3AuYmxvY2tzLnJlZ2lzdGVyQmxvY2tUeXBlO1xudmFyIEluc3BlY3RvckNvbnRyb2xzID0gd3AuZWRpdG9yLkluc3BlY3RvckNvbnRyb2xzO1xudmFyIEZyYWdtZW50ID0gd3AuZWxlbWVudC5GcmFnbWVudDtcbnZhciBfd3AkY29tcG9uZW50cyA9IHdwLmNvbXBvbmVudHMsXG4gICAgUGFuZW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]);
1
+ !function(t){var d={};function e(a){if(d[a])return d[a].exports;var c=d[a]={i:a,l:!1,exports:{}};return t[a].call(c.exports,c,c.exports,e),c.l=!0,c.exports}e.m=t,e.c=d,e.d=function(t,d,a){e.o(t,d)||Object.defineProperty(t,d,{enumerable:!0,get:a})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,d){if(1&d&&(t=e(t)),8&d)return t;if(4&d&&"object"==typeof t&&t&&t.__esModule)return t;var a=Object.create(null);if(e.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&d&&"string"!=typeof t)for(var c in t)e.d(a,c,function(d){return t[d]}.bind(null,c));return a},e.n=function(t){var d=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(d,"a",d),d},e.o=function(t,d){return Object.prototype.hasOwnProperty.call(t,d)},e.p="",e(e.s=7)}({0:function(module,exports,__webpack_require__){eval('!function(t,e){ true&&module.exports?(module.exports=e(),module.exports.default=module.exports):t.timeago=e()}("undefined"!=typeof window?window:this,function(){function t(t){return t instanceof Date?t:isNaN(t)?/^\\d+$/.test(t)?new Date(e(t)):(t=(t||"").trim().replace(/\\.\\d+/,"").replace(/-/,"/").replace(/-/,"/").replace(/(\\d)T(\\d)/,"$1 $2").replace(/Z/," UTC").replace(/([\\+\\-]\\d\\d)\\:?(\\d\\d)/," $1$2"),new Date(t)):new Date(e(t))}function e(t){return parseInt(t)}function n(t,n,r){n=l[n]?n:l[r]?r:"en";for(var o=0,i=t<0?1:0,a=t=Math.abs(t);t>=p[o]&&o<h;o++)t/=p[o];return t=e(t),o*=2,t>(0===o?9:1)&&(o+=1),l[n](t,o,a)[i].replace("%s",t)}function r(e,n){return((n=n?t(n):new Date)-t(e))/1e3}function o(t){for(var e=1,n=0,r=Math.abs(t);t>=p[n]&&n<h;n++)t/=p[n],e*=p[n];return r%=e,r=r?e-r:e,Math.ceil(r)}function i(t){return a(t,"data-timeago")||a(t,"datetime")}function a(t,e){return t.getAttribute?t.getAttribute(e):t.attr?t.attr(e):void 0}function u(t,e){return t.setAttribute?t.setAttribute(m,e):t.attr?t.attr(m,e):void 0}function c(t,e){this.nowDate=t,this.defaultLocale=e||"en"}function d(t,e){return new c(t,e)}var f="second_minute_hour_day_week_month_year".split("_"),s="秒_分钟_小时_天_周_月_年".split("_"),l={en:function(t,e){if(0===e)return["just now","right now"];var n=f[parseInt(e/2)];return t>1&&(n+="s"),[t+" "+n+" ago","in "+t+" "+n]},zh_CN:function(t,e){if(0===e)return["刚刚","片刻后"];var n=s[parseInt(e/2)];return[t+n+"前",t+n+"后"]}},p=[60,60,24,7,365/7/12,12],h=6,m="data-tid",w={};return c.prototype.doRender=function(t,e,i){var a,c=r(e,this.nowDate),d=this;t.innerHTML=n(c,i,this.defaultLocale),w[a=setTimeout(function(){d.doRender(t,e,i),delete w[a]},Math.min(1e3*o(c),2147483647))]=0,u(t,a)},c.prototype.format=function(t,e){return n(r(t,this.nowDate),e,this.defaultLocale)},c.prototype.render=function(t,e){void 0===t.length&&(t=[t]);for(var n=0,r=t.length;n<r;n++)this.doRender(t[n],i(t[n]),e)},c.prototype.setLocale=function(t){this.defaultLocale=t},d.register=function(t,e){l[t]=e},d.cancel=function(t){var e;if(t)(e=a(t,m))&&(clearTimeout(e),delete w[e]);else{for(e in w)clearTimeout(e);w={}}},d});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy90aW1lYWdvLmpzL2Rpc3QvdGltZWFnby5taW4uanM/YTc2MiJdLCJzb3VyY2VzQ29udGVudCI6WyIhZnVuY3Rpb24odCxlKXtcIm9iamVjdFwiPT10eXBlb2YgbW9kdWxlJiZtb2R1bGUuZXhwb3J0cz8obW9kdWxlLmV4cG9ydHM9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D10aGlzO3QuaW5uZXJIVE1MPW4oYyxpLHRoaXMuZGVmYXVsdExvY2FsZSksd1thPXNldFRpbWVvdXQoZnVuY3Rpb24oKXtkLmRvUmVuZGVyKHQsZSxpKSxkZWxldGUgd1thXX0sTWF0aC5taW4oMWUzKm8oYyksMjE0NzQ4MzY0NykpXT0wLHUodCxhKX0sYy5wcm90b3R5cGUuZm9ybWF0PWZ1bmN0aW9uKHQsZSl7cmV0dXJuIG4ocih0LHRoaXMubm93RGF0ZSksZSx0aGlzLmRlZmF1bHRMb2NhbGUpfSxjLnByb3RvdHlwZS5yZW5kZXI9ZnVuY3Rpb24odCxlKXt2b2lkIDA9PT10Lmxlbmd0aCYmKHQ9W3RdKTtmb3IodmFyIG49MCxyPXQubGVuZ3RoO248cjtuKyspdGhpcy5kb1JlbmRlcih0W25dLGkodFtuXSksZSl9LGMucHJvdG90eXBlLnNldExvY2FsZT1mdW5jdGlvbih0KXt0aGlzLmRlZmF1bHRMb2NhbGU9dH0sZC5yZWdpc3Rlcj1mdW5jdGlvbih0LGUpe2xbdF09ZX0sZC5jYW5jZWw9ZnVuY3Rpb24odCl7dmFyIGU7aWYodCkoZT1hKHQsbSkpJiYoY2xlYXJUaW1lb3V0KGUpLGRlbGV0ZSB3W2VdKTtlbHNle2ZvcihlIGluIHcpY2xlYXJUaW1lb3V0KGUpO3c9e319fSxkfSk7Il0sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///0\n')},7:function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n\n// CONCATENATED MODULE: ./blocks/amp-mathml/index.js\n\n/**\n * Internal block libraries.\n */\nvar __ = wp.i18n.__;\nvar registerBlockType = wp.blocks.registerBlockType;\nvar PlainText = wp.editor.PlainText;\n\n/**\n * Register block.\n */\n\n/* harmony default export */ var amp_mathml = (registerBlockType('amp/amp-mathml', {\n\ttitle: __('AMP MathML', 'amp'),\n\tcategory: 'common',\n\ticon: 'welcome-learn-more',\n\tkeywords: [__('Mathematical formula', 'amp'), __('Scientific content ', 'amp')],\n\n\tattributes: {\n\t\tdataFormula: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-mathml',\n\t\t\tattribute: 'data-formula'\n\t\t}\n\t},\n\n\tedit: function edit(_ref) {\n\t\tvar attributes = _ref.attributes,\n\t\t setAttributes = _ref.setAttributes;\n\t\tvar dataFormula = attributes.dataFormula;\n\n\n\t\treturn wp.element.createElement(PlainText, {\n\t\t\tkey: 'formula',\n\t\t\tvalue: dataFormula,\n\t\t\tplaceholder: __('Insert formula', 'amp'),\n\t\t\tonChange: function onChange(value) {\n\t\t\t\treturn setAttributes({ dataFormula: value });\n\t\t\t}\n\t\t});\n\t},\n\tsave: function save(_ref2) {\n\t\tvar attributes = _ref2.attributes;\n\n\t\tvar mathmlProps = {\n\t\t\t'data-formula': attributes.dataFormula,\n\t\t\tlayout: 'container'\n\t\t};\n\t\treturn wp.element.createElement('amp-mathml', mathmlProps);\n\t}\n}));\n// CONCATENATED MODULE: ./blocks/utils.js\nvar utils_ = wp.i18n.__;\nvar _wp$components = wp.components,\n TextControl = _wp$components.TextControl,\n SelectControl = _wp$components.SelectControl,\n Notice = _wp$components.Notice,\n Placeholder = _wp$components.Placeholder;\n\n/**\n * Display media placeholder.\n *\n * @param {string} name Block's name.\n * @param {string|boolean} url URL.\n * @return {XML} Placeholder.\n */\n\nfunction getMediaPlaceholder(name, url) {\n\treturn wp.element.createElement(\n\t\tPlaceholder,\n\t\t{ label: name },\n\t\twp.element.createElement(\n\t\t\t\"p\",\n\t\t\t{ className: \"components-placeholder__error\" },\n\t\t\turl\n\t\t),\n\t\twp.element.createElement(\n\t\t\t\"p\",\n\t\t\t{ className: \"components-placeholder__error\" },\n\t\t\tutils_('Previews for this are unavailable in the editor, sorry!', 'amp')\n\t\t)\n\t);\n}\n\n/**\n * Layout controls for AMP blocks' attributes: layout, width, height.\n *\n * @param {Object} props Props.\n * @param {Array} ampLayoutOptions Layout options.\n * @return {[XML,*,XML,*,XML]} Controls.\n */\nfunction getLayoutControls(props, ampLayoutOptions) {\n\t// @todo Move getting ampLayoutOptions to utils as well.\n\tvar attributes = props.attributes,\n\t setAttributes = props.setAttributes;\n\tvar ampLayout = attributes.ampLayout,\n\t height = attributes.height,\n\t width = attributes.width;\n\n\tvar showHeightNotice = !height && ('fixed' === ampLayout || 'fixed-height' === ampLayout);\n\tvar showWidthNotice = !width && 'fixed' === ampLayout;\n\n\treturn [wp.element.createElement(SelectControl, {\n\t\tkey: \"ampLayout\",\n\t\tlabel: utils_('Layout', 'amp'),\n\t\tvalue: ampLayout,\n\t\toptions: ampLayoutOptions,\n\t\tonChange: function onChange(value) {\n\t\t\treturn setAttributes({ ampLayout: value });\n\t\t}\n\t}), showWidthNotice && wp.element.createElement(\n\t\tNotice,\n\t\t{ key: \"showWidthNotice\", status: \"error\", isDismissible: false },\n\t\twp.i18n.sprintf(\n\t\t/* translators: %s is the layout name */\n\t\tutils_('Width is required for %s layout', 'amp'), ampLayout)\n\t), wp.element.createElement(TextControl, {\n\t\tkey: \"width\",\n\t\ttype: \"number\",\n\t\tlabel: utils_('Width (px)', 'amp'),\n\t\tvalue: width !== undefined ? width : '',\n\t\tonChange: function onChange(value) {\n\t\t\treturn setAttributes({ width: value });\n\t\t}\n\t}), showHeightNotice && wp.element.createElement(\n\t\tNotice,\n\t\t{ key: \"showHeightNotice\", status: \"error\", isDismissible: false },\n\t\twp.i18n.sprintf(\n\t\t/* translators: %s is the layout name */\n\t\tutils_('Height is required for %s layout', 'amp'), ampLayout)\n\t), wp.element.createElement(TextControl, {\n\t\tkey: \"height\",\n\t\ttype: \"number\",\n\t\tlabel: utils_('Height (px)', 'amp'),\n\t\tvalue: height,\n\t\tonChange: function onChange(value) {\n\t\t\treturn setAttributes({ height: value });\n\t\t}\n\t})];\n}\n// EXTERNAL MODULE: ./node_modules/timeago.js/dist/timeago.min.js\nvar timeago_min = __webpack_require__(0);\nvar timeago_min_default = /*#__PURE__*/__webpack_require__.n(timeago_min);\n\n// CONCATENATED MODULE: ./blocks/amp-timeago/index.js\n/* global moment */\n\n/**\n * Helper methods for blocks.\n */\n\n\n/**\n * Internal block libraries.\n */\nvar amp_timeago_ = wp.i18n.__;\nvar amp_timeago_registerBlockType = wp.blocks.registerBlockType;\nvar _wp$editor = wp.editor,\n InspectorControls = _wp$editor.InspectorControls,\n BlockAlignmentToolbar = _wp$editor.BlockAlignmentToolbar,\n BlockControls = _wp$editor.BlockControls;\nvar amp_timeago_wp$components = wp.components,\n DateTimePicker = amp_timeago_wp$components.DateTimePicker,\n PanelBody = amp_timeago_wp$components.PanelBody,\n amp_timeago_TextControl = amp_timeago_wp$components.TextControl;\nvar Fragment = wp.element.Fragment;\n\n\n\n/**\n * Register block.\n */\n/* harmony default export */ var amp_timeago = (amp_timeago_registerBlockType('amp/amp-timeago', {\n\ttitle: amp_timeago_('AMP Timeago'),\n\tcategory: 'common',\n\ticon: 'backup',\n\tkeywords: [amp_timeago_('Time difference'), amp_timeago_('Time ago'), amp_timeago_('Date')],\n\n\tattributes: {\n\t\talign: {\n\t\t\ttype: 'string'\n\t\t},\n\t\tcutoff: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-timeago',\n\t\t\tattribute: 'cutoff'\n\t\t},\n\t\tdateTime: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-timeago',\n\t\t\tattribute: 'datetime'\n\t\t},\n\t\tampLayout: {\n\t\t\tdefault: 'fixed-height',\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-timeago',\n\t\t\tattribute: 'layout'\n\t\t},\n\t\twidth: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-timeago',\n\t\t\tattribute: 'width'\n\t\t},\n\t\theight: {\n\t\t\tdefault: 20,\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-timeago',\n\t\t\tattribute: 'height'\n\t\t}\n\t},\n\n\tgetEditWrapperProps: function getEditWrapperProps(attributes) {\n\t\tvar align = attributes.align;\n\n\t\tif ('left' === align || 'right' === align || 'center' === align) {\n\t\t\treturn { 'data-align': align };\n\t\t}\n\t},\n\tedit: function edit(props) {\n\t\tvar attributes = props.attributes,\n\t\t setAttributes = props.setAttributes;\n\t\tvar align = attributes.align,\n\t\t cutoff = attributes.cutoff;\n\n\t\tvar timeAgo = void 0;\n\t\tif (attributes.dateTime) {\n\t\t\tif (attributes.cutoff && parseInt(attributes.cutoff) < Math.abs(moment(attributes.dateTime).diff(moment(), 'seconds'))) {\n\t\t\t\ttimeAgo = moment(attributes.dateTime).format('dddd D MMMM HH:mm');\n\t\t\t} else {\n\t\t\t\ttimeAgo = timeago_min_default()().format(attributes.dateTime);\n\t\t\t}\n\t\t} else {\n\t\t\ttimeAgo = timeago_min_default()().format(new Date());\n\t\t\tsetAttributes({ dateTime: moment(moment(), moment.ISO_8601, true).format() });\n\t\t}\n\n\t\tvar ampLayoutOptions = [{ value: '', label: amp_timeago_('Responsive', 'amp') }, { value: 'fixed', label: amp_timeago_('Fixed', 'amp') }, { value: 'fixed-height', label: amp_timeago_('Fixed height', 'amp') }];\n\n\t\treturn wp.element.createElement(\n\t\t\tFragment,\n\t\t\tnull,\n\t\t\twp.element.createElement(\n\t\t\t\tInspectorControls,\n\t\t\t\t{ key: 'inspector' },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\tPanelBody,\n\t\t\t\t\t{ title: amp_timeago_('AMP Timeago Settings') },\n\t\t\t\t\twp.element.createElement(DateTimePicker, {\n\t\t\t\t\t\tlocale: 'en',\n\t\t\t\t\t\tcurrentDate: attributes.dateTime || moment(),\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dateTime: moment(value, moment.ISO_8601, true).format() });\n\t\t\t\t\t\t} // eslint-disable-line\n\t\t\t\t\t}),\n\t\t\t\t\tgetLayoutControls(props, ampLayoutOptions),\n\t\t\t\t\twp.element.createElement(amp_timeago_TextControl, {\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\tclassName: 'blocks-amp-timeout__cutoff',\n\t\t\t\t\t\tlabel: amp_timeago_('Cutoff (seconds)'),\n\t\t\t\t\t\tvalue: cutoff !== undefined ? cutoff : '',\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ cutoff: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t),\n\t\t\twp.element.createElement(\n\t\t\t\tBlockControls,\n\t\t\t\t{ key: 'controls' },\n\t\t\t\twp.element.createElement(BlockAlignmentToolbar, {\n\t\t\t\t\tvalue: align,\n\t\t\t\t\tonChange: function onChange(nextAlign) {\n\t\t\t\t\t\tsetAttributes({ align: nextAlign });\n\t\t\t\t\t},\n\t\t\t\t\tcontrols: ['left', 'center', 'right']\n\t\t\t\t})\n\t\t\t),\n\t\t\twp.element.createElement(\n\t\t\t\t'time',\n\t\t\t\t{ key: 'timeago', dateTime: attributes.dateTime },\n\t\t\t\ttimeAgo\n\t\t\t)\n\t\t);\n\t},\n\tsave: function save(_ref) {\n\t\tvar attributes = _ref.attributes;\n\n\t\tvar timeagoProps = {\n\t\t\tlayout: 'responsive',\n\t\t\tclassName: 'align' + (attributes.align || 'none'),\n\t\t\tdatetime: attributes.dateTime,\n\t\t\tlocale: 'en'\n\t\t};\n\t\tif (attributes.cutoff) {\n\t\t\ttimeagoProps.cutoff = attributes.cutoff;\n\t\t}\n\t\tif (attributes.ampLayout) {\n\t\t\tswitch (attributes.ampLayout) {\n\t\t\t\tcase 'fixed-height':\n\t\t\t\t\tif (attributes.height) {\n\t\t\t\t\t\ttimeagoProps.height = attributes.height;\n\t\t\t\t\t\ttimeagoProps.layout = attributes.ampLayout;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'fixed':\n\t\t\t\t\tif (attributes.height && attributes.width) {\n\t\t\t\t\t\ttimeagoProps.height = attributes.height;\n\t\t\t\t\t\ttimeagoProps.width = attributes.width;\n\t\t\t\t\t\ttimeagoProps.layout = attributes.ampLayout;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn wp.element.createElement(\n\t\t\t'amp-timeago',\n\t\t\ttimeagoProps,\n\t\t\tmoment(attributes.dateTime).format('dddd D MMMM HH:mm')\n\t\t);\n\t}\n}));\n// CONCATENATED MODULE: ./blocks/amp-o2-player/index.js\n/**\n * Helper methods for blocks.\n */\n\n\n/**\n * Internal block libraries.\n */\nvar amp_o2_player_ = wp.i18n.__;\nvar amp_o2_player_registerBlockType = wp.blocks.registerBlockType;\nvar amp_o2_player_InspectorControls = wp.editor.InspectorControls;\nvar amp_o2_player_Fragment = wp.element.Fragment;\nvar amp_o2_player_wp$components = wp.components,\n amp_o2_player_PanelBody = amp_o2_player_wp$components.PanelBody,\n amp_o2_player_TextControl = amp_o2_player_wp$components.TextControl,\n amp_o2_player_Placeholder = amp_o2_player_wp$components.Placeholder,\n ToggleControl = amp_o2_player_wp$components.ToggleControl;\n\n/**\n * Register block.\n */\n\n/* harmony default export */ var amp_o2_player = (amp_o2_player_registerBlockType('amp/amp-o2-player', {\n\ttitle: amp_o2_player_('AMP O2 Player', 'amp'),\n\tcategory: 'embed',\n\ticon: 'embed-generic',\n\tkeywords: [amp_o2_player_('Embed', 'amp'), amp_o2_player_('AOL O2Player', 'amp')],\n\n\t// @todo Add other useful macro toggles, e.g. showing relevant content.\n\tattributes: {\n\t\tdataPid: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-o2-player',\n\t\t\tattribute: 'data-pid'\n\t\t},\n\t\tdataVid: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-o2-player',\n\t\t\tattribute: 'data-vid'\n\t\t},\n\t\tdataBcid: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-o2-player',\n\t\t\tattribute: 'data-bcid'\n\t\t},\n\t\tdataBid: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-o2-player',\n\t\t\tattribute: 'data-bid'\n\t\t},\n\t\tautoPlay: {\n\t\t\tdefault: false\n\t\t},\n\t\tampLayout: {\n\t\t\tdefault: 'responsive',\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-o2-player',\n\t\t\tattribute: 'layout'\n\t\t},\n\t\twidth: {\n\t\t\tdefault: 600,\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-o2-player',\n\t\t\tattribute: 'width'\n\t\t},\n\t\theight: {\n\t\t\tdefault: 400,\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-o2-player',\n\t\t\tattribute: 'height'\n\t\t}\n\t},\n\n\tedit: function edit(props) {\n\t\tvar attributes = props.attributes,\n\t\t setAttributes = props.setAttributes;\n\t\tvar autoPlay = attributes.autoPlay,\n\t\t dataPid = attributes.dataPid,\n\t\t dataVid = attributes.dataVid,\n\t\t dataBcid = attributes.dataBcid,\n\t\t dataBid = attributes.dataBid;\n\n\t\tvar ampLayoutOptions = [{ value: 'responsive', label: amp_o2_player_('Responsive', 'amp') }, { value: 'fixed-height', label: amp_o2_player_('Fixed height', 'amp') }, { value: 'fixed', label: amp_o2_player_('Fixed', 'amp') }, { value: 'fill', label: amp_o2_player_('Fill', 'amp') }, { value: 'flex-item', label: amp_o2_player_('Flex-item', 'amp') }, { value: 'nodisplay', label: amp_o2_player_('No Display', 'amp') }];\n\t\tvar url = false;\n\t\tif (dataPid && (dataBcid || dataVid)) {\n\t\t\turl = 'https://delivery.vidible.tv/htmlembed/pid=' + dataPid + '/';\n\t\t}\n\t\treturn wp.element.createElement(\n\t\t\tamp_o2_player_Fragment,\n\t\t\tnull,\n\t\t\twp.element.createElement(\n\t\t\t\tamp_o2_player_InspectorControls,\n\t\t\t\t{ key: 'inspector' },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\tamp_o2_player_PanelBody,\n\t\t\t\t\t{ title: amp_o2_player_('O2 Player Settings', 'amp') },\n\t\t\t\t\twp.element.createElement(amp_o2_player_TextControl, {\n\t\t\t\t\t\tlabel: amp_o2_player_('Player ID (required)', 'amp'),\n\t\t\t\t\t\tvalue: dataPid,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataPid: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(amp_o2_player_TextControl, {\n\t\t\t\t\t\tlabel: amp_o2_player_('Buyer Company ID (either buyer or video ID is required)', 'amp'),\n\t\t\t\t\t\tvalue: dataBcid,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataBcid: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(amp_o2_player_TextControl, {\n\t\t\t\t\t\tlabel: amp_o2_player_('Video ID (either buyer or video ID is required)', 'amp'),\n\t\t\t\t\t\tvalue: dataVid,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataVid: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(amp_o2_player_TextControl, {\n\t\t\t\t\t\tlabel: amp_o2_player_('Playlist ID', 'amp'),\n\t\t\t\t\t\tvalue: dataBid,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataBid: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(ToggleControl, {\n\t\t\t\t\t\tlabel: amp_o2_player_('Autoplay', 'amp'),\n\t\t\t\t\t\tchecked: autoPlay,\n\t\t\t\t\t\tonChange: function onChange() {\n\t\t\t\t\t\t\treturn setAttributes({ autoPlay: !autoPlay });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\tgetLayoutControls(props, ampLayoutOptions)\n\t\t\t\t)\n\t\t\t),\n\t\t\turl && getMediaPlaceholder(amp_o2_player_('O2 Player', 'amp'), url),\n\t\t\t!url && wp.element.createElement(\n\t\t\t\tamp_o2_player_Placeholder,\n\t\t\t\t{ label: amp_o2_player_('O2 Player', 'amp') },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\t'p',\n\t\t\t\t\tnull,\n\t\t\t\t\tamp_o2_player_('Add required data to use the block.', 'amp')\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t},\n\tsave: function save(_ref) {\n\t\tvar attributes = _ref.attributes;\n\n\t\tvar o2Props = {\n\t\t\tlayout: attributes.ampLayout,\n\t\t\theight: attributes.height,\n\t\t\t'data-pid': attributes.dataPid\n\t\t};\n\t\tif ('fixed-height' !== attributes.ampLayout && attributes.width) {\n\t\t\to2Props.width = attributes.width;\n\t\t}\n\t\tif (!attributes.autoPlay) {\n\t\t\to2Props['data-macros'] = 'm.playback=click';\n\t\t}\n\t\tif (attributes.dataVid) {\n\t\t\to2Props['data-vid'] = attributes.dataVid;\n\t\t} else if (attributes.dataBcid) {\n\t\t\to2Props['data-bcid'] = attributes.dataBcid;\n\t\t}\n\t\tif (attributes.dataBid) {\n\t\t\to2Props['data-bid'] = attributes.dataBid;\n\t\t}\n\t\treturn wp.element.createElement('amp-o2-player', o2Props);\n\t}\n}));\n// CONCATENATED MODULE: ./blocks/amp-ooyala-player/index.js\n/**\n * Helper methods for blocks.\n */\n\n\n/**\n * Internal block libraries.\n */\nvar amp_ooyala_player_ = wp.i18n.__;\nvar amp_ooyala_player_registerBlockType = wp.blocks.registerBlockType;\nvar amp_ooyala_player_InspectorControls = wp.editor.InspectorControls;\nvar amp_ooyala_player_Fragment = wp.element.Fragment;\nvar amp_ooyala_player_wp$components = wp.components,\n amp_ooyala_player_PanelBody = amp_ooyala_player_wp$components.PanelBody,\n amp_ooyala_player_TextControl = amp_ooyala_player_wp$components.TextControl,\n amp_ooyala_player_SelectControl = amp_ooyala_player_wp$components.SelectControl,\n amp_ooyala_player_Placeholder = amp_ooyala_player_wp$components.Placeholder;\n\n/**\n * Register block.\n */\n\n/* harmony default export */ var amp_ooyala_player = (amp_ooyala_player_registerBlockType('amp/amp-ooyala-player', {\n\ttitle: amp_ooyala_player_('AMP Ooyala Player', 'amp'),\n\tdescription: amp_ooyala_player_('Displays an Ooyala video.', 'amp'),\n\tcategory: 'embed',\n\ticon: 'embed-generic',\n\tkeywords: [amp_ooyala_player_('Embed', 'amp'), amp_ooyala_player_('Ooyala video', 'amp')],\n\n\t// @todo Add data-config attribute?\n\tattributes: {\n\t\tdataEmbedCode: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-ooyala-player',\n\t\t\tattribute: 'data-embedcode'\n\t\t},\n\t\tdataPlayerId: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-ooyala-player',\n\t\t\tattribute: 'data-playerid'\n\t\t},\n\t\tdataPcode: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-ooyala-player',\n\t\t\tattribute: 'data-pcode'\n\t\t},\n\t\tdataPlayerVersion: {\n\t\t\tdefault: 'v3',\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-ooyala-player',\n\t\t\tattribute: 'data-playerversion'\n\t\t},\n\t\tampLayout: {\n\t\t\tdefault: 'responsive',\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-ooyala-player',\n\t\t\tattribute: 'layout'\n\t\t},\n\t\twidth: {\n\t\t\tdefault: 600,\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-ooyala-player',\n\t\t\tattribute: 'width'\n\t\t},\n\t\theight: {\n\t\t\tdefault: 400,\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-ooyala-player',\n\t\t\tattribute: 'height'\n\t\t}\n\t},\n\n\tedit: function edit(props) {\n\t\tvar attributes = props.attributes,\n\t\t setAttributes = props.setAttributes;\n\t\tvar dataEmbedCode = attributes.dataEmbedCode,\n\t\t dataPlayerId = attributes.dataPlayerId,\n\t\t dataPcode = attributes.dataPcode,\n\t\t dataPlayerVersion = attributes.dataPlayerVersion;\n\n\t\tvar ampLayoutOptions = [{ value: 'responsive', label: amp_ooyala_player_('Responsive', 'amp') }, { value: 'fixed', label: amp_ooyala_player_('Fixed', 'amp') }, { value: 'fill', label: amp_ooyala_player_('Fill', 'amp') }, { value: 'flex-item', label: amp_ooyala_player_('Flex-item', 'amp') }];\n\t\tvar url = false;\n\t\tif (dataEmbedCode && dataPlayerId && dataPcode) {\n\t\t\turl = 'http://cf.c.ooyala.com/' + dataEmbedCode;\n\t\t}\n\t\treturn wp.element.createElement(\n\t\t\tamp_ooyala_player_Fragment,\n\t\t\tnull,\n\t\t\twp.element.createElement(\n\t\t\t\tamp_ooyala_player_InspectorControls,\n\t\t\t\t{ key: 'inspector' },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\tamp_ooyala_player_PanelBody,\n\t\t\t\t\t{ title: amp_ooyala_player_('Ooyala settings', 'amp') },\n\t\t\t\t\twp.element.createElement(amp_ooyala_player_TextControl, {\n\t\t\t\t\t\tlabel: amp_ooyala_player_('Video embed code (required)', 'amp'),\n\t\t\t\t\t\tvalue: dataEmbedCode,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataEmbedCode: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(amp_ooyala_player_TextControl, {\n\t\t\t\t\t\tlabel: amp_ooyala_player_('Player ID (required)', 'amp'),\n\t\t\t\t\t\tvalue: dataPlayerId,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataPlayerId: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(amp_ooyala_player_TextControl, {\n\t\t\t\t\t\tlabel: amp_ooyala_player_('Provider code for the account (required)', 'amp'),\n\t\t\t\t\t\tvalue: dataPcode,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataPcode: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(amp_ooyala_player_SelectControl, {\n\t\t\t\t\t\tlabel: amp_ooyala_player_('Player version', 'amp'),\n\t\t\t\t\t\tvalue: dataPlayerVersion,\n\t\t\t\t\t\toptions: [{ value: 'v3', label: amp_ooyala_player_('V3', 'amp') }, { value: 'v4', label: amp_ooyala_player_('V4', 'amp') }],\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataPlayerVersion: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\tgetLayoutControls(props, ampLayoutOptions)\n\t\t\t\t)\n\t\t\t),\n\t\t\turl && getMediaPlaceholder(amp_ooyala_player_('Ooyala Player', 'amp'), url),\n\t\t\t!url && wp.element.createElement(\n\t\t\t\tamp_ooyala_player_Placeholder,\n\t\t\t\t{ label: amp_ooyala_player_('Ooyala Player', 'amp') },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\t'p',\n\t\t\t\t\tnull,\n\t\t\t\t\tamp_ooyala_player_('Add required data to use the block.', 'amp')\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t},\n\tsave: function save(_ref) {\n\t\tvar attributes = _ref.attributes;\n\t\tvar dataEmbedCode = attributes.dataEmbedCode,\n\t\t dataPlayerId = attributes.dataPlayerId,\n\t\t dataPcode = attributes.dataPcode,\n\t\t dataPlayerVersion = attributes.dataPlayerVersion,\n\t\t ampLayout = attributes.ampLayout,\n\t\t height = attributes.height,\n\t\t width = attributes.width;\n\n\n\t\tvar ooyalaProps = {\n\t\t\tlayout: ampLayout,\n\t\t\theight: height,\n\t\t\t'data-embedcode': dataEmbedCode,\n\t\t\t'data-playerid': dataPlayerId,\n\t\t\t'data-pcode': dataPcode,\n\t\t\t'data-playerversion': dataPlayerVersion\n\t\t};\n\t\tif ('fixed-height' !== ampLayout && width) {\n\t\t\tooyalaProps.width = width;\n\t\t}\n\t\treturn wp.element.createElement('amp-ooyala-player', ooyalaProps);\n\t}\n}));\n// CONCATENATED MODULE: ./blocks/amp-reach-player/index.js\n/**\n * Helper methods for blocks.\n */\n\n\n/**\n * Internal block libraries.\n */\nvar amp_reach_player_ = wp.i18n.__;\nvar amp_reach_player_registerBlockType = wp.blocks.registerBlockType;\nvar amp_reach_player_InspectorControls = wp.editor.InspectorControls;\nvar amp_reach_player_Fragment = wp.element.Fragment;\nvar amp_reach_player_wp$components = wp.components,\n amp_reach_player_PanelBody = amp_reach_player_wp$components.PanelBody,\n amp_reach_player_TextControl = amp_reach_player_wp$components.TextControl,\n amp_reach_player_Placeholder = amp_reach_player_wp$components.Placeholder;\n\n/**\n * Register block.\n */\n\n/* harmony default export */ var amp_reach_player = (amp_reach_player_registerBlockType('amp/amp-reach-player', {\n\ttitle: amp_reach_player_('AMP Reach Player', 'amp'),\n\tdescription: amp_reach_player_('Displays the Reach Player configured in the Beachfront Reach platform.', 'amp'),\n\tcategory: 'embed',\n\ticon: 'embed-generic',\n\tkeywords: [amp_reach_player_('Embed', 'amp'), amp_reach_player_('Beachfront Reach video', 'amp')],\n\n\tattributes: {\n\t\tdataEmbedId: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-reach-player',\n\t\t\tattribute: 'data-embed-id'\n\t\t},\n\t\tampLayout: {\n\t\t\tdefault: 'fixed-height',\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-reach-player',\n\t\t\tattribute: 'layout'\n\t\t},\n\t\twidth: {\n\t\t\tdefault: 600,\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-reach-player',\n\t\t\tattribute: 'width'\n\t\t},\n\t\theight: {\n\t\t\tdefault: 400,\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-reach-player',\n\t\t\tattribute: 'height'\n\t\t}\n\t},\n\n\tedit: function edit(props) {\n\t\tvar attributes = props.attributes,\n\t\t setAttributes = props.setAttributes;\n\t\tvar dataEmbedId = attributes.dataEmbedId;\n\n\t\tvar ampLayoutOptions = [{ value: 'responsive', label: amp_reach_player_('Responsive', 'amp') }, { value: 'fixed-height', label: amp_reach_player_('Fixed Height', 'amp') }, { value: 'fixed', label: amp_reach_player_('Fixed', 'amp') }, { value: 'fill', label: amp_reach_player_('Fill', 'amp') }, { value: 'flex-item', label: amp_reach_player_('Flex-item', 'amp') }];\n\t\tvar url = false;\n\t\tif (dataEmbedId) {\n\t\t\turl = 'https://media-cdn.beachfrontreach.com/acct_1/video/';\n\t\t}\n\t\treturn wp.element.createElement(\n\t\t\tamp_reach_player_Fragment,\n\t\t\tnull,\n\t\t\twp.element.createElement(\n\t\t\t\tamp_reach_player_InspectorControls,\n\t\t\t\t{ key: 'inspector' },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\tamp_reach_player_PanelBody,\n\t\t\t\t\t{ title: amp_reach_player_('Reach settings', 'amp') },\n\t\t\t\t\twp.element.createElement(amp_reach_player_TextControl, {\n\t\t\t\t\t\tlabel: amp_reach_player_('The Reach player embed id (required)', 'amp'),\n\t\t\t\t\t\tvalue: dataEmbedId,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataEmbedId: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\tgetLayoutControls(props, ampLayoutOptions)\n\t\t\t\t)\n\t\t\t),\n\t\t\turl && getMediaPlaceholder(amp_reach_player_('Reach Player', 'amp'), url),\n\t\t\t!url && wp.element.createElement(\n\t\t\t\tamp_reach_player_Placeholder,\n\t\t\t\t{ label: amp_reach_player_('Reach Player', 'amp') },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\t'p',\n\t\t\t\t\tnull,\n\t\t\t\t\tamp_reach_player_('Add Reach player embed ID to use the block.', 'amp')\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t},\n\tsave: function save(_ref) {\n\t\tvar attributes = _ref.attributes;\n\t\tvar dataEmbedId = attributes.dataEmbedId,\n\t\t ampLayout = attributes.ampLayout,\n\t\t height = attributes.height,\n\t\t width = attributes.width;\n\n\n\t\tvar reachProps = {\n\t\t\tlayout: ampLayout,\n\t\t\theight: height,\n\t\t\t'data-embed-id': dataEmbedId\n\t\t};\n\t\tif ('fixed-height' !== ampLayout && width) {\n\t\t\treachProps.width = width;\n\t\t}\n\t\treturn wp.element.createElement('amp-reach-player', reachProps);\n\t}\n}));\n// CONCATENATED MODULE: ./blocks/amp-springboard-player/index.js\n/**\n * Helper methods for blocks.\n */\n\n\n/**\n * Internal block libraries.\n */\nvar amp_springboard_player_ = wp.i18n.__;\nvar amp_springboard_player_registerBlockType = wp.blocks.registerBlockType;\nvar amp_springboard_player_InspectorControls = wp.editor.InspectorControls;\nvar amp_springboard_player_Fragment = wp.element.Fragment;\nvar amp_springboard_player_wp$components = wp.components,\n amp_springboard_player_PanelBody = amp_springboard_player_wp$components.PanelBody,\n amp_springboard_player_TextControl = amp_springboard_player_wp$components.TextControl,\n amp_springboard_player_SelectControl = amp_springboard_player_wp$components.SelectControl,\n amp_springboard_player_Placeholder = amp_springboard_player_wp$components.Placeholder;\n\n/**\n * Register block.\n */\n\n/* harmony default export */ var amp_springboard_player = (amp_springboard_player_registerBlockType('amp/amp-springboard-player', {\n\ttitle: amp_springboard_player_('AMP Springboard Player', 'amp'),\n\tdescription: amp_springboard_player_('Displays the Springboard Player used in the Springboard Video Platform', 'amp'),\n\tcategory: 'embed',\n\ticon: 'embed-generic',\n\tkeywords: [amp_springboard_player_('Embed', 'amp')],\n\n\tattributes: {\n\t\tdataSiteId: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-springboard-player',\n\t\t\tattribute: 'data-site-id'\n\t\t},\n\t\tdataContentId: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-springboard-player',\n\t\t\tattribute: 'data-content-id'\n\t\t},\n\t\tdataPlayerId: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-springboard-player',\n\t\t\tattribute: 'data-player-id'\n\t\t},\n\t\tdataDomain: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-springboard-player',\n\t\t\tattribute: 'data-domain'\n\t\t},\n\t\tdataMode: {\n\t\t\tdefault: 'video',\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-springboard-player',\n\t\t\tattribute: 'data-mode'\n\t\t},\n\t\tdataItems: {\n\t\t\tdefault: 1,\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-springboard-player',\n\t\t\tattribute: 'data-items'\n\t\t},\n\t\tampLayout: {\n\t\t\tdefault: 'responsive',\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-springboard-player',\n\t\t\tattribute: 'layout'\n\t\t},\n\t\twidth: {\n\t\t\tdefault: 600,\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-springboard-player',\n\t\t\tattribute: 'width'\n\t\t},\n\t\theight: {\n\t\t\tdefault: 400,\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-springboard-player',\n\t\t\tattribute: 'height'\n\t\t}\n\t},\n\n\tedit: function edit(props) {\n\t\tvar attributes = props.attributes,\n\t\t setAttributes = props.setAttributes;\n\t\tvar dataSiteId = attributes.dataSiteId,\n\t\t dataPlayerId = attributes.dataPlayerId,\n\t\t dataContentId = attributes.dataContentId,\n\t\t dataDomain = attributes.dataDomain,\n\t\t dataMode = attributes.dataMode,\n\t\t dataItems = attributes.dataItems;\n\n\t\tvar ampLayoutOptions = [{ value: 'responsive', label: amp_springboard_player_('Responsive', 'amp') }, { value: 'fixed', label: amp_springboard_player_('Fixed', 'amp') }, { value: 'fill', label: amp_springboard_player_('Fill', 'amp') }, { value: 'flex-item', label: amp_springboard_player_('Flex-item', 'amp') }];\n\t\tvar url = false;\n\t\tif (dataSiteId && dataContentId && dataDomain && dataMode && dataItems) {\n\t\t\turl = 'https://cms.springboardplatform.com/embed_iframe/';\n\t\t}\n\t\treturn wp.element.createElement(\n\t\t\tamp_springboard_player_Fragment,\n\t\t\tnull,\n\t\t\twp.element.createElement(\n\t\t\t\tamp_springboard_player_InspectorControls,\n\t\t\t\t{ key: 'inspector' },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\tamp_springboard_player_PanelBody,\n\t\t\t\t\t{ title: amp_springboard_player_('Springboard Player Settings', 'amp') },\n\t\t\t\t\twp.element.createElement(amp_springboard_player_TextControl, {\n\t\t\t\t\t\tlabel: amp_springboard_player_('SprintBoard site ID (required)', 'amp'),\n\t\t\t\t\t\tvalue: dataSiteId,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataSiteId: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(amp_springboard_player_TextControl, {\n\t\t\t\t\t\tlabel: amp_springboard_player_('Player content ID (required)', 'amp'),\n\t\t\t\t\t\tvalue: dataContentId,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataContentId: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(amp_springboard_player_TextControl, {\n\t\t\t\t\t\tlabel: amp_springboard_player_('Player ID', 'amp'),\n\t\t\t\t\t\tvalue: dataPlayerId,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataPlayerId: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(amp_springboard_player_TextControl, {\n\t\t\t\t\t\tlabel: amp_springboard_player_('Springboard partner domain', 'amp'),\n\t\t\t\t\t\tvalue: dataDomain,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataDomain: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(amp_springboard_player_SelectControl, {\n\t\t\t\t\t\tlabel: amp_springboard_player_('Mode (required)', 'amp'),\n\t\t\t\t\t\tvalue: dataMode,\n\t\t\t\t\t\toptions: [{ value: 'video', label: amp_springboard_player_('Video', 'amp') }, { value: 'playlist', label: amp_springboard_player_('Playlist', 'amp') }],\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataMode: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(amp_springboard_player_TextControl, {\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\tlabel: amp_springboard_player_('Number of video is playlist (required)', 'amp'),\n\t\t\t\t\t\tvalue: dataItems,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataItems: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\tgetLayoutControls(props, ampLayoutOptions)\n\t\t\t\t)\n\t\t\t),\n\t\t\turl && getMediaPlaceholder(amp_springboard_player_('Springboard Player', 'amp'), url),\n\t\t\t!url && wp.element.createElement(\n\t\t\t\tamp_springboard_player_Placeholder,\n\t\t\t\t{ label: amp_springboard_player_('Springboard Player', 'amp') },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\t'p',\n\t\t\t\t\tnull,\n\t\t\t\t\tamp_springboard_player_('Add required data to use the block.', 'amp')\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t},\n\tsave: function save(_ref) {\n\t\tvar attributes = _ref.attributes;\n\t\tvar dataSiteId = attributes.dataSiteId,\n\t\t dataPlayerId = attributes.dataPlayerId,\n\t\t dataContentId = attributes.dataContentId,\n\t\t dataDomain = attributes.dataDomain,\n\t\t dataMode = attributes.dataMode,\n\t\t dataItems = attributes.dataItems,\n\t\t ampLayout = attributes.ampLayout,\n\t\t height = attributes.height,\n\t\t width = attributes.width;\n\n\t\tvar springboardProps = {\n\t\t\tlayout: ampLayout,\n\t\t\theight: height,\n\t\t\t'data-site-id': dataSiteId,\n\t\t\t'data-mode': dataMode,\n\t\t\t'data-content-id': dataContentId,\n\t\t\t'data-player-id': dataPlayerId,\n\t\t\t'data-domain': dataDomain,\n\t\t\t'data-items': dataItems\n\t\t};\n\t\tif ('fixed-height' !== ampLayout && width) {\n\t\t\tspringboardProps.width = attributes.width;\n\t\t}\n\t\treturn wp.element.createElement('amp-springboard-player', springboardProps);\n\t}\n}));\n// CONCATENATED MODULE: ./blocks/amp-jwplayer/index.js\n/**\n * Helper methods for blocks.\n */\n\n\n/**\n * Internal block libraries.\n */\nvar amp_jwplayer_ = wp.i18n.__;\nvar amp_jwplayer_registerBlockType = wp.blocks.registerBlockType;\nvar amp_jwplayer_InspectorControls = wp.editor.InspectorControls;\nvar amp_jwplayer_Fragment = wp.element.Fragment;\nvar amp_jwplayer_wp$components = wp.components,\n amp_jwplayer_PanelBody = amp_jwplayer_wp$components.PanelBody,\n amp_jwplayer_TextControl = amp_jwplayer_wp$components.TextControl,\n amp_jwplayer_Placeholder = amp_jwplayer_wp$components.Placeholder;\n\n/**\n * Register block.\n */\n\n/* harmony default export */ var amp_jwplayer = (amp_jwplayer_registerBlockType('amp/amp-jwplayer', {\n\ttitle: amp_jwplayer_('AMP JW Player', 'amp'),\n\tdescription: amp_jwplayer_('Displays a cloud-hosted JW Player.', 'amp'),\n\tcategory: 'embed',\n\ticon: 'embed-generic',\n\tkeywords: [amp_jwplayer_('Embed', 'amp')],\n\n\tattributes: {\n\t\tdataPlayerId: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-jwplayer',\n\t\t\tattribute: 'data-player-id'\n\t\t},\n\t\tdataMediaId: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-jwplayer',\n\t\t\tattribute: 'data-media-id'\n\t\t},\n\t\tdataPlaylistId: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-jwplayer',\n\t\t\tattribute: 'data-playlist-id'\n\t\t},\n\t\tampLayout: {\n\t\t\tdefault: 'responsive',\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-jwplayer',\n\t\t\tattribute: 'layout'\n\t\t},\n\t\twidth: {\n\t\t\tdefault: 600,\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-jwplayer',\n\t\t\tattribute: 'width'\n\t\t},\n\t\theight: {\n\t\t\tdefault: 400,\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-jwplayer',\n\t\t\tattribute: 'height'\n\t\t}\n\t},\n\n\tedit: function edit(props) {\n\t\tvar attributes = props.attributes,\n\t\t setAttributes = props.setAttributes;\n\t\tvar dataPlayerId = attributes.dataPlayerId,\n\t\t dataMediaId = attributes.dataMediaId,\n\t\t dataPlaylistId = attributes.dataPlaylistId;\n\n\t\tvar ampLayoutOptions = [{ value: 'responsive', label: amp_jwplayer_('Responsive', 'amp') }, { value: 'fixed-height', label: amp_jwplayer_('Fixed height', 'amp') }, { value: 'fixed', label: amp_jwplayer_('Fixed', 'amp') }, { value: 'fill', label: amp_jwplayer_('Fill', 'amp') }, { value: 'flex-item', label: amp_jwplayer_('Flex-item', 'amp') }, { value: 'nodisplay', label: amp_jwplayer_('No Display', 'amp') }];\n\t\tvar url = false;\n\t\tif (dataPlayerId && (dataMediaId || dataPlaylistId)) {\n\t\t\tif (dataPlaylistId) {\n\t\t\t\turl = 'https://content.jwplatform.com/players/' + dataPlaylistId + '-' + dataPlayerId;\n\t\t\t} else {\n\t\t\t\turl = 'https://content.jwplatform.com/players/' + dataMediaId + '-' + dataPlayerId;\n\t\t\t}\n\t\t}\n\t\treturn wp.element.createElement(\n\t\t\tamp_jwplayer_Fragment,\n\t\t\tnull,\n\t\t\twp.element.createElement(\n\t\t\t\tamp_jwplayer_InspectorControls,\n\t\t\t\t{ key: 'inspector' },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\tamp_jwplayer_PanelBody,\n\t\t\t\t\t{ title: amp_jwplayer_('JW Player Settings', 'amp') },\n\t\t\t\t\twp.element.createElement(amp_jwplayer_TextControl, {\n\t\t\t\t\t\tlabel: amp_jwplayer_('Player ID (required)', 'amp'),\n\t\t\t\t\t\tvalue: dataPlayerId,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataPlayerId: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(amp_jwplayer_TextControl, {\n\t\t\t\t\t\tlabel: amp_jwplayer_('Media ID (required if playlist ID not set)', 'amp'),\n\t\t\t\t\t\tvalue: dataMediaId,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataMediaId: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(amp_jwplayer_TextControl, {\n\t\t\t\t\t\tlabel: amp_jwplayer_('Playlist ID (required if media ID not set)', 'amp'),\n\t\t\t\t\t\tvalue: dataPlaylistId,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataPlaylistId: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\tgetLayoutControls(props, ampLayoutOptions)\n\t\t\t\t)\n\t\t\t),\n\t\t\turl && getMediaPlaceholder(amp_jwplayer_('JW Player', 'amp'), url),\n\t\t\t!url && wp.element.createElement(\n\t\t\t\tamp_jwplayer_Placeholder,\n\t\t\t\t{ label: amp_jwplayer_('JW Player', 'amp') },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\t'p',\n\t\t\t\t\tnull,\n\t\t\t\t\tamp_jwplayer_('Add required data to use the block.', 'amp')\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t},\n\tsave: function save(_ref) {\n\t\tvar attributes = _ref.attributes;\n\n\t\tvar jwProps = {\n\t\t\tlayout: attributes.ampLayout,\n\t\t\theight: attributes.height,\n\t\t\t'data-player-id': attributes.dataPlayerId\n\t\t};\n\t\tif ('fixed-height' !== attributes.ampLayout && attributes.width) {\n\t\t\tjwProps.width = attributes.width;\n\t\t}\n\t\tif (attributes.dataPlaylistId) {\n\t\t\tjwProps['data-playlist-id'] = attributes.dataPlaylistId;\n\t\t}\n\t\tif (attributes.dataMediaId) {\n\t\t\tjwProps['data-media-id'] = attributes.dataMediaId;\n\t\t}\n\t\treturn wp.element.createElement('amp-jwplayer', jwProps);\n\t}\n}));\n// CONCATENATED MODULE: ./blocks/amp-brid-player/index.js\n/**\n * Helper methods for blocks.\n */\n\n\n/**\n * Internal block libraries.\n */\nvar amp_brid_player_ = wp.i18n.__;\nvar amp_brid_player_registerBlockType = wp.blocks.registerBlockType;\nvar amp_brid_player_InspectorControls = wp.editor.InspectorControls;\nvar amp_brid_player_Fragment = wp.element.Fragment;\nvar amp_brid_player_wp$components = wp.components,\n amp_brid_player_PanelBody = amp_brid_player_wp$components.PanelBody,\n amp_brid_player_TextControl = amp_brid_player_wp$components.TextControl,\n amp_brid_player_Placeholder = amp_brid_player_wp$components.Placeholder,\n amp_brid_player_ToggleControl = amp_brid_player_wp$components.ToggleControl;\n\n/**\n * Register block.\n */\n\n/* harmony default export */ var amp_brid_player = (amp_brid_player_registerBlockType('amp/amp-brid-player', {\n\ttitle: amp_brid_player_('AMP Brid Player', 'amp'),\n\tdescription: amp_brid_player_('Displays the Brid Player used in Brid.tv Video Platform.', 'amp'),\n\tcategory: 'embed',\n\ticon: 'embed-generic',\n\tkeywords: [amp_brid_player_('Embed', 'amp')],\n\n\tattributes: {\n\t\tautoPlay: {\n\t\t\ttype: 'boolean'\n\t\t},\n\t\tdataPartner: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-brid-player',\n\t\t\tattribute: 'data-partner'\n\t\t},\n\t\tdataPlayer: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-brid-player',\n\t\t\tattribute: 'data-player'\n\t\t},\n\t\tdataVideo: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-brid-player',\n\t\t\tattribute: 'data-video'\n\t\t},\n\t\tdataPlaylist: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-brid-player',\n\t\t\tattribute: 'data-playlist'\n\t\t},\n\t\tdataOutstream: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-brid-player',\n\t\t\tattribute: 'data-outstream'\n\t\t},\n\t\tampLayout: {\n\t\t\tdefault: 'responsive',\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-brid-player',\n\t\t\tattribute: 'layout'\n\t\t},\n\t\twidth: {\n\t\t\ttype: 'number',\n\t\t\tdefault: 600\n\t\t},\n\t\theight: {\n\t\t\tdefault: 400,\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-brid-player',\n\t\t\tattribute: 'height'\n\t\t}\n\t},\n\n\tedit: function edit(props) {\n\t\tvar attributes = props.attributes,\n\t\t setAttributes = props.setAttributes;\n\t\tvar autoPlay = attributes.autoPlay,\n\t\t dataPartner = attributes.dataPartner,\n\t\t dataPlayer = attributes.dataPlayer,\n\t\t dataVideo = attributes.dataVideo,\n\t\t dataPlaylist = attributes.dataPlaylist,\n\t\t dataOutstream = attributes.dataOutstream;\n\n\t\tvar ampLayoutOptions = [{ value: 'responsive', label: amp_brid_player_('Responsive', 'amp') }, { value: 'fixed-height', label: amp_brid_player_('Fixed height', 'amp') }, { value: 'fixed', label: amp_brid_player_('Fixed', 'amp') }, { value: 'fill', label: amp_brid_player_('Fill', 'amp') }, { value: 'flex-item', label: amp_brid_player_('Flex-item', 'amp') }, { value: 'nodisplay', label: amp_brid_player_('No Display', 'amp') }];\n\t\tvar url = false;\n\t\tif (dataPartner && dataPlayer && (dataVideo || dataPlaylist || dataOutstream)) {\n\t\t\turl = 'http://cdn.brid.tv/live/partners/' + dataPartner;\n\t\t}\n\t\treturn wp.element.createElement(\n\t\t\tamp_brid_player_Fragment,\n\t\t\tnull,\n\t\t\twp.element.createElement(\n\t\t\t\tamp_brid_player_InspectorControls,\n\t\t\t\t{ key: 'inspector' },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\tamp_brid_player_PanelBody,\n\t\t\t\t\t{ title: amp_brid_player_('Brid Player Settings', 'amp') },\n\t\t\t\t\twp.element.createElement(amp_brid_player_TextControl, {\n\t\t\t\t\t\tlabel: amp_brid_player_('Brid.tv partner ID (required)', 'amp'),\n\t\t\t\t\t\tvalue: dataPartner,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataPartner: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(amp_brid_player_TextControl, {\n\t\t\t\t\t\tlabel: amp_brid_player_('Brid.tv player ID (required)', 'amp'),\n\t\t\t\t\t\tvalue: dataPlayer,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataPlayer: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(amp_brid_player_TextControl, {\n\t\t\t\t\t\tlabel: amp_brid_player_('Video ID (one of video / playlist / outstream ID is required)', 'amp'),\n\t\t\t\t\t\tvalue: dataVideo,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataVideo: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(amp_brid_player_TextControl, {\n\t\t\t\t\t\tlabel: amp_brid_player_('Outstream unit ID (one of video / playlist / outstream ID is required)', 'amp'),\n\t\t\t\t\t\tvalue: dataOutstream,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataOutstream: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(amp_brid_player_TextControl, {\n\t\t\t\t\t\tlabel: amp_brid_player_('Playlist ID (one of video / playlist / outstream ID is required)', 'amp'),\n\t\t\t\t\t\tvalue: dataPlaylist,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataPlaylist: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(amp_brid_player_ToggleControl, {\n\t\t\t\t\t\tlabel: amp_brid_player_('Autoplay', 'amp'),\n\t\t\t\t\t\tchecked: autoPlay,\n\t\t\t\t\t\tonChange: function onChange() {\n\t\t\t\t\t\t\treturn setAttributes({ autoPlay: !autoPlay });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\tgetLayoutControls(props, ampLayoutOptions)\n\t\t\t\t)\n\t\t\t),\n\t\t\turl && getMediaPlaceholder(amp_brid_player_('Brid Player', 'amp'), url),\n\t\t\t!url && wp.element.createElement(\n\t\t\t\tamp_brid_player_Placeholder,\n\t\t\t\t{ label: amp_brid_player_('Brid Player', 'amp') },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\t'p',\n\t\t\t\t\tnull,\n\t\t\t\t\tamp_brid_player_('Add required data to use the block.', 'amp')\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t},\n\tsave: function save(_ref) {\n\t\tvar attributes = _ref.attributes;\n\n\t\tvar bridProps = {\n\t\t\tlayout: attributes.ampLayout,\n\t\t\theight: attributes.height,\n\t\t\t'data-player': attributes.dataPlayer,\n\t\t\t'data-partner': attributes.dataPartner\n\t\t};\n\t\tif ('fixed-height' !== attributes.ampLayout && attributes.width) {\n\t\t\tbridProps.width = attributes.width;\n\t\t}\n\t\tif (attributes.dataPlaylist) {\n\t\t\tbridProps['data-playlist'] = attributes.dataPlaylist;\n\t\t}\n\t\tif (attributes.dataVideo) {\n\t\t\tbridProps['data-video'] = attributes.dataVideo;\n\t\t}\n\t\tif (attributes.dataOutstream) {\n\t\t\tbridProps['data-outstream'] = attributes.dataOutstream;\n\t\t}\n\t\tif (attributes.autoPlay) {\n\t\t\tbridProps.autoplay = attributes.autoPlay;\n\t\t}\n\t\treturn wp.element.createElement('amp-brid-player', bridProps);\n\t}\n}));\n// CONCATENATED MODULE: ./blocks/amp-ima-video/index.js\n/**\n * Helper methods for blocks.\n */\n\n\n/**\n * Internal block libraries.\n */\nvar amp_ima_video_ = wp.i18n.__;\nvar amp_ima_video_registerBlockType = wp.blocks.registerBlockType;\nvar amp_ima_video_InspectorControls = wp.editor.InspectorControls;\nvar amp_ima_video_Fragment = wp.element.Fragment;\nvar amp_ima_video_wp$components = wp.components,\n amp_ima_video_PanelBody = amp_ima_video_wp$components.PanelBody,\n amp_ima_video_TextControl = amp_ima_video_wp$components.TextControl,\n amp_ima_video_Placeholder = amp_ima_video_wp$components.Placeholder,\n amp_ima_video_ToggleControl = amp_ima_video_wp$components.ToggleControl;\n\n/**\n * Register block.\n */\n\n/* harmony default export */ var amp_ima_video = (amp_ima_video_registerBlockType('amp/amp-ima-video', {\n\ttitle: amp_ima_video_('AMP IMA Video', 'amp'),\n\tdescription: amp_ima_video_('Embeds a video player for instream video ads that are integrated with the IMA SDK', 'amp'),\n\tcategory: 'embed',\n\ticon: 'embed-generic',\n\tkeywords: [amp_ima_video_('Embed', 'amp')],\n\n\t// @todo Perhaps later add subtitles option and additional source options?\n\tattributes: {\n\t\tdataDelayAdRequest: {\n\t\t\tdefault: false,\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-ima-video',\n\t\t\tattribute: 'data-delay-ad-request'\n\t\t},\n\t\tdataTag: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-ima-video',\n\t\t\tattribute: 'data-tag'\n\t\t},\n\t\tdataSrc: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-ima-video',\n\t\t\tattribute: 'data-src'\n\t\t},\n\t\tdataPoster: {\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-ima-video',\n\t\t\tattribute: 'data-poster'\n\t\t},\n\t\tampLayout: {\n\t\t\tdefault: 'responsive',\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-ima-video',\n\t\t\tattribute: 'layout'\n\t\t},\n\t\twidth: {\n\t\t\tdefault: 600,\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-ima-video',\n\t\t\tattribute: 'width'\n\t\t},\n\t\theight: {\n\t\t\tdefault: 400,\n\t\t\tsource: 'attribute',\n\t\t\tselector: 'amp-ima-video',\n\t\t\tattribute: 'height'\n\t\t}\n\t},\n\n\tedit: function edit(props) {\n\t\tvar attributes = props.attributes,\n\t\t setAttributes = props.setAttributes;\n\t\tvar dataDelayAdRequest = attributes.dataDelayAdRequest,\n\t\t dataTag = attributes.dataTag,\n\t\t dataSrc = attributes.dataSrc,\n\t\t dataPoster = attributes.dataPoster;\n\n\t\tvar ampLayoutOptions = [{ value: 'responsive', label: amp_ima_video_('Responsive', 'amp') }, { value: 'fixed', label: amp_ima_video_('Fixed', 'amp') }];\n\t\tvar dataSet = false;\n\t\tif (dataTag && dataSrc) {\n\t\t\tdataSet = true;\n\t\t}\n\t\treturn wp.element.createElement(\n\t\t\tamp_ima_video_Fragment,\n\t\t\tnull,\n\t\t\twp.element.createElement(\n\t\t\t\tamp_ima_video_InspectorControls,\n\t\t\t\t{ key: 'inspector' },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\tamp_ima_video_PanelBody,\n\t\t\t\t\t{ title: amp_ima_video_('IMA Video Settings', 'amp') },\n\t\t\t\t\twp.element.createElement(amp_ima_video_TextControl, {\n\t\t\t\t\t\tlabel: amp_ima_video_('Https URL for your VAST ad document (required)', 'amp'),\n\t\t\t\t\t\tvalue: dataTag,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataTag: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(amp_ima_video_TextControl, {\n\t\t\t\t\t\tlabel: amp_ima_video_('Https URL of your video content (required)', 'amp'),\n\t\t\t\t\t\tvalue: dataSrc,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataSrc: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(amp_ima_video_TextControl, {\n\t\t\t\t\t\tlabel: amp_ima_video_('Https URL to preview image', 'amp'),\n\t\t\t\t\t\tvalue: dataPoster,\n\t\t\t\t\t\tonChange: function onChange(value) {\n\t\t\t\t\t\t\treturn setAttributes({ dataPoster: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(amp_ima_video_ToggleControl, {\n\t\t\t\t\t\tlabel: amp_ima_video_('Delay Ad Request', 'amp'),\n\t\t\t\t\t\tchecked: dataDelayAdRequest,\n\t\t\t\t\t\tonChange: function onChange() {\n\t\t\t\t\t\t\treturn setAttributes({ dataDelayAdRequest: !dataDelayAdRequest });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\tgetLayoutControls(props, ampLayoutOptions)\n\t\t\t\t)\n\t\t\t),\n\t\t\tdataSet && getMediaPlaceholder(amp_ima_video_('IMA Video', 'amp'), dataSrc),\n\t\t\t!dataSet && wp.element.createElement(\n\t\t\t\tamp_ima_video_Placeholder,\n\t\t\t\t{ label: amp_ima_video_('IMA Video', 'amp') },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\t'p',\n\t\t\t\t\tnull,\n\t\t\t\t\tamp_ima_video_('Add required data to use the block.', 'amp')\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t},\n\tsave: function save(_ref) {\n\t\tvar attributes = _ref.attributes;\n\n\t\tvar imaProps = {\n\t\t\tlayout: attributes.ampLayout,\n\t\t\theight: attributes.height,\n\t\t\twidth: attributes.width,\n\t\t\t'data-tag': attributes.dataTag,\n\t\t\t'data-src': attributes.dataSrc\n\t\t};\n\t\tif (attributes.dataPoster) {\n\t\t\timaProps['data-poster'] = attributes.dataPoster;\n\t\t}\n\t\tif (attributes.dataDelayAdRequest) {\n\t\t\timaProps['data-delay-ad-request'] = attributes.dataDelayAdRequest;\n\t\t}\n\t\treturn wp.element.createElement('amp-ima-video', imaProps);\n\t}\n}));\n// CONCATENATED MODULE: ./blocks/index.js\n/**\n * Import blocks.\n */\n\n\n\n\n\n\n\n\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJm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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/amp-editor-blocks.js CHANGED
@@ -37,7 +37,6 @@ var ampEditorBlocks = ( function() { // eslint-disable-line no-unused-vars
37
  value: 'responsive',
38
  label: __( 'Responsive', 'amp' ),
39
  notAvailable: [
40
- 'core/audio',
41
  'core-embed/soundcloud'
42
  ]
43
  },
@@ -50,7 +49,6 @@ var ampEditorBlocks = ( function() { // eslint-disable-line no-unused-vars
50
  value: 'fill',
51
  label: __( 'Fill', 'amp' ),
52
  notAvailable: [
53
- 'core/audio',
54
  'core-embed/soundcloud'
55
  ]
56
  },
@@ -58,7 +56,6 @@ var ampEditorBlocks = ( function() { // eslint-disable-line no-unused-vars
58
  value: 'flex-item',
59
  label: __( 'Flex Item', 'amp' ),
60
  notAvailable: [
61
- 'core/audio',
62
  'core-embed/soundcloud'
63
  ]
64
  },
@@ -67,7 +64,6 @@ var ampEditorBlocks = ( function() { // eslint-disable-line no-unused-vars
67
  value: 'intrinsic',
68
  label: __( 'Intrinsic', 'amp' ),
69
  notAvailable: [
70
- 'core/audio',
71
  'core-embed/youtube',
72
  'core-embed/facebook',
73
  'core-embed/instagram',
@@ -83,8 +79,7 @@ var ampEditorBlocks = ( function() { // eslint-disable-line no-unused-vars
83
  defaultHeight: 400,
84
  mediaBlocks: [
85
  'core/image',
86
- 'core/video',
87
- 'core/audio'
88
  ],
89
  textBlocks: [
90
  'core/paragraph',
@@ -628,7 +623,7 @@ var ampEditorBlocks = ( function() { // eslint-disable-line no-unused-vars
628
  var ampCarousel = props.attributes.ampCarousel,
629
  el = wp.element.createElement,
630
  ToggleControl = wp.components.ToggleControl,
631
- label = __( 'Display as AMP carousel' );
632
 
633
  return el( ToggleControl, {
634
  label: label,
37
  value: 'responsive',
38
  label: __( 'Responsive', 'amp' ),
39
  notAvailable: [
 
40
  'core-embed/soundcloud'
41
  ]
42
  },
49
  value: 'fill',
50
  label: __( 'Fill', 'amp' ),
51
  notAvailable: [
 
52
  'core-embed/soundcloud'
53
  ]
54
  },
56
  value: 'flex-item',
57
  label: __( 'Flex Item', 'amp' ),
58
  notAvailable: [
 
59
  'core-embed/soundcloud'
60
  ]
61
  },
64
  value: 'intrinsic',
65
  label: __( 'Intrinsic', 'amp' ),
66
  notAvailable: [
 
67
  'core-embed/youtube',
68
  'core-embed/facebook',
69
  'core-embed/instagram',
79
  defaultHeight: 400,
80
  mediaBlocks: [
81
  'core/image',
82
+ 'core/video'
 
83
  ],
84
  textBlocks: [
85
  'core/paragraph',
623
  var ampCarousel = props.attributes.ampCarousel,
624
  el = wp.element.createElement,
625
  ToggleControl = wp.components.ToggleControl,
626
+ label = __( 'Display as carousel' );
627
 
628
  return el( ToggleControl, {
629
  label: label,
assets/js/amp-service-worker-runtime-precaching.js ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ /* global URLS */
2
+ // See AMP_Service_Workers::add_amp_runtime_caching() and <https://github.com/ampproject/amp-by-example/blob/a4d798cac6a534e0c46e78944a2718a8dab3c057/boilerplate-generator/templates/files/serviceworkerJs.js#L9-L22>.
3
+ {
4
+ self.addEventListener( 'install', event => {
5
+ event.waitUntil(
6
+ caches.open( wp.serviceWorker.core.cacheNames.runtime ).then( cache => cache.addAll( URLS ) )
7
+ );
8
+ } );
9
+ }
assets/js/amp-validated-url-post-edit-screen.js CHANGED
@@ -120,7 +120,7 @@ const ampValidatedUrlPostEditScreen = ( function() { // eslint-disable-line no-u
120
  tr.classList.add( 'hidden' );
121
  } else if ( null !== numberErrorsDisplaying ) {
122
  // Update the number of errors displaying and create a 'Show all' button if it does not exist yet.
123
- document.getElementById( component.idNumberErrors ).innerText = component.data.l10n.showing_number_errors.replace( '%', numberErrorsDisplaying );
124
  document.getElementById( component.idNumberErrors ).classList.remove( 'hidden' );
125
  component.conditionallyCreateShowAllButton();
126
  if ( document.getElementById( component.showAllId ) ) {
120
  tr.classList.add( 'hidden' );
121
  } else if ( null !== numberErrorsDisplaying ) {
122
  // Update the number of errors displaying and create a 'Show all' button if it does not exist yet.
123
+ document.getElementById( component.idNumberErrors ).innerText = component.data.l10n.showing_number_errors.replace( '%1$s', numberErrorsDisplaying );
124
  document.getElementById( component.idNumberErrors ).classList.remove( 'hidden' );
125
  component.conditionallyCreateShowAllButton();
126
  if ( document.getElementById( component.showAllId ) ) {
assets/js/amp-validation-detail-toggle-compiled.js CHANGED
@@ -1,83 +1 @@
1
- /******/ (function(modules) { // webpackBootstrap
2
- /******/ // The module cache
3
- /******/ var installedModules = {};
4
- /******/
5
- /******/ // The require function
6
- /******/ function __webpack_require__(moduleId) {
7
- /******/
8
- /******/ // Check if module is in cache
9
- /******/ if(installedModules[moduleId]) {
10
- /******/ return installedModules[moduleId].exports;
11
- /******/ }
12
- /******/ // Create a new module (and put it into the cache)
13
- /******/ var module = installedModules[moduleId] = {
14
- /******/ i: moduleId,
15
- /******/ l: false,
16
- /******/ exports: {}
17
- /******/ };
18
- /******/
19
- /******/ // Execute the module function
20
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
21
- /******/
22
- /******/ // Flag the module as loaded
23
- /******/ module.l = true;
24
- /******/
25
- /******/ // Return the exports of the module
26
- /******/ return module.exports;
27
- /******/ }
28
- /******/
29
- /******/
30
- /******/ // expose the modules object (__webpack_modules__)
31
- /******/ __webpack_require__.m = modules;
32
- /******/
33
- /******/ // expose the module cache
34
- /******/ __webpack_require__.c = installedModules;
35
- /******/
36
- /******/ // define getter function for harmony exports
37
- /******/ __webpack_require__.d = function(exports, name, getter) {
38
- /******/ if(!__webpack_require__.o(exports, name)) {
39
- /******/ Object.defineProperty(exports, name, {
40
- /******/ configurable: false,
41
- /******/ enumerable: true,
42
- /******/ get: getter
43
- /******/ });
44
- /******/ }
45
- /******/ };
46
- /******/
47
- /******/ // getDefaultExport function for compatibility with non-harmony modules
48
- /******/ __webpack_require__.n = function(module) {
49
- /******/ var getter = module && module.__esModule ?
50
- /******/ function getDefault() { return module['default']; } :
51
- /******/ function getModuleExports() { return module; };
52
- /******/ __webpack_require__.d(getter, 'a', getter);
53
- /******/ return getter;
54
- /******/ };
55
- /******/
56
- /******/ // Object.prototype.hasOwnProperty.call
57
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
58
- /******/
59
- /******/ // __webpack_public_path__
60
- /******/ __webpack_require__.p = "";
61
- /******/
62
- /******/ // Load entry module and return exports
63
- /******/ return __webpack_require__(__webpack_require__.s = 76);
64
- /******/ })
65
- /************************************************************************/
66
- /******/ ({
67
-
68
- /***/ 76:
69
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
70
-
71
- "use strict";
72
- eval("Object.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_amp_validation_i18n__ = __webpack_require__(77);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_amp_validation_i18n___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_amp_validation_i18n__);\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\n/**\n * Localized data\n */\n\n\nvar OPEN_CLASS = 'is-open';\n\n/**\n * Adds detail toggle buttons to the header and footer rows of the validation error \"details\" column.\n * The buttons are added via JS because there's no easy way to append them to the heading of a sortable\n * table column via backend code.\n *\n * @param {string} containerSelector Selector for elements that will have the button added.\n * @param {string} ariaLabel Screen reader label for the button.\n * @return {Array} Array of added buttons.\n */\nfunction addToggleButtons(containerSelector, ariaLabel) {\n\tvar addButton = function addButton(container) {\n\t\tvar button = document.createElement('button');\n\t\tbutton.setAttribute('aria-label', ariaLabel);\n\t\tbutton.setAttribute('type', 'button');\n\t\tbutton.setAttribute('class', 'error-details-toggle');\n\t\tcontainer.appendChild(button);\n\n\t\treturn button;\n\t};\n\n\treturn [].concat(_toConsumableArray(document.querySelectorAll(containerSelector))).map(function (container) {\n\t\treturn addButton(container);\n\t});\n}\n\nfunction addToggleAllListener(_ref) {\n\tvar btn = _ref.btn,\n\t _ref$toggleAllButtonS = _ref.toggleAllButtonSelector,\n\t toggleAllButtonSelector = _ref$toggleAllButtonS === undefined ? null : _ref$toggleAllButtonS,\n\t targetDetailsSelector = _ref.targetDetailsSelector;\n\n\tvar open = false;\n\n\tvar targetDetails = [].concat(_toConsumableArray(document.querySelectorAll(targetDetailsSelector)));\n\n\tvar toggleAllButtons = [];\n\tif (toggleAllButtonSelector) {\n\t\ttoggleAllButtons = [].concat(_toConsumableArray(document.querySelectorAll(toggleAllButtonSelector)));\n\t}\n\n\tvar onButtonClick = function onButtonClick() {\n\t\topen = !open;\n\t\ttoggleAllButtons.forEach(function (toggleAllButton) {\n\t\t\ttoggleAllButton.classList.toggle(OPEN_CLASS);\n\t\t});\n\n\t\ttargetDetails.forEach(function (detail) {\n\t\t\tif (open) {\n\t\t\t\tdetail.setAttribute('open', true);\n\t\t\t} else {\n\t\t\t\tdetail.removeAttribute('open');\n\t\t\t}\n\t\t});\n\t};\n\n\tbtn.addEventListener('click', onButtonClick);\n}\n\n/**\n * Adds classes to the rows for the amp_validation_error term list table.\n *\n * This is needed because \\WP_Terms_List_Table::single_row() does not allow for additional\n * attributes to be added to the <tr> element.\n */\nfunction addTermListTableRowClasses() {\n\tvar rows = [].concat(_toConsumableArray(document.querySelectorAll('#the-list tr')));\n\trows.forEach(function (row) {\n\t\tvar statusText = row.querySelector('.column-status > .status-text');\n\t\tif (statusText) {\n\t\t\trow.classList.toggle('new', statusText.classList.contains('new'));\n\t\t\trow.classList.toggle('accepted', statusText.classList.contains('accepted'));\n\t\t\trow.classList.toggle('rejected', statusText.classList.contains('rejected'));\n\t\t}\n\t});\n}\n\nwp.domReady(function () {\n\taddToggleButtons('th.column-details.manage-column', __WEBPACK_IMPORTED_MODULE_0_amp_validation_i18n__[\"detailToggleBtnAriaLabel\"]).forEach(function (btn) {\n\t\taddToggleAllListener({\n\t\t\tbtn: btn,\n\t\t\ttoggleAllButtonSelector: '.column-details button.error-details-toggle',\n\t\t\ttargetDetailsSelector: '.column-details details'\n\t\t});\n\t});\n\n\taddToggleButtons('th.manage-column.column-sources_with_invalid_output', __WEBPACK_IMPORTED_MODULE_0_amp_validation_i18n__[\"sourcesToggleBtnAriaLabel\"]).forEach(function (btn) {\n\t\taddToggleAllListener({\n\t\t\tbtn: btn,\n\t\t\ttoggleAllButtonSelector: '.column-sources_with_invalid_output button.error-details-toggle',\n\t\t\ttargetDetailsSelector: 'details.source'\n\t\t});\n\t});\n\n\taddTermListTableRowClasses();\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9hc3NldHMvc3JjL2FtcC12YWxpZGF0aW9uLWRldGFpbC10b2dnbGUuanM/YmUxMiJdLCJzb3VyY2VzQ29udGVudCI6WyJmdW5jdGlvbiBfdG9Db25zdW1hYmxlQXJyYXkoYXJyKSB7IGlmIChBcnJheS5pc0FycmF5KGFycikpIHsgZm9yICh2YXIgaSA9IDAsIGFycjIgPSBBcnJheShhcnIubGVuZ3RoKTsgaSA8IGFyci5sZW5ndGg7IGkrKykgeyBhcnIyW2ldID0gYXJyW2ldOyB9IHJldHVybiBhcnIyOyB9IGVsc2UgeyByZXR1cm4gQXJyYXkuZnJvbShhcnIpOyB9IH1cblxuLyoqXG4gKiBMb2NhbGl6ZWQgZGF0YVxuICovXG5pbXBvcnQgeyBkZXRhaWxUb2dnbGVCdG5BcmlhTGFiZWwsIHNvdXJjZXN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E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///76\n");
73
-
74
- /***/ }),
75
-
76
- /***/ 77:
77
- /***/ (function(module, exports) {
78
-
79
- module.exports = ampValidationI18n;
80
-
81
- /***/ })
82
-
83
- /******/ });
1
+ !function(t){var n={};function l(e){if(n[e])return n[e].exports;var c=n[e]={i:e,l:!1,exports:{}};return t[e].call(c.exports,c,c.exports,l),c.l=!0,c.exports}l.m=t,l.c=n,l.d=function(t,n,e){l.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:e})},l.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},l.t=function(t,n){if(1&n&&(t=l(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var e=Object.create(null);if(l.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var c in t)l.d(e,c,function(n){return t[n]}.bind(null,c));return e},l.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return l.d(n,"a",n),n},l.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},l.p="",l(l.s=5)}({2:function(module,exports){eval("module.exports = ampValidationI18n;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy9leHRlcm5hbCBcImFtcFZhbGlkYXRpb25JMThuXCI/YWE5ZCJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IGFtcFZhbGlkYXRpb25JMThuOyJdLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///2\n")},5:function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var amp_validation_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);\n/* harmony import */ var amp_validation_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(amp_validation_i18n__WEBPACK_IMPORTED_MODULE_0__);\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\n/**\n * Localized data\n */\n\n\nvar OPEN_CLASS = 'is-open';\n\n/**\n * Adds detail toggle buttons to the header and footer rows of the validation error \"details\" column.\n * The buttons are added via JS because there's no easy way to append them to the heading of a sortable\n * table column via backend code.\n *\n * @param {string} containerSelector Selector for elements that will have the button added.\n * @param {string} ariaLabel Screen reader label for the button.\n * @return {Array} Array of added buttons.\n */\nfunction addToggleButtons(containerSelector, ariaLabel) {\n\tvar addButton = function addButton(container) {\n\t\tvar button = document.createElement('button');\n\t\tbutton.setAttribute('aria-label', ariaLabel);\n\t\tbutton.setAttribute('type', 'button');\n\t\tbutton.setAttribute('class', 'error-details-toggle');\n\t\tcontainer.appendChild(button);\n\n\t\treturn button;\n\t};\n\n\treturn [].concat(_toConsumableArray(document.querySelectorAll(containerSelector))).map(function (container) {\n\t\treturn addButton(container);\n\t});\n}\n\nfunction addToggleAllListener(_ref) {\n\tvar btn = _ref.btn,\n\t _ref$toggleAllButtonS = _ref.toggleAllButtonSelector,\n\t toggleAllButtonSelector = _ref$toggleAllButtonS === undefined ? null : _ref$toggleAllButtonS,\n\t targetDetailsSelector = _ref.targetDetailsSelector;\n\n\tvar open = false;\n\n\tvar targetDetails = [].concat(_toConsumableArray(document.querySelectorAll(targetDetailsSelector)));\n\n\tvar toggleAllButtons = [];\n\tif (toggleAllButtonSelector) {\n\t\ttoggleAllButtons = [].concat(_toConsumableArray(document.querySelectorAll(toggleAllButtonSelector)));\n\t}\n\n\tvar onButtonClick = function onButtonClick() {\n\t\topen = !open;\n\t\ttoggleAllButtons.forEach(function (toggleAllButton) {\n\t\t\ttoggleAllButton.classList.toggle(OPEN_CLASS);\n\t\t});\n\n\t\ttargetDetails.forEach(function (detail) {\n\t\t\tif (open) {\n\t\t\t\tdetail.setAttribute('open', true);\n\t\t\t} else {\n\t\t\t\tdetail.removeAttribute('open');\n\t\t\t}\n\t\t});\n\t};\n\n\tbtn.addEventListener('click', onButtonClick);\n}\n\n/**\n * Adds classes to the rows for the amp_validation_error term list table.\n *\n * This is needed because \\WP_Terms_List_Table::single_row() does not allow for additional\n * attributes to be added to the <tr> element.\n */\nfunction addTermListTableRowClasses() {\n\tvar rows = [].concat(_toConsumableArray(document.querySelectorAll('#the-list tr')));\n\trows.forEach(function (row) {\n\t\tvar statusText = row.querySelector('.column-status > .status-text');\n\t\tif (statusText) {\n\t\t\trow.classList.toggle('new', statusText.classList.contains('new'));\n\t\t\trow.classList.toggle('accepted', statusText.classList.contains('accepted'));\n\t\t\trow.classList.toggle('rejected', statusText.classList.contains('rejected'));\n\t\t}\n\t});\n}\n\nwp.domReady(function () {\n\taddToggleButtons('th.column-details.manage-column', amp_validation_i18n__WEBPACK_IMPORTED_MODULE_0__[\"detailToggleBtnAriaLabel\"]).forEach(function (btn) {\n\t\taddToggleAllListener({\n\t\t\tbtn: btn,\n\t\t\ttoggleAllButtonSelector: '.column-details button.error-details-toggle',\n\t\t\ttargetDetailsSelector: '.column-details details'\n\t\t});\n\t});\n\n\taddToggleButtons('th.manage-column.column-sources_with_invalid_output', amp_validation_i18n__WEBPACK_IMPORTED_MODULE_0__[\"sourcesToggleBtnAriaLabel\"]).forEach(function (btn) {\n\t\taddToggleAllListener({\n\t\t\tbtn: btn,\n\t\t\ttoggleAllButtonSelector: '.column-sources_with_invalid_output button.error-details-toggle',\n\t\t\ttargetDetailsSelector: 'details.source'\n\t\t});\n\t});\n\n\taddTermListTableRowClasses();\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2Fzc2V0cy9zcmMvYW1wLXZhbGlkYXRpb24tZGV0YWlsLXRvZ2dsZS5qcz81YjZhIl0sInNvdXJjZXNDb250ZW50IjpbImZ1bmN0aW9uIF90b0NvbnN1bWFibGVBcnJheShhcnIpIHsgaWYgKEFycmF5LmlzQXJyYXkoYXJyKSkgeyBmb3IgKHZhciBpID0gMCwgYXJyMiA9IEFycmF5KGFyci5sZW5ndGgpOyBpIDwgYXJyLmxlbmd0aDsgaSsrKSB7IGFycjJbaV0gPSBhcnJbaV07IH0gcmV0dXJuIGFycjI7IH0gZWxzZSB7IHJldHVybiBBcnJheS5mcm9tKGFycik7IH0gfVxuXG4vKipcbiAqIExvY2FsaXplZCBkYXRhXG4gKi9cbmltcG9ydCB7IGRldGFpbFRvZ2dsZUJ0bkFyaWFMYWJlbCwgc291cmNlc1RvZ2dsZUJ0bkFyaWFMYWJlbCB9IGZyb20gJ2FtcC12YWxpZGF0aW9uLWkxOG4nO1xuXG52YXIgT1BFTl9DTEFTUyA9ICdpcy1vcGVuJztcblxuLyoqXG4gKiBBZGRzIGRldGFpbCB0b2dnbGUgYnV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tBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///5\n")}});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/amp-validation-single-error-url-details-compiled.js CHANGED
@@ -1,75 +1 @@
1
- /******/ (function(modules) { // webpackBootstrap
2
- /******/ // The module cache
3
- /******/ var installedModules = {};
4
- /******/
5
- /******/ // The require function
6
- /******/ function __webpack_require__(moduleId) {
7
- /******/
8
- /******/ // Check if module is in cache
9
- /******/ if(installedModules[moduleId]) {
10
- /******/ return installedModules[moduleId].exports;
11
- /******/ }
12
- /******/ // Create a new module (and put it into the cache)
13
- /******/ var module = installedModules[moduleId] = {
14
- /******/ i: moduleId,
15
- /******/ l: false,
16
- /******/ exports: {}
17
- /******/ };
18
- /******/
19
- /******/ // Execute the module function
20
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
21
- /******/
22
- /******/ // Flag the module as loaded
23
- /******/ module.l = true;
24
- /******/
25
- /******/ // Return the exports of the module
26
- /******/ return module.exports;
27
- /******/ }
28
- /******/
29
- /******/
30
- /******/ // expose the modules object (__webpack_modules__)
31
- /******/ __webpack_require__.m = modules;
32
- /******/
33
- /******/ // expose the module cache
34
- /******/ __webpack_require__.c = installedModules;
35
- /******/
36
- /******/ // define getter function for harmony exports
37
- /******/ __webpack_require__.d = function(exports, name, getter) {
38
- /******/ if(!__webpack_require__.o(exports, name)) {
39
- /******/ Object.defineProperty(exports, name, {
40
- /******/ configurable: false,
41
- /******/ enumerable: true,
42
- /******/ get: getter
43
- /******/ });
44
- /******/ }
45
- /******/ };
46
- /******/
47
- /******/ // getDefaultExport function for compatibility with non-harmony modules
48
- /******/ __webpack_require__.n = function(module) {
49
- /******/ var getter = module && module.__esModule ?
50
- /******/ function getDefault() { return module['default']; } :
51
- /******/ function getModuleExports() { return module; };
52
- /******/ __webpack_require__.d(getter, 'a', getter);
53
- /******/ return getter;
54
- /******/ };
55
- /******/
56
- /******/ // Object.prototype.hasOwnProperty.call
57
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
58
- /******/
59
- /******/ // __webpack_public_path__
60
- /******/ __webpack_require__.p = "";
61
- /******/
62
- /******/ // Load entry module and return exports
63
- /******/ return __webpack_require__(__webpack_require__.s = 78);
64
- /******/ })
65
- /************************************************************************/
66
- /******/ ({
67
-
68
- /***/ 78:
69
- /***/ (function(module, exports) {
70
-
71
- eval("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; }; }();\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Toggles the contents of a details element as an additional table tr.\n */\nvar RowToggler = function () {\n\tfunction RowToggler(tr, index) {\n\t\t_classCallCheck(this, RowToggler);\n\n\t\tthis.tr = tr;\n\t\tthis.index = index;\n\n\t\t// Since we're adding additional rows, we need to override default .striped tables styles.\n\t\tthis.tr.classList.add(this.index % 2 ? 'odd' : 'even'); // eslint-disable-line no-magic-numbers\n\n\t\tthis.toggle = this.toggle.bind(this);\n\t}\n\n\t/**\n * Sets up the new tr and adds an event listener to toggle details.\n */\n\n\n\t_createClass(RowToggler, [{\n\t\tkey: 'init',\n\t\tvalue: function init() {\n\t\t\tvar _this = this;\n\n\t\t\tthis.details = this.tr.querySelector('.column-details details');\n\t\t\tif (this.details) {\n\t\t\t\tthis.createNewTr();\n\t\t\t\tvar togglers = [].concat(_toConsumableArray(this.tr.querySelectorAll('.single-url-detail-toggle')), [this.details.querySelector('summary')]);\n\n\t\t\t\ttogglers.forEach(function (el) {\n\t\t\t\t\tel.addEventListener('click', function () {\n\t\t\t\t\t\t_this.toggle(el);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t/**\n * Creates the details table row from the original row's <details> element content, minus the summary.\n */\n\n\t}, {\n\t\tkey: 'createNewTr',\n\t\tvalue: function createNewTr() {\n\t\t\tthis.newTr = document.createElement('tr');\n\t\t\tthis.newTr.classList.add('details');\n\t\t\tthis.newTr.classList.add(this.index % 2 ? 'odd' : 'even'); // eslint-disable-line no-magic-numbers\n\n\t\t\tvar newCell = document.createElement('td');\n\t\t\tnewCell.setAttribute('colspan', this.getRowColspan());\n\n\t\t\tvar _iteratorNormalCompletion = true;\n\t\t\tvar _didIteratorError = false;\n\t\t\tvar _iteratorError = undefined;\n\n\t\t\ttry {\n\t\t\t\tfor (var _iterator = this.details.childNodes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\t\tvar childNode = _step.value;\n\n\t\t\t\t\tif ('SUMMARY' !== childNode.tagName) {\n\t\t\t\t\t\tnewCell.appendChild(childNode.cloneNode(true));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t_didIteratorError = true;\n\t\t\t\t_iteratorError = err;\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return) {\n\t\t\t\t\t\t_iterator.return();\n\t\t\t\t\t}\n\t\t\t\t} finally {\n\t\t\t\t\tif (_didIteratorError) {\n\t\t\t\t\t\tthrow _iteratorError;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.newTr.appendChild(newCell);\n\t\t}\n\n\t\t/**\n * Gets the number of cells within the original row.\n *\n * @return {number} The number of cells.\n */\n\n\t}, {\n\t\tkey: 'getRowColspan',\n\t\tvalue: function getRowColspan() {\n\t\t\treturn [].concat(_toConsumableArray(this.tr.childNodes)).filter(function (childNode) {\n\t\t\t\treturn ['TD', 'TH'].includes(childNode.tagName);\n\t\t\t}).length;\n\t\t}\n\n\t\t/**\n * Toggles the additional row.\n *\n * @param {Object} target The click event target.\n */\n\n\t}, {\n\t\tkey: 'toggle',\n\t\tvalue: function toggle(target) {\n\t\t\tif (this.tr.classList.contains('expanded')) {\n\t\t\t\tthis.onClose(target);\n\t\t\t} else {\n\t\t\t\tthis.onOpen(target);\n\t\t\t}\n\t\t}\n\n\t\t/**\n * Adds the additional row.\n *\n * @param {Object} target The click event target.\n */\n\n\t}, {\n\t\tkey: 'onOpen',\n\t\tvalue: function onOpen(target) {\n\t\t\tthis.tr.parentNode.insertBefore(this.newTr, this.tr.nextSibling);\n\t\t\tthis.tr.classList.add('expanded');\n\n\t\t\tif ('SUMMARY' !== target.tagName) {\n\t\t\t\t// This browser will do this if the summary was clicked.\n\t\t\t\tthis.details.setAttribute('open', true);\n\t\t\t}\n\t\t}\n\n\t\t/**\n * Removes the additional row.\n *\n * @param {Object} target The click event target.\n */\n\n\t}, {\n\t\tkey: 'onClose',\n\t\tvalue: function onClose(target) {\n\t\t\tthis.tr.parentNode.removeChild(this.newTr);\n\t\t\tthis.tr.classList.remove('expanded');\n\n\t\t\tif ('SUMMARY' !== target.tagName) {\n\t\t\t\tthis.details.removeAttribute('open');\n\t\t\t}\n\t\t}\n\t}]);\n\n\treturn RowToggler;\n}();\n\n/**\n * Sets up expandable details for errors when viewing a single URL error list.\n */\n\n\nvar ErrorRows = function () {\n\tfunction ErrorRows() {\n\t\t_classCallCheck(this, ErrorRows);\n\n\t\tthis.rows = [].concat(_toConsumableArray(document.querySelectorAll('.wp-list-table tr[id^=\"tag-\"]'))).map(function (tr, index) {\n\t\t\tvar rowHandler = new RowToggler(tr, index);\n\t\t\trowHandler.init();\n\t\t\treturn rowHandler;\n\t\t}).filter(function (row) {\n\t\t\treturn row.details;\n\t\t});\n\t}\n\n\t_createClass(ErrorRows, [{\n\t\tkey: 'init',\n\t\tvalue: function init() {\n\t\t\tthis.addToggleAllListener();\n\t\t}\n\n\t\t/**\n * Handle 'toggle all' buttons on the page.\n */\n\n\t}, {\n\t\tkey: 'addToggleAllListener',\n\t\tvalue: function addToggleAllListener() {\n\t\t\tvar _this2 = this;\n\n\t\t\tvar open = false;\n\t\t\tvar toggleButtons = [].concat(_toConsumableArray(document.querySelectorAll('.column-details button.error-details-toggle')));\n\n\t\t\tvar onButtonClick = function onButtonClick(target) {\n\t\t\t\topen = !open;\n\t\t\t\t_this2.rows.forEach(function (row) {\n\t\t\t\t\tif (open) {\n\t\t\t\t\t\trow.onOpen(target);\n\t\t\t\t\t} else {\n\t\t\t\t\t\trow.onClose(target);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t};\n\n\t\t\twindow.addEventListener('click', function (event) {\n\t\t\t\tif (toggleButtons.includes(event.target)) {\n\t\t\t\t\tonButtonClick(event.target);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}]);\n\n\treturn ErrorRows;\n}();\n\nwp.domReady(function () {\n\tnew ErrorRows().init();\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9hc3NldHMvc3JjL2FtcC12YWxpZGF0aW9uLXNpbmdsZS1lcnJvci11cmwtZGV0YWlscy5qcz80OTI0Il0sInNvdXJjZXNDb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- /******/ });
1
+ !function(t){var n={};function c(d){if(n[d])return n[d].exports;var l=n[d]={i:d,l:!1,exports:{}};return t[d].call(l.exports,l,l.exports,c),l.l=!0,l.exports}c.m=t,c.c=n,c.d=function(t,n,d){c.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:d})},c.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},c.t=function(t,n){if(1&n&&(t=c(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var d=Object.create(null);if(c.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var l in t)c.d(d,l,function(n){return t[n]}.bind(null,l));return d},c.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return c.d(n,"a",n),n},c.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},c.p="",c(c.s=6)}({6:function(module,exports){eval("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; }; }();\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Toggles the contents of a details element as an additional table tr.\n */\nvar RowToggler = function () {\n\tfunction RowToggler(tr, index) {\n\t\t_classCallCheck(this, RowToggler);\n\n\t\tthis.tr = tr;\n\t\tthis.index = index;\n\n\t\t// Since we're adding additional rows, we need to override default .striped tables styles.\n\t\tthis.tr.classList.add(this.index % 2 ? 'odd' : 'even'); // eslint-disable-line no-magic-numbers\n\n\t\tthis.toggle = this.toggle.bind(this);\n\t}\n\n\t/**\n * Sets up the new tr and adds an event listener to toggle details.\n */\n\n\n\t_createClass(RowToggler, [{\n\t\tkey: 'init',\n\t\tvalue: function init() {\n\t\t\tvar _this = this;\n\n\t\t\tthis.details = this.tr.querySelector('.column-details details');\n\t\t\tif (this.details) {\n\t\t\t\tthis.createNewTr();\n\t\t\t\tvar togglers = [].concat(_toConsumableArray(this.tr.querySelectorAll('.single-url-detail-toggle')), [this.details.querySelector('summary')]);\n\n\t\t\t\ttogglers.forEach(function (el) {\n\t\t\t\t\tel.addEventListener('click', function () {\n\t\t\t\t\t\t_this.toggle(el);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t/**\n * Creates the details table row from the original row's <details> element content, minus the summary.\n */\n\n\t}, {\n\t\tkey: 'createNewTr',\n\t\tvalue: function createNewTr() {\n\t\t\tthis.newTr = document.createElement('tr');\n\t\t\tthis.newTr.classList.add('details');\n\t\t\tthis.newTr.classList.add(this.index % 2 ? 'odd' : 'even'); // eslint-disable-line no-magic-numbers\n\n\t\t\tvar newCell = document.createElement('td');\n\t\t\tnewCell.setAttribute('colspan', this.getRowColspan());\n\n\t\t\tvar _iteratorNormalCompletion = true;\n\t\t\tvar _didIteratorError = false;\n\t\t\tvar _iteratorError = undefined;\n\n\t\t\ttry {\n\t\t\t\tfor (var _iterator = this.details.childNodes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\t\tvar childNode = _step.value;\n\n\t\t\t\t\tif ('SUMMARY' !== childNode.tagName) {\n\t\t\t\t\t\tnewCell.appendChild(childNode.cloneNode(true));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t_didIteratorError = true;\n\t\t\t\t_iteratorError = err;\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return) {\n\t\t\t\t\t\t_iterator.return();\n\t\t\t\t\t}\n\t\t\t\t} finally {\n\t\t\t\t\tif (_didIteratorError) {\n\t\t\t\t\t\tthrow _iteratorError;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.newTr.appendChild(newCell);\n\t\t}\n\n\t\t/**\n * Gets the number of cells within the original row.\n *\n * @return {number} The number of cells.\n */\n\n\t}, {\n\t\tkey: 'getRowColspan',\n\t\tvalue: function getRowColspan() {\n\t\t\treturn [].concat(_toConsumableArray(this.tr.childNodes)).filter(function (childNode) {\n\t\t\t\treturn ['TD', 'TH'].includes(childNode.tagName);\n\t\t\t}).length;\n\t\t}\n\n\t\t/**\n * Toggles the additional row.\n *\n * @param {Object} target The click event target.\n */\n\n\t}, {\n\t\tkey: 'toggle',\n\t\tvalue: function toggle(target) {\n\t\t\tif (this.tr.classList.contains('expanded')) {\n\t\t\t\tthis.onClose(target);\n\t\t\t} else {\n\t\t\t\tthis.onOpen(target);\n\t\t\t}\n\t\t}\n\n\t\t/**\n * Adds the additional row.\n *\n * @param {Object} target The click event target.\n */\n\n\t}, {\n\t\tkey: 'onOpen',\n\t\tvalue: function onOpen(target) {\n\t\t\tthis.tr.parentNode.insertBefore(this.newTr, this.tr.nextSibling);\n\t\t\tthis.tr.classList.add('expanded');\n\n\t\t\tif ('SUMMARY' !== target.tagName) {\n\t\t\t\t// This browser will do this if the summary was clicked.\n\t\t\t\tthis.details.setAttribute('open', true);\n\t\t\t}\n\t\t}\n\n\t\t/**\n * Removes the additional row.\n *\n * @param {Object} target The click event target.\n */\n\n\t}, {\n\t\tkey: 'onClose',\n\t\tvalue: function onClose(target) {\n\t\t\tthis.tr.parentNode.removeChild(this.newTr);\n\t\t\tthis.tr.classList.remove('expanded');\n\n\t\t\tif ('SUMMARY' !== target.tagName) {\n\t\t\t\tthis.details.removeAttribute('open');\n\t\t\t}\n\t\t}\n\t}]);\n\n\treturn RowToggler;\n}();\n\n/**\n * Sets up expandable details for errors when viewing a single URL error list.\n */\n\n\nvar ErrorRows = function () {\n\tfunction ErrorRows() {\n\t\t_classCallCheck(this, ErrorRows);\n\n\t\tthis.rows = [].concat(_toConsumableArray(document.querySelectorAll('.wp-list-table tr[id^=\"tag-\"]'))).map(function (tr, index) {\n\t\t\tvar rowHandler = new RowToggler(tr, index);\n\t\t\trowHandler.init();\n\t\t\treturn rowHandler;\n\t\t}).filter(function (row) {\n\t\t\treturn row.details;\n\t\t});\n\t}\n\n\t_createClass(ErrorRows, [{\n\t\tkey: 'init',\n\t\tvalue: function init() {\n\t\t\tthis.addToggleAllListener();\n\t\t}\n\n\t\t/**\n * Handle 'toggle all' buttons on the page.\n */\n\n\t}, {\n\t\tkey: 'addToggleAllListener',\n\t\tvalue: function addToggleAllListener() {\n\t\t\tvar _this2 = this;\n\n\t\t\tvar open = false;\n\t\t\tvar toggleButtons = [].concat(_toConsumableArray(document.querySelectorAll('.column-details button.error-details-toggle')));\n\n\t\t\tvar onButtonClick = function onButtonClick(target) {\n\t\t\t\topen = !open;\n\t\t\t\t_this2.rows.forEach(function (row) {\n\t\t\t\t\tif (open) {\n\t\t\t\t\t\trow.onOpen(target);\n\t\t\t\t\t} else {\n\t\t\t\t\t\trow.onClose(target);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t};\n\n\t\t\twindow.addEventListener('click', function (event) {\n\t\t\t\tif (toggleButtons.includes(event.target)) {\n\t\t\t\t\tonButtonClick(event.target);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}]);\n\n\treturn ErrorRows;\n}();\n\nwp.domReady(function () {\n\tnew ErrorRows().init();\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2Fzc2V0cy9zcmM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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/wp-dom-ready-compiled.js CHANGED
@@ -1,84 +1 @@
1
- /******/ (function(modules) { // webpackBootstrap
2
- /******/ // The module cache
3
- /******/ var installedModules = {};
4
- /******/
5
- /******/ // The require function
6
- /******/ function __webpack_require__(moduleId) {
7
- /******/
8
- /******/ // Check if module is in cache
9
- /******/ if(installedModules[moduleId]) {
10
- /******/ return installedModules[moduleId].exports;
11
- /******/ }
12
- /******/ // Create a new module (and put it into the cache)
13
- /******/ var module = installedModules[moduleId] = {
14
- /******/ i: moduleId,
15
- /******/ l: false,
16
- /******/ exports: {}
17
- /******/ };
18
- /******/
19
- /******/ // Execute the module function
20
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
21
- /******/
22
- /******/ // Flag the module as loaded
23
- /******/ module.l = true;
24
- /******/
25
- /******/ // Return the exports of the module
26
- /******/ return module.exports;
27
- /******/ }
28
- /******/
29
- /******/
30
- /******/ // expose the modules object (__webpack_modules__)
31
- /******/ __webpack_require__.m = modules;
32
- /******/
33
- /******/ // expose the module cache
34
- /******/ __webpack_require__.c = installedModules;
35
- /******/
36
- /******/ // define getter function for harmony exports
37
- /******/ __webpack_require__.d = function(exports, name, getter) {
38
- /******/ if(!__webpack_require__.o(exports, name)) {
39
- /******/ Object.defineProperty(exports, name, {
40
- /******/ configurable: false,
41
- /******/ enumerable: true,
42
- /******/ get: getter
43
- /******/ });
44
- /******/ }
45
- /******/ };
46
- /******/
47
- /******/ // getDefaultExport function for compatibility with non-harmony modules
48
- /******/ __webpack_require__.n = function(module) {
49
- /******/ var getter = module && module.__esModule ?
50
- /******/ function getDefault() { return module['default']; } :
51
- /******/ function getModuleExports() { return module; };
52
- /******/ __webpack_require__.d(getter, 'a', getter);
53
- /******/ return getter;
54
- /******/ };
55
- /******/
56
- /******/ // Object.prototype.hasOwnProperty.call
57
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
58
- /******/
59
- /******/ // __webpack_public_path__
60
- /******/ __webpack_require__.p = "";
61
- /******/
62
- /******/ // Load entry module and return exports
63
- /******/ return __webpack_require__(__webpack_require__.s = 73);
64
- /******/ })
65
- /************************************************************************/
66
- /******/ ({
67
-
68
- /***/ 73:
69
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
70
-
71
- "use strict";
72
- eval("Object.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wordpress_dom_ready__ = __webpack_require__(74);\n\n\nif (!window.wp) {\n\twindow.wp = {};\n}\n\nwp.domReady = __WEBPACK_IMPORTED_MODULE_0__wordpress_dom_ready__[\"a\" /* default */];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9hc3NldHMvc3JjL3dwLWRvbS1yZWFkeS5qcz81MzUzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBkb21SZWFkeSBmcm9tICdAd29yZHByZXNzL2RvbS1yZWFkeSc7XG5cbmlmICghd2luZG93LndwKSB7XG5cdHdpbmRvdy53cCA9IHt9O1xufVxuXG53cC5kb21SZWFkeSA9IGRvbVJlYWR5O1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vYXNzZXRzL3NyYy93cC1kb20tcmVhZHkuanNcbi8vIG1vZHVsZSBpZCA9IDczXG4vLyBtb2R1bGUgY2h1bmtzID0gMyJdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///73\n");
73
-
74
- /***/ }),
75
-
76
- /***/ 74:
77
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
78
-
79
- "use strict";
80
- eval("/**\n * Specify a function to execute when the DOM is fully loaded.\n *\n * @param {Function} callback A function to execute after the DOM is ready.\n *\n * @return {void}\n */\nvar domReady = function domReady(callback) {\n if (document.readyState === 'complete' || // DOMContentLoaded + Images/Styles/etc loaded, so we call directly.\n document.readyState === 'interactive' // DOMContentLoaded fires at this point, so we call directly.\n ) {\n return callback();\n } // DOMContentLoaded has not fired yet, delay callback until then.\n\n\n document.addEventListener('DOMContentLoaded', callback);\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (domReady);\n//# sourceMappingURL=index.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQHdvcmRwcmVzcy9kb20tcmVhZHkvYnVpbGQtbW9kdWxlL2luZGV4LmpzP2E3NjMiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBTcGVjaWZ5IGEgZnVuY3Rpb24gdG8gZXhlY3V0ZSB3aGVuIHRoZSBET00gaXMgZnVsbHkgbG9hZGVkLlxuICpcbiAqIEBwYXJhbSB7RnVuY3Rpb259IGNhbGxiYWNrIEEgZnVuY3Rpb24gdG8gZXhlY3V0ZSBhZnRlciB0aGUgRE9NIGlzIHJlYWR5LlxuICpcbiAqIEByZXR1cm4ge3ZvaWR9XG4gKi9cbnZhciBkb21SZWFkeSA9IGZ1bmN0aW9uIGRvbVJlYWR5KGNhbGxiYWNrKSB7XG4gIGlmIChkb2N1bWVudC5yZWFkeVN0YXRlID09PSAnY29tcGxldGUnIHx8IC8vIERPTUNvbnRlbnRMb2FkZWQgKyBJbWFnZXMvU3R5bGVzL2V0YyBsb2FkZWQsIHNvIHdlIGNhbGwgZGlyZWN0bHkuXG4gIGRvY3VtZW50LnJlYWR5U3RhdGUgPT09ICdpbnRlcmFjdGl2ZScgLy8gRE9NQ29udGVudExvYWRlZCBmaXJlcyBhdCB0aGlzIHBvaW50LCBzbyB3ZSBjYWxsIGRpcmVjdGx5LlxuICApIHtcbiAgICAgIHJldHVybiBjYWxsYmFjaygpO1xuICAgIH0gLy8gRE9NQ29udGVudExvYWRlZCBoYXMgbm90IGZpcmVkIHlldCwgZGVsYXkgY2FsbGJhY2sgdW50aWwgdGhlbi5cblxuXG4gIGRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIoJ0RPTUNvbnRlbnRMb2FkZWQnLCBjYWxsYmFjayk7XG59O1xuXG5leHBvcnQgZGVmYXVsdCBkb21SZWFkeTtcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPWluZGV4LmpzLm1hcFxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL0B3b3JkcHJlc3MvZG9tLXJlYWR5L2J1aWxkLW1vZHVsZS9pbmRleC5qc1xuLy8gbW9kdWxlIGlkID0gNzRcbi8vIG1vZHVsZSBjaHVua3MgPSAzIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///74\n");
81
-
82
- /***/ })
83
-
84
- /******/ });
1
+ !function(e){var n={};function t(d){if(n[d])return n[d].exports;var o=n[d]={i:d,l:!1,exports:{}};return e[d].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=e,t.c=n,t.d=function(e,n,d){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:d})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var d=Object.create(null);if(t.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(d,o,function(n){return e[n]}.bind(null,o));return d},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=9)}({9:function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n\n// CONCATENATED MODULE: ./node_modules/@wordpress/dom-ready/build-module/index.js\n/**\n * Specify a function to execute when the DOM is fully loaded.\n *\n * @param {Function} callback A function to execute after the DOM is ready.\n *\n * @example\n * ```js\n * import domReady from '@wordpress/dom-ready';\n *\n * domReady( function() {\n * \t//do something after DOM loads.\n * } );\n * ```\n *\n * @return {void}\n */\nvar domReady = function domReady(callback) {\n if (document.readyState === 'complete' || // DOMContentLoaded + Images/Styles/etc loaded, so we call directly.\n document.readyState === 'interactive' // DOMContentLoaded fires at this point, so we call directly.\n ) {\n return callback();\n } // DOMContentLoaded has not fired yet, delay callback until then.\n\n\n document.addEventListener('DOMContentLoaded', callback);\n};\n\n/* harmony default export */ var build_module = (domReady);\n//# sourceMappingURL=index.js.map\n// CONCATENATED MODULE: ./assets/src/wp-dom-ready.js\n\n\nif (!window.wp) {\n\twindow.wp = {};\n}\n\nwp.domReady = build_module;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9Ad29yZHByZXNzL2RvbS1yZWFkeS9idWlsZC1tb2R1bGUvaW5kZXguanM/ZGE4MSIsIndlYnBhY2s6Ly8vLi9hc3NldHMvc3JjL3dwLWRvbS1yZWF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blxuZXhwb3J0IGRlZmF1bHQgZG9tUmVhZHk7XG4vLyMgc291cmNlTWFwcGluZ1VSTD1pbmRleC5qcy5tYXAiLCJpbXBvcnQgZG9tUmVhZHkgZnJvbSAnQHdvcmRwcmVzcy9kb20tcmVhZHknO1xuXG5pZiAoIXdpbmRvdy53cCkge1xuXHR3aW5kb3cud3AgPSB7fTtcbn1cblxud3AuZG9tUmVhZHkgPSBkb21SZWFkeTsiXSwibWFwcGluZ3MiOiI7OztBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FDNUJBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///9\n")}});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/wp-i18n-compiled.js CHANGED
@@ -1,450 +1 @@
1
- /******/ (function(modules) { // webpackBootstrap
2
- /******/ // The module cache
3
- /******/ var installedModules = {};
4
- /******/
5
- /******/ // The require function
6
- /******/ function __webpack_require__(moduleId) {
7
- /******/
8
- /******/ // Check if module is in cache
9
- /******/ if(installedModules[moduleId]) {
10
- /******/ return installedModules[moduleId].exports;
11
- /******/ }
12
- /******/ // Create a new module (and put it into the cache)
13
- /******/ var module = installedModules[moduleId] = {
14
- /******/ i: moduleId,
15
- /******/ l: false,
16
- /******/ exports: {}
17
- /******/ };
18
- /******/
19
- /******/ // Execute the module function
20
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
21
- /******/
22
- /******/ // Flag the module as loaded
23
- /******/ module.l = true;
24
- /******/
25
- /******/ // Return the exports of the module
26
- /******/ return module.exports;
27
- /******/ }
28
- /******/
29
- /******/
30
- /******/ // expose the modules object (__webpack_modules__)
31
- /******/ __webpack_require__.m = modules;
32
- /******/
33
- /******/ // expose the module cache
34
- /******/ __webpack_require__.c = installedModules;
35
- /******/
36
- /******/ // define getter function for harmony exports
37
- /******/ __webpack_require__.d = function(exports, name, getter) {
38
- /******/ if(!__webpack_require__.o(exports, name)) {
39
- /******/ Object.defineProperty(exports, name, {
40
- /******/ configurable: false,
41
- /******/ enumerable: true,
42
- /******/ get: getter
43
- /******/ });
44
- /******/ }
45
- /******/ };
46
- /******/
47
- /******/ // getDefaultExport function for compatibility with non-harmony modules
48
- /******/ __webpack_require__.n = function(module) {
49
- /******/ var getter = module && module.__esModule ?
50
- /******/ function getDefault() { return module['default']; } :
51
- /******/ function getModuleExports() { return module; };
52
- /******/ __webpack_require__.d(getter, 'a', getter);
53
- /******/ return getter;
54
- /******/ };
55
- /******/
56
- /******/ // Object.prototype.hasOwnProperty.call
57
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
58
- /******/
59
- /******/ // __webpack_public_path__
60
- /******/ __webpack_require__.p = "";
61
- /******/
62
- /******/ // Load entry module and return exports
63
- /******/ return __webpack_require__(__webpack_require__.s = 29);
64
- /******/ })
65
- /************************************************************************/
66
- /******/ ([
67
- /* 0 */,
68
- /* 1 */
69
- /***/ (function(module, exports, __webpack_require__) {
70
-
71
- eval("// Thank's IE8 for his funny defineProperty\nmodule.exports = !__webpack_require__(2)(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2Rlc2NyaXB0b3JzLmpzPzZkNGEiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gVGhhbmsncyBJRTggZm9yIGhpcyBmdW5ueSBkZWZpbmVQcm9wZXJ0eVxubW9kdWxlLmV4cG9ydHMgPSAhcmVxdWlyZSgnLi9fZmFpbHMnKShmdW5jdGlvbiAoKSB7XG4gIHJldHVybiBPYmplY3QuZGVmaW5lUHJvcGVydHkoe30sICdhJywgeyBnZXQ6IGZ1bmN0aW9uICgpIHsgcmV0dXJuIDc7IH0gfSkuYSAhPSA3O1xufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2Rlc2NyaXB0b3JzLmpzXG4vLyBtb2R1bGUgaWQgPSAxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///1\n");
72
-
73
- /***/ }),
74
- /* 2 */
75
- /***/ (function(module, exports) {
76
-
77
- eval("module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2ZhaWxzLmpzP2NlMDIiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoZXhlYykge1xuICB0cnkge1xuICAgIHJldHVybiAhIWV4ZWMoKTtcbiAgfSBjYXRjaCAoZSkge1xuICAgIHJldHVybiB0cnVlO1xuICB9XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19mYWlscy5qc1xuLy8gbW9kdWxlIGlkID0gMlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///2\n");
78
-
79
- /***/ }),
80
- /* 3 */
81
- /***/ (function(module, exports, __webpack_require__) {
82
-
83
- eval("var isObject = __webpack_require__(4);\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2FuLW9iamVjdC5qcz8wYzg1Il0sInNvdXJjZXNDb250ZW50IjpbInZhciBpc09iamVjdCA9IHJlcXVpcmUoJy4vX2lzLW9iamVjdCcpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgaWYgKCFpc09iamVjdChpdCkpIHRocm93IFR5cGVFcnJvcihpdCArICcgaXMgbm90IGFuIG9iamVjdCEnKTtcbiAgcmV0dXJuIGl0O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fYW4tb2JqZWN0LmpzXG4vLyBtb2R1bGUgaWQgPSAzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///3\n");
84
-
85
- /***/ }),
86
- /* 4 */
87
- /***/ (function(module, exports) {
88
-
89
- eval("module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2lzLW9iamVjdC5qcz81MGEzIl0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0KSB7XG4gIHJldHVybiB0eXBlb2YgaXQgPT09ICdvYmplY3QnID8gaXQgIT09IG51bGwgOiB0eXBlb2YgaXQgPT09ICdmdW5jdGlvbic7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19pcy1vYmplY3QuanNcbi8vIG1vZHVsZSBpZCA9IDRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///4\n");
90
-
91
- /***/ }),
92
- /* 5 */
93
- /***/ (function(module, exports) {
94
-
95
- eval("// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNS5qc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
- eval("var core = module.exports = { version: '2.6.1' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9AYmFiZWwvcnVudGltZS1jb3JlanMyL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fY29yZS5qcz85YTY4Il0sInNvdXJjZXNDb250ZW50IjpbInZhciBjb3JlID0gbW9kdWxlLmV4cG9ydHMgPSB7IHZlcnNpb246ICcyLjYuMScgfTtcbmlmICh0eXBlb2YgX19lID09ICdudW1iZXInKSBfX2UgPSBjb3JlOyAvLyBlc2xpbnQtZGlzYWJsZS1saW5lIG5vLXVuZGVmXG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9AYmFiZWwvcnVudGltZS1jb3JlanMyL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fY29yZS5qc1xuLy8gbW9kdWxlIGlkID0gNlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///6\n");
102
-
103
- /***/ }),
104
- /* 7 */
105
- /***/ (function(module, exports) {
106
-
107
- eval("module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9AYmFiZWwvcnVudGltZS1jb3JlanMyL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faXMtb2JqZWN0LmpzPzE5ZDciXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgcmV0dXJuIHR5cGVvZiBpdCA9PT0gJ29iamVjdCcgPyBpdCAhPT0gbnVsbCA6IHR5cGVvZiBpdCA9PT0gJ2Z1bmN0aW9uJztcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9AYmFiZWwvcnVudGltZS1jb3JlanMyL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faXMtb2JqZWN0LmpzXG4vLyBtb2R1bGUgaWQgPSA3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///7\n");
108
-
109
- /***/ }),
110
- /* 8 */
111
- /***/ (function(module, exports, __webpack_require__) {
112
-
113
- eval("// Thank's IE8 for his funny defineProperty\nmodule.exports = !__webpack_require__(9)(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9AYmFiZWwvcnVudGltZS1jb3JlanMyL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fZGVzY3JpcHRvcnMuanM/YTVlMyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBUaGFuaydzIElFOCBmb3IgaGlzIGZ1bm55IGRlZmluZVByb3BlcnR5XG5tb2R1bGUuZXhwb3J0cyA9ICFyZXF1aXJlKCcuL19mYWlscycpKGZ1bmN0aW9uICgpIHtcbiAgcmV0dXJuIE9iamVjdC5kZWZpbmVQcm9wZXJ0eSh7fSwgJ2EnLCB7IGdldDogZnVuY3Rpb24gKCkgeyByZXR1cm4gNzsgfSB9KS5hICE9IDc7XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL0BiYWJlbC9ydW50aW1lLWNvcmVqczIvbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19kZXNjcmlwdG9ycy5qc1xuLy8gbW9kdWxlIGlkID0gOFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///8\n");
114
-
115
- /***/ }),
116
- /* 9 */
117
- /***/ (function(module, exports) {
118
-
119
- eval("module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9AYmFiZWwvcnVudGltZS1jb3JlanMyL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fZmFpbHMuanM/NWZiOCJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChleGVjKSB7XG4gIHRyeSB7XG4gICAgcmV0dXJuICEhZXhlYygpO1xuICB9IGNhdGNoIChlKSB7XG4gICAgcmV0dXJuIHRydWU7XG4gIH1cbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9AYmFiZWwvcnVudGltZS1jb3JlanMyL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fZmFpbHMuanNcbi8vIG1vZHVsZSBpZCA9IDlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///9\n");
120
-
121
- /***/ }),
122
- /* 10 */
123
- /***/ (function(module, exports, __webpack_require__) {
124
-
125
- eval("var anObject = __webpack_require__(3);\nvar IE8_DOM_DEFINE = __webpack_require__(33);\nvar toPrimitive = __webpack_require__(35);\nvar dP = Object.defineProperty;\n\nexports.f = __webpack_require__(1) ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19vYmplY3QtZHAuanM/OTQzMiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgYW5PYmplY3QgPSByZXF1aXJlKCcuL19hbi1vYmplY3QnKTtcbnZhciBJRThfRE9NX0RFRklORSA9IHJlcXVpcmUoJy4vX2llOC1kb20tZGVmaW5lJyk7XG52YXIgdG9QcmltaXRpdmUgPSByZXF1aXJlKCcuL190by1wcmltaXRpdmUnKTtcbnZhciBkUCA9IE9iamVjdC5kZWZpbmVQcm9wZXJ0eTtcblxuZXhwb3J0cy5mID0gcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKSA/IE9iamVjdC5kZWZpbmVQcm9wZXJ0eSA6IGZ1bmN0aW9uIGRlZmluZVByb3BlcnR5KE8sIFAsIEF0dHJpYnV0ZXMpIHtcbiAgYW5PYmplY3QoTyk7XG4gIFAgPSB0b1ByaW1pdGl2ZShQLCB0cnVlKTtcbiAgYW5PYmplY3QoQXR0cmlidXRlcyk7XG4gIGlmIChJRThfRE9NX0RFRklORSkgdHJ5IHtcbiAgICByZXR1cm4gZFAoTywgUCwgQXR0cmlidXRlcyk7XG4gIH0gY2F0Y2ggKGUpIHsgLyogZW1wdHkgKi8gfVxuICBpZiAoJ2dldCcgaW4gQXR0cmlidXRlcyB8fCAnc2V0JyBpbiBBdHRyaWJ1dGVzKSB0aHJvdyBUeXBlRXJyb3IoJ0FjY2Vzc29ycyBub3Qgc3VwcG9ydGVkIScpO1xuICBpZiAoJ3ZhbHVlJyBpbiBBdHRyaWJ1dGVzKSBPW1BdID0gQXR0cmlidXRlcy52YWx1ZTtcbiAgcmV0dXJuIE87XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19vYmplY3QtZHAuanNcbi8vIG1vZHVsZSBpZCA9IDEwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///10\n");
126
-
127
- /***/ }),
128
- /* 11 */
129
- /***/ (function(module, exports) {
130
-
131
- eval("// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19nbG9iYWwuanM/M2IzMiJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBodHRwczovL2dpdGh1Yi5jb20vemxvaXJvY2svY29yZS1qcy9pc3N1ZXMvODYjaXNzdWVjb21tZW50LTExNTc1OTAyOFxudmFyIGdsb2JhbCA9IG1vZHVsZS5leHBvcnRzID0gdHlwZW9mIHdpbmRvdyAhPSAndW5kZWZpbmVkJyAmJiB3aW5kb3cuTWF0aCA9PSBNYXRoXG4gID8gd2luZG93IDogdHlwZW9mIHNlbGYgIT0gJ3VuZGVmaW5lZCcgJiYgc2VsZi5NYXRoID09IE1hdGggPyBzZWxmXG4gIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1uZXctZnVuY1xuICA6IEZ1bmN0aW9uKCdyZXR1cm4gdGhpcycpKCk7XG5pZiAodHlwZW9mIF9fZyA9PSAnbnVtYmVyJykgX19nID0gZ2xvYmFsOyAvLyBlc2xpbnQtZGlzYWJsZS1saW5lIG5vLXVuZGVmXG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2dsb2JhbC5qc1xuLy8gbW9kdWxlIGlkID0gMTFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///11\n");
132
-
133
- /***/ }),
134
- /* 12 */
135
- /***/ (function(module, exports, __webpack_require__) {
136
-
137
- "use strict";
138
- eval("\n// 21.2.5.3 get RegExp.prototype.flags\nvar anObject = __webpack_require__(3);\nmodule.exports = function () {\n var that = anObject(this);\n var result = '';\n if (that.global) result += 'g';\n if (that.ignoreCase) result += 'i';\n if (that.multiline) result += 'm';\n if (that.unicode) result += 'u';\n if (that.sticky) result += 'y';\n return result;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19mbGFncy5qcz9kMjkxIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIDIxLjIuNS4zIGdldCBSZWdFeHAucHJvdG90eXBlLmZsYWdzXG52YXIgYW5PYmplY3QgPSByZXF1aXJlKCcuL19hbi1vYmplY3QnKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKCkge1xuICB2YXIgdGhhdCA9IGFuT2JqZWN0KHRoaXMpO1xuICB2YXIgcmVzdWx0ID0gJyc7XG4gIGlmICh0aGF0Lmdsb2JhbCkgcmVzdWx0ICs9ICdnJztcbiAgaWYgKHRoYXQuaWdub3JlQ2FzZSkgcmVzdWx0ICs9ICdpJztcbiAgaWYgKHRoYXQubXVsdGlsaW5lKSByZXN1bHQgKz0gJ20nO1xuICBpZiAodGhhdC51bmljb2RlKSByZXN1bHQgKz0gJ3UnO1xuICBpZiAodGhhdC5zdGlja3kpIHJlc3VsdCArPSAneSc7XG4gIHJldHVybiByZXN1bHQ7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19mbGFncy5qc1xuLy8gbW9kdWxlIGlkID0gMTJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///12\n");
139
-
140
- /***/ }),
141
- /* 13 */
142
- /***/ (function(module, exports) {
143
-
144
- eval("var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2hhcy5qcz9iNDRjIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBoYXNPd25Qcm9wZXJ0eSA9IHt9Lmhhc093blByb3BlcnR5O1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQsIGtleSkge1xuICByZXR1cm4gaGFzT3duUHJvcGVydHkuY2FsbChpdCwga2V5KTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9AYmFiZWwvcnVudGltZS1jb3JlanMyL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faGFzLmpzXG4vLyBtb2R1bGUgaWQgPSAxM1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///13\n");
145
-
146
- /***/ }),
147
- /* 14 */
148
- /***/ (function(module, exports, __webpack_require__) {
149
-
150
- eval("// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = __webpack_require__(15);\nvar defined = __webpack_require__(16);\nmodule.exports = function (it) {\n return IObject(defined(it));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWlvYmplY3QuanM/NTZjMSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyB0byBpbmRleGVkIG9iamVjdCwgdG9PYmplY3Qgd2l0aCBmYWxsYmFjayBmb3Igbm9uLWFycmF5LWxpa2UgRVMzIHN0cmluZ3NcbnZhciBJT2JqZWN0ID0gcmVxdWlyZSgnLi9faW9iamVjdCcpO1xudmFyIGRlZmluZWQgPSByZXF1aXJlKCcuL19kZWZpbmVkJyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gSU9iamVjdChkZWZpbmVkKGl0KSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWlvYmplY3QuanNcbi8vIG1vZHVsZSBpZCA9IDE0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///14\n");
151
-
152
- /***/ }),
153
- /* 15 */
154
- /***/ (function(module, exports, __webpack_require__) {
155
-
156
- eval("// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = __webpack_require__(58);\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2lvYmplY3QuanM/YjE2MyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBmYWxsYmFjayBmb3Igbm9uLWFycmF5LWxpa2UgRVMzIGFuZCBub24tZW51bWVyYWJsZSBvbGQgVjggc3RyaW5nc1xudmFyIGNvZiA9IHJlcXVpcmUoJy4vX2NvZicpO1xuLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG5vLXByb3RvdHlwZS1idWlsdGluc1xubW9kdWxlLmV4cG9ydHMgPSBPYmplY3QoJ3onKS5wcm9wZXJ0eUlzRW51bWVyYWJsZSgwKSA/IE9iamVjdCA6IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gY29mKGl0KSA9PSAnU3RyaW5nJyA/IGl0LnNwbGl0KCcnKSA6IE9iamVjdChpdCk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2lvYmplY3QuanNcbi8vIG1vZHVsZSBpZCA9IDE1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///15\n");
157
-
158
- /***/ }),
159
- /* 16 */
160
- /***/ (function(module, exports) {
161
-
162
- eval("// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2RlZmluZWQuanM/YWUzMyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyA3LjIuMSBSZXF1aXJlT2JqZWN0Q29lcmNpYmxlKGFyZ3VtZW50KVxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgaWYgKGl0ID09IHVuZGVmaW5lZCkgdGhyb3cgVHlwZUVycm9yKFwiQ2FuJ3QgY2FsbCBtZXRob2Qgb24gIFwiICsgaXQpO1xuICByZXR1cm4gaXQ7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2RlZmluZWQuanNcbi8vIG1vZHVsZSBpZCA9IDE2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///16\n");
163
-
164
- /***/ }),
165
- /* 17 */
166
- /***/ (function(module, exports) {
167
-
168
- eval("// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWludGVnZXIuanM/MzE1NyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyA3LjEuNCBUb0ludGVnZXJcbnZhciBjZWlsID0gTWF0aC5jZWlsO1xudmFyIGZsb29yID0gTWF0aC5mbG9vcjtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0KSB7XG4gIHJldHVybiBpc05hTihpdCA9ICtpdCkgPyAwIDogKGl0ID4gMCA/IGZsb29yIDogY2VpbCkoaXQpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL0BiYWJlbC9ydW50aW1lLWNvcmVqczIvbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL190by1pbnRlZ2VyLmpzXG4vLyBtb2R1bGUgaWQgPSAxN1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///17\n");
169
-
170
- /***/ }),
171
- /* 18 */,
172
- /* 19 */,
173
- /* 20 */,
174
- /* 21 */,
175
- /* 22 */,
176
- /* 23 */,
177
- /* 24 */,
178
- /* 25 */,
179
- /* 26 */,
180
- /* 27 */,
181
- /* 28 */,
182
- /* 29 */
183
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
184
-
185
- "use strict";
186
- eval("Object.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wordpress_i18n__ = __webpack_require__(30);\n\n\nif (!window.wp) {\n\twindow.wp = {};\n}\n\nwp.i18n = __WEBPACK_IMPORTED_MODULE_0__wordpress_i18n__;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9hc3NldHMvc3JjL3dwLWkxOG4uanM/MjRjNiJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgKiBhcyBpMThuIGZyb20gJ0B3b3JkcHJlc3MvaTE4bic7XG5cbmlmICghd2luZG93LndwKSB7XG5cdHdpbmRvdy53cCA9IHt9O1xufVxuXG53cC5pMThuID0gaTE4bjtcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL2Fzc2V0cy9zcmMvd3AtaTE4bi5qc1xuLy8gbW9kdWxlIGlkID0gMjlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///29\n");
187
-
188
- /***/ }),
189
- /* 30 */
190
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
191
-
192
- "use strict";
193
- eval("Object.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (immutable) */ __webpack_exports__[\"setLocaleData\"] = setLocaleData;\n/* harmony export (immutable) */ __webpack_exports__[\"getI18n\"] = getI18n;\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dcnpgettext\", function() { return dcnpgettext; });\n/* harmony export (immutable) */ __webpack_exports__[\"__\"] = __;\n/* harmony export (immutable) */ __webpack_exports__[\"_x\"] = _x;\n/* harmony export (immutable) */ __webpack_exports__[\"_n\"] = _n;\n/* harmony export (immutable) */ __webpack_exports__[\"_nx\"] = _nx;\n/* harmony export (immutable) */ __webpack_exports__[\"sprintf\"] = sprintf;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_core_js_modules_es6_regexp_to_string__ = __webpack_require__(31);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_core_js_modules_es6_regexp_to_string___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_core_js_modules_es6_regexp_to_string__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_corejs2_core_js_object_assign__ = __webpack_require__(42);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_corejs2_core_js_object_assign___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_corejs2_core_js_object_assign__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_jed__ = __webpack_require__(70);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_jed___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_jed__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_memize__ = __webpack_require__(71);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_memize___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_memize__);\n\n\n\n/**\n * External dependencies\n */\n\n\nvar i18n;\n/**\n * Log to console, once per message; or more precisely, per referentially equal\n * argument set. Because Jed throws errors, we log these to the console instead\n * to avoid crashing the application.\n *\n * @param {...*} args Arguments to pass to `console.error`\n */\n\nvar logErrorOnce = __WEBPACK_IMPORTED_MODULE_3_memize___default()(console.error); // eslint-disable-line no-console\n\n/**\n * Merges locale data into the Jed instance by domain. Creates a new Jed\n * instance if one has not yet been assigned.\n *\n * @see http://messageformat.github.io/Jed/\n *\n * @param {?Object} localeData Locale data configuration.\n * @param {?string} domain Domain for which configuration applies.\n */\n\nfunction setLocaleData() {\n var localeData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {\n '': {}\n };\n var domain = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';\n\n if (!i18n) {\n i18n = new __WEBPACK_IMPORTED_MODULE_2_jed___default.a({\n domain: 'default',\n locale_data: {\n default: {}\n }\n });\n }\n\n i18n.options.locale_data[domain] = __WEBPACK_IMPORTED_MODULE_1__babel_runtime_corejs2_core_js_object_assign___default()({}, i18n.options.locale_data[domain], localeData);\n}\n/**\n * Returns the current Jed instance, initializing with a default configuration\n * if not already assigned.\n *\n * @return {Jed} Jed instance.\n */\n\nfunction getI18n() {\n if (!i18n) {\n setLocaleData();\n }\n\n return i18n;\n}\n/**\n * Wrapper for Jed's `dcnpgettext`, its most qualified function. Absorbs errors\n * which are thrown as the result of invalid translation.\n *\n * @param {?string} domain Domain to retrieve the translated text.\n * @param {?string} context Context information for the translators.\n * @param {string} single Text to translate if non-plural. Used as fallback\n * return value on a caught error.\n * @param {?string} plural The text to be used if the number is plural.\n * @param {?number} number The number to compare against to use either the\n * singular or plural form.\n *\n * @return {string} The translated string.\n */\n\nvar dcnpgettext = __WEBPACK_IMPORTED_MODULE_3_memize___default()(function () {\n var domain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default';\n var context = arguments.length > 1 ? arguments[1] : undefined;\n var single = arguments.length > 2 ? arguments[2] : undefined;\n var plural = arguments.length > 3 ? arguments[3] : undefined;\n var number = arguments.length > 4 ? arguments[4] : undefined;\n\n try {\n return getI18n().dcnpgettext(domain, context, single, plural, number);\n } catch (error) {\n logErrorOnce('Jed localization error: \\n\\n' + error.toString());\n return single;\n }\n});\n/**\n * Retrieve the translation of text.\n *\n * @see https://developer.wordpress.org/reference/functions/__/\n *\n * @param {string} text Text to translate.\n * @param {?string} domain Domain to retrieve the translated text.\n *\n * @return {string} Translated text.\n */\n\nfunction __(text, domain) {\n return dcnpgettext(domain, undefined, text);\n}\n/**\n * Retrieve translated string with gettext context.\n *\n * @see https://developer.wordpress.org/reference/functions/_x/\n *\n * @param {string} text Text to translate.\n * @param {string} context Context information for the translators.\n * @param {?string} domain Domain to retrieve the translated text.\n *\n * @return {string} Translated context string without pipe.\n */\n\nfunction _x(text, context, domain) {\n return dcnpgettext(domain, context, text);\n}\n/**\n * Translates and retrieves the singular or plural form based on the supplied\n * number.\n *\n * @see https://developer.wordpress.org/reference/functions/_n/\n *\n * @param {string} single The text to be used if the number is singular.\n * @param {string} plural The text to be used if the number is plural.\n * @param {number} number The number to compare against to use either the\n * singular or plural form.\n * @param {?string} domain Domain to retrieve the translated text.\n *\n * @return {string} The translated singular or plural form.\n */\n\nfunction _n(single, plural, number, domain) {\n return dcnpgettext(domain, undefined, single, plural, number);\n}\n/**\n * Translates and retrieves the singular or plural form based on the supplied\n * number, with gettext context.\n *\n * @see https://developer.wordpress.org/reference/functions/_nx/\n *\n * @param {string} single The text to be used if the number is singular.\n * @param {string} plural The text to be used if the number is plural.\n * @param {number} number The number to compare against to use either the\n * singular or plural form.\n * @param {string} context Context information for the translators.\n * @param {?string} domain Domain to retrieve the translated text.\n *\n * @return {string} The translated singular or plural form.\n */\n\nfunction _nx(single, plural, number, context, domain) {\n return dcnpgettext(domain, context, single, plural, number);\n}\n/**\n * Returns a formatted string. If an error occurs in applying the format, the\n * original format string is returned.\n *\n * @param {string} format The format of the string to generate.\n * @param {string[]} ...args Arguments to apply to the format.\n *\n * @see http://www.diveintojavascript.com/projects/javascript-sprintf\n *\n * @return {string} The formatted string.\n */\n\nfunction sprintf(format) {\n try {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return __WEBPACK_IMPORTED_MODULE_2_jed___default.a.sprintf.apply(__WEBPACK_IMPORTED_MODULE_2_jed___default.a, [format].concat(args));\n } catch (error) {\n logErrorOnce('Jed sprintf error: \\n\\n' + error.toString());\n return format;\n }\n}\n//# sourceMappingURL=index.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQHdvcmRwcmVzcy9pMThuL2J1aWxkLW1vZHVsZS9pbmRleC5qcz85ODM4Il0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBcImNvcmUtanMvbW9kdWxlcy9lczYucmVnZXhwLnRvLXN0cmluZ1wiO1xuaW1wb3J0IF9PYmplY3QkYXNzaWduIGZyb20gXCJAYmFiZWwvcnVudGltZS1jb3JlanMyL2NvcmUtanMvb2JqZWN0L2Fzc2lnblwiO1xuXG4vKipcbiAqIEV4dGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgSmVkIGZyb20gJ2plZCc7XG5pbXBvcnQgbWVtb2l6ZSBmcm9tICdtZW1pemUnO1xudmFyIGkxOG47XG4vKipcbiAqIExvZyB0byBjb25zb2xlLCBvbmNlIHBlciBtZXNzYWdlOyBvciBtb3JlIHByZWNpc2VseSwgcGVyIHJlZmVyZW50aWFsbHkgZXF1YWxcbiAqIGFyZ3VtZW50IHNldC4gQmVjYXVzZSBKZWQgdGhyb3dzIGVycm9ycywgd2UgbG9nIHRoZXNlIHRvIHRoZSBjb25zb2xlIGluc3RlYWRcbiAqIHRvIGF2b2lkIGNyYXNoaW5nIHRoZSBhcHBsaWNhdGlvbi5cbiAqXG4gKiBAcGFyYW0gey4uLip9IGFyZ3MgQXJndW1lbnRzIHRvIHBhc3MgdG8gYGNvbnNvbGUuZXJyb3JgXG4gKi9cblxudmFyIGxvZ0Vycm9yT25jZSA9IG1lb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BQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///30\n");
194
-
195
- /***/ }),
196
- /* 31 */
197
- /***/ (function(module, exports, __webpack_require__) {
198
-
199
- "use strict";
200
- eval("\n__webpack_require__(32);\nvar anObject = __webpack_require__(3);\nvar $flags = __webpack_require__(12);\nvar DESCRIPTORS = __webpack_require__(1);\nvar TO_STRING = 'toString';\nvar $toString = /./[TO_STRING];\n\nvar define = function (fn) {\n __webpack_require__(36)(RegExp.prototype, TO_STRING, fn, true);\n};\n\n// 21.2.5.14 RegExp.prototype.toString()\nif (__webpack_require__(2)(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) {\n define(function toString() {\n var R = anObject(this);\n return '/'.concat(R.source, '/',\n 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined);\n });\n// FF44- RegExp#toString has a wrong name\n} else if ($toString.name != TO_STRING) {\n define(function toString() {\n return $toString.call(this);\n });\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6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cgbmFtZVxufSBlbHNlIGlmICgkdG9TdHJpbmcubmFtZSAhPSBUT19TVFJJTkcpIHtcbiAgZGVmaW5lKGZ1bmN0aW9uIHRvU3RyaW5nKCkge1xuICAgIHJldHVybiAkdG9TdHJpbmcuY2FsbCh0aGlzKTtcbiAgfSk7XG59XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LnJlZ2V4cC50by1zdHJpbmcuanNcbi8vIG1vZHVsZSBpZCA9IDMxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///31\n");
201
-
202
- /***/ }),
203
- /* 32 */
204
- /***/ (function(module, exports, __webpack_require__) {
205
-
206
- eval("// 21.2.5.3 get RegExp.prototype.flags()\nif (__webpack_require__(1) && /./g.flags != 'g') __webpack_require__(10).f(RegExp.prototype, 'flags', {\n configurable: true,\n get: __webpack_require__(12)\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5yZWdleHAuZmxhZ3MuanM/YTVkZiJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAyMS4yLjUuMyBnZXQgUmVnRXhwLnByb3RvdHlwZS5mbGFncygpXG5pZiAocmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKSAmJiAvLi9nLmZsYWdzICE9ICdnJykgcmVxdWlyZSgnLi9fb2JqZWN0LWRwJykuZihSZWdFeHAucHJvdG90eXBlLCAnZmxhZ3MnLCB7XG4gIGNvbmZpZ3VyYWJsZTogdHJ1ZSxcbiAgZ2V0OiByZXF1aXJlKCcuL19mbGFncycpXG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVnZXhwLmZsYWdzLmpzXG4vLyBtb2R1bGUgaWQgPSAzMlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///32\n");
207
-
208
- /***/ }),
209
- /* 33 */
210
- /***/ (function(module, exports, __webpack_require__) {
211
-
212
- eval("module.exports = !__webpack_require__(1) && !__webpack_require__(2)(function () {\n return Object.defineProperty(__webpack_require__(34)('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19pZTgtZG9tLWRlZmluZS5qcz9jNTk2Il0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gIXJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJykgJiYgIXJlcXVpcmUoJy4vX2ZhaWxzJykoZnVuY3Rpb24gKCkge1xuICByZXR1cm4gT2JqZWN0LmRlZmluZVByb3BlcnR5KHJlcXVpcmUoJy4vX2RvbS1jcmVhdGUnKSgnZGl2JyksICdhJywgeyBnZXQ6IGZ1bmN0aW9uICgpIHsgcmV0dXJuIDc7IH0gfSkuYSAhPSA3O1xufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2llOC1kb20tZGVmaW5lLmpzXG4vLyBtb2R1bGUgaWQgPSAzM1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///33\n");
213
-
214
- /***/ }),
215
- /* 34 */
216
- /***/ (function(module, exports, __webpack_require__) {
217
-
218
- eval("var isObject = __webpack_require__(4);\nvar document = __webpack_require__(11).document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19kb20tY3JlYXRlLmpzPzhlMWMiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGlzT2JqZWN0ID0gcmVxdWlyZSgnLi9faXMtb2JqZWN0Jyk7XG52YXIgZG9jdW1lbnQgPSByZXF1aXJlKCcuL19nbG9iYWwnKS5kb2N1bWVudDtcbi8vIHR5cGVvZiBkb2N1bWVudC5jcmVhdGVFbGVtZW50IGlzICdvYmplY3QnIGluIG9sZCBJRVxudmFyIGlzID0gaXNPYmplY3QoZG9jdW1lbnQpICYmIGlzT2JqZWN0KGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgcmV0dXJuIGlzID8gZG9jdW1lbnQuY3JlYXRlRWxlbWVudChpdCkgOiB7fTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2RvbS1jcmVhdGUuanNcbi8vIG1vZHVsZSBpZCA9IDM0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///34\n");
219
-
220
- /***/ }),
221
- /* 35 */
222
- /***/ (function(module, exports, __webpack_require__) {
223
-
224
- eval("// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = __webpack_require__(4);\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL190by1wcmltaXRpdmUuanM/YjM4OCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyA3LjEuMSBUb1ByaW1pdGl2ZShpbnB1dCBbLCBQcmVmZXJyZWRUeXBlXSlcbnZhciBpc09iamVjdCA9IHJlcXVpcmUoJy4vX2lzLW9iamVjdCcpO1xuLy8gaW5zdGVhZCBvZiB0aGUgRVM2IHNwZW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ack-internal:///35\n");
225
-
226
- /***/ }),
227
- /* 36 */
228
- /***/ (function(module, exports, __webpack_require__) {
229
-
230
- eval("var global = __webpack_require__(11);\nvar hide = __webpack_require__(37);\nvar has = __webpack_require__(39);\nvar SRC = __webpack_require__(40)('src');\nvar TO_STRING = 'toString';\nvar $toString = Function[TO_STRING];\nvar TPL = ('' + $toString).split(TO_STRING);\n\n__webpack_require__(41).inspectSource = function (it) {\n return $toString.call(it);\n};\n\n(module.exports = function (O, key, val, safe) {\n var isFunction = typeof val == 'function';\n if (isFunction) has(val, 'name') || hide(val, 'name', key);\n if (O[key] === val) return;\n if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n if (O === global) {\n O[key] = val;\n } else if (!safe) {\n delete O[key];\n hide(O, key, val);\n } else if (O[key]) {\n O[key] = val;\n } else {\n hide(O, key, val);\n }\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, TO_STRING, function toString() {\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19yZWRlZmluZS5qcz80NzcwIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBnbG9iYWwgPSByZXF1aXJlKCcuL19nbG9iYWwnKTtcbnZhciBoaWRlID0gcmVxdWlyZSgnLi9faGlkZScpO1xudmFyIGhhcyA9IHJlcXVpcmUoJy4vX2hhcycpO1xudmFyIFNSQyA9IHJlcXVpcmUoJy4vX3VpZCcpKCdzcmMnKTtcbnZhciBUT19TVFJJTkcgPSAndG9TdHJpbmcnO1xudmFyICR0b1N0cmluZyA9IEZ1bmN0aW9uW1RPX1NUUklOR107XG52YXIgVFBMID0gKCcnICsgJHRvU3RyaW5nK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gfHwgJHRvU3RyaW5nLmNhbGwodGhpcyk7XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fcmVkZWZpbmUuanNcbi8vIG1vZHVsZSBpZCA9IDM2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///36\n");
231
-
232
- /***/ }),
233
- /* 37 */
234
- /***/ (function(module, exports, __webpack_require__) {
235
-
236
- eval("var dP = __webpack_require__(10);\nvar createDesc = __webpack_require__(38);\nmodule.exports = __webpack_require__(1) ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19oaWRlLmpzP2RhOWQiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGRQID0gcmVxdWlyZSgnLi9fb2JqZWN0LWRwJyk7XG52YXIgY3JlYXRlRGVzYyA9IHJlcXVpcmUoJy4vX3Byb3BlcnR5LWRlc2MnKTtcbm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKSA/IGZ1bmN0aW9uIChvYmplY3QsIGtleSwgdmFsdWUpIHtcbiAgcmV0dXJuIGRQLmYob2JqZWN0LCBrZXksIGNyZWF0ZURlc2MoMSwgdmFsdWUpKTtcbn0gOiBmdW5jdGlvbiAob2JqZWN0LCBrZXksIHZhbHVlKSB7XG4gIG9iamVjdFtrZXldID0gdmFsdWU7XG4gIHJldHVybiBvYmplY3Q7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19oaWRlLmpzXG4vLyBtb2R1bGUgaWQgPSAzN1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///37\n");
237
-
238
- /***/ }),
239
- /* 38 */
240
- /***/ (function(module, exports) {
241
-
242
- eval("module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19wcm9wZXJ0eS1kZXNjLmpzPzdkNGQiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoYml0bWFwLCB2YWx1ZSkge1xuICByZXR1cm4ge1xuICAgIGVudW1lcmFibGU6ICEoYml0bWFwICYgMSksXG4gICAgY29uZmlndXJhYmxlOiAhKGJpdG1hcCAmIDIpLFxuICAgIHdyaXRhYmxlOiAhKGJpdG1hcCAmIDQpLFxuICAgIHZhbHVlOiB2YWx1ZVxuICB9O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fcHJvcGVydHktZGVzYy5qc1xuLy8gbW9kdWxlIGlkID0gMzhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///38\n");
243
-
244
- /***/ }),
245
- /* 39 */
246
- /***/ (function(module, exports) {
247
-
248
- eval("var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19oYXMuanM/NTgxNyJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgaGFzT3duUHJvcGVydHkgPSB7fS5oYXNPd25Qcm9wZXJ0eTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0LCBrZXkpIHtcbiAgcmV0dXJuIGhhc093blByb3BlcnR5LmNhbGwoaXQsIGtleSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19oYXMuanNcbi8vIG1vZHVsZSBpZCA9IDM5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///39\n");
249
-
250
- /***/ }),
251
- /* 40 */
252
- /***/ (function(module, exports) {
253
-
254
- eval("var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL191aWQuanM/YmE1NCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgaWQgPSAwO1xudmFyIHB4ID0gTWF0aC5yYW5kb20oKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGtleSkge1xuICByZXR1cm4gJ1N5bWJvbCgnLmNvbmNhdChrZXkgPT09IHVuZGVmaW5lZCA/ICcnIDoga2V5LCAnKV8nLCAoKytpZCArIHB4KS50b1N0cmluZygzNikpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fdWlkLmpzXG4vLyBtb2R1bGUgaWQgPSA0MFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///40\n");
255
-
256
- /***/ }),
257
- /* 41 */
258
- /***/ (function(module, exports) {
259
-
260
- eval("var core = module.exports = { version: '2.5.6' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19jb3JlLmpzP2VlMDUiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGNvcmUgPSBtb2R1bGUuZXhwb3J0cyA9IHsgdmVyc2lvbjogJzIuNS42JyB9O1xuaWYgKHR5cGVvZiBfX2UgPT0gJ251bWJlcicpIF9fZSA9IGNvcmU7IC8vIGVzbGludC1kaXNhYmxlLWxpbmUgbm8tdW5kZWZcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fY29yZS5qc1xuLy8gbW9kdWxlIGlkID0gNDFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///41\n");
261
-
262
- /***/ }),
263
- /* 42 */
264
- /***/ (function(module, exports, __webpack_require__) {
265
-
266
- eval("module.exports = __webpack_require__(43);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9jb3JlLWpzL29iamVjdC9hc3NpZ24uanM/YmM2YyJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoXCJjb3JlLWpzL2xpYnJhcnkvZm4vb2JqZWN0L2Fzc2lnblwiKTtcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9AYmFiZWwvcnVudGltZS1jb3JlanMyL2NvcmUtanMvb2JqZWN0L2Fzc2lnbi5qc1xuLy8gbW9kdWxlIGlkID0gNDJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///42\n");
267
-
268
- /***/ }),
269
- /* 43 */
270
- /***/ (function(module, exports, __webpack_require__) {
271
-
272
- eval("__webpack_require__(44);\nmodule.exports = __webpack_require__(6).Object.assign;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9hc3NpZ24uanM/NTIzMyJdLCJzb3VyY2VzQ29udGVudCI6WyJyZXF1aXJlKCcuLi8uLi9tb2R1bGVzL2VzNi5vYmplY3QuYXNzaWduJyk7XG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4uLy4uL21vZHVsZXMvX2NvcmUnKS5PYmplY3QuYXNzaWduO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9hc3NpZ24uanNcbi8vIG1vZHVsZSBpZCA9IDQzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///43\n");
273
-
274
- /***/ }),
275
- /* 44 */
276
- /***/ (function(module, exports, __webpack_require__) {
277
-
278
- eval("// 19.1.3.1 Object.assign(target, source)\nvar $export = __webpack_require__(45);\n\n$export($export.S + $export.F, 'Object', { assign: __webpack_require__(55) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2Lm9iamVjdC5hc3NpZ24uanM/YjI1NiJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAxOS4xLjMuMSBPYmplY3QuYXNzaWduKHRhcmdldCwgc291cmNlKVxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcblxuJGV4cG9ydCgkZXhwb3J0LlMgKyAkZXhwb3J0LkYsICdPYmplY3QnLCB7IGFzc2lnbjogcmVxdWlyZSgnLi9fb2JqZWN0LWFzc2lnbicpIH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2Lm9iamVjdC5hc3NpZ24uanNcbi8vIG1vZHVsZSBpZCA9IDQ0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///44\n");
279
-
280
- /***/ }),
281
- /* 45 */
282
- /***/ (function(module, exports, __webpack_require__) {
283
-
284
- eval("var global = __webpack_require__(5);\nvar core = __webpack_require__(6);\nvar ctx = __webpack_require__(46);\nvar hide = __webpack_require__(48);\nvar has = __webpack_require__(13);\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var IS_WRAP = type & $export.W;\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE];\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];\n var key, own, out;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n if (own && has(exports, key)) continue;\n // export native or passed\n out = own ? target[key] : source[key];\n // prevent global pollution for namespaces\n exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]\n // bind timers to global for call from export context\n : IS_BIND && own ? ctx(out, global)\n // wrap global constructors for prevent change them in library\n : IS_WRAP && target[key] == out ? (function (C) {\n var F = function (a, b, c) {\n if (this instanceof C) {\n switch (arguments.length) {\n case 0: return new C();\n case 1: return new C(a);\n case 2: return new C(a, b);\n } return new C(a, b, c);\n } return C.apply(this, arguments);\n };\n F[PROTOTYPE] = C[PROTOTYPE];\n return F;\n // make static versions for prototype methods\n })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%\n if (IS_PROTO) {\n (exports.virtual || (exports.virtual = {}))[key] = out;\n // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%\n if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);\n }\n }\n};\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbW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yIGBsaWJyYXJ5YFxubW9kdWxlLmV4cG9ydHMgPSAkZXhwb3J0O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2V4cG9ydC5qc1xuLy8gbW9kdWxlIGlkID0gNDVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///45\n");
285
-
286
- /***/ }),
287
- /* 46 */
288
- /***/ (function(module, exports, __webpack_require__) {
289
-
290
- eval("// optional / simple context binding\nvar aFunction = __webpack_require__(47);\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2N0eC5qcz82NzNhIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIG9wdGlvbmFsIC8gc2ltcGxlIGNvbnRleHQgYmluZGluZ1xudmFyIGFGdW5jdGlvbiA9IHJlcXVpcmUoJy4vX2EtZnVuY3Rpb24nKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGZuLCB0aGF0LCBsZW5ndGgpIHtcbiAgYUZ1bmN0aW9uKGZuKTtcbiAgaWYgKHRoYXQgPT09IHVuZGVmaW5lZCkgcmV0dXJuIGZuO1xuICBzd2l0Y2ggKGxlbmd0aCkge1xuICAgIGNhc2UgMTogcmV0dXJuIGZ1bmN0aW9uIChhKSB7XG4gICAgICByZXR1cm4gZm4uY2FsbCh0aGF0LCBhKTtcbiAgICB9O1xuICAgIGNhc2UgMjogcmV0dXJuIGZ1bmN0aW9uIChhLCBiKSB7XG4gICAgICByZXR1cm4gZm4uY2FsbCh0aGF0LCBhLCBiKTtcbiAgICB9O1xuICAgIGNhc2UgMzogcmV0dXJuIGZ1bmN0aW9uIChhLCBiLCBjKSB7XG4gICAgICByZXR1cm4gZm4uY2FsbCh0aGF0LCBhLCBiLCBjKTtcbiAgICB9O1xuICB9XG4gIHJldHVybiBmdW5jdGlvbiAoLyogLi4uYXJncyAqLykge1xuICAgIHJldHVybiBmbi5hcHBseSh0aGF0LCBhcmd1bWVudHMpO1xuICB9O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL0BiYWJlbC9ydW50aW1lLWNvcmVqczIvbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19jdHguanNcbi8vIG1vZHVsZSBpZCA9IDQ2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///46\n");
291
-
292
- /***/ }),
293
- /* 47 */
294
- /***/ (function(module, exports) {
295
-
296
- eval("module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2EtZnVuY3Rpb24uanM/NjQzNyJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICBpZiAodHlwZW9mIGl0ICE9ICdmdW5jdGlvbicpIHRocm93IFR5cGVFcnJvcihpdCArICcgaXMgbm90IGEgZnVuY3Rpb24hJyk7XG4gIHJldHVybiBpdDtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9AYmFiZWwvcnVudGltZS1jb3JlanMyL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fYS1mdW5jdGlvbi5qc1xuLy8gbW9kdWxlIGlkID0gNDdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///47\n");
297
-
298
- /***/ }),
299
- /* 48 */
300
- /***/ (function(module, exports, __webpack_require__) {
301
-
302
- eval("var dP = __webpack_require__(49);\nvar createDesc = __webpack_require__(54);\nmodule.exports = __webpack_require__(8) ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2hpZGUuanM/ZjZkMCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZFAgPSByZXF1aXJlKCcuL19vYmplY3QtZHAnKTtcbnZhciBjcmVhdGVEZXNjID0gcmVxdWlyZSgnLi9fcHJvcGVydHktZGVzYycpO1xubW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuL19kZXNjcmlwdG9ycycpID8gZnVuY3Rpb24gKG9iamVjdCwga2V5LCB2YWx1ZSkge1xuICByZXR1cm4gZFAuZihvYmplY3QsIGtleSwgY3JlYXRlRGVzYygxLCB2YWx1ZSkpO1xufSA6IGZ1bmN0aW9uIChvYmplY3QsIGtleSwgdmFsdWUpIHtcbiAgb2JqZWN0W2tleV0gPSB2YWx1ZTtcbiAgcmV0dXJuIG9iamVjdDtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9AYmFiZWwvcnVudGltZS1jb3JlanMyL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faGlkZS5qc1xuLy8gbW9kdWxlIGlkID0gNDhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///48\n");
303
-
304
- /***/ }),
305
- /* 49 */
306
- /***/ (function(module, exports, __webpack_require__) {
307
-
308
- eval("var anObject = __webpack_require__(50);\nvar IE8_DOM_DEFINE = __webpack_require__(51);\nvar toPrimitive = __webpack_require__(53);\nvar dP = Object.defineProperty;\n\nexports.f = __webpack_require__(8) ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1kcC5qcz81MTg0Il0sInNvdXJjZXNDb250ZW50IjpbInZhciBhbk9iamVjdCA9IHJlcXVpcmUoJy4vX2FuLW9iamVjdCcpO1xudmFyIElFOF9ET01fREVGSU5FID0gcmVxdWlyZSgnLi9faWU4LWRvbS1kZWZpbmUnKTtcbnZhciB0b1ByaW1pdGl2ZSA9IHJlcXVpcmUoJ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al:///49\n");
309
-
310
- /***/ }),
311
- /* 50 */
312
- /***/ (function(module, exports, __webpack_require__) {
313
-
314
- eval("var isObject = __webpack_require__(7);\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2FuLW9iamVjdC5qcz8xMTk1Il0sInNvdXJjZXNDb250ZW50IjpbInZhciBpc09iamVjdCA9IHJlcXVpcmUoJy4vX2lzLW9iamVjdCcpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgaWYgKCFpc09iamVjdChpdCkpIHRocm93IFR5cGVFcnJvcihpdCArICcgaXMgbm90IGFuIG9iamVjdCEnKTtcbiAgcmV0dXJuIGl0O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL0BiYWJlbC9ydW50aW1lLWNvcmVqczIvbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19hbi1vYmplY3QuanNcbi8vIG1vZHVsZSBpZCA9IDUwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///50\n");
315
-
316
- /***/ }),
317
- /* 51 */
318
- /***/ (function(module, exports, __webpack_require__) {
319
-
320
- eval("module.exports = !__webpack_require__(8) && !__webpack_require__(9)(function () {\n return Object.defineProperty(__webpack_require__(52)('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2llOC1kb20tZGVmaW5lLmpzP2U0MDEiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSAhcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKSAmJiAhcmVxdWlyZSgnLi9fZmFpbHMnKShmdW5jdGlvbiAoKSB7XG4gIHJldHVybiBPYmplY3QuZGVmaW5lUHJvcGVydHkocmVxdWlyZSgnLi9fZG9tLWNyZWF0ZScpKCdkaXYnKSwgJ2EnLCB7IGdldDogZnVuY3Rpb24gKCkgeyByZXR1cm4gNzsgfSB9KS5hICE9IDc7XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL0BiYWJlbC9ydW50aW1lLWNvcmVqczIvbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pZTgtZG9tLWRlZmluZS5qc1xuLy8gbW9kdWxlIGlkID0gNTFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///51\n");
321
-
322
- /***/ }),
323
- /* 52 */
324
- /***/ (function(module, exports, __webpack_require__) {
325
-
326
- eval("var isObject = __webpack_require__(7);\nvar document = __webpack_require__(5).document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2RvbS1jcmVhdGUuanM/NDFlYSJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgaXNPYmplY3QgPSByZXF1aXJlKCcuL19pcy1vYmplY3QnKTtcbnZhciBkb2N1bWVudCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpLmRvY3VtZW50O1xuLy8gdHlwZW9mIGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQgaXMgJ29iamVjdCcgaW4gb2xkIElFXG52YXIgaXMgPSBpc09iamVjdChkb2N1bWVudCkgJiYgaXNPYmplY3QoZG9jdW1lbnQuY3JlYXRlRWxlbWVudCk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gaXMgPyBkb2N1bWVudC5jcmVhdGVFbGVtZW50KGl0KSA6IHt9O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL0BiYWJlbC9ydW50aW1lLWNvcmVqczIvbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19kb20tY3JlYXRlLmpzXG4vLyBtb2R1bGUgaWQgPSA1MlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///52\n");
327
-
328
- /***/ }),
329
- /* 53 */
330
- /***/ (function(module, exports, __webpack_require__) {
331
-
332
- eval("// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = __webpack_require__(7);\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLXByaW1pdGl2ZS5qcz8yOGNiIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDcuMS4xIFRvUHJpbWl0aXZlKGlucHV0IFssIFByZWZlcnJlZFR5cGVdKVxudmFyIGlzT2JqZWN0ID0gcmVxdWlyZSgnLi9faXMtb2JqZWN0Jyk7XG4vLyBpbnN0ZWFkIG9mIHRoZSBFUzYgc3BlYyB2ZXJzaW9uLCB3ZSBkaWRuJ3QgaW1wbGVtZW50IEBAdG9QcmltaXRpdmUgY2FzZVxuLy8gYW5kIHRoZSBzZWNvbmQgYXJndW1lbnQgLSBmbGFnIC0gcHJlZmVycmVkIHR5cGUgaXMgYSBzdHJpbmdcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0LCBTKSB7XG4gIGlmICghaXNPYmplY3QoaXQpKSByZXR1cm4gaXQ7XG4gIHZhciBmbiwgdmFsO1xuICBpZiAoUyAmJiB0eXBlb2YgKGZuID0gaXQudG9TdHJpbmcpID09ICdmdW5jdGlvbicgJiYgIWlzT2JqZWN0KHZhbCA9IGZuLmNhbGwoaXQpKSkgcmV0dXJuIHZhbDtcbiAgaWYgKHR5cGVvZiAoZm4gPSBpdC52YWx1ZU9mKSA9PSAnZnVuY3Rpb24nICYmICFpc09iamVjdCh2YWwgPSBmbi5jYWxsKGl0KSkpIHJldHVybiB2YWw7XG4gIGlmICghUyAmJiB0eXBlb2YgKGZuID0gaXQudG9TdHJpbmcpID09ICdmdW5jdGlvbicgJiYgIWlzT2JqZWN0KHZhbCA9IGZuLmNhbGwoaXQpKSkgcmV0dXJuIHZhbDtcbiAgdGhyb3cgVHlwZUVycm9yKFwiQ2FuJ3QgY29udmVydCBvYmplY3QgdG8gcHJpbWl0aXZlIHZhbHVlXCIpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL0BiYWJlbC9ydW50aW1lLWNvcmVqczIvbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL190by1wcmltaXRpdmUuanNcbi8vIG1vZHVsZSBpZCA9IDUzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///53\n");
333
-
334
- /***/ }),
335
- /* 54 */
336
- /***/ (function(module, exports) {
337
-
338
- eval("module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3Byb3BlcnR5LWRlc2MuanM/OTBlZSJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChiaXRtYXAsIHZhbHVlKSB7XG4gIHJldHVybiB7XG4gICAgZW51bWVyYWJsZTogIShiaXRtYXAgJiAxKSxcbiAgICBjb25maWd1cmFibGU6ICEoYml0bWFwICYgMiksXG4gICAgd3JpdGFibGU6ICEoYml0bWFwICYgNCksXG4gICAgdmFsdWU6IHZhbHVlXG4gIH07XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3Byb3BlcnR5LWRlc2MuanNcbi8vIG1vZHVsZSBpZCA9IDU0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///54\n");
339
-
340
- /***/ }),
341
- /* 55 */
342
- /***/ (function(module, exports, __webpack_require__) {
343
-
344
- "use strict";
345
- eval("\n// 19.1.2.1 Object.assign(target, source, ...)\nvar getKeys = __webpack_require__(56);\nvar gOPS = __webpack_require__(67);\nvar pIE = __webpack_require__(68);\nvar toObject = __webpack_require__(69);\nvar IObject = __webpack_require__(15);\nvar $assign = Object.assign;\n\n// should work with symbols and should have deterministic property order (V8 bug)\nmodule.exports = !$assign || __webpack_require__(9)(function () {\n var A = {};\n var B = {};\n // eslint-disable-next-line no-undef\n var S = Symbol();\n var K = 'abcdefghijklmnopqrst';\n A[S] = 7;\n K.split('').forEach(function (k) { B[k] = k; });\n return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars\n var T = toObject(target);\n var aLen = arguments.length;\n var index = 1;\n var getSymbols = gOPS.f;\n var isEnum = pIE.f;\n while (aLen > index) {\n var S = IObject(arguments[index++]);\n var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);\n var length = keys.length;\n var j = 0;\n var key;\n while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];\n } return T;\n} : $assign;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1hc3NpZ24uanM/NjYxYiJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG4vLyAxOS4xLjIuMSBPYmplY3QuYXNzaWduKHRhcmdldCwgc291cmNlLCAuLi4pXG52YXIgZ2V0S2V5cyA9IHJlcXVpcmUoJy4vX29iamVjdC1rZXlzJyk7XG52YXIgZ09QUyA9IHJlcXVpcmUoJy4vX29iamVjdC1nb3BzJyk7XG52YXIgcElFID0gcmVxdWlyZSgnLi9fb2JqZWN0LXBpZScpO1xudmFyIHRvT2JqZWN0ID0gcmVxdWlyZSgnLi9fdG8tb2JqZWN0Jyk7XG52YXIgSU9iamVjdCA9IHJlcXVpcmUoJy4vX2lvYmplY3QnKTtcbnZhciAkYXNzaWduID0gT2JqZWN0LmFzc2lnbjtcblxuLy8gc2hvdWxkIHdvcmsgd2l0aCBzeW1ib2xzIGFuZCBzaG91bGQgaGF2ZSBkZXRlcm1pbmlzdGljIHByb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BrZXlzW2orK10pKSBUW2tleV0gPSBTW2tleV07XG4gIH0gcmV0dXJuIFQ7XG59IDogJGFzc2lnbjtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL0BiYWJlbC9ydW50aW1lLWNvcmVqczIvbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtYXNzaWduLmpzXG4vLyBtb2R1bGUgaWQgPSA1NVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///55\n");
346
-
347
- /***/ }),
348
- /* 56 */
349
- /***/ (function(module, exports, __webpack_require__) {
350
-
351
- eval("// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = __webpack_require__(57);\nvar enumBugKeys = __webpack_require__(66);\n\nmodule.exports = Object.keys || function keys(O) {\n return $keys(O, enumBugKeys);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1rZXlzLmpzP2E1ODAiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMTkuMS4yLjE0IC8gMTUuMi4zLjE0IE9iamVjdC5rZXlzKE8pXG52YXIgJGtleXMgPSByZXF1aXJlKCcuL19vYmplY3Qta2V5cy1pbnRlcm5hbCcpO1xudmFyIGVudW1CdWdLZXlzID0gcmVxdWlyZSgnLi9fZW51bS1idWcta2V5cycpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IE9iamVjdC5rZXlzIHx8IGZ1bmN0aW9uIGtleXMoTykge1xuICByZXR1cm4gJGtleXMoTywgZW51bUJ1Z0tleXMpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL0BiYWJlbC9ydW50aW1lLWNvcmVqczIvbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3Qta2V5cy5qc1xuLy8gbW9kdWxlIGlkID0gNTZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///56\n");
352
-
353
- /***/ }),
354
- /* 57 */
355
- /***/ (function(module, exports, __webpack_require__) {
356
-
357
- eval("var has = __webpack_require__(13);\nvar toIObject = __webpack_require__(14);\nvar arrayIndexOf = __webpack_require__(59)(false);\nvar IE_PROTO = __webpack_require__(62)('IE_PROTO');\n\nmodule.exports = function (object, names) {\n var O = toIObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTcuanM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JhcnkvbW9kdWxlcy9fb2JqZWN0LWtleXMtaW50ZXJuYWwuanNcbi8vIG1vZHVsZSBpZCA9IDU3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///57\n");
358
-
359
- /***/ }),
360
- /* 58 */
361
- /***/ (function(module, exports) {
362
-
363
- eval("var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2NvZi5qcz9jZWYwIl0sInNvdXJjZXNDb250ZW50IjpbInZhciB0b1N0cmluZyA9IHt9LnRvU3RyaW5nO1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gdG9TdHJpbmcuY2FsbChpdCkuc2xpY2UoOCwgLTEpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL0BiYWJlbC9ydW50aW1lLWNvcmVqczIvbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19jb2YuanNcbi8vIG1vZHVsZSBpZCA9IDU4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///58\n");
364
-
365
- /***/ }),
366
- /* 59 */
367
- /***/ (function(module, exports, __webpack_require__) {
368
-
369
- eval("// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = __webpack_require__(14);\nvar toLength = __webpack_require__(60);\nvar toAbsoluteIndex = __webpack_require__(61);\nmodule.exports = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2FycmF5LWluY2x1ZGVzLmpzPzc4YTYiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gZmFsc2UgLT4gQXJyYXkjaW5kZXhPZlxuLy8gdHJ1ZSAgLT4gQXJyYXkjaW5jbHVkZXNcbnZhciB0b0lPYmplY3QgPSByZXF1aXJlKCcuL190by1pb2JqZWN0Jyk7XG52YXIgdG9MZW5ndGggPSByZXF1aXJlKCcuL190by1sZW5ndGgnKTtcbnZhciB0b0Fic29sdXRlSW5kZXggPSByZXF1aXJlKCcuL190by1hYnNvbHV0ZS1pbmRleCcpO1xubW9kdWxl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iZWwvcnVudGltZS1jb3JlanMyL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fYXJyYXktaW5jbHVkZXMuanNcbi8vIG1vZHVsZSBpZCA9IDU5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///59\n");
370
-
371
- /***/ }),
372
- /* 60 */
373
- /***/ (function(module, exports, __webpack_require__) {
374
-
375
- eval("// 7.1.15 ToLength\nvar toInteger = __webpack_require__(17);\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWxlbmd0aC5qcz84NzkwIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDcuMS4xNSBUb0xlbmd0aFxudmFyIHRvSW50ZWdlciA9IHJlcXVpcmUoJy4vX3RvLWludGVnZXInKTtcbnZhciBtaW4gPSBNYXRoLm1pbjtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0KSB7XG4gIHJldHVybiBpdCA+IDAgPyBtaW4odG9JbnRlZ2VyKGl0KSwgMHgxZmZmZmZmZmZmZmZmZikgOiAwOyAvLyBwb3coMiwgNTMpIC0gMSA9PSA5MDA3MTk5MjU0NzQwOTkxXG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWxlbmd0aC5qc1xuLy8gbW9kdWxlIGlkID0gNjBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///60\n");
376
-
377
- /***/ }),
378
- /* 61 */
379
- /***/ (function(module, exports, __webpack_require__) {
380
-
381
- eval("var toInteger = __webpack_require__(17);\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWFic29sdXRlLWluZGV4LmpzP2I2NWMiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIHRvSW50ZWdlciA9IHJlcXVpcmUoJy4vX3RvLWludGVnZXInKTtcbnZhciBtYXggPSBNYXRoLm1heDtcbnZhciBtaW4gPSBNYXRoLm1pbjtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGluZGV4LCBsZW5ndGgpIHtcbiAgaW5kZXggPSB0b0ludGVnZXIoaW5kZXgpO1xuICByZXR1cm4gaW5kZXggPCAwID8gbWF4KGluZGV4ICsgbGVuZ3RoLCAwKSA6IG1pbihpbmRleCwgbGVuZ3RoKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9AYmFiZWwvcnVudGltZS1jb3JlanMyL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fdG8tYWJzb2x1dGUtaW5kZXguanNcbi8vIG1vZHVsZSBpZCA9IDYxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///61\n");
382
-
383
- /***/ }),
384
- /* 62 */
385
- /***/ (function(module, exports, __webpack_require__) {
386
-
387
- eval("var shared = __webpack_require__(63)('keys');\nvar uid = __webpack_require__(65);\nmodule.exports = function (key) {\n return shared[key] || (shared[key] = uid(key));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3NoYXJlZC1rZXkuanM/ZTY4MiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgc2hhcmVkID0gcmVxdWlyZSgnLi9fc2hhcmVkJykoJ2tleXMnKTtcbnZhciB1aWQgPSByZXF1aXJlKCcuL191aWQnKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGtleSkge1xuICByZXR1cm4gc2hhcmVkW2tleV0gfHwgKHNoYXJlZFtrZXldID0gdWlkKGtleSkpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL0BiYWJlbC9ydW50aW1lLWNvcmVqczIvbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19zaGFyZWQta2V5LmpzXG4vLyBtb2R1bGUgaWQgPSA2MlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///62\n");
388
-
389
- /***/ }),
390
- /* 63 */
391
- /***/ (function(module, exports, __webpack_require__) {
392
-
393
- eval("var core = __webpack_require__(6);\nvar global = __webpack_require__(5);\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: core.version,\n mode: __webpack_require__(64) ? 'pure' : 'global',\n copyright: '© 2018 Denis Pushkarev (zloirock.ru)'\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3NoYXJlZC5qcz85YjU3Il0sInNvdXJjZXNDb250ZW50IjpbInZhciBjb3JlID0gcmVxdWlyZSgnLi9fY29yZScpO1xudmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyIFNIQVJFRCA9ICdfX2NvcmUtanNfc2hhcmVkX18nO1xudmFyIHN0b3JlID0gZ2xvYmFsW1NIQVJFRF0gfHwgKGdsb2JhbFtTSEFSRURdID0ge30pO1xuXG4obW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoa2V5LCB2YWx1ZSkge1xuICByZXR1cm4gc3RvcmVba2V5XSB8fCAoc3RvcmVba2V5XSA9IHZhbHVlICE9PSB1bmRlZmluZWQgPyB2YWx1ZSA6IHt9KTtcbn0pKCd2ZXJzaW9ucycsIFtdKS5wdXNoKHtcbiAgdmVyc2lvbjogY29yZS52ZXJzaW9uLFxuICBtb2RlOiByZXF1aXJlKCcuL19saWJyYXJ5JykgPyAncHVyZScgOiAnZ2xvYmFsJyxcbiAgY29weXJpZ2h0OiAnwqkgMjAxOCBEZW5pcyBQdXNoa2FyZXYgKHpsb2lyb2NrLnJ1KSdcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3NoYXJlZC5qc1xuLy8gbW9kdWxlIGlkID0gNjNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///63\n");
394
-
395
- /***/ }),
396
- /* 64 */
397
- /***/ (function(module, exports) {
398
-
399
- eval("module.exports = true;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2xpYnJhcnkuanM/ZTVjNCJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IHRydWU7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9AYmFiZWwvcnVudGltZS1jb3JlanMyL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fbGlicmFyeS5qc1xuLy8gbW9kdWxlIGlkID0gNjRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///64\n");
400
-
401
- /***/ }),
402
- /* 65 */
403
- /***/ (function(module, exports) {
404
-
405
- eval("var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3VpZC5qcz9mNzA3Il0sInNvdXJjZXNDb250ZW50IjpbInZhciBpZCA9IDA7XG52YXIgcHggPSBNYXRoLnJhbmRvbSgpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoa2V5KSB7XG4gIHJldHVybiAnU3ltYm9sKCcuY29uY2F0KGtleSA9PT0gdW5kZWZpbmVkID8gJycgOiBrZXksICcpXycsICgrK2lkICsgcHgpLnRvU3RyaW5nKDM2KSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3VpZC5qc1xuLy8gbW9kdWxlIGlkID0gNjVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///65\n");
406
-
407
- /***/ }),
408
- /* 66 */
409
- /***/ (function(module, exports) {
410
-
411
- eval("// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2VudW0tYnVnLWtleXMuanM/YWI4MiJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBJRSA4LSBkb24ndCBlbnVtIGJ1ZyBrZXlzXG5tb2R1bGUuZXhwb3J0cyA9IChcbiAgJ2NvbnN0cnVjdG9yLGhhc093blByb3BlcnR5LGlzUHJvdG90eXBlT2YscHJvcGVydHlJc0VudW1lcmFibGUsdG9Mb2NhbGVTdHJpbmcsdG9TdHJpbmcsdmFsdWVPZidcbikuc3BsaXQoJywnKTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL0BiYWJlbC9ydW50aW1lLWNvcmVqczIvbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19lbnVtLWJ1Zy1rZXlzLmpzXG4vLyBtb2R1bGUgaWQgPSA2NlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///66\n");
412
-
413
- /***/ }),
414
- /* 67 */
415
- /***/ (function(module, exports) {
416
-
417
- eval("exports.f = Object.getOwnPropertySymbols;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1nb3BzLmpzPzk0MzEiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0cy5mID0gT2JqZWN0LmdldE93blByb3BlcnR5U3ltYm9scztcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL0BiYWJlbC9ydW50aW1lLWNvcmVqczIvbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtZ29wcy5qc1xuLy8gbW9kdWxlIGlkID0gNjdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///67\n");
418
-
419
- /***/ }),
420
- /* 68 */
421
- /***/ (function(module, exports) {
422
-
423
- eval("exports.f = {}.propertyIsEnumerable;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1waWUuanM/NWJmNSJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnRzLmYgPSB7fS5wcm9wZXJ0eUlzRW51bWVyYWJsZTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL0BiYWJlbC9ydW50aW1lLWNvcmVqczIvbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtcGllLmpzXG4vLyBtb2R1bGUgaWQgPSA2OFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///68\n");
424
-
425
- /***/ }),
426
- /* 69 */
427
- /***/ (function(module, exports, __webpack_require__) {
428
-
429
- eval("// 7.1.13 ToObject(argument)\nvar defined = __webpack_require__(16);\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLW9iamVjdC5qcz80ODE2Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIDcuMS4xMyBUb09iamVjdChhcmd1bWVudClcbnZhciBkZWZpbmVkID0gcmVxdWlyZSgnLi9fZGVmaW5lZCcpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgcmV0dXJuIE9iamVjdChkZWZpbmVkKGl0KSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUtY29yZWpzMi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLW9iamVjdC5qc1xuLy8gbW9kdWxlIGlkID0gNjlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///69\n");
430
-
431
- /***/ }),
432
- /* 70 */
433
- /***/ (function(module, exports, __webpack_require__) {
434
-
435
- eval("/**\n * @preserve jed.js https://github.com/SlexAxton/Jed\n */\n/*\n-----------\nA gettext compatible i18n library for modern JavaScript Applications\n\nby Alex Sexton - AlexSexton [at] gmail - @SlexAxton\n\nMIT License\n\nA jQuery Foundation project - requires CLA to contribute -\nhttps://contribute.jquery.org/CLA/\n\n\n\nJed offers the entire applicable GNU gettext spec'd set of\nfunctions, but also offers some nicer wrappers around them.\nThe api for gettext was written for a language with no function\noverloading, so Jed allows a little more of that.\n\nMany thanks to Joshua I. Miller - unrtst@cpan.org - who wrote\ngettext.js back in 2008. I was able to vet a lot of my ideas\nagainst his. I also made sure Jed passed against his tests\nin order to offer easy upgrades -- jsgettext.berlios.de\n*/\n(function (root, undef) {\n\n // Set up some underscore-style functions, if you already have\n // underscore, feel free to delete this section, and use it\n // directly, however, the amount of functions used doesn't\n // warrant having underscore as a full dependency.\n // Underscore 1.3.0 was used to port and is licensed\n // under the MIT License by Jeremy Ashkenas.\n var ArrayProto = Array.prototype,\n ObjProto = Object.prototype,\n slice = ArrayProto.slice,\n hasOwnProp = ObjProto.hasOwnProperty,\n nativeForEach = ArrayProto.forEach,\n breaker = {};\n\n // We're not using the OOP style _ so we don't need the\n // extra level of indirection. This still means that you\n // sub out for real `_` though.\n var _ = {\n forEach : function( obj, iterator, context ) {\n var i, l, key;\n if ( obj === null ) {\n return;\n }\n\n if ( nativeForEach && obj.forEach === nativeForEach ) {\n obj.forEach( iterator, context );\n }\n else if ( obj.length === +obj.length ) {\n for ( i = 0, l = obj.length; i < l; i++ ) {\n if ( i in obj && iterator.call( context, obj[i], i, obj ) === breaker ) {\n return;\n }\n }\n }\n else {\n for ( key in obj) {\n if ( hasOwnProp.call( obj, key ) ) {\n if ( iterator.call (context, obj[key], key, obj ) === breaker ) {\n return;\n }\n }\n }\n }\n },\n extend : function( obj ) {\n this.forEach( slice.call( arguments, 1 ), function ( source ) {\n for ( var prop in source ) {\n obj[prop] = source[prop];\n }\n });\n return obj;\n }\n };\n // END Miniature underscore impl\n\n // Jed is a constructor function\n var Jed = function ( options ) {\n // Some minimal defaults\n this.defaults = {\n \"locale_data\" : {\n \"messages\" : {\n \"\" : {\n \"domain\" : \"messages\",\n \"lang\" : \"en\",\n \"plural_forms\" : \"nplurals=2; plural=(n != 1);\"\n }\n // There are no default keys, though\n }\n },\n // The default domain if one is missing\n \"domain\" : \"messages\",\n // enable debug mode to log untranslated strings to the console\n \"debug\" : false\n };\n\n // Mix in the sent options with the default options\n this.options = _.extend( {}, this.defaults, options );\n this.textdomain( this.options.domain );\n\n if ( options.domain && ! this.options.locale_data[ this.options.domain ] ) {\n throw new Error('Text domain set to non-existent domain: `' + options.domain + '`');\n }\n };\n\n // The gettext spec sets this character as the default\n // delimiter for context lookups.\n // e.g.: context\\u0004key\n // If your translation company uses something different,\n // just change this at any time and it will use that instead.\n Jed.context_delimiter = String.fromCharCode( 4 );\n\n function getPluralFormFunc ( plural_form_string ) {\n return Jed.PF.compile( plural_form_string || \"nplurals=2; plural=(n != 1);\");\n }\n\n function Chain( key, i18n ){\n this._key = key;\n this._i18n = i18n;\n }\n\n // Create a chainable api for adding args prettily\n _.extend( Chain.prototype, {\n onDomain : function ( domain ) {\n this._domain = domain;\n return this;\n },\n withContext : function ( context ) {\n this._context = context;\n return this;\n },\n ifPlural : function ( num, pkey ) {\n this._val = num;\n this._pkey = pkey;\n return this;\n },\n fetch : function ( sArr ) {\n if ( {}.toString.call( sArr ) != '[object Array]' ) {\n sArr = [].slice.call(arguments, 0);\n }\n return ( sArr && sArr.length ? Jed.sprintf : function(x){ return x; } )(\n this._i18n.dcnpgettext(this._domain, this._context, this._key, this._pkey, this._val),\n sArr\n );\n }\n });\n\n // Add functions to the Jed prototype.\n // These will be the functions on the object that's returned\n // from creating a `new Jed()`\n // These seem redundant, but they gzip pretty well.\n _.extend( Jed.prototype, {\n // The sexier api start point\n translate : function ( key ) {\n return new Chain( key, this );\n },\n\n textdomain : function ( domain ) {\n if ( ! domain ) {\n return this._textdomain;\n }\n this._textdomain = domain;\n },\n\n gettext : function ( key ) {\n return this.dcnpgettext.call( this, undef, undef, key );\n },\n\n dgettext : function ( domain, key ) {\n return this.dcnpgettext.call( this, domain, undef, key );\n },\n\n dcgettext : function ( domain , key /*, category */ ) {\n // Ignores the category anyways\n return this.dcnpgettext.call( this, domain, undef, key );\n },\n\n ngettext : function ( skey, pkey, val ) {\n return this.dcnpgettext.call( this, undef, undef, skey, pkey, val );\n },\n\n dngettext : function ( domain, skey, pkey, val ) {\n return this.dcnpgettext.call( this, domain, undef, skey, pkey, val );\n },\n\n dcngettext : function ( domain, skey, pkey, val/*, category */) {\n return this.dcnpgettext.call( this, domain, undef, skey, pkey, val );\n },\n\n pgettext : function ( context, key ) {\n return this.dcnpgettext.call( this, undef, context, key );\n },\n\n dpgettext : function ( domain, context, key ) {\n return this.dcnpgettext.call( this, domain, context, key );\n },\n\n dcpgettext : function ( domain, context, key/*, category */) {\n return this.dcnpgettext.call( this, domain, context, key );\n },\n\n npgettext : function ( context, skey, pkey, val ) {\n return this.dcnpgettext.call( this, undef, context, skey, pkey, val );\n },\n\n dnpgettext : function ( domain, context, skey, pkey, val ) {\n return this.dcnpgettext.call( this, domain, context, skey, pkey, val );\n },\n\n // The most fully qualified gettext function. It has every option.\n // Since it has every option, we can use it from every other method.\n // This is the bread and butter.\n // Technically there should be one more argument in this function for 'Category',\n // but since we never use it, we might as well not waste the bytes to define it.\n dcnpgettext : function ( domain, context, singular_key, plural_key, val ) {\n // Set some defaults\n\n plural_key = plural_key || singular_key;\n\n // Use the global domain default if one\n // isn't explicitly passed in\n domain = domain || this._textdomain;\n\n var fallback;\n\n // Handle special cases\n\n // No options found\n if ( ! this.options ) {\n // There's likely something wrong, but we'll return the correct key for english\n // We do this by instantiating a brand new Jed instance with the default set\n // for everything that could be broken.\n fallback = new Jed();\n return fallback.dcnpgettext.call( fallback, undefined, undefined, singular_key, plural_key, val );\n }\n\n // No translation data provided\n if ( ! this.options.locale_data ) {\n throw new Error('No locale data provided.');\n }\n\n if ( ! this.options.locale_data[ domain ] ) {\n throw new Error('Domain `' + domain + '` was not found.');\n }\n\n if ( ! this.options.locale_data[ domain ][ \"\" ] ) {\n throw new Error('No locale meta information provided.');\n }\n\n // Make sure we have a truthy key. Otherwise we might start looking\n // into the empty string key, which is the options for the locale\n // data.\n if ( ! singular_key ) {\n throw new Error('No translation key found.');\n }\n\n var key = context ? context + Jed.context_delimiter + singular_key : singular_key,\n locale_data = this.options.locale_data,\n dict = locale_data[ domain ],\n defaultConf = (locale_data.messages || this.defaults.locale_data.messages)[\"\"],\n pluralForms = dict[\"\"].plural_forms || dict[\"\"][\"Plural-Forms\"] || dict[\"\"][\"plural-forms\"] || defaultConf.plural_forms || defaultConf[\"Plural-Forms\"] || defaultConf[\"plural-forms\"],\n val_list,\n res;\n\n var val_idx;\n if (val === undefined) {\n // No value passed in; assume singular key lookup.\n val_idx = 0;\n\n } else {\n // Value has been passed in; use plural-forms calculations.\n\n // Handle invalid numbers, but try casting strings for good measure\n if ( typeof val != 'number' ) {\n val = parseInt( val, 10 );\n\n if ( isNaN( val ) ) {\n throw new Error('The number that was passed in is not a number.');\n }\n }\n\n val_idx = getPluralFormFunc(pluralForms)(val);\n }\n\n // Throw an error if a domain isn't found\n if ( ! dict ) {\n throw new Error('No domain named `' + domain + '` could be found.');\n }\n\n val_list = dict[ key ];\n\n // If there is no match, then revert back to\n // english style singular/plural with the keys passed in.\n if ( ! val_list || val_idx > val_list.length ) {\n if (this.options.missing_key_callback) {\n this.options.missing_key_callback(key, domain);\n }\n res = [ singular_key, plural_key ];\n\n // collect untranslated strings\n if (this.options.debug===true) {\n console.log(res[ getPluralFormFunc(pluralForms)( val ) ]);\n }\n return res[ getPluralFormFunc()( val ) ];\n }\n\n res = val_list[ val_idx ];\n\n // This includes empty strings on purpose\n if ( ! res ) {\n res = [ singular_key, plural_key ];\n return res[ getPluralFormFunc()( val ) ];\n }\n return res;\n }\n });\n\n\n // We add in sprintf capabilities for post translation value interolation\n // This is not internally used, so you can remove it if you have this\n // available somewhere else, or want to use a different system.\n\n // We _slightly_ modify the normal sprintf behavior to more gracefully handle\n // undefined values.\n\n /**\n sprintf() for JavaScript 0.7-beta1\n http://www.diveintojavascript.com/projects/javascript-sprintf\n\n Copyright (c) Alexandru Marasteanu <alexaholic [at) gmail (dot] com>\n All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n * Neither the name of sprintf() for JavaScript nor the\n names of its contributors may be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n DISCLAIMED. IN NO EVENT SHALL Alexandru Marasteanu BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n var sprintf = (function() {\n function get_type(variable) {\n return Object.prototype.toString.call(variable).slice(8, -1).toLowerCase();\n }\n function str_repeat(input, multiplier) {\n for (var output = []; multiplier > 0; output[--multiplier] = input) {/* do nothing */}\n return output.join('');\n }\n\n var str_format = function() {\n if (!str_format.cache.hasOwnProperty(arguments[0])) {\n str_format.cache[arguments[0]] = str_format.parse(arguments[0]);\n }\n return str_format.format.call(null, str_format.cache[arguments[0]], arguments);\n };\n\n str_format.format = function(parse_tree, argv) {\n var cursor = 1, tree_length = parse_tree.length, node_type = '', arg, output = [], i, k, match, pad, pad_character, pad_length;\n for (i = 0; i < tree_length; i++) {\n node_type = get_type(parse_tree[i]);\n if (node_type === 'string') {\n output.push(parse_tree[i]);\n }\n else if (node_type === 'array') {\n match = parse_tree[i]; // convenience purposes only\n if (match[2]) { // keyword argument\n arg = argv[cursor];\n for (k = 0; k < match[2].length; k++) {\n if (!arg.hasOwnProperty(match[2][k])) {\n throw(sprintf('[sprintf] property \"%s\" does not exist', match[2][k]));\n }\n arg = arg[match[2][k]];\n }\n }\n else if (match[1]) { // positional argument (explicit)\n arg = argv[match[1]];\n }\n else { // positional argument (implicit)\n arg = argv[cursor++];\n }\n\n if (/[^s]/.test(match[8]) && (get_type(arg) != 'number')) {\n throw(sprintf('[sprintf] expecting number but found %s', get_type(arg)));\n }\n\n // Jed EDIT\n if ( typeof arg == 'undefined' || arg === null ) {\n arg = '';\n }\n // Jed EDIT\n\n switch (match[8]) {\n case 'b': arg = arg.toString(2); break;\n case 'c': arg = String.fromCharCode(arg); break;\n case 'd': arg = parseInt(arg, 10); break;\n case 'e': arg = match[7] ? arg.toExponential(match[7]) : arg.toExponential(); break;\n case 'f': arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg); break;\n case 'o': arg = arg.toString(8); break;\n case 's': arg = ((arg = String(arg)) && match[7] ? arg.substring(0, match[7]) : arg); break;\n case 'u': arg = Math.abs(arg); break;\n case 'x': arg = arg.toString(16); break;\n case 'X': arg = arg.toString(16).toUpperCase(); break;\n }\n arg = (/[def]/.test(match[8]) && match[3] && arg >= 0 ? '+'+ arg : arg);\n pad_character = match[4] ? match[4] == '0' ? '0' : match[4].charAt(1) : ' ';\n pad_length = match[6] - String(arg).length;\n pad = match[6] ? str_repeat(pad_character, pad_length) : '';\n output.push(match[5] ? arg + pad : pad + arg);\n }\n }\n return output.join('');\n };\n\n str_format.cache = {};\n\n str_format.parse = function(fmt) {\n var _fmt = fmt, match = [], parse_tree = [], arg_names = 0;\n while (_fmt) {\n if ((match = /^[^\\x25]+/.exec(_fmt)) !== null) {\n parse_tree.push(match[0]);\n }\n else if ((match = /^\\x25{2}/.exec(_fmt)) !== null) {\n parse_tree.push('%');\n }\n else if ((match = /^\\x25(?:([1-9]\\d*)\\$|\\(([^\\)]+)\\))?(\\+)?(0|'[^$])?(-)?(\\d+)?(?:\\.(\\d+))?([b-fosuxX])/.exec(_fmt)) !== null) {\n if (match[2]) {\n arg_names |= 1;\n var field_list = [], replacement_field = match[2], field_match = [];\n if ((field_match = /^([a-z_][a-z_\\d]*)/i.exec(replacement_field)) !== null) {\n field_list.push(field_match[1]);\n while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') {\n if ((field_match = /^\\.([a-z_][a-z_\\d]*)/i.exec(replacement_field)) !== null) {\n field_list.push(field_match[1]);\n }\n else if ((field_match = /^\\[(\\d+)\\]/.exec(replacement_field)) !== null) {\n field_list.push(field_match[1]);\n }\n else {\n throw('[sprintf] huh?');\n }\n }\n }\n else {\n throw('[sprintf] huh?');\n }\n match[2] = field_list;\n }\n else {\n arg_names |= 2;\n }\n if (arg_names === 3) {\n throw('[sprintf] mixing positional and named placeholders is not (yet) supported');\n }\n parse_tree.push(match);\n }\n else {\n throw('[sprintf] huh?');\n }\n _fmt = _fmt.substring(match[0].length);\n }\n return parse_tree;\n };\n\n return str_format;\n })();\n\n var vsprintf = function(fmt, argv) {\n argv.unshift(fmt);\n return sprintf.apply(null, argv);\n };\n\n Jed.parse_plural = function ( plural_forms, n ) {\n plural_forms = plural_forms.replace(/n/g, n);\n return Jed.parse_expression(plural_forms);\n };\n\n Jed.sprintf = function ( fmt, args ) {\n if ( {}.toString.call( args ) == '[object Array]' ) {\n return vsprintf( fmt, [].slice.call(args) );\n }\n return sprintf.apply(this, [].slice.call(arguments) );\n };\n\n Jed.prototype.sprintf = function () {\n return Jed.sprintf.apply(this, arguments);\n };\n // END sprintf Implementation\n\n // Start the Plural forms section\n // This is a full plural form expression parser. It is used to avoid\n // running 'eval' or 'new Function' directly against the plural\n // forms.\n //\n // This can be important if you get translations done through a 3rd\n // party vendor. I encourage you to use this instead, however, I\n // also will provide a 'precompiler' that you can use at build time\n // to output valid/safe function representations of the plural form\n // expressions. This means you can build this code out for the most\n // part.\n Jed.PF = {};\n\n Jed.PF.parse = function ( p ) {\n var plural_str = Jed.PF.extractPluralExpr( p );\n return Jed.PF.parser.parse.call(Jed.PF.parser, plural_str);\n };\n\n Jed.PF.compile = function ( p ) {\n // Handle trues and falses as 0 and 1\n function imply( val ) {\n return (val === true ? 1 : val ? val : 0);\n }\n\n var ast = Jed.PF.parse( p );\n return function ( n ) {\n return imply( Jed.PF.interpreter( ast )( n ) );\n };\n };\n\n Jed.PF.interpreter = function ( ast ) {\n return function ( n ) {\n var res;\n switch ( ast.type ) {\n case 'GROUP':\n return Jed.PF.interpreter( ast.expr )( n );\n case 'TERNARY':\n if ( Jed.PF.interpreter( ast.expr )( n ) ) {\n return Jed.PF.interpreter( ast.truthy )( n );\n }\n return Jed.PF.interpreter( ast.falsey )( n );\n case 'OR':\n return Jed.PF.interpreter( ast.left )( n ) || Jed.PF.interpreter( ast.right )( n );\n case 'AND':\n return Jed.PF.interpreter( ast.left )( n ) && Jed.PF.interpreter( ast.right )( n );\n case 'LT':\n return Jed.PF.interpreter( ast.left )( n ) < Jed.PF.interpreter( ast.right )( n );\n case 'GT':\n return Jed.PF.interpreter( ast.left )( n ) > Jed.PF.interpreter( ast.right )( n );\n case 'LTE':\n return Jed.PF.interpreter( ast.left )( n ) <= Jed.PF.interpreter( ast.right )( n );\n case 'GTE':\n return Jed.PF.interpreter( ast.left )( n ) >= Jed.PF.interpreter( ast.right )( n );\n case 'EQ':\n return Jed.PF.interpreter( ast.left )( n ) == Jed.PF.interpreter( ast.right )( n );\n case 'NEQ':\n return Jed.PF.interpreter( ast.left )( n ) != Jed.PF.interpreter( ast.right )( n );\n case 'MOD':\n return Jed.PF.interpreter( ast.left )( n ) % Jed.PF.interpreter( ast.right )( n );\n case 'VAR':\n return n;\n case 'NUM':\n return ast.val;\n default:\n throw new Error(\"Invalid Token found.\");\n }\n };\n };\n\n Jed.PF.extractPluralExpr = function ( p ) {\n // trim first\n p = p.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\n\n if (! /;\\s*$/.test(p)) {\n p = p.concat(';');\n }\n\n var nplurals_re = /nplurals\\=(\\d+);/,\n plural_re = /plural\\=(.*);/,\n nplurals_matches = p.match( nplurals_re ),\n res = {},\n plural_matches;\n\n // Find the nplurals number\n if ( nplurals_matches.length > 1 ) {\n res.nplurals = nplurals_matches[1];\n }\n else {\n throw new Error('nplurals not found in plural_forms string: ' + p );\n }\n\n // remove that data to get to the formula\n p = p.replace( nplurals_re, \"\" );\n plural_matches = p.match( plural_re );\n\n if (!( plural_matches && plural_matches.length > 1 ) ) {\n throw new Error('`plural` expression not found: ' + p);\n }\n return plural_matches[ 1 ];\n };\n\n /* Jison generated parser */\n Jed.PF.parser = (function(){\n\nvar parser = {trace: function trace() { },\nyy: {},\nsymbols_: {\"error\":2,\"expressions\":3,\"e\":4,\"EOF\":5,\"?\":6,\":\":7,\"||\":8,\"&&\":9,\"<\":10,\"<=\":11,\">\":12,\">=\":13,\"!=\":14,\"==\":15,\"%\":16,\"(\":17,\")\":18,\"n\":19,\"NUMBER\":20,\"$accept\":0,\"$end\":1},\nterminals_: {2:\"error\",5:\"EOF\",6:\"?\",7:\":\",8:\"||\",9:\"&&\",10:\"<\",11:\"<=\",12:\">\",13:\">=\",14:\"!=\",15:\"==\",16:\"%\",17:\"(\",18:\")\",19:\"n\",20:\"NUMBER\"},\nproductions_: [0,[3,2],[4,5],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,1],[4,1]],\nperformAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {\n\nvar $0 = $$.length - 1;\nswitch (yystate) {\ncase 1: return { type : 'GROUP', expr: $$[$0-1] };\nbreak;\ncase 2:this.$ = { type: 'TERNARY', expr: $$[$0-4], truthy : $$[$0-2], falsey: $$[$0] };\nbreak;\ncase 3:this.$ = { type: \"OR\", left: $$[$0-2], right: $$[$0] };\nbreak;\ncase 4:this.$ = { type: \"AND\", left: $$[$0-2], right: $$[$0] };\nbreak;\ncase 5:this.$ = { type: 'LT', left: $$[$0-2], right: $$[$0] };\nbreak;\ncase 6:this.$ = { type: 'LTE', left: $$[$0-2], right: $$[$0] };\nbreak;\ncase 7:this.$ = { type: 'GT', left: $$[$0-2], right: $$[$0] };\nbreak;\ncase 8:this.$ = { type: 'GTE', left: $$[$0-2], right: $$[$0] };\nbreak;\ncase 9:this.$ = { type: 'NEQ', left: $$[$0-2], right: $$[$0] };\nbreak;\ncase 10:this.$ = { type: 'EQ', left: $$[$0-2], right: $$[$0] };\nbreak;\ncase 11:this.$ = { type: 'MOD', left: $$[$0-2], right: $$[$0] };\nbreak;\ncase 12:this.$ = { type: 'GROUP', expr: $$[$0-1] };\nbreak;\ncase 13:this.$ = { type: 'VAR' };\nbreak;\ncase 14:this.$ = { type: 'NUM', val: Number(yytext) };\nbreak;\n}\n},\ntable: [{3:1,4:2,17:[1,3],19:[1,4],20:[1,5]},{1:[3]},{5:[1,6],6:[1,7],8:[1,8],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16]},{4:17,17:[1,3],19:[1,4],20:[1,5]},{5:[2,13],6:[2,13],7:[2,13],8:[2,13],9:[2,13],10:[2,13],11:[2,13],12:[2,13],13:[2,13],14:[2,13],15:[2,13],16:[2,13],18:[2,13]},{5:[2,14],6:[2,14],7:[2,14],8:[2,14],9:[2,14],10:[2,14],11:[2,14],12:[2,14],13:[2,14],14:[2,14],15:[2,14],16:[2,14],18:[2,14]},{1:[2,1]},{4:18,17:[1,3],19:[1,4],20:[1,5]},{4:19,17:[1,3],19:[1,4],20:[1,5]},{4:20,17:[1,3],19:[1,4],20:[1,5]},{4:21,17:[1,3],19:[1,4],20:[1,5]},{4:22,17:[1,3],19:[1,4],20:[1,5]},{4:23,17:[1,3],19:[1,4],20:[1,5]},{4:24,17:[1,3],19:[1,4],20:[1,5]},{4:25,17:[1,3],19:[1,4],20:[1,5]},{4:26,17:[1,3],19:[1,4],20:[1,5]},{4:27,17:[1,3],19:[1,4],20:[1,5]},{6:[1,7],8:[1,8],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16],18:[1,28]},{6:[1,7],7:[1,29],8:[1,8],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16]},{5:[2,3],6:[2,3],7:[2,3],8:[2,3],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16],18:[2,3]},{5:[2,4],6:[2,4],7:[2,4],8:[2,4],9:[2,4],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16],18:[2,4]},{5:[2,5],6:[2,5],7:[2,5],8:[2,5],9:[2,5],10:[2,5],11:[2,5],12:[2,5],13:[2,5],14:[2,5],15:[2,5],16:[1,16],18:[2,5]},{5:[2,6],6:[2,6],7:[2,6],8:[2,6],9:[2,6],10:[2,6],11:[2,6],12:[2,6],13:[2,6],14:[2,6],15:[2,6],16:[1,16],18:[2,6]},{5:[2,7],6:[2,7],7:[2,7],8:[2,7],9:[2,7],10:[2,7],11:[2,7],12:[2,7],13:[2,7],14:[2,7],15:[2,7],16:[1,16],18:[2,7]},{5:[2,8],6:[2,8],7:[2,8],8:[2,8],9:[2,8],10:[2,8],11:[2,8],12:[2,8],13:[2,8],14:[2,8],15:[2,8],16:[1,16],18:[2,8]},{5:[2,9],6:[2,9],7:[2,9],8:[2,9],9:[2,9],10:[2,9],11:[2,9],12:[2,9],13:[2,9],14:[2,9],15:[2,9],16:[1,16],18:[2,9]},{5:[2,10],6:[2,10],7:[2,10],8:[2,10],9:[2,10],10:[2,10],11:[2,10],12:[2,10],13:[2,10],14:[2,10],15:[2,10],16:[1,16],18:[2,10]},{5:[2,11],6:[2,11],7:[2,11],8:[2,11],9:[2,11],10:[2,11],11:[2,11],12:[2,11],13:[2,11],14:[2,11],15:[2,11],16:[2,11],18:[2,11]},{5:[2,12],6:[2,12],7:[2,12],8:[2,12],9:[2,12],10:[2,12],11:[2,12],12:[2,12],13:[2,12],14:[2,12],15:[2,12],16:[2,12],18:[2,12]},{4:30,17:[1,3],19:[1,4],20:[1,5]},{5:[2,2],6:[1,7],7:[2,2],8:[1,8],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16],18:[2,2]}],\ndefaultActions: {6:[2,1]},\nparseError: function parseError(str, hash) {\n throw new Error(str);\n},\nparse: function parse(input) {\n var self = this,\n stack = [0],\n vstack = [null], // semantic value stack\n lstack = [], // location stack\n table = this.table,\n yytext = '',\n yylineno = 0,\n yyleng = 0,\n recovering = 0,\n TERROR = 2,\n EOF = 1;\n\n //this.reductionCount = this.shiftCount = 0;\n\n this.lexer.setInput(input);\n this.lexer.yy = this.yy;\n this.yy.lexer = this.lexer;\n if (typeof this.lexer.yylloc == 'undefined')\n this.lexer.yylloc = {};\n var yyloc = this.lexer.yylloc;\n lstack.push(yyloc);\n\n if (typeof this.yy.parseError === 'function')\n this.parseError = this.yy.parseError;\n\n function popStack (n) {\n stack.length = stack.length - 2*n;\n vstack.length = vstack.length - n;\n lstack.length = lstack.length - n;\n }\n\n function lex() {\n var token;\n token = self.lexer.lex() || 1; // $end = 1\n // if token isn't its numeric value, convert\n if (typeof token !== 'number') {\n token = self.symbols_[token] || token;\n }\n return token;\n }\n\n var symbol, preErrorSymbol, state, action, a, r, yyval={},p,len,newState, expected;\n while (true) {\n // retreive state number from top of stack\n state = stack[stack.length-1];\n\n // use default actions if available\n if (this.defaultActions[state]) {\n action = this.defaultActions[state];\n } else {\n if (symbol == null)\n symbol = lex();\n // read action for current state and first input\n action = table[state] && table[state][symbol];\n }\n\n // handle parse error\n _handle_error:\n if (typeof action === 'undefined' || !action.length || !action[0]) {\n\n if (!recovering) {\n // Report error\n expected = [];\n for (p in table[state]) if (this.terminals_[p] && p > 2) {\n expected.push(\"'\"+this.terminals_[p]+\"'\");\n }\n var errStr = '';\n if (this.lexer.showPosition) {\n errStr = 'Parse error on line '+(yylineno+1)+\":\\n\"+this.lexer.showPosition()+\"\\nExpecting \"+expected.join(', ') + \", got '\" + this.terminals_[symbol]+ \"'\";\n } else {\n errStr = 'Parse error on line '+(yylineno+1)+\": Unexpected \" +\n (symbol == 1 /*EOF*/ ? \"end of input\" :\n (\"'\"+(this.terminals_[symbol] || symbol)+\"'\"));\n }\n this.parseError(errStr,\n {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected});\n }\n\n // just recovered from another error\n if (recovering == 3) {\n if (symbol == EOF) {\n throw new Error(errStr || 'Parsing halted.');\n }\n\n // discard current lookahead and grab another\n yyleng = this.lexer.yyleng;\n yytext = this.lexer.yytext;\n yylineno = this.lexer.yylineno;\n yyloc = this.lexer.yylloc;\n symbol = lex();\n }\n\n // try to recover from error\n while (1) {\n // check for error recovery rule in this state\n if ((TERROR.toString()) in table[state]) {\n break;\n }\n if (state == 0) {\n throw new Error(errStr || 'Parsing halted.');\n }\n popStack(1);\n state = stack[stack.length-1];\n }\n\n preErrorSymbol = symbol; // save the lookahead token\n symbol = TERROR; // insert generic error symbol as new lookahead\n state = stack[stack.length-1];\n action = table[state] && table[state][TERROR];\n recovering = 3; // allow 3 real symbols to be shifted before reporting a new error\n }\n\n // this shouldn't happen, unless resolve defaults are off\n if (action[0] instanceof Array && action.length > 1) {\n throw new Error('Parse Error: multiple actions possible at state: '+state+', token: '+symbol);\n }\n\n switch (action[0]) {\n\n case 1: // shift\n //this.shiftCount++;\n\n stack.push(symbol);\n vstack.push(this.lexer.yytext);\n lstack.push(this.lexer.yylloc);\n stack.push(action[1]); // push state\n symbol = null;\n if (!preErrorSymbol) { // normal execution/no error\n yyleng = this.lexer.yyleng;\n yytext = this.lexer.yytext;\n yylineno = this.lexer.yylineno;\n yyloc = this.lexer.yylloc;\n if (recovering > 0)\n recovering--;\n } else { // error just occurred, resume old lookahead f/ before error\n symbol = preErrorSymbol;\n preErrorSymbol = null;\n }\n break;\n\n case 2: // reduce\n //this.reductionCount++;\n\n len = this.productions_[action[1]][1];\n\n // perform semantic action\n yyval.$ = vstack[vstack.length-len]; // default to $$ = $1\n // default location, uses first token for firsts, last for lasts\n yyval._$ = {\n first_line: lstack[lstack.length-(len||1)].first_line,\n last_line: lstack[lstack.length-1].last_line,\n first_column: lstack[lstack.length-(len||1)].first_column,\n last_column: lstack[lstack.length-1].last_column\n };\n r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);\n\n if (typeof r !== 'undefined') {\n return r;\n }\n\n // pop off stack\n if (len) {\n stack = stack.slice(0,-1*len*2);\n vstack = vstack.slice(0, -1*len);\n lstack = lstack.slice(0, -1*len);\n }\n\n stack.push(this.productions_[action[1]][0]); // push nonterminal (reduce)\n vstack.push(yyval.$);\n lstack.push(yyval._$);\n // goto new state = table[STATE][NONTERMINAL]\n newState = table[stack[stack.length-2]][stack[stack.length-1]];\n stack.push(newState);\n break;\n\n case 3: // accept\n return true;\n }\n\n }\n\n return true;\n}};/* Jison generated lexer */\nvar lexer = (function(){\n\nvar lexer = ({EOF:1,\nparseError:function parseError(str, hash) {\n if (this.yy.parseError) {\n this.yy.parseError(str, hash);\n } else {\n throw new Error(str);\n }\n },\nsetInput:function (input) {\n this._input = input;\n this._more = this._less = this.done = false;\n this.yylineno = this.yyleng = 0;\n this.yytext = this.matched = this.match = '';\n this.conditionStack = ['INITIAL'];\n this.yylloc = {first_line:1,first_column:0,last_line:1,last_column:0};\n return this;\n },\ninput:function () {\n var ch = this._input[0];\n this.yytext+=ch;\n this.yyleng++;\n this.match+=ch;\n this.matched+=ch;\n var lines = ch.match(/\\n/);\n if (lines) this.yylineno++;\n this._input = this._input.slice(1);\n return ch;\n },\nunput:function (ch) {\n this._input = ch + this._input;\n return this;\n },\nmore:function () {\n this._more = true;\n return this;\n },\npastInput:function () {\n var past = this.matched.substr(0, this.matched.length - this.match.length);\n return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\\n/g, \"\");\n },\nupcomingInput:function () {\n var next = this.match;\n if (next.length < 20) {\n next += this._input.substr(0, 20-next.length);\n }\n return (next.substr(0,20)+(next.length > 20 ? '...':'')).replace(/\\n/g, \"\");\n },\nshowPosition:function () {\n var pre = this.pastInput();\n var c = new Array(pre.length + 1).join(\"-\");\n return pre + this.upcomingInput() + \"\\n\" + c+\"^\";\n },\nnext:function () {\n if (this.done) {\n return this.EOF;\n }\n if (!this._input) this.done = true;\n\n var token,\n match,\n col,\n lines;\n if (!this._more) {\n this.yytext = '';\n this.match = '';\n }\n var rules = this._currentRules();\n for (var i=0;i < rules.length; i++) {\n match = this._input.match(this.rules[rules[i]]);\n if (match) {\n lines = match[0].match(/\\n.*/g);\n if (lines) this.yylineno += lines.length;\n this.yylloc = {first_line: this.yylloc.last_line,\n last_line: this.yylineno+1,\n first_column: this.yylloc.last_column,\n last_column: lines ? lines[lines.length-1].length-1 : this.yylloc.last_column + match[0].length}\n this.yytext += match[0];\n this.match += match[0];\n this.matches = match;\n this.yyleng = this.yytext.length;\n this._more = false;\n this._input = this._input.slice(match[0].length);\n this.matched += match[0];\n token = this.performAction.call(this, this.yy, this, rules[i],this.conditionStack[this.conditionStack.length-1]);\n if (token) return token;\n else return;\n }\n }\n if (this._input === \"\") {\n return this.EOF;\n } else {\n this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\\n'+this.showPosition(),\n {text: \"\", token: null, line: this.yylineno});\n }\n },\nlex:function lex() {\n var r = this.next();\n if (typeof r !== 'undefined') {\n return r;\n } else {\n return this.lex();\n }\n },\nbegin:function begin(condition) {\n this.conditionStack.push(condition);\n },\npopState:function popState() {\n return this.conditionStack.pop();\n },\n_currentRules:function _currentRules() {\n return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;\n },\ntopState:function () {\n return this.conditionStack[this.conditionStack.length-2];\n },\npushState:function begin(condition) {\n this.begin(condition);\n }});\nlexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {\n\nvar YYSTATE=YY_START;\nswitch($avoiding_name_collisions) {\ncase 0:/* skip whitespace */\nbreak;\ncase 1:return 20\nbreak;\ncase 2:return 19\nbreak;\ncase 3:return 8\nbreak;\ncase 4:return 9\nbreak;\ncase 5:return 6\nbreak;\ncase 6:return 7\nbreak;\ncase 7:return 11\nbreak;\ncase 8:return 13\nbreak;\ncase 9:return 10\nbreak;\ncase 10:return 12\nbreak;\ncase 11:return 14\nbreak;\ncase 12:return 15\nbreak;\ncase 13:return 16\nbreak;\ncase 14:return 17\nbreak;\ncase 15:return 18\nbreak;\ncase 16:return 5\nbreak;\ncase 17:return 'INVALID'\nbreak;\n}\n};\nlexer.rules = [/^\\s+/,/^[0-9]+(\\.[0-9]+)?\\b/,/^n\\b/,/^\\|\\|/,/^&&/,/^\\?/,/^:/,/^<=/,/^>=/,/^</,/^>/,/^!=/,/^==/,/^%/,/^\\(/,/^\\)/,/^$/,/^./];\nlexer.conditions = {\"INITIAL\":{\"rules\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],\"inclusive\":true}};return lexer;})()\nparser.lexer = lexer;\nreturn parser;\n})();\n// End parser\n\n // Handle node, amd, and global systems\n if (true) {\n if (typeof module !== 'undefined' && module.exports) {\n exports = module.exports = Jed;\n }\n exports.Jed = Jed;\n }\n else {\n if (typeof define === 'function' && define.amd) {\n define(function() {\n return Jed;\n });\n }\n // Leak a global regardless of module system\n root['Jed'] = Jed;\n }\n\n})(this);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvamVkL2plZC5qcz9kNWFlIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQHByZXNlcnZlIGplZC5qcyBodHRwczovL2dpdGh1Yi5jb20vU2xleEF4dG9uL0plZFxuICovXG4vKlxuLS0tLS0tLS0tLS1cbkEgZ2V0dGV4dCBjb21wYXRpYmxlIGkxOG4gbGlicmFyeSBmb3IgbW9kZXJuIEphdmFTY3JpcHQgQXBwbGljYXRpb25zXG5cbmJ5IEFsZXggU2V4dG9uIC0gQWxleFNleHRvbiBbYXRdIGdtYWlsIC0gQFNsZXhBeHRvblxuXG5NSVQgTGljZW5zZVxuXG5BIGpRdWVyeSBGb3VuZGF0aW9uIHByb2plY3QgLSByZXF1aXJlcyBDTEEgdG8gY29udHJpYnV0ZSAtXG5odHRwczovL2NvbnRyaWJ1dGUuanF1ZXJ5Lm9yZy9DTEEvXG5cblxuXG5KZWQg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cbiAgICAgICAgICBpZiAoIGkgaW4gb2JqICYmIGl0ZXJhdG9yLmNhbGwoIGNvbnRleHQsIG9ialtpXSwgaSwgb2JqICkgPT09IGJyZWFrZXIgKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgICBlbHNlIHtcbiAgICAgICAgZm9yICgga2V5IGluIG9iaikge1xuICAgICAgICAgIGlmICggaGFzT3duUHJvcC5jYWxsKCBvYmosIGtleSApICkge1xuICAgICAgICAgICAgaWYgKCBpdGVyYXRvci5jYWxsIChjb250ZXh0LCBvYmpba2V5XSwga2V5LCBvYmogKSA9PT0gYnJlYWtlciApIHtcbiAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0sXG4gICAgZXh0ZW5kIDogZnVuY3Rpb24oIG9iaiApIHtcbiAgICAgIHRoaXMuZm9yRWFjaCggc2xpY2UuY2FsbCggYXJndW1lbnRzLCAxICksIGZ1bmN0aW9uICggc291cmNlICkge1xuICAgICAgICBmb3IgKCB2YXIgcHJvcCBpbiBzb3VyY2UgKSB7XG4gICAgICAgICAgb2JqW3Byb3BdID0gc291cmNlW3Byb3BdO1xuICAgICAgICB9XG4gICAgICB9KTtcbiAgICAgIHJldHVybiBvYmo7XG4gICAgfVxuICB9O1xuICAvLyBFTkQgTWluaWF0dXJlIHVuZGVyc2NvcmUgaW1wbFxuXG4gIC8vIEplZCBpcyBhIGNvbnN0cnVjdG9yIGZ1bmN0aW9uXG4gIHZhciBKZWQgPSBmdW5jdGlvbiAoIG9wdGlvbnMgKSB7XG4gICAgLy8gU29tZSBtaW5pbWFsIGRlZmF1bHRzXG4gICAgdGhpcy5kZWZhdWx0cyA9IHtcbiAgICAgIFwibG9jYWxlX2RhdGFcIiA6IHtcbiAgICAgICAgXCJtZXNzYWdlc1wiIDoge1xuICAgICAgICAgIFwiXCIgOi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ICAgICAgICAgICAgICBhcmcgPSBhcmdbbWF0Y2hbMl1ba11dO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBlbHNlIGlmIChtYXRjaFsxXSkgeyAvLyBwb3NpdGlvbmFsIGFyZ3VtZW50IChleHBsaWNpdClcbiAgICAgICAgICAgIGFyZyA9IGFyZ3ZbbWF0Y2hbMV1dO1xuICAgICAgICAgIH1cbiAgICAgICAgICBlbHNlIHsgLy8gcG9zaXRpb25hbCBhcmd1bWVudCAoaW1wbGljaXQpXG4gICAgICAgICAgICBhcmcgPSBhcmd2W2N1cnNvcisrXTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoL1tec10vLnRlc3QobWF0Y2hbOF0pICYmIChnZXRfdHlwZShhcmcpICE9ICdudW1iZXInKSkge1xuICAgICAgICAgICAgdGhyb3coc3ByaW50ZignW3NwcmludGZdIGV4cGVjdGluZyBudW1iZXIgYnV0IGZvdW5kICVzJywgZ2V0X3R5cGUoYXJnKSkpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIC8vIEplZCBFRElUXG4gICAgICAgICAgaWYgKCB0eXBlb2YgYXJnID09ICd1bmRlZmluZWQnIHx8IGFyZyA9PT0gbnVsbCApIHtcbiAgICAgICAgICAgIGFyZyA9ICcnO1xuICAgICAgICAgIH1cbiAgICAgICAgICAvLyBKZWQgRURJVFxuXG4gICAgICAgICAgc3dpdGNoIChtYXRjaFs4XSkge1xuICAgICAgICAgICAgY2FzZSAnYic6IGFyZyA9IGFyZy50b1N0cmluZygyKTsgYnJlYWs7XG4gICAgICAgICAgICBjYXNlICdjJzogYXJnID0gU3RyaW5nLmZyb21DaGFyQ29kZShhcmcpOyBicmVhaztcbiAgICAgICAgICAgIGNhc2UgJ2QnOiBhcmcgPSBwYXJzZUludChhcmcsIDEwKTsgYnJlYWs7XG4gICAgICAgICAgICBjYXNlICdlJzogYXJnID0gbWF0Y2hbN10gPyBhcmcudG9FeHBvbmVudGlhbChtY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GZpZWxkX2xpc3QucHVzaChmaWVsZF9tYXRjaFsxXSk7XG4gICAgICAgICAgICAgIHdoaWxlICgocmVwbGFjZW1lbnRfZmllbGQgPSByZXBsYWNlbWVudF9maWVsZC5zdWJzdHJpbmcoZmllbGRfbWF0Y2hbMF0ubGVuZ3RoKSkgIT09ICcnKSB7XG4gICAgICAgICAgICAgICAgaWYgKChmaWVsZF9tYXRjaCA9IC9eXFwuKFthLXpfXVthLXpfXFxkXSopL2kuZXhlYyhyZXBsYWNlbWVudF9maWVsZCkpICE9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICBmaWVsZF9saXN0LnB1c2goZmllbGRfbWF0Y2hbMV0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmICgoZmllbGRfbWF0Y2ggPSAvXlxcWyhcXGQrKVxcXS8uZXhlYyhyZXBsYWNlbWVudF9maWVsZCkpICE9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICBmaWVsZF9saXN0LnB1c2goZmllbGRfbWF0Y2hbMV0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgIHRocm93KCdbc3ByaW50Zl0gaHVoPycpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgIHRocm93KCdbc3ByaW50Zl0gaHVoPycpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbWF0Y2hbMl0gPSBmaWVsZF9saXN0O1xuICAgICAgICAgIH1cbiAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGFyZ19uYW1lcyB8PSAyO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoYXJnX25hbWVzID09PSAzKSB7XG4gICAgICAgICAgICB0aHJvdygnW3NwcmludGZdIG1peGluZyBwb3NpdGlvbmFsIGFuZCBuYW1lZC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GLnBhcnNlciwgcGx1cmFsX3N0cik7XG4gIH07XG5cbiAgSmVkLlBGLmNvbXBpbGUgPSBmdW5jdGlvbiAoIHAgKSB7XG4gICAgLy8gSGFuZGxlIHRydWVzIGFuZCBmYWxzZXMgYXMgMCBhbmQgMVxuICAgIGZ1bmN0aW9uIGltcGx5KCB2YWwgKSB7XG4gICAgICByZXR1cm4gKHZhbCA9PT0gdHJ1ZSA/IDEgOiB2YWwgPyB2YWwgOiAwKTtcbiAgICB9XG5cbiAgICB2YXIgYXN0ID0gSmVkLlBGLnBhcnNlKCBwICk7XG4gICAgcmV0dXJuIGZ1bmN0aW9uICggbiApIHtcbiAgICAgIHJldHVybiBpbXBseSggSmVkLlBGLmludGVycHJldGVyKCBhc3QgKSggbiApICk7XG4gICAgfTtcbiAgfTtcblxuICBKZWQuUEYuaW50ZXJwcmV0ZXIgPSBmdW5jdGlvbiAoIGFzdCApIHtcbiAgICByZXR1cm4gZnVuY3Rpb24gKCBuICkge1xuICAgICAgdmFyIHJlcztcbiAgICAgIHN3aXRjaCAoIGFzdC50eXBlICkge1xuICAgICAgICBjYXNlICdHUk9VUCc6XG4gICAgICAgICAgcmV0dXJuIEplZC5QRi5pbnRlcnByZXRlciggYXN0LmV4cHIgKSggbiApO1xuICAgICAgICBjYXNlICdURVJOQVJZJzpcbiAgICAgICAgICBpZiAoIEplZC5QRi5pbnRlcnByZXRlciggYXN0LmV4cHIgKSggbiApICkge1xuICAgICAgICAgICAgcmV0dXJuIEplZC5QRi5pbnRlcnByZXRlciggYXN0LnRydXRoeSApKCBuICk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiBKZWQuUEYuaW50ZXJwcmV0ZXIoIGFzdC5mYWxzZXkgKSggbiApO1xuICAgICAgICBjYXNlICdPUic6XG4gICAgICAgICAgcmV0dXJuIEplZC5QRi5pbnRlcnByZXRlciggYXN0LmxlZnQgKSggbiApIHx8IEplZC5QRi5pbnRlcnByZXRlciggYXN0LnJpZ2h0ICkoIG4gKTtcbiAgICAgICAgY2FzZSAnQU5EJzpcbiAgICAgICAgICByZXR1cm4gSmVkLlBGLmludGVycHJldGVyKCBhc3QubGVmdCApKCBuICkgJiYgSmVkLlBGLmludGVycHJldGVyKCBhc3QucmlnaHQgKSggbiApO1xuICAgICAgICBjYXNlICdMVCc6XG4gICAgICAgICAgcmV0dXJuIEplZC5QRi5pbnRlcnByZXRlciggYXN0LmxlZnQgKSggbiApIDwgSmVkLlBGLmludGVycHJldGVyKCBhc3QucmlnaHQgKSggbiApO1xuICAgICAgICBjYXNlICdHVCc6XG4gICAgICAgICAgcmV0dXJuIEplZC5QRi5pbnRlcnByZXRlciggYXN0LmxlZnQgKSggbiApID4gSmVkLlBGLmludGVycHJldGVyKCBhc3QucmlnaHQgKSggbiApO1xuICAgICAgICBjYXNlICdMVEUnOlxuICAgICAgICAgIHJldHVybiBKZWQuUEYuaW50ZXJwcmV0ZXIoIGFzdC5sZWZ0ICkoIG4gKSA8PSBKZWQuUEYuaW50ZXJwcmV0ZXIoIGFzdC5yaWdodCApKCBuICk7XG4gICAgICAgIGNhc2UgJ0dURSc6XG4gICAgICAgICAgcmV0dXJuIEplZC5QRi5pbnRlcnByZXRlciggYXN0LmxlZnQgKSggbiApID49IEplZC5QRi5pbnRlcnByZXRlciggYXN0LnJpZ2h0ICkoIG4gKTtcbiAgICAgICAgY2FzZSAnRVEnOlxuICAgICAgICAgIHJldHVybiBKZWQuUEYuaW50ZXJwcmV0ZXIoIGFzdC5sZWZ0ICkoIG4gKSA9PSBKZWQuUEYuaW50ZXJwcmV0ZXIoIGFzdC5yaWdodCApKCBuICk7XG4gICAgICAgIGNhc2UgJ05FUSc6XG4gICAgICAgICAgcmV0dXJuIEplZC5QRi5pbnRlcnByZXRlciggYXN0LmxlZnQgKSggbiApICE9IEplZC5QRi5pbnRlcnByZXRlciggYXN0LnJpZ2h0ICkoIG4gKTtcbiAgICAgICAgY2FzZSAnTU9EJzpcbiAgICAgICAgICByZXR1cm4gSm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AgICAgIGlmICghcmVjb3ZlcmluZykge1xuICAgICAgICAgICAgICAgIC8vIFJlcG9ydCBlcnJvclxuICAgICAgICAgICAgICAgIGV4cGVjdGVkID0gW107XG4gICAgICAgICAgICAgICAgZm9yIChwIGluIHRhYmxlW3N0YXRlXSkgaWYgKHRoaXMudGVybWluYWxzX1twXSAmJiBwID4gMikge1xuICAgICAgICAgICAgICAgICAgICBleHBlY3RlZC5wdXNoKFwiJ1wiK3RoaXMudGVybWluYWxzX1twXStcIidcIik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBlcnJTdHIgPSAnJztcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5sZXhlci5zaG93UG9zaXRpb24pIHtcbiAgICAgICAgICAgICAgICAgICAgZXJyU3RyID0gJ1BhcnNlIGVycm9yIG9uIGxpbmUgJysoeXlsaW5lbm8rMSkrXCI6XFxuXCIrdGhpcy5sZXhlci5zaG93UG9zaXRpb24oKStcIlxcbkV4cGVjdGluZyBcIitleHBlY3RlZC5qb2luKCcsICcpICsgXCIsIGdvdCAnXCIgKyB0aGlzLnRlcm1pbmFsc19bc3ltYm9sXSsgXCInXCI7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgZXJyU3RyID0gJ1BhcnNlIGVycm9yIG9uIGxpbmUgJysoeXlsaW5lbm8rMSkrXCI6IFVuZXhwZWN0ZWQgXCIgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChzeW1ib2wgPT0gMSAvKkVPRiovID8gXCJlbmQgb2YgaW5wdXRcIiA6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFwiJ1wiKyh0aGlzLnRlcm1pbmFsc19bc3ltYm9sXSB8fCBzeW1ib2wpK1wiJ1wiKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRoaXMucGFyc2VFcnJvcihlcnJTdHIsXG4gICAgICAgICAgICAgICAgICAgIHt0ZXh0OiB0aGlzLmxleGVyLm1hdGNoLCB0b2tlbjogdGhpcy50ZXJtaW5hbHNfW3N5bWJvbF0gfHwgc3ltYm9sLCBsaW5lOiB0aGlzLmxleGVyLnl5bGluZW5vLCBsb2M6IHl5bG9jLCBleHBlY3RlZDogZXhwZWN0ZWR9KTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8ganVzdCByZWNvdmVyZWQgZnJvbSBhbm90aGVyIGVycm9yXG4gICAgICAgICAgICBpZiAocmVjb3ZlcmluZyA9PSAzKSB7XG4gICAgICAgICAgICAgICAgaWYgKHN5bWJvbCA9PSBFT0YpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGVyclN0ciB8fCAnUGFyc2luZyBoYWx0ZWQuJyk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy8gZGlzY2FyZCBjdXJyZW50IGxvb2thaGVhZCBhbmQgZ3JhYiBhbm90aGVyXG4gICAgICAgICAgICAgICAgeXlsZW5nID0gdGhpcy5sZXhlci55eWxlbmc7XG4gICAgICAgICAgICAgICAgeXl0ZXh0ID0gdGhpcy5sZXhlci55eXRleHQ7XG4gICAgICAgICAgICAgICAgeXlsaW5lbm8gPSB0aGlzLmxleGVyLnl5bGluZW5vO1xuICAgICAgICAgICAgICAgIHl5bG9jID0gdGhpcy5sZXhlci55eWxsb2M7XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gbGV4KCk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIHRyeSB0byByZWNvdmVyIGZyb20gZXJyb3JcbiAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgLy8gY2hlY2sgZm9yIGVycm9yIHJlY292ZXJ5IHJ1bGUgaW4gdGhpcyBzdGF0ZVxuICAgICAgICAgICAgICAgIGlmICgoVEVSUk9SLnRvU3RyaW5nKCkpIGluIHRhYmxlW3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GF0ZTogJytzdGF0ZSsnLCB0b2tlbjogJytzeW1ib2wpO1xuICAgICAgICB9XG5cbiAgICAgICAgc3dpdGNoIChhY3Rpb25bMF0pIHtcblxuICAgICAgICAgICAgY2FzZSAxOiAvLyBzaGlmdFxuICAgICAgICAgICAgICAgIC8vdGhpcy5zaGlmdENvdW50Kys7XG5cbiAgICAgICAgICAgICAgICBzdGFjay5wdXNoKHN5bWJvbCk7XG4gICAgICAgICAgICAgICAgdnN0YWNrLnB1c2godGhpcy5sZXhlci55eXRleHQpO1xuICAgICAgICAgICAgICAgIGxzdGFjay5wdXNoKHRoaXMubGV4ZXIueXlsbG9jKTtcbiAgICAgICAgICAgICAgICBzdGFjay5wdXNoKGFjdGlvblsxXSk7IC8vIHB1c2ggc3RhdGVcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBudWxsO1xuICAgICAgICAgICAgICAgIGlmICghcHJlRXJyb3JTeW1ib2wpIHsgLy8gbm9ybWFsIGV4ZWN1dGlvbi9ubyBlcnJvclxuICAgICAgICAgICAgICAgICAgICB5eWxlbmcgPSB0aGlzLmxleGVyLnl5bGVuZztcbiAgICAgICAgICAgICAgICAgICAgeXl0ZXh0ID0gdGhpcy5sZXhlci55eXRleHQ7XG4gICAgICAgICAgICAgICAgICAgIHl5bGluZW5vID0gdGhpcy5sZXhlci55eWxpbmVubztcbiAgICAgICAgICAgICAgICAgICAgeXlsb2MgPSB0aGlzLmxleGVyLnl5bGxvYztcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlY292ZXJpbmcgPiAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgcmVjb3ZlcmluZy0tO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7IC8vIGVycm9yIGp1c3Qgb2NjdXJyZWQsIHJlc3VtZSBvbGQgbG9va2FoZWFkIGYvIGJlZm9yZSBlcnJvclxuICAgICAgICAgICAgICAgICAgICBzeW1ib2wgPSBwcmVFcnJvclN5bWJvbDtcbiAgICAgICAgICAgICAgICAgICAgcHJlRXJyb3JTeW1ib2wgPSBudWxsO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgY2FzZSAyOiAvLyByZWR1Y2VcbiAgICAgICAgICAgICAgICAvL3RoaXMucmVkdWN0aW9uQ291bnQrKztcblxuICAgICAgICAgICAgICAgIGxlbiA9IHRoaXMucHJvZHVjdGlvbnNfW2FjdGlvblsxXV1bMV07XG5cbiAgICAgICAgICAgICAgICAvLyBwZXJmb3JtIHNlbWFudGljIGFjdGlvblxuICAgICAgICAgICAgICAgIHl5dmFsLiQgPSB2c3RhY2tbdnN0YWNrLmxlbmd0aC1sZW5dOyAvLyBkZWZhdWx0IHRvICQkID0gJDFcbiAgICAgICAgICAgICAgICAvLyBkZWZhdWx0IGxvY2F0aW9uLCB1c2VzIGZpcnN0IHRva2VuIGZvciBmaXJzdHMsIGxhc3QgZm9yIGxhc3RzXG4gICAgICAgICAgICAgICAgeXl2YWwuXyQgPSB7XG4gICAgICAgICAgICAgICAgICAgIGZpcnN0X2xpbmU6IGxzdGFja1tsc3RhY2subGVuZ3RoLShsZW58fDEpXS5maXJzdF9saW5lLFxuICAgICAgICAgICAgICAgICAgICBsYXN0X2xpbmU6IGxzdGFja1tsc3RhY2subGVuZ3RoLTFdLmxhc3RfbGluZSxcbiAgICAgICAgICAgICAgICAgICAgZmlyc3RfY29sdW1uOiBsc3RhY2tbbHN0YWNrLmxlbmd0aC0obGVufHwxKV0uZmlyc3RfY29sdW1uLFxuICAgICAgICAgICAgICAgICAgICBsYXN0X2NvbHVtbjogbHN0YWNrW2xzdGFjay5sZW5ndGgtMV0ubGFzdF9jb2x1bW5cbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIHIgPSB0aGlzLnBlcmZvcm1BY3Rpb24uY2FsbCh5eXZhbCwgeXl0ZXh0LCB5eWxlbmcsIHl5bGluZW5vLCB0aGlzLnl5LCBhY3Rpb25bMV0sIHZzdGFjaywgbHN0YWNrKTtcblxuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgciAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHI7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy8gcG9wIG9mZiBzdGFja1xuICAgICAgICAgICAgICAgIGlmIChsZW4pIHtcbiAgICAgICAgICAgICAgICAgICAgc3RhY2sgPSBzdGFjay5zbGljZSgwLC0xKmxlbioyKTtcbiAgICAgICAgICAgICAgICAgICAgdnN0YWNrID0gdnN0YWNrLnNsaWNlKDAsIC0xKmxlbik7XG4gICAgICAgICAgICAgICAgICAgIGxzdGFjayA9IGxzdGFjay5zbGljZSgwLCAtMSpsZW4pO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHN0YWNrLnB1c2godGhpcy5wcm9kdWN0aW9uc19bYWN0aW9uWzFdXVswXSk7ICAgIC8vIHB1c2ggbm9udGVybWluYWwgKHJlZHVjZSlcbiAgICAgICAgICAgICAgICB2c3RhY2sucHVzaCh5eXZhbC4kKTtcbiAgICAgICAgICAgICAgICBsc3RhY2sucHVzaCh5eXZhbC5fJCk7XG4gICAgICAgICAgICAgICAgLy8gZ290byBuZXcgc3RhdGUgPSB0YWJsZVtTVEFURV1bTk9OVEVSTUlOQUxdXG4gICAgICAgICAgICAgICAgbmV3U3RhdGUgPSB0YWJsZVtzdGFja1tzdGFjay5sZW5ndGgtMl1dW3N0YWNrW3N0YWNrLmxlbmd0aC0xXV07XG4gICAgICAgICAgICAgICAgc3RhY2sucHVzaChuZXdTdGF0ZSk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICAgIGNhc2UgMzogLy8gYWNjZXB0XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH1cblxuICAgIH1cblxuICAgIHJldHVybiB0cnVlO1xufX07LyogSmlzb24gZ2VuZXJhdGVkIGxle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KyAxKS5qb2luKFwiLVwiKTtcbiAgICAgICAgcmV0dXJuIHByZSArIHRoaXMudXBjb21pbmdJbnB1dCgpICsgXCJcXG5cIiArIGMrXCJeXCI7XG4gICAgfSxcbm5leHQ6ZnVuY3Rpb24gKCkge1xuICAgICAgICBpZiAodGhpcy5kb25lKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5FT0Y7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCF0aGlzLl9pbnB1dCkgdGhpcy5kb25lID0gdHJ1ZTtcblxuICAgICAgICB2YXIgdG9rZW4sXG4gICAgICAgICAgICBtYXRjaCxcbiAgICAgICAgICAgIGNvbCxcbiAgICAgICAgICAgIGxpbmVzO1xuICAgICAgICBpZiAoIXRoaXMuX21vcmUpIHtcbiAgICAgICAgICAgIHRoaXMueXl0ZXh0ID0gJyc7XG4gICAgICAgICAgICB0aGlzLm1hdGNoID0gJyc7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIHJ1bGVzID0gdGhpcy5fY3VycmVudFJ1bGVzKCk7XG4gICAgICAgIGZvciAodmFyIGk9MDtpIDwgcnVsZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIG1hdGNoID0gdGhpcy5faW5wdXQubWF0Y2godGhpcy5ydWxlc1tydWxlc1tpXV0pO1xuICAgICAgICAgICAgaWYgKG1hdGNoKSB7XG4gICAgICAgICAgICAgICAgbGluZXMgPSBtYXRjaFswXS5tYXRjaCgvXFxuLiovZyk7XG4gICAgICAgICAgICAgICAgaWYgKGxpbmVzKSB0aGlzLnl5bGluZW5vICs9IGxpbmVzLmxlbmd0aDtcbiAgICAgICAgICAgICAgICB0aGlzLnl5bGxvYyA9IHtmaXJzdF9saW5lOiB0aGlzLnl5bGxvYy5sYXN0X2xpbmUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGFzdF9saW5lOiB0aGlzLnl5bGluZW5vKzEsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmlyc3RfY29sdW1uOiB0aGlzLnl5bGxvYy5sYXN0X2NvbHVtbixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsYXN0X2NvbHVtbjogbGluZXMgPyBsaW5lc1tsaW5lcy5sZW5ndGgtMV0ubGVuZ3RoLTEgOiB0aGlzLnl5bGxvYy5sYXN0X2NvbHVtbiArIG1hdGNoWzBdLmxlbmd0aH1cbiAgICAgICAgICAgICAgICB0aGlzLnl5dGV4dCArPSBtYXRjaFswXTtcbiAgICAgICAgICAgICAgICB0aGlzLm1hdGNoICs9IG1hdGNoWzBdO1xuICAgICAgICAgICAgICAgIHRoaXMubWF0Y2hlcyA9IG1hdGNoO1xuICAgICAgICAgICAgICAgIHRoaXMueXlsZW5nID0gdGhpcy55eXRleHQubGVuZ3RoO1xuICAgICAgICAgICAgICAgIHRoaXMuX21vcmUgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICB0aGlzLl9pbnB1dCA9IHRoaXMuX2lucHV0LnNsaWNlKG1hdGNoWzBdLmxlbmd0aCk7XG4gICAgICAgICAgICAgICAgdGhpcy5tYXRjaGVkICs9IG1hdGNoWzBdO1xuICAgICAgICAgICAgICAgIHRva2VuID0gdGhpcy5wZXJmb3JtQWN0aW9uLmNhbGwodGhpcywgdGhpcy55eSwgdGhpcywgcnVsZXNbaV0sdGhpcy5jb25kaXRpb25TdGFja1t0aGlzLmNvbmRpdGlvblN0YWNrLmxlbmd0aC0xXSk7XG4gICAgICAgICAgICAgICAgaWYgKHRva2VuKSByZXR1cm4gdG9rZW47XG4gICAgICAgICAgICAgICAgZWxzZSByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHRoaXMuX2lucHV0ID09PSBcIlwiKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5FT0Y7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLnBhcnNlRXJyb3IoJ0xleGljYWwgZXJyb3Igb24gbGluZSAnKy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*/
439
- /***/ (function(module, exports, __webpack_require__) {
440
-
441
- eval("/* WEBPACK VAR INJECTION */(function(process) {module.exports = function memize( fn, options ) {\n\tvar size = 0,\n\t\tmaxSize, head, tail;\n\n\tif ( options && options.maxSize ) {\n\t\tmaxSize = options.maxSize;\n\t}\n\n\tfunction memoized( /* ...args */ ) {\n\t\tvar node = head,\n\t\t\tlen = arguments.length,\n\t\t\targs, i;\n\n\t\tsearchCache: while ( node ) {\n\t\t\t// Perform a shallow equality test to confirm that whether the node\n\t\t\t// under test is a candidate for the arguments passed. Two arrays\n\t\t\t// are shallowly equal if their length matches and each entry is\n\t\t\t// strictly equal between the two sets. Avoid abstracting to a\n\t\t\t// function which could incur an arguments leaking deoptimization.\n\n\t\t\t// Check whether node arguments match arguments length\n\t\t\tif ( node.args.length !== arguments.length ) {\n\t\t\t\tnode = node.next;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Check whether node arguments match arguments values\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tif ( node.args[ i ] !== arguments[ i ] ) {\n\t\t\t\t\tnode = node.next;\n\t\t\t\t\tcontinue searchCache;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// At this point we can assume we've found a match\n\n\t\t\t// Surface matched node to head if not already\n\t\t\tif ( node !== head ) {\n\t\t\t\t// As tail, shift to previous. Must only shift if not also\n\t\t\t\t// head, since if both head and tail, there is no previous.\n\t\t\t\tif ( node === tail ) {\n\t\t\t\t\ttail = node.prev;\n\t\t\t\t}\n\n\t\t\t\t// Adjust siblings to point to each other. If node was tail,\n\t\t\t\t// this also handles new tail's empty `next` assignment.\n\t\t\t\tnode.prev.next = node.next;\n\t\t\t\tif ( node.next ) {\n\t\t\t\t\tnode.next.prev = node.prev;\n\t\t\t\t}\n\n\t\t\t\tnode.next = head;\n\t\t\t\tnode.prev = null;\n\t\t\t\thead.prev = node;\n\t\t\t\thead = node;\n\t\t\t}\n\n\t\t\t// Return immediately\n\t\t\treturn node.val;\n\t\t}\n\n\t\t// No cached value found. Continue to insertion phase:\n\n\t\t// Create a copy of arguments (avoid leaking deoptimization)\n\t\targs = new Array( len );\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\n\t\tnode = {\n\t\t\targs: args,\n\n\t\t\t// Generate the result from original function\n\t\t\tval: fn.apply( null, args )\n\t\t};\n\n\t\t// Don't need to check whether node is already head, since it would\n\t\t// have been returned above already if it was\n\n\t\t// Shift existing head down list\n\t\tif ( head ) {\n\t\t\thead.prev = node;\n\t\t\tnode.next = head;\n\t\t} else {\n\t\t\t// If no head, follows that there's no tail (at initial or reset)\n\t\t\ttail = node;\n\t\t}\n\n\t\t// Trim tail if we're reached max size and are pending cache insertion\n\t\tif ( size === maxSize ) {\n\t\t\ttail = tail.prev;\n\t\t\ttail.next = null;\n\t\t} else {\n\t\t\tsize++;\n\t\t}\n\n\t\thead = node;\n\n\t\treturn node.val;\n\t}\n\n\tmemoized.clear = function() {\n\t\thead = null;\n\t\ttail = null;\n\t\tsize = 0;\n\t};\n\n\tif ( process.env.NODE_ENV === 'test' ) {\n\t\t// Cache is not exposed in the public API, but used in tests to ensure\n\t\t// expected list progression\n\t\tmemoized.getCache = function() {\n\t\t\treturn [ head, tail, size ];\n\t\t};\n\t}\n\n\treturn memoized;\n};\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(72)))//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvbWVtaXplL2luZGV4LmpzP2NjZWUiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiBtZW1pemUoIGZuLCBvcHRpb25zICkge1xuXHR2YXIgc2l6ZSA9IDAsXG5cdFx0bWF4U2l6ZSwgaGVhZCwgdGFpb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ZSBpZCA9IDcxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///71\n");
442
-
443
- /***/ }),
444
- /* 72 */
445
- /***/ (function(module, exports) {
446
-
447
- eval("// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvcHJvY2Vzcy9icm93c2VyLmpzPzViNjkiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gc2hpbSBmb3IgdXNpbmcgcHJvY2VzcyBpbiBicm93c2VyXG52YXIgcHJvY2VzcyA9IG1vZHVsZS5leHBvcnRzID0ge307XG5cbi8vIGNhY2hlZCBmcm9tIHdoYXRldmVyIGdsb2JhbCBpcyBwcmVzZW50IHNvIHRoYXQgdGVzdCBydW5uZXJzIHRoYXQgc3R1YiBpdFxuLy8gZG9uJ3QgYnJlYWsgdGhpbmdzLiAgQnV0IHdlIG5lZWQgdG8gd3JhcCBpdCBpbiBhIHRyeSBjYXRjaCBpbiBjYXNlIGl0IGlzXG4vLyB3cmFwcGVkIGluIHN0cmljdCBtb2RlIGNvZGUgd2hpY2ggZG9lc24ndCBkZWZpbmUgYW55IGdsb2JhbHMuICBJdCdzIGluc2lkZSBhXG4vLyBmdW5jdGlvbiBiZWNhdXNlIHRyeS9jYXRjaGVzIGRlb3B0aW1pemUgaW4gY2VydGFpbiBlbmdpbmVzLlxuXG52YXIgY2FjaGVkU2V0VGltZW91dDtcbnZhciBjYWNoZWRDbGVhclRpbWVvdXQ7XG5cbmZ1bmN0aW9uIGRlZmF1bHRTZXRUaW1vdXQoKSB7XG4gICAgdGhyb3cgbmV3IEVycm9yKCdzZXRUaW1lb3V0IGhhcyBub3QgYmVlbiBkZWZpbmVkJyk7XG59XG5mdW5jdGlvbiBkZWZhdWx0Q2xlYXJUaW1lb3V0ICgpIHtcbiAgICB0aHJvdyBuZXcgRXJyb3IoJ2NsZWFyVGltZW91dCBoYXMgb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Q0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///72\n");
448
-
449
- /***/ })
450
- /******/ ]);
1
+ !function(g){var n={};function t(I){if(n[I])return n[I].exports;var c=n[I]={i:I,l:!1,exports:{}};return g[I].call(c.exports,c,c.exports,t),c.l=!0,c.exports}t.m=g,t.c=n,t.d=function(g,n,I){t.o(g,n)||Object.defineProperty(g,n,{enumerable:!0,get:I})},t.r=function(g){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(g,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(g,"__esModule",{value:!0})},t.t=function(g,n){if(1&n&&(g=t(g)),8&n)return g;if(4&n&&"object"==typeof g&&g&&g.__esModule)return g;var I=Object.create(null);if(t.r(I),Object.defineProperty(I,"default",{enumerable:!0,value:g}),2&n&&"string"!=typeof g)for(var c in g)t.d(I,c,function(n){return g[n]}.bind(null,c));return I},t.n=function(g){var n=g&&g.__esModule?function(){return g.default}:function(){return g};return t.d(n,"a",n),n},t.o=function(g,n){return Object.prototype.hasOwnProperty.call(g,n)},t.p="",t(t.s=8)}({1:function(module,exports,__webpack_require__){eval("var __WEBPACK_AMD_DEFINE_RESULT__;/* global window, exports, define */\n\n!function() {\n 'use strict'\n\n var re = {\n not_string: /[^s]/,\n not_bool: /[^t]/,\n not_type: /[^T]/,\n not_primitive: /[^v]/,\n number: /[diefg]/,\n numeric_arg: /[bcdiefguxX]/,\n json: /[j]/,\n not_json: /[^j]/,\n text: /^[^\\x25]+/,\n modulo: /^\\x25{2}/,\n placeholder: /^\\x25(?:([1-9]\\d*)\\$|\\(([^)]+)\\))?(\\+)?(0|'[^$])?(-)?(\\d+)?(?:\\.(\\d+))?([b-gijostTuvxX])/,\n key: /^([a-z_][a-z_\\d]*)/i,\n key_access: /^\\.([a-z_][a-z_\\d]*)/i,\n index_access: /^\\[(\\d+)\\]/,\n sign: /^[+-]/\n }\n\n function sprintf(key) {\n // `arguments` is not an array, but should be fine for this call\n return sprintf_format(sprintf_parse(key), arguments)\n }\n\n function vsprintf(fmt, argv) {\n return sprintf.apply(null, [fmt].concat(argv || []))\n }\n\n function sprintf_format(parse_tree, argv) {\n var cursor = 1, tree_length = parse_tree.length, arg, output = '', i, k, ph, pad, pad_character, pad_length, is_positive, sign\n for (i = 0; i < tree_length; i++) {\n if (typeof parse_tree[i] === 'string') {\n output += parse_tree[i]\n }\n else if (typeof parse_tree[i] === 'object') {\n ph = parse_tree[i] // convenience purposes only\n if (ph.keys) { // keyword argument\n arg = argv[cursor]\n for (k = 0; k < ph.keys.length; k++) {\n if (arg == undefined) {\n throw new Error(sprintf('[sprintf] Cannot access property \"%s\" of undefined value \"%s\"', ph.keys[k], ph.keys[k-1]))\n }\n arg = arg[ph.keys[k]]\n }\n }\n else if (ph.param_no) { // positional argument (explicit)\n arg = argv[ph.param_no]\n }\n else { // positional argument (implicit)\n arg = argv[cursor++]\n }\n\n if (re.not_type.test(ph.type) && re.not_primitive.test(ph.type) && arg instanceof Function) {\n arg = arg()\n }\n\n if (re.numeric_arg.test(ph.type) && (typeof arg !== 'number' && isNaN(arg))) {\n throw new TypeError(sprintf('[sprintf] expecting number but found %T', arg))\n }\n\n if (re.number.test(ph.type)) {\n is_positive = arg >= 0\n }\n\n switch (ph.type) {\n case 'b':\n arg = parseInt(arg, 10).toString(2)\n break\n case 'c':\n arg = String.fromCharCode(parseInt(arg, 10))\n break\n case 'd':\n case 'i':\n arg = parseInt(arg, 10)\n break\n case 'j':\n arg = JSON.stringify(arg, null, ph.width ? parseInt(ph.width) : 0)\n break\n case 'e':\n arg = ph.precision ? parseFloat(arg).toExponential(ph.precision) : parseFloat(arg).toExponential()\n break\n case 'f':\n arg = ph.precision ? parseFloat(arg).toFixed(ph.precision) : parseFloat(arg)\n break\n case 'g':\n arg = ph.precision ? String(Number(arg.toPrecision(ph.precision))) : parseFloat(arg)\n break\n case 'o':\n arg = (parseInt(arg, 10) >>> 0).toString(8)\n break\n case 's':\n arg = String(arg)\n arg = (ph.precision ? arg.substring(0, ph.precision) : arg)\n break\n case 't':\n arg = String(!!arg)\n arg = (ph.precision ? arg.substring(0, ph.precision) : arg)\n break\n case 'T':\n arg = Object.prototype.toString.call(arg).slice(8, -1).toLowerCase()\n arg = (ph.precision ? arg.substring(0, ph.precision) : arg)\n break\n case 'u':\n arg = parseInt(arg, 10) >>> 0\n break\n case 'v':\n arg = arg.valueOf()\n arg = (ph.precision ? arg.substring(0, ph.precision) : arg)\n break\n case 'x':\n arg = (parseInt(arg, 10) >>> 0).toString(16)\n break\n case 'X':\n arg = (parseInt(arg, 10) >>> 0).toString(16).toUpperCase()\n break\n }\n if (re.json.test(ph.type)) {\n output += arg\n }\n else {\n if (re.number.test(ph.type) && (!is_positive || ph.sign)) {\n sign = is_positive ? '+' : '-'\n arg = arg.toString().replace(re.sign, '')\n }\n else {\n sign = ''\n }\n pad_character = ph.pad_char ? ph.pad_char === '0' ? '0' : ph.pad_char.charAt(1) : ' '\n pad_length = ph.width - (sign + arg).length\n pad = ph.width ? (pad_length > 0 ? pad_character.repeat(pad_length) : '') : ''\n output += ph.align ? sign + arg + pad : (pad_character === '0' ? sign + pad + arg : pad + sign + arg)\n }\n }\n }\n return output\n }\n\n var sprintf_cache = Object.create(null)\n\n function sprintf_parse(fmt) {\n if (sprintf_cache[fmt]) {\n return sprintf_cache[fmt]\n }\n\n var _fmt = fmt, match, parse_tree = [], arg_names = 0\n while (_fmt) {\n if ((match = re.text.exec(_fmt)) !== null) {\n parse_tree.push(match[0])\n }\n else if ((match = re.modulo.exec(_fmt)) !== null) {\n parse_tree.push('%')\n }\n else if ((match = re.placeholder.exec(_fmt)) !== null) {\n if (match[2]) {\n arg_names |= 1\n var field_list = [], replacement_field = match[2], field_match = []\n if ((field_match = re.key.exec(replacement_field)) !== null) {\n field_list.push(field_match[1])\n while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') {\n if ((field_match = re.key_access.exec(replacement_field)) !== null) {\n field_list.push(field_match[1])\n }\n else if ((field_match = re.index_access.exec(replacement_field)) !== null) {\n field_list.push(field_match[1])\n }\n else {\n throw new SyntaxError('[sprintf] failed to parse named argument key')\n }\n }\n }\n else {\n throw new SyntaxError('[sprintf] failed to parse named argument key')\n }\n match[2] = field_list\n }\n else {\n arg_names |= 2\n }\n if (arg_names === 3) {\n throw new Error('[sprintf] mixing positional and named placeholders is not (yet) supported')\n }\n\n parse_tree.push(\n {\n placeholder: match[0],\n param_no: match[1],\n keys: match[2],\n sign: match[3],\n pad_char: match[4],\n align: match[5],\n width: match[6],\n precision: match[7],\n type: match[8]\n }\n )\n }\n else {\n throw new SyntaxError('[sprintf] unexpected placeholder')\n }\n _fmt = _fmt.substring(match[0].length)\n }\n return sprintf_cache[fmt] = parse_tree\n }\n\n /**\n * export to either browser or node.js\n */\n /* eslint-disable quote-props */\n if (true) {\n exports['sprintf'] = sprintf\n exports['vsprintf'] = vsprintf\n }\n if (typeof window !== 'undefined') {\n window['sprintf'] = sprintf\n window['vsprintf'] = vsprintf\n\n if (true) {\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {\n return {\n 'sprintf': sprintf,\n 'vsprintf': vsprintf\n }\n }).call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))\n }\n }\n /* eslint-enable quote-props */\n}(); // eslint-disable-line\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9Ad29yZHByZXNzL2kxOG4vbm9kZV9tb2R1bGVzL3NwcmludGYtanMvc3JjL3NwcmludGYuanM/ZDgyYiJdLCJzb3VyY2VzQ29udGVudCI6WyIvKiBnbG9iYWwgd2luZG93LCBleHBvcnRzLCBkZWZpbmUgKi9cblxuIWZ1bmN0aW9uKCkge1xuICAgICd1c2Ugc3RyaWN0J1xuXG4gICAgdmFyIHJlID0ge1xuICAgICAgICBub3Rfc3RyaW5nOiAvW15zXS8sXG4gICAgICAgIG5vdF9ib29sOiAvW150XS8sXG4gICAgICAgIG5vdF90eXBlOiAvW15UXS8sXG4gICAgICAgIG5vdF9wcmltaXRpdmU6IC9bXnZdLyxcbiAgICAgICAgbnVtYmVyOiAvW2RpZWZnXS8sXG4gICAgICAgIG51bWVyaWNfYXJnOiAvW2JjZGllZmd1eFhdLyxcbiAgICAgICAganNvbjogL1tqXS8sXG4gICAgICAgIG5vdF9qc29uOiAvW15qXS8sXG4gICAgICAgIHRleHQ6IC9eW15cXHgyNV0rLyxcbiAgICAgICAgbW9kdWxvOiAvXlxceDI1ezJ9LyxcbiAgICAgICAgcGxhY2Vob2xkZXI6IC9eXFx4MjUoPzooWzEtOV1cXGQqKVxcJHxcXCgoW14pXSspXFwpKT8oXFwrKT8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uICAgICAgICAgICAgZWxzZSBpZiAodHlwZW9mIHBhcnNlX3RyZWVbaV0gPT09ICdvYmplY3QnKSB7XG4gICAgICAgICAgICAgICAgcGggPSBwYXJzZV90cmVlW2ldIC8vIGNvbnZlbmllbmNlIHB1cnBvc2VzIG9ubHlcbiAgICAgICAgICAgICAgICBpZiAocGgua2V5cykgeyAvLyBrZXl3b3JkIGFyZ3VtZW50XG4gICAgICAgICAgICAgICAgICAgIGFyZyA9IGFyZ3ZbY3Vyc29yXVxuICAgICAgICAgICAgICAgICAgICBmb3IgKGsgPSAwOyBrIDwgcGgua2V5cy5sZW5ndGg7IGsrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFyZyA9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3Ioc3ByaW50ZignW3NwcmludGZdIENhbm5vdCBhY2Nlc3MgcHJvcGVydHkgXCIlc1wiIG9mIHVuZGVmaW5lZCB2YWx1ZSBcIiVzXCInLCBwaC5rZXlzW2tdLCBwaC5rZXlzW2stMV0pKVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgYXJnID0gYXJnW3BoLmtleXNba11dXG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAocGgucGFyYW1fbm8pIHsgLy8gcG9zaXRpb25hbCBhcmd1bWVudCAoZXhwbGljaXQpXG4gICAgICAgICAgICAgICAgICAgIGFyZyA9IGFyZ3ZbcGgucGFyYW1fbm9dXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgeyAvLyBwb3NpdGlvbmFsIGFyZ3VtZW50IChpbXBsaWNpdClcbiAgICAgICAgICAgICAgICAgICAgYXJnID0gYXJndltjdXJzb3IrK11cbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAocmUubm90X3R5cGUudGVzdChwaC50eXBlKSAmJiByZS5ub3RfcHJpbWl0aXZlLnRlc3QocGgudHlwZSkgJiYgYXJnIGluc3RhbmNlb2YgRnVuY3Rpb24pIHtcbiAgICAgICAgICAgICAgICAgICAgYXJnID0gYXJnKClcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAocmUubnVtZXJpY19hcmcudGVzdChwaC50eXBlKSAmJiAodHlwZW9mIGFyZyAhPT0gJ251bWJlcicgJiYgaXNOYU4oYXJnKSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcihzcHJpbnRmKCdbc3ByaW50Zl0gZXhwZWN0aW5nIG51bWJlciBidXQgZm91bmQgJVQnLCBhcmcpKVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmIChyZS5udW1iZXIudGVzdChwaC50eXBlKSkge1xuICAgICAgICAgICAgICAgICAgICBpc19wb3NpdGl2ZSA9IGFyZyA+PSAwXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgc3dpdGNoIChwaC50eXBlKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ2InOlxuICAgICAgICAgICAgICAgICAgICAgICAgYXJnID0gcGFyc2VJbnQoYXJnLCAxMCkudG9TdHJpbmcoMilcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ2MnOlxuICAgICAgICAgICAgICAgICAgICAgICAgYXJnID0gU3RyaW5nLmZyb21DaGFyQ29kZShwYXJzZUludChhcmcsIDEwKSlcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ2QnOlxuICAgICAgICAgICAgICAgICAgICBjYXNlICdpJzpcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyZyA9IHBhcnNlSW50KGFyZywgMTApXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVha1xuICAgICAgICAgICAgICAgICAgICBjYXNlICdqJzpcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyZyA9IEpTT04uc3RyaW5naWZ5KGFyZywgbnVsbCwgcGgud2lkdGggPyBwYXJzZUludChwaC53aWR0aCkgOiAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnZSc6XG4gICAgICAgICAgICAgICAgICAgICAgICBhcmcgPSBwaC5wcmVjaXNpb24gPyBwYXJzZUZsb2F0KGFyZykudG9FeHBvbmVudGlhbChwaC5wcmVjaXNpb24pIDogcGFyc2VGbG9hdChhcmcpLnRvRXhwb25lbnRpYWwoKVxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnZic6XG4gICAgICAgICAgICAgICAgICAgICAgICBhcmcgPSBwaC5wcmVjaXNpb24gPyBwYXJzZUZsb2F0KGFyZykudG9GaXhlZChwaC5wcmVjaXNpb24pIDogcGFyc2VGbG9hdChhcmcpXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVha1xuICAgICAgICAgICAgICAgICAgICBjYXNlICdnJzpcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyZyA9IHBoLnByZWNpc2lvbiA/IFN0cmluZyhOdW1iZXIoYXJnLnRvUHJlY2lzaW9uKHBoLnByZWNpc2lvbikpKSA6IHBhcnNlRmxvYXQoYXJnKVxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnbyc6XG4gICAgICAgICAgICAgICAgICAgICAgICBhcmcgPSAocGFyc2VJbnQoYXJnLCAxMCkgPj4+IDApLnRvU3RyaW5nKDgpXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVha1xuICAgICAgICAgICAgICAgICAgICBjYXNlICdzJzpcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyZyA9IFN0cmluZyhhcmcpXG4gICAgICAgICAgICAgICAgICAgICAgICBhcmcgPSAocGgucHJlY2lzaW9uID8gYXJnLnN1YnN0cmluZygwLCBwaC5wcmVjaXNpb24pIDogYXJnKVxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAndCc6XG4gICAgICAgICAgICAgICAgICAgICAgICBhcmcgPSBTdHJpbmcoISFhcmcpXG4gICAgICAgICAgICAgICAgICAgICAgICBhcmcgPSAocGgucHJlY2lzaW9uID8gYXJnLnN1YnN0cmluZygwLCBwaC5wcmVjaXNpb24pIDogYXJnKVxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnVCc6XG4gICAgICAgICAgICAgICAgICAgICAgICBhcmcgPSBPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nLmNhbGwoYXJnKS5zbGljZSg4LCAtMSkudG9Mb3dlckNhc2UoKVxuICAgICAgICAgICAgICAgICAgICAgICAgYXJnID0gKHBoLnByZWNpc2lvbiA/IGFyZy5zdWJzdHJpbmcoMCwgcGgucHJlY2lzaW9uKSA6IGFyZylcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ3UnOlxuICAgICAgICAgICAgICAgICAgICAgICAgYXJnID0gcGFyc2VJbnQoYXJnLCAxMCkgPj4+IDBcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ3YnOlxuICAgICAgICAgICAgICAgICAgICAgICAgYXJnID0gYXJnLnZhbHVlT2YoKVxuICAgICAgICAgICAgICAgICAgICAgICAgYXJnID0gKHBoLnByZWNpc2lvbiA/IGFyZy5zdWJzdHJpbmcoMCwgcGgucHJlY2lzaW9uKSA6IGFyZylcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ3gnOlxuICAgICAgICAgICAgICAgICAgICAgICAgYXJnID0gKHBhcnNlSW50KGFyZywgMTApID4+PiAwKS50b1N0cmluZygxNilcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ1gnOlxuICAgICAgICAgICAgICAgICAgICAgICAgYXJnID0gKHBhcnNlSW50KGFyZywgMTApID4+PiAwKS50b1N0cmluZygxNikudG9VcHBlckNhc2UoKVxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHJlLmpzb24udGVzdChwaC50eXBlKSkge1xuICAgICAgICAgICAgICAgICAgICBvdXRwdXQgKz0gYXJnXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBpZiAocmUubnVtYmVyLnRlc3QocGgudHlwZSkgJiYgKCFpc19wb3NpdGl2ZSB8fCBwaC5zaWduKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgc2lnbiA9IGlzX3Bvc2l0aXZlID8gJysnIDogJy0nXG4gICAgICAgICAgICAgICAgICAgICAgICBhcmcgPSBhcmcudG9TdHJpbmcoKS5yZXBsYWNlKHJlLnNpZ24sICcnKVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgc2lnbiA9ICcnXG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcGFkX2NoYXJhY3RlciA9IHBoLnBhZF9jaGFyID8gcGgucGFkX2NoYXIgPT09ICcwJyA/ICcwJyA6IHBoLnBhZF9jaGFyLmNoYXJBdCgxKSA6ICcgJ1xuICAgICAgICAgICAgICAgICAgICBwYWRfbGVuZ3RoID0gcGgud2lkdGggLSAoc2lnbiArIGFyZykubGVuZ3RoXG4gICAgICAgICAgICAgICAgICAgIHBhZCA9IHBoLndpZHRoID8gKHBhZF9sZW5ndGggPiAwID8gcGFkX2NoYXJhY3Rlci5yZXBlYXQocGFkX2xlbmd0aCkgOiAnJykgOiAnJ1xuICAgICAgICAgICAgICAgICAgICBvdXRwdXQgKz0gcGguYWxpZ24gPyBzaWduICsgYXJnICsgcGFkIDogKHBhZF9jaGFyYWN0ZXIgPT09ICcwJyA/IHNpZ24gKyBwYWQgKyBhcmcgOiBwYWQgKyBzaWduICsgYXJnKVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gb3V0cHV0XG4gICAgfVxuXG4gICAgdmFyIHNwcmludGZfY2FjaGUgPSBPYmplY3QuY3JlYXRlKG51bGwpXG5cbiAgICBmdW5jdGlvbiBzcHJpbnRmX3BhcnNlKGZtdCkge1xuICAgICAgICBpZiAoc3ByaW50Zl9jYWNoZVtmbXRdKSB7XG4gICAgICAgICAgICByZXR1cm4gc3ByaW50Zl9jYWNoZVtmbXRdXG4gICAgICAgIH1cblxuICAgICAgICB2YXIgX2ZtdCA9IGZtdCwgbWF0Y2gsIHBhcnNlX3RyZWUgPSBbXSwgYXJnX25hbWVzID0gMFxuICAgICAgICB3aGlsZSAoX2ZtdCkge1xuICAgICAgICAgICAgaWYgKChtYXRjaCA9IHJlLnRleHQuZXhlYyhfZm10KSkgIT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICBwYXJzZV90cmVlLnB1c2gobWF0Y2hbMF0pXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmICgobWF0Y2ggPSByZS5tb2R1bG8uZXhlYyhfZm10KSkgIT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICBwYXJzZV90cmVlLnB1c2goJyUnKVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAoKG1hdGNoID0gcmUucGxhY2Vob2xkZXIuZXhlYyhfZm10KSkgIT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICBpZiAobWF0Y2hbMl0pIHtcbiAgICAgICAgICAgICAgICAgICAgYXJnX25hbWVzIHw9IDFcbiAgICAgICAgICAgICAgICAgICAgdmFyIGZpZWxkX2xpc3QgPSBbXSwgcmVwbGFjZW1lbnRfZmllbGQgPSBtYXRjaFsyXSwgZmllbGRfbWF0Y2ggPSBbXVxuICAgICAgICAgICAgICAgICAgICBpZiAoKGZpZWxkX21hdGNoID0gcmUua2V5LmV4ZWMocmVwbGFjZW1lbnRfZmllbGQpKSAhPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZmllbGRfbGlzdC5wdXNoKGZpZWxkX21hdGNoWzFdKVxuICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKChyZXBsYWNlbWVudF9maWVsZCA9IHJlcGxhY2VtZW50X2ZpZWxkLnN1YnN0cmluZyhmaWVsZF9tYXRjaFswXS5sZW5ndGgpKSAhPT0gJycpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGZpZWxkX21hdGNoID0gcmUua2V5X2FjY2Vzcy5leGVjKHJlcGxhY2VtZW50X2ZpZWxkKSkgIT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmllbGRfbGlzdC5wdXNoKGZpZWxkX21hdGNoWzFdKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICgoZmllbGRfbWF0Y2ggPSByZS5pbmRleF9hY2Nlc3MuZXhlYyhyZXBsYWNlbWVudF9maWVsZCkpICE9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpZWxkX2xpc3QucHVzaChmaWVsZF9tYXRjaFsxXSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBTeW50YXhFcnJvcignW3NwcmludGZdIGZhaWxlZCB0byBwYXJzZSBuYW1lZCBhcmd1bWVudCBrZXknKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBTeW50YXhFcnJvcignW3NwcmludGZdIGZhaWxlZCB0byBwYXJzZSBuYW1lZCBhcmd1bWVudCBrZXknKVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIG1hdGNoWzJdID0gZmllbGRfbGlzdFxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgYXJnX25hbWVzIHw9IDJcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGFyZ19uYW1lcyA9PT0gMykge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ1tzcHJpbnRmXSBtaXhpbmcgcG9zaXRpb25hbCBhbmQgbmFtZWQgcGxhY2Vob2xkZXJzIGlzIG5vdCAoeWV0KSBzdXBwb3J0ZWQnKVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHBhcnNlX3RyZWUucHVzaChcbiAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgcGxhY2Vob2xkZXI6IG1hdGNoWzBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1fbm86ICAgIG1hdGNoWzFdLFxuICAgICAgICAgICAgICAgICAgICAgICAga2V5czogICAgICAgIG1hdGNoWzJdLFxuICAgICAgICAgICAgICAgICAgICAgICAgc2lnbjogICAgICAgIG1hdGNoWzNdLFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFkX2NoYXI6ICAgIG1hdGNoWzRdLFxuICAgICAgICAgICAgICAgICAgICAgICAgYWxpZ246ICAgICAgIG1hdGNoWzVdLFxuICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGg6ICAgICAgIG1hdGNoWzZdLFxuICAgICAgICAgICAgICAgICAgICAgICAgcHJlY2lzaW9uOiAgIG1hdGNoWzddLFxuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogICAgICAgIG1hdGNoWzhdXG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgU3ludGF4RXJyb3IoJ1tzcHJpbnRmXSB1bmV4cGVjdGVkIHBsYWNlaG9sZGVyJylcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIF9mbXQgPSBfZm10LnN1YnN0cmluZyhtYXRjaFswXS5sZW5ndGgpXG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHNwcmludGZfY2FjaGVbZm10XSA9IHBhcnNlX3RyZWVcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBleHBvcnQgdG8gZWl0aGVyIGJyb3dzZXIgb3Igbm9kZS5qc1xuICAgICAqL1xuICAgIC8qIGVzbGludC1kaXNhYmxlIHF1b3RlLXByb3BzICovXG4gICAgaWYgKHR5cGVvZiBleHBvcnRzICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICBleHBvcnRzWydzcHJpbnRmJ10gPSBzcHJpbnRmXG4gICAgICAgIGV4cG9ydHNbJ3ZzcHJpbnRmJ10gPSB2c3ByaW50ZlxuICAgIH1cbiAgICBpZiAodHlwZW9mIHdpbmRvdyAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgd2luZG93WydzcHJpbnRmJ10gPSBzcHJpbnRmXG4gICAgICAgIHdpbmRvd1sndnNwcmludGYnXSA9IHZzcHJpbnRmXG5cbiAgICAgICAgaWYgKHR5cGVvZiBkZWZpb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pack_require__){eval("module.exports = function memize( fn, options ) {\n\tvar size = 0,\n\t\tmaxSize, head, tail;\n\n\tif ( options && options.maxSize ) {\n\t\tmaxSize = options.maxSize;\n\t}\n\n\tfunction memoized( /* ...args */ ) {\n\t\tvar node = head,\n\t\t\tlen = arguments.length,\n\t\t\targs, i;\n\n\t\tsearchCache: while ( node ) {\n\t\t\t// Perform a shallow equality test to confirm that whether the node\n\t\t\t// under test is a candidate for the arguments passed. Two arrays\n\t\t\t// are shallowly equal if their length matches and each entry is\n\t\t\t// strictly equal between the two sets. Avoid abstracting to a\n\t\t\t// function which could incur an arguments leaking deoptimization.\n\n\t\t\t// Check whether node arguments match arguments length\n\t\t\tif ( node.args.length !== arguments.length ) {\n\t\t\t\tnode = node.next;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Check whether node arguments match arguments values\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tif ( node.args[ i ] !== arguments[ i ] ) {\n\t\t\t\t\tnode = node.next;\n\t\t\t\t\tcontinue searchCache;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// At this point we can assume we've found a match\n\n\t\t\t// Surface matched node to head if not already\n\t\t\tif ( node !== head ) {\n\t\t\t\t// As tail, shift to previous. Must only shift if not also\n\t\t\t\t// head, since if both head and tail, there is no previous.\n\t\t\t\tif ( node === tail ) {\n\t\t\t\t\ttail = node.prev;\n\t\t\t\t}\n\n\t\t\t\t// Adjust siblings to point to each other. If node was tail,\n\t\t\t\t// this also handles new tail's empty `next` assignment.\n\t\t\t\tnode.prev.next = node.next;\n\t\t\t\tif ( node.next ) {\n\t\t\t\t\tnode.next.prev = node.prev;\n\t\t\t\t}\n\n\t\t\t\tnode.next = head;\n\t\t\t\tnode.prev = null;\n\t\t\t\thead.prev = node;\n\t\t\t\thead = node;\n\t\t\t}\n\n\t\t\t// Return immediately\n\t\t\treturn node.val;\n\t\t}\n\n\t\t// No cached value found. Continue to insertion phase:\n\n\t\t// Create a copy of arguments (avoid leaking deoptimization)\n\t\targs = new Array( len );\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\n\t\tnode = {\n\t\t\targs: args,\n\n\t\t\t// Generate the result from original function\n\t\t\tval: fn.apply( null, args )\n\t\t};\n\n\t\t// Don't need to check whether node is already head, since it would\n\t\t// have been returned above already if it was\n\n\t\t// Shift existing head down list\n\t\tif ( head ) {\n\t\t\thead.prev = node;\n\t\t\tnode.next = head;\n\t\t} else {\n\t\t\t// If no head, follows that there's no tail (at initial or reset)\n\t\t\ttail = node;\n\t\t}\n\n\t\t// Trim tail if we're reached max size and are pending cache insertion\n\t\tif ( size === maxSize ) {\n\t\t\ttail = tail.prev;\n\t\t\ttail.next = null;\n\t\t} else {\n\t\t\tsize++;\n\t\t}\n\n\t\thead = node;\n\n\t\treturn node.val;\n\t}\n\n\tmemoized.clear = function() {\n\t\thead = null;\n\t\ttail = null;\n\t\tsize = 0;\n\t};\n\n\tif ( false ) {}\n\n\treturn memoized;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9tZW1pemUvaW5kZXguanM/ZTFlMiJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIG1lbWl6ZSggZm4sIG9wdGlvbnMgKSB7XG5cdHZhciBzaXplID0gMCxcblx0XHRtYXhTaXplLCBoZWFkLCB0YWlsO1xuXG5cdGlmICggb3B0aW9ucyAmJiBvcHRpb25zLm1heFNpemUgKSB7XG5cdFx0bWF4U2l6ZSA9IG9wdGlvbnMubWF4U2l6ZTtcblx0fVxuXG5cdGZ1bmN0aW9uIG1lbW9pemVkKCAvKiAuLi5hcmdzICovICkge1xuXHRcdHZhciBub2RlID0gaGVhZCxcblx0XHRcdGxlbiA9IGF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FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLGdCQU1BO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///3\n")},8:function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\nvar build_module_namespaceObject = {};\n__webpack_require__.r(build_module_namespaceObject);\n__webpack_require__.d(build_module_namespaceObject, \"setLocaleData\", function() { return setLocaleData; });\n__webpack_require__.d(build_module_namespaceObject, \"__\", function() { return __; });\n__webpack_require__.d(build_module_namespaceObject, \"_x\", function() { return _x; });\n__webpack_require__.d(build_module_namespaceObject, \"_n\", function() { return _n; });\n__webpack_require__.d(build_module_namespaceObject, \"_nx\", function() { return _nx; });\n__webpack_require__.d(build_module_namespaceObject, \"sprintf\", function() { return build_module_sprintf; });\n\n// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread.js\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n// CONCATENATED MODULE: ./node_modules/@tannin/postfix/index.js\nvar PRECEDENCE, OPENERS, TERMINATORS, PATTERN;\n\n/**\n * Operator precedence mapping.\n *\n * @type {Object}\n */\nPRECEDENCE = {\n\t'(': 9,\n\t'!': 8,\n\t'*': 7,\n\t'/': 7,\n\t'%': 7,\n\t'+': 6,\n\t'-': 6,\n\t'<': 5,\n\t'<=': 5,\n\t'>': 5,\n\t'>=': 5,\n\t'==': 4,\n\t'!=': 4,\n\t'&&': 3,\n\t'||': 2,\n\t'?': 1,\n\t'?:': 1,\n};\n\n/**\n * Characters which signal pair opening, to be terminated by terminators.\n *\n * @type {string[]}\n */\nOPENERS = [ '(', '?' ];\n\n/**\n * Characters which signal pair termination, the value an array with the\n * opener as its first member. The second member is an optional operator\n * replacement to push to the stack.\n *\n * @type {string[]}\n */\nTERMINATORS = {\n\t')': [ '(' ],\n\t':': [ '?', '?:' ],\n};\n\n/**\n * Pattern matching operators and openers.\n *\n * @type {RegExp}\n */\nPATTERN = /<=|>=|==|!=|&&|\\|\\||\\?:|\\(|!|\\*|\\/|%|\\+|-|<|>|\\?|\\)|:/;\n\n/**\n * Given a C expression, returns the equivalent postfix (Reverse Polish)\n * notation terms as an array.\n *\n * If a postfix string is desired, simply `.join( ' ' )` the result.\n *\n * @example\n *\n * ```js\n * import postfix from '@tannin/postfix';\n *\n * postfix( 'n > 1' );\n * // ⇒ [ 'n', '1', '>' ]\n * ```\n *\n * @param {string} expression C expression.\n *\n * @return {string[]} Postfix terms.\n */\nfunction postfix( expression ) {\n\tvar terms = [],\n\t\tstack = [],\n\t\tmatch, operator, term, element;\n\n\twhile ( ( match = expression.match( PATTERN ) ) ) {\n\t\toperator = match[ 0 ];\n\n\t\t// Term is the string preceding the operator match. It may contain\n\t\t// whitespace, and may be empty (if operator is at beginning).\n\t\tterm = expression.substr( 0, match.index ).trim();\n\t\tif ( term ) {\n\t\t\tterms.push( term );\n\t\t}\n\n\t\twhile ( ( element = stack.pop() ) ) {\n\t\t\tif ( TERMINATORS[ operator ] ) {\n\t\t\t\tif ( TERMINATORS[ operator ][ 0 ] === element ) {\n\t\t\t\t\t// Substitution works here under assumption that because\n\t\t\t\t\t// the assigned operator will no longer be a terminator, it\n\t\t\t\t\t// will be pushed to the stack during the condition below.\n\t\t\t\t\toperator = TERMINATORS[ operator ][ 1 ] || operator;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else if ( OPENERS.indexOf( element ) >= 0 || PRECEDENCE[ element ] < PRECEDENCE[ operator ] ) {\n\t\t\t\t// Push to stack if either an opener or when pop reveals an\n\t\t\t\t// element of lower precedence.\n\t\t\t\tstack.push( element );\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// For each popped from stack, push to terms.\n\t\t\tterms.push( element );\n\t\t}\n\n\t\tif ( ! TERMINATORS[ operator ] ) {\n\t\t\tstack.push( operator );\n\t\t}\n\n\t\t// Slice matched fragment from expression to continue match.\n\t\texpression = expression.substr( match.index + operator.length );\n\t}\n\n\t// Push remainder of operand, if exists, to terms.\n\texpression = expression.trim();\n\tif ( expression ) {\n\t\tterms.push( expression );\n\t}\n\n\t// Pop remaining items from stack into terms.\n\treturn terms.concat( stack.reverse() );\n}\n\n// CONCATENATED MODULE: ./node_modules/@tannin/evaluate/index.js\n/**\n * Operator callback functions.\n *\n * @type {Object}\n */\nvar OPERATORS = {\n\t'!': function( a ) {\n\t\treturn ! a;\n\t},\n\t'*': function( a, b ) {\n\t\treturn a * b;\n\t},\n\t'/': function( a, b ) {\n\t\treturn a / b;\n\t},\n\t'%': function( a, b ) {\n\t\treturn a % b;\n\t},\n\t'+': function( a, b ) {\n\t\treturn a + b;\n\t},\n\t'-': function( a, b ) {\n\t\treturn a - b;\n\t},\n\t'<': function( a, b ) {\n\t\treturn a < b;\n\t},\n\t'<=': function( a, b ) {\n\t\treturn a <= b;\n\t},\n\t'>': function( a, b ) {\n\t\treturn a > b;\n\t},\n\t'>=': function( a, b ) {\n\t\treturn a >= b;\n\t},\n\t'==': function( a, b ) {\n\t\treturn a === b;\n\t},\n\t'!=': function( a, b ) {\n\t\treturn a !== b;\n\t},\n\t'&&': function( a, b ) {\n\t\treturn a && b;\n\t},\n\t'||': function( a, b ) {\n\t\treturn a || b;\n\t},\n\t'?:': function( a, b, c ) {\n\t\tif ( a ) {\n\t\t\tthrow b;\n\t\t}\n\n\t\treturn c;\n\t},\n};\n\n/**\n * Given an array of postfix terms and operand variables, returns the result of\n * the postfix evaluation.\n *\n * @example\n *\n * ```js\n * import evaluate from '@tannin/evaluate';\n *\n * // 3 + 4 * 5 / 6 ⇒ '3 4 5 * 6 / +'\n * const terms = [ '3', '4', '5', '*', '6', '/', '+' ];\n *\n * evaluate( terms, {} );\n * // ⇒ 6.333333333333334\n * ```\n *\n * @param {string[]} postfix Postfix terms.\n * @param {Object} variables Operand variables.\n *\n * @return {*} Result of evaluation.\n */\nfunction evaluate_evaluate( postfix, variables ) {\n\tvar stack = [],\n\t\ti, j, args, getOperatorResult, term, value;\n\n\tfor ( i = 0; i < postfix.length; i++ ) {\n\t\tterm = postfix[ i ];\n\n\t\tgetOperatorResult = OPERATORS[ term ];\n\t\tif ( getOperatorResult ) {\n\t\t\t// Pop from stack by number of function arguments.\n\t\t\tj = getOperatorResult.length;\n\t\t\targs = Array( j );\n\t\t\twhile ( j-- ) {\n\t\t\t\targs[ j ] = stack.pop();\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tvalue = getOperatorResult.apply( null, args );\n\t\t\t} catch ( earlyReturn ) {\n\t\t\t\treturn earlyReturn;\n\t\t\t}\n\t\t} else if ( variables.hasOwnProperty( term ) ) {\n\t\t\tvalue = variables[ term ];\n\t\t} else {\n\t\t\tvalue = +term;\n\t\t}\n\n\t\tstack.push( value );\n\t}\n\n\treturn stack[ 0 ];\n}\n\n// CONCATENATED MODULE: ./node_modules/@tannin/compile/index.js\n\n\n\n/**\n * Given a C expression, returns a function which can be called to evaluate its\n * result.\n *\n * @example\n *\n * ```js\n * import compile from '@tannin/compile';\n *\n * const evaluate = compile( 'n > 1' );\n *\n * evaluate( { n: 2 } );\n * // ⇒ true\n * ```\n *\n * @param {string} expression C expression.\n *\n * @return {Function} Compiled evaluator.\n */\nfunction compile( expression ) {\n\tvar terms = postfix( expression );\n\n\treturn function( variables ) {\n\t\treturn evaluate_evaluate( terms, variables );\n\t};\n}\n\n// CONCATENATED MODULE: ./node_modules/@tannin/plural-forms/index.js\n\n\n/**\n * Given a C expression, returns a function which, when called with a value,\n * evaluates the result with the value assumed to be the \"n\" variable of the\n * expression. The result will be coerced to its numeric equivalent.\n *\n * @param {string} expression C expression.\n *\n * @return {Function} Evaluator function.\n */\nfunction pluralForms( expression ) {\n\tvar evaluate = compile( expression );\n\n\treturn function( n ) {\n\t\treturn +evaluate( { n: n } );\n\t};\n}\n\n// CONCATENATED MODULE: ./node_modules/tannin/index.js\n\n\n/**\n * Tannin constructor options.\n *\n * @property {?string} contextDelimiter Joiner in string lookup with context.\n * @property {?Function} onMissingKey Callback to invoke when key missing.\n *\n * @type {Object}\n *\n * @typedef {TanninOptions}\n */\n\n/**\n * Default Tannin constructor options.\n *\n * @type {TanninOptions}\n */\nvar DEFAULT_OPTIONS = {\n\tcontextDelimiter: '\\u0004',\n\tonMissingKey: null,\n};\n\n/**\n * Given a specific locale data's config `plural_forms` value, returns the\n * expression.\n *\n * @example\n *\n * ```\n * getPluralExpression( 'nplurals=2; plural=(n != 1);' ) === '(n != 1)'\n * ```\n *\n * @param {string} pf Locale data plural forms.\n *\n * @return {string} Plural forms expression.\n */\nfunction getPluralExpression( pf ) {\n\tvar parts, i, part;\n\n\tparts = pf.split( ';' );\n\n\tfor ( i = 0; i < parts.length; i++ ) {\n\t\tpart = parts[ i ].trim();\n\t\tif ( part.indexOf( 'plural=' ) === 0 ) {\n\t\t\treturn part.substr( 7 );\n\t\t}\n\t}\n}\n\n/**\n * Tannin constructor.\n *\n * @param {Object} data Jed-formatted locale data.\n * @param {TanninOptions} options Tannin options.\n */\nfunction Tannin( data, options ) {\n\tvar key;\n\n\tthis.data = data;\n\tthis.pluralForms = {};\n\n\toptions = options || {};\n\tthis.options = {};\n\tfor ( key in DEFAULT_OPTIONS ) {\n\t\tthis.options[ key ] = options[ key ] || DEFAULT_OPTIONS[ key ];\n\t}\n}\n\n/**\n * Returns the plural form index for the given domain and value.\n *\n * @param {string} domain Domain on which to calculate plural form.\n * @param {number} n Value for which plural form is to be calculated.\n *\n * @return {number} Plural form index.\n */\nTannin.prototype.getPluralForm = function( domain, n ) {\n\tvar getPluralForm = this.pluralForms[ domain ],\n\t\tconfig, plural, pf;\n\n\tif ( ! getPluralForm ) {\n\t\tconfig = this.data[ domain ][ '' ];\n\n\t\tpf = (\n\t\t\tconfig[ 'Plural-Forms' ] ||\n\t\t\tconfig[ 'plural-forms' ] ||\n\t\t\tconfig.plural_forms\n\t\t);\n\n\t\tif ( typeof pf !== 'function' ) {\n\t\t\tplural = getPluralExpression(\n\t\t\t\tconfig[ 'Plural-Forms' ] ||\n\t\t\t\tconfig[ 'plural-forms' ] ||\n\t\t\t\tconfig.plural_forms\n\t\t\t);\n\n\t\t\tpf = pluralForms( plural );\n\t\t}\n\n\t\tgetPluralForm = this.pluralForms[ domain ] = pf;\n\t}\n\n\treturn getPluralForm( n );\n};\n\n/**\n * Translate a string.\n *\n * @param {string} domain Translation domain.\n * @param {string} context Context distinguishing terms of the same name.\n * @param {string} singular Primary key for translation lookup.\n * @param {string} plural Fallback value used for non-zero plural form index.\n * @param {number} n Value to use in calculating plural form.\n *\n * @return {string} Translated string.\n */\nTannin.prototype.dcnpgettext = function( domain, context, singular, plural, n ) {\n\tvar index, key, entry;\n\n\tif ( n === undefined ) {\n\t\t// Default to singular.\n\t\tindex = 0;\n\t} else {\n\t\t// Find index by evaluating plural form for value.\n\t\tindex = this.getPluralForm( domain, n );\n\t}\n\n\tkey = singular;\n\n\t// If provided, context is prepended to key with delimiter.\n\tif ( context ) {\n\t\tkey = context + this.options.contextDelimiter + singular;\n\t}\n\n\tentry = this.data[ domain ][ key ];\n\n\t// Verify not only that entry exists, but that the intended index is within\n\t// range and non-empty.\n\tif ( entry && entry[ index ] ) {\n\t\treturn entry[ index ];\n\t}\n\n\tif ( this.options.onMissingKey ) {\n\t\tthis.options.onMissingKey( singular, domain );\n\t}\n\n\t// If entry not found, fall back to singular vs. plural with zero index\n\t// representing the singular value.\n\treturn index === 0 ? singular : plural;\n};\n\n// EXTERNAL MODULE: ./node_modules/memize/index.js\nvar memize = __webpack_require__(3);\nvar memize_default = /*#__PURE__*/__webpack_require__.n(memize);\n\n// EXTERNAL MODULE: ./node_modules/@wordpress/i18n/node_modules/sprintf-js/src/sprintf.js\nvar sprintf = __webpack_require__(1);\nvar sprintf_default = /*#__PURE__*/__webpack_require__.n(sprintf);\n\n// CONCATENATED MODULE: ./node_modules/@wordpress/i18n/build-module/index.js\n\n\n/**\n * External dependencies\n */\n\n\n\n/**\n * Default locale data to use for Tannin domain when not otherwise provided.\n * Assumes an English plural forms expression.\n *\n * @type {Object}\n */\n\nvar DEFAULT_LOCALE_DATA = {\n '': {\n plural_forms: 'plural=(n!=1)'\n }\n};\n/**\n * Log to console, once per message; or more precisely, per referentially equal\n * argument set. Because Jed throws errors, we log these to the console instead\n * to avoid crashing the application.\n *\n * @param {...*} args Arguments to pass to `console.error`\n */\n\nvar logErrorOnce = memize_default()(console.error); // eslint-disable-line no-console\n\n/**\n * The underlying instance of Tannin to which exported functions interface.\n *\n * @type {Tannin}\n */\n\nvar i18n = new Tannin({});\n/**\n * Merges locale data into the Tannin instance by domain. Accepts data in a\n * Jed-formatted JSON object shape.\n *\n * @see http://messageformat.github.io/Jed/\n *\n * @param {?Object} data Locale data configuration.\n * @param {?string} domain Domain for which configuration applies.\n */\n\nfunction setLocaleData(data) {\n var domain = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';\n i18n.data[domain] = _objectSpread({}, DEFAULT_LOCALE_DATA, i18n.data[domain], data); // Populate default domain configuration (supported locale date which omits\n // a plural forms expression).\n\n i18n.data[domain][''] = _objectSpread({}, DEFAULT_LOCALE_DATA[''], i18n.data[domain]['']);\n}\n/**\n * Wrapper for Tannin's `dcnpgettext`. Populates default locale data if not\n * otherwise previously assigned.\n *\n * @param {?string} domain Domain to retrieve the translated text.\n * @param {?string} context Context information for the translators.\n * @param {string} single Text to translate if non-plural. Used as fallback\n * return value on a caught error.\n * @param {?string} plural The text to be used if the number is plural.\n * @param {?number} number The number to compare against to use either the\n * singular or plural form.\n *\n * @return {string} The translated string.\n */\n\nfunction dcnpgettext() {\n var domain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default';\n var context = arguments.length > 1 ? arguments[1] : undefined;\n var single = arguments.length > 2 ? arguments[2] : undefined;\n var plural = arguments.length > 3 ? arguments[3] : undefined;\n var number = arguments.length > 4 ? arguments[4] : undefined;\n\n if (!i18n.data[domain]) {\n setLocaleData(undefined, domain);\n }\n\n return i18n.dcnpgettext(domain, context, single, plural, number);\n}\n/**\n * Retrieve the translation of text.\n *\n * @see https://developer.wordpress.org/reference/functions/__/\n *\n * @param {string} text Text to translate.\n * @param {?string} domain Domain to retrieve the translated text.\n *\n * @return {string} Translated text.\n */\n\n\nfunction __(text, domain) {\n return dcnpgettext(domain, undefined, text);\n}\n/**\n * Retrieve translated string with gettext context.\n *\n * @see https://developer.wordpress.org/reference/functions/_x/\n *\n * @param {string} text Text to translate.\n * @param {string} context Context information for the translators.\n * @param {?string} domain Domain to retrieve the translated text.\n *\n * @return {string} Translated context string without pipe.\n */\n\nfunction _x(text, context, domain) {\n return dcnpgettext(domain, context, text);\n}\n/**\n * Translates and retrieves the singular or plural form based on the supplied\n * number.\n *\n * @see https://developer.wordpress.org/reference/functions/_n/\n *\n * @param {string} single The text to be used if the number is singular.\n * @param {string} plural The text to be used if the number is plural.\n * @param {number} number The number to compare against to use either the\n * singular or plural form.\n * @param {?string} domain Domain to retrieve the translated text.\n *\n * @return {string} The translated singular or plural form.\n */\n\nfunction _n(single, plural, number, domain) {\n return dcnpgettext(domain, undefined, single, plural, number);\n}\n/**\n * Translates and retrieves the singular or plural form based on the supplied\n * number, with gettext context.\n *\n * @see https://developer.wordpress.org/reference/functions/_nx/\n *\n * @param {string} single The text to be used if the number is singular.\n * @param {string} plural The text to be used if the number is plural.\n * @param {number} number The number to compare against to use either the\n * singular or plural form.\n * @param {string} context Context information for the translators.\n * @param {?string} domain Domain to retrieve the translated text.\n *\n * @return {string} The translated singular or plural form.\n */\n\nfunction _nx(single, plural, number, context, domain) {\n return dcnpgettext(domain, context, single, plural, number);\n}\n/**\n * Returns a formatted string. If an error occurs in applying the format, the\n * original format string is returned.\n *\n * @param {string} format The format of the string to generate.\n * @param {...string} args Arguments to apply to the format.\n *\n * @see http://www.diveintojavascript.com/projects/javascript-sprintf\n *\n * @return {string} The formatted string.\n */\n\nfunction build_module_sprintf(format) {\n try {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return sprintf_default.a.sprintf.apply(sprintf_default.a, [format].concat(args));\n } catch (error) {\n logErrorOnce('sprintf error: \\n\\n' + error.toString());\n return format;\n }\n}\n//# sourceMappingURL=index.js.map\n// CONCATENATED MODULE: ./assets/src/wp-i18n.js\n\n\nif (!window.wp) {\n\twindow.wp = {};\n}\n\nwp.i18n = build_module_namespaceObject;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
back-compat/back-compat.php CHANGED
@@ -1,12 +1,29 @@
1
  <?php
 
 
 
 
 
2
 
3
- // If you want to use the template that shipped with v0.3 and earlier, you can use this to force that.
4
- // Note that this may not stick around forever, so use caution and `function_exists`.
 
 
 
 
5
  function amp_backcompat_use_v03_templates() {
6
  add_filter( 'amp_customizer_is_enabled', '__return_false' );
7
- add_filter( 'amp_post_template_dir', '_amp_backcompat_use_v03_templates_callback', 0 ); // early in case there are other overrides
8
  }
9
 
 
 
 
 
 
 
 
 
10
  function _amp_backcompat_use_v03_templates_callback( $templates ) {
11
  return AMP__DIR__ . '/back-compat/templates-v0-3';
12
  }
1
  <?php
2
+ /**
3
+ * Functions for managing legacy templates
4
+ *
5
+ * @package AMP
6
+ */
7
 
8
+ /**
9
+ * Adds hooks to use legacy templates.
10
+ *
11
+ * If you want to use the template that shipped with v0.3 and earlier, you can use this to force that.
12
+ * Note that this may not stick around forever, so use caution and `function_exists`.
13
+ */
14
  function amp_backcompat_use_v03_templates() {
15
  add_filter( 'amp_customizer_is_enabled', '__return_false' );
16
+ add_filter( 'amp_post_template_dir', '_amp_backcompat_use_v03_templates_callback', 0 ); // Early in case there are other overrides.
17
  }
18
 
19
+ /**
20
+ * Callback for getting the legacy templates directory.
21
+ *
22
+ * @access private
23
+ *
24
+ * @param string $templates Template directory.
25
+ * @return string Legacy template directory.
26
+ */
27
  function _amp_backcompat_use_v03_templates_callback( $templates ) {
28
  return AMP__DIR__ . '/back-compat/templates-v0-3';
29
  }
back-compat/templates-v0-3/header-bar.php CHANGED
@@ -1,4 +1,12 @@
1
- <?php $site_icon_url = $this->get( 'site_icon_url' ); ?>
 
 
 
 
 
 
 
 
2
 
3
  <nav class="amp-wp-title-bar">
4
  <div>
1
+ <?php
2
+ /**
3
+ * Legacy template for the AMP title bar.
4
+ *
5
+ * @package AMP
6
+ */
7
+
8
+ $site_icon_url = $this->get( 'site_icon_url' );
9
+ ?>
10
 
11
  <nav class="amp-wp-title-bar">
12
  <div>
back-compat/templates-v0-3/meta-author.php CHANGED
@@ -1,9 +1,21 @@
1
- <?php $post_author = $this->get( 'post_author' ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  <li class="amp-wp-byline">
3
  <?php if ( function_exists( 'get_avatar_url' ) ) : ?>
4
- <amp-img src="<?php echo esc_url( get_avatar_url( $post_author->user_email, array(
5
- 'size' => 24,
6
- ) ) ); ?>" width="24" height="24" layout="fixed"></amp-img>
7
  <?php endif; ?>
8
  <span class="amp-wp-author"><?php echo esc_html( $post_author->display_name ); ?></span>
9
  </li>
1
+ <?php
2
+ /**
3
+ * Legacy template for the AMP author byline.
4
+ *
5
+ * @package AMP
6
+ */
7
+
8
+ $post_author = $this->get( 'post_author' );
9
+ $avatar_url = get_avatar_url(
10
+ $post_author->user_email,
11
+ array(
12
+ 'size' => 24,
13
+ )
14
+ );
15
+ ?>
16
  <li class="amp-wp-byline">
17
  <?php if ( function_exists( 'get_avatar_url' ) ) : ?>
18
+ <amp-img src="<?php echo esc_url( $avatar_url ); ?>" width="24" height="24" layout="fixed"></amp-img>
 
 
19
  <?php endif; ?>
20
  <span class="amp-wp-author"><?php echo esc_html( $post_author->display_name ); ?></span>
21
  </li>
back-compat/templates-v0-3/meta-taxonomy.php CHANGED
@@ -1,8 +1,16 @@
1
- <?php $categories = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'amp' ) ); ?>
 
 
 
 
 
 
 
 
2
  <?php if ( $categories ) : ?>
3
  <li class="amp-wp-tax-category">
4
  <span class="screen-reader-text">Categories:</span>
5
- <?php echo $categories; ?>
6
  </li>
7
  <?php endif; ?>
8
 
@@ -10,6 +18,6 @@
10
  <?php if ( $tags && ! is_wp_error( $tags ) ) : ?>
11
  <li class="amp-wp-tax-tag">
12
  <span class="screen-reader-text">Tags:</span>
13
- <?php echo $tags; ?>
14
  </li>
15
  <?php endif; ?>
1
+ <?php
2
+ /**
3
+ * Legacy template for the AMP post taxonomy term lists.
4
+ *
5
+ * @package AMP
6
+ */
7
+
8
+ $categories = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'amp' ) );
9
+ ?>
10
  <?php if ( $categories ) : ?>
11
  <li class="amp-wp-tax-category">
12
  <span class="screen-reader-text">Categories:</span>
13
+ <?php echo $categories; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
14
  </li>
15
  <?php endif; ?>
16
 
18
  <?php if ( $tags && ! is_wp_error( $tags ) ) : ?>
19
  <li class="amp-wp-tax-tag">
20
  <span class="screen-reader-text">Tags:</span>
21
+ <?php echo $tags; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
22
  </li>
23
  <?php endif; ?>
back-compat/templates-v0-3/meta-time.php CHANGED
@@ -1,3 +1,11 @@
 
 
 
 
 
 
 
 
1
  <li class="amp-wp-posted-on">
2
  <time datetime="<?php echo esc_attr( date( 'c', $this->get( 'post_publish_timestamp' ) ) ); ?>">
3
  <?php
1
+ <?php
2
+ /**
3
+ * Legacy template for the AMP post date.
4
+ *
5
+ * @package AMP
6
+ */
7
+
8
+ ?>
9
  <li class="amp-wp-posted-on">
10
  <time datetime="<?php echo esc_attr( date( 'c', $this->get( 'post_publish_timestamp' ) ) ); ?>">
11
  <?php
back-compat/templates-v0-3/single.php CHANGED
@@ -1,3 +1,11 @@
 
 
 
 
 
 
 
 
1
  <!doctype html>
2
  <html amp <?php language_attributes(); ?>>
3
  <head>
@@ -17,7 +25,7 @@
17
  <ul class="amp-wp-meta">
18
  <?php $this->load_parts( apply_filters( 'amp_post_template_meta_parts', array( 'meta-author', 'meta-time', 'meta-taxonomy' ) ) ); ?>
19
  </ul>
20
- <?php echo $this->get( 'post_amp_content' ); // amphtml content; no kses ?>
21
  </div>
22
  <?php do_action( 'amp_post_template_footer', $this ); ?>
23
  </body>
1
+ <?php
2
+ /**
3
+ * Legacy template for the AMP post.
4
+ *
5
+ * @package AMP
6
+ */
7
+
8
+ ?>
9
  <!doctype html>
10
  <html amp <?php language_attributes(); ?>>
11
  <head>
25
  <ul class="amp-wp-meta">
26
  <?php $this->load_parts( apply_filters( 'amp_post_template_meta_parts', array( 'meta-author', 'meta-time', 'meta-taxonomy' ) ) ); ?>
27
  </ul>
28
+ <?php echo $this->get( 'post_amp_content' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
29
  </div>
30
  <?php do_action( 'amp_post_template_footer', $this ); ?>
31
  </body>
back-compat/templates-v0-3/style.php CHANGED
@@ -1,3 +1,13 @@
 
 
 
 
 
 
 
 
 
 
1
  /* Merriweather fonts */
2
  @font-face {
3
  font-family:'Merriweather';
1
+ <?php
2
+ /**
3
+ * Legacy template for the AMP stylesheet.
4
+ *
5
+ * @package AMP
6
+ */
7
+
8
+ // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
9
+
10
+ ?>
11
  /* Merriweather fonts */
12
  @font-face {
13
  font-family:'Merriweather';
includes/admin/class-amp-admin-pointer.php CHANGED
@@ -105,6 +105,12 @@ class AMP_Admin_Pointer {
105
  * @return boolean Is dismissed.
106
  */
107
  protected function is_pointer_dismissed() {
 
 
 
 
 
 
108
  $dismissed = get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true );
109
  if ( empty( $dismissed ) ) {
110
  return false;
@@ -130,7 +136,7 @@ class AMP_Admin_Pointer {
130
  '<h3>%s</h3><p><strong>%s</strong></p><p>%s</p>',
131
  __( 'AMP', 'amp' ),
132
  __( 'New AMP Template Modes', 'amp' ),
133
- __( 'You can now reuse your theme\'s templates and styles in AMP responses, in both &#8220;Paired&#8221; and &#8220;Native&#8221; modes.', 'amp' )
134
  ),
135
  'position' => array(
136
  'edge' => 'left',
105
  * @return boolean Is dismissed.
106
  */
107
  protected function is_pointer_dismissed() {
108
+
109
+ // Consider dismissed in v1.1, since admin pointer is only to educate about the new modes in 1.0.
110
+ if ( version_compare( strtok( AMP__VERSION, '-' ), '1.1', '>=' ) ) {
111
+ return true;
112
+ }
113
+
114
  $dismissed = get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true );
115
  if ( empty( $dismissed ) ) {
116
  return false;
136
  '<h3>%s</h3><p><strong>%s</strong></p><p>%s</p>',
137
  __( 'AMP', 'amp' ),
138
  __( 'New AMP Template Modes', 'amp' ),
139
+ __( 'You can now reuse your theme\'s templates and styles in AMP responses, in both &#8220;Transitional&#8221; and &#8220;Native&#8221; modes.', 'amp' )
140
  ),
141
  'position' => array(
142
  'edge' => 'left',
includes/admin/class-amp-customizer.php CHANGED
@@ -1,4 +1,10 @@
1
  <?php
 
 
 
 
 
 
2
  /**
3
  * AMP class that implements a template style editor in the Customizer.
4
  *
@@ -82,12 +88,15 @@ class AMP_Template_Customizer {
82
  * Sets up the AMP Customizer preview.
83
  */
84
  public function register_ui() {
85
- $this->wp_customize->add_panel( self::PANEL_ID, array(
86
- 'type' => 'amp',
87
- 'title' => __( 'AMP', 'amp' ),
88
- /* translators: placeholder is URL to AMP project. */
89
- 'description' => sprintf( __( '<a href="%s" target="_blank">The AMP Project</a> is a Google-led initiative that dramatically improves loading speeds on phones and tablets. You can use the Customizer to preview changes to your AMP template before publishing them.', 'amp' ), 'https://ampproject.org' ),
90
- ) );
 
 
 
91
 
92
  /**
93
  * Fires after the AMP panel has been registered for plugins to add additional controls.
@@ -133,18 +142,25 @@ class AMP_Template_Customizer {
133
  true
134
  );
135
 
136
- wp_add_inline_script( 'amp-customize-controls', sprintf( 'ampCustomizeControls.boot( %s );',
137
- wp_json_encode( array(
138
- 'queryVar' => amp_get_slug(),
139
- 'panelId' => self::PANEL_ID,
140
- 'ampUrl' => amp_admin_get_preview_permalink(),
141
- 'l10n' => array(
142
- 'unavailableMessage' => __( 'AMP is not available for the page currently being previewed.', 'amp' ),
143
- 'unavailableLinkText' => __( 'Navigate to an AMP compatible page', 'amp' ),
144
- ),
145
- ) )
146
- ) );
 
 
 
 
 
 
147
 
 
148
  wp_enqueue_style(
149
  'amp-customizer',
150
  amp_get_asset_url( 'css/amp-customizer.css' )
@@ -199,12 +215,18 @@ class AMP_Template_Customizer {
199
  $available = false;
200
  }
201
 
202
- wp_add_inline_script( 'amp-customize-preview', sprintf( 'ampCustomizePreview.boot( %s );',
203
- wp_json_encode( array(
204
- 'available' => $available,
205
- 'enabled' => is_amp_endpoint(),
206
- ) )
207
- ) );
 
 
 
 
 
 
208
  }
209
 
210
  /**
1
  <?php
2
+ /**
3
+ * Class AMP_Template_Customizer
4
+ *
5
+ * @package AMP
6
+ */
7
+
8
  /**
9
  * AMP class that implements a template style editor in the Customizer.
10
  *
88
  * Sets up the AMP Customizer preview.
89
  */
90
  public function register_ui() {
91
+ $this->wp_customize->add_panel(
92
+ self::PANEL_ID,
93
+ array(
94
+ 'type' => 'amp',
95
+ 'title' => __( 'AMP', 'amp' ),
96
+ /* translators: placeholder is URL to AMP project. */
97
+ 'description' => sprintf( __( '<a href="%s" target="_blank">The AMP Project</a> is a Google-led initiative that dramatically improves loading speeds on phones and tablets. You can use the Customizer to preview changes to your AMP template before publishing them.', 'amp' ), 'https://ampproject.org' ),
98
+ )
99
+ );
100
 
101
  /**
102
  * Fires after the AMP panel has been registered for plugins to add additional controls.
142
  true
143
  );
144
 
145
+ wp_add_inline_script(
146
+ 'amp-customize-controls',
147
+ sprintf(
148
+ 'ampCustomizeControls.boot( %s );',
149
+ wp_json_encode(
150
+ array(
151
+ 'queryVar' => amp_get_slug(),
152
+ 'panelId' => self::PANEL_ID,
153
+ 'ampUrl' => amp_admin_get_preview_permalink(),
154
+ 'l10n' => array(
155
+ 'unavailableMessage' => __( 'AMP is not available for the page currently being previewed.', 'amp' ),
156
+ 'unavailableLinkText' => __( 'Navigate to an AMP compatible page', 'amp' ),
157
+ ),
158
+ )
159
+ )
160
+ )
161
+ );
162
 
163
+ // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion
164
  wp_enqueue_style(
165
  'amp-customizer',
166
  amp_get_asset_url( 'css/amp-customizer.css' )
215
  $available = false;
216
  }
217
 
218
+ wp_add_inline_script(
219
+ 'amp-customize-preview',
220
+ sprintf(
221
+ 'ampCustomizePreview.boot( %s );',
222
+ wp_json_encode(
223
+ array(
224
+ 'available' => $available,
225
+ 'enabled' => is_amp_endpoint(),
226
+ )
227
+ )
228
+ )
229
+ );
230
  }
231
 
232
  /**
includes/admin/class-amp-editor-blocks.php CHANGED
@@ -51,7 +51,7 @@ class AMP_Editor_Blocks {
51
  * then the non-AMP blog page need to load the AMP runtime scripts so that the AMP components
52
  * in the posts displayed there will be rendered properly. This is only relevant on native AMP
53
  * sites because the AMP Gutenberg blocks are only made available in that mode; they are not
54
- * presented in the Gutenberg inserter in paired mode. In general, using AMP components in
55
  * non-AMP documents is still not officially supported, so it's occurrence is being minimized
56
  * as much as possible. For more, see <https://github.com/ampproject/amp-wp/issues/1192>.
57
  */
@@ -77,6 +77,9 @@ class AMP_Editor_Blocks {
77
  }
78
 
79
  foreach ( $tags as &$tag ) {
 
 
 
80
  $tag['data-amp-layout'] = true;
81
  $tag['data-amp-noloading'] = true;
82
  $tag['data-amp-lightbox'] = true;
@@ -132,6 +135,7 @@ class AMP_Editor_Blocks {
132
  AMP__VERSION
133
  );
134
 
 
135
  wp_enqueue_script(
136
  'amp-editor-blocks-build',
137
  amp_get_asset_url( 'js/amp-blocks-compiled.js' ),
@@ -154,9 +158,14 @@ class AMP_Editor_Blocks {
154
 
155
  wp_add_inline_script(
156
  'amp-editor-blocks',
157
- sprintf( 'ampEditorBlocks.boot( %s );', wp_json_encode( array(
158
- 'hasThemeSupport' => current_theme_supports( AMP_Theme_Support::SLUG ),
159
- ) ) )
 
 
 
 
 
160
  );
161
 
162
  if ( function_exists( 'wp_set_script_translations' ) ) {
51
  * then the non-AMP blog page need to load the AMP runtime scripts so that the AMP components
52
  * in the posts displayed there will be rendered properly. This is only relevant on native AMP
53
  * sites because the AMP Gutenberg blocks are only made available in that mode; they are not
54
+ * presented in the Gutenberg inserter in transitional mode. In general, using AMP components in
55
  * non-AMP documents is still not officially supported, so it's occurrence is being minimized
56
  * as much as possible. For more, see <https://github.com/ampproject/amp-wp/issues/1192>.
57
  */
77
  }
78
 
79
  foreach ( $tags as &$tag ) {
80
+ if ( ! is_array( $tag ) ) {
81
+ continue;
82
+ }
83
  $tag['data-amp-layout'] = true;
84
  $tag['data-amp-noloading'] = true;
85
  $tag['data-amp-lightbox'] = true;
135
  AMP__VERSION
136
  );
137
 
138
+ // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.NotInFooter
139
  wp_enqueue_script(
140
  'amp-editor-blocks-build',
141
  amp_get_asset_url( 'js/amp-blocks-compiled.js' ),
158
 
159
  wp_add_inline_script(
160
  'amp-editor-blocks',
161
+ sprintf(
162
+ 'ampEditorBlocks.boot( %s );',
163
+ wp_json_encode(
164
+ array(
165
+ 'hasThemeSupport' => current_theme_supports( AMP_Theme_Support::SLUG ),
166
+ )
167
+ )
168
+ )
169
  );
170
 
171
  if ( function_exists( 'wp_set_script_translations' ) ) {
includes/admin/class-amp-post-meta-box.php CHANGED
@@ -83,13 +83,17 @@ class AMP_Post_Meta_Box {
83
  * @since 0.6
84
  */
85
  public function init() {
86
- register_meta( 'post', self::STATUS_POST_META_KEY, array(
87
- 'sanitize_callback' => array( $this, 'sanitize_status' ),
88
- 'type' => 'string',
89
- 'description' => __( 'AMP status.', 'amp' ),
90
- 'show_in_rest' => true,
91
- 'single' => true,
92
- ) );
 
 
 
 
93
 
94
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_assets' ) );
95
  add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_block_assets' ) );
@@ -106,7 +110,7 @@ class AMP_Post_Meta_Box {
106
  */
107
  public function sanitize_status( $status ) {
108
  $status = strtolower( trim( $status ) );
109
- if ( ! in_array( $status, array( 'enabled', 'disabled' ), true ) ) {
110
  /*
111
  * In lieu of actual validation being available, clear the status entirely
112
  * so that the underlying default status will be used instead.
@@ -137,7 +141,6 @@ class AMP_Post_Meta_Box {
137
  return;
138
  }
139
 
140
- // Styles.
141
  wp_enqueue_style(
142
  self::ASSETS_HANDLE,
143
  amp_get_asset_url( 'css/amp-post-meta-box.css' ),
@@ -145,7 +148,7 @@ class AMP_Post_Meta_Box {
145
  AMP__VERSION
146
  );
147
 
148
- // Scripts.
149
  wp_enqueue_script(
150
  self::ASSETS_HANDLE,
151
  amp_get_asset_url( 'js/amp-post-meta-box.js' ),
@@ -160,18 +163,24 @@ class AMP_Post_Meta_Box {
160
  $support_errors = AMP_Post_Type_Support::get_support_errors( $post );
161
  }
162
 
163
- wp_add_inline_script( self::ASSETS_HANDLE, sprintf( 'ampPostMetaBox.boot( %s );',
164
- wp_json_encode( array(
165
- 'previewLink' => esc_url_raw( add_query_arg( amp_get_slug(), '', get_preview_post_link( $post ) ) ),
166
- 'canonical' => amp_is_canonical(),
167
- 'enabled' => empty( $support_errors ),
168
- 'canSupport' => 0 === count( array_diff( $support_errors, array( 'post-status-disabled' ) ) ),
169
- 'statusInputName' => self::STATUS_INPUT_NAME,
170
- 'l10n' => array(
171
- 'ampPreviewBtnLabel' => __( 'Preview changes in AMP (opens in new window)', 'amp' ),
172
- ),
173
- ) )
174
- ) );
 
 
 
 
 
 
175
  }
176
 
177
  /**
@@ -370,9 +379,9 @@ class AMP_Post_Meta_Box {
370
  */
371
  public function preview_post_link( $link ) {
372
  $is_amp = (
373
- isset( $_POST['amp-preview'] ) // WPCS: CSRF ok.
374
  &&
375
- 'do-preview' === sanitize_key( wp_unslash( $_POST['amp-preview'] ) ) // WPCS: CSRF ok.
376
  );
377
 
378
  if ( $is_amp ) {
83
  * @since 0.6
84
  */
85
  public function init() {
86
+ register_meta(
87
+ 'post',
88
+ self::STATUS_POST_META_KEY,
89
+ array(
90
+ 'sanitize_callback' => array( $this, 'sanitize_status' ),
91
+ 'type' => 'string',
92
+ 'description' => __( 'AMP status.', 'amp' ),
93
+ 'show_in_rest' => true,
94
+ 'single' => true,
95
+ )
96
+ );
97
 
98
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_assets' ) );
99
  add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_block_assets' ) );
110
  */
111
  public function sanitize_status( $status ) {
112
  $status = strtolower( trim( $status ) );
113
+ if ( ! in_array( $status, array( self::ENABLED_STATUS, self::DISABLED_STATUS ), true ) ) {
114
  /*
115
  * In lieu of actual validation being available, clear the status entirely
116
  * so that the underlying default status will be used instead.
141
  return;
142
  }
143
 
 
144
  wp_enqueue_style(
145
  self::ASSETS_HANDLE,
146
  amp_get_asset_url( 'css/amp-post-meta-box.css' ),
148
  AMP__VERSION
149
  );
150
 
151
+ // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.NotInFooter
152
  wp_enqueue_script(
153
  self::ASSETS_HANDLE,
154
  amp_get_asset_url( 'js/amp-post-meta-box.js' ),
163
  $support_errors = AMP_Post_Type_Support::get_support_errors( $post );
164
  }
165
 
166
+ wp_add_inline_script(
167
+ self::ASSETS_HANDLE,
168
+ sprintf(
169
+ 'ampPostMetaBox.boot( %s );',
170
+ wp_json_encode(
171
+ array(
172
+ 'previewLink' => esc_url_raw( add_query_arg( amp_get_slug(), '', get_preview_post_link( $post ) ) ),
173
+ 'canonical' => amp_is_canonical(),
174
+ 'enabled' => empty( $support_errors ),
175
+ 'canSupport' => 0 === count( array_diff( $support_errors, array( 'post-status-disabled' ) ) ),
176
+ 'statusInputName' => self::STATUS_INPUT_NAME,
177
+ 'l10n' => array(
178
+ 'ampPreviewBtnLabel' => __( 'Preview changes in AMP (opens in new window)', 'amp' ),
179
+ ),
180
+ )
181
+ )
182
+ )
183
+ );
184
  }
185
 
186
  /**
379
  */
380
  public function preview_post_link( $link ) {
381
  $is_amp = (
382
+ isset( $_POST['amp-preview'] ) // phpcs:ignore WordPress.Security.NonceVerification.Missing
383
  &&
384
+ 'do-preview' === sanitize_key( wp_unslash( $_POST['amp-preview'] ) ) // phpcs:ignore WordPress.Security.NonceVerification.Missing
385
  );
386
 
387
  if ( $is_amp ) {
includes/admin/functions.php CHANGED
@@ -67,16 +67,18 @@ function amp_admin_get_preview_permalink() {
67
  }
68
  }
69
 
70
- $post_ids = get_posts( array(
71
- 'no_found_rows' => true,
72
- 'suppress_filters' => false,
73
- 'post_status' => 'publish',
74
- 'post_password' => '',
75
- 'post_type' => $supported_post_types,
76
- 'posts_per_page' => 1,
77
- 'fields' => 'ids',
 
78
  // @todo This should eventually do a meta_query to make sure there are none that have AMP_Post_Meta_Box::STATUS_POST_META_KEY = DISABLED_STATUS.
79
- ) );
 
80
 
81
  if ( empty( $post_ids ) ) {
82
  return false;
@@ -96,11 +98,14 @@ function amp_add_customizer_link() {
96
  return;
97
  }
98
 
99
- $menu_slug = add_query_arg( array(
100
- 'autofocus[panel]' => AMP_Template_Customizer::PANEL_ID,
101
- 'url' => rawurlencode( amp_admin_get_preview_permalink() ),
102
- 'return' => rawurlencode( admin_url() ),
103
- ), 'customize.php' );
 
 
 
104
 
105
  // Add the theme page.
106
  add_theme_page(
67
  }
68
  }
69
 
70
+ $post_ids = get_posts(
71
+ array(
72
+ 'no_found_rows' => true,
73
+ 'suppress_filters' => false,
74
+ 'post_status' => 'publish',
75
+ 'post_password' => '',
76
+ 'post_type' => $supported_post_types,
77
+ 'posts_per_page' => 1,
78
+ 'fields' => 'ids',
79
  // @todo This should eventually do a meta_query to make sure there are none that have AMP_Post_Meta_Box::STATUS_POST_META_KEY = DISABLED_STATUS.
80
+ )
81
+ );
82
 
83
  if ( empty( $post_ids ) ) {
84
  return false;
98
  return;
99
  }
100
 
101
+ $menu_slug = add_query_arg(
102
+ array(
103
+ 'autofocus[panel]' => AMP_Template_Customizer::PANEL_ID,
104
+ 'url' => rawurlencode( amp_admin_get_preview_permalink() ),
105
+ 'return' => rawurlencode( admin_url() ),
106
+ ),
107
+ 'customize.php'
108
+ );
109
 
110
  // Add the theme page.
111
  add_theme_page(
includes/amp-frontend-actions.php CHANGED
@@ -6,7 +6,17 @@
6
  * @package AMP
7
  */
8
 
9
- _deprecated_file( __FILE__, '1.0', null, esc_html__( 'Use amp_add_amphtml_link() function which is already included from amp-helper-functions.php', 'amp' ) );
 
 
 
 
 
 
 
 
 
 
10
 
11
  /**
12
  * Add amphtml link to frontend.
6
  * @package AMP
7
  */
8
 
9
+ _deprecated_file(
10
+ __FILE__,
11
+ '1.0',
12
+ null,
13
+ sprintf(
14
+ /* translators: 1: amp_add_amphtml_link(). 2: amp-helper-functions.php */
15
+ esc_html__( 'Use %1$s function which is already included from %2$s', 'amp' ),
16
+ 'amp_add_amphtml_link()',
17
+ 'amp-helper-functions.php'
18
+ )
19
+ );
20
 
21
  /**
22
  * Add amphtml link to frontend.
includes/amp-helper-functions.php CHANGED
@@ -200,16 +200,18 @@ function amp_add_amphtml_link() {
200
  $error_count = count( $validation_errors );
201
  if ( $error_count > 0 ) {
202
  echo "<!--\n";
203
- echo esc_html( sprintf(
204
- /* translators: %s is error count */
205
- _n(
206
- 'There is %s validation error that is blocking the amphtml version from being available.',
207
- 'There are %s validation errors that are blocking the amphtml version from being available.',
208
- $error_count,
209
- 'amp'
210
- ),
211
- number_format_i18n( $error_count )
212
- ) );
 
 
213
  echo "\n-->";
214
  return;
215
  }
@@ -240,28 +242,61 @@ function post_supports_amp( $post ) {
240
  * This function cannot be called before the parse_query action because it needs to be able
241
  * to determine the queried object is able to be served as AMP. If 'amp' theme support is not
242
  * present, this function returns true just if the query var is present. If theme support is
243
- * present, then it returns true in paired mode if an AMP template is available and the query
244
  * var is present, or else in native mode if just the template is available.
245
  *
246
  * @return bool Whether it is the AMP endpoint.
 
 
247
  */
248
  function is_amp_endpoint() {
249
- global $pagenow;
 
 
 
 
250
 
251
- if ( is_admin() || is_feed() || ( defined( 'REST_REQUEST' ) && REST_REQUEST ) || in_array( $pagenow, array( 'wp-login.php', 'wp-signup.php', 'wp-activate.php' ), true ) ) {
 
252
  return false;
253
  }
254
 
255
  $did_parse_query = did_action( 'parse_query' );
256
 
257
  if ( ! $did_parse_query ) {
258
- _doing_it_wrong( __FUNCTION__, sprintf( esc_html__( "is_amp_endpoint() was called before the 'parse_query' hook was called. This function will always return 'false' before the 'parse_query' hook is called.", 'amp' ) ), '0.4.2' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
259
  }
260
 
261
  $has_amp_query_var = (
262
- isset( $_GET[ amp_get_slug() ] ) // WPCS: CSRF OK.
263
  ||
264
- false !== get_query_var( amp_get_slug(), false )
 
 
 
 
265
  );
266
 
267
  if ( ! current_theme_supports( AMP_Theme_Support::SLUG ) ) {
@@ -284,7 +319,17 @@ function is_amp_endpoint() {
284
  }
285
 
286
  if ( ! did_action( 'wp' ) ) {
287
- _doing_it_wrong( __FUNCTION__, sprintf( esc_html__( "is_amp_endpoint() was called before the 'wp' action which means it will not have access to the queried object to determine if it is an AMP response, thus neither the amp_skip_post filter nor the AMP enabled publish metabox toggle will not be considered.", 'amp' ) ), '1.0.2' );
 
 
 
 
 
 
 
 
 
 
288
  $supported = true;
289
  } else {
290
  $availability = AMP_Theme_Support::get_template_availability();
@@ -327,9 +372,9 @@ function amp_add_generator_metadata() {
327
  if ( amp_is_canonical() ) {
328
  $mode = 'native';
329
  } elseif ( current_theme_supports( AMP_Theme_Support::SLUG ) ) {
330
- $mode = 'paired';
331
  } else {
332
- $mode = 'classic';
333
  }
334
  printf( '<meta name="generator" content="%s">', esc_attr( sprintf( 'AMP Plugin v%s; mode=%s', AMP__VERSION, $mode ) ) );
335
  }
@@ -359,9 +404,13 @@ function amp_register_default_scripts( $wp_scripts ) {
359
  array(),
360
  null
361
  );
362
- $wp_scripts->add_data( $handle, 'amp_script_attributes', array(
363
- 'async' => true,
364
- ) );
 
 
 
 
365
 
366
  // Shadow AMP API.
367
  $handle = 'amp-shadow';
@@ -371,9 +420,13 @@ function amp_register_default_scripts( $wp_scripts ) {
371
  array(),
372
  null
373
  );
374
- $wp_scripts->add_data( $handle, 'amp_script_attributes', array(
375
- 'async' => true,
376
- ) );
 
 
 
 
377
 
378
  // Get all AMP components as defined in the spec.
379
  $extensions = array();
@@ -513,7 +566,7 @@ function amp_filter_script_loader_tag( $tag, $handle ) {
513
  *
514
  * This explicitly triggers a CORS request, and gets back a non-opaque response, ensuring that a service
515
  * worker caching the external stylesheet will not inflate the storage quota. This must be done in AMP
516
- * and non-AMP alike because in paired mode the service worker could cache the font stylesheets in a
517
  * non-AMP document without CORS (crossorigin="anonymous") in which case the service worker could then
518
  * fail to serve the cached font resources in an AMP document with the warning:
519
  *
@@ -566,7 +619,7 @@ function amp_get_analytics( $analytics = array() ) {
566
  * Add amp-analytics tags.
567
  *
568
  * This filter allows you to easily insert any amp-analytics tags without needing much heavy lifting.
569
- * This filter should be used to alter entries for paired mode.
570
  *
571
  * @since 0.7
572
  *
@@ -609,20 +662,38 @@ function amp_print_analytics( $analytics ) {
609
  // Can enter multiple configs within backend.
610
  foreach ( $analytics_entries as $id => $analytics_entry ) {
611
  if ( ! isset( $analytics_entry['type'], $analytics_entry['attributes'], $analytics_entry['config_data'] ) ) {
612
- /* translators: 1: the analytics entry ID, 2: comma-separated list of the actual entry keys. */
613
- _doing_it_wrong( __FUNCTION__, sprintf( esc_html__( 'Analytics entry for %1$s is missing one of the following keys: `type`, `attributes`, or `config_data` (array keys: %2$s)', 'amp' ), esc_html( $id ), esc_html( implode( ', ', array_keys( $analytics_entry ) ) ) ), '0.3.2' );
 
 
 
 
 
 
 
 
 
 
 
614
  continue;
615
  }
616
- $script_element = AMP_HTML_Utils::build_tag( 'script', array(
617
- 'type' => 'application/json',
618
- ), wp_json_encode( $analytics_entry['config_data'] ) );
 
 
 
 
619
 
620
- $amp_analytics_attr = array_merge( array(
621
- 'id' => $id,
622
- 'type' => $analytics_entry['type'],
623
- ), $analytics_entry['attributes'] );
 
 
 
624
 
625
- echo AMP_HTML_Utils::build_tag( 'amp-analytics', $amp_analytics_attr, $script_element ); // WPCS: XSS OK.
626
  }
627
  }
628
 
@@ -637,7 +708,15 @@ function amp_print_analytics( $analytics ) {
637
  */
638
  function amp_get_content_embed_handlers( $post = null ) {
639
  if ( current_theme_supports( AMP_Theme_Support::SLUG ) && $post ) {
640
- _deprecated_argument( __FUNCTION__, '0.7', esc_html__( 'The $post argument is deprecated when theme supports AMP.', 'amp' ) );
 
 
 
 
 
 
 
 
641
  $post = null;
642
  }
643
 
@@ -650,7 +729,8 @@ function amp_get_content_embed_handlers( $post = null ) {
650
  * @param array $handlers Handlers.
651
  * @param WP_Post $post Post. Deprecated. It will be null when `amp_is_canonical()`.
652
  */
653
- return apply_filters( 'amp_content_embed_handlers',
 
654
  array(
655
  'AMP_Core_Block_Handler' => array(),
656
  'AMP_Twitter_Embed_Handler' => array(),
@@ -681,17 +761,67 @@ function amp_get_content_embed_handlers( $post = null ) {
681
  * Get content sanitizers.
682
  *
683
  * @since 0.7
 
684
  *
685
  * @param WP_Post $post Post that the content belongs to. Deprecated when theme supports AMP, as sanitizers apply
686
  * to non-post data (e.g. Text widget).
687
  * @return array Embed handlers.
688
  */
689
  function amp_get_content_sanitizers( $post = null ) {
690
- if ( current_theme_supports( AMP_Theme_Support::SLUG ) && $post ) {
691
- _deprecated_argument( __FUNCTION__, '0.7', esc_html__( 'The $post argument is deprecated when theme supports AMP.', 'amp' ) );
 
 
 
 
 
 
 
 
 
 
692
  $post = null;
693
  }
694
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
695
  /**
696
  * Filters the content sanitizers.
697
  *
@@ -701,33 +831,7 @@ function amp_get_content_sanitizers( $post = null ) {
701
  * @param array $handlers Handlers.
702
  * @param WP_Post $post Post. Deprecated.
703
  */
704
- $sanitizers = apply_filters( 'amp_content_sanitizers',
705
- array(
706
- 'AMP_Core_Theme_Sanitizer' => array(
707
- 'template' => get_template(),
708
- 'stylesheet' => get_stylesheet(),
709
- ),
710
- 'AMP_Img_Sanitizer' => array(),
711
- 'AMP_Form_Sanitizer' => array(),
712
- 'AMP_Comments_Sanitizer' => array(),
713
- 'AMP_Video_Sanitizer' => array(),
714
- 'AMP_O2_Player_Sanitizer' => array(),
715
- 'AMP_Audio_Sanitizer' => array(),
716
- 'AMP_Playbuzz_Sanitizer' => array(),
717
- 'AMP_Embed_Sanitizer' => array(),
718
- 'AMP_Iframe_Sanitizer' => array(
719
- 'add_placeholder' => true,
720
- ),
721
- 'AMP_Gallery_Block_Sanitizer' => array( // Note: Gallery block sanitizer must come after image sanitizers since itś logic is using the already sanitized images.
722
- 'carousel_required' => ! current_theme_supports( AMP_Theme_Support::SLUG ), // For back-compat.
723
- ),
724
- 'AMP_Block_Sanitizer' => array(), // Note: Block sanitizer must come after embed / media sanitizers since it's logic is using the already sanitized content.
725
- 'AMP_Script_Sanitizer' => array(),
726
- 'AMP_Style_Sanitizer' => array(),
727
- 'AMP_Tag_And_Attribute_Sanitizer' => array(), // Note: This whitelist sanitizer must come at the end to clean up any remaining issues the other sanitizers didn't catch.
728
- ),
729
- $post
730
- );
731
 
732
  // Force style sanitizer and whitelist sanitizer to be at end.
733
  foreach ( array( 'AMP_Style_Sanitizer', 'AMP_Tag_And_Attribute_Sanitizer' ) as $class_name ) {
@@ -937,6 +1041,8 @@ function amp_get_schemaorg_metadata() {
937
  * Output schema.org metadata.
938
  *
939
  * @since 0.7
 
 
940
  */
941
  function amp_print_schemaorg_metadata() {
942
  $metadata = amp_get_schemaorg_metadata();
@@ -944,7 +1050,7 @@ function amp_print_schemaorg_metadata() {
944
  return;
945
  }
946
  ?>
947
- <script type="application/ld+json"><?php echo wp_json_encode( $metadata ); ?></script>
948
  <?php
949
  }
950
 
200
  $error_count = count( $validation_errors );
201
  if ( $error_count > 0 ) {
202
  echo "<!--\n";
203
+ echo esc_html(
204
+ sprintf(
205
+ /* translators: %s: error count */
206
+ _n(
207
+ 'There is %s validation error that is blocking the amphtml version from being available.',
208
+ 'There are %s validation errors that are blocking the amphtml version from being available.',
209
+ $error_count,
210
+ 'amp'
211
+ ),
212
+ number_format_i18n( $error_count )
213
+ )
214
+ );
215
  echo "\n-->";
216
  return;
217
  }
242
  * This function cannot be called before the parse_query action because it needs to be able
243
  * to determine the queried object is able to be served as AMP. If 'amp' theme support is not
244
  * present, this function returns true just if the query var is present. If theme support is
245
+ * present, then it returns true in transitional mode if an AMP template is available and the query
246
  * var is present, or else in native mode if just the template is available.
247
  *
248
  * @return bool Whether it is the AMP endpoint.
249
+ * @global string $pagenow
250
+ * @global WP_Query $wp_query
251
  */
252
  function is_amp_endpoint() {
253
+ global $pagenow, $wp_query;
254
+
255
+ if ( is_admin() || is_embed() || is_feed() || ( defined( 'REST_REQUEST' ) && REST_REQUEST ) || in_array( $pagenow, array( 'wp-login.php', 'wp-signup.php', 'wp-activate.php' ), true ) ) {
256
+ return false;
257
+ }
258
 
259
+ // Always return false when requesting service worker.
260
+ if ( class_exists( 'WP_Service_Workers' ) && ! empty( $wp_query ) && defined( 'WP_Service_Workers::QUERY_VAR' ) && $wp_query->get( WP_Service_Workers::QUERY_VAR ) ) {
261
  return false;
262
  }
263
 
264
  $did_parse_query = did_action( 'parse_query' );
265
 
266
  if ( ! $did_parse_query ) {
267
+ _doing_it_wrong(
268
+ __FUNCTION__,
269
+ sprintf(
270
+ /* translators: 1: is_amp_endpoint(), 2: parse_query */
271
+ esc_html__( '%1$s was called before the %2$s hook was called.', 'amp' ),
272
+ 'is_amp_endpoint()',
273
+ 'parse_query'
274
+ ),
275
+ '0.4.2'
276
+ );
277
+ }
278
+
279
+ if ( empty( $wp_query ) || ! ( $wp_query instanceof WP_Query ) ) {
280
+ _doing_it_wrong(
281
+ __FUNCTION__,
282
+ sprintf(
283
+ /* translators: 1: is_amp_endpoint(), 2: WP_Query */
284
+ esc_html__( '%1$s was called before the %2$s was instantiated.', 'amp' ),
285
+ 'is_amp_endpoint()',
286
+ 'WP_Query'
287
+ ),
288
+ '1.1'
289
+ );
290
  }
291
 
292
  $has_amp_query_var = (
293
+ isset( $_GET[ amp_get_slug() ] ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended
294
  ||
295
+ (
296
+ $wp_query instanceof WP_Query
297
+ &&
298
+ false !== $wp_query->get( amp_get_slug(), false )
299
+ )
300
  );
301
 
302
  if ( ! current_theme_supports( AMP_Theme_Support::SLUG ) ) {
319
  }
320
 
321
  if ( ! did_action( 'wp' ) ) {
322
+ _doing_it_wrong(
323
+ __FUNCTION__,
324
+ sprintf(
325
+ /* translators: 1: is_amp_endpoint(). 2: wp. 3: amp_skip_post */
326
+ esc_html__( '%1$s was called before the %2$s action which means it will not have access to the queried object to determine if it is an AMP response, thus neither the %3$s filter nor the AMP enabled publish metabox toggle will be considered.', 'amp' ),
327
+ 'is_amp_endpoint()',
328
+ 'wp',
329
+ 'amp_skip_post'
330
+ ),
331
+ '1.0.2'
332
+ );
333
  $supported = true;
334
  } else {
335
  $availability = AMP_Theme_Support::get_template_availability();
372
  if ( amp_is_canonical() ) {
373
  $mode = 'native';
374
  } elseif ( current_theme_supports( AMP_Theme_Support::SLUG ) ) {
375
+ $mode = 'transitional';
376
  } else {
377
+ $mode = 'reader';
378
  }
379
  printf( '<meta name="generator" content="%s">', esc_attr( sprintf( 'AMP Plugin v%s; mode=%s', AMP__VERSION, $mode ) ) );
380
  }
404
  array(),
405
  null
406
  );
407
+ $wp_scripts->add_data(
408
+ $handle,
409
+ 'amp_script_attributes',
410
+ array(
411
+ 'async' => true,
412
+ )
413
+ );
414
 
415
  // Shadow AMP API.
416
  $handle = 'amp-shadow';
420
  array(),
421
  null
422
  );
423
+ $wp_scripts->add_data(
424
+ $handle,
425
+ 'amp_script_attributes',
426
+ array(
427
+ 'async' => true,
428
+ )
429
+ );
430
 
431
  // Get all AMP components as defined in the spec.
432
  $extensions = array();
566
  *
567
  * This explicitly triggers a CORS request, and gets back a non-opaque response, ensuring that a service
568
  * worker caching the external stylesheet will not inflate the storage quota. This must be done in AMP
569
+ * and non-AMP alike because in transitional mode the service worker could cache the font stylesheets in a
570
  * non-AMP document without CORS (crossorigin="anonymous") in which case the service worker could then
571
  * fail to serve the cached font resources in an AMP document with the warning:
572
  *
619
  * Add amp-analytics tags.
620
  *
621
  * This filter allows you to easily insert any amp-analytics tags without needing much heavy lifting.
622
+ * This filter should be used to alter entries for transitional mode.
623
  *
624
  * @since 0.7
625
  *
662
  // Can enter multiple configs within backend.
663
  foreach ( $analytics_entries as $id => $analytics_entry ) {
664
  if ( ! isset( $analytics_entry['type'], $analytics_entry['attributes'], $analytics_entry['config_data'] ) ) {
665
+ _doing_it_wrong(
666
+ __FUNCTION__,
667
+ sprintf(
668
+ /* translators: 1: the analytics entry ID. 2: type. 3: attributes. 4: config_data. 5: comma-separated list of the actual entry keys. */
669
+ esc_html__( 'Analytics entry for %1$s is missing one of the following keys: `%2$s`, `%3$s`, or `%4$s` (array keys: %5$s)', 'amp' ),
670
+ esc_html( $id ),
671
+ 'type',
672
+ 'attributes',
673
+ 'config_data',
674
+ esc_html( implode( ', ', array_keys( $analytics_entry ) ) )
675
+ ),
676
+ '0.3.2'
677
+ );
678
  continue;
679
  }
680
+ $script_element = AMP_HTML_Utils::build_tag(
681
+ 'script',
682
+ array(
683
+ 'type' => 'application/json',
684
+ ),
685
+ wp_json_encode( $analytics_entry['config_data'] )
686
+ );
687
 
688
+ $amp_analytics_attr = array_merge(
689
+ array(
690
+ 'id' => $id,
691
+ 'type' => $analytics_entry['type'],
692
+ ),
693
+ $analytics_entry['attributes']
694
+ );
695
 
696
+ echo AMP_HTML_Utils::build_tag( 'amp-analytics', $amp_analytics_attr, $script_element ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
697
  }
698
  }
699
 
708
  */
709
  function amp_get_content_embed_handlers( $post = null ) {
710
  if ( current_theme_supports( AMP_Theme_Support::SLUG ) && $post ) {
711
+ _deprecated_argument(
712
+ __FUNCTION__,
713
+ '0.7',
714
+ sprintf(
715
+ /* translators: %s: $post */
716
+ esc_html__( 'The %s argument is deprecated when theme supports AMP.', 'amp' ),
717
+ '$post'
718
+ )
719
+ );
720
  $post = null;
721
  }
722
 
729
  * @param array $handlers Handlers.
730
  * @param WP_Post $post Post. Deprecated. It will be null when `amp_is_canonical()`.
731
  */
732
+ return apply_filters(
733
+ 'amp_content_embed_handlers',
734
  array(
735
  'AMP_Core_Block_Handler' => array(),
736
  'AMP_Twitter_Embed_Handler' => array(),
761
  * Get content sanitizers.
762
  *
763
  * @since 0.7
764
+ * @since 1.1 Added AMP_Nav_Menu_Toggle_Sanitizer and AMP_Nav_Menu_Dropdown_Sanitizer.
765
  *
766
  * @param WP_Post $post Post that the content belongs to. Deprecated when theme supports AMP, as sanitizers apply
767
  * to non-post data (e.g. Text widget).
768
  * @return array Embed handlers.
769
  */
770
  function amp_get_content_sanitizers( $post = null ) {
771
+ $theme_support_args = AMP_Theme_Support::get_theme_support_args();
772
+
773
+ if ( is_array( $theme_support_args ) && $post ) {
774
+ _deprecated_argument(
775
+ __FUNCTION__,
776
+ '0.7',
777
+ sprintf(
778
+ /* translators: %s: $post */
779
+ esc_html__( 'The %s argument is deprecated when theme supports AMP.', 'amp' ),
780
+ '$post'
781
+ )
782
+ );
783
  $post = null;
784
  }
785
 
786
+ $sanitizers = array(
787
+ 'AMP_Core_Theme_Sanitizer' => array(
788
+ 'template' => get_template(),
789
+ 'stylesheet' => get_stylesheet(),
790
+ ),
791
+ 'AMP_Img_Sanitizer' => array(
792
+ 'align_wide_support' => current_theme_supports( 'align-wide' ),
793
+ ),
794
+ 'AMP_Form_Sanitizer' => array(),
795
+ 'AMP_Comments_Sanitizer' => array(
796
+ 'comments_live_list' => ! empty( $theme_support_args['comments_live_list'] ),
797
+ ),
798
+ 'AMP_Video_Sanitizer' => array(),
799
+ 'AMP_O2_Player_Sanitizer' => array(),
800
+ 'AMP_Audio_Sanitizer' => array(),
801
+ 'AMP_Playbuzz_Sanitizer' => array(),
802
+ 'AMP_Embed_Sanitizer' => array(),
803
+ 'AMP_Iframe_Sanitizer' => array(
804
+ 'add_placeholder' => true,
805
+ ),
806
+ 'AMP_Gallery_Block_Sanitizer' => array( // Note: Gallery block sanitizer must come after image sanitizers since itś logic is using the already sanitized images.
807
+ 'carousel_required' => ! is_array( $theme_support_args ), // For back-compat.
808
+ ),
809
+ 'AMP_Block_Sanitizer' => array(), // Note: Block sanitizer must come after embed / media sanitizers since it's logic is using the already sanitized content.
810
+ 'AMP_Script_Sanitizer' => array(),
811
+ 'AMP_Style_Sanitizer' => array(
812
+ 'include_manifest_comment' => ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ? 'always' : 'when_excessive',
813
+ ),
814
+ 'AMP_Tag_And_Attribute_Sanitizer' => array(), // Note: This whitelist sanitizer must come at the end to clean up any remaining issues the other sanitizers didn't catch.
815
+ );
816
+
817
+ if ( ! empty( $theme_support_args['nav_menu_toggle'] ) ) {
818
+ $sanitizers['AMP_Nav_Menu_Toggle_Sanitizer'] = $theme_support_args['nav_menu_toggle'];
819
+ }
820
+
821
+ if ( ! empty( $theme_support_args['nav_menu_dropdown'] ) ) {
822
+ $sanitizers['AMP_Nav_Menu_Dropdown_Sanitizer'] = $theme_support_args['nav_menu_dropdown'];
823
+ }
824
+
825
  /**
826
  * Filters the content sanitizers.
827
  *
831
  * @param array $handlers Handlers.
832
  * @param WP_Post $post Post. Deprecated.
833
  */
834
+ $sanitizers = apply_filters( 'amp_content_sanitizers', $sanitizers, $post );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
835
 
836
  // Force style sanitizer and whitelist sanitizer to be at end.
837
  foreach ( array( 'AMP_Style_Sanitizer', 'AMP_Tag_And_Attribute_Sanitizer' ) as $class_name ) {
1041
  * Output schema.org metadata.
1042
  *
1043
  * @since 0.7
1044
+ * @since 1.1 we pass `JSON_UNESCAPED_UNICODE` to `wp_json_encode`.
1045
+ * @see https://github.com/ampproject/amp-wp/issues/1969
1046
  */
1047
  function amp_print_schemaorg_metadata() {
1048
  $metadata = amp_get_schemaorg_metadata();
1050
  return;
1051
  }
1052
  ?>
1053
+ <script type="application/ld+json"><?php echo wp_json_encode( $metadata, JSON_UNESCAPED_UNICODE ); ?></script>
1054
  <?php
1055
  }
1056
 
includes/amp-post-template-actions.php DELETED
@@ -1,139 +0,0 @@
1
- <?php
2
- /**
3
- * Callbacks for adding content to an AMP template.
4
- *
5
- * @todo Rename this file from amp-post-template-actions.php to amp-post-template-functions.php.
6
- * @package AMP
7
- */
8
-
9
- /**
10
- * Register hooks.
11
- */
12
- function amp_post_template_init_hooks() {
13
- add_action( 'amp_post_template_head', 'amp_post_template_add_title' );
14
- add_action( 'amp_post_template_head', 'amp_post_template_add_canonical' );
15
- add_action( 'amp_post_template_head', 'amp_post_template_add_scripts' );
16
- add_action( 'amp_post_template_head', 'amp_post_template_add_fonts' );
17
- add_action( 'amp_post_template_head', 'amp_post_template_add_boilerplate_css' );
18
- add_action( 'amp_post_template_head', 'amp_print_schemaorg_metadata' );
19
- add_action( 'amp_post_template_head', 'amp_add_generator_metadata' );
20
- add_action( 'amp_post_template_css', 'amp_post_template_add_styles', 99 );
21
- add_action( 'amp_post_template_data', 'amp_post_template_add_analytics_script' );
22
- add_action( 'amp_post_template_footer', 'amp_post_template_add_analytics_data' );
23
- }
24
-
25
- /**
26
- * Add title.
27
- *
28
- * @param AMP_Post_Template $amp_template template.
29
- */
30
- function amp_post_template_add_title( $amp_template ) {
31
- ?>
32
- <title><?php echo esc_html( $amp_template->get( 'document_title' ) ); ?></title>
33
- <?php
34
- }
35
-
36
- /**
37
- * Add canonical link.
38
- *
39
- * @param AMP_Post_Template $amp_template Template.
40
- */
41
- function amp_post_template_add_canonical( $amp_template ) {
42
- ?>
43
- <link rel="canonical" href="<?php echo esc_url( $amp_template->get( 'canonical_url' ) ); ?>" />
44
- <?php
45
- }
46
-
47
- /**
48
- * Print scripts.
49
- *
50
- * @see amp_register_default_scripts()
51
- * @see amp_filter_script_loader_tag()
52
- * @param AMP_Post_Template $amp_template Template.
53
- */
54
- function amp_post_template_add_scripts( $amp_template ) {
55
- echo amp_render_scripts( array_merge(
56
- array(
57
- // Just in case the runtime has been overridden by amp_post_template_data filter.
58
- 'amp-runtime' => $amp_template->get( 'amp_runtime_script' ),
59
- ),
60
- $amp_template->get( 'amp_component_scripts', array() )
61
- ) ); // WPCS: xss ok.
62
- }
63
-
64
- /**
65
- * Print fonts.
66
- *
67
- * @param AMP_Post_Template $amp_template Template.
68
- */
69
- function amp_post_template_add_fonts( $amp_template ) {
70
- $font_urls = $amp_template->get( 'font_urls', array() );
71
- foreach ( $font_urls as $slug => $url ) {
72
- printf( '<link rel="stylesheet" href="%s">', esc_url( esc_url( $url ) ) ); // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedStylesheet
73
- }
74
- }
75
-
76
- /**
77
- * Print boilerplate CSS.
78
- *
79
- * @since 0.3
80
- * @see amp_get_boilerplate_code()
81
- */
82
- function amp_post_template_add_boilerplate_css() {
83
- echo amp_get_boilerplate_code(); // WPCS: xss ok.
84
- }
85
-
86
- /**
87
- * Print Schema.org metadata.
88
- *
89
- * @deprecated Since 0.7
90
- */
91
- function amp_post_template_add_schemaorg_metadata() {
92
- _deprecated_function( __FUNCTION__, '0.7', 'amp_print_schemaorg_metadata' );
93
- amp_print_schemaorg_metadata();
94
- }
95
-
96
- /**
97
- * Print styles.
98
- *
99
- * @param AMP_Post_Template $amp_template Template.
100
- */
101
- function amp_post_template_add_styles( $amp_template ) {
102
- $stylesheets = $amp_template->get( 'post_amp_stylesheets' );
103
- if ( ! empty( $stylesheets ) ) {
104
- echo '/* Inline stylesheets */' . PHP_EOL; // WPCS: XSS OK.
105
- echo implode( '', $stylesheets ); // WPCS: XSS OK.
106
- }
107
-
108
- $styles = $amp_template->get( 'post_amp_styles' );
109
- if ( ! empty( $styles ) ) {
110
- echo '/* Inline styles */' . PHP_EOL; // WPCS: XSS OK.
111
- foreach ( $styles as $selector => $declarations ) {
112
- $declarations = implode( ';', $declarations ) . ';';
113
- printf( '%1$s{%2$s}', $selector, $declarations ); // WPCS: XSS OK.
114
- }
115
- }
116
- }
117
-
118
- /**
119
- * Add analytics scripts.
120
- *
121
- * @param array $data Data.
122
- * @return array Data.
123
- */
124
- function amp_post_template_add_analytics_script( $data ) {
125
- if ( ! empty( $data['amp_analytics'] ) ) {
126
- $data['amp_component_scripts']['amp-analytics'] = 'https://cdn.ampproject.org/v0/amp-analytics-0.1.js';
127
- }
128
- return $data;
129
- }
130
-
131
- /**
132
- * Print analytics data.
133
- *
134
- * @since 0.3.2
135
- */
136
- function amp_post_template_add_analytics_data() {
137
- $analytics = amp_add_custom_analytics();
138
- amp_print_analytics( $analytics );
139
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/amp-post-template-functions.php CHANGED
@@ -1,15 +1,142 @@
1
  <?php
 
 
 
 
 
2
 
3
- // Was only available in Customizer > 4.6
4
- if ( ! function_exists( 'sanitize_hex_color' ) ) {
5
- function sanitize_hex_color( $color ) {
6
- if ( '' === $color ) {
7
- return '';
8
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
 
10
- // 3 or 6 hex digits, or the empty string.
11
- if ( preg_match( '|^#([A-Fa-f0-9]{3}){1,2}$|', $color ) ) {
12
- return $color;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  }
14
  }
15
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
+ /**
3
+ * Callbacks for adding content to an AMP template.
4
+ *
5
+ * @package AMP
6
+ */
7
 
8
+ /**
9
+ * Register hooks.
10
+ */
11
+ function amp_post_template_init_hooks() {
12
+ add_action( 'amp_post_template_head', 'amp_post_template_add_title' );
13
+ add_action( 'amp_post_template_head', 'amp_post_template_add_canonical' );
14
+ add_action( 'amp_post_template_head', 'amp_post_template_add_scripts' );
15
+ add_action( 'amp_post_template_head', 'amp_post_template_add_fonts' );
16
+ add_action( 'amp_post_template_head', 'amp_post_template_add_boilerplate_css' );
17
+ add_action( 'amp_post_template_head', 'amp_print_schemaorg_metadata' );
18
+ add_action( 'amp_post_template_head', 'amp_add_generator_metadata' );
19
+ add_action( 'amp_post_template_head', 'wp_generator' );
20
+ add_action( 'amp_post_template_css', 'amp_post_template_add_styles', 99 );
21
+ add_action( 'amp_post_template_data', 'amp_post_template_add_analytics_script' );
22
+ add_action( 'amp_post_template_footer', 'amp_post_template_add_analytics_data' );
23
+ }
24
+
25
+ /**
26
+ * Add title.
27
+ *
28
+ * @param AMP_Post_Template $amp_template template.
29
+ */
30
+ function amp_post_template_add_title( $amp_template ) {
31
+ ?>
32
+ <title><?php echo esc_html( $amp_template->get( 'document_title' ) ); ?></title>
33
+ <?php
34
+ }
35
+
36
+ /**
37
+ * Add canonical link.
38
+ *
39
+ * @param AMP_Post_Template $amp_template Template.
40
+ */
41
+ function amp_post_template_add_canonical( $amp_template ) {
42
+ ?>
43
+ <link rel="canonical" href="<?php echo esc_url( $amp_template->get( 'canonical_url' ) ); ?>" />
44
+ <?php
45
+ }
46
+
47
+ /**
48
+ * Print scripts.
49
+ *
50
+ * @see amp_register_default_scripts()
51
+ * @see amp_filter_script_loader_tag()
52
+ * @param AMP_Post_Template $amp_template Template.
53
+ */
54
+ function amp_post_template_add_scripts( $amp_template ) {
55
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
56
+ echo amp_render_scripts(
57
+ array_merge(
58
+ array(
59
+ // Just in case the runtime has been overridden by amp_post_template_data filter.
60
+ 'amp-runtime' => $amp_template->get( 'amp_runtime_script' ),
61
+ ),
62
+ $amp_template->get( 'amp_component_scripts', array() )
63
+ )
64
+ );
65
+ }
66
+
67
+ /**
68
+ * Print fonts.
69
+ *
70
+ * @param AMP_Post_Template $amp_template Template.
71
+ */
72
+ function amp_post_template_add_fonts( $amp_template ) {
73
+ $font_urls = $amp_template->get( 'font_urls', array() );
74
+ foreach ( $font_urls as $slug => $url ) {
75
+ printf( '<link rel="stylesheet" href="%s">', esc_url( esc_url( $url ) ) ); // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedStylesheet
76
+ }
77
+ }
78
 
79
+ /**
80
+ * Print boilerplate CSS.
81
+ *
82
+ * @since 0.3
83
+ * @see amp_get_boilerplate_code()
84
+ */
85
+ function amp_post_template_add_boilerplate_css() {
86
+ echo amp_get_boilerplate_code(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
87
+ }
88
+
89
+ /**
90
+ * Print Schema.org metadata.
91
+ *
92
+ * @deprecated Since 0.7
93
+ */
94
+ function amp_post_template_add_schemaorg_metadata() {
95
+ _deprecated_function( __FUNCTION__, '0.7', 'amp_print_schemaorg_metadata' );
96
+ amp_print_schemaorg_metadata();
97
+ }
98
+
99
+ /**
100
+ * Print styles.
101
+ *
102
+ * @param AMP_Post_Template $amp_template Template.
103
+ */
104
+ function amp_post_template_add_styles( $amp_template ) {
105
+ $stylesheets = $amp_template->get( 'post_amp_stylesheets' );
106
+ if ( ! empty( $stylesheets ) ) {
107
+ echo '/* Inline stylesheets */' . PHP_EOL; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
108
+ echo implode( '', $stylesheets ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
109
+ }
110
+
111
+ $styles = $amp_template->get( 'post_amp_styles' );
112
+ if ( ! empty( $styles ) ) {
113
+ echo '/* Inline styles */' . PHP_EOL; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
114
+ foreach ( $styles as $selector => $declarations ) {
115
+ $declarations = implode( ';', $declarations ) . ';';
116
+ printf( '%1$s{%2$s}', $selector, $declarations ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
117
  }
118
  }
119
  }
120
+
121
+ /**
122
+ * Add analytics scripts.
123
+ *
124
+ * @param array $data Data.
125
+ * @return array Data.
126
+ */
127
+ function amp_post_template_add_analytics_script( $data ) {
128
+ if ( ! empty( $data['amp_analytics'] ) ) {
129
+ $data['amp_component_scripts']['amp-analytics'] = 'https://cdn.ampproject.org/v0/amp-analytics-0.1.js';
130
+ }
131
+ return $data;
132
+ }
133
+
134
+ /**
135
+ * Print analytics data.
136
+ *
137
+ * @since 0.3.2
138
+ */
139
+ function amp_post_template_add_analytics_data() {
140
+ $analytics = amp_add_custom_analytics();
141
+ amp_print_analytics( $analytics );
142
+ }
includes/class-amp-autoloader.php CHANGED
@@ -28,87 +28,83 @@ class AMP_Autoloader {
28
  *
29
  * @var string[]
30
  */
31
- private static $_classmap = array(
32
- 'AMP_Editor_Blocks' => 'includes/admin/class-amp-editor-blocks',
33
- 'AMP_Theme_Support' => 'includes/class-amp-theme-support',
34
- 'AMP_HTTP' => 'includes/class-amp-http',
35
- 'AMP_Comment_Walker' => 'includes/class-amp-comment-walker',
36
- 'AMP_Template_Customizer' => 'includes/admin/class-amp-customizer',
37
- 'AMP_Post_Meta_Box' => 'includes/admin/class-amp-post-meta-box',
38
- 'AMP_Admin_Pointer' => 'includes/admin/class-amp-admin-pointer',
39
- 'AMP_Post_Type_Support' => 'includes/class-amp-post-type-support',
40
- 'AMP_Base_Embed_Handler' => 'includes/embeds/class-amp-base-embed-handler',
41
- 'AMP_DailyMotion_Embed_Handler' => 'includes/embeds/class-amp-dailymotion-embed',
42
- 'AMP_Facebook_Embed_Handler' => 'includes/embeds/class-amp-facebook-embed',
43
- 'AMP_Gallery_Embed_Handler' => 'includes/embeds/class-amp-gallery-embed',
44
- 'AMP_Gfycat_Embed_Handler' => 'includes/embeds/class-amp-gfycat-embed-handler',
45
- 'AMP_Hulu_Embed_Handler' => 'includes/embeds/class-amp-hulu-embed-handler',
46
- 'AMP_Imgur_Embed_Handler' => 'includes/embeds/class-amp-imgur-embed-handler',
47
- 'AMP_Core_Block_Handler' => 'includes/embeds/class-amp-core-block-handler',
48
- 'AMP_Instagram_Embed_Handler' => 'includes/embeds/class-amp-instagram-embed',
49
- 'AMP_Issuu_Embed_Handler' => 'includes/embeds/class-amp-issuu-embed-handler',
50
- 'AMP_Meetup_Embed_Handler' => 'includes/embeds/class-amp-meetup-embed-handler',
51
- 'AMP_Pinterest_Embed_Handler' => 'includes/embeds/class-amp-pinterest-embed',
52
- 'AMP_Playlist_Embed_Handler' => 'includes/embeds/class-amp-playlist-embed-handler',
53
- 'AMP_Reddit_Embed_Handler' => 'includes/embeds/class-amp-reddit-embed-handler',
54
- 'AMP_SoundCloud_Embed_Handler' => 'includes/embeds/class-amp-soundcloud-embed',
55
- 'AMP_Tumblr_Embed_Handler' => 'includes/embeds/class-amp-tumblr-embed-handler',
56
- 'AMP_Twitter_Embed_Handler' => 'includes/embeds/class-amp-twitter-embed',
57
- 'AMP_Vimeo_Embed_Handler' => 'includes/embeds/class-amp-vimeo-embed',
58
- 'AMP_Vine_Embed_Handler' => 'includes/embeds/class-amp-vine-embed',
59
- 'AMP_YouTube_Embed_Handler' => 'includes/embeds/class-amp-youtube-embed',
60
- 'FastImage' => 'third_party/fastimage/class-fastimage',
61
- 'WillWashburn\Stream\Exception\StreamBufferTooSmallException' => 'third_party/fasterimage/Stream/Exception/StreamBufferTooSmallException',
62
- 'WillWashburn\Stream\StreamableInterface' => 'third_party/fasterimage/Stream/StreamableInterface',
63
- 'WillWashburn\Stream\Stream' => 'third_party/fasterimage/Stream/Stream',
64
- 'FasterImage\Exception\InvalidImageException' => 'third_party/fasterimage/Exception/InvalidImageException',
65
- 'FasterImage\ExifParser' => 'third_party/fasterimage/ExifParser',
66
- 'FasterImage\ImageParser' => 'third_party/fasterimage/ImageParser',
67
- 'FasterImage\FasterImage' => 'third_party/fasterimage/FasterImage',
68
- 'AMP_Analytics_Options_Submenu' => 'includes/options/class-amp-analytics-options-submenu',
69
- 'AMP_Options_Menu' => 'includes/options/class-amp-options-menu',
70
- 'AMP_Options_Manager' => 'includes/options/class-amp-options-manager',
71
- 'AMP_Analytics_Options_Submenu_Page' => 'includes/options/views/class-amp-analytics-options-submenu-page',
72
- 'AMP_Options_Menu_Page' => 'includes/options/views/class-amp-options-menu-page',
73
- 'AMP_Rule_Spec' => 'includes/sanitizers/class-amp-rule-spec',
74
- 'AMP_Allowed_Tags_Generated' => 'includes/sanitizers/class-amp-allowed-tags-generated',
75
- 'AMP_Audio_Sanitizer' => 'includes/sanitizers/class-amp-audio-sanitizer',
76
- 'AMP_Base_Sanitizer' => 'includes/sanitizers/class-amp-base-sanitizer',
77
- 'AMP_Blacklist_Sanitizer' => 'includes/sanitizers/class-amp-blacklist-sanitizer',
78
- 'AMP_Block_Sanitizer' => 'includes/sanitizers/class-amp-block-sanitizer',
79
- 'AMP_Gallery_Block_Sanitizer' => 'includes/sanitizers/class-amp-gallery-block-sanitizer',
80
- 'AMP_Iframe_Sanitizer' => 'includes/sanitizers/class-amp-iframe-sanitizer',
81
- 'AMP_Img_Sanitizer' => 'includes/sanitizers/class-amp-img-sanitizer',
82
- 'AMP_Comments_Sanitizer' => 'includes/sanitizers/class-amp-comments-sanitizer',
83
- 'AMP_Form_Sanitizer' => 'includes/sanitizers/class-amp-form-sanitizer',
84
- 'AMP_O2_Player_Sanitizer' => 'includes/sanitizers/class-amp-o2-player-sanitizer',
85
- 'AMP_Playbuzz_Sanitizer' => 'includes/sanitizers/class-amp-playbuzz-sanitizer',
86
- 'AMP_Style_Sanitizer' => 'includes/sanitizers/class-amp-style-sanitizer',
87
- 'AMP_Script_Sanitizer' => 'includes/sanitizers/class-amp-script-sanitizer',
88
- 'AMP_Embed_Sanitizer' => 'includes/sanitizers/class-amp-embed-sanitizer',
89
- 'AMP_Tag_And_Attribute_Sanitizer' => 'includes/sanitizers/class-amp-tag-and-attribute-sanitizer',
90
- 'AMP_Video_Sanitizer' => 'includes/sanitizers/class-amp-video-sanitizer',
91
- 'AMP_Core_Theme_Sanitizer' => 'includes/sanitizers/class-amp-core-theme-sanitizer',
92
- 'AMP_Customizer_Design_Settings' => 'includes/settings/class-amp-customizer-design-settings',
93
- 'AMP_Customizer_Settings' => 'includes/settings/class-amp-customizer-settings',
94
- 'AMP_Content' => 'includes/templates/class-amp-content',
95
- 'AMP_Content_Sanitizer' => 'includes/templates/class-amp-content-sanitizer',
96
- 'AMP_Post_Template' => 'includes/templates/class-amp-post-template',
97
- 'AMP_DOM_Utils' => 'includes/utils/class-amp-dom-utils',
98
- 'AMP_HTML_Utils' => 'includes/utils/class-amp-html-utils',
99
- 'AMP_Image_Dimension_Extractor' => 'includes/utils/class-amp-image-dimension-extractor',
100
- 'AMP_Validation_Manager' => 'includes/validation/class-amp-validation-manager',
101
- 'AMP_Validated_URL_Post_Type' => 'includes/validation/class-amp-validated-url-post-type',
102
- 'AMP_Validation_Error_Taxonomy' => 'includes/validation/class-amp-validation-error-taxonomy',
103
- 'AMP_CLI' => 'includes/class-amp-cli',
104
- 'AMP_String_Utils' => 'includes/utils/class-amp-string-utils',
105
- 'AMP_WP_Utils' => 'includes/utils/class-amp-wp-utils',
106
- 'AMP_Widget_Archives' => 'includes/widgets/class-amp-widget-archives',
107
- 'AMP_Widget_Categories' => 'includes/widgets/class-amp-widget-categories',
108
- 'AMP_Widget_Text' => 'includes/widgets/class-amp-widget-text',
109
- 'WPCOM_AMP_Polldaddy_Embed' => 'wpcom/class-amp-polldaddy-embed',
110
- 'AMP_Test_Stub_Sanitizer' => 'tests/stubs',
111
- 'AMP_Test_World_Sanitizer' => 'tests/stubs',
112
  );
113
 
114
  /**
@@ -128,10 +124,10 @@ class AMP_Autoloader {
128
  * @param string $class_name Class name.
129
  */
130
  protected static function autoload( $class_name ) {
131
- if ( ! isset( self::$_classmap[ $class_name ] ) ) {
132
  return;
133
  }
134
- $filepath = self::$_classmap[ $class_name ];
135
  require AMP__DIR__ . "/{$filepath}.php";
136
  }
137
 
@@ -162,6 +158,6 @@ class AMP_Autoloader {
162
  * @param string $filepath Absolute filepath to class file, including .php extension.
163
  */
164
  public static function register_autoload_class( $class_name, $filepath ) {
165
- self::$_classmap[ $class_name ] = '!' . $filepath;
166
  }
167
  }
28
  *
29
  * @var string[]
30
  */
31
+ private static $classmap = array(
32
+ 'AMP_Editor_Blocks' => 'includes/admin/class-amp-editor-blocks',
33
+ 'AMP_Theme_Support' => 'includes/class-amp-theme-support',
34
+ 'AMP_Service_Worker' => 'includes/class-amp-service-worker',
35
+ 'AMP_HTTP' => 'includes/class-amp-http',
36
+ 'AMP_Comment_Walker' => 'includes/class-amp-comment-walker',
37
+ 'AMP_Template_Customizer' => 'includes/admin/class-amp-customizer',
38
+ 'AMP_Post_Meta_Box' => 'includes/admin/class-amp-post-meta-box',
39
+ 'AMP_Admin_Pointer' => 'includes/admin/class-amp-admin-pointer',
40
+ 'AMP_Post_Type_Support' => 'includes/class-amp-post-type-support',
41
+ 'AMP_Base_Embed_Handler' => 'includes/embeds/class-amp-base-embed-handler',
42
+ 'AMP_DailyMotion_Embed_Handler' => 'includes/embeds/class-amp-dailymotion-embed',
43
+ 'AMP_Facebook_Embed_Handler' => 'includes/embeds/class-amp-facebook-embed',
44
+ 'AMP_Gallery_Embed_Handler' => 'includes/embeds/class-amp-gallery-embed',
45
+ 'AMP_Gfycat_Embed_Handler' => 'includes/embeds/class-amp-gfycat-embed-handler',
46
+ 'AMP_Hulu_Embed_Handler' => 'includes/embeds/class-amp-hulu-embed-handler',
47
+ 'AMP_Imgur_Embed_Handler' => 'includes/embeds/class-amp-imgur-embed-handler',
48
+ 'AMP_Core_Block_Handler' => 'includes/embeds/class-amp-core-block-handler',
49
+ 'AMP_Instagram_Embed_Handler' => 'includes/embeds/class-amp-instagram-embed',
50
+ 'AMP_Issuu_Embed_Handler' => 'includes/embeds/class-amp-issuu-embed-handler',
51
+ 'AMP_Meetup_Embed_Handler' => 'includes/embeds/class-amp-meetup-embed-handler',
52
+ 'AMP_Pinterest_Embed_Handler' => 'includes/embeds/class-amp-pinterest-embed',
53
+ 'AMP_Playlist_Embed_Handler' => 'includes/embeds/class-amp-playlist-embed-handler',
54
+ 'AMP_Reddit_Embed_Handler' => 'includes/embeds/class-amp-reddit-embed-handler',
55
+ 'AMP_SoundCloud_Embed_Handler' => 'includes/embeds/class-amp-soundcloud-embed',
56
+ 'AMP_Tumblr_Embed_Handler' => 'includes/embeds/class-amp-tumblr-embed-handler',
57
+ 'AMP_Twitter_Embed_Handler' => 'includes/embeds/class-amp-twitter-embed',
58
+ 'AMP_Vimeo_Embed_Handler' => 'includes/embeds/class-amp-vimeo-embed',
59
+ 'AMP_Vine_Embed_Handler' => 'includes/embeds/class-amp-vine-embed',
60
+ 'AMP_YouTube_Embed_Handler' => 'includes/embeds/class-amp-youtube-embed',
61
+ 'AMP_Analytics_Options_Submenu' => 'includes/options/class-amp-analytics-options-submenu',
62
+ 'AMP_Options_Menu' => 'includes/options/class-amp-options-menu',
63
+ 'AMP_Options_Manager' => 'includes/options/class-amp-options-manager',
64
+ 'AMP_Analytics_Options_Submenu_Page' => 'includes/options/views/class-amp-analytics-options-submenu-page',
65
+ 'AMP_Options_Menu_Page' => 'includes/options/views/class-amp-options-menu-page',
66
+ 'AMP_Rule_Spec' => 'includes/sanitizers/class-amp-rule-spec',
67
+ 'AMP_Allowed_Tags_Generated' => 'includes/sanitizers/class-amp-allowed-tags-generated',
68
+ 'AMP_Audio_Sanitizer' => 'includes/sanitizers/class-amp-audio-sanitizer',
69
+ 'AMP_Base_Sanitizer' => 'includes/sanitizers/class-amp-base-sanitizer',
70
+ 'AMP_Blacklist_Sanitizer' => 'includes/sanitizers/class-amp-blacklist-sanitizer',
71
+ 'AMP_Block_Sanitizer' => 'includes/sanitizers/class-amp-block-sanitizer',
72
+ 'AMP_Gallery_Block_Sanitizer' => 'includes/sanitizers/class-amp-gallery-block-sanitizer',
73
+ 'AMP_Iframe_Sanitizer' => 'includes/sanitizers/class-amp-iframe-sanitizer',
74
+ 'AMP_Img_Sanitizer' => 'includes/sanitizers/class-amp-img-sanitizer',
75
+ 'AMP_Nav_Menu_Toggle_Sanitizer' => 'includes/sanitizers/class-amp-nav-menu-toggle-sanitizer',
76
+ 'AMP_Nav_Menu_Dropdown_Sanitizer' => 'includes/sanitizers/class-amp-nav-menu-dropdown-sanitizer',
77
+ 'AMP_Comments_Sanitizer' => 'includes/sanitizers/class-amp-comments-sanitizer',
78
+ 'AMP_Form_Sanitizer' => 'includes/sanitizers/class-amp-form-sanitizer',
79
+ 'AMP_O2_Player_Sanitizer' => 'includes/sanitizers/class-amp-o2-player-sanitizer',
80
+ 'AMP_Playbuzz_Sanitizer' => 'includes/sanitizers/class-amp-playbuzz-sanitizer',
81
+ 'AMP_Style_Sanitizer' => 'includes/sanitizers/class-amp-style-sanitizer',
82
+ 'AMP_Script_Sanitizer' => 'includes/sanitizers/class-amp-script-sanitizer',
83
+ 'AMP_Embed_Sanitizer' => 'includes/sanitizers/class-amp-embed-sanitizer',
84
+ 'AMP_Tag_And_Attribute_Sanitizer' => 'includes/sanitizers/class-amp-tag-and-attribute-sanitizer',
85
+ 'AMP_Video_Sanitizer' => 'includes/sanitizers/class-amp-video-sanitizer',
86
+ 'AMP_Core_Theme_Sanitizer' => 'includes/sanitizers/class-amp-core-theme-sanitizer',
87
+ 'AMP_Noscript_Fallback' => 'includes/sanitizers/trait-amp-noscript-fallback',
88
+ 'AMP_Customizer_Design_Settings' => 'includes/settings/class-amp-customizer-design-settings',
89
+ 'AMP_Customizer_Settings' => 'includes/settings/class-amp-customizer-settings',
90
+ 'AMP_Content' => 'includes/templates/class-amp-content',
91
+ 'AMP_Content_Sanitizer' => 'includes/templates/class-amp-content-sanitizer',
92
+ 'AMP_Post_Template' => 'includes/templates/class-amp-post-template',
93
+ 'AMP_DOM_Utils' => 'includes/utils/class-amp-dom-utils',
94
+ 'AMP_HTML_Utils' => 'includes/utils/class-amp-html-utils',
95
+ 'AMP_Image_Dimension_Extractor' => 'includes/utils/class-amp-image-dimension-extractor',
96
+ 'AMP_Validation_Manager' => 'includes/validation/class-amp-validation-manager',
97
+ 'AMP_Validated_URL_Post_Type' => 'includes/validation/class-amp-validated-url-post-type',
98
+ 'AMP_Validation_Error_Taxonomy' => 'includes/validation/class-amp-validation-error-taxonomy',
99
+ 'AMP_CLI' => 'includes/class-amp-cli',
100
+ 'AMP_String_Utils' => 'includes/utils/class-amp-string-utils',
101
+ 'AMP_WP_Utils' => 'includes/utils/class-amp-wp-utils',
102
+ 'AMP_Widget_Archives' => 'includes/widgets/class-amp-widget-archives',
103
+ 'AMP_Widget_Categories' => 'includes/widgets/class-amp-widget-categories',
104
+ 'AMP_Widget_Text' => 'includes/widgets/class-amp-widget-text',
105
+ 'WPCOM_AMP_Polldaddy_Embed' => 'wpcom/class-amp-polldaddy-embed',
106
+ 'AMP_Test_Stub_Sanitizer' => 'tests/stubs',
107
+ 'AMP_Test_World_Sanitizer' => 'tests/stubs',
 
 
 
 
108
  );
109
 
110
  /**
124
  * @param string $class_name Class name.
125
  */
126
  protected static function autoload( $class_name ) {
127
+ if ( ! isset( self::$classmap[ $class_name ] ) ) {
128
  return;
129
  }
130
+ $filepath = self::$classmap[ $class_name ];
131
  require AMP__DIR__ . "/{$filepath}.php";
132
  }
133
 
158
  * @param string $filepath Absolute filepath to class file, including .php extension.
159
  */
160
  public static function register_autoload_class( $class_name, $filepath ) {
161
+ self::$classmap[ $class_name ] = '!' . $filepath;
162
  }
163
  }
includes/class-amp-cli.php CHANGED
@@ -180,8 +180,7 @@ class AMP_CLI {
180
  } else {
181
  WP_CLI::error(
182
  sprintf(
183
- /* translators: %s is the flag to force validation */
184
- __( 'The current template mode is Classic, which does not allow crawling the site. Please pass the --%s flag in order to force crawling for validation.', 'amp' ),
185
  self::FLAG_NAME_FORCE_VALIDATION
186
  )
187
  );
@@ -193,35 +192,32 @@ class AMP_CLI {
193
  if ( ! empty( self::$include_conditionals ) ) {
194
  WP_CLI::error(
195
  sprintf(
196
- /* translators: %s is the command line argument to include certain templates */
197
- __( 'The templates passed via the --%s argument did not match any URLs. You might try passing different templates to it.', 'amp' ),
198
  self::INCLUDE_ARGUMENT
199
  )
200
  );
201
  } else {
202
  WP_CLI::error(
203
  sprintf(
204
- /* translators: %s is the command line argument to force validation */
205
- __( 'All of your templates might be unchecked in AMP Settings > Supported Templates. You might pass --%s to this command.', 'amp' ),
206
  self::FLAG_NAME_FORCE_VALIDATION
207
  )
208
  );
209
  }
210
  }
211
 
212
- WP_CLI::log( __( 'Crawling the site for AMP validity.', 'amp' ) );
213
 
214
  self::$wp_cli_progress = WP_CLI\Utils\make_progress_bar(
215
- /* translators: %d is the number of URLs */
216
- sprintf( __( 'Validating %d URLs...', 'amp' ), $number_urls_to_crawl ),
217
  $number_urls_to_crawl
218
  );
219
  self::crawl_site();
220
  self::$wp_cli_progress->finish();
221
 
222
- $key_template_type = __( 'Template or content type', 'amp' );
223
- $key_url_count = __( 'URL Count', 'amp' );
224
- $key_validity_rate = __( 'Validity Rate', 'amp' );
225
 
226
  $table_validation_by_type = array();
227
  foreach ( self::$validity_by_type as $type_name => $validity ) {
@@ -233,14 +229,13 @@ class AMP_CLI {
233
  }
234
 
235
  if ( empty( $table_validation_by_type ) ) {
236
- WP_CLI::error( __( 'No validation results were obtained from the URLs.', 'amp' ) );
237
  return;
238
  }
239
 
240
  WP_CLI::success(
241
  sprintf(
242
- /* translators: $1%d is the number of URls crawled, $2%d is the number of validation issues, $3%d is the number of unaccepted issues, $4%s is the list of validation by type, $5%s is the link for more details */
243
- __( '%3$d crawled URLs have unaccepted issue(s) out of %2$d total with AMP validation issue(s); %1$d URLs were crawled.', 'amp' ),
244
  self::$number_crawled,
245
  self::$total_errors,
246
  self::$unaccepted_errors
@@ -259,8 +254,7 @@ class AMP_CLI {
259
  AMP_Validated_URL_Post_Type::POST_TYPE_SLUG,
260
  admin_url( 'edit.php' )
261
  );
262
- /* translators: %s is the URL to the admin */
263
- WP_CLI::line( sprintf( __( 'For more details, please see: %s', 'amp' ), $url_more_details ) );
264
  }
265
 
266
  /**
@@ -293,8 +287,7 @@ class AMP_CLI {
293
  $posts = new WP_CLI\Iterators\Query( $query, 10000 );
294
 
295
  $progress = WP_CLI\Utils\make_progress_bar(
296
- /* translators: %d is the number of posts */
297
- sprintf( __( 'Deleting %d amp_validated_url posts...', 'amp' ), $count ),
298
  $count
299
  );
300
  while ( $posts->valid() ) {
@@ -311,8 +304,7 @@ class AMP_CLI {
311
  $terms = new WP_CLI\Iterators\Query( $query, 10000 );
312
 
313
  $progress = WP_CLI\Utils\make_progress_bar(
314
- /* translators: %d is the number of terms */
315
- sprintf( __( 'Deleting %d amp_taxonomy_error terms...', 'amp' ), $count ),
316
  $count
317
  );
318
  while ( $terms->valid() ) {
@@ -350,11 +342,13 @@ class AMP_CLI {
350
 
351
  // Count all public taxonomy terms.
352
  foreach ( $amp_enabled_taxonomies as $taxonomy ) {
353
- $term_query = new WP_Term_Query( array(
354
- 'taxonomy' => $taxonomy,
355
- 'fields' => 'ids',
356
- 'number' => self::$limit_type_validate_count,
357
- ) );
 
 
358
 
359
  // If $term_query->terms is an empty array, passing it to count() will throw an error.
360
  $total_count += ! empty( $term_query->terms ) ? count( $term_query->terms ) : 0;
@@ -631,8 +625,7 @@ class AMP_CLI {
631
  * One cause of an error is if the validation request results in a 404 response code.
632
  */
633
  if ( is_wp_error( $validity ) ) {
634
- /* translators: %1$s is error code, %2$s is error message, and %3$s is the actual URL. */
635
- WP_CLI::warning( sprintf( __( 'Validate URL error (%1$s): %2$s URL: %3$s', 'amp' ), $validity->get_error_code(), $validity->get_error_message(), $url ) );
636
  return;
637
  }
638
  if ( self::$wp_cli_progress ) {
@@ -645,17 +638,19 @@ class AMP_CLI {
645
  $validity['url'],
646
  wp_array_slice_assoc( $validity, array( 'queried_object' ) )
647
  );
648
- $unaccepted_error_count = count( array_filter(
649
- $validation_errors,
650
- function( $error ) {
651
- $validation_status = AMP_Validation_Error_Taxonomy::get_validation_error_sanitization( $error );
652
- return (
 
653
  AMP_Validation_Error_Taxonomy::VALIDATION_ERROR_ACK_ACCEPTED_STATUS !== $validation_status['term_status']
654
  &&
655
  AMP_Validation_Error_Taxonomy::VALIDATION_ERROR_NEW_ACCEPTED_STATUS !== $validation_status['term_status']
656
- );
657
- }
658
- ) );
 
659
 
660
  if ( count( $validation_errors ) > 0 ) {
661
  self::$total_errors++;
180
  } else {
181
  WP_CLI::error(
182
  sprintf(
183
+ 'Your templates are currently in Reader mode, which does not allow crawling the site. Please pass the --%s flag in order to force crawling for validation.',
 
184
  self::FLAG_NAME_FORCE_VALIDATION
185
  )
186
  );
192
  if ( ! empty( self::$include_conditionals ) ) {
193
  WP_CLI::error(
194
  sprintf(
195
+ 'The templates passed via the --%s argument did not match any URLs. You might try passing different templates to it.',
 
196
  self::INCLUDE_ARGUMENT
197
  )
198
  );
199
  } else {
200
  WP_CLI::error(
201
  sprintf(
202
+ 'All of your templates might be unchecked in AMP Settings > Supported Templates. You might pass --%s to this command.',
 
203
  self::FLAG_NAME_FORCE_VALIDATION
204
  )
205
  );
206
  }
207
  }
208
 
209
+ WP_CLI::log( 'Crawling the site for AMP validity.' );
210
 
211
  self::$wp_cli_progress = WP_CLI\Utils\make_progress_bar(
212
+ sprintf( 'Validating %d URLs...', $number_urls_to_crawl ),
 
213
  $number_urls_to_crawl
214
  );
215
  self::crawl_site();
216
  self::$wp_cli_progress->finish();
217
 
218
+ $key_template_type = 'Template or content type';
219
+ $key_url_count = 'URL Count';
220
+ $key_validity_rate = 'Validity Rate';
221
 
222
  $table_validation_by_type = array();
223
  foreach ( self::$validity_by_type as $type_name => $validity ) {
229
  }
230
 
231
  if ( empty( $table_validation_by_type ) ) {
232
+ WP_CLI::error( 'No validation results were obtained from the URLs.' );
233
  return;
234
  }
235
 
236
  WP_CLI::success(
237
  sprintf(
238
+ '%3$d crawled URLs have unaccepted issue(s) out of %2$d total with AMP validation issue(s); %1$d URLs were crawled.',
 
239
  self::$number_crawled,
240
  self::$total_errors,
241
  self::$unaccepted_errors
254
  AMP_Validated_URL_Post_Type::POST_TYPE_SLUG,
255
  admin_url( 'edit.php' )
256
  );
257
+ WP_CLI::line( sprintf( 'For more details, please see: %s', $url_more_details ) );
 
258
  }
259
 
260
  /**
287
  $posts = new WP_CLI\Iterators\Query( $query, 10000 );
288
 
289
  $progress = WP_CLI\Utils\make_progress_bar(
290
+ sprintf( 'Deleting %d amp_validated_url posts...', $count ),
 
291
  $count
292
  );
293
  while ( $posts->valid() ) {
304
  $terms = new WP_CLI\Iterators\Query( $query, 10000 );
305
 
306
  $progress = WP_CLI\Utils\make_progress_bar(
307
+ sprintf( 'Deleting %d amp_taxonomy_error terms...', $count ),
 
308
  $count
309
  );
310
  while ( $terms->valid() ) {
342
 
343
  // Count all public taxonomy terms.
344
  foreach ( $amp_enabled_taxonomies as $taxonomy ) {
345
+ $term_query = new WP_Term_Query(
346
+ array(
347
+ 'taxonomy' => $taxonomy,
348
+ 'fields' => 'ids',
349
+ 'number' => self::$limit_type_validate_count,
350
+ )
351
+ );
352
 
353
  // If $term_query->terms is an empty array, passing it to count() will throw an error.
354
  $total_count += ! empty( $term_query->terms ) ? count( $term_query->terms ) : 0;
625
  * One cause of an error is if the validation request results in a 404 response code.
626
  */
627
  if ( is_wp_error( $validity ) ) {
628
+ WP_CLI::warning( sprintf( 'Validate URL error (%1$s): %2$s URL: %3$s', $validity->get_error_code(), $validity->get_error_message(), $url ) );
 
629
  return;
630
  }
631
  if ( self::$wp_cli_progress ) {
638
  $validity['url'],
639
  wp_array_slice_assoc( $validity, array( 'queried_object' ) )
640
  );
641
+ $unaccepted_error_count = count(
642
+ array_filter(
643
+ $validation_errors,
644
+ function( $error ) {
645
+ $validation_status = AMP_Validation_Error_Taxonomy::get_validation_error_sanitization( $error );
646
+ return (
647
  AMP_Validation_Error_Taxonomy::VALIDATION_ERROR_ACK_ACCEPTED_STATUS !== $validation_status['term_status']
648
  &&
649
  AMP_Validation_Error_Taxonomy::VALIDATION_ERROR_NEW_ACCEPTED_STATUS !== $validation_status['term_status']
650
+ );
651
+ }
652
+ )
653
+ );
654
 
655
  if ( count( $validation_errors ) > 0 ) {
656
  self::$total_errors++;
includes/class-amp-comment-walker.php CHANGED
@@ -2,13 +2,18 @@
2
  /**
3
  * Class AMP_Comment_Walker
4
  *
 
5
  * @package AMP
6
  */
7
 
 
 
8
  /**
9
  * Class AMP_Comment_Walker
10
  *
11
  * Walker to wrap comments in mustache tags for amp-template.
 
 
12
  */
13
  class AMP_Comment_Walker extends Walker_Comment {
14
 
@@ -21,7 +26,7 @@ class AMP_Comment_Walker extends Walker_Comment {
21
  public $args;
22
 
23
  /**
24
- * Holds the timestamp of the most reacent comment in a thread.
25
  *
26
  * @since 0.7
27
  * @var array
2
  /**
3
  * Class AMP_Comment_Walker
4
  *
5
+ * @deprecated 1.1.0 This functionality was moved to AMP_Comments_Sanitizer
6
  * @package AMP
7
  */
8
 
9
+ _deprecated_file( __FILE__, '1.1', null, esc_html__( 'AMP_Comment_Walker functionality has been moved to AMP_Comments_Sanitizer.', 'amp' ) );
10
+
11
  /**
12
  * Class AMP_Comment_Walker
13
  *
14
  * Walker to wrap comments in mustache tags for amp-template.
15
+ *
16
+ * @deprecated 1.1.0 This functionality was moved to AMP_Comments_Sanitizer
17
  */
18
  class AMP_Comment_Walker extends Walker_Comment {
19
 
26
  public $args;
27
 
28
  /**
29
+ * Holds the timestamp of the most recent comment in a thread.
30
  *
31
  * @since 0.7
32
  * @var array
includes/class-amp-http.php CHANGED
@@ -122,11 +122,11 @@ class AMP_HTTP {
122
 
123
  // Scrub input vars.
124
  foreach ( $query_vars as $query_var ) {
125
- if ( ! isset( $_GET[ $query_var ] ) ) { // phpcs:ignore
126
  continue;
127
  }
128
- self::$purged_amp_query_vars[ $query_var ] = wp_unslash( $_GET[ $query_var ] ); // phpcs:ignore
129
- unset( $_REQUEST[ $query_var ], $_GET[ $query_var ] );
130
  $scrubbed = true;
131
  }
132
 
@@ -188,10 +188,12 @@ class AMP_HTTP {
188
  $hosts[] = 'cdn.ampproject.org';
189
 
190
  // From the publisher’s own origins.
191
- $domains = array_unique( array(
192
- wp_parse_url( site_url(), PHP_URL_HOST ),
193
- wp_parse_url( home_url(), PHP_URL_HOST ),
194
- ) );
 
 
195
 
196
  /*
197
  * From AMP docs:
@@ -201,11 +203,9 @@ class AMP_HTTP {
201
  */
202
  foreach ( $domains as $domain ) {
203
  if ( function_exists( 'idn_to_utf8' ) ) {
204
- if ( version_compare( PHP_VERSION, '5.4', '>=' ) && defined( 'INTL_IDNA_VARIANT_UTS46' ) ) {
205
- $domain = idn_to_utf8( $domain, IDNA_DEFAULT, INTL_IDNA_VARIANT_UTS46 ); // phpcs:ignore PHPCompatibility.PHP.NewFunctionParameters.idn_to_utf8_variantFound, PHPCompatibility.PHP.NewConstants.intl_idna_variant_uts46Found
206
- } else {
207
- $domain = idn_to_utf8( $domain );
208
- }
209
  }
210
  $subdomain = str_replace( '-', '--', $domain );
211
  $subdomain = str_replace( '.', '-', $subdomain );
@@ -302,9 +302,12 @@ class AMP_HTTP {
302
  add_filter( 'comment_post_redirect', array( __CLASS__, 'filter_comment_post_redirect' ), PHP_INT_MAX, 2 );
303
 
304
  // Add die handler for AMP error display, most likely due to problem with comment.
305
- add_filter( 'wp_die_handler', function () {
306
- return array( __CLASS__, 'handle_wp_die' );
307
- } );
 
 
 
308
  }
309
 
310
  /**
@@ -386,9 +389,11 @@ class AMP_HTTP {
386
  }
387
 
388
  // Message will be shown in template defined by AMP_Theme_Support::amend_comment_form().
389
- wp_send_json( array(
390
- 'error' => amp_wp_kses_mustache( $error ),
391
- ) );
 
 
392
  }
393
 
394
  /**
@@ -421,7 +426,7 @@ class AMP_HTTP {
421
  if ( '1' === (string) $comment->comment_approved ) {
422
  $message = __( 'Your comment has been posted.', 'amp' );
423
  } else {
424
- $message = __( 'Your comment is awaiting moderation.', 'default' ); // Note core string re-use.
425
  }
426
 
427
  /**
@@ -432,9 +437,11 @@ class AMP_HTTP {
432
  $message = apply_filters( 'amp_comment_posted_message', $message, $comment );
433
 
434
  // Message will be shown in template defined by AMP_Theme_Support::amend_comment_form().
435
- wp_send_json( array(
436
- 'message' => amp_wp_kses_mustache( $message ),
437
- ) );
 
 
438
 
439
  return null;
440
  }
122
 
123
  // Scrub input vars.
124
  foreach ( $query_vars as $query_var ) {
125
+ if ( ! isset( $_GET[ $query_var ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
126
  continue;
127
  }
128
+ self::$purged_amp_query_vars[ $query_var ] = wp_unslash( $_GET[ $query_var ] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
129
+ unset( $_REQUEST[ $query_var ], $_GET[ $query_var ] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
130
  $scrubbed = true;
131
  }
132
 
188
  $hosts[] = 'cdn.ampproject.org';
189
 
190
  // From the publisher’s own origins.
191
+ $domains = array_unique(
192
+ array(
193
+ wp_parse_url( site_url(), PHP_URL_HOST ),
194
+ wp_parse_url( home_url(), PHP_URL_HOST ),
195
+ )
196
+ );
197
 
198
  /*
199
  * From AMP docs:
203
  */
204
  foreach ( $domains as $domain ) {
205
  if ( function_exists( 'idn_to_utf8' ) ) {
206
+ // The third parameter is set explicitly to prevent issues with newer PHP versions compiled with an old ICU version.
207
+ // phpcs:ignore PHPCompatibility.Constants.RemovedConstants.intl_idna_variant_2003Deprecated
208
+ $domain = idn_to_utf8( $domain, IDNA_DEFAULT, defined( 'INTL_IDNA_VARIANT_UTS46' ) ? INTL_IDNA_VARIANT_UTS46 : INTL_IDNA_VARIANT_2003 );
 
 
209
  }
210
  $subdomain = str_replace( '-', '--', $domain );
211
  $subdomain = str_replace( '.', '-', $subdomain );
302
  add_filter( 'comment_post_redirect', array( __CLASS__, 'filter_comment_post_redirect' ), PHP_INT_MAX, 2 );
303
 
304
  // Add die handler for AMP error display, most likely due to problem with comment.
305
+ add_filter(
306
+ 'wp_die_handler',
307
+ function () {
308
+ return array( __CLASS__, 'handle_wp_die' );
309
+ }
310
+ );
311
  }
312
 
313
  /**
389
  }
390
 
391
  // Message will be shown in template defined by AMP_Theme_Support::amend_comment_form().
392
+ wp_send_json(
393
+ array(
394
+ 'error' => amp_wp_kses_mustache( $error ),
395
+ )
396
+ );
397
  }
398
 
399
  /**
426
  if ( '1' === (string) $comment->comment_approved ) {
427
  $message = __( 'Your comment has been posted.', 'amp' );
428
  } else {
429
+ $message = __( 'Your comment is awaiting moderation.', 'amp' );
430
  }
431
 
432
  /**
437
  $message = apply_filters( 'amp_comment_posted_message', $message, $comment );
438
 
439
  // Message will be shown in template defined by AMP_Theme_Support::amend_comment_form().
440
+ wp_send_json(
441
+ array(
442
+ 'message' => amp_wp_kses_mustache( $message ),
443
+ )
444
+ );
445
 
446
  return null;
447
  }
includes/class-amp-post-type-support.php CHANGED
@@ -36,12 +36,14 @@ class AMP_Post_Type_Support {
36
  * @return string[] Post types eligible for AMP.
37
  */
38
  public static function get_eligible_post_types() {
39
- return array_values( get_post_types(
40
- array(
41
- 'public' => true,
42
- ),
43
- 'names'
44
- ) );
 
 
45
  }
46
 
47
  /**
@@ -119,10 +121,14 @@ class AMP_Post_Type_Support {
119
  &&
120
  'page' === get_option( 'show_on_front' )
121
  &&
122
- in_array( (int) $post->ID, array(
123
- (int) get_option( 'page_on_front' ),
124
- (int) get_option( 'page_for_posts' ),
125
- ), true )
 
 
 
 
126
  )
127
  )
128
  );
36
  * @return string[] Post types eligible for AMP.
37
  */
38
  public static function get_eligible_post_types() {
39
+ return array_values(
40
+ get_post_types(
41
+ array(
42
+ 'public' => true,
43
+ ),
44
+ 'names'
45
+ )
46
+ );
47
  }
48
 
49
  /**
121
  &&
122
  'page' === get_option( 'show_on_front' )
123
  &&
124
+ in_array(
125
+ (int) $post->ID,
126
+ array(
127
+ (int) get_option( 'page_on_front' ),
128
+ (int) get_option( 'page_for_posts' ),
129
+ ),
130
+ true
131
+ )
132
  )
133
  )
134
  );
includes/class-amp-service-worker.php ADDED
@@ -0,0 +1,346 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AMP Service Workers.
4
+ *
5
+ * @package AMP
6
+ * @since 1.1
7
+ */
8
+
9
+ /**
10
+ * Class AMP_Service_Worker.
11
+ */
12
+ class AMP_Service_Worker {
13
+
14
+ /**
15
+ * Query var that is used to signal a request to install the service worker in an iframe.
16
+ *
17
+ * @link https://www.ampproject.org/docs/reference/components/amp-install-serviceworker#data-iframe-src-(optional)
18
+ */
19
+ const INSTALL_SERVICE_WORKER_IFRAME_QUERY_VAR = 'amp_install_service_worker_iframe';
20
+
21
+ /**
22
+ * Init.
23
+ */
24
+ public static function init() {
25
+ if ( ! class_exists( 'WP_Service_Workers' ) ) {
26
+ return;
27
+ }
28
+
29
+ // Shim support for service worker installation from PWA feature plugin.
30
+ add_filter( 'query_vars', array( __CLASS__, 'add_query_var' ) );
31
+ add_action( 'parse_request', array( __CLASS__, 'handle_service_worker_iframe_install' ) );
32
+ add_action( 'wp', array( __CLASS__, 'add_install_hooks' ) );
33
+
34
+ $theme_support = AMP_Theme_Support::get_theme_support_args();
35
+ if ( isset( $theme_support['service_worker'] ) && false === $theme_support['service_worker'] ) {
36
+ return;
37
+ }
38
+
39
+ /*
40
+ * The default-enabled options reflect which features are not commented-out in the AMP-by-Example service worker.
41
+ * See <https://github.com/ampproject/amp-by-example/blob/e093edb401b1617859b5365e80b639d81b06f058/boilerplate-generator/templates/files/serviceworkerJs.js>.
42
+ */
43
+ $enabled_options = array(
44
+ 'cdn_script_caching' => true,
45
+ 'image_caching' => false,
46
+ 'google_fonts_caching' => false,
47
+ );
48
+ if ( isset( $theme_support['service_worker'] ) && is_array( $theme_support['service_worker'] ) ) {
49
+ $enabled_options = array_merge(
50
+ $enabled_options,
51
+ $theme_support['service_worker']
52
+ );
53
+ }
54
+
55
+ if ( $enabled_options['cdn_script_caching'] ) {
56
+ add_action( 'wp_front_service_worker', array( __CLASS__, 'add_cdn_script_caching' ) );
57
+ }
58
+ if ( $enabled_options['image_caching'] ) {
59
+ add_action( 'wp_front_service_worker', array( __CLASS__, 'add_image_caching' ) );
60
+ }
61
+ if ( $enabled_options['google_fonts_caching'] ) {
62
+ add_action( 'wp_front_service_worker', array( __CLASS__, 'add_google_fonts_caching' ) );
63
+ }
64
+ }
65
+
66
+ /**
67
+ * Add query var for iframe service worker request.
68
+ *
69
+ * @param array $vars Query vars.
70
+ * @return array Amended query vars.
71
+ */
72
+ public static function add_query_var( $vars ) {
73
+ $vars[] = self::INSTALL_SERVICE_WORKER_IFRAME_QUERY_VAR;
74
+ return $vars;
75
+ }
76
+
77
+ /**
78
+ * Add runtime caching for scripts loaded from the AMP CDN with a stale-while-revalidate strategy.
79
+ *
80
+ * @link https://github.com/ampproject/amp-by-example/blob/4593af61609898043302a101826ddafe7206bfd9/boilerplate-generator/templates/files/serviceworkerJs.js
81
+ *
82
+ * @param WP_Service_Worker_Scripts $service_workers Service worker registry.
83
+ */
84
+ public static function add_cdn_script_caching( $service_workers ) {
85
+ if ( ! ( $service_workers instanceof WP_Service_Worker_Scripts ) ) {
86
+ _doing_it_wrong( __METHOD__, esc_html__( 'Please update to PWA v0.2. Expected argument to be WP_Service_Worker_Cache_Registry.', 'amp' ), '1.1' );
87
+ return;
88
+ }
89
+
90
+ // Add AMP scripts to runtime cache which will then get stale-while-revalidate strategy.
91
+ $service_workers->register(
92
+ 'amp-cdn-runtime-caching',
93
+ function() {
94
+ $urls = AMP_Service_Worker::get_precached_script_cdn_urls();
95
+ if ( empty( $urls ) ) {
96
+ return '';
97
+ }
98
+
99
+ $js = file_get_contents( AMP__DIR__ . '/assets/js/amp-service-worker-runtime-precaching.js' ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents, WordPress.WP.AlternativeFunctions.file_system_read_file_get_contents
100
+ $js = preg_replace( '#/\*\s*global.+?\*/#', '', $js );
101
+ $js = str_replace(
102
+ 'URLS',
103
+ wp_json_encode( $urls ),
104
+ $js
105
+ );
106
+ return $js;
107
+ }
108
+ );
109
+
110
+ // Serve the AMP Runtime from cache and check for an updated version in the background. See <https://github.com/ampproject/amp-by-example/blob/4593af61609898043302a101826ddafe7206bfd9/boilerplate-generator/templates/files/serviceworkerJs.js#L54-L58>.
111
+ $service_workers->caching_routes()->register(
112
+ '^https:\/\/cdn\.ampproject\.org\/.*',
113
+ array(
114
+ 'strategy' => WP_Service_Worker_Caching_Routes::STRATEGY_STALE_WHILE_REVALIDATE,
115
+ )
116
+ );
117
+ }
118
+
119
+ /**
120
+ * Add runtime image caching from the origin with a cache-first strategy.
121
+ *
122
+ * @link https://github.com/ampproject/amp-by-example/blob/4593af61609898043302a101826ddafe7206bfd9/boilerplate-generator/templates/files/serviceworkerJs.js#L60-L74
123
+ *
124
+ * @param WP_Service_Worker_Scripts $service_workers Service workers.
125
+ */
126
+ public static function add_image_caching( $service_workers ) {
127
+ if ( ! ( $service_workers instanceof WP_Service_Worker_Scripts ) ) {
128
+ _doing_it_wrong( __METHOD__, esc_html__( 'Please update to PWA v0.2. Expected argument to be WP_Service_Worker_Scripts.', 'amp' ), '1.1' );
129
+ return;
130
+ }
131
+
132
+ $service_workers->caching_routes()->register(
133
+ '^' . preg_quote( set_url_scheme( content_url( '/' ), 'https' ), '/' ) . '[^\?]+?\.(?:png|gif|jpg|jpeg|svg|webp)(\?.*)?$',
134
+ array(
135
+ 'strategy' => WP_Service_Worker_Caching_Routes::STRATEGY_CACHE_FIRST,
136
+ 'cacheName' => 'images',
137
+ 'plugins' => array(
138
+ 'cacheableResponse' => array(
139
+ 'statuses' => array( 0, 200 ),
140
+ ),
141
+ 'expiration' => array(
142
+ 'maxEntries' => 60,
143
+ 'maxAgeSeconds' => MONTH_IN_SECONDS,
144
+ ),
145
+ ),
146
+ )
147
+ );
148
+ }
149
+
150
+ /**
151
+ * Add runtime caching of Google Fonts with stale-while-revalidate strategy for stylesheets and cache-first strategy for webfont files.
152
+ *
153
+ * @link https://developers.google.com/web/tools/workbox/guides/common-recipes#google_fonts
154
+ * @link https://github.com/ampproject/amp-by-example/blob/4593af61609898043302a101826ddafe7206bfd9/boilerplate-generator/templates/files/serviceworkerJs.js#L76-L103
155
+ * @link https://github.com/xwp/pwa-wp/blob/master/integrations/class-wp-service-worker-fonts-integration.php
156
+ *
157
+ * @param WP_Service_Worker_Scripts $service_workers Service workers.
158
+ */
159
+ public static function add_google_fonts_caching( $service_workers ) {
160
+ if ( ! ( $service_workers instanceof WP_Service_Worker_Scripts ) ) {
161
+ _doing_it_wrong( __METHOD__, esc_html__( 'Please update to PWA v0.2. Expected argument to be WP_Service_Worker_Scripts.', 'amp' ), '1.1' );
162
+ return;
163
+ }
164
+
165
+ // The PWA plugin also automatically adds runtime caching for Google Fonts when WP_SERVICE_WORKER_INTEGRATIONS_ENABLED is set.
166
+ if ( class_exists( 'WP_Service_Worker_Fonts_Integration' ) ) {
167
+ return;
168
+ }
169
+
170
+ // Cache the Google Fonts stylesheets with a stale while revalidate strategy.
171
+ $service_workers->caching_routes()->register(
172
+ '^https:\/\/fonts\.googleapis\.com',
173
+ array(
174
+ 'strategy' => WP_Service_Worker_Caching_Routes::STRATEGY_STALE_WHILE_REVALIDATE,
175
+ 'cacheName' => 'google-fonts-stylesheets',
176
+ )
177
+ );
178
+
179
+ // Cache the Google Fonts webfont files with a cache first strategy for 1 year.
180
+ $service_workers->caching_routes()->register(
181
+ '^https:\/\/fonts\.gstatic\.com',
182
+ array(
183
+ 'strategy' => WP_Service_Worker_Caching_Routes::STRATEGY_CACHE_FIRST,
184
+ 'cacheName' => 'google-fonts-webfonts',
185
+ 'plugins' => array(
186
+ 'cacheableResponse' => array(
187
+ 'statuses' => array( 0, 200 ),
188
+ ),
189
+ 'expiration' => array(
190
+ 'maxAgeSeconds' => YEAR_IN_SECONDS,
191
+ 'maxEntries' => 30,
192
+ ),
193
+ ),
194
+ )
195
+ );
196
+ }
197
+
198
+ /**
199
+ * Register URLs that will be precached in the runtime cache. (Yes, this sounds somewhat strange.)
200
+ *
201
+ * Note that the PWA plugin handles the precaching of custom logo, custom header,
202
+ * and custom background. The PWA plugin also handles precaching & serving of the
203
+ * offline/500 error pages and enabling navigation preload.
204
+ *
205
+ * @link https://github.com/ampproject/amp-by-example/blob/4593af61609898043302a101826ddafe7206bfd9/boilerplate-generator/templates/files/serviceworkerJs.js#L9-L22
206
+ * @see AMP_Service_Worker::add_cdn_script_caching()
207
+ *
208
+ * @return array Runtime pre-cached URLs.
209
+ */
210
+ public static function get_precached_script_cdn_urls() {
211
+
212
+ // List of AMP scripts that we know will be used in WordPress always.
213
+ $precached_handles = array(
214
+ 'amp-runtime',
215
+ 'amp-bind', // Used by comments.
216
+ 'amp-form', // Used by comments.
217
+ 'amp-install-serviceworker',
218
+ );
219
+
220
+ $theme_support = AMP_Theme_Support::get_theme_support_args();
221
+ if ( ! empty( $theme_support['comments_live_list'] ) ) {
222
+ $precached_handles[] = 'amp-live-list';
223
+ }
224
+
225
+ if ( amp_get_analytics() ) {
226
+ $precached_handles[] = 'amp-analytics';
227
+ }
228
+
229
+ $urls = array();
230
+ foreach ( $precached_handles as $handle ) {
231
+ if ( wp_script_is( $handle, 'registered' ) ) {
232
+ $urls[] = wp_scripts()->registered[ $handle ]->src;
233
+ }
234
+ }
235
+
236
+ return $urls;
237
+ }
238
+
239
+ /**
240
+ * Add hooks to install the service worker from AMP page.
241
+ */
242
+ public static function add_install_hooks() {
243
+ if ( current_theme_supports( 'amp' ) && is_amp_endpoint() ) {
244
+ add_action( 'wp_footer', array( __CLASS__, 'install_service_worker' ) );
245
+
246
+ // Prevent validation error due to the script that installs the service worker on non-AMP pages.
247
+ $priority = has_action( 'wp_print_scripts', 'wp_print_service_workers' );
248
+ if ( false !== $priority ) {
249
+ remove_action( 'wp_print_scripts', 'wp_print_service_workers', $priority );
250
+ }
251
+ }
252
+
253
+ // Reader mode integration.
254
+ add_action( 'amp_post_template_footer', array( __CLASS__, 'install_service_worker' ) );
255
+ add_filter(
256
+ 'amp_post_template_data',
257
+ function ( $data ) {
258
+ $data['amp_component_scripts']['amp-install-serviceworker'] = true;
259
+ return $data;
260
+ }
261
+ );
262
+ }
263
+
264
+ /**
265
+ * Install service worker(s).
266
+ *
267
+ * @since 1.1
268
+ * @see wp_print_service_workers()
269
+ * @link https://github.com/xwp/pwa-wp
270
+ */
271
+ public static function install_service_worker() {
272
+ if ( ! function_exists( 'wp_service_workers' ) || ! function_exists( 'wp_get_service_worker_url' ) ) {
273
+ return;
274
+ }
275
+
276
+ $src = wp_get_service_worker_url( WP_Service_Workers::SCOPE_FRONT );
277
+ $iframe_src = add_query_arg(
278
+ self::INSTALL_SERVICE_WORKER_IFRAME_QUERY_VAR,
279
+ WP_Service_Workers::SCOPE_FRONT,
280
+ home_url( '/', 'https' )
281
+ );
282
+ ?>
283
+ <amp-install-serviceworker
284
+ src="<?php echo esc_url( $src ); ?>"
285
+ data-iframe-src="<?php echo esc_url( $iframe_src ); ?>"
286
+ layout="nodisplay"
287
+ >
288
+ </amp-install-serviceworker>
289
+ <?php
290
+ }
291
+
292
+ /**
293
+ * Handle request to install service worker via iframe.
294
+ *
295
+ * @see wp_print_service_workers()
296
+ * @link https://www.ampproject.org/docs/reference/components/amp-install-serviceworker#data-iframe-src-(optional)
297
+ */
298
+ public static function handle_service_worker_iframe_install() {
299
+ if ( ! isset( $GLOBALS['wp']->query_vars[ self::INSTALL_SERVICE_WORKER_IFRAME_QUERY_VAR ] ) ) {
300
+ return;
301
+ }
302
+
303
+ $scope = intval( $GLOBALS['wp']->query_vars[ self::INSTALL_SERVICE_WORKER_IFRAME_QUERY_VAR ] );
304
+ if ( WP_Service_Workers::SCOPE_ADMIN !== $scope && WP_Service_Workers::SCOPE_FRONT !== $scope ) {
305
+ wp_die(
306
+ esc_html__( 'No service workers registered for the requested scope.', 'amp' ),
307
+ esc_html__( 'Service Worker Installation', 'amp' ),
308
+ array( 'response' => 404 )
309
+ );
310
+ }
311
+
312
+ $front_scope = home_url( '/', 'relative' );
313
+
314
+ ?>
315
+ <!DOCTYPE html>
316
+ <html>
317
+ <head>
318
+ <meta charset="utf-8">
319
+ <title><?php esc_html_e( 'Service Worker Installation', 'amp' ); ?></title>
320
+ </head>
321
+ <body>
322
+ <?php esc_html_e( 'Installing service worker...', 'amp' ); ?>
323
+ <?php
324
+ printf(
325
+ '<script>navigator.serviceWorker.register( %s, %s );</script>',
326
+ wp_json_encode( wp_get_service_worker_url( $scope ) ),
327
+ wp_json_encode( array( 'scope' => $front_scope ) )
328
+ );
329
+ ?>
330
+ </body>
331
+ </html>
332
+ <?php
333
+
334
+ // Die in a way that can be unit tested.
335
+ add_filter(
336
+ 'wp_die_handler',
337
+ function() {
338
+ return function() {
339
+ die();
340
+ };
341
+ },
342
+ 1
343
+ );
344
+ wp_die();
345
+ }
346
+ }
includes/class-amp-theme-support.php CHANGED
@@ -128,9 +128,12 @@ class AMP_Theme_Support {
128
  return;
129
  }
130
 
 
 
 
131
  self::$init_start_time = microtime( true );
132
 
133
- require_once AMP__DIR__ . '/includes/amp-post-template-actions.php';
134
 
135
  add_action( 'widgets_init', array( __CLASS__, 'register_widgets' ) );
136
 
@@ -168,25 +171,43 @@ class AMP_Theme_Support {
168
  $args = self::get_theme_support_args();
169
 
170
  // Validate theme support usage.
171
- $keys = array( 'template_dir', 'comments_live_list', 'paired', 'templates_supported', 'available_callback' );
172
 
173
  if ( count( array_diff( array_keys( $args ), $keys ) ) !== 0 ) {
174
- _doing_it_wrong( 'add_theme_support', esc_html( sprintf( // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_trigger_error
175
- /* translators: 1: comma-separated list of expected keys, 2: comma-separated list of actual keys */
176
- __( 'Expected AMP theme support to keys (%1$s) but saw (%2$s)', 'amp' ),
177
- join( ', ', $keys ),
178
- join( ', ', array_keys( $args ) )
179
- ) ), '1.0' );
 
 
 
 
 
 
180
  }
181
 
182
  if ( isset( $args['available_callback'] ) ) {
183
- _doing_it_wrong( 'add_theme_support', esc_html__( 'The available_callback is deprecated when adding amp theme support in favor of declaratively setting the supported_templates.', 'amp' ), '1.0' );
 
 
 
 
 
 
 
 
 
184
  }
185
  self::$support_added_via_option = false;
186
  } elseif ( 'disabled' !== $theme_support_option ) {
187
- add_theme_support( self::SLUG, array(
188
- 'paired' => ( 'paired' === $theme_support_option ),
189
- ) );
 
 
 
190
  self::$support_added_via_option = true;
191
  } elseif ( AMP_Validation_Manager::is_theme_support_forced() ) {
192
  add_theme_support( self::SLUG );
@@ -225,10 +246,14 @@ class AMP_Theme_Support {
225
  */
226
  public static function finish_init() {
227
  if ( ! is_amp_endpoint() ) {
228
-
229
- // Redirect to AMP-less variable if AMP is not available for this URL and yet the query var is present.
230
- if ( isset( $_GET[ amp_get_slug() ] ) ) { // WPCS: csrf ok.
231
- self::redirect_ampless_url();
 
 
 
 
232
  }
233
 
234
  amp_add_frontend_actions();
@@ -265,20 +290,23 @@ class AMP_Theme_Support {
265
  */
266
  public static function ensure_proper_amp_location( $exit = true ) {
267
  $has_query_var = false !== get_query_var( amp_get_slug(), false ); // May come from URL param or endpoint slug.
268
- $has_url_param = isset( $_GET[ amp_get_slug() ] ); // WPCS: CSRF OK.
269
 
270
  if ( amp_is_canonical() ) {
271
  /*
272
  * When AMP native/canonical, then when there is an /amp/ endpoint or ?amp URL param,
273
  * then a redirect needs to be done to the URL without any AMP indicator in the URL.
 
 
 
274
  */
275
  if ( $has_query_var || $has_url_param ) {
276
- return self::redirect_ampless_url( $exit );
277
  }
278
  } else {
279
  /*
280
- * When in AMP paired mode *with* theme support, then the proper AMP URL has the 'amp' URL param
281
- * and not the /amp/ endpoint. The URL param is now the exclusive way to mark AMP in paired mode
282
  * when amp theme support present. This is important for plugins to be able to reliably call
283
  * is_amp_endpoint() before the parse_query action.
284
  */
@@ -286,7 +314,8 @@ class AMP_Theme_Support {
286
  $old_url = amp_get_current_url();
287
  $new_url = add_query_arg( amp_get_slug(), '', amp_remove_endpoint( $old_url ) );
288
  if ( $old_url !== $new_url ) {
289
- wp_safe_redirect( $new_url, 302 );
 
290
  // @codeCoverageIgnoreStart
291
  if ( $exit ) {
292
  exit;
@@ -308,21 +337,18 @@ class AMP_Theme_Support {
308
  * @since 1.0 Added $exit param.
309
  * @since 1.0 Renamed from redirect_canonical_amp().
310
  *
311
- * @param bool $exit Whether to exit after redirecting.
 
312
  * @return bool Whether redirection was done. Naturally this is irrelevant if $exit is true.
313
  */
314
- public static function redirect_ampless_url( $exit = true ) {
315
  $current_url = amp_get_current_url();
316
- $ampless_url = amp_remove_endpoint( $current_url );
317
- if ( $ampless_url === $current_url ) {
318
  return false;
319
  }
320
 
321
- /*
322
- * Temporary redirect because AMP URL may return when blocking validation errors
323
- * occur or when a non-canonical AMP theme is used.
324
- */
325
- wp_safe_redirect( $ampless_url, 302 );
326
  // @codeCoverageIgnoreStart
327
  if ( $exit ) {
328
  exit;
@@ -332,7 +358,7 @@ class AMP_Theme_Support {
332
  }
333
 
334
  /**
335
- * Determines whether paired mode is available.
336
  *
337
  * When 'amp' theme support has not been added or canonical mode is enabled, then this returns false.
338
  *
@@ -371,6 +397,9 @@ class AMP_Theme_Support {
371
  */
372
  public static function add_amp_template_filters() {
373
  foreach ( self::$template_types as $template_type ) {
 
 
 
374
  add_filter( "{$template_type}_template_hierarchy", array( __CLASS__, 'filter_amp_template_hierarchy' ) );
375
  }
376
  }
@@ -476,7 +505,7 @@ class AMP_Theme_Support {
476
 
477
  // Make sure global $wp_query is set in case of conditionals that unfortunately look at global scope.
478
  $prev_query = $wp_query;
479
- $wp_query = $query; // WPCS: override ok.
480
 
481
  $matching_templates = array();
482
  $supportable_templates = self::get_supportable_templates();
@@ -508,7 +537,7 @@ class AMP_Theme_Support {
508
  }
509
 
510
  // Restore previous $wp_query (if any).
511
- $wp_query = $prev_query; // WPCS: override ok.
512
 
513
  // Make sure children override their parents.
514
  $matching_template_ids = array_keys( $matching_templates );
@@ -540,17 +569,84 @@ class AMP_Theme_Support {
540
  }
541
  }
542
 
543
- // The is_home() condition is the default so discard it if there are other matching templates.
544
  if ( count( $matching_templates ) > 1 && isset( $matching_templates['is_home'] ) ) {
545
  unset( $matching_templates['is_home'] );
546
  }
547
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
548
  /*
549
  * If there are more than one matching templates, then something is probably not right.
550
  * Template conditions need to be set up properly to prevent this from happening.
551
  */
552
  if ( count( $matching_templates ) > 1 ) {
553
- _doing_it_wrong( __METHOD__, esc_html__( 'Did not expect there to be more than one matching template. Did you filter amp_supportable_templates to not honor the template hierarchy?', 'amp' ), '1.0' );
 
 
 
 
 
 
 
 
 
 
554
  }
555
 
556
  $matching_template = array_shift( $matching_templates );
@@ -617,7 +713,7 @@ class AMP_Theme_Support {
617
  );
618
  if ( AMP_Post_Meta_Box::DISABLED_STATUS === get_post_meta( get_option( 'page_on_front' ), AMP_Post_Meta_Box::STATUS_POST_META_KEY, true ) ) {
619
  /* translators: %s: the URL to the edit post screen. */
620
- $templates['is_front_page']['description'] = sprintf( __( 'Currently disabled at the <a href="%s" target="_blank">page level</a>.', 'amp' ), esc_url( get_edit_post_link( get_option( 'page_on_front' ) ) ) );
621
  }
622
 
623
  // In other words, same as is_posts_page, *but* it not is_singular.
@@ -626,7 +722,7 @@ class AMP_Theme_Support {
626
  );
627
  if ( AMP_Post_Meta_Box::DISABLED_STATUS === get_post_meta( get_option( 'page_for_posts' ), AMP_Post_Meta_Box::STATUS_POST_META_KEY, true ) ) {
628
  /* translators: %s: the URL to the edit post screen. */
629
- $templates['is_home']['description'] = sprintf( __( 'Currently disabled at the <a href="%s" target="_blank">page level</a>.', 'amp' ), esc_url( get_edit_post_link( get_option( 'page_for_posts' ) ) ) );
630
  }
631
  } else {
632
  $templates['is_home'] = array(
@@ -766,17 +862,27 @@ class AMP_Theme_Support {
766
 
767
  // @todo The wp_mediaelement_fallback() should still run to be injected inside of the audio/video generated by wp_audio_shortcode()/wp_video_shortcode() respectively.
768
  // Prevent MediaElement.js scripts/styles from being enqueued.
769
- add_filter( 'wp_video_shortcode_library', function() {
770
- return 'amp';
771
- } );
772
- add_filter( 'wp_audio_shortcode_library', function() {
773
- return 'amp';
774
- } );
 
 
 
 
 
 
775
 
776
  // Don't show loading indicator on custom logo since it makes most sense for larger images.
777
- add_filter( 'get_custom_logo', function( $html ) {
778
- return preg_replace( '/(?<=<img\s)/', ' noloading ', $html );
779
- }, 1 );
 
 
 
 
780
 
781
  /*
782
  * "AMP HTML documents MUST contain the AMP boilerplate code (head > style[amp-boilerplate] and noscript > style[amp-boilerplate])
@@ -791,15 +897,23 @@ class AMP_Theme_Support {
791
  *
792
  * Other required markup is added in the ensure_required_markup method, including meta charset, meta viewport, and rel=canonical link.
793
  */
794
- add_action( 'wp_head', function() {
795
- echo '<style amp-custom></style>';
796
- }, 0 );
797
- add_action( 'wp_head', function() {
798
- echo amp_get_boilerplate_code(); // WPCS: xss ok.
799
- }, PHP_INT_MAX );
 
 
 
 
 
 
 
 
800
 
801
  add_action( 'wp_head', 'amp_add_generator_metadata', 20 );
802
- add_action( 'wp_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
803
  add_action( 'wp_enqueue_scripts', array( __CLASS__, 'dequeue_customize_preview_scripts' ), 1000 );
804
  add_filter( 'customize_partial_render', array( __CLASS__, 'filter_customize_partial_render' ) );
805
 
@@ -819,11 +933,10 @@ class AMP_Theme_Support {
819
  * Start output buffering at very low priority for sake of plugins and themes that use template_redirect
820
  * instead of template_include.
821
  */
822
- $priority = defined( 'PHP_INT_MIN' ) ? PHP_INT_MIN : ~PHP_INT_MAX; // phpcs:ignore PHPCompatibility.PHP.NewConstants.php_int_minFound
823
  add_action( 'template_redirect', array( __CLASS__, 'start_output_buffering' ), $priority );
824
 
825
  // Commenting hooks.
826
- add_filter( 'wp_list_comments_args', array( __CLASS__, 'set_comments_walker' ), PHP_INT_MAX );
827
  add_filter( 'comment_form_defaults', array( __CLASS__, 'filter_comment_form_defaults' ) );
828
  add_filter( 'comment_reply_link', array( __CLASS__, 'filter_comment_reply_link' ), 10, 4 );
829
  add_filter( 'cancel_comment_reply_link', array( __CLASS__, 'filter_cancel_comment_reply_link' ), 10, 3 );
@@ -831,12 +944,19 @@ class AMP_Theme_Support {
831
  remove_action( 'comment_form', 'wp_comment_form_unfiltered_html_nonce' );
832
  add_filter( 'wp_kses_allowed_html', array( __CLASS__, 'whitelist_layout_in_wp_kses_allowed_html' ), 10 );
833
  add_filter( 'get_header_image_tag', array( __CLASS__, 'amend_header_image_with_video_header' ), PHP_INT_MAX );
834
- add_action( 'wp_print_footer_scripts', function() {
835
- wp_dequeue_script( 'wp-custom-header' );
836
- }, 0 );
837
- add_action( 'wp_enqueue_scripts', function() {
838
- wp_dequeue_script( 'comment-reply' ); // Handled largely by AMP_Comments_Sanitizer and *reply* methods in this class.
839
- } );
 
 
 
 
 
 
 
840
 
841
  // @todo Add character conversion.
842
  }
@@ -885,16 +1005,28 @@ class AMP_Theme_Support {
885
  *
886
  * @type AMP_Base_Embed_Handler $embed_handler
887
  */
888
- $embed_handler = new $embed_handler_class( array_merge(
889
- array(
890
- 'content_max_width' => ! empty( $content_width ) ? $content_width : AMP_Post_Template::CONTENT_MAX_WIDTH, // Back-compat.
891
- ),
892
- $args
893
- ) );
 
 
894
 
895
  if ( ! is_subclass_of( $embed_handler, 'AMP_Base_Embed_Handler' ) ) {
896
- /* translators: %s is embed handler */
897
- _doing_it_wrong( __METHOD__, esc_html( sprintf( __( 'Embed Handler (%s) must extend `AMP_Embed_Handler`', 'amp' ), $embed_handler_class ) ), '0.1' );
 
 
 
 
 
 
 
 
 
 
898
  continue;
899
  }
900
 
@@ -908,10 +1040,13 @@ class AMP_Theme_Support {
908
  /**
909
  * Add the comments template placeholder marker
910
  *
911
- * @param array $args the args for the comments list..
 
 
912
  * @return array Args to return.
913
  */
914
  public static function set_comments_walker( $args ) {
 
915
  $amp_walker = new AMP_Comment_Walker();
916
  $args['walker'] = $amp_walker;
917
  return $args;
@@ -940,7 +1075,7 @@ class AMP_Theme_Support {
940
  }
941
 
942
  /**
943
- * Prepends template hierarchy with template_dir for AMP paired mode templates.
944
  *
945
  * @param array $templates Template hierarchy.
946
  * @return array Templates.
@@ -1077,7 +1212,7 @@ class AMP_Theme_Support {
1077
  $link = sprintf(
1078
  '<a rel="nofollow" class="comment-reply-link" href="%s" on="%s" aria-label="%s">%s</a>',
1079
  esc_attr( '#' . $args['respond_id'] ),
1080
- esc_attr( sprintf( 'tap:AMP.setState( %s )', wp_json_encode( $tap_state ) ) ),
1081
  esc_attr( sprintf( $args['reply_to_text'], $comment->comment_author ) ),
1082
  $args['reply_text']
1083
  );
@@ -1137,20 +1272,27 @@ class AMP_Theme_Support {
1137
  wp_dequeue_script( 'admin-bar' );
1138
 
1139
  // Remove customize support script since not valid AMP.
1140
- add_action( 'admin_bar_menu', function() {
1141
- remove_action( 'wp_before_admin_bar_render', 'wp_customize_support_script' );
1142
- }, 41 );
 
 
 
 
1143
 
1144
  // Emulate customize support script in PHP, to assume Customizer.
1145
- add_filter( 'body_class', function( $body_classes ) {
1146
- return array_merge(
1147
- array_diff(
1148
- $body_classes,
1149
- array( 'no-customize-support' )
1150
- ),
1151
- array( 'customize-support' )
1152
- );
1153
- } );
 
 
 
1154
  }
1155
 
1156
  /**
@@ -1206,10 +1348,14 @@ class AMP_Theme_Support {
1206
  }
1207
  }
1208
  if ( empty( $links['canonical'] ) ) {
1209
- $rel_canonical = AMP_DOM_Utils::create_node( $dom, 'link', array(
1210
- 'rel' => 'canonical',
1211
- 'href' => self::get_current_canonical_url(),
1212
- ) );
 
 
 
 
1213
  $head->appendChild( $rel_canonical );
1214
  }
1215
 
@@ -1238,19 +1384,27 @@ class AMP_Theme_Support {
1238
  }
1239
  if ( ! $meta_charset ) {
1240
  // Warning: This probably means the character encoding needs to be converted.
1241
- $meta_charset = AMP_DOM_Utils::create_node( $dom, 'meta', array(
1242
- 'charset' => 'utf-8',
1243
- ) );
 
 
 
 
1244
  } else {
1245
  $head->removeChild( $meta_charset ); // So we can move it.
1246
  }
1247
  $head->insertBefore( $meta_charset, $head->firstChild );
1248
 
1249
  if ( ! $meta_viewport ) {
1250
- $meta_viewport = AMP_DOM_Utils::create_node( $dom, 'meta', array(
1251
- 'name' => 'viewport',
1252
- 'content' => 'width=device-width',
1253
- ) );
 
 
 
 
1254
  } else {
1255
  $head->removeChild( $meta_viewport ); // So we can move it.
1256
  }
@@ -1332,22 +1486,30 @@ class AMP_Theme_Support {
1332
  $links['preload'] = array();
1333
  }
1334
 
1335
- $prioritized_preloads[] = AMP_DOM_Utils::create_node( $dom, 'link', array(
1336
- 'rel' => 'preload',
1337
- 'as' => 'script',
1338
- 'href' => $runtime_src,
1339
- ) );
 
 
 
 
1340
 
1341
  $amp_script_handles = array_keys( $amp_scripts );
1342
  foreach ( array_intersect( $render_delaying_extensions, $amp_script_handles ) as $script_handle ) {
1343
  if ( ! in_array( $script_handle, $render_delaying_extensions, true ) ) {
1344
  continue;
1345
  }
1346
- $prioritized_preloads[] = AMP_DOM_Utils::create_node( $dom, 'link', array(
1347
- 'rel' => 'preload',
1348
- 'as' => 'script',
1349
- 'href' => $amp_scripts[ $script_handle ]->getAttribute( 'src' ),
1350
- ) );
 
 
 
 
1351
  }
1352
  $links['preload'] = array_merge( $prioritized_preloads, $links['preload'] );
1353
 
@@ -1552,7 +1714,7 @@ class AMP_Theme_Support {
1552
  );
1553
 
1554
  $current_url = amp_get_current_url();
1555
- $ampless_url = amp_remove_endpoint( $current_url );
1556
 
1557
  // When response caching is enabled, determine if it should be turned off for cache misses.
1558
  $caches_for_url = null;
@@ -1565,13 +1727,17 @@ class AMP_Theme_Support {
1565
  * Set response cache hash, the data values dictates whether a new hash key should be generated or not.
1566
  * This is also used as the ETag.
1567
  */
1568
- $response_cache_key = md5( wp_json_encode( array(
1569
- $args,
1570
- $response,
1571
- self::$sanitizer_classes,
1572
- self::$embed_handlers,
1573
- AMP__VERSION,
1574
- ) ) );
 
 
 
 
1575
 
1576
  /*
1577
  * Per rfc7232:
@@ -1582,10 +1748,23 @@ class AMP_Theme_Support {
1582
  * not have been set yet during the WordPress template generation is
1583
  * the ETag. The AMP plugin sends a Vary header at amp_init.
1584
  */
1585
- AMP_HTTP::send_header( 'ETag', $response_cache_key );
1586
 
1587
- // Handle responses that are cached by the browser.
1588
- if ( isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) && $_SERVER['HTTP_IF_NONE_MATCH'] === $response_cache_key ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
1589
  status_header( 304 );
1590
  return '';
1591
  }
@@ -1628,9 +1807,14 @@ class AMP_Theme_Support {
1628
  // Redirect to non-AMP version.
1629
  if ( ! amp_is_canonical() && $blocking_error_count > 0 ) {
1630
  if ( AMP_Validation_Manager::has_cap() ) {
1631
- $ampless_url = add_query_arg( AMP_Validation_Manager::VALIDATION_ERRORS_QUERY_VAR, $blocking_error_count, $ampless_url );
1632
  }
1633
- wp_safe_redirect( $ampless_url );
 
 
 
 
 
1634
  }
1635
  return $response_cache['body'];
1636
  }
@@ -1785,14 +1969,16 @@ class AMP_Theme_Support {
1785
  $cache_response( $response, $validation_results );
1786
  }
1787
 
1788
- /*
1789
- * Temporary redirect because AMP URL may return when blocking validation errors
1790
- * occur or when a non-canonical AMP theme is used.
1791
- */
1792
  if ( AMP_Validation_Manager::has_cap() ) {
1793
- $ampless_url = add_query_arg( AMP_Validation_Manager::VALIDATION_ERRORS_QUERY_VAR, $blocking_error_count, $ampless_url );
1794
  }
1795
- wp_safe_redirect( $ampless_url, 302 );
 
 
 
 
 
1796
  return $response;
1797
  }
1798
  }
@@ -1803,9 +1989,12 @@ class AMP_Theme_Support {
1803
  trigger_error( esc_html( sprintf( __( 'The database has the %s encoding when it needs to be utf-8 to work with AMP.', 'amp' ), get_bloginfo( 'charset' ) ) ), E_USER_WARNING ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_trigger_error
1804
  }
1805
 
1806
- AMP_Validation_Manager::finalize_validation( $dom, array(
1807
- 'remove_source_comments' => ! isset( $_GET['amp_preserve_source_comments'] ), // WPCS: CSRF.
1808
- ) );
 
 
 
1809
 
1810
  // For service worker streaming, restore the script that was removed above and obtain the script that should be added to the body fragment.
1811
  $truncate_after_comment = null;
128
  return;
129
  }
130
 
131
+ // Ensure extra theme support for core themes is in place.
132
+ AMP_Core_Theme_Sanitizer::extend_theme_support();
133
+
134
  self::$init_start_time = microtime( true );
135
 
136
+ require_once AMP__DIR__ . '/includes/amp-post-template-functions.php';
137
 
138
  add_action( 'widgets_init', array( __CLASS__, 'register_widgets' ) );
139
 
171
  $args = self::get_theme_support_args();
172
 
173
  // Validate theme support usage.
174
+ $keys = array( 'template_dir', 'comments_live_list', 'paired', 'templates_supported', 'available_callback', 'service_worker', 'nav_menu_toggle', 'nav_menu_dropdown' );
175
 
176
  if ( count( array_diff( array_keys( $args ), $keys ) ) !== 0 ) {
177
+ _doing_it_wrong(
178
+ 'add_theme_support',
179
+ esc_html(
180
+ sprintf( // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_trigger_error
181
+ /* translators: 1: comma-separated list of expected keys, 2: comma-separated list of actual keys */
182
+ __( 'Expected AMP theme support to keys (%1$s) but saw (%2$s)', 'amp' ),
183
+ join( ', ', $keys ),
184
+ join( ', ', array_keys( $args ) )
185
+ )
186
+ ),
187
+ '1.0'
188
+ );
189
  }
190
 
191
  if ( isset( $args['available_callback'] ) ) {
192
+ _doing_it_wrong(
193
+ 'add_theme_support',
194
+ sprintf(
195
+ /* translators: 1: available_callback. 2: supported_templates */
196
+ esc_html__( 'The %1$s is deprecated when adding amp theme support in favor of declaratively setting the %2$s.', 'amp' ),
197
+ 'available_callback',
198
+ 'supported_templates'
199
+ ),
200
+ '1.0'
201
+ );
202
  }
203
  self::$support_added_via_option = false;
204
  } elseif ( 'disabled' !== $theme_support_option ) {
205
+ add_theme_support(
206
+ self::SLUG,
207
+ array(
208
+ 'paired' => ( 'paired' === $theme_support_option ),
209
+ )
210
+ );
211
  self::$support_added_via_option = true;
212
  } elseif ( AMP_Validation_Manager::is_theme_support_forced() ) {
213
  add_theme_support( self::SLUG );
246
  */
247
  public static function finish_init() {
248
  if ( ! is_amp_endpoint() ) {
249
+ /*
250
+ * Redirect to AMP-less variable if AMP is not available for this URL and yet the query var is present.
251
+ * Temporary redirect is used for admin users because implied transitional mode and template support can be
252
+ * enabled by user ay any time, so they will be able to make AMP available for this URL and see the change
253
+ * without wrestling with the redirect cache.
254
+ */
255
+ if ( isset( $_GET[ amp_get_slug() ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
256
+ self::redirect_non_amp_url( current_user_can( 'manage_options' ) ? 302 : 301, true );
257
  }
258
 
259
  amp_add_frontend_actions();
290
  */
291
  public static function ensure_proper_amp_location( $exit = true ) {
292
  $has_query_var = false !== get_query_var( amp_get_slug(), false ); // May come from URL param or endpoint slug.
293
+ $has_url_param = isset( $_GET[ amp_get_slug() ] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
294
 
295
  if ( amp_is_canonical() ) {
296
  /*
297
  * When AMP native/canonical, then when there is an /amp/ endpoint or ?amp URL param,
298
  * then a redirect needs to be done to the URL without any AMP indicator in the URL.
299
+ * Permanent redirect is used for unauthenticated users since switching between modes
300
+ * should happen infrequently. For admin users, this is kept temporary to allow them
301
+ * to not be hampered by browser remembering permanent redirects and preventing test.
302
  */
303
  if ( $has_query_var || $has_url_param ) {
304
+ return self::redirect_non_amp_url( current_user_can( 'manage_options' ) ? 302 : 301, $exit );
305
  }
306
  } else {
307
  /*
308
+ * When in AMP transitional mode *with* theme support, then the proper AMP URL has the 'amp' URL param
309
+ * and not the /amp/ endpoint. The URL param is now the exclusive way to mark AMP in transitional mode
310
  * when amp theme support present. This is important for plugins to be able to reliably call
311
  * is_amp_endpoint() before the parse_query action.
312
  */
314
  $old_url = amp_get_current_url();
315
  $new_url = add_query_arg( amp_get_slug(), '', amp_remove_endpoint( $old_url ) );
316
  if ( $old_url !== $new_url ) {
317
+ // A temporary redirect is used for admin users to allow them to see changes between reader mode and transitional modes.
318
+ wp_safe_redirect( $new_url, current_user_can( 'manage_options' ) ? 302 : 301 );
319
  // @codeCoverageIgnoreStart
320
  if ( $exit ) {
321
  exit;
337
  * @since 1.0 Added $exit param.
338
  * @since 1.0 Renamed from redirect_canonical_amp().
339
  *
340
+ * @param int $status Status code (301 or 302).
341
+ * @param bool $exit Whether to exit after redirecting.
342
  * @return bool Whether redirection was done. Naturally this is irrelevant if $exit is true.
343
  */
344
+ public static function redirect_non_amp_url( $status = 302, $exit = true ) {
345
  $current_url = amp_get_current_url();
346
+ $non_amp_url = amp_remove_endpoint( $current_url );
347
+ if ( $non_amp_url === $current_url ) {
348
  return false;
349
  }
350
 
351
+ wp_safe_redirect( $non_amp_url, $status );
 
 
 
 
352
  // @codeCoverageIgnoreStart
353
  if ( $exit ) {
354
  exit;
358
  }
359
 
360
  /**
361
+ * Determines whether transitional mode is available.
362
  *
363
  * When 'amp' theme support has not been added or canonical mode is enabled, then this returns false.
364
  *
397
  */
398
  public static function add_amp_template_filters() {
399
  foreach ( self::$template_types as $template_type ) {
400
+ // See get_query_template().
401
+ $template_type = preg_replace( '|[^a-z0-9-]+|', '', $template_type );
402
+
403
  add_filter( "{$template_type}_template_hierarchy", array( __CLASS__, 'filter_amp_template_hierarchy' ) );
404
  }
405
  }
505
 
506
  // Make sure global $wp_query is set in case of conditionals that unfortunately look at global scope.
507
  $prev_query = $wp_query;
508
+ $wp_query = $query; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
509
 
510
  $matching_templates = array();
511
  $supportable_templates = self::get_supportable_templates();
537
  }
538
 
539
  // Restore previous $wp_query (if any).
540
+ $wp_query = $prev_query; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
541
 
542
  // Make sure children override their parents.
543
  $matching_template_ids = array_keys( $matching_templates );
569
  }
570
  }
571
 
572
+ // If there is more than 1 matching template, the is_home() condition is the default so discard it if there are other matching templates.
573
  if ( count( $matching_templates ) > 1 && isset( $matching_templates['is_home'] ) ) {
574
  unset( $matching_templates['is_home'] );
575
  }
576
 
577
+ /*
578
+ * When there is still more than one matching template, account for ambiguous cases, informed by the order in template-loader.php.
579
+ * See <https://github.com/WordPress/wordpress-develop/blob/5.1.0/src/wp-includes/template-loader.php#L49-L68>.
580
+ */
581
+ if ( count( $matching_templates ) > 1 ) {
582
+ $template_conditional_priority_order = array(
583
+ 'is_embed',
584
+ 'is_404',
585
+ 'is_search',
586
+ 'is_front_page',
587
+ 'is_home',
588
+ 'is_post_type_archive',
589
+ 'is_tax',
590
+ 'is_attachment',
591
+ 'is_single',
592
+ 'is_page',
593
+ 'is_singular',
594
+ 'is_category',
595
+ 'is_tag',
596
+ 'is_author',
597
+ 'is_date',
598
+ 'is_archive',
599
+ );
600
+
601
+ // Obtain the template conditionals for each matching template ID (e.g. 'is_post_type_archive[product]' => 'is_post_type_archive').
602
+ $template_conditional_id_mapping = array();
603
+ foreach ( array_keys( $matching_templates ) as $template_id ) {
604
+ $template_conditional_id_mapping[ strtok( $template_id, '[' ) ] = $template_id;
605
+ }
606
+
607
+ // If there are any custom supportable templates, only consider them since they would override the conditional logic in core.
608
+ $custom_template_conditions = array_diff(
609
+ array_keys( $template_conditional_id_mapping ),
610
+ $template_conditional_priority_order
611
+ );
612
+ if ( ! empty( $custom_template_conditions ) ) {
613
+ $matching_templates = wp_array_slice_assoc(
614
+ $matching_templates,
615
+ array_values( wp_array_slice_assoc( $template_conditional_id_mapping, $custom_template_conditions ) )
616
+ );
617
+ } else {
618
+ /*
619
+ * Otherwise, iterate over the template conditionals in the order they occur in the if/elseif/else conditional chain.
620
+ * to then populate $matching_templates with just this one entry.
621
+ */
622
+ foreach ( $template_conditional_priority_order as $template_conditional ) {
623
+ if ( isset( $template_conditional_id_mapping[ $template_conditional ] ) ) {
624
+ $template_id = $template_conditional_id_mapping[ $template_conditional ];
625
+ $matching_templates = array(
626
+ $template_id => $matching_templates[ $template_id ],
627
+ );
628
+ break;
629
+ }
630
+ }
631
+ }
632
+ }
633
+
634
  /*
635
  * If there are more than one matching templates, then something is probably not right.
636
  * Template conditions need to be set up properly to prevent this from happening.
637
  */
638
  if ( count( $matching_templates ) > 1 ) {
639
+ _doing_it_wrong(
640
+ __METHOD__,
641
+ esc_html(
642
+ sprintf(
643
+ /* translators: %s: amp_supportable_templates */
644
+ __( 'Did not expect there to be more than one matching template. Did you filter %s to not honor the template hierarchy?', 'amp' ),
645
+ 'amp_supportable_templates'
646
+ )
647
+ ),
648
+ '1.0'
649
+ );
650
  }
651
 
652
  $matching_template = array_shift( $matching_templates );
713
  );
714
  if ( AMP_Post_Meta_Box::DISABLED_STATUS === get_post_meta( get_option( 'page_on_front' ), AMP_Post_Meta_Box::STATUS_POST_META_KEY, true ) ) {
715
  /* translators: %s: the URL to the edit post screen. */
716
+ $templates['is_front_page']['description'] = sprintf( __( 'Currently disabled at the <a href="%s">page level</a>.', 'amp' ), esc_url( get_edit_post_link( get_option( 'page_on_front' ) ) ) );
717
  }
718
 
719
  // In other words, same as is_posts_page, *but* it not is_singular.
722
  );
723
  if ( AMP_Post_Meta_Box::DISABLED_STATUS === get_post_meta( get_option( 'page_for_posts' ), AMP_Post_Meta_Box::STATUS_POST_META_KEY, true ) ) {
724
  /* translators: %s: the URL to the edit post screen. */
725
+ $templates['is_home']['description'] = sprintf( __( 'Currently disabled at the <a href="%s">page level</a>.', 'amp' ), esc_url( get_edit_post_link( get_option( 'page_for_posts' ) ) ) );
726
  }
727
  } else {
728
  $templates['is_home'] = array(
862
 
863
  // @todo The wp_mediaelement_fallback() should still run to be injected inside of the audio/video generated by wp_audio_shortcode()/wp_video_shortcode() respectively.
864
  // Prevent MediaElement.js scripts/styles from being enqueued.
865
+ add_filter(
866
+ 'wp_video_shortcode_library',
867
+ function() {
868
+ return 'amp';
869
+ }
870
+ );
871
+ add_filter(
872
+ 'wp_audio_shortcode_library',
873
+ function() {
874
+ return 'amp';
875
+ }
876
+ );
877
 
878
  // Don't show loading indicator on custom logo since it makes most sense for larger images.
879
+ add_filter(
880
+ 'get_custom_logo',
881
+ function( $html ) {
882
+ return preg_replace( '/(?<=<img\s)/', ' data-amp-noloading="" ', $html );
883
+ },
884
+ 1
885
+ );
886
 
887
  /*
888
  * "AMP HTML documents MUST contain the AMP boilerplate code (head > style[amp-boilerplate] and noscript > style[amp-boilerplate])
897
  *
898
  * Other required markup is added in the ensure_required_markup method, including meta charset, meta viewport, and rel=canonical link.
899
  */
900
+ add_action(
901
+ 'wp_head',
902
+ function() {
903
+ echo '<style amp-custom></style>';
904
+ },
905
+ 0
906
+ );
907
+ add_action(
908
+ 'wp_head',
909
+ function() {
910
+ echo amp_get_boilerplate_code(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
911
+ },
912
+ PHP_INT_MAX
913
+ );
914
 
915
  add_action( 'wp_head', 'amp_add_generator_metadata', 20 );
916
+ add_action( 'wp_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ), 0 ); // Enqueue before theme's styles.
917
  add_action( 'wp_enqueue_scripts', array( __CLASS__, 'dequeue_customize_preview_scripts' ), 1000 );
918
  add_filter( 'customize_partial_render', array( __CLASS__, 'filter_customize_partial_render' ) );
919
 
933
  * Start output buffering at very low priority for sake of plugins and themes that use template_redirect
934
  * instead of template_include.
935
  */
936
+ $priority = defined( 'PHP_INT_MIN' ) ? PHP_INT_MIN : ~PHP_INT_MAX; // phpcs:ignore PHPCompatibility.Constants.NewConstants.php_int_minFound
937
  add_action( 'template_redirect', array( __CLASS__, 'start_output_buffering' ), $priority );
938
 
939
  // Commenting hooks.
 
940
  add_filter( 'comment_form_defaults', array( __CLASS__, 'filter_comment_form_defaults' ) );
941
  add_filter( 'comment_reply_link', array( __CLASS__, 'filter_comment_reply_link' ), 10, 4 );
942
  add_filter( 'cancel_comment_reply_link', array( __CLASS__, 'filter_cancel_comment_reply_link' ), 10, 3 );
944
  remove_action( 'comment_form', 'wp_comment_form_unfiltered_html_nonce' );
945
  add_filter( 'wp_kses_allowed_html', array( __CLASS__, 'whitelist_layout_in_wp_kses_allowed_html' ), 10 );
946
  add_filter( 'get_header_image_tag', array( __CLASS__, 'amend_header_image_with_video_header' ), PHP_INT_MAX );
947
+ add_action(
948
+ 'wp_print_footer_scripts',
949
+ function() {
950
+ wp_dequeue_script( 'wp-custom-header' );
951
+ },
952
+ 0
953
+ );
954
+ add_action(
955
+ 'wp_enqueue_scripts',
956
+ function() {
957
+ wp_dequeue_script( 'comment-reply' ); // Handled largely by AMP_Comments_Sanitizer and *reply* methods in this class.
958
+ }
959
+ );
960
 
961
  // @todo Add character conversion.
962
  }
1005
  *
1006
  * @type AMP_Base_Embed_Handler $embed_handler
1007
  */
1008
+ $embed_handler = new $embed_handler_class(
1009
+ array_merge(
1010
+ array(
1011
+ 'content_max_width' => ! empty( $content_width ) ? $content_width : AMP_Post_Template::CONTENT_MAX_WIDTH, // Back-compat.
1012
+ ),
1013
+ $args
1014
+ )
1015
+ );
1016
 
1017
  if ( ! is_subclass_of( $embed_handler, 'AMP_Base_Embed_Handler' ) ) {
1018
+ _doing_it_wrong(
1019
+ __METHOD__,
1020
+ esc_html(
1021
+ sprintf(
1022
+ /* translators: 1: embed handler. 2: AMP_Embed_Handler */
1023
+ __( 'Embed Handler (%1$s) must extend `%2$s`', 'amp' ),
1024
+ esc_html( $embed_handler_class ),
1025
+ 'AMP_Embed_Handler'
1026
+ )
1027
+ ),
1028
+ '0.1'
1029
+ );
1030
  continue;
1031
  }
1032
 
1040
  /**
1041
  * Add the comments template placeholder marker
1042
  *
1043
+ * @deprecated 1.1.0 This functionality was moved to AMP_Comments_Sanitizer
1044
+ *
1045
+ * @param array $args the args for the comments list.
1046
  * @return array Args to return.
1047
  */
1048
  public static function set_comments_walker( $args ) {
1049
+ _deprecated_function( __METHOD__, '1.1' );
1050
  $amp_walker = new AMP_Comment_Walker();
1051
  $args['walker'] = $amp_walker;
1052
  return $args;
1075
  }
1076
 
1077
  /**
1078
+ * Prepends template hierarchy with template_dir for AMP transitional mode templates.
1079
  *
1080
  * @param array $templates Template hierarchy.
1081
  * @return array Templates.
1212
  $link = sprintf(
1213
  '<a rel="nofollow" class="comment-reply-link" href="%s" on="%s" aria-label="%s">%s</a>',
1214
  esc_attr( '#' . $args['respond_id'] ),
1215
+ esc_attr( sprintf( 'tap:AMP.setState( %s )', wp_json_encode( $tap_state, JSON_UNESCAPED_UNICODE ) ) ),
1216
  esc_attr( sprintf( $args['reply_to_text'], $comment->comment_author ) ),
1217
  $args['reply_text']
1218
  );
1272
  wp_dequeue_script( 'admin-bar' );
1273
 
1274
  // Remove customize support script since not valid AMP.
1275
+ add_action(
1276
+ 'admin_bar_menu',
1277
+ function() {
1278
+ remove_action( 'wp_before_admin_bar_render', 'wp_customize_support_script' );
1279
+ },
1280
+ 41
1281
+ );
1282
 
1283
  // Emulate customize support script in PHP, to assume Customizer.
1284
+ add_filter(
1285
+ 'body_class',
1286
+ function( $body_classes ) {
1287
+ return array_merge(
1288
+ array_diff(
1289
+ $body_classes,
1290
+ array( 'no-customize-support' )
1291
+ ),
1292
+ array( 'customize-support' )
1293
+ );
1294
+ }
1295
+ );
1296
  }
1297
 
1298
  /**
1348
  }
1349
  }
1350
  if ( empty( $links['canonical'] ) ) {
1351
+ $rel_canonical = AMP_DOM_Utils::create_node(
1352
+ $dom,
1353
+ 'link',
1354
+ array(
1355
+ 'rel' => 'canonical',
1356
+ 'href' => self::get_current_canonical_url(),
1357
+ )
1358
+ );
1359
  $head->appendChild( $rel_canonical );
1360
  }
1361
 
1384
  }
1385
  if ( ! $meta_charset ) {
1386
  // Warning: This probably means the character encoding needs to be converted.
1387
+ $meta_charset = AMP_DOM_Utils::create_node(
1388
+ $dom,
1389
+ 'meta',
1390
+ array(
1391
+ 'charset' => 'utf-8',
1392
+ )
1393
+ );
1394
  } else {
1395
  $head->removeChild( $meta_charset ); // So we can move it.
1396
  }
1397
  $head->insertBefore( $meta_charset, $head->firstChild );
1398
 
1399
  if ( ! $meta_viewport ) {
1400
+ $meta_viewport = AMP_DOM_Utils::create_node(
1401
+ $dom,
1402
+ 'meta',
1403
+ array(
1404
+ 'name' => 'viewport',
1405
+ 'content' => 'width=device-width',
1406
+ )
1407
+ );
1408
  } else {
1409
  $head->removeChild( $meta_viewport ); // So we can move it.
1410
  }
1486
  $links['preload'] = array();
1487
  }
1488
 
1489
+ $prioritized_preloads[] = AMP_DOM_Utils::create_node(
1490
+ $dom,
1491
+ 'link',
1492
+ array(
1493
+ 'rel' => 'preload',
1494
+ 'as' => 'script',
1495
+ 'href' => $runtime_src,
1496
+ )
1497
+ );
1498
 
1499
  $amp_script_handles = array_keys( $amp_scripts );
1500
  foreach ( array_intersect( $render_delaying_extensions, $amp_script_handles ) as $script_handle ) {
1501
  if ( ! in_array( $script_handle, $render_delaying_extensions, true ) ) {
1502
  continue;
1503
  }
1504
+ $prioritized_preloads[] = AMP_DOM_Utils::create_node(
1505
+ $dom,
1506
+ 'link',
1507
+ array(
1508
+ 'rel' => 'preload',
1509
+ 'as' => 'script',
1510
+ 'href' => $amp_scripts[ $script_handle ]->getAttribute( 'src' ),
1511
+ )
1512
+ );
1513
  }
1514
  $links['preload'] = array_merge( $prioritized_preloads, $links['preload'] );
1515
 
1714
  );
1715
 
1716
  $current_url = amp_get_current_url();
1717
+ $non_amp_url = amp_remove_endpoint( $current_url );
1718
 
1719
  // When response caching is enabled, determine if it should be turned off for cache misses.
1720
  $caches_for_url = null;
1727
  * Set response cache hash, the data values dictates whether a new hash key should be generated or not.
1728
  * This is also used as the ETag.
1729
  */
1730
+ $response_cache_key = md5(
1731
+ wp_json_encode(
1732
+ array(
1733
+ $args,
1734
+ $response,
1735
+ self::$sanitizer_classes,
1736
+ self::$embed_handlers,
1737
+ AMP__VERSION,
1738
+ )
1739
+ )
1740
+ );
1741
 
1742
  /*
1743
  * Per rfc7232:
1748
  * not have been set yet during the WordPress template generation is
1749
  * the ETag. The AMP plugin sends a Vary header at amp_init.
1750
  */
1751
+ AMP_HTTP::send_header( 'ETag', '"' . $response_cache_key . '"' );
1752
 
1753
+ /*
1754
+ * Handle responses that are cached by the browser, returning 304 response if the response cache key
1755
+ * matches any ETags mentioned in If-None-Match request header. Note that if the client request indicates a
1756
+ * weak validator (prefixed by W/) then this will be ignored. The MD5 strings will be extracted from the
1757
+ * If-None-Match request header and if any of them match the $response_cache_key then a 304 Not Modified
1758
+ * response is returned.
1759
+ */
1760
+ $has_matching_etag = (
1761
+ isset( $_SERVER['HTTP_IF_NONE_MATCH'] )
1762
+ &&
1763
+ preg_match_all( '#\b[0-9a-f]{32}\b#', wp_unslash( $_SERVER['HTTP_IF_NONE_MATCH'] ), $etag_match_candidates )
1764
+ &&
1765
+ in_array( $response_cache_key, $etag_match_candidates[0], true )
1766
+ );
1767
+ if ( $has_matching_etag ) {
1768
  status_header( 304 );
1769
  return '';
1770
  }
1807
  // Redirect to non-AMP version.
1808
  if ( ! amp_is_canonical() && $blocking_error_count > 0 ) {
1809
  if ( AMP_Validation_Manager::has_cap() ) {
1810
+ $non_amp_url = add_query_arg( AMP_Validation_Manager::VALIDATION_ERRORS_QUERY_VAR, $blocking_error_count, $non_amp_url );
1811
  }
1812
+
1813
+ /*
1814
+ * Temporary redirect because AMP page may return with blocking validation errors when auto-accepting sanitization
1815
+ * is not enabled. A 302 will allow the errors to be fixed without needing to bust any redirect caches.
1816
+ */
1817
+ wp_safe_redirect( $non_amp_url, 302 );
1818
  }
1819
  return $response_cache['body'];
1820
  }
1969
  $cache_response( $response, $validation_results );
1970
  }
1971
 
1972
+ // Indicate the number of validation errors detected at runtime in a query var on the non-AMP page for display in the admin bar.
 
 
 
1973
  if ( AMP_Validation_Manager::has_cap() ) {
1974
+ $non_amp_url = add_query_arg( AMP_Validation_Manager::VALIDATION_ERRORS_QUERY_VAR, $blocking_error_count, $non_amp_url );
1975
  }
1976
+
1977
+ /*
1978
+ * Temporary redirect because AMP page may return with blocking validation errors when auto-accepting sanitization
1979
+ * is not enabled. A 302 will allow the errors to be fixed without needing to bust any redirect caches.
1980
+ */
1981
+ wp_safe_redirect( $non_amp_url, 302 );
1982
  return $response;
1983
  }
1984
  }
1989
  trigger_error( esc_html( sprintf( __( 'The database has the %s encoding when it needs to be utf-8 to work with AMP.', 'amp' ), get_bloginfo( 'charset' ) ) ), E_USER_WARNING ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_trigger_error
1990
  }
1991
 
1992
+ AMP_Validation_Manager::finalize_validation(
1993
+ $dom,
1994
+ array(
1995
+ 'remove_source_comments' => ! isset( $_GET['amp_preserve_source_comments'] ), // phpcs:ignore WordPress.Security.NonceVerification.Recommended
1996
+ )
1997
+ );
1998
 
1999
  // For service worker streaming, restore the script that was removed above and obtain the script that should be added to the body fragment.
2000
  $truncate_after_comment = null;
includes/embeds/class-amp-base-embed-handler.php CHANGED
@@ -40,25 +40,28 @@ abstract class AMP_Base_Embed_Handler {
40
  protected $did_convert_elements = false;
41
 
42
  /**
43
- * Register embed.
44
  */
45
  abstract public function register_embed();
46
 
47
  /**
48
- * Unregister embed.
49
  */
50
  abstract public function unregister_embed();
51
 
52
  /**
53
- * AMP_Base_Embed_Handler constructor.
54
  *
55
  * @param array $args Height and width for embed.
56
  */
57
  public function __construct( $args = array() ) {
58
- $this->args = wp_parse_args( $args, array(
59
- 'width' => $this->DEFAULT_WIDTH,
60
- 'height' => $this->DEFAULT_HEIGHT,
61
- ) );
 
 
 
62
  }
63
 
64
  /**
40
  protected $did_convert_elements = false;
41
 
42
  /**
43
+ * Registers embed.
44
  */
45
  abstract public function register_embed();
46
 
47
  /**
48
+ * Unregisters embed.
49
  */
50
  abstract public function unregister_embed();
51
 
52
  /**
53
+ * Constructor.
54
  *
55
  * @param array $args Height and width for embed.
56
  */
57
  public function __construct( $args = array() ) {
58
+ $this->args = wp_parse_args(
59
+ $args,
60
+ array(
61
+ 'width' => $this->DEFAULT_WIDTH,
62
+ 'height' => $this->DEFAULT_HEIGHT,
63
+ )
64
+ );
65
  }
66
 
67
  /**
includes/embeds/class-amp-core-block-handler.php CHANGED
@@ -13,105 +13,119 @@
13
  class AMP_Core_Block_Handler extends AMP_Base_Embed_Handler {
14
 
15
  /**
16
- * Original block callback.
17
  *
18
  * @var array
19
  */
20
- public $original_categories_callback;
21
-
22
- /**
23
- * Block name.
24
- *
25
- * @var string
26
- */
27
- public $block_name = 'core/categories';
28
 
29
  /**
30
  * Register embed.
31
  */
32
  public function register_embed() {
33
- if ( class_exists( 'WP_Block_Type_Registry' ) ) {
34
- $registry = WP_Block_Type_Registry::get_instance();
35
- $block = $registry->get_registered( $this->block_name );
36
-
37
- if ( $block ) {
38
- $this->original_categories_callback = $block->render_callback;
39
- $block->render_callback = array( $this, 'render' );
40
- }
41
- }
42
  }
43
 
44
  /**
45
  * Unregister embed.
46
  */
47
  public function unregister_embed() {
48
- if ( class_exists( 'WP_Block_Type_Registry' ) ) {
49
- $registry = WP_Block_Type_Registry::get_instance();
50
- $block = $registry->get_registered( $this->block_name );
51
 
52
- if ( $block && ! empty( $this->original_categories_callback ) ) {
53
- $block->render_callback = $this->original_categories_callback;
54
- $this->original_categories_callback = null;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  }
56
  }
 
57
  }
58
 
59
  /**
60
- * Render Gutenberg block. This is essentially the same method as the original.
61
- * Difference is excluding the disallowed JS script, adding <form> tags, and using on:change for <select>.
62
  *
63
- * @param array $attributes Attributes.
 
 
 
 
64
  * @return string Rendered.
65
  */
66
- public function render( $attributes ) {
67
  static $block_id = 0;
68
  $block_id++;
69
 
70
- $align = 'center';
71
- if ( isset( $attributes['align'] ) && in_array( $attributes['align'], array( 'left', 'right', 'full' ), true ) ) {
72
- $align = $attributes['align'];
73
- }
74
 
75
- $args = array(
76
- 'echo' => false,
77
- 'hierarchical' => ! empty( $attributes['showHierarchy'] ),
78
- 'orderby' => 'name',
79
- 'show_count' => ! empty( $attributes['showPostCounts'] ),
80
- 'title_li' => '',
81
  );
82
 
83
- if ( ! empty( $attributes['displayAsDropdown'] ) ) {
84
- $id = 'wp-block-categories-dropdown-' . $block_id;
85
- $form_id = $id . '-form';
86
- $args['id'] = $id;
87
- $args['show_option_none'] = __( 'Select Category', 'amp' );
88
- $wrapper_markup = '<div class="%1$s">%2$s</div>';
89
- $items_markup = wp_dropdown_categories( $args );
90
- $type = 'dropdown';
91
-
92
- $items_markup = preg_replace(
93
- '/(?<=<select\b)/',
94
- sprintf( ' on="change:%s.submit"', esc_attr( $form_id ) ),
95
- $items_markup,
96
- 1
97
- );
98
- } else {
99
- $wrapper_markup = '<div class="%1$s"><ul>%2$s</ul></div>';
100
- $items_markup = wp_list_categories( $args );
101
- $type = 'list';
102
- }
103
 
104
- $class = "wp-block-categories wp-block-categories-{$type} align{$align}";
 
105
 
106
- $block_content = sprintf(
107
- $wrapper_markup,
108
- esc_attr( $class ),
109
- $items_markup
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  );
111
 
112
- if ( ! empty( $attributes['displayAsDropdown'] ) ) {
113
- $block_content = sprintf( '<form action="%s" method="get" target="_top" id="%s">%s</form>', esc_url( home_url() ), esc_attr( $form_id ), $block_content );
114
- }
115
  return $block_content;
116
  }
 
117
  }
13
  class AMP_Core_Block_Handler extends AMP_Base_Embed_Handler {
14
 
15
  /**
16
+ * Methods to ampify blocks.
17
  *
18
  * @var array
19
  */
20
+ protected $block_ampify_methods = array(
21
+ 'core/categories' => 'ampify_categories_block',
22
+ 'core/archives' => 'ampify_archives_block',
23
+ );
 
 
 
 
24
 
25
  /**
26
  * Register embed.
27
  */
28
  public function register_embed() {
29
+ add_filter( 'render_block', array( $this, 'filter_rendered_block' ), 0, 2 );
 
 
 
 
 
 
 
 
30
  }
31
 
32
  /**
33
  * Unregister embed.
34
  */
35
  public function unregister_embed() {
36
+ remove_filter( 'render_block', array( $this, 'filter_rendered_block' ), 0 );
37
+ }
 
38
 
39
+ /**
40
+ * Filters the content of a single block to make it AMP valid.
41
+ *
42
+ * @param string $block_content The block content about to be appended.
43
+ * @param array $block The full block, including name and attributes.
44
+ * @return string Filtered block content.
45
+ */
46
+ public function filter_rendered_block( $block_content, $block ) {
47
+ if ( ! isset( $block['blockName'] ) ) {
48
+ return $block_content;
49
+ }
50
+ if ( isset( $this->block_ampify_methods[ $block['blockName'] ] ) ) {
51
+ $block_content = call_user_func(
52
+ array( $this, $this->block_ampify_methods[ $block['blockName'] ] ),
53
+ $block_content
54
+ );
55
+ } elseif ( 'core/image' === $block['blockName'] || 'core/audio' === $block['blockName'] ) {
56
+ /*
57
+ * While the video block placeholder just outputs an empty video element, the placeholders for image and
58
+ * audio blocks output empty <img> and <audio> respectively. These will result in AMP validation errors,
59
+ * so we need to empty out the block content to prevent this from happening. Note that <source> is used
60
+ * for <img> because eventually the image block could use <picture>.
61
+ */
62
+ if ( ! preg_match( '/src=|<source/', $block_content ) ) {
63
+ $block_content = '';
64
  }
65
  }
66
+ return $block_content;
67
  }
68
 
69
  /**
70
+ * Fix rendering of categories block when displayAsDropdown.
 
71
  *
72
+ * This excludes the disallowed JS scrips, adds <form> tags, and uses on:change for <select>.
73
+ *
74
+ * @see render_block_core_categories()
75
+ *
76
+ * @param string $block_content Block content.
77
  * @return string Rendered.
78
  */
79
+ public function ampify_categories_block( $block_content ) {
80
  static $block_id = 0;
81
  $block_id++;
82
 
83
+ $form_id = "wp-block-categories-dropdown-{$block_id}-form";
84
+
85
+ // Remove output of build_dropdown_script_block_core_categories().
86
+ $block_content = preg_replace( '#<script.+?</script>#s', '', $block_content );
87
 
88
+ $form = sprintf(
89
+ '<form action="%s" method="get" target="_top" id="%s">',
90
+ esc_url( home_url() ),
91
+ esc_attr( $form_id )
 
 
92
  );
93
 
94
+ $block_content = preg_replace(
95
+ '#(<select)(.+</select>)#s',
96
+ $form . '$1' . sprintf( ' on="change:%1$s.submit"', esc_attr( $form_id ) ) . '$2</form>',
97
+ $block_content,
98
+ 1
99
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
 
101
+ return $block_content;
102
+ }
103
 
104
+ /**
105
+ * Fix rendering of archives block when displayAsDropdown.
106
+ *
107
+ * This replaces disallowed script with the use of on:change for <select>.
108
+ *
109
+ * @see render_block_core_archives()
110
+ *
111
+ * @param string $block_content Block content.
112
+ * @return string Rendered.
113
+ */
114
+ public function ampify_archives_block( $block_content ) {
115
+
116
+ // Eliminate use of uniqid(). Core should be using wp_unique_id() here.
117
+ static $block_id = 0;
118
+ $block_id++;
119
+ $block_content = preg_replace( '/(?<="wp-block-archives-)\w+(?=")/', $block_id, $block_content );
120
+
121
+ // Replace onchange with on attribute.
122
+ $block_content = preg_replace(
123
+ '/onchange=".+?"/',
124
+ 'on="change:AMP.navigateTo(url=event.value)"',
125
+ $block_content
126
  );
127
 
 
 
 
128
  return $block_content;
129
  }
130
+
131
  }
includes/embeds/class-amp-dailymotion-embed.php CHANGED
@@ -116,17 +116,20 @@ class AMP_DailyMotion_Embed_Handler extends AMP_Base_Embed_Handler {
116
  */
117
  public function render( $args ) {
118
  $args = wp_parse_args(
119
- $args, array(
 
120
  'video_id' => false,
121
  )
122
  );
123
 
124
  if ( empty( $args['video_id'] ) ) {
125
  return AMP_HTML_Utils::build_tag(
126
- 'a', array(
 
127
  'href' => esc_url( $args['url'] ),
128
  'class' => 'amp-wp-embed-fallback',
129
- ), esc_html( $args['url'] )
 
130
  );
131
  }
132
 
116
  */
117
  public function render( $args ) {
118
  $args = wp_parse_args(
119
+ $args,
120
+ array(
121
  'video_id' => false,
122
  )
123
  );
124
 
125
  if ( empty( $args['video_id'] ) ) {
126
  return AMP_HTML_Utils::build_tag(
127
+ 'a',
128
+ array(
129
  'href' => esc_url( $args['url'] ),
130
  'class' => 'amp-wp-embed-fallback',
131
+ ),
132
+ esc_html( $args['url'] )
133
  );
134
  }
135
 
includes/embeds/class-amp-facebook-embed.php CHANGED
@@ -11,7 +11,18 @@
11
  class AMP_Facebook_Embed_Handler extends AMP_Base_Embed_Handler {
12
  const URL_PATTERN = '#https?://(www\.)?facebook\.com/.*#i';
13
 
 
 
 
 
 
14
  protected $DEFAULT_WIDTH = 600;
 
 
 
 
 
 
15
  protected $DEFAULT_HEIGHT = 400;
16
 
17
  /**
@@ -28,22 +39,46 @@ class AMP_Facebook_Embed_Handler extends AMP_Base_Embed_Handler {
28
  */
29
  private $amp_tag = 'amp-facebook';
30
 
 
 
 
31
  public function register_embed() {
32
  wp_embed_register_handler( $this->amp_tag, self::URL_PATTERN, array( $this, 'oembed' ), -1 );
33
  }
34
 
 
 
 
35
  public function unregister_embed() {
36
  wp_embed_unregister_handler( $this->amp_tag, -1 );
37
  }
38
 
 
 
 
 
 
 
 
 
 
39
  public function oembed( $matches, $attr, $url, $rawattr ) {
40
  return $this->render( array( 'url' => $url ) );
41
  }
42
 
 
 
 
 
 
 
43
  public function render( $args ) {
44
- $args = wp_parse_args( $args, array(
45
- 'url' => false,
46
- ) );
 
 
 
47
 
48
  if ( empty( $args['url'] ) ) {
49
  return '';
@@ -92,6 +127,24 @@ class AMP_Facebook_Embed_Handler extends AMP_Base_Embed_Handler {
92
  $this->create_amp_facebook_and_replace_node( $dom, $node, $embed_type );
93
  }
94
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  }
96
 
97
  /**
@@ -102,13 +155,22 @@ class AMP_Facebook_Embed_Handler extends AMP_Base_Embed_Handler {
102
  */
103
  private function get_embed_type( $node ) {
104
  $class_attr = $node->getAttribute( 'class' );
105
- if ( null !== $class_attr && $node->hasAttribute( 'data-href' ) ) {
106
- if ( false !== strpos( $class_attr, 'fb-post' ) ) {
107
- return 'post';
108
- } elseif ( false !== strpos( $class_attr, 'fb-video' ) ) {
109
- return 'video';
110
- }
111
- return false !== strpos( $class_attr, 'fb-video' ) ? 'video' : 'post';
 
 
 
 
 
 
 
 
 
112
  }
113
 
114
  return null;
@@ -122,15 +184,54 @@ class AMP_Facebook_Embed_Handler extends AMP_Base_Embed_Handler {
122
  * @param string $embed_type Embed type.
123
  */
124
  private function create_amp_facebook_and_replace_node( $dom, $node, $embed_type ) {
125
- $amp_facebook_node = AMP_DOM_Utils::create_node( $dom, $this->amp_tag, array(
126
- 'data-href' => $node->getAttribute( 'data-href' ),
127
- 'data-embed-as' => $embed_type,
128
- 'layout' => 'responsive',
129
- 'width' => $this->DEFAULT_WIDTH,
130
- 'height' => $this->DEFAULT_HEIGHT,
131
- ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
132
 
133
  $node->parentNode->replaceChild( $amp_facebook_node, $node );
 
 
 
134
 
135
  $this->did_convert_elements = true;
136
  }
11
  class AMP_Facebook_Embed_Handler extends AMP_Base_Embed_Handler {
12
  const URL_PATTERN = '#https?://(www\.)?facebook\.com/.*#i';
13
 
14
+ /**
15
+ * Default width.
16
+ *
17
+ * @var int
18
+ */
19
  protected $DEFAULT_WIDTH = 600;
20
+
21
+ /**
22
+ * Default height.
23
+ *
24
+ * @var int
25
+ */
26
  protected $DEFAULT_HEIGHT = 400;
27
 
28
  /**
39
  */
40
  private $amp_tag = 'amp-facebook';
41
 
42
+ /**
43
+ * Registers embed.
44
+ */
45
  public function register_embed() {
46
  wp_embed_register_handler( $this->amp_tag, self::URL_PATTERN, array( $this, 'oembed' ), -1 );
47
  }
48
 
49
+ /**
50
+ * Unregisters embed.
51
+ */
52
  public function unregister_embed() {
53
  wp_embed_unregister_handler( $this->amp_tag, -1 );
54
  }
55
 
56
+ /**
57
+ * WordPress OEmbed rendering callback.
58
+ *
59
+ * @param array $matches URL pattern matches.
60
+ * @param array $attr Matched attributes.
61
+ * @param string $url Matched URL.
62
+ * @param string $rawattr Raw attributes string.
63
+ * @return string HTML markup for rendered embed.
64
+ */
65
  public function oembed( $matches, $attr, $url, $rawattr ) {
66
  return $this->render( array( 'url' => $url ) );
67
  }
68
 
69
+ /**
70
+ * Gets the rendered embed markup.
71
+ *
72
+ * @param array $args Embed rendering arguments.
73
+ * @return string HTML markup for rendered embed.
74
+ */
75
  public function render( $args ) {
76
+ $args = wp_parse_args(
77
+ $args,
78
+ array(
79
+ 'url' => false,
80
+ )
81
+ );
82
 
83
  if ( empty( $args['url'] ) ) {
84
  return '';
127
  $this->create_amp_facebook_and_replace_node( $dom, $node, $embed_type );
128
  }
129
  }
130
+
131
+ /*
132
+ * Remove the fb-root div and the Facebook Connect JS script since irrelevant.
133
+ * <div id="fb-root"></div>
134
+ * <script async defer crossorigin="anonymous" src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.2"></script>
135
+ */
136
+ $fb_root = $dom->getElementById( 'fb-root' );
137
+ if ( $fb_root ) {
138
+ $xpath = new DOMXPath( $dom );
139
+ $scripts = array();
140
+ foreach ( $xpath->query( '//script[ starts-with( @src, "https://connect.facebook.net" ) and contains( @src, "sdk.js" ) ]' ) as $script ) {
141
+ $scripts[] = $script;
142
+ }
143
+ foreach ( $scripts as $script ) {
144
+ $script->parentNode->removeChild( $script );
145
+ }
146
+ $fb_root->parentNode->removeChild( $fb_root );
147
+ }
148
  }
149
 
150
  /**
155
  */
156
  private function get_embed_type( $node ) {
157
  $class_attr = $node->getAttribute( 'class' );
158
+ if ( null === $class_attr || ! $node->hasAttribute( 'data-href' ) ) {
159
+ return null;
160
+ }
161
+
162
+ if ( false !== strpos( $class_attr, 'fb-post' ) ) {
163
+ return 'post';
164
+ } elseif ( false !== strpos( $class_attr, 'fb-video' ) ) {
165
+ return 'video';
166
+ } elseif ( false !== strpos( $class_attr, 'fb-page' ) ) {
167
+ return 'page';
168
+ } elseif ( false !== strpos( $class_attr, 'fb-like' ) ) {
169
+ return 'like';
170
+ } elseif ( false !== strpos( $class_attr, 'fb-comments' ) ) {
171
+ return 'comments';
172
+ } elseif ( false !== strpos( $class_attr, 'fb-comment-embed' ) ) {
173
+ return 'comment';
174
  }
175
 
176
  return null;
184
  * @param string $embed_type Embed type.
185
  */
186
  private function create_amp_facebook_and_replace_node( $dom, $node, $embed_type ) {
187
+
188
+ $attributes = array(
189
+ 'layout' => 'responsive',
190
+ 'width' => $node->hasAttribute( 'data-width' ) ? $node->getAttribute( 'data-width' ) : $this->DEFAULT_WIDTH,
191
+ 'height' => $node->hasAttribute( 'data-height' ) ? $node->getAttribute( 'data-height' ) : $this->DEFAULT_HEIGHT,
192
+ );
193
+
194
+ $node->removeAttribute( 'data-width' );
195
+ $node->removeAttribute( 'data-height' );
196
+
197
+ foreach ( $node->attributes as $attribute ) {
198
+ if ( 'data-' === substr( $attribute->nodeName, 0, 5 ) ) {
199
+ $attributes[ $attribute->nodeName ] = $attribute->nodeValue;
200
+ }
201
+ }
202
+
203
+ if ( 'page' === $embed_type ) {
204
+ $amp_tag = 'amp-facebook-page';
205
+ } elseif ( 'like' === $embed_type ) {
206
+ $amp_tag = 'amp-facebook-like';
207
+ } elseif ( 'comments' === $embed_type ) {
208
+ $amp_tag = 'amp-facebook-comments';
209
+ } else {
210
+ $amp_tag = $this->amp_tag;
211
+
212
+ $attributes['data-embed-as'] = $embed_type;
213
+ }
214
+
215
+ $amp_facebook_node = AMP_DOM_Utils::create_node(
216
+ $dom,
217
+ $amp_tag,
218
+ $attributes
219
+ );
220
+
221
+ $fallback = null;
222
+ foreach ( $node->childNodes as $child_node ) {
223
+ if ( $child_node instanceof DOMElement && false !== strpos( $child_node->getAttribute( 'class' ), 'fb-xfbml-parse-ignore' ) ) {
224
+ $fallback = $child_node;
225
+ $child_node->parentNode->removeChild( $child_node );
226
+ $fallback->setAttribute( 'fallback', '' );
227
+ break;
228
+ }
229
+ }
230
 
231
  $node->parentNode->replaceChild( $amp_facebook_node, $node );
232
+ if ( $fallback ) {
233
+ $amp_facebook_node->appendChild( $fallback );
234
+ }
235
 
236
  $this->did_convert_elements = true;
237
  }
includes/embeds/class-amp-gallery-embed.php CHANGED
@@ -42,15 +42,19 @@ class AMP_Gallery_Embed_Handler extends AMP_Base_Embed_Handler {
42
  $attr['include'] = $attr['ids'];
43
  }
44
 
45
- $atts = shortcode_atts( array(
46
- 'order' => 'ASC',
47
- 'orderby' => 'menu_order ID',
48
- 'id' => $post ? $post->ID : 0,
49
- 'include' => '',
50
- 'exclude' => '',
51
- 'size' => array( $this->args['width'], $this->args['height'] ),
52
- 'link' => 'none',
53
- ), $attr, 'gallery' );
 
 
 
 
54
 
55
  if ( ! empty( $attr['amp-lightbox'] ) ) {
56
  $atts['lightbox'] = filter_var( $attr['amp-lightbox'], FILTER_VALIDATE_BOOLEAN );
@@ -59,36 +63,42 @@ class AMP_Gallery_Embed_Handler extends AMP_Base_Embed_Handler {
59
  $id = intval( $atts['id'] );
60
 
61
  if ( ! empty( $atts['include'] ) ) {
62
- $attachments = get_posts( array(
63
- 'include' => $atts['include'],
64
- 'post_status' => 'inherit',
65
- 'post_type' => 'attachment',
66
- 'post_mime_type' => 'image',
67
- 'order' => $atts['order'],
68
- 'orderby' => $atts['orderby'],
69
- 'fields' => 'ids',
70
- ) );
 
 
71
  } elseif ( ! empty( $atts['exclude'] ) ) {
72
- $attachments = get_children( array(
73
- 'post_parent' => $id,
74
- 'exclude' => $atts['exclude'],
75
- 'post_status' => 'inherit',
76
- 'post_type' => 'attachment',
77
- 'post_mime_type' => 'image',
78
- 'order' => $atts['order'],
79
- 'orderby' => $atts['orderby'],
80
- 'fields' => 'ids',
81
- ) );
 
 
82
  } else {
83
- $attachments = get_children( array(
84
- 'post_parent' => $id,
85
- 'post_status' => 'inherit',
86
- 'post_type' => 'attachment',
87
- 'post_mime_type' => 'image',
88
- 'order' => $atts['order'],
89
- 'orderby' => $atts['orderby'],
90
- 'fields' => 'ids',
91
- ) );
 
 
92
  }
93
 
94
  if ( empty( $attachments ) ) {
@@ -183,9 +193,12 @@ class AMP_Gallery_Embed_Handler extends AMP_Base_Embed_Handler {
183
  public function render( $args ) {
184
  $this->did_convert_elements = true;
185
 
186
- $args = wp_parse_args( $args, array(
187
- 'images' => false,
188
- ) );
 
 
 
189
 
190
  if ( empty( $args['images'] ) ) {
191
  return '';
42
  $attr['include'] = $attr['ids'];
43
  }
44
 
45
+ $atts = shortcode_atts(
46
+ array(
47
+ 'order' => 'ASC',
48
+ 'orderby' => 'menu_order ID',
49
+ 'id' => $post ? $post->ID : 0,
50
+ 'include' => '',
51
+ 'exclude' => '',
52
+ 'size' => array( $this->args['width'], $this->args['height'] ),
53
+ 'link' => 'none',
54
+ ),
55
+ $attr,
56
+ 'gallery'
57
+ );
58
 
59
  if ( ! empty( $attr['amp-lightbox'] ) ) {
60
  $atts['lightbox'] = filter_var( $attr['amp-lightbox'], FILTER_VALIDATE_BOOLEAN );
63
  $id = intval( $atts['id'] );
64
 
65
  if ( ! empty( $atts['include'] ) ) {
66
+ $attachments = get_posts(
67
+ array(
68
+ 'include' => $atts['include'],
69
+ 'post_status' => 'inherit',
70
+ 'post_type' => 'attachment',
71
+ 'post_mime_type' => 'image',
72
+ 'order' => $atts['order'],
73
+ 'orderby' => $atts['orderby'],
74
+ 'fields' => 'ids',
75
+ )
76
+ );
77
  } elseif ( ! empty( $atts['exclude'] ) ) {
78
+ $attachments = get_children(
79
+ array(
80
+ 'post_parent' => $id,
81
+ 'exclude' => $atts['exclude'],
82
+ 'post_status' => 'inherit',
83
+ 'post_type' => 'attachment',
84
+ 'post_mime_type' => 'image',
85
+ 'order' => $atts['order'],
86
+ 'orderby' => $atts['orderby'],
87
+ 'fields' => 'ids',
88
+ )
89
+ );
90
  } else {
91
+ $attachments = get_children(
92
+ array(
93
+ 'post_parent' => $id,
94
+ 'post_status' => 'inherit',
95
+ 'post_type' => 'attachment',
96
+ 'post_mime_type' => 'image',
97
+ 'order' => $atts['order'],
98
+ 'orderby' => $atts['orderby'],
99
+ 'fields' => 'ids',
100
+ )
101
+ );
102
  }
103
 
104
  if ( empty( $attachments ) ) {
193
  public function render( $args ) {
194
  $this->did_convert_elements = true;
195
 
196
+ $args = wp_parse_args(
197
+ $args,
198
+ array(
199
+ 'images' => false,
200
+ )
201
+ );
202
 
203
  if ( empty( $args['images'] ) ) {
204
  return '';
includes/embeds/class-amp-imgur-embed-handler.php CHANGED
@@ -61,9 +61,12 @@ class AMP_Imgur_Embed_Handler extends AMP_Base_Embed_Handler {
61
  * @return string Embed.
62
  */
63
  public function render( $args ) {
64
- $args = wp_parse_args( $args, array(
65
- 'url' => false,
66
- ) );
 
 
 
67
 
68
  if ( empty( $args['url'] ) ) {
69
  return '';
61
  * @return string Embed.
62
  */
63
  public function render( $args ) {
64
+ $args = wp_parse_args(
65
+ $args,
66
+ array(
67
+ 'url' => false,
68
+ )
69
+ );
70
 
71
  if ( empty( $args['url'] ) ) {
72
  return '';
includes/embeds/class-amp-instagram-embed.php CHANGED
@@ -12,9 +12,20 @@
12
  */
13
  class AMP_Instagram_Embed_Handler extends AMP_Base_Embed_Handler {
14
  const SHORT_URL_HOST = 'instagr.am';
15
- const URL_PATTERN = '#http(s?)://(www\.)?instagr(\.am|am\.com)/p/([^/?]+)#i';
16
 
 
 
 
 
 
17
  protected $DEFAULT_WIDTH = 600;
 
 
 
 
 
 
18
  protected $DEFAULT_HEIGHT = 600;
19
 
20
  /**
@@ -31,16 +42,28 @@ class AMP_Instagram_Embed_Handler extends AMP_Base_Embed_Handler {
31
  */
32
  private $amp_tag = 'amp-instagram';
33
 
 
 
 
34
  public function register_embed() {
35
  wp_embed_register_handler( $this->amp_tag, self::URL_PATTERN, array( $this, 'oembed' ), -1 );
36
  add_shortcode( 'instagram', array( $this, 'shortcode' ) );
37
  }
38
 
 
 
 
39
  public function unregister_embed() {
40
  wp_embed_unregister_handler( $this->amp_tag, -1 );
41
  remove_shortcode( 'instagram' );
42
  }
43
 
 
 
 
 
 
 
44
  public function shortcode( $attr ) {
45
  $url = false;
46
 
@@ -55,24 +78,56 @@ class AMP_Instagram_Embed_Handler extends AMP_Base_Embed_Handler {
55
 
56
  $instagram_id = $this->get_instagram_id_from_url( $url );
57
 
58
- return $this->render( array(
59
- 'url' => $url,
60
- 'instagram_id' => $instagram_id,
61
- ) );
 
 
62
  }
63
 
 
 
 
 
 
 
 
 
 
64
  public function oembed( $matches, $attr, $url, $rawattr ) {
65
- return $this->render( array( 'url' => $url, 'instagram_id' => end( $matches ) ) );
 
 
 
 
 
66
  }
67
 
 
 
 
 
 
 
68
  public function render( $args ) {
69
- $args = wp_parse_args( $args, array(
70
- 'url' => false,
71
- 'instagram_id' => false,
72
- ) );
 
 
 
73
 
74
  if ( empty( $args['instagram_id'] ) ) {
75
- return AMP_HTML_Utils::build_tag( 'a', array( 'href' => esc_url( $args['url'] ), 'class' => 'amp-wp-embed-fallback' ), esc_html( $args['url'] ) );
 
 
 
 
 
 
 
76
  }
77
 
78
  $this->did_convert_elements = true;
12
  */
13
  class AMP_Instagram_Embed_Handler extends AMP_Base_Embed_Handler {
14
  const SHORT_URL_HOST = 'instagr.am';
15
+ const URL_PATTERN = '#http(s?)://(www\.)?instagr(\.am|am\.com)/p/([^/?]+)#i';
16
 
17
+ /**
18
+ * Default width.
19
+ *
20
+ * @var int
21
+ */
22
  protected $DEFAULT_WIDTH = 600;
23
+
24
+ /**
25
+ * Default height.
26
+ *
27
+ * @var int
28
+ */
29
  protected $DEFAULT_HEIGHT = 600;
30
 
31
  /**
42
  */
43
  private $amp_tag = 'amp-instagram';
44
 
45
+ /**
46
+ * Registers embed.
47
+ */
48
  public function register_embed() {
49
  wp_embed_register_handler( $this->amp_tag, self::URL_PATTERN, array( $this, 'oembed' ), -1 );
50
  add_shortcode( 'instagram', array( $this, 'shortcode' ) );
51
  }
52
 
53
+ /**
54
+ * Unregisters embed.
55
+ */
56
  public function unregister_embed() {
57
  wp_embed_unregister_handler( $this->amp_tag, -1 );
58
  remove_shortcode( 'instagram' );
59
  }
60
 
61
+ /**
62
+ * WordPress shortcode rendering callback.
63
+ *
64
+ * @param array $attr Shortcode attributes.
65
+ * @return string HTML markup for rendered embed.
66
+ */
67
  public function shortcode( $attr ) {
68
  $url = false;
69
 
78
 
79
  $instagram_id = $this->get_instagram_id_from_url( $url );
80
 
81
+ return $this->render(
82
+ array(
83
+ 'url' => $url,
84
+ 'instagram_id' => $instagram_id,
85
+ )
86
+ );
87
  }
88
 
89
+ /**
90
+ * WordPress OEmbed rendering callback.
91
+ *
92
+ * @param array $matches URL pattern matches.
93
+ * @param array $attr Matched attributes.
94
+ * @param string $url Matched URL.
95
+ * @param string $rawattr Raw attributes string.
96
+ * @return string HTML markup for rendered embed.
97
+ */
98
  public function oembed( $matches, $attr, $url, $rawattr ) {
99
+ return $this->render(
100
+ array(
101
+ 'url' => $url,
102
+ 'instagram_id' => end( $matches ),
103
+ )
104
+ );
105
  }
106
 
107
+ /**
108
+ * Gets the rendered embed markup.
109
+ *
110
+ * @param array $args Embed rendering arguments.
111
+ * @return string HTML markup for rendered embed.
112
+ */
113
  public function render( $args ) {
114
+ $args = wp_parse_args(
115
+ $args,
116
+ array(
117
+ 'url' => false,
118
+ 'instagram_id' => false,
119
+ )
120
+ );
121
 
122
  if ( empty( $args['instagram_id'] ) ) {
123
+ return AMP_HTML_Utils::build_tag(
124
+ 'a',
125
+ array(
126
+ 'href' => esc_url( $args['url'] ),
127
+ 'class' => 'amp-wp-embed-fallback',
128
+ ),
129
+ esc_html( $args['url'] )
130
+ );
131
  }
132
 
133
  $this->did_convert_elements = true;
includes/embeds/class-amp-pinterest-embed.php CHANGED
@@ -12,29 +12,65 @@ class AMP_Pinterest_Embed_Handler extends AMP_Base_Embed_Handler {
12
 
13
  const URL_PATTERN = '#https?://(www\.)?pinterest\.com/pin/.*#i';
14
 
 
 
 
 
 
15
  protected $DEFAULT_WIDTH = 450;
 
 
 
 
 
 
16
  protected $DEFAULT_HEIGHT = 750;
17
 
 
 
 
18
  public function register_embed() {
19
  wp_embed_register_handler(
20
  'amp-pinterest',
21
  self::URL_PATTERN,
22
- array($this, 'oembed'),
23
- -1);
 
24
  }
25
 
 
 
 
26
  public function unregister_embed() {
27
- wp_embed_unregister_handler('amp-pinterest', -1);
28
  }
29
 
 
 
 
 
 
 
 
 
 
30
  public function oembed( $matches, $attr, $url, $rawattr ) {
31
  return $this->render( array( 'url' => $url ) );
32
  }
33
 
 
 
 
 
 
 
34
  public function render( $args ) {
35
- $args = wp_parse_args( $args, array(
36
- 'url' => false,
37
- ) );
 
 
 
38
 
39
  if ( empty( $args['url'] ) ) {
40
  return '';
@@ -45,9 +81,9 @@ class AMP_Pinterest_Embed_Handler extends AMP_Base_Embed_Handler {
45
  return AMP_HTML_Utils::build_tag(
46
  'amp-pinterest',
47
  array(
48
- 'width' => $this->args['width'],
49
- 'height' => $this->args['height'],
50
- 'data-do' => "embedPin",
51
  'data-url' => $args['url'],
52
  )
53
  );
12
 
13
  const URL_PATTERN = '#https?://(www\.)?pinterest\.com/pin/.*#i';
14
 
15
+ /**
16
+ * Default width.
17
+ *
18
+ * @var int
19
+ */
20
  protected $DEFAULT_WIDTH = 450;
21
+
22
+ /**
23
+ * Default height.
24
+ *
25
+ * @var int
26
+ */
27
  protected $DEFAULT_HEIGHT = 750;
28
 
29
+ /**
30
+ * Registers embed.
31
+ */
32
  public function register_embed() {
33
  wp_embed_register_handler(
34
  'amp-pinterest',
35
  self::URL_PATTERN,
36
+ array( $this, 'oembed' ),
37
+ -1
38
+ );
39
  }
40
 
41
+ /**
42
+ * Unregisters embed.
43
+ */
44
  public function unregister_embed() {
45
+ wp_embed_unregister_handler( 'amp-pinterest', -1 );
46
  }
47
 
48
+ /**
49
+ * WordPress OEmbed rendering callback.
50
+ *
51
+ * @param array $matches URL pattern matches.
52
+ * @param array $attr Matched attributes.
53
+ * @param string $url Matched URL.
54
+ * @param string $rawattr Raw attributes string.
55
+ * @return string HTML markup for rendered embed.
56
+ */
57
  public function oembed( $matches, $attr, $url, $rawattr ) {
58
  return $this->render( array( 'url' => $url ) );
59
  }
60
 
61
+ /**
62
+ * Gets the rendered embed markup.
63
+ *
64
+ * @param array $args Embed rendering arguments.
65
+ * @return string HTML markup for rendered embed.
66
+ */
67
  public function render( $args ) {
68
+ $args = wp_parse_args(
69
+ $args,
70
+ array(
71
+ 'url' => false,
72
+ )
73
+ );
74
 
75
  if ( empty( $args['url'] ) ) {
76
  return '';
81
  return AMP_HTML_Utils::build_tag(
82
  'amp-pinterest',
83
  array(
84
+ 'width' => $this->args['width'],
85
+ 'height' => $this->args['height'],
86
+ 'data-do' => 'embedPin',
87
  'data-url' => $args['url'],
88
  )
89
  );
includes/embeds/class-amp-playlist-embed-handler.php CHANGED
@@ -221,13 +221,13 @@ class AMP_Playlist_Embed_Handler extends AMP_Base_Embed_Handler {
221
  ?>
222
  <div class="wp-playlist wp-video-playlist wp-playlist-light">
223
  <amp-state id="<?php echo esc_attr( $state_id ); ?>">
224
- <script type="application/json"><?php echo wp_json_encode( $amp_state ); // WPCS: XSS ok. ?></script>
225
  </amp-state>
226
  <amp-video id="amp-video" src="<?php echo esc_url( $data['tracks'][0]['src'] ); ?>" [src]="<?php echo esc_attr( $src_bound ); ?>" width="<?php echo esc_attr( $width ); ?>" height="<?php echo esc_attr( $height ); ?>" controls></amp-video>
227
  <?php $this->print_tracks( $state_id, $data['tracks'] ); ?>
228
  </div>
229
  <?php
230
- return ob_get_clean(); // WPCS: XSS ok.
231
  }
232
 
233
  /**
221
  ?>
222
  <div class="wp-playlist wp-video-playlist wp-playlist-light">
223
  <amp-state id="<?php echo esc_attr( $state_id ); ?>">
224
+ <script type="application/json"><?php echo wp_json_encode( $amp_state ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></script>
225
  </amp-state>
226
  <amp-video id="amp-video" src="<?php echo esc_url( $data['tracks'][0]['src'] ); ?>" [src]="<?php echo esc_attr( $src_bound ); ?>" width="<?php echo esc_attr( $width ); ?>" height="<?php echo esc_attr( $height ); ?>" controls></amp-video>
227
  <?php $this->print_tracks( $state_id, $data['tracks'] ); ?>
228
  </div>
229
  <?php
230
+ return ob_get_clean(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
231
  }
232
 
233
  /**
includes/embeds/class-amp-reddit-embed-handler.php CHANGED
@@ -50,9 +50,12 @@ class AMP_Reddit_Embed_Handler extends AMP_Base_Embed_Handler {
50
  * @return string Rendered content.
51
  */
52
  public function render( $args ) {
53
- $args = wp_parse_args( $args, array(
54
- 'url' => false,
55
- ) );
 
 
 
56
 
57
  if ( empty( $args['url'] ) ) {
58
  return '';
50
  * @return string Rendered content.
51
  */
52
  public function render( $args ) {
53
+ $args = wp_parse_args(
54
+ $args,
55
+ array(
56
+ 'url' => false,
57
+ )
58
+ );
59
 
60
  if ( empty( $args['url'] ) ) {
61
  return '';
includes/embeds/class-amp-soundcloud-embed.php CHANGED
@@ -17,7 +17,7 @@ class AMP_SoundCloud_Embed_Handler extends AMP_Base_Embed_Handler {
17
  *
18
  * @var int
19
  */
20
- protected $DEFAULT_HEIGHT = 200; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.MemberNotSnakeCase
21
 
22
  /**
23
  * Register embed.
@@ -81,9 +81,11 @@ class AMP_SoundCloud_Embed_Handler extends AMP_Base_Embed_Handler {
81
  $query = array();
82
  parse_str( wp_parse_url( $src, PHP_URL_QUERY ), $query );
83
  if ( ! empty( $query['url'] ) ) {
84
- $embed = $this->render( array(
85
- 'track_id' => $this->get_track_id_from_url( $query['url'] ),
86
- ) );
 
 
87
  }
88
  }
89
  return $embed;
@@ -133,10 +135,13 @@ class AMP_SoundCloud_Embed_Handler extends AMP_Base_Embed_Handler {
133
  * @global WP_Embed $wp_embed
134
  */
135
  public function render( $args ) {
136
- $args = wp_parse_args( $args, array(
137
- 'track_id' => false,
138
- 'url' => null,
139
- ) );
 
 
 
140
 
141
  if ( empty( $args['track_id'] ) ) {
142
  return $this->render_embed_fallback( $args['url'] );
@@ -161,7 +166,8 @@ class AMP_SoundCloud_Embed_Handler extends AMP_Base_Embed_Handler {
161
  * @returns string
162
  */
163
  private function render_embed_fallback( $url ) {
164
- return AMP_HTML_Utils::build_tag( 'a',
 
165
  array(
166
  'href' => esc_url( $url ),
167
  'class' => 'amp-wp-embed-fallback',
17
  *
18
  * @var int
19
  */
20
+ protected $DEFAULT_HEIGHT = 200;
21
 
22
  /**
23
  * Register embed.
81
  $query = array();
82
  parse_str( wp_parse_url( $src, PHP_URL_QUERY ), $query );
83
  if ( ! empty( $query['url'] ) ) {
84
+ $embed = $this->render(
85
+ array(
86
+ 'track_id' => $this->get_track_id_from_url( $query['url'] ),
87
+ )
88
+ );
89
  }
90
  }
91
  return $embed;
135
  * @global WP_Embed $wp_embed
136
  */
137
  public function render( $args ) {
138
+ $args = wp_parse_args(
139
+ $args,
140
+ array(
141
+ 'track_id' => false,
142
+ 'url' => null,
143
+ )
144
+ );
145
 
146
  if ( empty( $args['track_id'] ) ) {
147
  return $this->render_embed_fallback( $args['url'] );
166
  * @returns string
167
  */
168
  private function render_embed_fallback( $url ) {
169
+ return AMP_HTML_Utils::build_tag(
170
+ 'a',
171
  array(
172
  'href' => esc_url( $url ),
173
  'class' => 'amp-wp-embed-fallback',
includes/embeds/class-amp-twitter-embed.php CHANGED
@@ -43,7 +43,7 @@ class AMP_Twitter_Embed_Handler extends AMP_Base_Embed_Handler {
43
  private $amp_tag = 'amp-twitter';
44
 
45
  /**
46
- * Register embed.
47
  */
48
  public function register_embed() {
49
  add_shortcode( 'tweet', array( $this, 'shortcode' ) ); // Note: This is a Jetpack shortcode.
@@ -52,7 +52,7 @@ class AMP_Twitter_Embed_Handler extends AMP_Base_Embed_Handler {
52
  }
53
 
54
  /**
55
- * Unregister embed.
56
  */
57
  public function unregister_embed() {
58
  remove_shortcode( 'tweet' ); // Note: This is a Jetpack shortcode.
@@ -69,9 +69,12 @@ class AMP_Twitter_Embed_Handler extends AMP_Base_Embed_Handler {
69
  * @return string Twitter shortcode markup.
70
  */
71
  public function shortcode( $attr ) {
72
- $attr = wp_parse_args( $attr, array(
73
- 'tweet' => false,
74
- ) );
 
 
 
75
 
76
  if ( empty( $attr['tweet'] ) && ! empty( $attr[0] ) ) {
77
  $attr['tweet'] = $attr[0];
@@ -226,12 +229,16 @@ class AMP_Twitter_Embed_Handler extends AMP_Base_Embed_Handler {
226
  return;
227
  }
228
 
229
- $new_node = AMP_DOM_Utils::create_node( $dom, $this->amp_tag, array(
230
- 'width' => $this->DEFAULT_WIDTH,
231
- 'height' => $this->DEFAULT_HEIGHT,
232
- 'layout' => 'responsive',
233
- 'data-tweetid' => $tweet_id,
234
- ) );
 
 
 
 
235
 
236
  $this->sanitize_embed_script( $node );
237
 
43
  private $amp_tag = 'amp-twitter';
44
 
45
  /**
46
+ * Registers embed.
47
  */
48
  public function register_embed() {
49
  add_shortcode( 'tweet', array( $this, 'shortcode' ) ); // Note: This is a Jetpack shortcode.
52
  }
53
 
54
  /**
55
+ * Unregisters embed.
56
  */
57
  public function unregister_embed() {
58
  remove_shortcode( 'tweet' ); // Note: This is a Jetpack shortcode.
69
  * @return string Twitter shortcode markup.
70
  */
71
  public function shortcode( $attr ) {
72
+ $attr = wp_parse_args(
73
+ $attr,
74
+ array(
75
+ 'tweet' => false,
76
+ )
77
+ );
78
 
79
  if ( empty( $attr['tweet'] ) && ! empty( $attr[0] ) ) {
80
  $attr['tweet'] = $attr[0];
229
  return;
230
  }
231
 
232
+ $new_node = AMP_DOM_Utils::create_node(
233
+ $dom,
234
+ $this->amp_tag,
235
+ array(
236
+ 'width' => $this->DEFAULT_WIDTH,
237
+ 'height' => $this->DEFAULT_HEIGHT,
238
+ 'layout' => 'responsive',
239
+ 'data-tweetid' => $tweet_id,
240
+ )
241
+ );
242
 
243
  $this->sanitize_embed_script( $node );
244
 
includes/embeds/class-amp-vimeo-embed.php CHANGED
@@ -122,17 +122,20 @@ class AMP_Vimeo_Embed_Handler extends AMP_Base_Embed_Handler {
122
  */
123
  public function render( $args ) {
124
  $args = wp_parse_args(
125
- $args, array(
 
126
  'video_id' => false,
127
  )
128
  );
129
 
130
  if ( empty( $args['video_id'] ) ) {
131
  return AMP_HTML_Utils::build_tag(
132
- 'a', array(
 
133
  'href' => esc_url( $args['url'] ),
134
  'class' => 'amp-wp-embed-fallback',
135
- ), esc_html( $args['url'] )
 
136
  );
137
  }
138
 
122
  */
123
  public function render( $args ) {
124
  $args = wp_parse_args(
125
+ $args,
126
+ array(
127
  'video_id' => false,
128
  )
129
  );
130
 
131
  if ( empty( $args['video_id'] ) ) {
132
  return AMP_HTML_Utils::build_tag(
133
+ 'a',
134
+ array(
135
  'href' => esc_url( $args['url'] ),
136
  'class' => 'amp-wp-embed-fallback',
137
+ ),
138
+ esc_html( $args['url'] )
139
  );
140
  }
141
 
includes/embeds/class-amp-vine-embed.php CHANGED
@@ -11,29 +11,76 @@
11
  class AMP_Vine_Embed_Handler extends AMP_Base_Embed_Handler {
12
  const URL_PATTERN = '#https?://vine\.co/v/([^/?]+)#i';
13
 
 
 
 
 
 
14
  protected $DEFAULT_WIDTH = 400;
 
 
 
 
 
 
15
  protected $DEFAULT_HEIGHT = 400;
16
 
 
 
 
17
  public function register_embed() {
18
  wp_embed_register_handler( 'amp-vine', self::URL_PATTERN, array( $this, 'oembed' ), -1 );
19
  }
20
 
 
 
 
21
  public function unregister_embed() {
22
  wp_embed_unregister_handler( 'amp-vine', -1 );
23
  }
24
 
 
 
 
 
 
 
 
 
 
25
  public function oembed( $matches, $attr, $url, $rawattr ) {
26
- return $this->render( array( 'url' => $url, 'vine_id' => end( $matches ) ) );
 
 
 
 
 
27
  }
28
 
 
 
 
 
 
 
29
  public function render( $args ) {
30
- $args = wp_parse_args( $args, array(
31
- 'url' => false,
32
- 'vine_id' => false,
33
- ) );
 
 
 
34
 
35
  if ( empty( $args['vine_id'] ) ) {
36
- return AMP_HTML_Utils::build_tag( 'a', array( 'href' => esc_url( $args['url'] ), 'class' => 'amp-wp-embed-fallback' ), esc_html( $args['url'] ) );
 
 
 
 
 
 
 
37
  }
38
 
39
  $this->did_convert_elements = true;
@@ -42,9 +89,9 @@ class AMP_Vine_Embed_Handler extends AMP_Base_Embed_Handler {
42
  'amp-vine',
43
  array(
44
  'data-vineid' => $args['vine_id'],
45
- 'layout' => 'responsive',
46
- 'width' => $this->args['width'],
47
- 'height' => $this->args['height'],
48
  )
49
  );
50
  }
11
  class AMP_Vine_Embed_Handler extends AMP_Base_Embed_Handler {
12
  const URL_PATTERN = '#https?://vine\.co/v/([^/?]+)#i';
13
 
14
+ /**
15
+ * Default width.
16
+ *
17
+ * @var int
18
+ */
19
  protected $DEFAULT_WIDTH = 400;
20
+
21
+ /**
22
+ * Default height.
23
+ *
24
+ * @var int
25
+ */
26
  protected $DEFAULT_HEIGHT = 400;
27
 
28
+ /**
29
+ * Registers embed.
30
+ */
31
  public function register_embed() {
32
  wp_embed_register_handler( 'amp-vine', self::URL_PATTERN, array( $this, 'oembed' ), -1 );
33
  }
34
 
35
+ /**
36
+ * Unregisters embed.
37
+ */
38
  public function unregister_embed() {
39
  wp_embed_unregister_handler( 'amp-vine', -1 );
40
  }
41
 
42
+ /**
43
+ * WordPress OEmbed rendering callback.
44
+ *
45
+ * @param array $matches URL pattern matches.
46
+ * @param array $attr Matched attributes.
47
+ * @param string $url Matched URL.
48
+ * @param string $rawattr Raw attributes string.
49
+ * @return string HTML markup for rendered embed.
50
+ */
51
  public function oembed( $matches, $attr, $url, $rawattr ) {
52
+ return $this->render(
53
+ array(
54
+ 'url' => $url,
55
+ 'vine_id' => end( $matches ),
56
+ )
57
+ );
58
  }
59
 
60
+ /**
61
+ * Gets the rendered embed markup.
62
+ *
63
+ * @param array $args Embed rendering arguments.
64
+ * @return string HTML markup for rendered embed.
65
+ */
66
  public function render( $args ) {
67
+ $args = wp_parse_args(
68
+ $args,
69
+ array(
70
+ 'url' => false,
71
+ 'vine_id' => false,
72
+ )
73
+ );
74
 
75
  if ( empty( $args['vine_id'] ) ) {
76
+ return AMP_HTML_Utils::build_tag(
77
+ 'a',
78
+ array(
79
+ 'href' => esc_url( $args['url'] ),
80
+ 'class' => 'amp-wp-embed-fallback',
81
+ ),
82
+ esc_html( $args['url'] )
83
+ );
84
  }
85
 
86
  $this->did_convert_elements = true;
89
  'amp-vine',
90
  array(
91
  'data-vineid' => $args['vine_id'],
92
+ 'layout' => 'responsive',
93
+ 'width' => $this->args['width'],
94
+ 'height' => $this->args['height'],
95
  )
96
  );
97
  }
includes/embeds/class-amp-youtube-embed.php CHANGED
@@ -114,17 +114,20 @@ class AMP_YouTube_Embed_Handler extends AMP_Base_Embed_Handler {
114
  */
115
  public function render( $args ) {
116
  $args = wp_parse_args(
117
- $args, array(
 
118
  'video_id' => false,
119
  )
120
  );
121
 
122
  if ( empty( $args['video_id'] ) ) {
123
  return AMP_HTML_Utils::build_tag(
124
- 'a', array(
 
125
  'href' => esc_url( $args['url'] ),
126
  'class' => 'amp-wp-embed-fallback',
127
- ), esc_html( $args['url'] )
 
128
  );
129
  }
130
 
@@ -158,7 +161,8 @@ class AMP_YouTube_Embed_Handler extends AMP_Base_Embed_Handler {
158
  $video_id = $parts[1];
159
  }
160
  } else {
161
- /* The query looks like ?v={id} or ?list={id} */
 
162
  parse_str( $parsed_url['query'], $query_args );
163
 
164
  if ( isset( $query_args['v'] ) ) {
114
  */
115
  public function render( $args ) {
116
  $args = wp_parse_args(
117
+ $args,
118
+ array(
119
  'video_id' => false,
120
  )
121
  );
122
 
123
  if ( empty( $args['video_id'] ) ) {
124
  return AMP_HTML_Utils::build_tag(
125
+ 'a',
126
+ array(
127
  'href' => esc_url( $args['url'] ),
128
  'class' => 'amp-wp-embed-fallback',
129
+ ),
130
+ esc_html( $args['url'] )
131
  );
132
  }
133
 
161
  $video_id = $parts[1];
162
  }
163
  } else {
164
+ /* phpcs:ignore Squiz.PHP.CommentedOutCode.Found
165
+ The query looks like ?v={id} or ?list={id} */
166
  parse_str( $parsed_url['query'], $query_args );
167
 
168
  if ( isset( $query_args['v'] ) ) {
includes/options/class-amp-analytics-options-submenu.php CHANGED
@@ -10,24 +10,53 @@
10
  */
11
  class AMP_Analytics_Options_Submenu {
12
 
 
 
 
 
 
13
  private $parent_menu_slug;
 
 
 
 
 
 
14
  private $menu_slug;
 
 
 
 
 
 
15
  private $menu_page;
16
 
 
 
 
 
 
17
  public function __construct( $parent_menu_slug ) {
18
  $this->parent_menu_slug = $parent_menu_slug;
19
  $this->menu_slug = 'amp-analytics-options';
20
  $this->menu_page = new AMP_Analytics_Options_Submenu_Page();
21
  }
22
 
 
 
 
23
  public function init() {
24
  $this->add_submenu();
 
25
  add_action(
26
  'admin_print_styles-amp_page_' . $this->menu_slug,
27
  array( $this, 'amp_options_styles' )
28
  );
29
  }
30
 
 
 
 
31
  private function add_submenu() {
32
  add_submenu_page(
33
  $this->parent_menu_slug,
@@ -39,6 +68,9 @@ class AMP_Analytics_Options_Submenu {
39
  );
40
  }
41
 
 
 
 
42
  public function amp_options_styles() {
43
  ?>
44
  <style>
@@ -54,8 +86,7 @@ class AMP_Analytics_Options_Submenu {
54
  .amp-analytics-options.notice {
55
  width: 300px;
56
  }
57
- </style>;
58
-
59
  <?php
60
  }
61
  }
10
  */
11
  class AMP_Analytics_Options_Submenu {
12
 
13
+ /**
14
+ * Parent menu slug for the submenu.
15
+ *
16
+ * @var string
17
+ */
18
  private $parent_menu_slug;
19
+
20
+ /**
21
+ * Slug for the submenu.
22
+ *
23
+ * @var string
24
+ */
25
  private $menu_slug;
26
+
27
+ /**
28
+ * Menu page instance for rendering the content.
29
+ *
30
+ * @var AMP_Analytics_Options_Submenu_Page
31
+ */
32
  private $menu_page;
33
 
34
+ /**
35
+ * Constructor.
36
+ *
37
+ * @param string $parent_menu_slug Slug of the parent menu item.
38
+ */
39
  public function __construct( $parent_menu_slug ) {
40
  $this->parent_menu_slug = $parent_menu_slug;
41
  $this->menu_slug = 'amp-analytics-options';
42
  $this->menu_page = new AMP_Analytics_Options_Submenu_Page();
43
  }
44
 
45
+ /**
46
+ * Adds the submenu item and adds necessary hooks.
47
+ */
48
  public function init() {
49
  $this->add_submenu();
50
+
51
  add_action(
52
  'admin_print_styles-amp_page_' . $this->menu_slug,
53
  array( $this, 'amp_options_styles' )
54
  );
55
  }
56
 
57
+ /**
58
+ * Adds the submenu page and registers the rendering callback.
59
+ */
60
  private function add_submenu() {
61
  add_submenu_page(
62
  $this->parent_menu_slug,
68
  );
69
  }
70
 
71
+ /**
72
+ * Prints extra styles for the page content.
73
+ */
74
  public function amp_options_styles() {
75
  ?>
76
  <style>
86
  .amp-analytics-options.notice {
87
  width: 300px;
88
  }
89
+ </style>
 
90
  <?php
91
  }
92
  }
includes/options/class-amp-options-manager.php CHANGED
@@ -234,7 +234,7 @@ class AMP_Options_Manager {
234
  */
235
  public static function check_supported_post_type_update_errors() {
236
 
237
- // If all templates are supported then skip check since all post types are also supported. This option only applies with native/paired theme support.
238
  if ( self::get_option( 'all_templates_supported', false ) && 'disabled' !== self::get_option( 'theme_support' ) ) {
239
  return;
240
  }
@@ -379,6 +379,9 @@ class AMP_Options_Manager {
379
  .amp-welcome-notice {
380
  padding: 38px;
381
  }
 
 
 
382
  .amp-welcome-icon-holder {
383
  width: 200px;
384
  height: 200px;
@@ -410,10 +413,12 @@ class AMP_Options_Manager {
410
  public static function persistent_object_caching_notice() {
411
  if ( ! wp_using_ext_object_cache() && 'toplevel_page_' . self::OPTION_NAME === get_current_screen()->id ) {
412
  printf(
413
- '<div class="notice notice-warning"><p>%s <a href="%s">%s</a></p></div>',
414
- esc_html__( 'The AMP plugin performs at its best when persistent object cache is enabled.', 'amp' ),
415
- esc_url( 'https://codex.wordpress.org/Class_Reference/WP_Object_Cache#Persistent_Caching' ),
416
- esc_html__( 'More details', 'amp' )
 
 
417
  );
418
  }
419
  }
@@ -433,10 +438,12 @@ class AMP_Options_Manager {
433
  }
434
 
435
  printf(
436
- '<div class="notice notice-warning is-dismissible"><p>%s <a href="%s">%s</a></p></div>',
437
- esc_html__( "The AMP plugin's post-processor cache disabled due to the detection of highly-variable content.", 'amp' ),
438
- esc_url( 'https://github.com/ampproject/amp-wp/wiki/Post-Processor-Cache' ),
439
- esc_html__( 'More details', 'amp' )
 
 
440
  );
441
  }
442
 
@@ -465,9 +472,9 @@ class AMP_Options_Manager {
465
  printf(
466
  '<div class="notice notice-warning"><p>%s</p></div>',
467
  sprintf(
468
- /* translators: %s is location where conflicting lib was found */
469
- esc_html__( "A conflicting version of PHP-CSS-Parser appears to be installed by another plugin/theme (located in '%s'). Because of this CSS processing will be limited, and tree shaking will not be available.", 'amp' ),
470
- esc_html( $source_dir )
471
  )
472
  );
473
  } catch ( ReflectionException $e ) {
@@ -517,7 +524,7 @@ class AMP_Options_Manager {
517
  $theme_support['paired'] = 'paired' === $template_mode;
518
  add_theme_support( AMP_Theme_Support::SLUG, $theme_support );
519
  } else {
520
- remove_theme_support( AMP_Theme_Support::SLUG ); // So that the amp_get_permalink() will work for classic URL.
521
  }
522
 
523
  $url = amp_admin_get_preview_permalink();
@@ -528,12 +535,14 @@ class AMP_Options_Manager {
528
  $validation = AMP_Validation_Manager::validate_url( $url );
529
 
530
  if ( is_wp_error( $validation ) ) {
531
- $review_messages[] = esc_html( sprintf(
532
- /* translators: %1$s is the error message, %2$s is the error code */
533
- __( 'However, there was an error when checking the AMP validity for your site.', 'amp' ),
534
- $validation->get_error_message(),
535
- $validation->get_error_code()
536
- ) );
 
 
537
 
538
  $error_message = $validation->get_error_message();
539
  if ( $error_message ) {
@@ -633,7 +642,7 @@ class AMP_Options_Manager {
633
  }
634
  break;
635
  case 'paired':
636
- $message = esc_html__( 'Paired mode activated!', 'amp' );
637
  if ( $review_messages ) {
638
  $message .= ' ' . join( ' ', $review_messages );
639
  }
@@ -642,7 +651,7 @@ class AMP_Options_Manager {
642
  $message = wp_kses_post(
643
  sprintf(
644
  /* translators: %s is an AMP URL */
645
- __( 'Classic mode activated! View the <a href="%s">AMP version of a recent post</a>. It is recommended that you upgrade to Native or Paired mode.', 'amp' ),
646
  esc_url( $url )
647
  )
648
  );
234
  */
235
  public static function check_supported_post_type_update_errors() {
236
 
237
+ // If all templates are supported then skip check since all post types are also supported. This option only applies with native/transitional theme support.
238
  if ( self::get_option( 'all_templates_supported', false ) && 'disabled' !== self::get_option( 'theme_support' ) ) {
239
  return;
240
  }
379
  .amp-welcome-notice {
380
  padding: 38px;
381
  }
382
+ .amp-welcome-notice + .notice {
383
+ clear: both;
384
+ }
385
  .amp-welcome-icon-holder {
386
  width: 200px;
387
  height: 200px;
413
  public static function persistent_object_caching_notice() {
414
  if ( ! wp_using_ext_object_cache() && 'toplevel_page_' . self::OPTION_NAME === get_current_screen()->id ) {
415
  printf(
416
+ '<div class="notice notice-warning"><p>%s</p></div>',
417
+ sprintf(
418
+ /* translators: %s: Persistent object cache support URL */
419
+ __( 'The AMP plugin performs at its best when persistent object cache is enabled. <a href="%s">More details</a>', 'amp' ), // phpcs:ignore WordPress.Security.EscapeOutput
420
+ esc_url( __( 'https://codex.wordpress.org/Class_Reference/WP_Object_Cache#Persistent_Caching', 'amp' ) )
421
+ )
422
  );
423
  }
424
  }
438
  }
439
 
440
  printf(
441
+ '<div class="notice notice-warning is-dismissible"><p>%s</p></div>',
442
+ sprintf(
443
+ /* translators: %s: post-processor cache support URL */
444
+ __( 'The AMP plugin&lsquo;s post-processor cache was disabled due to the detection of highly-variable content. <a href="%s">More details</a>', 'amp' ), // phpcs:ignore WordPress.Security.EscapeOutput
445
+ esc_url( __( 'https://github.com/ampproject/amp-wp/wiki/Post-Processor-Cache', 'amp' ) )
446
+ )
447
  );
448
  }
449
 
472
  printf(
473
  '<div class="notice notice-warning"><p>%s</p></div>',
474
  sprintf(
475
+ /* translators: %s: path to the conflicting library */
476
+ __( 'A conflicting version of PHP-CSS-Parser appears to be installed by another plugin or theme (located in %s). Because of this, CSS processing will be limited, and tree shaking will not be available.', 'amp' ), // phpcs:ignore WordPress.Security.EscapeOutput
477
+ '<code>' . esc_html( $source_dir ) . '</code>'
478
  )
479
  );
480
  } catch ( ReflectionException $e ) {
524
  $theme_support['paired'] = 'paired' === $template_mode;
525
  add_theme_support( AMP_Theme_Support::SLUG, $theme_support );
526
  } else {
527
+ remove_theme_support( AMP_Theme_Support::SLUG ); // So that the amp_get_permalink() will work for reader mode URL.
528
  }
529
 
530
  $url = amp_admin_get_preview_permalink();
535
  $validation = AMP_Validation_Manager::validate_url( $url );
536
 
537
  if ( is_wp_error( $validation ) ) {
538
+ $review_messages[] = esc_html(
539
+ sprintf(
540
+ /* translators: %1$s is the error message, %2$s is the error code */
541
+ __( 'However, there was an error when checking the AMP validity for your site.', 'amp' ),
542
+ $validation->get_error_message(),
543
+ $validation->get_error_code()
544
+ )
545
+ );
546
 
547
  $error_message = $validation->get_error_message();
548
  if ( $error_message ) {
642
  }
643
  break;
644
  case 'paired':
645
+ $message = esc_html__( 'Transitional mode activated!', 'amp' );
646
  if ( $review_messages ) {
647
  $message .= ' ' . join( ' ', $review_messages );
648
  }
651
  $message = wp_kses_post(
652
  sprintf(
653
  /* translators: %s is an AMP URL */
654
+ __( 'Reader mode activated! View the <a href="%s">AMP version of a recent post</a>. It is recommended that you upgrade to Native or Transitional mode.', 'amp' ),
655
  esc_url( $url )
656
  )
657
  );
includes/options/class-amp-options-menu.php CHANGED
@@ -138,9 +138,15 @@ class AMP_Options_Menu {
138
  * @since 1.0
139
  */
140
  public function render_theme_support() {
141
- $theme_support = AMP_Options_Manager::get_option( 'theme_support' );
142
- $native_description = __( 'Reuses active theme\'s templates to display AMP responses but does not use separate URLs for AMP. This means your site is <b>AMP-first</b> and your canonical URLs are AMP.', 'amp' );
143
- $paired_description = __( 'Reuses active theme\'s templates to display AMP responses, but uses separate URLs for AMP. Each canonical URL may have a corresponding AMP URL, if the content is fully AMP valid.', 'amp' );
 
 
 
 
 
 
144
 
145
  $builtin_support = in_array( get_template(), AMP_Core_Theme_Sanitizer::get_supported_themes(), true );
146
  ?>
@@ -148,22 +154,28 @@ class AMP_Options_Menu {
148
  <div class="notice notice-info notice-alt inline">
149
  <p><?php esc_html_e( 'Your active theme has built-in AMP support.', 'amp' ); ?></p>
150
  </div>
 
 
 
151
  <p>
152
  <?php if ( amp_is_canonical() ) : ?>
153
  <strong><?php esc_html_e( 'Native:', 'amp' ); ?></strong>
154
  <?php echo wp_kses_post( $native_description ); ?>
155
  <?php else : ?>
156
- <strong><?php esc_html_e( 'Paired:', 'amp' ); ?></strong>
157
- <?php echo wp_kses_post( $paired_description ); ?>
158
  <?php endif; ?>
159
  </p>
160
  <?php else : ?>
161
  <fieldset <?php disabled( ! current_user_can( 'manage_options' ) ); ?>>
162
  <?php if ( $builtin_support ) : ?>
163
  <div class="notice notice-success notice-alt inline">
164
- <p><?php esc_html_e( 'Your active theme is known to work well in paired or native mode.', 'amp' ); ?></p>
165
  </div>
166
  <?php endif; ?>
 
 
 
167
  <dl>
168
  <dt>
169
  <input type="radio" id="theme_support_native" name="<?php echo esc_attr( AMP_Options_Manager::OPTION_NAME . '[theme_support]' ); ?>" value="native" <?php checked( $theme_support, 'native' ); ?>>
@@ -175,22 +187,22 @@ class AMP_Options_Menu {
175
  <?php echo wp_kses_post( $native_description ); ?>
176
  </dd>
177
  <dt>
178
- <input type="radio" id="theme_support_paired" name="<?php echo esc_attr( AMP_Options_Manager::OPTION_NAME . '[theme_support]' ); ?>" value="paired" <?php checked( $theme_support, 'paired' ); ?>>
179
- <label for="theme_support_paired">
180
- <strong><?php esc_html_e( 'Paired', 'amp' ); ?></strong>
181
  </label>
182
  </dt>
183
  <dd>
184
- <?php echo wp_kses_post( $paired_description ); ?>
185
  </dd>
186
  <dt>
187
  <input type="radio" id="theme_support_disabled" name="<?php echo esc_attr( AMP_Options_Manager::OPTION_NAME . '[theme_support]' ); ?>" value="disabled" <?php checked( $theme_support, 'disabled' ); ?>>
188
  <label for="theme_support_disabled">
189
- <strong><?php esc_html_e( 'Classic', 'amp' ); ?></strong>
190
  </label>
191
  </dt>
192
  <dd>
193
- <?php esc_html_e( 'Display AMP responses in classic (legacy) post templates in a basic design that does not match your theme\'s templates.', 'amp' ); ?>
194
 
195
  <?php if ( ! current_theme_supports( AMP_Theme_Support::SLUG ) && wp_count_posts( AMP_Validated_URL_Post_Type::POST_TYPE_SLUG )->publish > 0 ) : ?>
196
  <div class="notice notice-info inline notice-alt">
@@ -199,7 +211,7 @@ class AMP_Options_Menu {
199
  echo wp_kses_post(
200
  sprintf(
201
  /* translators: %1$s is link to invalid URLs and %2$s is link to validation errors */
202
- __( 'View current site compatibility results for native and paired modes: %1$s and %2$s.', 'amp' ),
203
  sprintf(
204
  '<a href="%s">%s</a>',
205
  esc_url( add_query_arg( 'post_type', AMP_Validated_URL_Post_Type::POST_TYPE_SLUG, admin_url( 'edit.php' ) ) ),
@@ -242,13 +254,17 @@ class AMP_Options_Menu {
242
  ?>
243
  <fieldset <?php disabled( ! current_user_can( 'manage_options' ) ); ?>>
244
  <?php
245
- $auto_sanitization = AMP_Validation_Error_Taxonomy::get_validation_error_sanitization( array(
246
- 'code' => 'non_existent',
247
- ) );
 
 
248
  remove_filter( 'amp_validation_error_sanitized', array( 'AMP_Validation_Manager', 'filter_tree_shaking_validation_error_as_accepted' ) );
249
- $tree_shaking_sanitization = AMP_Validation_Error_Taxonomy::get_validation_error_sanitization( array(
250
- 'code' => AMP_Style_Sanitizer::TREE_SHAKING_ERROR_CODE,
251
- ) );
 
 
252
 
253
  $forced_sanitization = 'with_filter' === $auto_sanitization['forced'];
254
  $forced_tree_shaking = $forced_sanitization || 'with_filter' === $tree_shaking_sanitization['forced'];
@@ -304,7 +320,7 @@ class AMP_Options_Menu {
304
  </label>
305
  </p>
306
  <p class="description">
307
- <?php esc_html_e( 'AMP limits the total amount of CSS to no more than 50KB; if you have more, than it is a validation error. The need to tree shake the CSS is not done by default because in some situations (in particular for dynamic content) it can result in CSS rules being removed that are needed.', 'amp' ); ?>
308
  </p>
309
  </div>
310
  <?php endif; ?>
@@ -384,7 +400,13 @@ class AMP_Options_Menu {
384
  <?php else : ?>
385
  <div class="notice notice-warning notice-alt inline">
386
  <p>
387
- <?php esc_html_e( 'Your theme is using the deprecated available_callback argument for AMP theme support.', 'amp' ); ?>
 
 
 
 
 
 
388
  </p>
389
  </div>
390
  <?php endif; ?>
@@ -567,7 +589,7 @@ class AMP_Options_Menu {
567
  * @since 0.6
568
  */
569
  public function render_screen() {
570
- if ( ! empty( $_GET['settings-updated'] ) ) { // WPCS: CSRF ok.
571
  AMP_Options_Manager::check_supported_post_type_update_errors();
572
  }
573
  ?>
138
  * @since 1.0
139
  */
140
  public function render_theme_support() {
141
+ $theme_support = AMP_Options_Manager::get_option( 'theme_support' );
142
+
143
+ /* translators: %s: URL to the documentation. */
144
+ $native_description = sprintf( __( 'Integrates AMP as the framework for your site by using the active’s theme templates and styles to render AMP responses. This means your site is <b>AMP-first</b> and your canonical URLs are AMP! Depending on your theme/plugins, a varying level of <a href="%s">development work</a> may be required.', 'amp' ), esc_url( 'https://amp-wp.org/documentation/developing-wordpress-amp-sites/' ) );
145
+ /* translators: %s: URL to the documentation. */
146
+ $transitional_description = sprintf( __( 'Uses the active theme’s templates to generate non-AMP and AMP versions of your content, allowing for each canonical URL to have a corresponding (paired) AMP URL. This mode is useful to progressively transition towards a fully AMP-first site. Depending on your theme/plugins, a varying level of <a href="%s">development work</a> may be required.', 'amp' ), esc_url( 'https://amp-wp.org/documentation/developing-wordpress-amp-sites/' ) );
147
+ $reader_description = __( 'Formerly called the <b>classic mode</b>, this mode generates paired AMP content using simplified templates which may not match the look-and-feel of your site. Only posts/pages can be served as AMP in Reader mode. No redirection is performed for mobile visitors; AMP pages are served by AMP consumption platforms.', 'amp' );
148
+ /* translators: %s: URL to the ecosystem page. */
149
+ $ecosystem_description = sprintf( __( 'For a list of themes and plugins that are known to be AMP compatible, please see the <a href="%s">ecosystem page</a>.' ), esc_url( 'https://amp-wp.org/ecosystem/' ) );
150
 
151
  $builtin_support = in_array( get_template(), AMP_Core_Theme_Sanitizer::get_supported_themes(), true );
152
  ?>
154
  <div class="notice notice-info notice-alt inline">
155
  <p><?php esc_html_e( 'Your active theme has built-in AMP support.', 'amp' ); ?></p>
156
  </div>
157
+ <p>
158
+ <?php echo wp_kses_post( $ecosystem_description ); ?>
159
+ </p>
160
  <p>
161
  <?php if ( amp_is_canonical() ) : ?>
162
  <strong><?php esc_html_e( 'Native:', 'amp' ); ?></strong>
163
  <?php echo wp_kses_post( $native_description ); ?>
164
  <?php else : ?>
165
+ <strong><?php esc_html_e( 'Transitional:', 'amp' ); ?></strong>
166
+ <?php echo wp_kses_post( $transitional_description ); ?>
167
  <?php endif; ?>
168
  </p>
169
  <?php else : ?>
170
  <fieldset <?php disabled( ! current_user_can( 'manage_options' ) ); ?>>
171
  <?php if ( $builtin_support ) : ?>
172
  <div class="notice notice-success notice-alt inline">
173
+ <p><?php esc_html_e( 'Your active theme is known to work well in transitional or native mode.', 'amp' ); ?></p>
174
  </div>
175
  <?php endif; ?>
176
+ <p>
177
+ <?php echo wp_kses_post( $ecosystem_description ); ?>
178
+ </p>
179
  <dl>
180
  <dt>
181
  <input type="radio" id="theme_support_native" name="<?php echo esc_attr( AMP_Options_Manager::OPTION_NAME . '[theme_support]' ); ?>" value="native" <?php checked( $theme_support, 'native' ); ?>>
187
  <?php echo wp_kses_post( $native_description ); ?>
188
  </dd>
189
  <dt>
190
+ <input type="radio" id="theme_support_transitional" name="<?php echo esc_attr( AMP_Options_Manager::OPTION_NAME . '[theme_support]' ); ?>" value="paired" <?php checked( $theme_support, 'paired' ); ?>>
191
+ <label for="theme_support_transitional">
192
+ <strong><?php esc_html_e( 'Transitional', 'amp' ); ?></strong>
193
  </label>
194
  </dt>
195
  <dd>
196
+ <?php echo wp_kses_post( $transitional_description ); ?>
197
  </dd>
198
  <dt>
199
  <input type="radio" id="theme_support_disabled" name="<?php echo esc_attr( AMP_Options_Manager::OPTION_NAME . '[theme_support]' ); ?>" value="disabled" <?php checked( $theme_support, 'disabled' ); ?>>
200
  <label for="theme_support_disabled">
201
+ <strong><?php esc_html_e( 'Reader', 'amp' ); ?></strong>
202
  </label>
203
  </dt>
204
  <dd>
205
+ <?php echo wp_kses_post( $reader_description ); ?>
206
 
207
  <?php if ( ! current_theme_supports( AMP_Theme_Support::SLUG ) && wp_count_posts( AMP_Validated_URL_Post_Type::POST_TYPE_SLUG )->publish > 0 ) : ?>
208
  <div class="notice notice-info inline notice-alt">
211
  echo wp_kses_post(
212
  sprintf(
213
  /* translators: %1$s is link to invalid URLs and %2$s is link to validation errors */
214
+ __( 'View current site compatibility results for native and transitional modes: %1$s and %2$s.', 'amp' ),
215
  sprintf(
216
  '<a href="%s">%s</a>',
217
  esc_url( add_query_arg( 'post_type', AMP_Validated_URL_Post_Type::POST_TYPE_SLUG, admin_url( 'edit.php' ) ) ),
254
  ?>
255
  <fieldset <?php disabled( ! current_user_can( 'manage_options' ) ); ?>>
256
  <?php
257
+ $auto_sanitization = AMP_Validation_Error_Taxonomy::get_validation_error_sanitization(
258
+ array(
259
+ 'code' => 'non_existent',
260
+ )
261
+ );
262
  remove_filter( 'amp_validation_error_sanitized', array( 'AMP_Validation_Manager', 'filter_tree_shaking_validation_error_as_accepted' ) );
263
+ $tree_shaking_sanitization = AMP_Validation_Error_Taxonomy::get_validation_error_sanitization(
264
+ array(
265
+ 'code' => AMP_Style_Sanitizer::TREE_SHAKING_ERROR_CODE,
266
+ )
267
+ );
268
 
269
  $forced_sanitization = 'with_filter' === $auto_sanitization['forced'];
270
  $forced_tree_shaking = $forced_sanitization || 'with_filter' === $tree_shaking_sanitization['forced'];
320
  </label>
321
  </p>
322
  <p class="description">
323
+ <?php esc_html_e( 'AMP limits the total amount of CSS to no more than 50KB; any more than this will cause a validation error. The need to tree shake the CSS is not done by default because in some situations (in particular for dynamic content) it can result in CSS rules being removed that are needed.', 'amp' ); ?>
324
  </p>
325
  </div>
326
  <?php endif; ?>
400
  <?php else : ?>
401
  <div class="notice notice-warning notice-alt inline">
402
  <p>
403
+ <?php
404
+ printf(
405
+ /* translators: %s: available_callback */
406
+ esc_html__( 'Your theme is using the deprecated %s argument for AMP theme support.', 'amp' ),
407
+ 'available_callback'
408
+ );
409
+ ?>
410
  </p>
411
  </div>
412
  <?php endif; ?>
589
  * @since 0.6
590
  */
591
  public function render_screen() {
592
+ if ( ! empty( $_GET['settings-updated'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
593
  AMP_Options_Manager::check_supported_post_type_update_errors();
594
  }
595
  ?>
includes/options/views/class-amp-analytics-options-submenu-page.php CHANGED
@@ -64,7 +64,6 @@ class AMP_Analytics_Options_Submenu_Page {
64
  name="<?php echo esc_attr( $id_base . '[config]' ); ?>"
65
  class="amp-analytics-input"
66
  placeholder="{...}"
67
- title="<?php esc_attr_e( 'A JSON object begins with a &#8220;{&#8221; and ends with a &#8220;}&#8221;. Do not include any HTML tags like "<amp-analytics>" or "<script>".', 'amp' ); ?>"
68
  required
69
  ><?php echo esc_textarea( $config ); ?></textarea>
70
  </label>
@@ -101,7 +100,24 @@ class AMP_Analytics_Options_Submenu_Page {
101
  <?php esc_html_e( 'Learn about analytics for AMP.', 'amp' ); ?>
102
  </summary>
103
  <p>
104
- <?php echo wp_kses_post( __( 'For Google Analytics, please see <a href="https://developers.google.com/analytics/devguides/collection/amp-analytics/" target="_blank">Adding Analytics to your AMP pages</a>; see also the <a href="https://github.com/ampproject/amp-wp/wiki/Analytics" target="_blank">Analytics wiki page</a> and the AMP project\'s <a href="https://www.ampproject.org/docs/reference/components/amp-analytics" target="_blank">amp-analytics documentation</a>. The analytics configuration supplied below must take the form of JSON objects, which begin with a &#8220;{&#8221; and end with a &#8220;}&#8221;. Do not include any HTML tags like &#8220;<code>&lt;amp-analytics&gt;</code>&#8221; or &#8220;<code>&lt;script&gt;</code>&#8221;. A common entry would have the type &#8220;<code>googleanalytics</code>&#8221; (see <a href="https://www.ampproject.org/docs/analytics/analytics-vendors" target="_blank">available vendors</a>) and a configuration that looks like the following (where <code>UA-XXXXX-Y</code> is replaced with your own site\'s account number):', 'amp' ) ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
 
106
  <pre>{
107
  "vars": {
64
  name="<?php echo esc_attr( $id_base . '[config]' ); ?>"
65
  class="amp-analytics-input"
66
  placeholder="{...}"
 
67
  required
68
  ><?php echo esc_textarea( $config ); ?></textarea>
69
  </label>
100
  <?php esc_html_e( 'Learn about analytics for AMP.', 'amp' ); ?>
101
  </summary>
102
  <p>
103
+ <?php
104
+ echo wp_kses_post(
105
+ sprintf(
106
+ /* translators: 1: AMP Analytics docs URL. 2: AMP for WordPress analytics docs URL. 3: AMP analytics code reference. 4: amp-analytics, 5: {. 6: }. 7: <script>, 8: googleanalytics. 9: AMP analytics vendor docs URL. 10: UA-XXXXX-Y. */
107
+ __( 'For Google Analytics, please see <a href="%1$s" target="_blank">Adding Analytics to your AMP pages</a>; see also the <a href="%2$s" target="_blank">Analytics wiki page</a> and the AMP project\'s <a href="%3$s" target="_blank">%4$s documentation</a>. The analytics configuration supplied below must take the form of JSON objects, which begin with a %5$s and end with a %6$s. Do not include any HTML tags like %4$s or %7$s. A common entry would have the type %8$s (see <a href="%9$s" target="_blank">available vendors</a>) and a configuration that looks like the following (where %10$s is replaced with your own site\'s account number):', 'amp' ),
108
+ __( 'https://developers.google.com/analytics/devguides/collection/amp-analytics/', 'amp' ),
109
+ __( 'https://github.com/ampproject/amp-wp/wiki/Analytics', 'amp' ),
110
+ __( 'https://www.ampproject.org/docs/reference/components/amp-analytics', 'amp' ),
111
+ '<code>amp-analytics</code>',
112
+ '<code>{</code>',
113
+ '<code>}</code>',
114
+ '<code>&lt;script&gt;</code>',
115
+ '<code>googleanalytics</code>',
116
+ __( 'https://www.ampproject.org/docs/analytics/analytics-vendors', 'amp' ),
117
+ '<code>UA-XXXXX-Y</code>'
118
+ )
119
+ );
120
+ ?>
121
 
122
  <pre>{
123
  "vars": {
includes/sanitizers/class-amp-allowed-tags-generated.php CHANGED
@@ -13,8 +13,314 @@
13
  */
14
  class AMP_Allowed_Tags_Generated {
15
 
16
- private static $spec_file_revision = 767;
17
- private static $minimum_validator_revision_required = 348;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
 
19
  private static $allowed_tags = array(
20
  'a' => array(
@@ -36,6 +342,7 @@ class AMP_Allowed_Tags_Generated {
36
  'maps',
37
  'bip',
38
  'bbmi',
 
39
  'fb-messenger',
40
  'intent',
41
  'line',
@@ -49,13 +356,16 @@ class AMP_Allowed_Tags_Generated {
49
  'viber',
50
  'webcal',
51
  'web+mastodon',
 
52
  'whatsapp',
53
  ),
54
  ),
55
  ),
56
  'hreflang' => array(),
57
  'media' => array(),
58
- 'name' => array(),
 
 
59
  'referrerpolicy' => array(),
60
  'rel' => array(
61
  'blacklisted_value_regex' => '(^|\\s)(components|dns-prefetch|import|manifest|preconnect|prefetch|preload|prerender|serviceworker|stylesheet|subresource|)(\\s|$)',
@@ -224,6 +534,11 @@ class AMP_Allowed_Tags_Generated {
224
  5,
225
  ),
226
  ),
 
 
 
 
 
227
  'requires_extension' => array(
228
  'amp-accordion',
229
  ),
@@ -231,6 +546,26 @@ class AMP_Allowed_Tags_Generated {
231
  ),
232
  ),
233
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
234
  'amp-ad' => array(
235
  array(
236
  'attr_spec_list' => array(
@@ -405,6 +740,10 @@ class AMP_Allowed_Tags_Generated {
405
  'amp-addthis' => array(
406
  array(
407
  'attr_spec_list' => array(
 
 
 
 
408
  'data-pub-id' => array(
409
  'mandatory' => true,
410
  ),
@@ -426,9 +765,7 @@ class AMP_Allowed_Tags_Generated {
426
  ),
427
  ),
428
  ),
429
- 'data-widget-id' => array(
430
- 'mandatory' => true,
431
- ),
432
  'media' => array(),
433
  'noloading' => array(
434
  'value' => array(
@@ -542,6 +879,12 @@ class AMP_Allowed_Tags_Generated {
542
  1,
543
  ),
544
  ),
 
 
 
 
 
 
545
  'requires_extension' => array(
546
  'amp-animation',
547
  ),
@@ -586,6 +929,7 @@ class AMP_Allowed_Tags_Generated {
586
  array(
587
  'attr_spec_list' => array(
588
  'id' => array(
 
589
  'mandatory' => true,
590
  ),
591
  'media' => array(),
@@ -716,11 +1060,7 @@ class AMP_Allowed_Tags_Generated {
716
  ),
717
  'tag_spec' => array(
718
  'amp_layout' => array(
719
- 'defines_default_height' => true,
720
- 'defines_default_width' => true,
721
  'supported_layouts' => array(
722
- 2,
723
- 3,
724
  1,
725
  ),
726
  ),
@@ -757,6 +1097,181 @@ class AMP_Allowed_Tags_Generated {
757
  ),
758
  ),
759
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
760
  'amp-beopinion' => array(
761
  array(
762
  'attr_spec_list' => array(
@@ -807,6 +1322,7 @@ class AMP_Allowed_Tags_Generated {
807
  'mandatory' => true,
808
  ),
809
  'id' => array(
 
810
  'mandatory' => true,
811
  ),
812
  ),
@@ -871,6 +1387,9 @@ class AMP_Allowed_Tags_Generated {
871
  array(
872
  'attr_spec_list' => array(
873
  'autoplay' => array(),
 
 
 
874
  'data-outstream' => array(
875
  'value_regex' => '[0-9]+',
876
  ),
@@ -883,7 +1402,7 @@ class AMP_Allowed_Tags_Generated {
883
  'value_regex' => '[0-9]+',
884
  ),
885
  'data-playlist' => array(
886
- 'value_regex' => '[0-9]+',
887
  ),
888
  'data-video' => array(
889
  'value_regex' => '[0-9]+',
@@ -931,6 +1450,11 @@ class AMP_Allowed_Tags_Generated {
931
  'data-account' => array(
932
  'mandatory' => true,
933
  ),
 
 
 
 
 
934
  'media' => array(),
935
  'noloading' => array(
936
  'value' => array(
@@ -1020,6 +1544,12 @@ class AMP_Allowed_Tags_Generated {
1020
  4,
1021
  ),
1022
  ),
 
 
 
 
 
 
1023
  'requires_extension' => array(
1024
  'amp-call-tracking',
1025
  ),
@@ -1062,7 +1592,6 @@ class AMP_Allowed_Tags_Generated {
1062
  'type' => array(
1063
  'value' => array(
1064
  'slides',
1065
- 'carousel',
1066
  ),
1067
  ),
1068
  ),
@@ -1081,6 +1610,7 @@ class AMP_Allowed_Tags_Generated {
1081
  'requires_extension' => array(
1082
  'amp-carousel',
1083
  ),
 
1084
  'spec_url' => 'https://www.ampproject.org/docs/reference/components/amp-carousel',
1085
  ),
1086
  ),
@@ -1093,10 +1623,61 @@ class AMP_Allowed_Tags_Generated {
1093
  ),
1094
  ),
1095
  'autoplay' => array(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1096
  'value' => array(
1097
  '',
1098
  ),
1099
  ),
 
 
 
1100
  'controls' => array(),
1101
  'delay' => array(
1102
  'value_regex' => '[0-9]+',
@@ -1123,7 +1704,6 @@ class AMP_Allowed_Tags_Generated {
1123
  'type' => array(
1124
  'value' => array(
1125
  'slides',
1126
- 'carousel',
1127
  ),
1128
  ),
1129
  ),
@@ -1153,51 +1733,143 @@ class AMP_Allowed_Tags_Generated {
1153
  'amp-carousel',
1154
  'amp-lightbox-gallery',
1155
  ),
1156
- 'spec_name' => 'AMP-CAROUSEL [lightbox]',
1157
  'spec_url' => 'https://www.ampproject.org/docs/reference/components/amp-carousel',
1158
  ),
1159
  ),
1160
- ),
1161
- 'amp-consent' => array(
1162
  array(
1163
  'attr_spec_list' => array(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1164
  'media' => array(),
1165
  'noloading' => array(
1166
  'value' => array(
1167
  '',
1168
  ),
1169
  ),
 
 
 
 
 
 
1170
  ),
1171
  'tag_spec' => array(
1172
  'amp_layout' => array(
1173
  'supported_layouts' => array(
 
 
1174
  1,
1175
  ),
1176
  ),
 
 
 
 
 
 
 
 
 
 
1177
  'requires_extension' => array(
1178
- 'amp-consent',
 
1179
  ),
1180
- 'unique' => true,
 
1181
  ),
1182
  ),
1183
  ),
1184
- 'amp-dailymotion' => array(
1185
  array(
1186
  'attr_spec_list' => array(
1187
- 'autoplay' => array(),
1188
- 'data-endscreen-enable' => array(
1189
  'value' => array(
1190
- 'false',
1191
- 'true',
1192
  ),
1193
  ),
1194
- 'data-info' => array(
1195
- 'value' => array(
1196
- 'false',
1197
- 'true',
 
1198
  ),
1199
  ),
1200
- 'data-mute' => array(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1201
  'value' => array(
1202
  'false',
1203
  'true',
@@ -1225,6 +1897,11 @@ class AMP_Allowed_Tags_Generated {
1225
  'mandatory' => true,
1226
  'value_regex_casei' => '[a-z0-9]+',
1227
  ),
 
 
 
 
 
1228
  'media' => array(),
1229
  'noloading' => array(
1230
  'value' => array(
@@ -1326,11 +2003,57 @@ class AMP_Allowed_Tags_Generated {
1326
  ),
1327
  ),
1328
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1329
  'amp-date-picker' => array(
1330
  array(
1331
  'attr_spec_list' => array(
1332
  '[max]' => array(),
1333
  '[min]' => array(),
 
1334
  'allow-blocked-ranges' => array(
1335
  'value' => array(
1336
  '',
@@ -1418,6 +2141,7 @@ class AMP_Allowed_Tags_Generated {
1418
  'attr_spec_list' => array(
1419
  '[max]' => array(),
1420
  '[min]' => array(),
 
1421
  'allow-blocked-ranges' => array(
1422
  'value' => array(
1423
  '',
@@ -1501,6 +2225,7 @@ class AMP_Allowed_Tags_Generated {
1501
  'attr_spec_list' => array(
1502
  '[max]' => array(),
1503
  '[min]' => array(),
 
1504
  'allow-blocked-ranges' => array(
1505
  'value' => array(
1506
  '',
@@ -1524,6 +2249,9 @@ class AMP_Allowed_Tags_Generated {
1524
  'highlighted' => array(),
1525
  'locale' => array(),
1526
  'max' => array(),
 
 
 
1527
  'media' => array(),
1528
  'min' => array(),
1529
  'minimum-nights' => array(
@@ -1594,6 +2322,7 @@ class AMP_Allowed_Tags_Generated {
1594
  'attr_spec_list' => array(
1595
  '[max]' => array(),
1596
  '[min]' => array(),
 
1597
  'allow-blocked-ranges' => array(
1598
  'value' => array(
1599
  '',
@@ -1612,6 +2341,9 @@ class AMP_Allowed_Tags_Generated {
1612
  'highlighted' => array(),
1613
  'locale' => array(),
1614
  'max' => array(),
 
 
 
1615
  'media' => array(),
1616
  'min' => array(),
1617
  'minimum-nights' => array(
@@ -1686,6 +2418,11 @@ class AMP_Allowed_Tags_Generated {
1686
  'data-content-id' => array(
1687
  'mandatory' => true,
1688
  ),
 
 
 
 
 
1689
  'media' => array(),
1690
  'noloading' => array(
1691
  'value' => array(
@@ -2122,6 +2859,11 @@ class AMP_Allowed_Tags_Generated {
2122
  1,
2123
  ),
2124
  ),
 
 
 
 
 
2125
  'requires_extension' => array(
2126
  'amp-geo',
2127
  ),
@@ -2363,6 +3105,11 @@ class AMP_Allowed_Tags_Generated {
2363
  ),
2364
  ),
2365
  ),
 
 
 
 
 
2366
  'media' => array(),
2367
  'noloading' => array(
2368
  'value' => array(
@@ -2441,6 +3188,13 @@ class AMP_Allowed_Tags_Generated {
2441
  4,
2442
  ),
2443
  ),
 
 
 
 
 
 
 
2444
  'requires_extension' => array(
2445
  'amp-image-slider',
2446
  ),
@@ -2749,6 +3503,7 @@ class AMP_Allowed_Tags_Generated {
2749
  'amp-list' => array(
2750
  array(
2751
  'attr_spec_list' => array(
 
2752
  '[src]' => array(),
2753
  '[state]' => array(),
2754
  'auto-resize' => array(
@@ -2765,6 +3520,13 @@ class AMP_Allowed_Tags_Generated {
2765
  ),
2766
  'credentials' => array(),
2767
  'items' => array(),
 
 
 
 
 
 
 
2768
  'max-items' => array(),
2769
  'media' => array(),
2770
  'noloading' => array(
@@ -2808,6 +3570,38 @@ class AMP_Allowed_Tags_Generated {
2808
  ),
2809
  ),
2810
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2811
  'amp-live-list' => array(
2812
  array(
2813
  'attr_spec_list' => array(
@@ -2824,6 +3618,7 @@ class AMP_Allowed_Tags_Generated {
2824
  ),
2825
  ),
2826
  'id' => array(
 
2827
  'mandatory' => true,
2828
  ),
2829
  'sort' => array(
@@ -3422,6 +4217,34 @@ class AMP_Allowed_Tags_Generated {
3422
  ),
3423
  ),
3424
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3425
  'amp-reddit' => array(
3426
  array(
3427
  'attr_spec_list' => array(
@@ -3498,6 +4321,47 @@ class AMP_Allowed_Tags_Generated {
3498
  ),
3499
  ),
3500
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3501
  'amp-selector' => array(
3502
  array(
3503
  'attr_spec_list' => array(
@@ -3583,16 +4447,37 @@ class AMP_Allowed_Tags_Generated {
3583
  1,
3584
  ),
3585
  ),
 
 
 
3586
  'mandatory_parent' => 'body',
3587
  'requires_extension' => array(
3588
  'amp-sidebar',
3589
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3590
  ),
3591
  ),
3592
  ),
3593
  'amp-skimlinks' => array(
3594
  array(
3595
  'attr_spec_list' => array(
 
3596
  'custom-tracking-id' => array(
3597
  'value_regex_casei' => '^.{0,50}$',
3598
  ),
@@ -3627,6 +4512,43 @@ class AMP_Allowed_Tags_Generated {
3627
  ),
3628
  ),
3629
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3630
  'amp-social-share' => array(
3631
  array(
3632
  'attr_spec_list' => array(
@@ -3640,6 +4562,7 @@ class AMP_Allowed_Tags_Generated {
3640
  'https',
3641
  'mailto',
3642
  'bbmi',
 
3643
  'fb-messenger',
3644
  'intent',
3645
  'line',
@@ -3650,6 +4573,7 @@ class AMP_Allowed_Tags_Generated {
3650
  'tg',
3651
  'threema',
3652
  'viber',
 
3653
  'whatsapp',
3654
  ),
3655
  ),
@@ -3777,6 +4701,7 @@ class AMP_Allowed_Tags_Generated {
3777
  '[src]' => array(),
3778
  'credentials' => array(),
3779
  'id' => array(
 
3780
  'mandatory' => true,
3781
  ),
3782
  'overridable' => array(),
@@ -3791,6 +4716,11 @@ class AMP_Allowed_Tags_Generated {
3791
  ),
3792
  ),
3793
  'tag_spec' => array(
 
 
 
 
 
3794
  'requires_extension' => array(
3795
  'amp-bind',
3796
  ),
@@ -3815,6 +4745,12 @@ class AMP_Allowed_Tags_Generated {
3815
  1,
3816
  ),
3817
  ),
 
 
 
 
 
 
3818
  'disallowed_ancestor' => array(
3819
  'amp-app-banner',
3820
  ),
@@ -3887,11 +4823,30 @@ class AMP_Allowed_Tags_Generated {
3887
  '',
3888
  ),
3889
  ),
 
 
 
 
 
3890
  'title' => array(
3891
  'mandatory' => true,
3892
  ),
3893
  ),
3894
  'tag_spec' => array(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3895
  'mandatory_parent' => 'body',
3896
  'requires_extension' => array(
3897
  'amp-story',
@@ -3955,6 +4910,7 @@ class AMP_Allowed_Tags_Generated {
3955
  ),
3956
  ),
3957
  'tag_spec' => array(
 
3958
  'mandatory_ancestor' => 'amp-story',
3959
  ),
3960
  ),
@@ -3963,6 +4919,7 @@ class AMP_Allowed_Tags_Generated {
3963
  array(
3964
  'attr_spec_list' => array(
3965
  'id' => array(
 
3966
  'mandatory' => true,
3967
  ),
3968
  ),
@@ -3972,6 +4929,12 @@ class AMP_Allowed_Tags_Generated {
3972
  1,
3973
  ),
3974
  ),
 
 
 
 
 
 
3975
  'mandatory_parent' => 'amp-consent',
3976
  'requires_extension' => array(
3977
  'amp-consent',
@@ -3984,6 +4947,7 @@ class AMP_Allowed_Tags_Generated {
3984
  array(
3985
  'attr_spec_list' => array(),
3986
  'tag_spec' => array(
 
3987
  'mandatory_ancestor' => 'amp-story-page',
3988
  'reference_points' => array(
3989
  'AMP-STORY-CTA-LAYER animate-in' => array(
@@ -4008,6 +4972,7 @@ class AMP_Allowed_Tags_Generated {
4008
  ),
4009
  ),
4010
  'tag_spec' => array(
 
4011
  'mandatory_ancestor' => 'amp-story-page',
4012
  'reference_points' => array(
4013
  'AMP-STORY-GRID-LAYER animate-in' => array(
@@ -4035,10 +5000,21 @@ class AMP_Allowed_Tags_Generated {
4035
  ),
4036
  ),
4037
  'id' => array(
 
4038
  'mandatory' => true,
4039
  ),
4040
  ),
4041
  'tag_spec' => array(
 
 
 
 
 
 
 
 
 
 
4042
  'mandatory_parent' => 'amp-story',
4043
  'requires_extension' => array(
4044
  'amp-story',
@@ -4046,6 +5022,22 @@ class AMP_Allowed_Tags_Generated {
4046
  ),
4047
  ),
4048
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4049
  'amp-timeago' => array(
4050
  array(
4051
  'attr_spec_list' => array(
@@ -4219,7 +5211,11 @@ class AMP_Allowed_Tags_Generated {
4219
  '',
4220
  ),
4221
  ),
4222
- 'dock' => array(),
 
 
 
 
4223
  'lightbox' => array(),
4224
  'lightbox-thumbnail-id' => array(
4225
  'value_regex_casei' => '^[a-z][a-z\\d_-]*',
@@ -4326,7 +5322,11 @@ class AMP_Allowed_Tags_Generated {
4326
  '',
4327
  ),
4328
  ),
4329
- 'dock' => array(),
 
 
 
 
4330
  'loop' => array(
4331
  'value' => array(
4332
  '',
@@ -4395,6 +5395,163 @@ class AMP_Allowed_Tags_Generated {
4395
  ),
4396
  ),
4397
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4398
  'amp-vimeo' => array(
4399
  array(
4400
  'attr_spec_list' => array(
@@ -4694,6 +5851,11 @@ class AMP_Allowed_Tags_Generated {
4694
  'data-videoid' => array(
4695
  'value_regex' => '[^=/?:]+',
4696
  ),
 
 
 
 
 
4697
  'lightbox' => array(),
4698
  'lightbox-thumbnail-id' => array(
4699
  'value_regex_casei' => '^[a-z][a-z\\d_-]*',
@@ -4961,7 +6123,7 @@ class AMP_Allowed_Tags_Generated {
4961
  'stroke-opacity' => array(),
4962
  'stroke-width' => array(),
4963
  'style' => array(
4964
- 'blacklisted_value_regex' => '!important',
4965
  ),
4966
  'systemlanguage' => array(),
4967
  'text-anchor' => array(),
@@ -5051,7 +6213,7 @@ class AMP_Allowed_Tags_Generated {
5051
  'stroke-opacity' => array(),
5052
  'stroke-width' => array(),
5053
  'style' => array(
5054
- 'blacklisted_value_regex' => '!important',
5055
  ),
5056
  'systemlanguage' => array(),
5057
  'text-anchor' => array(),
@@ -5176,7 +6338,7 @@ class AMP_Allowed_Tags_Generated {
5176
  'stroke-opacity' => array(),
5177
  'stroke-width' => array(),
5178
  'style' => array(
5179
- 'blacklisted_value_regex' => '!important',
5180
  ),
5181
  'systemlanguage' => array(),
5182
  'text-anchor' => array(),
@@ -5221,7 +6383,7 @@ class AMP_Allowed_Tags_Generated {
5221
  array(
5222
  'attr_spec_list' => array(
5223
  'style' => array(
5224
- 'blacklisted_value_regex' => '!important',
5225
  ),
5226
  'xml:lang' => array(),
5227
  'xml:space' => array(),
@@ -5234,6 +6396,19 @@ class AMP_Allowed_Tags_Generated {
5234
  ),
5235
  ),
5236
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
5237
  'dfn' => array(
5238
  array(
5239
  'attr_spec_list' => array(),
@@ -5463,7 +6638,7 @@ class AMP_Allowed_Tags_Generated {
5463
  'stroke-opacity' => array(),
5464
  'stroke-width' => array(),
5465
  'style' => array(
5466
- 'blacklisted_value_regex' => '!important',
5467
  ),
5468
  'systemlanguage' => array(),
5469
  'text-anchor' => array(),
@@ -5552,7 +6727,7 @@ class AMP_Allowed_Tags_Generated {
5552
  'stroke-opacity' => array(),
5553
  'stroke-width' => array(),
5554
  'style' => array(
5555
- 'blacklisted_value_regex' => '!important',
5556
  ),
5557
  'text-anchor' => array(),
5558
  'text-decoration' => array(),
@@ -5644,7 +6819,7 @@ class AMP_Allowed_Tags_Generated {
5644
  'stroke-opacity' => array(),
5645
  'stroke-width' => array(),
5646
  'style' => array(
5647
- 'blacklisted_value_regex' => '!important',
5648
  ),
5649
  'text-anchor' => array(),
5650
  'text-decoration' => array(),
@@ -5727,7 +6902,7 @@ class AMP_Allowed_Tags_Generated {
5727
  'stroke-opacity' => array(),
5728
  'stroke-width' => array(),
5729
  'style' => array(
5730
- 'blacklisted_value_regex' => '!important',
5731
  ),
5732
  'text-anchor' => array(),
5733
  'text-decoration' => array(),
@@ -5813,7 +6988,7 @@ class AMP_Allowed_Tags_Generated {
5813
  'stroke-opacity' => array(),
5814
  'stroke-width' => array(),
5815
  'style' => array(
5816
- 'blacklisted_value_regex' => '!important',
5817
  ),
5818
  'text-anchor' => array(),
5819
  'text-decoration' => array(),
@@ -5896,7 +7071,7 @@ class AMP_Allowed_Tags_Generated {
5896
  'stroke-opacity' => array(),
5897
  'stroke-width' => array(),
5898
  'style' => array(
5899
- 'blacklisted_value_regex' => '!important',
5900
  ),
5901
  'text-anchor' => array(),
5902
  'text-decoration' => array(),
@@ -5925,7 +7100,7 @@ class AMP_Allowed_Tags_Generated {
5925
  'attr_spec_list' => array(
5926
  'in' => array(),
5927
  'style' => array(
5928
- 'blacklisted_value_regex' => '!important',
5929
  ),
5930
  'xml:lang' => array(),
5931
  'xml:space' => array(),
@@ -6000,7 +7175,7 @@ class AMP_Allowed_Tags_Generated {
6000
  'stroke-opacity' => array(),
6001
  'stroke-width' => array(),
6002
  'style' => array(
6003
- 'blacklisted_value_regex' => '!important',
6004
  ),
6005
  'text-anchor' => array(),
6006
  'text-decoration' => array(),
@@ -6110,7 +7285,7 @@ class AMP_Allowed_Tags_Generated {
6110
  'stroke-opacity' => array(),
6111
  'stroke-width' => array(),
6112
  'style' => array(
6113
- 'blacklisted_value_regex' => '!important',
6114
  ),
6115
  'text-anchor' => array(),
6116
  'text-decoration' => array(),
@@ -6195,7 +7370,9 @@ class AMP_Allowed_Tags_Generated {
6195
  'get',
6196
  ),
6197
  ),
6198
- 'name' => array(),
 
 
6199
  'novalidate' => array(),
6200
  'target' => array(
6201
  'mandatory' => true,
@@ -6253,7 +7430,9 @@ class AMP_Allowed_Tags_Generated {
6253
  'post',
6254
  ),
6255
  ),
6256
- 'name' => array(),
 
 
6257
  'novalidate' => array(),
6258
  'target' => array(
6259
  'value_casei' => array(
@@ -6341,7 +7520,7 @@ class AMP_Allowed_Tags_Generated {
6341
  'stroke-opacity' => array(),
6342
  'stroke-width' => array(),
6343
  'style' => array(
6344
- 'blacklisted_value_regex' => '!important',
6345
  ),
6346
  'systemlanguage' => array(),
6347
  'text-anchor' => array(),
@@ -6426,7 +7605,7 @@ class AMP_Allowed_Tags_Generated {
6426
  'stroke-opacity' => array(),
6427
  'stroke-width' => array(),
6428
  'style' => array(
6429
- 'blacklisted_value_regex' => '!important',
6430
  ),
6431
  'text-anchor' => array(),
6432
  'text-decoration' => array(),
@@ -6512,7 +7691,7 @@ class AMP_Allowed_Tags_Generated {
6512
  'stroke-opacity' => array(),
6513
  'stroke-width' => array(),
6514
  'style' => array(
6515
- 'blacklisted_value_regex' => '!important',
6516
  ),
6517
  'text-anchor' => array(),
6518
  'text-decoration' => array(),
@@ -6631,7 +7810,7 @@ class AMP_Allowed_Tags_Generated {
6631
  'g2' => array(),
6632
  'k' => array(),
6633
  'style' => array(
6634
- 'blacklisted_value_regex' => '!important',
6635
  ),
6636
  'u1' => array(),
6637
  'u2' => array(),
@@ -6679,7 +7858,9 @@ class AMP_Allowed_Tags_Generated {
6679
  ),
6680
  ),
6681
  'height' => array(),
6682
- 'name' => array(),
 
 
6683
  'referrerpolicy' => array(),
6684
  'resizable' => array(
6685
  'value' => array(
@@ -6776,7 +7957,7 @@ class AMP_Allowed_Tags_Generated {
6776
  'stroke-opacity' => array(),
6777
  'stroke-width' => array(),
6778
  'style' => array(
6779
- 'blacklisted_value_regex' => '!important',
6780
  ),
6781
  'systemlanguage' => array(),
6782
  'text-anchor' => array(),
@@ -6928,13 +8109,379 @@ class AMP_Allowed_Tags_Generated {
6928
  'step' => array(),
6929
  'tabindex' => array(),
6930
  'type' => array(
6931
- 'blacklisted_value_regex' => '(^|\\s)(button|file|image|password|)(\\s|$)',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6932
  ),
6933
  'value' => array(),
6934
  'width' => array(),
6935
  ),
6936
  'tag_spec' => array(
6937
- 'spec_url' => 'https://www.ampproject.org/docs/reference/components/amp-form',
 
 
 
 
6938
  ),
6939
  ),
6940
  array(
@@ -6959,6 +8506,7 @@ class AMP_Allowed_Tags_Generated {
6959
  '[size]' => array(),
6960
  '[spellcheck]' => array(),
6961
  '[step]' => array(),
 
6962
  '[value]' => array(),
6963
  '[width]' => array(),
6964
  'accept' => array(),
@@ -6970,6 +8518,14 @@ class AMP_Allowed_Tags_Generated {
6970
  'height' => array(),
6971
  'inputmode' => array(),
6972
  'list' => array(),
 
 
 
 
 
 
 
 
6973
  'max' => array(),
6974
  'maxlength' => array(),
6975
  'min' => array(),
@@ -6978,11 +8534,6 @@ class AMP_Allowed_Tags_Generated {
6978
  'name' => array(
6979
  'blacklisted_value_regex' => '(^|\\s)(__amp_\\S*|__count__|__defineGetter__|__defineSetter__|__lookupGetter__|__lookupSetter__|__noSuchMethod__|__parent__|__proto__|__AMP_\\S*|\\$p|\\$proxy|acceptCharset|addEventListener|appendChild|assignedSlot|attachShadow|baseURI|checkValidity|childElementCount|childNodes|classList|className|clientHeight|clientLeft|clientTop|clientWidth|compareDocumentPosition|computedName|computedRole|contentEditable|createShadowRoot|enqueAction|firstChild|firstElementChild|getAnimations|getAttribute|getAttributeNS|getAttributeNode|getAttributeNodeNS|getBoundingClientRect|getClientRects|getDestinationInsertionPoints|getElementsByClassName|getElementsByTagName|getElementsByTagNameNS|getRootNode|hasAttribute|hasAttributeNS|hasAttributes|hasChildNodes|hasPointerCapture|innerHTML|innerText|inputMode|insertAdjacentElement|insertAdjacentHTML|insertAdjacentText|isContentEditable|isDefaultNamespace|isEqualNode|isSameNode|lastChild|lastElementChild|lookupNamespaceURI|namespaceURI|nextElementSibling|nextSibling|nodeName|nodeType|nodeValue|offsetHeight|offsetLeft|offsetParent|offsetTop|offsetWidth|outerHTML|outerText|ownerDocument|parentElement|parentNode|previousElementSibling|previousSibling|querySelector|querySelectorAll|releasePointerCapture|removeAttribute|removeAttributeNS|removeAttributeNode|removeChild|removeEventListener|replaceChild|reportValidity|requestPointerLock|scrollHeight|scrollIntoView|scrollIntoViewIfNeeded|scrollLeft|scrollWidth|setAttribute|setAttributeNS|setAttributeNode|setAttributeNodeNS|setPointerCapture|shadowRoot|styleMap|tabIndex|tagName|textContent|toString|valueOf|(webkit|ms|moz|o)dropzone|(webkit|moz|ms|o)MatchesSelector|(webkit|moz|ms|o)RequestFullScreen|(webkit|moz|ms|o)RequestFullscreen)(\\s|$)',
6980
  ),
6981
- 'no-verify' => array(
6982
- 'value' => array(
6983
- '',
6984
- ),
6985
- ),
6986
  'pattern' => array(),
6987
  'placeholder' => array(),
6988
  'readonly' => array(),
@@ -6993,19 +8544,21 @@ class AMP_Allowed_Tags_Generated {
6993
  'step' => array(),
6994
  'tabindex' => array(),
6995
  'type' => array(
6996
- 'dispatch_key' => 2,
6997
- 'mandatory' => true,
6998
- 'value_casei' => array(
6999
- 'file',
7000
  ),
7001
  ),
7002
  'value' => array(),
7003
  'width' => array(),
7004
  ),
7005
  'tag_spec' => array(
7006
- 'mandatory_ancestor' => 'form [method=post]',
7007
- 'spec_name' => 'INPUT [type=file]',
7008
- 'spec_url' => 'https://www.ampproject.org/docs/reference/components/amp-form',
 
 
7009
  ),
7010
  ),
7011
  array(
@@ -7030,6 +8583,7 @@ class AMP_Allowed_Tags_Generated {
7030
  '[size]' => array(),
7031
  '[spellcheck]' => array(),
7032
  '[step]' => array(),
 
7033
  '[value]' => array(),
7034
  '[width]' => array(),
7035
  'accept' => array(),
@@ -7041,6 +8595,14 @@ class AMP_Allowed_Tags_Generated {
7041
  'height' => array(),
7042
  'inputmode' => array(),
7043
  'list' => array(),
 
 
 
 
 
 
 
 
7044
  'max' => array(),
7045
  'maxlength' => array(),
7046
  'min' => array(),
@@ -7059,19 +8621,21 @@ class AMP_Allowed_Tags_Generated {
7059
  'step' => array(),
7060
  'tabindex' => array(),
7061
  'type' => array(
7062
- 'dispatch_key' => 2,
7063
- 'mandatory' => true,
7064
- 'value_casei' => array(
7065
- 'password',
7066
  ),
7067
  ),
7068
  'value' => array(),
7069
  'width' => array(),
7070
  ),
7071
  'tag_spec' => array(
7072
- 'mandatory_ancestor' => 'form [method=post]',
7073
- 'spec_name' => 'INPUT [type=password]',
7074
- 'spec_url' => 'https://www.ampproject.org/docs/reference/components/amp-form',
 
 
7075
  ),
7076
  ),
7077
  array(
@@ -7109,8 +8673,11 @@ class AMP_Allowed_Tags_Generated {
7109
  'inputmode' => array(),
7110
  'list' => array(),
7111
  'mask' => array(
7112
- 'dispatch_key' => 1,
7113
  'mandatory' => true,
 
 
 
7114
  ),
7115
  'mask-output' => array(),
7116
  'max' => array(),
@@ -7144,7 +8711,7 @@ class AMP_Allowed_Tags_Generated {
7144
  'requires_extension' => array(
7145
  'amp-inputmask',
7146
  ),
7147
- 'spec_name' => 'input [mask]',
7148
  'spec_url' => 'https://www.ampproject.org/docs/reference/components/amp-inputmask',
7149
  ),
7150
  ),
@@ -7260,7 +8827,7 @@ class AMP_Allowed_Tags_Generated {
7260
  'stroke-opacity' => array(),
7261
  'stroke-width' => array(),
7262
  'style' => array(
7263
- 'blacklisted_value_regex' => '!important',
7264
  ),
7265
  'systemlanguage' => array(),
7266
  'text-anchor' => array(),
@@ -7348,7 +8915,7 @@ class AMP_Allowed_Tags_Generated {
7348
  'stroke-opacity' => array(),
7349
  'stroke-width' => array(),
7350
  'style' => array(
7351
- 'blacklisted_value_regex' => '!important',
7352
  ),
7353
  'text-anchor' => array(),
7354
  'text-decoration' => array(),
@@ -7724,7 +9291,7 @@ class AMP_Allowed_Tags_Generated {
7724
  'stroke-opacity' => array(),
7725
  'stroke-width' => array(),
7726
  'style' => array(
7727
- 'blacklisted_value_regex' => '!important',
7728
  ),
7729
  'text-anchor' => array(),
7730
  'text-decoration' => array(),
@@ -7810,7 +9377,7 @@ class AMP_Allowed_Tags_Generated {
7810
  'stroke-opacity' => array(),
7811
  'stroke-width' => array(),
7812
  'style' => array(
7813
- 'blacklisted_value_regex' => '!important',
7814
  ),
7815
  'systemlanguage' => array(),
7816
  'text-anchor' => array(),
@@ -7977,6 +9544,25 @@ class AMP_Allowed_Tags_Generated {
7977
  'spec_url' => 'https://www.ampproject.org/docs/reference/components/amp-ad',
7978
  ),
7979
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7980
  array(
7981
  'attr_spec_list' => array(
7982
  'content' => array(
@@ -8046,6 +9632,42 @@ class AMP_Allowed_Tags_Generated {
8046
  'spec_name' => 'meta name=amp-ad-doubleclick-sra',
8047
  ),
8048
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8049
  array(
8050
  'attr_spec_list' => array(
8051
  'content' => array(),
@@ -8286,7 +9908,7 @@ class AMP_Allowed_Tags_Generated {
8286
  array(
8287
  'attr_spec_list' => array(
8288
  'style' => array(
8289
- 'blacklisted_value_regex' => '!important',
8290
  ),
8291
  'xml:lang' => array(),
8292
  'xml:space' => array(),
@@ -8334,6 +9956,13 @@ class AMP_Allowed_Tags_Generated {
8334
  ),
8335
  ),
8336
  'tag_spec' => array(
 
 
 
 
 
 
 
8337
  'mandatory_parent' => 'amp-sidebar',
8338
  'spec_name' => 'amp-sidebar > nav',
8339
  ),
@@ -8510,7 +10139,7 @@ class AMP_Allowed_Tags_Generated {
8510
  'stroke-opacity' => array(),
8511
  'stroke-width' => array(),
8512
  'style' => array(
8513
- 'blacklisted_value_regex' => '!important',
8514
  ),
8515
  'systemlanguage' => array(),
8516
  'text-anchor' => array(),
@@ -8598,7 +10227,7 @@ class AMP_Allowed_Tags_Generated {
8598
  'stroke-opacity' => array(),
8599
  'stroke-width' => array(),
8600
  'style' => array(
8601
- 'blacklisted_value_regex' => '!important',
8602
  ),
8603
  'systemlanguage' => array(),
8604
  'text-anchor' => array(),
@@ -8713,7 +10342,7 @@ class AMP_Allowed_Tags_Generated {
8713
  'stroke-opacity' => array(),
8714
  'stroke-width' => array(),
8715
  'style' => array(
8716
- 'blacklisted_value_regex' => '!important',
8717
  ),
8718
  'systemlanguage' => array(),
8719
  'text-anchor' => array(),
@@ -8798,7 +10427,7 @@ class AMP_Allowed_Tags_Generated {
8798
  'stroke-opacity' => array(),
8799
  'stroke-width' => array(),
8800
  'style' => array(
8801
- 'blacklisted_value_regex' => '!important',
8802
  ),
8803
  'systemlanguage' => array(),
8804
  'text-anchor' => array(),
@@ -8920,7 +10549,7 @@ class AMP_Allowed_Tags_Generated {
8920
  'stroke-opacity' => array(),
8921
  'stroke-width' => array(),
8922
  'style' => array(
8923
- 'blacklisted_value_regex' => '!important',
8924
  ),
8925
  'text-anchor' => array(),
8926
  'text-decoration' => array(),
@@ -9029,7 +10658,7 @@ class AMP_Allowed_Tags_Generated {
9029
  'stroke-opacity' => array(),
9030
  'stroke-width' => array(),
9031
  'style' => array(
9032
- 'blacklisted_value_regex' => '!important',
9033
  ),
9034
  'systemlanguage' => array(),
9035
  'text-anchor' => array(),
@@ -9279,6 +10908,35 @@ class AMP_Allowed_Tags_Generated {
9279
  ),
9280
  ),
9281
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9282
  array(
9283
  'attr_spec_list' => array(
9284
  'async' => array(
@@ -9394,6 +11052,31 @@ class AMP_Allowed_Tags_Generated {
9394
  ),
9395
  ),
9396
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9397
  array(
9398
  'attr_spec_list' => array(
9399
  'async' => array(
@@ -9682,6 +11365,31 @@ class AMP_Allowed_Tags_Generated {
9682
  ),
9683
  ),
9684
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9685
  array(
9686
  'attr_spec_list' => array(
9687
  'async' => array(
@@ -10021,6 +11729,31 @@ class AMP_Allowed_Tags_Generated {
10021
  ),
10022
  ),
10023
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10024
  array(
10025
  'attr_spec_list' => array(
10026
  'async' => array(
@@ -11041,6 +12774,44 @@ class AMP_Allowed_Tags_Generated {
11041
  ),
11042
  ),
11043
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11044
  array(
11045
  'attr_spec_list' => array(
11046
  'async' => array(
@@ -11341,6 +13112,31 @@ class AMP_Allowed_Tags_Generated {
11341
  ),
11342
  ),
11343
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11344
  array(
11345
  'attr_spec_list' => array(
11346
  'async' => array(
@@ -11392,6 +13188,31 @@ class AMP_Allowed_Tags_Generated {
11392
  ),
11393
  ),
11394
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11395
  array(
11396
  'attr_spec_list' => array(
11397
  'async' => array(
@@ -11470,6 +13291,31 @@ class AMP_Allowed_Tags_Generated {
11470
  ),
11471
  ),
11472
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11473
  array(
11474
  'attr_spec_list' => array(
11475
  'async' => array(
@@ -11649,6 +13495,9 @@ class AMP_Allowed_Tags_Generated {
11649
  ),
11650
  'tag_spec' => array(
11651
  'extension_spec' => array(
 
 
 
11652
  'name' => 'amp-story',
11653
  'version' => array(
11654
  '0.1',
@@ -11870,6 +13719,57 @@ class AMP_Allowed_Tags_Generated {
11870
  ),
11871
  ),
11872
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11873
  array(
11874
  'attr_spec_list' => array(
11875
  'async' => array(
@@ -12123,6 +14023,18 @@ class AMP_Allowed_Tags_Generated {
12123
  ),
12124
  ),
12125
  'tag_spec' => array(
 
 
 
 
 
 
 
 
 
 
 
 
12126
  'mandatory_parent' => 'amp-accordion',
12127
  'spec_name' => 'amp-accordion > section',
12128
  ),
@@ -12158,7 +14070,9 @@ class AMP_Allowed_Tags_Generated {
12158
  'slot' => array(
12159
  array(
12160
  'attr_spec_list' => array(
12161
- 'name' => array(),
 
 
12162
  ),
12163
  'tag_spec' => array(),
12164
  ),
@@ -12228,7 +14142,7 @@ class AMP_Allowed_Tags_Generated {
12228
  'stroke-opacity' => array(),
12229
  'stroke-width' => array(),
12230
  'style' => array(
12231
- 'blacklisted_value_regex' => '!important',
12232
  ),
12233
  'text-anchor' => array(),
12234
  'text-decoration' => array(),
@@ -12407,7 +14321,7 @@ class AMP_Allowed_Tags_Generated {
12407
  'stop-color' => array(),
12408
  'stop-opacity' => array(),
12409
  'style' => array(
12410
- 'blacklisted_value_regex' => '!important',
12411
  ),
12412
  ),
12413
  'tag_spec' => array(
@@ -12422,7 +14336,7 @@ class AMP_Allowed_Tags_Generated {
12422
  'stop-color' => array(),
12423
  'stop-opacity' => array(),
12424
  'style' => array(
12425
- 'blacklisted_value_regex' => '!important',
12426
  ),
12427
  ),
12428
  'tag_spec' => array(
@@ -12463,7 +14377,7 @@ class AMP_Allowed_Tags_Generated {
12463
  'cdata' => array(
12464
  'blacklisted_cdata_regex' => array(
12465
  'error_message' => 'CSS !important',
12466
- 'regex' => '!important',
12467
  ),
12468
  'css_spec' => array(
12469
  'allowed_at_rules' => array(
@@ -12503,21 +14417,6 @@ class AMP_Allowed_Tags_Generated {
12503
  'unique' => true,
12504
  ),
12505
  ),
12506
- array(
12507
- 'attr_spec_list' => array(
12508
- 'nonce' => array(),
12509
- ),
12510
- 'cdata' => array(
12511
- 'cdata_regex' => 'body ?{opacity: ?0}',
12512
- ),
12513
- 'tag_spec' => array(
12514
- 'mandatory_alternatives' => 'head > style[amp-boilerplate]',
12515
- 'mandatory_parent' => 'head',
12516
- 'spec_name' => 'head > style[amp-boilerplate] - old variant',
12517
- 'spec_url' => 'https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md',
12518
- 'unique' => true,
12519
- ),
12520
- ),
12521
  array(
12522
  'attr_spec_list' => array(
12523
  'amp-boilerplate' => array(
@@ -12533,7 +14432,7 @@ class AMP_Allowed_Tags_Generated {
12533
  'cdata_regex' => '\\s*body\\s*{\\s*-webkit-animation:\\s*-amp-start\\s+8s\\s+steps\\(1,\\s*end\\)\\s+0s\\s+1\\s+normal\\s+both;\\s*-moz-animation:\\s*-amp-start\\s+8s\\s+steps\\s*\\(1\\s*,\\s*end\\s*\\)\\s+0s\\s+1\\s+normal\\s+both;\\s*-ms-animation:\\s*-amp-start\\s+8s\\s+steps\\s*\\(1\\s*,\\s*end\\s*\\)\\s+0s\\s+1\\s+normal\\s+both;\\s*animation:\\s*-amp-start\\s+8s\\s+steps\\(1,\\s*end\\)\\s+0s\\s+1\\s+normal\\s+both;?\\s*}\\s*@-webkit-keyframes\\s+-amp-start\\s*{\\s*from\\s*{\\s*visibility:\\s*hidden;?\\s*}\\s*to\\s*{\\s*visibility:\\s*visible;?\\s*}\\s*}\\s*@-moz-keyframes\\s+-amp-start\\s*{\\s*from\\s*{\\s*visibility:\\s*hidden;?\\s*}\\s*to\\s*{\\s*visibility:\\s*visible;?\\s*}\\s*}\\s*@-ms-keyframes\\s+-amp-start\\s*{\\s*from\\s*{\\s*visibility:\\s*hidden;?\\s*}\\s*to\\s*{\\s*visibility:\\s*visible;?\\s*}\\s*}\\s*@-o-keyframes\\s+-amp-start\\s*{\\s*from\\s*{\\s*visibility:\\s*hidden;?\\s*}\\s*to\\s*{\\s*visibility:\\s*visible;?\\s*}\\s*}\\s*@keyframes\\s+-amp-start\\s*{\\s*from\\s*{\\s*visibility:\\s*hidden;?\\s*}\\s*to\\s*{\\s*visibility:\\s*visible;?\\s*}\\s*}\\s*',
12534
  ),
12535
  'tag_spec' => array(
12536
- 'mandatory_alternatives' => 'head > style[amp-boilerplate]',
12537
  'mandatory_parent' => 'head',
12538
  'spec_name' => 'head > style[amp-boilerplate]',
12539
  'spec_url' => 'https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md',
@@ -12555,7 +14454,7 @@ class AMP_Allowed_Tags_Generated {
12555
  'cdata_regex' => '\\s*body\\s*{\\s*-webkit-animation:\\s*none;\\s*-moz-animation:\\s*none;\\s*-ms-animation:\\s*none;\\s*animation:\\s*none;?\\s*}\\s*',
12556
  ),
12557
  'tag_spec' => array(
12558
- 'mandatory_alternatives' => 'noscript > style[amp-boilerplate]',
12559
  'mandatory_ancestor' => 'head',
12560
  'mandatory_parent' => 'noscript',
12561
  'spec_name' => 'noscript > style[amp-boilerplate]',
@@ -12607,6 +14506,14 @@ class AMP_Allowed_Tags_Generated {
12607
  'tag_spec' => array(),
12608
  ),
12609
  ),
 
 
 
 
 
 
 
 
12610
  'sup' => array(
12611
  array(
12612
  'attr_spec_list' => array(),
@@ -12677,7 +14584,7 @@ class AMP_Allowed_Tags_Generated {
12677
  'stroke-opacity' => array(),
12678
  'stroke-width' => array(),
12679
  'style' => array(
12680
- 'blacklisted_value_regex' => '!important',
12681
  ),
12682
  'systemlanguage' => array(),
12683
  'text-anchor' => array(),
@@ -12768,7 +14675,7 @@ class AMP_Allowed_Tags_Generated {
12768
  'stroke-opacity' => array(),
12769
  'stroke-width' => array(),
12770
  'style' => array(
12771
- 'blacklisted_value_regex' => '!important',
12772
  ),
12773
  'systemlanguage' => array(),
12774
  'text-anchor' => array(),
@@ -12849,7 +14756,7 @@ class AMP_Allowed_Tags_Generated {
12849
  'stroke-opacity' => array(),
12850
  'stroke-width' => array(),
12851
  'style' => array(
12852
- 'blacklisted_value_regex' => '!important',
12853
  ),
12854
  'text-anchor' => array(),
12855
  'text-decoration' => array(),
@@ -12978,6 +14885,7 @@ class AMP_Allowed_Tags_Generated {
12978
  'form div [submitting][template]',
12979
  'form div [verify-error][template]',
12980
  ),
 
12981
  'requires_extension' => array(
12982
  'amp-mustache',
12983
  ),
@@ -12994,6 +14902,7 @@ class AMP_Allowed_Tags_Generated {
12994
  ),
12995
  ),
12996
  'tag_spec' => array(
 
12997
  'mandatory_parent' => 'amp-story-auto-ads',
12998
  'reference_points' => array(
12999
  'AMP-STORY-GRID-LAYER animate-in' => array(
@@ -13076,7 +14985,7 @@ class AMP_Allowed_Tags_Generated {
13076
  'stroke-opacity' => array(),
13077
  'stroke-width' => array(),
13078
  'style' => array(
13079
- 'blacklisted_value_regex' => '!important',
13080
  ),
13081
  'systemlanguage' => array(),
13082
  'text-anchor' => array(),
@@ -13111,6 +15020,7 @@ class AMP_Allowed_Tags_Generated {
13111
  '[disabled]' => array(),
13112
  '[maxlength]' => array(),
13113
  '[minlength]' => array(),
 
13114
  '[placeholder]' => array(),
13115
  '[readonly]' => array(),
13116
  '[required]' => array(),
@@ -13121,6 +15031,11 @@ class AMP_Allowed_Tags_Generated {
13121
  '[spellcheck]' => array(),
13122
  '[wrap]' => array(),
13123
  'autocomplete' => array(),
 
 
 
 
 
13124
  'autofocus' => array(),
13125
  'cols' => array(),
13126
  'disabled' => array(),
@@ -13134,6 +15049,7 @@ class AMP_Allowed_Tags_Generated {
13134
  '',
13135
  ),
13136
  ),
 
13137
  'placeholder' => array(),
13138
  'readonly' => array(),
13139
  'required' => array(),
@@ -13212,7 +15128,7 @@ class AMP_Allowed_Tags_Generated {
13212
  'stroke-opacity' => array(),
13213
  'stroke-width' => array(),
13214
  'style' => array(
13215
- 'blacklisted_value_regex' => '!important',
13216
  ),
13217
  'systemlanguage' => array(),
13218
  'text-anchor' => array(),
@@ -13302,7 +15218,7 @@ class AMP_Allowed_Tags_Generated {
13302
  array(
13303
  'attr_spec_list' => array(
13304
  'style' => array(
13305
- 'blacklisted_value_regex' => '!important',
13306
  ),
13307
  'xml:lang' => array(),
13308
  'xml:space' => array(),
@@ -13604,6 +15520,42 @@ class AMP_Allowed_Tags_Generated {
13604
  'spec_name' => 'amp-video > track[kind=subtitles]',
13605
  ),
13606
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13607
  array(
13608
  'attr_spec_list' => array(
13609
  '[label]' => array(),
@@ -13702,7 +15654,7 @@ class AMP_Allowed_Tags_Generated {
13702
  'stroke-opacity' => array(),
13703
  'stroke-width' => array(),
13704
  'style' => array(
13705
- 'blacklisted_value_regex' => '!important',
13706
  ),
13707
  'systemlanguage' => array(),
13708
  'text-anchor' => array(),
@@ -13806,7 +15758,7 @@ class AMP_Allowed_Tags_Generated {
13806
  'stroke-opacity' => array(),
13807
  'stroke-width' => array(),
13808
  'style' => array(
13809
- 'blacklisted_value_regex' => '!important',
13810
  ),
13811
  'systemlanguage' => array(),
13812
  'text-anchor' => array(),
@@ -13910,7 +15862,7 @@ class AMP_Allowed_Tags_Generated {
13910
  'stroke-opacity' => array(),
13911
  'stroke-width' => array(),
13912
  'style' => array(
13913
- 'blacklisted_value_regex' => '!important',
13914
  ),
13915
  'systemlanguage' => array(),
13916
  'text-anchor' => array(),
@@ -13996,7 +15948,7 @@ class AMP_Allowed_Tags_Generated {
13996
  'externalresourcesrequired' => array(),
13997
  'preserveaspectratio' => array(),
13998
  'style' => array(
13999
- 'blacklisted_value_regex' => '!important',
14000
  ),
14001
  'viewbox' => array(),
14002
  'viewtarget' => array(),
@@ -14019,7 +15971,7 @@ class AMP_Allowed_Tags_Generated {
14019
  'g2' => array(),
14020
  'k' => array(),
14021
  'style' => array(
14022
- 'blacklisted_value_regex' => '!important',
14023
  ),
14024
  'u1' => array(),
14025
  'u2' => array(),
@@ -14106,7 +16058,10 @@ class AMP_Allowed_Tags_Generated {
14106
  'amp-access-style' => array(),
14107
  'amp-access-template' => array(),
14108
  'amp-fx' => array(
14109
- 'value_regex_casei' => '(fade-in|fade-in-scroll|fly-in-bottom|fly-in-left|fly-in-right|fly-in-top|parallax)(\\s|fade-in|fade-in-scroll|fly-in-bottom|fly-in-left|fly-in-right|fly-in-top|parallax)*',
 
 
 
14110
  ),
14111
  'aria-activedescendant' => array(),
14112
  'aria-atomic' => array(),
@@ -14144,6 +16099,7 @@ class AMP_Allowed_Tags_Generated {
14144
  'aria-valuemin' => array(),
14145
  'aria-valuenow' => array(),
14146
  'aria-valuetext' => array(),
 
14147
  'class' => array(
14148
  'blacklisted_value_regex' => '(^|\\W)i-amphtml-',
14149
  ),
@@ -14188,22 +16144,43 @@ class AMP_Allowed_Tags_Generated {
14188
  'rev' => array(),
14189
  'role' => array(),
14190
  'style' => array(
14191
- 'blacklisted_value_regex' => '(!important|<!--)',
 
 
 
 
 
14192
  ),
14193
- 'subscriptions-action' => array(),
14194
  'subscriptions-actions' => array(
 
 
 
14195
  'value' => array(
14196
  '',
14197
  ),
14198
  ),
14199
- 'subscriptions-decorate' => array(),
 
 
 
 
14200
  'subscriptions-dialog' => array(
 
 
 
14201
  'value' => array(
14202
  '',
14203
  ),
14204
  ),
14205
- 'subscriptions-display' => array(),
 
 
 
 
14206
  'subscriptions-section' => array(
 
 
 
14207
  'value_casei' => array(
14208
  'actions',
14209
  'content',
@@ -14211,7 +16188,11 @@ class AMP_Allowed_Tags_Generated {
14211
  'loading',
14212
  ),
14213
  ),
14214
- 'subscriptions-service' => array(),
 
 
 
 
14215
  'tabindex' => array(),
14216
  'title' => array(),
14217
  'translate' => array(),
@@ -14235,6 +16216,26 @@ class AMP_Allowed_Tags_Generated {
14235
 
14236
 
14237
  private static $reference_points = array(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14238
  'AMP-CAROUSEL lightbox [child]' => array(
14239
  'attr_spec_list' => array(
14240
  'lightbox-thumbnail-id' => array(
@@ -14280,6 +16281,7 @@ class AMP_Allowed_Tags_Generated {
14280
  'data-tombstone' => array(),
14281
  'data-update-time' => array(),
14282
  'id' => array(
 
14283
  'mandatory' => true,
14284
  ),
14285
  ),
@@ -14385,6 +16387,19 @@ class AMP_Allowed_Tags_Generated {
14385
  'animate-in-after' => array(),
14386
  'animate-in-delay' => array(),
14387
  'animate-in-duration' => array(),
 
 
 
 
 
 
 
 
 
 
 
 
 
14388
  ),
14389
  'tag_spec' => array(
14390
  'reference_points' => array(
@@ -14424,6 +16439,7 @@ class AMP_Allowed_Tags_Generated {
14424
  'animate-in-after' => array(),
14425
  'animate-in-delay' => array(),
14426
  'animate-in-duration' => array(),
 
14427
  'data-tooltip-icon' => array(
14428
  'value_url' => array(
14429
  'protocol' => array(
@@ -14433,11 +16449,28 @@ class AMP_Allowed_Tags_Generated {
14433
  ),
14434
  ),
14435
  ),
 
 
 
 
 
 
 
 
 
 
 
14436
  'target' => array(
14437
  'value' => array(
14438
  '_blank',
14439
  ),
14440
  ),
 
 
 
 
 
 
14441
  ),
14442
  'tag_spec' => array(
14443
  'reference_points' => array(
@@ -14504,6 +16537,7 @@ class AMP_Allowed_Tags_Generated {
14504
  'animate-in-after' => array(),
14505
  'animate-in-delay' => array(),
14506
  'animate-in-duration' => array(),
 
14507
  'data-tooltip-icon' => array(
14508
  'value_url' => array(
14509
  'protocol' => array(
@@ -14514,6 +16548,11 @@ class AMP_Allowed_Tags_Generated {
14514
  ),
14515
  ),
14516
  'grid-area' => array(),
 
 
 
 
 
14517
  'justify-content' => array(
14518
  'value' => array(
14519
  'center',
@@ -14541,11 +16580,23 @@ class AMP_Allowed_Tags_Generated {
14541
  'stretch',
14542
  ),
14543
  ),
 
 
 
 
 
 
14544
  'target' => array(
14545
  'value' => array(
14546
  '_blank',
14547
  ),
14548
  ),
 
 
 
 
 
 
14549
  ),
14550
  'tag_spec' => array(
14551
  'reference_points' => array(
@@ -14558,6 +16609,17 @@ class AMP_Allowed_Tags_Generated {
14558
  'spec_url' => 'https://www.ampproject.org/docs/reference/components/amp-story',
14559
  ),
14560
  ),
 
 
 
 
 
 
 
 
 
 
 
14561
  );
14562
 
14563
 
@@ -14587,6 +16649,32 @@ class AMP_Allowed_Tags_Generated {
14587
  return null;
14588
  }
14589
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14590
  /**
14591
  * Get reference point spec.
14592
  *
@@ -14622,3 +16710,4 @@ class AMP_Allowed_Tags_Generated {
14622
  }
14623
 
14624
  }
 
13
  */
14
  class AMP_Allowed_Tags_Generated {
15
 
16
+ private static $spec_file_revision = 855;
17
+ private static $minimum_validator_revision_required = 375;
18
+
19
+ private static $descendant_tag_lists = array(
20
+ 'amp-story-bookend-allowed-descendants' => array(
21
+ 'script',
22
+ ),
23
+ 'amp-story-cta-layer-allowed-descendants' => array(
24
+ 'a',
25
+ 'abbr',
26
+ 'address',
27
+ 'amp-call-tracking',
28
+ 'amp-date-countdown',
29
+ 'amp-fit-text',
30
+ 'amp-font',
31
+ 'amp-img',
32
+ 'amp-timeago',
33
+ 'b',
34
+ 'bdi',
35
+ 'bdo',
36
+ 'blockquote',
37
+ 'br',
38
+ 'button',
39
+ 'caption',
40
+ 'cite',
41
+ 'code',
42
+ 'data',
43
+ 'del',
44
+ 'dfn',
45
+ 'div',
46
+ 'em',
47
+ 'figcaption',
48
+ 'figure',
49
+ 'footer',
50
+ 'h1',
51
+ 'h2',
52
+ 'h3',
53
+ 'h4',
54
+ 'h5',
55
+ 'h6',
56
+ 'header',
57
+ 'hgroup',
58
+ 'hr',
59
+ 'i',
60
+ 'ins',
61
+ 'kbd',
62
+ 'li',
63
+ 'main',
64
+ 'mark',
65
+ 'nav',
66
+ 'noscript',
67
+ 'ol',
68
+ 'p',
69
+ 'pre',
70
+ 'q',
71
+ 'rp',
72
+ 'rt',
73
+ 'rtc',
74
+ 'ruby',
75
+ 's',
76
+ 'samp',
77
+ 'section',
78
+ 'small',
79
+ 'span',
80
+ 'strong',
81
+ 'sub',
82
+ 'sup',
83
+ 'time',
84
+ 'tr',
85
+ 'u',
86
+ 'ul',
87
+ 'var',
88
+ 'wbr',
89
+ ),
90
+ 'amp-story-grid-layer-allowed-descendants' => array(
91
+ 'a',
92
+ 'abbr',
93
+ 'address',
94
+ 'amp-analytics',
95
+ 'amp-audio',
96
+ 'amp-date-countdown',
97
+ 'amp-experiment',
98
+ 'amp-fit-text',
99
+ 'amp-font',
100
+ 'amp-gfycat',
101
+ 'amp-gist',
102
+ 'amp-google-vrview-image',
103
+ 'amp-img',
104
+ 'amp-install-serviceworker',
105
+ 'amp-list',
106
+ 'amp-live-list',
107
+ 'amp-pixel',
108
+ 'amp-timeago',
109
+ 'amp-twitter',
110
+ 'amp-video',
111
+ 'article',
112
+ 'aside',
113
+ 'b',
114
+ 'bdi',
115
+ 'bdo',
116
+ 'blockquote',
117
+ 'br',
118
+ 'caption',
119
+ 'cite',
120
+ 'code',
121
+ 'col',
122
+ 'colgroup',
123
+ 'data',
124
+ 'dd',
125
+ 'del',
126
+ 'dfn',
127
+ 'div',
128
+ 'dl',
129
+ 'dt',
130
+ 'em',
131
+ 'figcaption',
132
+ 'figure',
133
+ 'footer',
134
+ 'h1',
135
+ 'h2',
136
+ 'h3',
137
+ 'h4',
138
+ 'h5',
139
+ 'h6',
140
+ 'header',
141
+ 'hgroup',
142
+ 'hr',
143
+ 'i',
144
+ 'ins',
145
+ 'kbd',
146
+ 'li',
147
+ 'main',
148
+ 'mark',
149
+ 'nav',
150
+ 'noscript',
151
+ 'ol',
152
+ 'p',
153
+ 'pre',
154
+ 'q',
155
+ 'rp',
156
+ 'rt',
157
+ 'rtc',
158
+ 'ruby',
159
+ 's',
160
+ 'samp',
161
+ 'section',
162
+ 'small',
163
+ 'source',
164
+ 'span',
165
+ 'strong',
166
+ 'sub',
167
+ 'sup',
168
+ 'table',
169
+ 'tbody',
170
+ 'td',
171
+ 'tfoot',
172
+ 'th',
173
+ 'thead',
174
+ 'time',
175
+ 'tr',
176
+ 'track',
177
+ 'u',
178
+ 'ul',
179
+ 'var',
180
+ 'wbr',
181
+ ),
182
+ 'amp-story-page-attachment-allowed-descendants' => array(
183
+ 'a',
184
+ 'abbr',
185
+ 'address',
186
+ 'amp-3d-gltf',
187
+ 'amp-3q-player',
188
+ 'amp-accordion',
189
+ 'amp-audio',
190
+ 'amp-beopinion',
191
+ 'amp-bodymovin-animation',
192
+ 'amp-brid-player',
193
+ 'amp-brightcove',
194
+ 'amp-byside-content',
195
+ 'amp-call-tracking',
196
+ 'amp-carousel',
197
+ 'amp-dailymotion',
198
+ 'amp-date-countdown',
199
+ 'amp-embedly-card',
200
+ 'amp-facebook',
201
+ 'amp-facebook-comments',
202
+ 'amp-facebook-like',
203
+ 'amp-facebook-page',
204
+ 'amp-fit-text',
205
+ 'amp-fx-collection',
206
+ 'amp-fx-flying-carpet',
207
+ 'amp-gfycat',
208
+ 'amp-gfycat',
209
+ 'amp-gist',
210
+ 'amp-gist',
211
+ 'amp-google-document-embed',
212
+ 'amp-google-vrview-image',
213
+ 'amp-google-vrview-image',
214
+ 'amp-hulu',
215
+ 'amp-ima-video',
216
+ 'amp-image-slider',
217
+ 'amp-img',
218
+ 'amp-imgur',
219
+ 'amp-instagram',
220
+ 'amp-izlesene',
221
+ 'amp-jwplayer',
222
+ 'amp-kaltura-player',
223
+ 'amp-list',
224
+ 'amp-list',
225
+ 'amp-live-list',
226
+ 'amp-live-list',
227
+ 'amp-mathml',
228
+ 'amp-mowplayer',
229
+ 'amp-nexxtv-player',
230
+ 'amp-o2-player',
231
+ 'amp-ooyala-player',
232
+ 'amp-pan-zoom',
233
+ 'amp-pinterest',
234
+ 'amp-playbuzz',
235
+ 'amp-powr-player',
236
+ 'amp-reach-player',
237
+ 'amp-reddit',
238
+ 'amp-riddle-quiz',
239
+ 'amp-soundcloud',
240
+ 'amp-springboard-player',
241
+ 'amp-timeago',
242
+ 'amp-twitter',
243
+ 'amp-video',
244
+ 'amp-video-iframe',
245
+ 'amp-vimeo',
246
+ 'amp-vine',
247
+ 'amp-viqeo-player',
248
+ 'amp-vk',
249
+ 'amp-wistia-player',
250
+ 'amp-yotpo',
251
+ 'amp-youtube',
252
+ 'article',
253
+ 'aside',
254
+ 'b',
255
+ 'bdi',
256
+ 'bdo',
257
+ 'blockquote',
258
+ 'br',
259
+ 'button',
260
+ 'caption',
261
+ 'cite',
262
+ 'code',
263
+ 'col',
264
+ 'colgroup',
265
+ 'data',
266
+ 'dd',
267
+ 'del',
268
+ 'dfn',
269
+ 'div',
270
+ 'dl',
271
+ 'dt',
272
+ 'em',
273
+ 'figcaption',
274
+ 'figure',
275
+ 'footer',
276
+ 'h1',
277
+ 'h2',
278
+ 'h3',
279
+ 'h4',
280
+ 'h5',
281
+ 'h6',
282
+ 'header',
283
+ 'hgroup',
284
+ 'hr',
285
+ 'i',
286
+ 'ins',
287
+ 'kbd',
288
+ 'li',
289
+ 'main',
290
+ 'mark',
291
+ 'nav',
292
+ 'ol',
293
+ 'p',
294
+ 'pre',
295
+ 'q',
296
+ 'rp',
297
+ 'rt',
298
+ 'rtc',
299
+ 'ruby',
300
+ 's',
301
+ 'samp',
302
+ 'section',
303
+ 'small',
304
+ 'source',
305
+ 'span',
306
+ 'strong',
307
+ 'sub',
308
+ 'sup',
309
+ 'table',
310
+ 'tbody',
311
+ 'td',
312
+ 'tfoot',
313
+ 'th',
314
+ 'thead',
315
+ 'time',
316
+ 'tr',
317
+ 'track',
318
+ 'u',
319
+ 'ul',
320
+ 'var',
321
+ 'wbr',
322
+ ),
323
+ );
324
 
325
  private static $allowed_tags = array(
326
  'a' => array(
342
  'maps',
343
  'bip',
344
  'bbmi',
345
+ 'fb-me',
346
  'fb-messenger',
347
  'intent',
348
  'line',
356
  'viber',
357
  'webcal',
358
  'web+mastodon',
359
+ 'wh',
360
  'whatsapp',
361
  ),
362
  ),
363
  ),
364
  'hreflang' => array(),
365
  'media' => array(),
366
+ 'name' => array(
367
+ 'blacklisted_value_regex' => '(^|\\s)(__amp_\\S*|__count__|__defineGetter__|__defineSetter__|__lookupGetter__|__lookupSetter__|__noSuchMethod__|__parent__|__proto__|__AMP_\\S*|\\$p|\\$proxy|acceptCharset|addEventListener|appendChild|assignedSlot|attachShadow|baseURI|checkValidity|childElementCount|childNodes|classList|className|clientHeight|clientLeft|clientTop|clientWidth|compareDocumentPosition|computedName|computedRole|contentEditable|createShadowRoot|enqueAction|firstChild|firstElementChild|getAnimations|getAttribute|getAttributeNS|getAttributeNode|getAttributeNodeNS|getBoundingClientRect|getClientRects|getDestinationInsertionPoints|getElementsByClassName|getElementsByTagName|getElementsByTagNameNS|getRootNode|hasAttribute|hasAttributeNS|hasAttributes|hasChildNodes|hasPointerCapture|innerHTML|innerText|inputMode|insertAdjacentElement|insertAdjacentHTML|insertAdjacentText|isContentEditable|isDefaultNamespace|isEqualNode|isSameNode|lastChild|lastElementChild|lookupNamespaceURI|namespaceURI|nextElementSibling|nextSibling|nodeName|nodeType|nodeValue|offsetHeight|offsetLeft|offsetParent|offsetTop|offsetWidth|outerHTML|outerText|ownerDocument|parentElement|parentNode|previousElementSibling|previousSibling|querySelector|querySelectorAll|releasePointerCapture|removeAttribute|removeAttributeNS|removeAttributeNode|removeChild|removeEventListener|replaceChild|reportValidity|requestPointerLock|scrollHeight|scrollIntoView|scrollIntoViewIfNeeded|scrollLeft|scrollWidth|setAttribute|setAttributeNS|setAttributeNode|setAttributeNodeNS|setPointerCapture|shadowRoot|styleMap|tabIndex|tagName|textContent|toString|valueOf|(webkit|ms|moz|o)dropzone|(webkit|moz|ms|o)MatchesSelector|(webkit|moz|ms|o)RequestFullScreen|(webkit|moz|ms|o)RequestFullscreen)(\\s|$)',
368
+ ),
369
  'referrerpolicy' => array(),
370
  'rel' => array(
371
  'blacklisted_value_regex' => '(^|\\s)(components|dns-prefetch|import|manifest|preconnect|prefetch|preload|prerender|serviceworker|stylesheet|subresource|)(\\s|$)',
534
  5,
535
  ),
536
  ),
537
+ 'child_tags' => array(
538
+ 'child_tag_name_oneof' => array(
539
+ 'section',
540
+ ),
541
+ ),
542
  'requires_extension' => array(
543
  'amp-accordion',
544
  ),
546
  ),
547
  ),
548
  ),
549
+ 'amp-action-macro' => array(
550
+ array(
551
+ 'attr_spec_list' => array(
552
+ 'arguments' => array(),
553
+ 'execute' => array(
554
+ 'mandatory' => true,
555
+ ),
556
+ 'id' => array(
557
+ 'blacklisted_value_regex' => '(^|\\s)(__amp_\\S*|__count__|__defineGetter__|__defineSetter__|__lookupGetter__|__lookupSetter__|__noSuchMethod__|__parent__|__proto__|__AMP_\\S*|\\$p|\\$proxy|acceptCharset|addEventListener|appendChild|assignedSlot|attachShadow|AMP|baseURI|checkValidity|childElementCount|childNodes|classList|className|clientHeight|clientLeft|clientTop|clientWidth|compareDocumentPosition|computedName|computedRole|contentEditable|createShadowRoot|enqueAction|firstChild|firstElementChild|getAnimations|getAttribute|getAttributeNS|getAttributeNode|getAttributeNodeNS|getBoundingClientRect|getClientRects|getDestinationInsertionPoints|getElementsByClassName|getElementsByTagName|getElementsByTagNameNS|getRootNode|hasAttribute|hasAttributeNS|hasAttributes|hasChildNodes|hasPointerCapture|i-amphtml-\\S*|innerHTML|innerText|inputMode|insertAdjacentElement|insertAdjacentHTML|insertAdjacentText|isContentEditable|isDefaultNamespace|isEqualNode|isSameNode|lastChild|lastElementChild|lookupNamespaceURI|namespaceURI|nextElementSibling|nextSibling|nodeName|nodeType|nodeValue|offsetHeight|offsetLeft|offsetParent|offsetTop|offsetWidth|outerHTML|outerText|ownerDocument|parentElement|parentNode|previousElementSibling|previousSibling|querySelector|querySelectorAll|releasePointerCapture|removeAttribute|removeAttributeNS|removeAttributeNode|removeChild|removeEventListener|replaceChild|reportValidity|requestPointerLock|scrollHeight|scrollIntoView|scrollIntoViewIfNeeded|scrollLeft|scrollWidth|setAttribute|setAttributeNS|setAttributeNode|setAttributeNodeNS|setPointerCapture|shadowRoot|styleMap|tabIndex|tagName|textContent|toString|valueOf|(webkit|ms|moz|o)dropzone|(webkit|moz|ms|o)MatchesSelector|(webkit|moz|ms|o)RequestFullScreen|(webkit|moz|ms|o)RequestFullscreen)(\\s|$)',
558
+ 'mandatory' => true,
559
+ ),
560
+ ),
561
+ 'tag_spec' => array(
562
+ 'requires_extension' => array(
563
+ 'amp-action-macro',
564
+ ),
565
+ 'spec_url' => 'https://www.ampproject.org/docs/reference/components/amp-action-macro',
566
+ ),
567
+ ),
568
+ ),
569
  'amp-ad' => array(
570
  array(
571
  'attr_spec_list' => array(
740
  'amp-addthis' => array(
741
  array(
742
  'attr_spec_list' => array(
743
+ 'data-class-name' => array(
744
+ 'mandatory' => false,
745
+ ),
746
+ 'data-product-code' => array(),
747
  'data-pub-id' => array(
748
  'mandatory' => true,
749
  ),
765
  ),
766
  ),
767
  ),
768
+ 'data-widget-id' => array(),
 
 
769
  'media' => array(),
770
  'noloading' => array(
771
  'value' => array(
879
  1,
880
  ),
881
  ),
882
+ 'child_tags' => array(
883
+ 'child_tag_name_oneof' => array(
884
+ 'script',
885
+ ),
886
+ 'mandatory_num_child_tags' => 1,
887
+ ),
888
  'requires_extension' => array(
889
  'amp-animation',
890
  ),
929
  array(
930
  'attr_spec_list' => array(
931
  'id' => array(
932
+ 'blacklisted_value_regex' => '(^|\\s)(__amp_\\S*|__count__|__defineGetter__|__defineSetter__|__lookupGetter__|__lookupSetter__|__noSuchMethod__|__parent__|__proto__|__AMP_\\S*|\\$p|\\$proxy|acceptCharset|addEventListener|appendChild|assignedSlot|attachShadow|AMP|baseURI|checkValidity|childElementCount|childNodes|classList|className|clientHeight|clientLeft|clientTop|clientWidth|compareDocumentPosition|computedName|computedRole|contentEditable|createShadowRoot|enqueAction|firstChild|firstElementChild|getAnimations|getAttribute|getAttributeNS|getAttributeNode|getAttributeNodeNS|getBoundingClientRect|getClientRects|getDestinationInsertionPoints|getElementsByClassName|getElementsByTagName|getElementsByTagNameNS|getRootNode|hasAttribute|hasAttributeNS|hasAttributes|hasChildNodes|hasPointerCapture|i-amphtml-\\S*|innerHTML|innerText|inputMode|insertAdjacentElement|insertAdjacentHTML|insertAdjacentText|isContentEditable|isDefaultNamespace|isEqualNode|isSameNode|lastChild|lastElementChild|lookupNamespaceURI|namespaceURI|nextElementSibling|nextSibling|nodeName|nodeType|nodeValue|offsetHeight|offsetLeft|offsetParent|offsetTop|offsetWidth|outerHTML|outerText|ownerDocument|parentElement|parentNode|previousElementSibling|previousSibling|querySelector|querySelectorAll|releasePointerCapture|removeAttribute|removeAttributeNS|removeAttributeNode|removeChild|removeEventListener|replaceChild|reportValidity|requestPointerLock|scrollHeight|scrollIntoView|scrollIntoViewIfNeeded|scrollLeft|scrollWidth|setAttribute|setAttributeNS|setAttributeNode|setAttributeNodeNS|setPointerCapture|shadowRoot|styleMap|tabIndex|tagName|textContent|toString|valueOf|(webkit|ms|moz|o)dropzone|(webkit|moz|ms|o)MatchesSelector|(webkit|moz|ms|o)RequestFullScreen|(webkit|moz|ms|o)RequestFullscreen)(\\s|$)',
933
  'mandatory' => true,
934
  ),
935
  'media' => array(),
1060
  ),
1061
  'tag_spec' => array(
1062
  'amp_layout' => array(
 
 
1063
  'supported_layouts' => array(
 
 
1064
  1,
1065
  ),
1066
  ),
1097
  ),
1098
  ),
1099
  ),
1100
+ 'amp-base-carousel' => array(
1101
+ array(
1102
+ 'attr_spec_list' => array(
1103
+ '[advance-count]' => array(),
1104
+ '[auto-advance-count]' => array(),
1105
+ '[auto-advance-interval]' => array(),
1106
+ '[auto-advance-loops]' => array(),
1107
+ '[auto-advance]' => array(),
1108
+ '[horizontal]' => array(),
1109
+ '[loop]' => array(),
1110
+ '[mixed-length]' => array(),
1111
+ '[slide]' => array(),
1112
+ '[snap-align]' => array(),
1113
+ '[snap-by]' => array(),
1114
+ '[snap]' => array(),
1115
+ '[visible-count]' => array(),
1116
+ 'advance-count' => array(
1117
+ 'value_regex' => '([^,]+\\s+(-?\\d+),\\s*)*(-?\\d+)',
1118
+ ),
1119
+ 'auto-advance' => array(
1120
+ 'value_regex' => '([^,]+\\s+(true|false),\\s*)*(true|false)',
1121
+ ),
1122
+ 'auto-advance-count' => array(
1123
+ 'value_regex' => '([^,]+\\s+(-?\\d+),\\s*)*(-?\\d+)',
1124
+ ),
1125
+ 'auto-advance-interval' => array(
1126
+ 'value_regex' => '([^,]+\\s+(\\d+),\\s*)*(\\d+)',
1127
+ ),
1128
+ 'auto-advance-loops' => array(
1129
+ 'value_regex' => '([^,]+\\s+(\\d+),\\s*)*(\\d+)',
1130
+ ),
1131
+ 'horizontal' => array(
1132
+ 'value_regex' => '([^,]+\\s+(true|false),\\s*)*(true|false)',
1133
+ ),
1134
+ 'loop' => array(
1135
+ 'value_regex' => '([^,]+\\s+(true|false),\\s*)*(true|false)',
1136
+ ),
1137
+ 'media' => array(),
1138
+ 'mixed-length' => array(
1139
+ 'value_regex' => '([^,]+\\s+(true|false),\\s*)*(true|false)',
1140
+ ),
1141
+ 'noloading' => array(
1142
+ 'value' => array(
1143
+ '',
1144
+ ),
1145
+ ),
1146
+ 'slide' => array(
1147
+ 'value_regex' => '([^,]+\\s+(\\d+),\\s*)*(\\d+)',
1148
+ ),
1149
+ 'snap' => array(
1150
+ 'value_regex' => '([^,]+\\s+(true|false),\\s*)*(true|false)',
1151
+ ),
1152
+ 'snap-align' => array(
1153
+ 'value_regex' => '([^,]+\\s+(start|center),\\s*)*(start|center)',
1154
+ ),
1155
+ 'snap-by' => array(
1156
+ 'value_regex' => '([^,]+\\s+(\\d+),\\s*)*(\\d+)',
1157
+ ),
1158
+ 'visible-count' => array(
1159
+ 'value_regex' => '([^,]+\\s+(\\d+(\\.\\d+)?),\\s*)*(\\d+(\\.\\d+)?)',
1160
+ ),
1161
+ ),
1162
+ 'tag_spec' => array(
1163
+ 'amp_layout' => array(
1164
+ 'supported_layouts' => array(
1165
+ 6,
1166
+ 2,
1167
+ 3,
1168
+ 7,
1169
+ 9,
1170
+ 1,
1171
+ 4,
1172
+ ),
1173
+ ),
1174
+ 'requires_extension' => array(
1175
+ 'amp-base-carousel',
1176
+ ),
1177
+ 'spec_url' => 'https://www.ampproject.org/docs/reference/components/amp-base-carousel',
1178
+ ),
1179
+ ),
1180
+ array(
1181
+ 'attr_spec_list' => array(
1182
+ '[advance-count]' => array(),
1183
+ '[auto-advance-count]' => array(),
1184
+ '[auto-advance-interval]' => array(),
1185
+ '[auto-advance-loops]' => array(),
1186
+ '[auto-advance]' => array(),
1187
+ '[horizontal]' => array(),
1188
+ '[loop]' => array(),
1189
+ '[mixed-length]' => array(),
1190
+ '[slide]' => array(),
1191
+ '[snap-align]' => array(),
1192
+ '[snap-by]' => array(),
1193
+ '[snap]' => array(),
1194
+ '[visible-count]' => array(),
1195
+ 'advance-count' => array(
1196
+ 'value_regex' => '([^,]+\\s+(-?\\d+),\\s*)*(-?\\d+)',
1197
+ ),
1198
+ 'auto-advance' => array(
1199
+ 'value_regex' => '([^,]+\\s+(true|false),\\s*)*(true|false)',
1200
+ ),
1201
+ 'auto-advance-count' => array(
1202
+ 'value_regex' => '([^,]+\\s+(-?\\d+),\\s*)*(-?\\d+)',
1203
+ ),
1204
+ 'auto-advance-interval' => array(
1205
+ 'value_regex' => '([^,]+\\s+(\\d+),\\s*)*(\\d+)',
1206
+ ),
1207
+ 'auto-advance-loops' => array(
1208
+ 'value_regex' => '([^,]+\\s+(\\d+),\\s*)*(\\d+)',
1209
+ ),
1210
+ 'horizontal' => array(
1211
+ 'value_regex' => '([^,]+\\s+(true|false),\\s*)*(true|false)',
1212
+ ),
1213
+ 'lightbox' => array(
1214
+ 'mandatory' => true,
1215
+ ),
1216
+ 'loop' => array(
1217
+ 'value_regex' => '([^,]+\\s+(true|false),\\s*)*(true|false)',
1218
+ ),
1219
+ 'media' => array(),
1220
+ 'mixed-length' => array(
1221
+ 'value_regex' => '([^,]+\\s+(true|false),\\s*)*(true|false)',
1222
+ ),
1223
+ 'noloading' => array(
1224
+ 'value' => array(
1225
+ '',
1226
+ ),
1227
+ ),
1228
+ 'slide' => array(
1229
+ 'value_regex' => '([^,]+\\s+(\\d+),\\s*)*(\\d+)',
1230
+ ),
1231
+ 'snap' => array(
1232
+ 'value_regex' => '([^,]+\\s+(true|false),\\s*)*(true|false)',
1233
+ ),
1234
+ 'snap-align' => array(
1235
+ 'value_regex' => '([^,]+\\s+(start|center),\\s*)*(start|center)',
1236
+ ),
1237
+ 'snap-by' => array(
1238
+ 'value_regex' => '([^,]+\\s+(\\d+),\\s*)*(\\d+)',
1239
+ ),
1240
+ 'visible-count' => array(
1241
+ 'value_regex' => '([^,]+\\s+(\\d+(\\.\\d+)?),\\s*)*(\\d+(\\.\\d+)?)',
1242
+ ),
1243
+ ),
1244
+ 'tag_spec' => array(
1245
+ 'amp_layout' => array(
1246
+ 'supported_layouts' => array(
1247
+ 6,
1248
+ 2,
1249
+ 3,
1250
+ 7,
1251
+ 9,
1252
+ 1,
1253
+ 4,
1254
+ ),
1255
+ ),
1256
+ 'reference_points' => array(
1257
+ 'AMP-BASE-CAROUSEL lightbox [child]' => array(
1258
+ 'mandatory' => false,
1259
+ 'unique' => false,
1260
+ ),
1261
+ 'AMP-BASE-CAROUSEL lightbox [lightbox-exclude]' => array(
1262
+ 'mandatory' => false,
1263
+ 'unique' => false,
1264
+ ),
1265
+ ),
1266
+ 'requires_extension' => array(
1267
+ 'amp-base-carousel',
1268
+ 'amp-lightbox-gallery',
1269
+ ),
1270
+ 'spec_name' => 'AMP-BASE-CAROUSEL [lightbox]',
1271
+ 'spec_url' => 'https://www.ampproject.org/docs/reference/components/amp-base-carousel',
1272
+ ),
1273
+ ),
1274
+ ),
1275
  'amp-beopinion' => array(
1276
  array(
1277
  'attr_spec_list' => array(
1322
  'mandatory' => true,
1323
  ),
1324
  'id' => array(
1325
+ 'blacklisted_value_regex' => '(^|\\s)(__amp_\\S*|__count__|__defineGetter__|__defineSetter__|__lookupGetter__|__lookupSetter__|__noSuchMethod__|__parent__|__proto__|__AMP_\\S*|\\$p|\\$proxy|acceptCharset|addEventListener|appendChild|assignedSlot|attachShadow|AMP|baseURI|checkValidity|childElementCount|childNodes|classList|className|clientHeight|clientLeft|clientTop|clientWidth|compareDocumentPosition|computedName|computedRole|contentEditable|createShadowRoot|enqueAction|firstChild|firstElementChild|getAnimations|getAttribute|getAttributeNS|getAttributeNode|getAttributeNodeNS|getBoundingClientRect|getClientRects|getDestinationInsertionPoints|getElementsByClassName|getElementsByTagName|getElementsByTagNameNS|getRootNode|hasAttribute|hasAttributeNS|hasAttributes|hasChildNodes|hasPointerCapture|i-amphtml-\\S*|innerHTML|innerText|inputMode|insertAdjacentElement|insertAdjacentHTML|insertAdjacentText|isContentEditable|isDefaultNamespace|isEqualNode|isSameNode|lastChild|lastElementChild|lookupNamespaceURI|namespaceURI|nextElementSibling|nextSibling|nodeName|nodeType|nodeValue|offsetHeight|offsetLeft|offsetParent|offsetTop|offsetWidth|outerHTML|outerText|ownerDocument|parentElement|parentNode|previousElementSibling|previousSibling|querySelector|querySelectorAll|releasePointerCapture|removeAttribute|removeAttributeNS|removeAttributeNode|removeChild|removeEventListener|replaceChild|reportValidity|requestPointerLock|scrollHeight|scrollIntoView|scrollIntoViewIfNeeded|scrollLeft|scrollWidth|setAttribute|setAttributeNS|setAttributeNode|setAttributeNodeNS|setPointerCapture|shadowRoot|styleMap|tabIndex|tagName|textContent|toString|valueOf|(webkit|ms|moz|o)dropzone|(webkit|moz|ms|o)MatchesSelector|(webkit|moz|ms|o)RequestFullScreen|(webkit|moz|ms|o)RequestFullscreen)(\\s|$)',
1326
  'mandatory' => true,
1327
  ),
1328
  ),
1387
  array(
1388
  'attr_spec_list' => array(
1389
  'autoplay' => array(),
1390
+ 'data-dynamic' => array(
1391
+ 'value_regex' => '[a-z]+',
1392
+ ),
1393
  'data-outstream' => array(
1394
  'value_regex' => '[0-9]+',
1395
  ),
1402
  'value_regex' => '[0-9]+',
1403
  ),
1404
  'data-playlist' => array(
1405
+ 'value_regex' => '.+',
1406
  ),
1407
  'data-video' => array(
1408
  'value_regex' => '[0-9]+',
1450
  'data-account' => array(
1451
  'mandatory' => true,
1452
  ),
1453
+ 'dock' => array(
1454
+ 'requires_extension' => array(
1455
+ 'amp-video-docking',
1456
+ ),
1457
+ ),
1458
  'media' => array(),
1459
  'noloading' => array(
1460
  'value' => array(
1544
  4,
1545
  ),
1546
  ),
1547
+ 'child_tags' => array(
1548
+ 'child_tag_name_oneof' => array(
1549
+ 'a',
1550
+ ),
1551
+ 'mandatory_num_child_tags' => 1,
1552
+ ),
1553
  'requires_extension' => array(
1554
  'amp-call-tracking',
1555
  ),
1592
  'type' => array(
1593
  'value' => array(
1594
  'slides',
 
1595
  ),
1596
  ),
1597
  ),
1610
  'requires_extension' => array(
1611
  'amp-carousel',
1612
  ),
1613
+ 'spec_name' => 'AMP-CAROUSEL [type=slides]',
1614
  'spec_url' => 'https://www.ampproject.org/docs/reference/components/amp-carousel',
1615
  ),
1616
  ),
1623
  ),
1624
  ),
1625
  'autoplay' => array(
1626
+ 'value_regex' => '(|[0-9]+)',
1627
+ ),
1628
+ 'controls' => array(),
1629
+ 'delay' => array(
1630
+ 'value_regex' => '[0-9]+',
1631
+ ),
1632
+ 'dots' => array(
1633
+ 'value' => array(
1634
+ '',
1635
+ ),
1636
+ ),
1637
+ 'loop' => array(
1638
+ 'value' => array(
1639
+ '',
1640
+ ),
1641
+ ),
1642
+ 'media' => array(),
1643
+ 'noloading' => array(
1644
+ 'value' => array(
1645
+ '',
1646
+ ),
1647
+ ),
1648
+ 'type' => array(
1649
+ 'mandatory' => true,
1650
+ 'value' => array(
1651
+ 'carousel',
1652
+ ),
1653
+ ),
1654
+ ),
1655
+ 'tag_spec' => array(
1656
+ 'amp_layout' => array(
1657
+ 'supported_layouts' => array(
1658
+ 2,
1659
+ 3,
1660
+ 1,
1661
+ ),
1662
+ ),
1663
+ 'requires_extension' => array(
1664
+ 'amp-carousel',
1665
+ ),
1666
+ 'spec_name' => 'AMP-CAROUSEL [type=carousel]',
1667
+ 'spec_url' => 'https://www.ampproject.org/docs/reference/components/amp-carousel',
1668
+ ),
1669
+ ),
1670
+ array(
1671
+ 'attr_spec_list' => array(
1672
+ '[slide]' => array(),
1673
+ 'arrows' => array(
1674
  'value' => array(
1675
  '',
1676
  ),
1677
  ),
1678
+ 'autoplay' => array(
1679
+ 'value_regex' => '(|[0-9]+)',
1680
+ ),
1681
  'controls' => array(),
1682
  'delay' => array(
1683
  'value_regex' => '[0-9]+',
1704
  'type' => array(
1705
  'value' => array(
1706
  'slides',
 
1707
  ),
1708
  ),
1709
  ),
1733
  'amp-carousel',
1734
  'amp-lightbox-gallery',
1735
  ),
1736
+ 'spec_name' => 'AMP-CAROUSEL [lightbox] [type=slides]',
1737
  'spec_url' => 'https://www.ampproject.org/docs/reference/components/amp-carousel',
1738
  ),
1739
  ),
 
 
1740
  array(
1741
  'attr_spec_list' => array(
1742
+ '[slide]' => array(),
1743
+ 'arrows' => array(
1744
+ 'value' => array(
1745
+ '',
1746
+ ),
1747
+ ),
1748
+ 'autoplay' => array(
1749
+ 'value_regex' => '(|[0-9]+)',
1750
+ ),
1751
+ 'controls' => array(),
1752
+ 'delay' => array(
1753
+ 'value_regex' => '[0-9]+',
1754
+ ),
1755
+ 'dots' => array(
1756
+ 'value' => array(
1757
+ '',
1758
+ ),
1759
+ ),
1760
+ 'lightbox' => array(
1761
+ 'mandatory' => true,
1762
+ ),
1763
+ 'loop' => array(
1764
+ 'value' => array(
1765
+ '',
1766
+ ),
1767
+ ),
1768
  'media' => array(),
1769
  'noloading' => array(
1770
  'value' => array(
1771
  '',
1772
  ),
1773
  ),
1774
+ 'type' => array(
1775
+ 'mandatory' => true,
1776
+ 'value' => array(
1777
+ 'carousel',
1778
+ ),
1779
+ ),
1780
  ),
1781
  'tag_spec' => array(
1782
  'amp_layout' => array(
1783
  'supported_layouts' => array(
1784
+ 2,
1785
+ 3,
1786
  1,
1787
  ),
1788
  ),
1789
+ 'reference_points' => array(
1790
+ 'AMP-CAROUSEL lightbox [child]' => array(
1791
+ 'mandatory' => false,
1792
+ 'unique' => false,
1793
+ ),
1794
+ 'AMP-CAROUSEL lightbox [lightbox-exclude]' => array(
1795
+ 'mandatory' => false,
1796
+ 'unique' => false,
1797
+ ),
1798
+ ),
1799
  'requires_extension' => array(
1800
+ 'amp-carousel',
1801
+ 'amp-lightbox-gallery',
1802
  ),
1803
+ 'spec_name' => 'AMP-CAROUSEL [lightbox] [type=carousel]',
1804
+ 'spec_url' => 'https://www.ampproject.org/docs/reference/components/amp-carousel',
1805
  ),
1806
  ),
1807
  ),
1808
+ 'amp-consent' => array(
1809
  array(
1810
  'attr_spec_list' => array(
1811
+ 'media' => array(),
1812
+ 'noloading' => array(
1813
  'value' => array(
1814
+ '',
 
1815
  ),
1816
  ),
1817
+ ),
1818
+ 'tag_spec' => array(
1819
+ 'amp_layout' => array(
1820
+ 'supported_layouts' => array(
1821
+ 1,
1822
  ),
1823
  ),
1824
+ 'requires_extension' => array(
1825
+ 'amp-consent',
1826
+ ),
1827
+ 'unique' => true,
1828
+ ),
1829
+ ),
1830
+ array(
1831
+ 'attr_spec_list' => array(
1832
+ 'media' => array(),
1833
+ 'noloading' => array(
1834
+ 'value' => array(
1835
+ '',
1836
+ ),
1837
+ ),
1838
+ 'type' => array(
1839
+ 'mandatory' => true,
1840
+ ),
1841
+ ),
1842
+ 'tag_spec' => array(
1843
+ 'amp_layout' => array(
1844
+ 'supported_layouts' => array(
1845
+ 1,
1846
+ ),
1847
+ ),
1848
+ 'requires_extension' => array(
1849
+ 'amp-consent',
1850
+ ),
1851
+ 'spec_name' => 'amp-consent [type]',
1852
+ 'unique' => true,
1853
+ ),
1854
+ ),
1855
+ ),
1856
+ 'amp-dailymotion' => array(
1857
+ array(
1858
+ 'attr_spec_list' => array(
1859
+ 'autoplay' => array(),
1860
+ 'data-endscreen-enable' => array(
1861
+ 'value' => array(
1862
+ 'false',
1863
+ 'true',
1864
+ ),
1865
+ ),
1866
+ 'data-info' => array(
1867
+ 'value' => array(
1868
+ 'false',
1869
+ 'true',
1870
+ ),
1871
+ ),
1872
+ 'data-mute' => array(
1873
  'value' => array(
1874
  'false',
1875
  'true',
1897
  'mandatory' => true,
1898
  'value_regex_casei' => '[a-z0-9]+',
1899
  ),
1900
+ 'dock' => array(
1901
+ 'requires_extension' => array(
1902
+ 'amp-video-docking',
1903
+ ),
1904
+ ),
1905
  'media' => array(),
1906
  'noloading' => array(
1907
  'value' => array(
2003
  ),
2004
  ),
2005
  ),
2006
+ 'amp-date-display' => array(
2007
+ array(
2008
+ 'attr_spec_list' => array(
2009
+ 'datetime' => array(
2010
+ 'value_regex' => 'now|(\\d{4}-[01]\\d-[0-3]\\d(T[0-2]\\d:[0-5]\\d(:[0-6]\\d(\\.\\d\\d?\\d?)?)?(Z|[+-][0-1]\\d:[0-5]\\d)?)?)',
2011
+ ),
2012
+ 'display-in' => array(
2013
+ 'value_casei' => array(
2014
+ 'utc',
2015
+ ),
2016
+ ),
2017
+ 'locale' => array(),
2018
+ 'media' => array(),
2019
+ 'noloading' => array(
2020
+ 'value' => array(
2021
+ '',
2022
+ ),
2023
+ ),
2024
+ 'offset-seconds' => array(
2025
+ 'value_regex' => '-?\\d+',
2026
+ ),
2027
+ 'timestamp-ms' => array(
2028
+ 'value_regex' => '\\d+',
2029
+ ),
2030
+ 'timestamp-seconds' => array(
2031
+ 'value_regex' => '\\d+',
2032
+ ),
2033
+ ),
2034
+ 'tag_spec' => array(
2035
+ 'amp_layout' => array(
2036
+ 'supported_layouts' => array(
2037
+ 6,
2038
+ 2,
2039
+ 3,
2040
+ 7,
2041
+ 1,
2042
+ 4,
2043
+ ),
2044
+ ),
2045
+ 'requires_extension' => array(
2046
+ 'amp-date-display',
2047
+ ),
2048
+ ),
2049
+ ),
2050
+ ),
2051
  'amp-date-picker' => array(
2052
  array(
2053
  'attr_spec_list' => array(
2054
  '[max]' => array(),
2055
  '[min]' => array(),
2056
+ '[src]' => array(),
2057
  'allow-blocked-ranges' => array(
2058
  'value' => array(
2059
  '',
2141
  'attr_spec_list' => array(
2142
  '[max]' => array(),
2143
  '[min]' => array(),
2144
+ '[src]' => array(),
2145
  'allow-blocked-ranges' => array(
2146
  'value' => array(
2147
  '',
2225
  'attr_spec_list' => array(
2226
  '[max]' => array(),
2227
  '[min]' => array(),
2228
+ '[src]' => array(),
2229
  'allow-blocked-ranges' => array(
2230
  'value' => array(
2231
  '',
2249
  'highlighted' => array(),
2250
  'locale' => array(),
2251
  'max' => array(),
2252
+ 'maximum-nights' => array(
2253
+ 'value_regex' => '[0-9]+',
2254
+ ),
2255
  'media' => array(),
2256
  'min' => array(),
2257
  'minimum-nights' => array(
2322
  'attr_spec_list' => array(
2323
  '[max]' => array(),
2324
  '[min]' => array(),
2325
+ '[src]' => array(),
2326
  'allow-blocked-ranges' => array(
2327
  'value' => array(
2328
  '',
2341
  'highlighted' => array(),
2342
  'locale' => array(),
2343
  'max' => array(),
2344
+ 'maximum-nights' => array(
2345
+ 'value_regex' => '[0-9]+',
2346
+ ),
2347
  'media' => array(),
2348
  'min' => array(),
2349
  'minimum-nights' => array(
2418
  'data-content-id' => array(
2419
  'mandatory' => true,
2420
  ),
2421
+ 'dock' => array(
2422
+ 'requires_extension' => array(
2423
+ 'amp-video-docking',
2424
+ ),
2425
+ ),
2426
  'media' => array(),
2427
  'noloading' => array(
2428
  'value' => array(
2859
  1,
2860
  ),
2861
  ),
2862
+ 'child_tags' => array(
2863
+ 'first_child_tag_name_oneof' => array(
2864
+ 'script',
2865
+ ),
2866
+ ),
2867
  'requires_extension' => array(
2868
  'amp-geo',
2869
  ),
3105
  ),
3106
  ),
3107
  ),
3108
+ 'dock' => array(
3109
+ 'requires_extension' => array(
3110
+ 'amp-video-docking',
3111
+ ),
3112
+ ),
3113
  'media' => array(),
3114
  'noloading' => array(
3115
  'value' => array(
3188
  4,
3189
  ),
3190
  ),
3191
+ 'child_tags' => array(
3192
+ 'child_tag_name_oneof' => array(
3193
+ 'amp-img',
3194
+ 'div',
3195
+ ),
3196
+ 'mandatory_min_num_child_tags' => 2,
3197
+ ),
3198
  'requires_extension' => array(
3199
  'amp-image-slider',
3200
  ),
3503
  'amp-list' => array(
3504
  array(
3505
  'attr_spec_list' => array(
3506
+ '[is-layout-container]' => array(),
3507
  '[src]' => array(),
3508
  '[state]' => array(),
3509
  'auto-resize' => array(
3520
  ),
3521
  'credentials' => array(),
3522
  'items' => array(),
3523
+ 'load-more' => array(
3524
+ 'value' => array(
3525
+ 'auto',
3526
+ 'manual',
3527
+ ),
3528
+ ),
3529
+ 'load-more-bookmark' => array(),
3530
  'max-items' => array(),
3531
  'media' => array(),
3532
  'noloading' => array(
3570
  ),
3571
  ),
3572
  ),
3573
+ 'amp-list-load-more' => array(
3574
+ array(
3575
+ 'attr_spec_list' => array(
3576
+ 'load-more-button' => array(
3577
+ 'value' => array(
3578
+ '',
3579
+ ),
3580
+ ),
3581
+ 'load-more-end' => array(
3582
+ 'value' => array(
3583
+ '',
3584
+ ),
3585
+ ),
3586
+ 'load-more-failed' => array(
3587
+ 'value' => array(
3588
+ '',
3589
+ ),
3590
+ ),
3591
+ 'load-more-loading' => array(
3592
+ 'value' => array(
3593
+ '',
3594
+ ),
3595
+ ),
3596
+ ),
3597
+ 'tag_spec' => array(
3598
+ 'mandatory_parent' => 'amp-list',
3599
+ 'requires_extension' => array(
3600
+ 'amp-list',
3601
+ ),
3602
+ ),
3603
+ ),
3604
+ ),
3605
  'amp-live-list' => array(
3606
  array(
3607
  'attr_spec_list' => array(
3618
  ),
3619
  ),
3620
  'id' => array(
3621
+ 'blacklisted_value_regex' => '(^|\\s)(__amp_\\S*|__count__|__defineGetter__|__defineSetter__|__lookupGetter__|__lookupSetter__|__noSuchMethod__|__parent__|__proto__|__AMP_\\S*|\\$p|\\$proxy|acceptCharset|addEventListener|appendChild|assignedSlot|attachShadow|AMP|baseURI|checkValidity|childElementCount|childNodes|classList|className|clientHeight|clientLeft|clientTop|clientWidth|compareDocumentPosition|computedName|computedRole|contentEditable|createShadowRoot|enqueAction|firstChild|firstElementChild|getAnimations|getAttribute|getAttributeNS|getAttributeNode|getAttributeNodeNS|getBoundingClientRect|getClientRects|getDestinationInsertionPoints|getElementsByClassName|getElementsByTagName|getElementsByTagNameNS|getRootNode|hasAttribute|hasAttributeNS|hasAttributes|hasChildNodes|hasPointerCapture|i-amphtml-\\S*|innerHTML|innerText|inputMode|insertAdjacentElement|insertAdjacentHTML|insertAdjacentText|isContentEditable|isDefaultNamespace|isEqualNode|isSameNode|lastChild|lastElementChild|lookupNamespaceURI|namespaceURI|nextElementSibling|nextSibling|nodeName|nodeType|nodeValue|offsetHeight|offsetLeft|offsetParent|offsetTop|offsetWidth|outerHTML|outerText|ownerDocument|parentElement|parentNode|previousElementSibling|previousSibling|querySelector|querySelectorAll|releasePointerCapture|removeAttribute|removeAttributeNS|removeAttributeNode|removeChild|removeEventListener|replaceChild|reportValidity|requestPointerLock|scrollHeight|scrollIntoView|scrollIntoViewIfNeeded|scrollLeft|scrollWidth|setAttribute|setAttributeNS|setAttributeNode|setAttributeNodeNS|setPointerCapture|shadowRoot|styleMap|tabIndex|tagName|textContent|toString|valueOf|(webkit|ms|moz|o)dropzone|(webkit|moz|ms|o)MatchesSelector|(webkit|moz|ms|o)RequestFullScreen|(webkit|moz|ms|o)RequestFullscreen)(\\s|$)',
3622
  'mandatory' => true,
3623
  ),
3624
  'sort' => array(
4217
  ),
4218
  ),
4219
  ),
4220
+ 'amp-recaptcha-input' => array(
4221
+ array(
4222
+ 'attr_spec_list' => array(
4223
+ 'data-action' => array(
4224
+ 'mandatory' => true,
4225
+ ),
4226
+ 'data-sitekey' => array(
4227
+ 'mandatory' => true,
4228
+ ),
4229
+ 'name' => array(
4230
+ 'blacklisted_value_regex' => '(^|\\s)(__amp_\\S*|__count__|__defineGetter__|__defineSetter__|__lookupGetter__|__lookupSetter__|__noSuchMethod__|__parent__|__proto__|__AMP_\\S*|\\$p|\\$proxy|acceptCharset|addEventListener|appendChild|assignedSlot|attachShadow|baseURI|checkValidity|childElementCount|childNodes|classList|className|clientHeight|clientLeft|clientTop|clientWidth|compareDocumentPosition|computedName|computedRole|contentEditable|createShadowRoot|enqueAction|firstChild|firstElementChild|getAnimations|getAttribute|getAttributeNS|getAttributeNode|getAttributeNodeNS|getBoundingClientRect|getClientRects|getDestinationInsertionPoints|getElementsByClassName|getElementsByTagName|getElementsByTagNameNS|getRootNode|hasAttribute|hasAttributeNS|hasAttributes|hasChildNodes|hasPointerCapture|innerHTML|innerText|inputMode|insertAdjacentElement|insertAdjacentHTML|insertAdjacentText|isContentEditable|isDefaultNamespace|isEqualNode|isSameNode|lastChild|lastElementChild|lookupNamespaceURI|namespaceURI|nextElementSibling|nextSibling|nodeName|nodeType|nodeValue|offsetHeight|offsetLeft|offsetParent|offsetTop|offsetWidth|outerHTML|outerText|ownerDocument|parentElement|parentNode|previousElementSibling|previousSibling|querySelector|querySelectorAll|releasePointerCapture|removeAttribute|removeAttributeNS|removeAttributeNode|removeChild|removeEventListener|replaceChild|reportValidity|requestPointerLock|scrollHeight|scrollIntoView|scrollIntoViewIfNeeded|scrollLeft|scrollWidth|setAttribute|setAttributeNS|setAttributeNode|setAttributeNodeNS|setPointerCapture|shadowRoot|styleMap|tabIndex|tagName|textContent|toString|valueOf|(webkit|ms|moz|o)dropzone|(webkit|moz|ms|o)MatchesSelector|(webkit|moz|ms|o)RequestFullScreen|(webkit|moz|ms|o)RequestFullscreen)(\\s|$)',
4231
+ 'mandatory' => true,
4232
+ ),
4233
+ ),
4234
+ 'tag_spec' => array(
4235
+ 'amp_layout' => array(
4236
+ 'supported_layouts' => array(
4237
+ 1,
4238
+ ),
4239
+ ),
4240
+ 'mandatory_ancestor' => 'form',
4241
+ 'requires_extension' => array(
4242
+ 'amp-form',
4243
+ 'amp-recaptcha-input',
4244
+ ),
4245
+ ),
4246
+ ),
4247
+ ),
4248
  'amp-reddit' => array(
4249
  array(
4250
  'attr_spec_list' => array(
4321
  ),
4322
  ),
4323
  ),
4324
+ 'amp-script' => array(
4325
+ array(
4326
+ 'attr_spec_list' => array(
4327
+ 'media' => array(),
4328
+ 'noloading' => array(
4329
+ 'value' => array(
4330
+ '',
4331
+ ),
4332
+ ),
4333
+ 'src' => array(
4334
+ 'blacklisted_value_regex' => '__amp_source_origin',
4335
+ 'mandatory' => true,
4336
+ 'value_url' => array(
4337
+ 'allow_relative' => false,
4338
+ 'protocol' => array(
4339
+ 'https',
4340
+ ),
4341
+ ),
4342
+ ),
4343
+ ),
4344
+ 'tag_spec' => array(
4345
+ 'amp_layout' => array(
4346
+ 'supported_layouts' => array(
4347
+ 5,
4348
+ 6,
4349
+ 2,
4350
+ 3,
4351
+ 7,
4352
+ 1,
4353
+ 4,
4354
+ ),
4355
+ ),
4356
+ 'disallowed_ancestor' => array(
4357
+ 'amp-script',
4358
+ ),
4359
+ 'requires_extension' => array(
4360
+ 'amp-script',
4361
+ ),
4362
+ ),
4363
+ ),
4364
+ ),
4365
  'amp-selector' => array(
4366
  array(
4367
  'attr_spec_list' => array(
4447
  1,
4448
  ),
4449
  ),
4450
+ 'disallowed_ancestor' => array(
4451
+ 'amp-story',
4452
+ ),
4453
  'mandatory_parent' => 'body',
4454
  'requires_extension' => array(
4455
  'amp-sidebar',
4456
  ),
4457
+ 'spec_url' => 'https://www.ampproject.org/docs/reference/components/amp-sidebar',
4458
+ ),
4459
+ ),
4460
+ array(
4461
+ 'attr_spec_list' => array(),
4462
+ 'tag_spec' => array(
4463
+ 'amp_layout' => array(
4464
+ 'supported_layouts' => array(
4465
+ 1,
4466
+ ),
4467
+ ),
4468
+ 'mandatory_parent' => 'amp-story',
4469
+ 'requires_extension' => array(
4470
+ 'amp-sidebar',
4471
+ ),
4472
+ 'spec_name' => 'amp-story >> amp-sidebar',
4473
+ 'spec_url' => 'https://www.ampproject.org/docs/reference/components/amp-sidebar',
4474
  ),
4475
  ),
4476
  ),
4477
  'amp-skimlinks' => array(
4478
  array(
4479
  'attr_spec_list' => array(
4480
+ 'custom-redirect-domain' => array(),
4481
  'custom-tracking-id' => array(
4482
  'value_regex_casei' => '^.{0,50}$',
4483
  ),
4512
  ),
4513
  ),
4514
  ),
4515
+ 'amp-smartlinks' => array(
4516
+ array(
4517
+ 'attr_spec_list' => array(
4518
+ 'exclusive-links' => array(
4519
+ 'value' => array(
4520
+ '',
4521
+ ),
4522
+ ),
4523
+ 'link-attribute' => array(),
4524
+ 'link-selector' => array(),
4525
+ 'linkmate' => array(
4526
+ 'value' => array(
4527
+ '',
4528
+ ),
4529
+ ),
4530
+ 'media' => array(),
4531
+ 'noloading' => array(
4532
+ 'value' => array(
4533
+ '',
4534
+ ),
4535
+ ),
4536
+ 'nrtv-account-name' => array(
4537
+ 'mandatory' => true,
4538
+ ),
4539
+ ),
4540
+ 'tag_spec' => array(
4541
+ 'amp_layout' => array(
4542
+ 'supported_layouts' => array(
4543
+ 1,
4544
+ ),
4545
+ ),
4546
+ 'requires_extension' => array(
4547
+ 'amp-smartlinks',
4548
+ ),
4549
+ ),
4550
+ ),
4551
+ ),
4552
  'amp-social-share' => array(
4553
  array(
4554
  'attr_spec_list' => array(
4562
  'https',
4563
  'mailto',
4564
  'bbmi',
4565
+ 'fb-me',
4566
  'fb-messenger',
4567
  'intent',
4568
  'line',
4573
  'tg',
4574
  'threema',
4575
  'viber',
4576
+ 'wh',
4577
  'whatsapp',
4578
  ),
4579
  ),
4701
  '[src]' => array(),
4702
  'credentials' => array(),
4703
  'id' => array(
4704
+ 'blacklisted_value_regex' => '(^|\\s)(__amp_\\S*|__count__|__defineGetter__|__defineSetter__|__lookupGetter__|__lookupSetter__|__noSuchMethod__|__parent__|__proto__|__AMP_\\S*|\\$p|\\$proxy|acceptCharset|addEventListener|appendChild|assignedSlot|attachShadow|AMP|baseURI|checkValidity|childElementCount|childNodes|classList|className|clientHeight|clientLeft|clientTop|clientWidth|compareDocumentPosition|computedName|computedRole|contentEditable|createShadowRoot|enqueAction|firstChild|firstElementChild|getAnimations|getAttribute|getAttributeNS|getAttributeNode|getAttributeNodeNS|getBoundingClientRect|getClientRects|getDestinationInsertionPoints|getElementsByClassName|getElementsByTagName|getElementsByTagNameNS|getRootNode|hasAttribute|hasAttributeNS|hasAttributes|hasChildNodes|hasPointerCapture|i-amphtml-\\S*|innerHTML|innerText|inputMode|insertAdjacentElement|insertAdjacentHTML|insertAdjacentText|isContentEditable|isDefaultNamespace|isEqualNode|isSameNode|lastChild|lastElementChild|lookupNamespaceURI|namespaceURI|nextElementSibling|nextSibling|nodeName|nodeType|nodeValue|offsetHeight|offsetLeft|offsetParent|offsetTop|offsetWidth|outerHTML|outerText|ownerDocument|parentElement|parentNode|previousElementSibling|previousSibling|querySelector|querySelectorAll|releasePointerCapture|removeAttribute|removeAttributeNS|removeAttributeNode|removeChild|removeEventListener|replaceChild|reportValidity|requestPointerLock|scrollHeight|scrollIntoView|scrollIntoViewIfNeeded|scrollLeft|scrollWidth|setAttribute|setAttributeNS|setAttributeNode|setAttributeNodeNS|setPointerCapture|shadowRoot|styleMap|tabIndex|tagName|textContent|toString|valueOf|(webkit|ms|moz|o)dropzone|(webkit|moz|ms|o)MatchesSelector|(webkit|moz|ms|o)RequestFullScreen|(webkit|moz|ms|o)RequestFullscreen)(\\s|$)',
4705
  'mandatory' => true,
4706
  ),
4707
  'overridable' => array(),
4716
  ),
4717
  ),
4718
  'tag_spec' => array(
4719
+ 'child_tags' => array(
4720
+ 'first_child_tag_name_oneof' => array(
4721
+ 'script',
4722
+ ),
4723
+ ),
4724
  'requires_extension' => array(
4725
  'amp-bind',
4726
  ),
4745
  1,
4746
  ),
4747
  ),
4748
+ 'child_tags' => array(
4749
+ 'first_child_tag_name_oneof' => array(
4750
+ 'amp-ad',
4751
+ ),
4752
+ 'mandatory_num_child_tags' => 1,
4753
+ ),
4754
  'disallowed_ancestor' => array(
4755
  'amp-app-banner',
4756
  ),
4823
  '',
4824
  ),
4825
  ),
4826
+ 'supports-landscape' => array(
4827
+ 'value' => array(
4828
+ '',
4829
+ ),
4830
+ ),
4831
  'title' => array(
4832
  'mandatory' => true,
4833
  ),
4834
  ),
4835
  'tag_spec' => array(
4836
+ 'child_tags' => array(
4837
+ 'child_tag_name_oneof' => array(
4838
+ 'amp-analytics',
4839
+ 'amp-consent',
4840
+ 'amp-geo',
4841
+ 'amp-pixel',
4842
+ 'amp-sidebar',
4843
+ 'amp-story-access',
4844
+ 'amp-story-auto-ads',
4845
+ 'amp-story-bookend',
4846
+ 'amp-story-page',
4847
+ ),
4848
+ 'mandatory_min_num_child_tags' => 1,
4849
+ ),
4850
  'mandatory_parent' => 'body',
4851
  'requires_extension' => array(
4852
  'amp-story',
4910
  ),
4911
  ),
4912
  'tag_spec' => array(
4913
+ 'descendant_tag_list' => 'amp-story-bookend-allowed-descendants',
4914
  'mandatory_ancestor' => 'amp-story',
4915
  ),
4916
  ),
4919
  array(
4920
  'attr_spec_list' => array(
4921
  'id' => array(
4922
+ 'blacklisted_value_regex' => '(^|\\s)(__amp_\\S*|__count__|__defineGetter__|__defineSetter__|__lookupGetter__|__lookupSetter__|__noSuchMethod__|__parent__|__proto__|__AMP_\\S*|\\$p|\\$proxy|acceptCharset|addEventListener|appendChild|assignedSlot|attachShadow|AMP|baseURI|checkValidity|childElementCount|childNodes|classList|className|clientHeight|clientLeft|clientTop|clientWidth|compareDocumentPosition|computedName|computedRole|contentEditable|createShadowRoot|enqueAction|firstChild|firstElementChild|getAnimations|getAttribute|getAttributeNS|getAttributeNode|getAttributeNodeNS|getBoundingClientRect|getClientRects|getDestinationInsertionPoints|getElementsByClassName|getElementsByTagName|getElementsByTagNameNS|getRootNode|hasAttribute|hasAttributeNS|hasAttributes|hasChildNodes|hasPointerCapture|i-amphtml-\\S*|innerHTML|innerText|inputMode|insertAdjacentElement|insertAdjacentHTML|insertAdjacentText|isContentEditable|isDefaultNamespace|isEqualNode|isSameNode|lastChild|lastElementChild|lookupNamespaceURI|namespaceURI|nextElementSibling|nextSibling|nodeName|nodeType|nodeValue|offsetHeight|offsetLeft|offsetParent|offsetTop|offsetWidth|outerHTML|outerText|ownerDocument|parentElement|parentNode|previousElementSibling|previousSibling|querySelector|querySelectorAll|releasePointerCapture|removeAttribute|removeAttributeNS|removeAttributeNode|removeChild|removeEventListener|replaceChild|reportValidity|requestPointerLock|scrollHeight|scrollIntoView|scrollIntoViewIfNeeded|scrollLeft|scrollWidth|setAttribute|setAttributeNS|setAttributeNode|setAttributeNodeNS|setPointerCapture|shadowRoot|styleMap|tabIndex|tagName|textContent|toString|valueOf|(webkit|ms|moz|o)dropzone|(webkit|moz|ms|o)MatchesSelector|(webkit|moz|ms|o)RequestFullScreen|(webkit|moz|ms|o)RequestFullscreen)(\\s|$)',
4923
  'mandatory' => true,
4924
  ),
4925
  ),
4929
  1,
4930
  ),
4931
  ),
4932
+ 'child_tags' => array(
4933
+ 'child_tag_name_oneof' => array(
4934
+ 'script',
4935
+ ),
4936
+ 'mandatory_num_child_tags' => 1,
4937
+ ),
4938
  'mandatory_parent' => 'amp-consent',
4939
  'requires_extension' => array(
4940
  'amp-consent',
4947
  array(
4948
  'attr_spec_list' => array(),
4949
  'tag_spec' => array(
4950
+ 'descendant_tag_list' => 'amp-story-cta-layer-allowed-descendants',
4951
  'mandatory_ancestor' => 'amp-story-page',
4952
  'reference_points' => array(
4953
  'AMP-STORY-CTA-LAYER animate-in' => array(
4972
  ),
4973
  ),
4974
  'tag_spec' => array(
4975
+ 'descendant_tag_list' => 'amp-story-grid-layer-allowed-descendants',
4976
  'mandatory_ancestor' => 'amp-story-page',
4977
  'reference_points' => array(
4978
  'AMP-STORY-GRID-LAYER animate-in' => array(
5000
  ),
5001
  ),
5002
  'id' => array(
5003
+ 'blacklisted_value_regex' => '(^|\\s)(__amp_\\S*|__count__|__defineGetter__|__defineSetter__|__lookupGetter__|__lookupSetter__|__noSuchMethod__|__parent__|__proto__|__AMP_\\S*|\\$p|\\$proxy|acceptCharset|addEventListener|appendChild|assignedSlot|attachShadow|AMP|baseURI|checkValidity|childElementCount|childNodes|classList|className|clientHeight|clientLeft|clientTop|clientWidth|compareDocumentPosition|computedName|computedRole|contentEditable|createShadowRoot|enqueAction|firstChild|firstElementChild|getAnimations|getAttribute|getAttributeNS|getAttributeNode|getAttributeNodeNS|getBoundingClientRect|getClientRects|getDestinationInsertionPoints|getElementsByClassName|getElementsByTagName|getElementsByTagNameNS|getRootNode|hasAttribute|hasAttributeNS|hasAttributes|hasChildNodes|hasPointerCapture|i-amphtml-\\S*|innerHTML|innerText|inputMode|insertAdjacentElement|insertAdjacentHTML|insertAdjacentText|isContentEditable|isDefaultNamespace|isEqualNode|isSameNode|lastChild|lastElementChild|lookupNamespaceURI|namespaceURI|nextElementSibling|nextSibling|nodeName|nodeType|nodeValue|offsetHeight|offsetLeft|offsetParent|offsetTop|offsetWidth|outerHTML|outerText|ownerDocument|parentElement|parentNode|previousElementSibling|previousSibling|querySelector|querySelectorAll|releasePointerCapture|removeAttribute|removeAttributeNS|removeAttributeNode|removeChild|removeEventListener|replaceChild|reportValidity|requestPointerLock|scrollHeight|scrollIntoView|scrollIntoViewIfNeeded|scrollLeft|scrollWidth|setAttribute|setAttributeNS|setAttributeNode|setAttributeNodeNS|setPointerCapture|shadowRoot|styleMap|tabIndex|tagName|textContent|toString|valueOf|(webkit|ms|moz|o)dropzone|(webkit|moz|ms|o)MatchesSelector|(webkit|moz|ms|o)RequestFullScreen|(webkit|moz|ms|o)RequestFullscreen)(\\s|$)',
5004
  'mandatory' => true,
5005
  ),
5006
  ),
5007
  'tag_spec' => array(
5008
+ 'child_tags' => array(
5009
+ 'child_tag_name_oneof' => array(
5010
+ 'amp-analytics',
5011
+ 'amp-pixel',
5012
+ 'amp-story-cta-layer',
5013
+ 'amp-story-grid-layer',
5014
+ 'amp-story-page-attachment',
5015
+ ),
5016
+ 'mandatory_min_num_child_tags' => 1,
5017
+ ),
5018
  'mandatory_parent' => 'amp-story',
5019
  'requires_extension' => array(
5020
  'amp-story',
5022
  ),
5023
  ),
5024
  ),
5025
+ 'amp-story-page-attachment' => array(
5026
+ array(
5027
+ 'attr_spec_list' => array(
5028
+ 'layout' => array(
5029
+ 'mandatory' => true,
5030
+ 'value' => array(
5031
+ 'nodisplay',
5032
+ ),
5033
+ ),
5034
+ ),
5035
+ 'tag_spec' => array(
5036
+ 'descendant_tag_list' => 'amp-story-page-attachment-allowed-descendants',
5037
+ 'mandatory_ancestor' => 'amp-story-page',
5038
+ ),
5039
+ ),
5040
+ ),
5041
  'amp-timeago' => array(
5042
  array(
5043
  'attr_spec_list' => array(
5211
  '',
5212
  ),
5213
  ),
5214
+ 'dock' => array(
5215
+ 'requires_extension' => array(
5216
+ 'amp-video-docking',
5217
+ ),
5218
+ ),
5219
  'lightbox' => array(),
5220
  'lightbox-thumbnail-id' => array(
5221
  'value_regex_casei' => '^[a-z][a-z\\d_-]*',
5322
  '',
5323
  ),
5324
  ),
5325
+ 'dock' => array(
5326
+ 'requires_extension' => array(
5327
+ 'amp-video-docking',
5328
+ ),
5329
+ ),
5330
  'loop' => array(
5331
  'value' => array(
5332
  '',
5395
  ),
5396
  ),
5397
  ),
5398
+ 'amp-video-iframe' => array(
5399
+ array(
5400
+ 'attr_spec_list' => array(
5401
+ '[src]' => array(),
5402
+ 'album' => array(),
5403
+ 'alt' => array(),
5404
+ 'artist' => array(),
5405
+ 'artwork' => array(),
5406
+ 'attribution' => array(),
5407
+ 'autoplay' => array(
5408
+ 'value' => array(
5409
+ '',
5410
+ ),
5411
+ ),
5412
+ 'dock' => array(
5413
+ 'requires_extension' => array(
5414
+ 'amp-video-docking',
5415
+ ),
5416
+ ),
5417
+ 'implements-media-session' => array(
5418
+ 'value' => array(
5419
+ '',
5420
+ ),
5421
+ ),
5422
+ 'implements-rotate-to-fullscreen' => array(
5423
+ 'value' => array(
5424
+ '',
5425
+ ),
5426
+ ),
5427
+ 'lightbox' => array(),
5428
+ 'lightbox-thumbnail-id' => array(
5429
+ 'value_regex_casei' => '^[a-z][a-z\\d_-]*',
5430
+ ),
5431
+ 'media' => array(),
5432
+ 'noloading' => array(
5433
+ 'value' => array(
5434
+ '',
5435
+ ),
5436
+ ),
5437
+ 'poster' => array(
5438
+ 'mandatory' => true,
5439
+ ),
5440
+ 'referrerpolicy' => array(),
5441
+ 'rotate-to-fullscreen' => array(
5442
+ 'value' => array(
5443
+ '',
5444
+ ),
5445
+ ),
5446
+ 'src' => array(
5447
+ 'blacklisted_value_regex' => '__amp_source_origin',
5448
+ 'mandatory' => true,
5449
+ 'value_url' => array(
5450
+ 'protocol' => array(
5451
+ 'https',
5452
+ ),
5453
+ ),
5454
+ ),
5455
+ ),
5456
+ 'tag_spec' => array(
5457
+ 'amp_layout' => array(
5458
+ 'supported_layouts' => array(
5459
+ 6,
5460
+ 2,
5461
+ 3,
5462
+ 7,
5463
+ 9,
5464
+ 1,
5465
+ 4,
5466
+ ),
5467
+ ),
5468
+ 'requires_extension' => array(
5469
+ 'amp-video-iframe',
5470
+ ),
5471
+ 'spec_name' => 'AMP-VIDEO-IFRAME[poster]',
5472
+ 'spec_url' => 'https://www.ampproject.org/docs/reference/components/amp-video-iframe',
5473
+ ),
5474
+ ),
5475
+ array(
5476
+ 'attr_spec_list' => array(
5477
+ '[src]' => array(),
5478
+ 'album' => array(),
5479
+ 'alt' => array(),
5480
+ 'artist' => array(),
5481
+ 'artwork' => array(),
5482
+ 'attribution' => array(),
5483
+ 'autoplay' => array(
5484
+ 'value' => array(
5485
+ '',
5486
+ ),
5487
+ ),
5488
+ 'dock' => array(
5489
+ 'requires_extension' => array(
5490
+ 'amp-video-docking',
5491
+ ),
5492
+ ),
5493
+ 'implements-media-session' => array(
5494
+ 'value' => array(
5495
+ '',
5496
+ ),
5497
+ ),
5498
+ 'implements-rotate-to-fullscreen' => array(
5499
+ 'value' => array(
5500
+ '',
5501
+ ),
5502
+ ),
5503
+ 'lightbox' => array(),
5504
+ 'lightbox-thumbnail-id' => array(
5505
+ 'value_regex_casei' => '^[a-z][a-z\\d_-]*',
5506
+ ),
5507
+ 'media' => array(),
5508
+ 'noloading' => array(
5509
+ 'value' => array(
5510
+ '',
5511
+ ),
5512
+ ),
5513
+ 'referrerpolicy' => array(),
5514
+ 'rotate-to-fullscreen' => array(
5515
+ 'value' => array(
5516
+ '',
5517
+ ),
5518
+ ),
5519
+ 'src' => array(
5520
+ 'blacklisted_value_regex' => '__amp_source_origin',
5521
+ 'mandatory' => true,
5522
+ 'value_url' => array(
5523
+ 'protocol' => array(
5524
+ 'https',
5525
+ ),
5526
+ ),
5527
+ ),
5528
+ ),
5529
+ 'tag_spec' => array(
5530
+ 'amp_layout' => array(
5531
+ 'supported_layouts' => array(
5532
+ 6,
5533
+ 2,
5534
+ 3,
5535
+ 7,
5536
+ 9,
5537
+ 1,
5538
+ 4,
5539
+ ),
5540
+ ),
5541
+ 'reference_points' => array(
5542
+ 'AMP-VIDEO-IFRAME > [placeholder]' => array(
5543
+ 'mandatory' => true,
5544
+ 'unique' => true,
5545
+ ),
5546
+ ),
5547
+ 'requires_extension' => array(
5548
+ 'amp-video-iframe',
5549
+ ),
5550
+ 'spec_name' => 'AMP-VIDEO-IFRAME with [placeholder]',
5551
+ 'spec_url' => 'https://www.ampproject.org/docs/reference/components/amp-video-iframe',
5552
+ ),
5553
+ ),
5554
+ ),
5555
  'amp-vimeo' => array(
5556
  array(
5557
  'attr_spec_list' => array(
5851
  'data-videoid' => array(
5852
  'value_regex' => '[^=/?:]+',
5853
  ),
5854
+ 'dock' => array(
5855
+ 'requires_extension' => array(
5856
+ 'amp-video-docking',
5857
+ ),
5858
+ ),
5859
  'lightbox' => array(),
5860
  'lightbox-thumbnail-id' => array(
5861
  'value_regex_casei' => '^[a-z][a-z\\d_-]*',
6123
  'stroke-opacity' => array(),
6124
  'stroke-width' => array(),
6125
  'style' => array(
6126
+ 'blacklisted_value_regex' => '!\\s*important',
6127
  ),
6128
  'systemlanguage' => array(),
6129
  'text-anchor' => array(),
6213
  'stroke-opacity' => array(),
6214
  'stroke-width' => array(),
6215
  'style' => array(
6216
+ 'blacklisted_value_regex' => '!\\s*important',
6217
  ),
6218
  'systemlanguage' => array(),
6219
  'text-anchor' => array(),
6338
  'stroke-opacity' => array(),
6339
  'stroke-width' => array(),
6340
  'style' => array(
6341
+ 'blacklisted_value_regex' => '!\\s*important',
6342
  ),
6343
  'systemlanguage' => array(),
6344
  'text-anchor' => array(),
6383
  array(
6384
  'attr_spec_list' => array(
6385
  'style' => array(
6386
+ 'blacklisted_value_regex' => '!\\s*important',
6387
  ),
6388
  'xml:lang' => array(),
6389
  'xml:space' => array(),
6396
  ),
6397
  ),
6398
  ),
6399
+ 'details' => array(
6400
+ array(
6401
+ 'attr_spec_list' => array(
6402
+ '[open]' => array(),
6403
+ 'open' => array(
6404
+ 'value' => array(
6405
+ '',
6406
+ ),
6407
+ ),
6408
+ ),
6409
+ 'tag_spec' => array(),
6410
+ ),
6411
+ ),
6412
  'dfn' => array(
6413
  array(
6414
  'attr_spec_list' => array(),
6638
  'stroke-opacity' => array(),
6639
  'stroke-width' => array(),
6640
  'style' => array(
6641
+ 'blacklisted_value_regex' => '!\\s*important',
6642
  ),
6643
  'systemlanguage' => array(),
6644
  'text-anchor' => array(),
6727
  'stroke-opacity' => array(),
6728
  'stroke-width' => array(),
6729
  'style' => array(
6730
+ 'blacklisted_value_regex' => '!\\s*important',
6731
  ),
6732
  'text-anchor' => array(),
6733
  'text-decoration' => array(),
6819
  'stroke-opacity' => array(),
6820
  'stroke-width' => array(),
6821
  'style' => array(
6822
+ 'blacklisted_value_regex' => '!\\s*important',
6823
  ),
6824
  'text-anchor' => array(),
6825
  'text-decoration' => array(),
6902
  'stroke-opacity' => array(),
6903
  'stroke-width' => array(),
6904
  'style' => array(
6905
+ 'blacklisted_value_regex' => '!\\s*important',
6906
  ),
6907
  'text-anchor' => array(),
6908
  'text-decoration' => array(),
6988
  'stroke-opacity' => array(),
6989
  'stroke-width' => array(),
6990
  'style' => array(
6991
+ 'blacklisted_value_regex' => '!\\s*important',
6992
  ),
6993
  'text-anchor' => array(),
6994
  'text-decoration' => array(),
7071
  'stroke-opacity' => array(),
7072
  'stroke-width' => array(),
7073
  'style' => array(
7074
+ 'blacklisted_value_regex' => '!\\s*important',
7075
  ),
7076
  'text-anchor' => array(),
7077
  'text-decoration' => array(),
7100
  'attr_spec_list' => array(
7101
  'in' => array(),
7102
  'style' => array(
7103
+ 'blacklisted_value_regex' => '!\\s*important',
7104
  ),
7105
  'xml:lang' => array(),
7106
  'xml:space' => array(),
7175
  'stroke-opacity' => array(),
7176
  'stroke-width' => array(),
7177
  'style' => array(
7178
+ 'blacklisted_value_regex' => '!\\s*important',
7179
  ),
7180
  'text-anchor' => array(),
7181
  'text-decoration' => array(),
7285
  'stroke-opacity' => array(),
7286
  'stroke-width' => array(),
7287
  'style' => array(
7288
+ 'blacklisted_value_regex' => '!\\s*important',
7289
  ),
7290
  'text-anchor' => array(),
7291
  'text-decoration' => array(),
7370
  'get',
7371
  ),
7372
  ),
7373
+ 'name' => array(
7374
+ 'blacklisted_value_regex' => '(^|\\s)(ATTRIBUTE_NODE|CDATA_SECTION_NODE|COMMENT_NODE|DOCUMENT_FRAGMENT_NODE|DOCUMENT_NODE|DOCUMENT_POSITION_CONTAINED_BY|DOCUMENT_POSITION_CONTAINS|DOCUMENT_POSITION_DISCONNECTED|DOCUMENT_POSITION_FOLLOWING|DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|DOCUMENT_POSITION_PRECEDING|DOCUMENT_TYPE_NODE|ELEMENT_NODE|ENTITY_NODE|ENTITY_REFERENCE_NODE|NOTATION_NODE|PROCESSING_INSTRUCTION_NODE|TEXT_NODE|URL|URLUnencoded|__amp_\\S*|__count__|__defineGetter__|__defineSetter__|__lookupGetter__|__lookupSetter__|__noSuchMethod__|__parent__|__proto__|__AMP_\\S*|activeElement|addEventListener|adoptNode|alinkColor|all|anchors|append|appendChild|applets|baseURI|bgColor|body|captureEvents|caretPositionFromPoint|caretRangeFromPoint|characterSet|charset|childElementCount|childNodes|children|clear|cloneNode|close|compareDocumentPosition|compatMode|constructor|contains|contentType|cookie|createAttribute|createAttributeNS|createCDATASection|createComment|createDocumentFragment|createElement|createElementNS|createEvent|createExpression|createNSResolver|createNodeIterator|createProcessingInstruction|createRange|createTextNode|createTreeWalker|currentScript|defaultView|designMode|dir|dispatchEvent|doctype|documentElement|documentURI|domain|elementFromPoint|elementsFromPoint|embeds|enableStyleSheetsForSet|evaluate|execCommand|execCommandShowHelp|exitFullscreen|exitPictureInPicture|exitPointerLock|fgColor|firstChild|firstElementChild|focus|fonts|forms|fullscreen|fullscreenElement|fullscreenEnabled|getCSSCanvasContext|getElementById|getElementsByClassName|getElementsByName|getElementsByTagName|getElementsByTagNameNS|getOverrideStyle|getRootNode|getSelection|hasChildNodes|hasFocus|hasOwnProperty|hasStorageAccess|head|hidden|images|implementation|importNode|inputEncoding|insertBefore|isConnected|isDefaultNamespace|isEqualNode|isPrototypeOf|isSameNode|l10n|lastChild|lastElementChild|lastModified|lastStyleSheetSet|linkColor|links|location|lookupNamespaceURI|lookupPrefix|mozCancelFullScreen|mozFullScreen|mozFullScreenElement|mozFullScreenEnabled|mozSetImageElement|msCSSOMElementFloatMetrics|msCapsLockWarningOff|msElementsFromPoint|msElementsFromRect|nextSibling|nodeName|nodeType|nodeValue|normalize|onabort|onactivate|onafterscriptexecute|onanimationcancel|onanimationend|onanimationiteration|onanimationstart|onauxclick|onbeforeactivate|onbeforecopy|onbeforecut|onbeforedeactivate|onbeforeinput|onbeforepaste|onbeforescriptexecute|onblur|oncancel|oncanplay|oncanplaythrough|onchange|onclick|onclose|oncontextmenu|oncopy|oncuechange|oncut|ondblclick|ondeactivate|ondrag|ondragend|ondragenter|ondragexit|ondragleave|ondragover|ondragstart|ondrop|ondurationchange|onemptied|onended|onerror|onfocus|onfreeze|onfullscreenchange|onfullscreenerror|ongotpointercapture|oninput|oninvalid|onkeydown|onkeypress|onkeyup|onload|onloadeddata|onloadedmetadata|onloadend|onloadstart|onlostpointercapture|onmousedown|onmouseenter|onmouseleave|onmousemove|onmouseout|onmouseover|onmouseup|onmousewheel|onmozfullscreenchange|onmozfullscreenerror|onmscontentzoom|onmsgesturechange|onmsgesturedoubletap|onmsgestureend|onmsgesturehold|onmsgesturestart|onmsgesturetap|onmsinertiastart|onmsmanipulationstatechanged|onmssitemodejumplistitemremoved|onmsthumbnailclick|onpaste|onpause|onplay|onplaying|onpointercancel|onpointerdown|onpointerenter|onpointerleave|onpointerlockchange|onpointerlockerror|onpointermove|onpointerout|onpointerover|onpointerup|onprogress|onratechange|onreadystatechange|onrejectionhandled|onreset|onresize|onresume|onscroll|onsearch|onseeked|onseeking|onselect|onselectionchange|onselectstart|onshow|onstalled|onstop|onsubmit|onsuspend|ontimeupdate|ontoggle|ontransitioncancel|ontransitionend|ontransitionrun|ontransitionstart|onunhandledrejection|onvisibilitychange|onvolumechange|onwaiting|onwebkitanimationend|onwebkitanimationiteration|onwebkitanimationstart|onwebkitfullscreenchange|onwebkitfullscreenerror|onwebkitmouseforcechanged|onwebkitmouseforcedown|onwebkitmouseforceup|onwebkitmouseforcewillbegin|onwebkittransitionend|onwheel|open|origin|ownerDocument|parentElement|parentNode|pictureInPictureElement|pictureInPictureEnabled|plugins|pointerLockElement|preferredStyleSheetSet|prepend|previousSibling|propertyIsEnumerable|queryCommandEnabled|queryCommandIndeterm|queryCommandState|queryCommandSupported|queryCommandText|queryCommandValue|querySelector|querySelectorAll|readyState|referrer|registerElement|releaseCapture|releaseEvents|removeChild|removeEventListener|replaceChild|requestStorageAccess|rootElement|scripts|scrollingElement|selectedStyleSheetSet|styleSheetSets|styleSheets|textContent|title|toLocaleString|toSource|toString|updateSettings|valueOf|visibilityState|vlinkColor|wasDiscarded|webkitCancelFullScreen|webkitCurrentFullScreenElement|webkitExitFullscreen|webkitFullScreenKeyboardInputAllowed|webkitFullscreenElement|webkitFullscreenEnabled|webkitHidden|webkitIsFullScreen|webkitVisibilityState|write|writeln|xmlEncoding|xmlStandalone|xmlVersion)(\\s|$)',
7375
+ ),
7376
  'novalidate' => array(),
7377
  'target' => array(
7378
  'mandatory' => true,
7430
  'post',
7431
  ),
7432
  ),
7433
+ 'name' => array(
7434
+ 'blacklisted_value_regex' => '(^|\\s)(ATTRIBUTE_NODE|CDATA_SECTION_NODE|COMMENT_NODE|DOCUMENT_FRAGMENT_NODE|DOCUMENT_NODE|DOCUMENT_POSITION_CONTAINED_BY|DOCUMENT_POSITION_CONTAINS|DOCUMENT_POSITION_DISCONNECTED|DOCUMENT_POSITION_FOLLOWING|DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|DOCUMENT_POSITION_PRECEDING|DOCUMENT_TYPE_NODE|ELEMENT_NODE|ENTITY_NODE|ENTITY_REFERENCE_NODE|NOTATION_NODE|PROCESSING_INSTRUCTION_NODE|TEXT_NODE|URL|URLUnencoded|__amp_\\S*|__count__|__defineGetter__|__defineSetter__|__lookupGetter__|__lookupSetter__|__noSuchMethod__|__parent__|__proto__|__AMP_\\S*|activeElement|addEventListener|adoptNode|alinkColor|all|anchors|append|appendChild|applets|baseURI|bgColor|body|captureEvents|caretPositionFromPoint|caretRangeFromPoint|characterSet|charset|childElementCount|childNodes|children|clear|cloneNode|close|compareDocumentPosition|compatMode|constructor|contains|contentType|cookie|createAttribute|createAttributeNS|createCDATASection|createComment|createDocumentFragment|createElement|createElementNS|createEvent|createExpression|createNSResolver|createNodeIterator|createProcessingInstruction|createRange|createTextNode|createTreeWalker|currentScript|defaultView|designMode|dir|dispatchEvent|doctype|documentElement|documentURI|domain|elementFromPoint|elementsFromPoint|embeds|enableStyleSheetsForSet|evaluate|execCommand|execCommandShowHelp|exitFullscreen|exitPictureInPicture|exitPointerLock|fgColor|firstChild|firstElementChild|focus|fonts|forms|fullscreen|fullscreenElement|fullscreenEnabled|getCSSCanvasContext|getElementById|getElementsByClassName|getElementsByName|getElementsByTagName|getElementsByTagNameNS|getOverrideStyle|getRootNode|getSelection|hasChildNodes|hasFocus|hasOwnProperty|hasStorageAccess|head|hidden|images|implementation|importNode|inputEncoding|insertBefore|isConnected|isDefaultNamespace|isEqualNode|isPrototypeOf|isSameNode|l10n|lastChild|lastElementChild|lastModified|lastStyleSheetSet|linkColor|links|location|lookupNamespaceURI|lookupPrefix|mozCancelFullScreen|mozFullScreen|mozFullScreenElement|mozFullScreenEnabled|mozSetImageElement|msCSSOMElementFloatMetrics|msCapsLockWarningOff|msElementsFromPoint|msElementsFromRect|nextSibling|nodeName|nodeType|nodeValue|normalize|onabort|onactivate|onafterscriptexecute|onanimationcancel|onanimationend|onanimationiteration|onanimationstart|onauxclick|onbeforeactivate|onbeforecopy|onbeforecut|onbeforedeactivate|onbeforeinput|onbeforepaste|onbeforescriptexecute|onblur|oncancel|oncanplay|oncanplaythrough|onchange|onclick|onclose|oncontextmenu|oncopy|oncuechange|oncut|ondblclick|ondeactivate|ondrag|ondragend|ondragenter|ondragexit|ondragleave|ondragover|ondragstart|ondrop|ondurationchange|onemptied|onended|onerror|onfocus|onfreeze|onfullscreenchange|onfullscreenerror|ongotpointercapture|oninput|oninvalid|onkeydown|onkeypress|onkeyup|onload|onloadeddata|onloadedmetadata|onloadend|onloadstart|onlostpointercapture|onmousedown|onmouseenter|onmouseleave|onmousemove|onmouseout|onmouseover|onmouseup|onmousewheel|onmozfullscreenchange|onmozfullscreenerror|onmscontentzoom|onmsgesturechange|onmsgesturedoubletap|onmsgestureend|onmsgesturehold|onmsgesturestart|onmsgesturetap|onmsinertiastart|onmsmanipulationstatechanged|onmssitemodejumplistitemremoved|onmsthumbnailclick|onpaste|onpause|onplay|onplaying|onpointercancel|onpointerdown|onpointerenter|onpointerleave|onpointerlockchange|onpointerlockerror|onpointermove|onpointerout|onpointerover|onpointerup|onprogress|onratechange|onreadystatechange|onrejectionhandled|onreset|onresize|onresume|onscroll|onsearch|onseeked|onseeking|onselect|onselectionchange|onselectstart|onshow|onstalled|onstop|onsubmit|onsuspend|ontimeupdate|ontoggle|ontransitioncancel|ontransitionend|ontransitionrun|ontransitionstart|onunhandledrejection|onvisibilitychange|onvolumechange|onwaiting|onwebkitanimationend|onwebkitanimationiteration|onwebkitanimationstart|onwebkitfullscreenchange|onwebkitfullscreenerror|onwebkitmouseforcechanged|onwebkitmouseforcedown|onwebkitmouseforceup|onwebkitmouseforcewillbegin|onwebkittransitionend|onwheel|open|origin|ownerDocument|parentElement|parentNode|pictureInPictureElement|pictureInPictureEnabled|plugins|pointerLockElement|preferredStyleSheetSet|prepend|previousSibling|propertyIsEnumerable|queryCommandEnabled|queryCommandIndeterm|queryCommandState|queryCommandSupported|queryCommandText|queryCommandValue|querySelector|querySelectorAll|readyState|referrer|registerElement|releaseCapture|releaseEvents|removeChild|removeEventListener|replaceChild|requestStorageAccess|rootElement|scripts|scrollingElement|selectedStyleSheetSet|styleSheetSets|styleSheets|textContent|title|toLocaleString|toSource|toString|updateSettings|valueOf|visibilityState|vlinkColor|wasDiscarded|webkitCancelFullScreen|webkitCurrentFullScreenElement|webkitExitFullscreen|webkitFullScreenKeyboardInputAllowed|webkitFullscreenElement|webkitFullscreenEnabled|webkitHidden|webkitIsFullScreen|webkitVisibilityState|write|writeln|xmlEncoding|xmlStandalone|xmlVersion)(\\s|$)',
7435
+ ),
7436
  'novalidate' => array(),
7437
  'target' => array(
7438
  'value_casei' => array(
7520
  'stroke-opacity' => array(),
7521
  'stroke-width' => array(),
7522
  'style' => array(
7523
+ 'blacklisted_value_regex' => '!\\s*important',
7524
  ),
7525
  'systemlanguage' => array(),
7526
  'text-anchor' => array(),
7605
  'stroke-opacity' => array(),
7606
  'stroke-width' => array(),
7607
  'style' => array(
7608
+ 'blacklisted_value_regex' => '!\\s*important',
7609
  ),
7610
  'text-anchor' => array(),
7611
  'text-decoration' => array(),
7691
  'stroke-opacity' => array(),
7692
  'stroke-width' => array(),
7693
  'style' => array(
7694
+ 'blacklisted_value_regex' => '!\\s*important',
7695
  ),
7696
  'text-anchor' => array(),
7697
  'text-decoration' => array(),
7810
  'g2' => array(),
7811
  'k' => array(),
7812
  'style' => array(
7813
+ 'blacklisted_value_regex' => '!\\s*important',
7814
  ),
7815
  'u1' => array(),
7816
  'u2' => array(),
7858
  ),
7859
  ),
7860
  'height' => array(),
7861
+ 'name' => array(
7862
+ 'blacklisted_value_regex' => '(^|\\s)(__amp_\\S*|__count__|__defineGetter__|__defineSetter__|__lookupGetter__|__lookupSetter__|__noSuchMethod__|__parent__|__proto__|__AMP_\\S*|\\$p|\\$proxy|acceptCharset|addEventListener|appendChild|assignedSlot|attachShadow|baseURI|checkValidity|childElementCount|childNodes|classList|className|clientHeight|clientLeft|clientTop|clientWidth|compareDocumentPosition|computedName|computedRole|contentEditable|createShadowRoot|enqueAction|firstChild|firstElementChild|getAnimations|getAttribute|getAttributeNS|getAttributeNode|getAttributeNodeNS|getBoundingClientRect|getClientRects|getDestinationInsertionPoints|getElementsByClassName|getElementsByTagName|getElementsByTagNameNS|getRootNode|hasAttribute|hasAttributeNS|hasAttributes|hasChildNodes|hasPointerCapture|innerHTML|innerText|inputMode|insertAdjacentElement|insertAdjacentHTML|insertAdjacentText|isContentEditable|isDefaultNamespace|isEqualNode|isSameNode|lastChild|lastElementChild|lookupNamespaceURI|namespaceURI|nextElementSibling|nextSibling|nodeName|nodeType|nodeValue|offsetHeight|offsetLeft|offsetParent|offsetTop|offsetWidth|outerHTML|outerText|ownerDocument|parentElement|parentNode|previousElementSibling|previousSibling|querySelector|querySelectorAll|releasePointerCapture|removeAttribute|removeAttributeNS|removeAttributeNode|removeChild|removeEventListener|replaceChild|reportValidity|requestPointerLock|scrollHeight|scrollIntoView|scrollIntoViewIfNeeded|scrollLeft|scrollWidth|setAttribute|setAttributeNS|setAttributeNode|setAttributeNodeNS|setPointerCapture|shadowRoot|styleMap|tabIndex|tagName|textContent|toString|valueOf|(webkit|ms|moz|o)dropzone|(webkit|moz|ms|o)MatchesSelector|(webkit|moz|ms|o)RequestFullScreen|(webkit|moz|ms|o)RequestFullscreen)(\\s|$)',
7863
+ ),
7864
  'referrerpolicy' => array(),
7865
  'resizable' => array(
7866
  'value' => array(
7957
  'stroke-opacity' => array(),
7958
  'stroke-width' => array(),
7959
  'style' => array(
7960
+ 'blacklisted_value_regex' => '!\\s*important',
7961
  ),
7962
  'systemlanguage' => array(),
7963
  'text-anchor' => array(),
8109
  'step' => array(),
8110
  'tabindex' => array(),
8111
  'type' => array(
8112
+ 'blacklisted_value_regex' => '(^|\\s)(button|file|image|password|)(\\s|$)',
8113
+ ),
8114
+ 'value' => array(),
8115
+ 'width' => array(),
8116
+ ),
8117
+ 'tag_spec' => array(
8118
+ 'spec_url' => 'https://www.ampproject.org/docs/reference/components/amp-form',
8119
+ ),
8120
+ ),
8121
+ array(
8122
+ 'attr_spec_list' => array(
8123
+ '[accept]' => array(),
8124
+ '[accesskey]' => array(),
8125
+ '[autocomplete]' => array(),
8126
+ '[checked]' => array(),
8127
+ '[disabled]' => array(),
8128
+ '[height]' => array(),
8129
+ '[inputmode]' => array(),
8130
+ '[max]' => array(),
8131
+ '[maxlength]' => array(),
8132
+ '[min]' => array(),
8133
+ '[minlength]' => array(),
8134
+ '[multiple]' => array(),
8135
+ '[pattern]' => array(),
8136
+ '[placeholder]' => array(),
8137
+ '[readonly]' => array(),
8138
+ '[required]' => array(),
8139
+ '[selectiondirection]' => array(),
8140
+ '[size]' => array(),
8141
+ '[spellcheck]' => array(),
8142
+ '[step]' => array(),
8143
+ '[value]' => array(),
8144
+ '[width]' => array(),
8145
+ 'accept' => array(),
8146
+ 'accesskey' => array(),
8147
+ 'autocomplete' => array(),
8148
+ 'autofocus' => array(),
8149
+ 'checked' => array(),
8150
+ 'disabled' => array(),
8151
+ 'height' => array(),
8152
+ 'inputmode' => array(),
8153
+ 'list' => array(),
8154
+ 'max' => array(),
8155
+ 'maxlength' => array(),
8156
+ 'min' => array(),
8157
+ 'minlength' => array(),
8158
+ 'multiple' => array(),
8159
+ 'name' => array(
8160
+ 'blacklisted_value_regex' => '(^|\\s)(__amp_\\S*|__count__|__defineGetter__|__defineSetter__|__lookupGetter__|__lookupSetter__|__noSuchMethod__|__parent__|__proto__|__AMP_\\S*|\\$p|\\$proxy|acceptCharset|addEventListener|appendChild|assignedSlot|attachShadow|baseURI|checkValidity|childElementCount|childNodes|classList|className|clientHeight|clientLeft|clientTop|clientWidth|compareDocumentPosition|computedName|computedRole|contentEditable|createShadowRoot|enqueAction|firstChild|firstElementChild|getAnimations|getAttribute|getAttributeNS|getAttributeNode|getAttributeNodeNS|getBoundingClientRect|getClientRects|getDestinationInsertionPoints|getElementsByClassName|getElementsByTagName|getElementsByTagNameNS|getRootNode|hasAttribute|hasAttributeNS|hasAttributes|hasChildNodes|hasPointerCapture|innerHTML|innerText|inputMode|insertAdjacentElement|insertAdjacentHTML|insertAdjacentText|isContentEditable|isDefaultNamespace|isEqualNode|isSameNode|lastChild|lastElementChild|lookupNamespaceURI|namespaceURI|nextElementSibling|nextSibling|nodeName|nodeType|nodeValue|offsetHeight|offsetLeft|offsetParent|offsetTop|offsetWidth|outerHTML|outerText|ownerDocument|parentElement|parentNode|previousElementSibling|previousSibling|querySelector|querySelectorAll|releasePointerCapture|removeAttribute|removeAttributeNS|removeAttributeNode|removeChild|removeEventListener|replaceChild|reportValidity|requestPointerLock|scrollHeight|scrollIntoView|scrollIntoViewIfNeeded|scrollLeft|scrollWidth|setAttribute|setAttributeNS|setAttributeNode|setAttributeNodeNS|setPointerCapture|shadowRoot|styleMap|tabIndex|tagName|textContent|toString|valueOf|(webkit|ms|moz|o)dropzone|(webkit|moz|ms|o)MatchesSelector|(webkit|moz|ms|o)RequestFullScreen|(webkit|moz|ms|o)RequestFullscreen)(\\s|$)',
8161
+ ),
8162
+ 'no-verify' => array(
8163
+ 'value' => array(
8164
+ '',
8165
+ ),
8166
+ ),
8167
+ 'pattern' => array(),
8168
+ 'placeholder' => array(),
8169
+ 'readonly' => array(),
8170
+ 'required' => array(),
8171
+ 'selectiondirection' => array(),
8172
+ 'size' => array(),
8173
+ 'spellcheck' => array(),
8174
+ 'step' => array(),
8175
+ 'tabindex' => array(),
8176
+ 'type' => array(
8177
+ 'dispatch_key' => 2,
8178
+ 'mandatory' => true,
8179
+ 'value_casei' => array(
8180
+ 'file',
8181
+ ),
8182
+ ),
8183
+ 'value' => array(),
8184
+ 'width' => array(),
8185
+ ),
8186
+ 'tag_spec' => array(
8187
+ 'mandatory_ancestor' => 'form [method=post]',
8188
+ 'spec_name' => 'INPUT [type=file]',
8189
+ 'spec_url' => 'https://www.ampproject.org/docs/reference/components/amp-form',
8190
+ ),
8191
+ ),
8192
+ array(
8193
+ 'attr_spec_list' => array(
8194
+ '[accept]' => array(),
8195
+ '[accesskey]' => array(),
8196
+ '[autocomplete]' => array(),
8197
+ '[checked]' => array(),
8198
+ '[disabled]' => array(),
8199
+ '[height]' => array(),
8200
+ '[inputmode]' => array(),
8201
+ '[max]' => array(),
8202
+ '[maxlength]' => array(),
8203
+ '[min]' => array(),
8204
+ '[minlength]' => array(),
8205
+ '[multiple]' => array(),
8206
+ '[pattern]' => array(),
8207
+ '[placeholder]' => array(),
8208
+ '[readonly]' => array(),
8209
+ '[required]' => array(),
8210
+ '[selectiondirection]' => array(),
8211
+ '[size]' => array(),
8212
+ '[spellcheck]' => array(),
8213
+ '[step]' => array(),
8214
+ '[value]' => array(),
8215
+ '[width]' => array(),
8216
+ 'accept' => array(),
8217
+ 'accesskey' => array(),
8218
+ 'autocomplete' => array(),
8219
+ 'autofocus' => array(),
8220
+ 'checked' => array(),
8221
+ 'disabled' => array(),
8222
+ 'height' => array(),
8223
+ 'inputmode' => array(),
8224
+ 'list' => array(),
8225
+ 'max' => array(),
8226
+ 'maxlength' => array(),
8227
+ 'min' => array(),
8228
+ 'minlength' => array(),
8229
+ 'multiple' => array(),
8230
+ 'name' => array(
8231
+ 'blacklisted_value_regex' => '(^|\\s)(__amp_\\S*|__count__|__defineGetter__|__defineSetter__|__lookupGetter__|__lookupSetter__|__noSuchMethod__|__parent__|__proto__|__AMP_\\S*|\\$p|\\$proxy|acceptCharset|addEventListener|appendChild|assignedSlot|attachShadow|baseURI|checkValidity|childElementCount|childNodes|classList|className|clientHeight|clientLeft|clientTop|clientWidth|compareDocumentPosition|computedName|computedRole|contentEditable|createShadowRoot|enqueAction|firstChild|firstElementChild|getAnimations|getAttribute|getAttributeNS|getAttributeNode|getAttributeNodeNS|getBoundingClientRect|getClientRects|getDestinationInsertionPoints|getElementsByClassName|getElementsByTagName|getElementsByTagNameNS|getRootNode|hasAttribute|hasAttributeNS|hasAttributes|hasChildNodes|hasPointerCapture|innerHTML|innerText|inputMode|insertAdjacentElement|insertAdjacentHTML|insertAdjacentText|isContentEditable|isDefaultNamespace|isEqualNode|isSameNode|lastChild|lastElementChild|lookupNamespaceURI|namespaceURI|nextElementSibling|nextSibling|nodeName|nodeType|nodeValue|offsetHeight|offsetLeft|offsetParent|offsetTop|offsetWidth|outerHTML|outerText|ownerDocument|parentElement|parentNode|previousElementSibling|previousSibling|querySelector|querySelectorAll|releasePointerCapture|removeAttribute|removeAttributeNS|removeAttributeNode|removeChild|removeEventListener|replaceChild|reportValidity|requestPointerLock|scrollHeight|scrollIntoView|scrollIntoViewIfNeeded|scrollLeft|scrollWidth|setAttribute|setAttributeNS|setAttributeNode|setAttributeNodeNS|setPointerCapture|shadowRoot|styleMap|tabIndex|tagName|textContent|toString|valueOf|(webkit|ms|moz|o)dropzone|(webkit|moz|ms|o)MatchesSelector|(webkit|moz|ms|o)RequestFullScreen|(webkit|moz|ms|o)RequestFullscreen)(\\s|$)',
8232
+ ),
8233
+ 'pattern' => array(),
8234
+ 'placeholder' => array(),
8235
+ 'readonly' => array(),
8236
+ 'required' => array(),
8237
+ 'selectiondirection' => array(),
8238
+ 'size' => array(),
8239
+ 'spellcheck' => array(),
8240
+ 'step' => array(),
8241
+ 'tabindex' => array(),
8242
+ 'type' => array(
8243
+ 'dispatch_key' => 2,
8244
+ 'mandatory' => true,
8245
+ 'value_casei' => array(
8246
+ 'password',
8247
+ ),
8248
+ ),
8249
+ 'value' => array(),
8250
+ 'width' => array(),
8251
+ ),
8252
+ 'tag_spec' => array(
8253
+ 'mandatory_ancestor' => 'form [method=post]',
8254
+ 'spec_name' => 'INPUT [type=password]',
8255
+ 'spec_url' => 'https://www.ampproject.org/docs/reference/components/amp-form',
8256
+ ),
8257
+ ),
8258
+ array(
8259
+ 'attr_spec_list' => array(
8260
+ '[accept]' => array(),
8261
+ '[accesskey]' => array(),
8262
+ '[autocomplete]' => array(),
8263
+ '[checked]' => array(),
8264
+ '[disabled]' => array(),
8265
+ '[height]' => array(),
8266
+ '[inputmode]' => array(),
8267
+ '[max]' => array(),
8268
+ '[maxlength]' => array(),
8269
+ '[min]' => array(),
8270
+ '[minlength]' => array(),
8271
+ '[multiple]' => array(),
8272
+ '[pattern]' => array(),
8273
+ '[placeholder]' => array(),
8274
+ '[readonly]' => array(),
8275
+ '[required]' => array(),
8276
+ '[selectiondirection]' => array(),
8277
+ '[size]' => array(),
8278
+ '[spellcheck]' => array(),
8279
+ '[step]' => array(),
8280
+ '[type]' => array(),
8281
+ '[value]' => array(),
8282
+ '[width]' => array(),
8283
+ 'accept' => array(),
8284
+ 'accesskey' => array(),
8285
+ 'autocomplete' => array(),
8286
+ 'autofocus' => array(),
8287
+ 'checked' => array(),
8288
+ 'disabled' => array(),
8289
+ 'height' => array(),
8290
+ 'inputmode' => array(),
8291
+ 'list' => array(),
8292
+ 'mask' => array(
8293
+ 'blacklisted_value_regex' => '(payment-card|date-dd-mm-yyyy|date-mm-dd-yyyy|date-mm-yy|date-yyyy-mm-dd)',
8294
+ 'dispatch_key' => 1,
8295
+ 'mandatory' => true,
8296
+ ),
8297
+ 'mask-output' => array(),
8298
+ 'max' => array(),
8299
+ 'maxlength' => array(),
8300
+ 'min' => array(),
8301
+ 'minlength' => array(),
8302
+ 'multiple' => array(),
8303
+ 'name' => array(
8304
+ 'blacklisted_value_regex' => '(^|\\s)(__amp_\\S*|__count__|__defineGetter__|__defineSetter__|__lookupGetter__|__lookupSetter__|__noSuchMethod__|__parent__|__proto__|__AMP_\\S*|\\$p|\\$proxy|acceptCharset|addEventListener|appendChild|assignedSlot|attachShadow|baseURI|checkValidity|childElementCount|childNodes|classList|className|clientHeight|clientLeft|clientTop|clientWidth|compareDocumentPosition|computedName|computedRole|contentEditable|createShadowRoot|enqueAction|firstChild|firstElementChild|getAnimations|getAttribute|getAttributeNS|getAttributeNode|getAttributeNodeNS|getBoundingClientRect|getClientRects|getDestinationInsertionPoints|getElementsByClassName|getElementsByTagName|getElementsByTagNameNS|getRootNode|hasAttribute|hasAttributeNS|hasAttributes|hasChildNodes|hasPointerCapture|innerHTML|innerText|inputMode|insertAdjacentElement|insertAdjacentHTML|insertAdjacentText|isContentEditable|isDefaultNamespace|isEqualNode|isSameNode|lastChild|lastElementChild|lookupNamespaceURI|namespaceURI|nextElementSibling|nextSibling|nodeName|nodeType|nodeValue|offsetHeight|offsetLeft|offsetParent|offsetTop|offsetWidth|outerHTML|outerText|ownerDocument|parentElement|parentNode|previousElementSibling|previousSibling|querySelector|querySelectorAll|releasePointerCapture|removeAttribute|removeAttributeNS|removeAttributeNode|removeChild|removeEventListener|replaceChild|reportValidity|requestPointerLock|scrollHeight|scrollIntoView|scrollIntoViewIfNeeded|scrollLeft|scrollWidth|setAttribute|setAttributeNS|setAttributeNode|setAttributeNodeNS|setPointerCapture|shadowRoot|styleMap|tabIndex|tagName|textContent|toString|valueOf|(webkit|ms|moz|o)dropzone|(webkit|moz|ms|o)MatchesSelector|(webkit|moz|ms|o)RequestFullScreen|(webkit|moz|ms|o)RequestFullscreen)(\\s|$)',
8305
+ ),
8306
+ 'pattern' => array(),
8307
+ 'placeholder' => array(),
8308
+ 'readonly' => array(),
8309
+ 'required' => array(),
8310
+ 'selectiondirection' => array(),
8311
+ 'size' => array(),
8312
+ 'spellcheck' => array(),
8313
+ 'step' => array(),
8314
+ 'tabindex' => array(),
8315
+ 'type' => array(
8316
+ 'value' => array(
8317
+ 'text',
8318
+ 'tel',
8319
+ 'search',
8320
+ ),
8321
+ ),
8322
+ 'value' => array(),
8323
+ 'width' => array(),
8324
+ ),
8325
+ 'tag_spec' => array(
8326
+ 'requires_extension' => array(
8327
+ 'amp-inputmask',
8328
+ ),
8329
+ 'spec_name' => 'input [mask] (custom mask)',
8330
+ 'spec_url' => 'https://www.ampproject.org/docs/reference/components/amp-inputmask',
8331
+ ),
8332
+ ),
8333
+ array(
8334
+ 'attr_spec_list' => array(
8335
+ '[accept]' => array(),
8336
+ '[accesskey]' => array(),
8337
+ '[autocomplete]' => array(),
8338
+ '[checked]' => array(),
8339
+ '[disabled]' => array(),
8340
+ '[height]' => array(),
8341
+ '[inputmode]' => array(),
8342
+ '[max]' => array(),
8343
+ '[maxlength]' => array(),
8344
+ '[min]' => array(),
8345
+ '[minlength]' => array(),
8346
+ '[multiple]' => array(),
8347
+ '[pattern]' => array(),
8348
+ '[placeholder]' => array(),
8349
+ '[readonly]' => array(),
8350
+ '[required]' => array(),
8351
+ '[selectiondirection]' => array(),
8352
+ '[size]' => array(),
8353
+ '[spellcheck]' => array(),
8354
+ '[step]' => array(),
8355
+ '[type]' => array(),
8356
+ '[value]' => array(),
8357
+ '[width]' => array(),
8358
+ 'accept' => array(),
8359
+ 'accesskey' => array(),
8360
+ 'autocomplete' => array(),
8361
+ 'autofocus' => array(),
8362
+ 'checked' => array(),
8363
+ 'disabled' => array(),
8364
+ 'height' => array(),
8365
+ 'inputmode' => array(),
8366
+ 'list' => array(),
8367
+ 'mask' => array(
8368
+ 'dispatch_key' => 2,
8369
+ 'mandatory' => true,
8370
+ 'value' => array(
8371
+ 'payment-card',
8372
+ ),
8373
+ ),
8374
+ 'mask-output' => array(),
8375
+ 'max' => array(),
8376
+ 'maxlength' => array(),
8377
+ 'min' => array(),
8378
+ 'minlength' => array(),
8379
+ 'multiple' => array(),
8380
+ 'name' => array(
8381
+ 'blacklisted_value_regex' => '(^|\\s)(__amp_\\S*|__count__|__defineGetter__|__defineSetter__|__lookupGetter__|__lookupSetter__|__noSuchMethod__|__parent__|__proto__|__AMP_\\S*|\\$p|\\$proxy|acceptCharset|addEventListener|appendChild|assignedSlot|attachShadow|baseURI|checkValidity|childElementCount|childNodes|classList|className|clientHeight|clientLeft|clientTop|clientWidth|compareDocumentPosition|computedName|computedRole|contentEditable|createShadowRoot|enqueAction|firstChild|firstElementChild|getAnimations|getAttribute|getAttributeNS|getAttributeNode|getAttributeNodeNS|getBoundingClientRect|getClientRects|getDestinationInsertionPoints|getElementsByClassName|getElementsByTagName|getElementsByTagNameNS|getRootNode|hasAttribute|hasAttributeNS|hasAttributes|hasChildNodes|hasPointerCapture|innerHTML|innerText|inputMode|insertAdjacentElement|insertAdjacentHTML|insertAdjacentText|isContentEditable|isDefaultNamespace|isEqualNode|isSameNode|lastChild|lastElementChild|lookupNamespaceURI|namespaceURI|nextElementSibling|nextSibling|nodeName|nodeType|nodeValue|offsetHeight|offsetLeft|offsetParent|offsetTop|offsetWidth|outerHTML|outerText|ownerDocument|parentElement|parentNode|previousElementSibling|previousSibling|querySelector|querySelectorAll|releasePointerCapture|removeAttribute|removeAttributeNS|removeAttributeNode|removeChild|removeEventListener|replaceChild|reportValidity|requestPointerLock|scrollHeight|scrollIntoView|scrollIntoViewIfNeeded|scrollLeft|scrollWidth|setAttribute|setAttributeNS|setAttributeNode|setAttributeNodeNS|setPointerCapture|shadowRoot|styleMap|tabIndex|tagName|textContent|toString|valueOf|(webkit|ms|moz|o)dropzone|(webkit|moz|ms|o)MatchesSelector|(webkit|moz|ms|o)RequestFullScreen|(webkit|moz|ms|o)RequestFullscreen)(\\s|$)',
8382
+ ),
8383
+ 'pattern' => array(),
8384
+ 'placeholder' => array(),
8385
+ 'readonly' => array(),
8386
+ 'required' => array(),
8387
+ 'selectiondirection' => array(),
8388
+ 'size' => array(),
8389
+ 'spellcheck' => array(),
8390
+ 'step' => array(),
8391
+ 'tabindex' => array(),
8392
+ 'type' => array(
8393
+ 'value' => array(
8394
+ 'text',
8395
+ 'tel',
8396
+ 'search',
8397
+ ),
8398
+ ),
8399
+ 'value' => array(),
8400
+ 'width' => array(),
8401
+ ),
8402
+ 'tag_spec' => array(
8403
+ 'requires_extension' => array(
8404
+ 'amp-inputmask',
8405
+ ),
8406
+ 'spec_name' => 'input [mask=payment-card]',
8407
+ 'spec_url' => 'https://www.ampproject.org/docs/reference/components/amp-inputmask',
8408
+ ),
8409
+ ),
8410
+ array(
8411
+ 'attr_spec_list' => array(
8412
+ '[accept]' => array(),
8413
+ '[accesskey]' => array(),
8414
+ '[autocomplete]' => array(),
8415
+ '[checked]' => array(),
8416
+ '[disabled]' => array(),
8417
+ '[height]' => array(),
8418
+ '[inputmode]' => array(),
8419
+ '[max]' => array(),
8420
+ '[maxlength]' => array(),
8421
+ '[min]' => array(),
8422
+ '[minlength]' => array(),
8423
+ '[multiple]' => array(),
8424
+ '[pattern]' => array(),
8425
+ '[placeholder]' => array(),
8426
+ '[readonly]' => array(),
8427
+ '[required]' => array(),
8428
+ '[selectiondirection]' => array(),
8429
+ '[size]' => array(),
8430
+ '[spellcheck]' => array(),
8431
+ '[step]' => array(),
8432
+ '[type]' => array(),
8433
+ '[value]' => array(),
8434
+ '[width]' => array(),
8435
+ 'accept' => array(),
8436
+ 'accesskey' => array(),
8437
+ 'autocomplete' => array(),
8438
+ 'autofocus' => array(),
8439
+ 'checked' => array(),
8440
+ 'disabled' => array(),
8441
+ 'height' => array(),
8442
+ 'inputmode' => array(),
8443
+ 'list' => array(),
8444
+ 'mask' => array(
8445
+ 'dispatch_key' => 2,
8446
+ 'mandatory' => true,
8447
+ 'value' => array(
8448
+ 'date-dd-mm-yyyy',
8449
+ ),
8450
+ ),
8451
+ 'mask-output' => array(),
8452
+ 'max' => array(),
8453
+ 'maxlength' => array(),
8454
+ 'min' => array(),
8455
+ 'minlength' => array(),
8456
+ 'multiple' => array(),
8457
+ 'name' => array(
8458
+ 'blacklisted_value_regex' => '(^|\\s)(__amp_\\S*|__count__|__defineGetter__|__defineSetter__|__lookupGetter__|__lookupSetter__|__noSuchMethod__|__parent__|__proto__|__AMP_\\S*|\\$p|\\$proxy|acceptCharset|addEventListener|appendChild|assignedSlot|attachShadow|baseURI|checkValidity|childElementCount|childNodes|classList|className|clientHeight|clientLeft|clientTop|clientWidth|compareDocumentPosition|computedName|computedRole|contentEditable|createShadowRoot|enqueAction|firstChild|firstElementChild|getAnimations|getAttribute|getAttributeNS|getAttributeNode|getAttributeNodeNS|getBoundingClientRect|getClientRects|getDestinationInsertionPoints|getElementsByClassName|getElementsByTagName|getElementsByTagNameNS|getRootNode|hasAttribute|hasAttributeNS|hasAttributes|hasChildNodes|hasPointerCapture|innerHTML|innerText|inputMode|insertAdjacentElement|insertAdjacentHTML|insertAdjacentText|isContentEditable|isDefaultNamespace|isEqualNode|isSameNode|lastChild|lastElementChild|lookupNamespaceURI|namespaceURI|nextElementSibling|nextSibling|nodeName|nodeType|nodeValue|offsetHeight|offsetLeft|offsetParent|offsetTop|offsetWidth|outerHTML|outerText|ownerDocument|parentElement|parentNode|previousElementSibling|previousSibling|querySelector|querySelectorAll|releasePointerCapture|removeAttribute|removeAttributeNS|removeAttributeNode|removeChild|removeEventListener|replaceChild|reportValidity|requestPointerLock|scrollHeight|scrollIntoView|scrollIntoViewIfNeeded|scrollLeft|scrollWidth|setAttribute|setAttributeNS|setAttributeNode|setAttributeNodeNS|setPointerCapture|shadowRoot|styleMap|tabIndex|tagName|textContent|toString|valueOf|(webkit|ms|moz|o)dropzone|(webkit|moz|ms|o)MatchesSelector|(webkit|moz|ms|o)RequestFullScreen|(webkit|moz|ms|o)RequestFullscreen)(\\s|$)',
8459
+ ),
8460
+ 'pattern' => array(),
8461
+ 'placeholder' => array(),
8462
+ 'readonly' => array(),
8463
+ 'required' => array(),
8464
+ 'selectiondirection' => array(),
8465
+ 'size' => array(),
8466
+ 'spellcheck' => array(),
8467
+ 'step' => array(),
8468
+ 'tabindex' => array(),
8469
+ 'type' => array(
8470
+ 'value' => array(
8471
+ 'text',
8472
+ 'tel',
8473
+ 'search',
8474
+ ),
8475
  ),
8476
  'value' => array(),
8477
  'width' => array(),
8478
  ),
8479
  'tag_spec' => array(
8480
+ 'requires_extension' => array(
8481
+ 'amp-inputmask',
8482
+ ),
8483
+ 'spec_name' => 'input [mask=date-dd-mm-yyyy]',
8484
+ 'spec_url' => 'https://www.ampproject.org/docs/reference/components/amp-inputmask',
8485
  ),
8486
  ),
8487
  array(
8506
  '[size]' => array(),
8507
  '[spellcheck]' => array(),
8508
  '[step]' => array(),
8509
+ '[type]' => array(),
8510
  '[value]' => array(),
8511
  '[width]' => array(),
8512
  'accept' => array(),
8518
  'height' => array(),
8519
  'inputmode' => array(),
8520
  'list' => array(),
8521
+ 'mask' => array(
8522
+ 'dispatch_key' => 2,
8523
+ 'mandatory' => true,
8524
+ 'value' => array(
8525
+ 'date-mm-dd-yyyy',
8526
+ ),
8527
+ ),
8528
+ 'mask-output' => array(),
8529
  'max' => array(),
8530
  'maxlength' => array(),
8531
  'min' => array(),
8534
  'name' => array(
8535
  'blacklisted_value_regex' => '(^|\\s)(__amp_\\S*|__count__|__defineGetter__|__defineSetter__|__lookupGetter__|__lookupSetter__|__noSuchMethod__|__parent__|__proto__|__AMP_\\S*|\\$p|\\$proxy|acceptCharset|addEventListener|appendChild|assignedSlot|attachShadow|baseURI|checkValidity|childElementCount|childNodes|classList|className|clientHeight|clientLeft|clientTop|clientWidth|compareDocumentPosition|computedName|computedRole|contentEditable|createShadowRoot|enqueAction|firstChild|firstElementChild|getAnimations|getAttribute|getAttributeNS|getAttributeNode|getAttributeNodeNS|getBoundingClientRect|getClientRects|getDestinationInsertionPoints|getElementsByClassName|getElementsByTagName|getElementsByTagNameNS|getRootNode|hasAttribute|hasAttributeNS|hasAttributes|hasChildNodes|hasPointerCapture|innerHTML|innerText|inputMode|insertAdjacentElement|insertAdjacentHTML|insertAdjacentText|isContentEditable|isDefaultNamespace|isEqualNode|isSameNode|lastChild|lastElementChild|lookupNamespaceURI|namespaceURI|nextElementSibling|nextSibling|nodeName|nodeType|nodeValue|offsetHeight|offsetLeft|offsetParent|offsetTop|offsetWidth|outerHTML|outerText|ownerDocument|parentElement|parentNode|previousElementSibling|previousSibling|querySelector|querySelectorAll|releasePointerCapture|removeAttribute|removeAttributeNS|removeAttributeNode|removeChild|removeEventListener|replaceChild|reportValidity|requestPointerLock|scrollHeight|scrollIntoView|scrollIntoViewIfNeeded|scrollLeft|scrollWidth|setAttribute|setAttributeNS|setAttributeNode|setAttributeNodeNS|setPointerCapture|shadowRoot|styleMap|tabIndex|tagName|textContent|toString|valueOf|(webkit|ms|moz|o)dropzone|(webkit|moz|ms|o)MatchesSelector|(webkit|moz|ms|o)RequestFullScreen|(webkit|moz|ms|o)RequestFullscreen)(\\s|$)',
8536
  ),
 
 
 
 
 
8537
  'pattern' => array(),
8538
  'placeholder' => array(),
8539
  'readonly' => array(),
8544
  'step' => array(),
8545
  'tabindex' => array(),
8546
  'type' => array(
8547
+ 'value' => array(
8548
+ 'text',
8549
+ 'tel',
8550
+ 'search',
8551
  ),
8552
  ),
8553
  'value' => array(),
8554
  'width' => array(),
8555
  ),
8556
  'tag_spec' => array(
8557
+ 'requires_extension' => array(
8558
+ 'amp-inputmask',
8559
+ ),
8560
+ 'spec_name' => 'input [mask=date-mm-dd-yyyy]',
8561
+ 'spec_url' => 'https://www.ampproject.org/docs/reference/components/amp-inputmask',
8562
  ),
8563
  ),
8564
  array(
8583
  '[size]' => array(),
8584
  '[spellcheck]' => array(),
8585
  '[step]' => array(),
8586
+ '[type]' => array(),
8587
  '[value]' => array(),
8588
  '[width]' => array(),
8589
  'accept' => array(),
8595
  'height' => array(),
8596
  'inputmode' => array(),
8597
  'list' => array(),
8598
+ 'mask' => array(
8599
+ 'dispatch_key' => 2,
8600
+ 'mandatory' => true,
8601
+ 'value' => array(
8602
+ 'date-mm-yy',
8603
+ ),
8604
+ ),
8605
+ 'mask-output' => array(),
8606
  'max' => array(),
8607
  'maxlength' => array(),
8608
  'min' => array(),
8621
  'step' => array(),
8622
  'tabindex' => array(),
8623
  'type' => array(
8624
+ 'value' => array(
8625
+ 'text',
8626
+ 'tel',
8627
+ 'search',
8628
  ),
8629
  ),
8630
  'value' => array(),
8631
  'width' => array(),
8632
  ),
8633
  'tag_spec' => array(
8634
+ 'requires_extension' => array(
8635
+ 'amp-inputmask',
8636
+ ),
8637
+ 'spec_name' => 'input [mask=date-mm-yy]',
8638
+ 'spec_url' => 'https://www.ampproject.org/docs/reference/components/amp-inputmask',
8639
  ),
8640
  ),
8641
  array(
8673
  'inputmode' => array(),
8674
  'list' => array(),
8675
  'mask' => array(
8676
+ 'dispatch_key' => 2,
8677
  'mandatory' => true,
8678
+ 'value' => array(
8679
+ 'date-yyyy-mm-dd',
8680
+ ),
8681
  ),
8682
  'mask-output' => array(),
8683
  'max' => array(),
8711
  'requires_extension' => array(
8712
  'amp-inputmask',
8713
  ),
8714
+ 'spec_name' => 'input [mask=date-yyyy-mm-dd]',
8715
  'spec_url' => 'https://www.ampproject.org/docs/reference/components/amp-inputmask',
8716
  ),
8717
  ),
8827
  'stroke-opacity' => array(),
8828
  'stroke-width' => array(),
8829
  'style' => array(
8830
+ 'blacklisted_value_regex' => '!\\s*important',
8831
  ),
8832
  'systemlanguage' => array(),
8833
  'text-anchor' => array(),
8915
  'stroke-opacity' => array(),
8916
  'stroke-width' => array(),
8917
  'style' => array(
8918
+ 'blacklisted_value_regex' => '!\\s*important',
8919
  ),
8920
  'text-anchor' => array(),
8921
  'text-decoration' => array(),
9291
  'stroke-opacity' => array(),
9292
  'stroke-width' => array(),
9293
  'style' => array(
9294
+ 'blacklisted_value_regex' => '!\\s*important',
9295
  ),
9296
  'text-anchor' => array(),
9297
  'text-decoration' => array(),
9377
  'stroke-opacity' => array(),
9378
  'stroke-width' => array(),
9379
  'style' => array(
9380
+ 'blacklisted_value_regex' => '!\\s*important',
9381
  ),
9382
  'systemlanguage' => array(),
9383
  'text-anchor' => array(),
9544
  'spec_url' => 'https://www.ampproject.org/docs/reference/components/amp-ad',
9545
  ),
9546
  ),
9547
+ array(
9548
+ 'attr_spec_list' => array(
9549
+ 'content' => array(
9550
+ 'mandatory' => true,
9551
+ ),
9552
+ 'name' => array(
9553
+ 'dispatch_key' => 2,
9554
+ 'mandatory' => true,
9555
+ 'value_casei' => array(
9556
+ 'amp-consent-blocking',
9557
+ ),
9558
+ ),
9559
+ ),
9560
+ 'tag_spec' => array(
9561
+ 'mandatory_parent' => 'head',
9562
+ 'spec_name' => 'meta name=amp-consent-blocking',
9563
+ 'unique' => true,
9564
+ ),
9565
+ ),
9566
  array(
9567
  'attr_spec_list' => array(
9568
  'content' => array(
9632
  'spec_name' => 'meta name=amp-ad-doubleclick-sra',
9633
  ),
9634
  ),
9635
+ array(
9636
+ 'attr_spec_list' => array(
9637
+ 'content' => array(
9638
+ 'mandatory' => true,
9639
+ ),
9640
+ 'name' => array(
9641
+ 'dispatch_key' => 2,
9642
+ 'mandatory' => true,
9643
+ 'value_casei' => array(
9644
+ 'amp-list-load-more',
9645
+ ),
9646
+ ),
9647
+ ),
9648
+ 'tag_spec' => array(
9649
+ 'mandatory_parent' => 'head',
9650
+ 'spec_name' => 'meta name=amp-list-load-more',
9651
+ ),
9652
+ ),
9653
+ array(
9654
+ 'attr_spec_list' => array(
9655
+ 'content' => array(
9656
+ 'mandatory' => true,
9657
+ ),
9658
+ 'name' => array(
9659
+ 'dispatch_key' => 2,
9660
+ 'mandatory' => true,
9661
+ 'value_casei' => array(
9662
+ 'amp-recaptcha-input',
9663
+ ),
9664
+ ),
9665
+ ),
9666
+ 'tag_spec' => array(
9667
+ 'mandatory_parent' => 'head',
9668
+ 'spec_name' => 'meta name=amp-recaptcha-input',
9669
+ ),
9670
+ ),
9671
  array(
9672
  'attr_spec_list' => array(
9673
  'content' => array(),
9908
  array(
9909
  'attr_spec_list' => array(
9910
  'style' => array(
9911
+ 'blacklisted_value_regex' => '!\\s*important',
9912
  ),
9913
  'xml:lang' => array(),
9914
  'xml:space' => array(),
9956
  ),
9957
  ),
9958
  'tag_spec' => array(
9959
+ 'child_tags' => array(
9960
+ 'child_tag_name_oneof' => array(
9961
+ 'ol',
9962
+ 'ul',
9963
+ ),
9964
+ 'mandatory_num_child_tags' => 1,
9965
+ ),
9966
  'mandatory_parent' => 'amp-sidebar',
9967
  'spec_name' => 'amp-sidebar > nav',
9968
  ),
10139
  'stroke-opacity' => array(),
10140
  'stroke-width' => array(),
10141
  'style' => array(
10142
+ 'blacklisted_value_regex' => '!\\s*important',
10143
  ),
10144
  'systemlanguage' => array(),
10145
  'text-anchor' => array(),
10227
  'stroke-opacity' => array(),
10228
  'stroke-width' => array(),
10229
  'style' => array(
10230
+ 'blacklisted_value_regex' => '!\\s*important',
10231
  ),
10232
  'systemlanguage' => array(),
10233
  'text-anchor' => array(),
10342
  'stroke-opacity' => array(),
10343
  'stroke-width' => array(),
10344
  'style' => array(
10345
+ 'blacklisted_value_regex' => '!\\s*important',
10346
  ),
10347
  'systemlanguage' => array(),
10348
  'text-anchor' => array(),
10427
  'stroke-opacity' => array(),
10428
  'stroke-width' => array(),
10429
  'style' => array(
10430
+ 'blacklisted_value_regex' => '!\\s*important',
10431
  ),
10432
  'systemlanguage' => array(),
10433
  'text-anchor' => array(),
10549
  'stroke-opacity' => array(),
10550
  'stroke-width' => array(),
10551
  'style' => array(
10552
+ 'blacklisted_value_regex' => '!\\s*important',
10553
  ),
10554
  'text-anchor' => array(),
10555
  'text-decoration' => array(),
10658
  'stroke-opacity' => array(),
10659
  'stroke-width' => array(),
10660
  'style' => array(
10661
+ 'blacklisted_value_regex' => '!\\s*important',
10662
  ),
10663
  'systemlanguage' => array(),
10664
  'text-anchor' => array(),
10908
  ),
10909
  ),
10910
  ),
10911
+ array(
10912
+ 'attr_spec_list' => array(
10913
+ 'async' => array(
10914
+ 'mandatory' => true,
10915
+ 'value' => array(
10916
+ '',
10917
+ ),
10918
+ ),
10919
+ 'nonce' => array(),
10920
+ 'type' => array(
10921
+ 'value_casei' => array(
10922
+ 'text/javascript',
10923
+ ),
10924
+ ),
10925
+ ),
10926
+ 'tag_spec' => array(
10927
+ 'extension_spec' => array(
10928
+ 'name' => 'amp-access-poool',
10929
+ 'requires_usage' => 3,
10930
+ 'version' => array(
10931
+ '0.1',
10932
+ 'latest',
10933
+ ),
10934
+ ),
10935
+ 'requires_extension' => array(
10936
+ 'amp-access',
10937
+ ),
10938
+ ),
10939
+ ),
10940
  array(
10941
  'attr_spec_list' => array(
10942
  'async' => array(
11052
  ),
11053
  ),
11054
  ),
11055
+ array(
11056
+ 'attr_spec_list' => array(
11057
+ 'async' => array(
11058
+ 'mandatory' => true,
11059
+ 'value' => array(
11060
+ '',
11061
+ ),
11062
+ ),
11063
+ 'nonce' => array(),
11064
+ 'type' => array(
11065
+ 'value_casei' => array(
11066
+ 'text/javascript',
11067
+ ),
11068
+ ),
11069
+ ),
11070
+ 'tag_spec' => array(
11071
+ 'extension_spec' => array(
11072
+ 'name' => 'amp-action-macro',
11073
+ 'version' => array(
11074
+ '0.1',
11075
+ 'latest',
11076
+ ),
11077
+ ),
11078
+ ),
11079
+ ),
11080
  array(
11081
  'attr_spec_list' => array(
11082
  'async' => array(
11365
  ),
11366
  ),
11367
  ),
11368
+ array(
11369
+ 'attr_spec_list' => array(
11370
+ 'async' => array(
11371
+ 'mandatory' => true,
11372
+ 'value' => array(
11373
+ '',
11374
+ ),
11375
+ ),
11376
+ 'nonce' => array(),
11377
+ 'type' => array(
11378
+ 'value_casei' => array(
11379
+ 'text/javascript',
11380
+ ),
11381
+ ),
11382
+ ),
11383
+ 'tag_spec' => array(
11384
+ 'extension_spec' => array(
11385
+ 'name' => 'amp-base-carousel',
11386
+ 'version' => array(
11387
+ '0.1',
11388
+ 'latest',
11389
+ ),
11390
+ ),
11391
+ ),
11392
+ ),
11393
  array(
11394
  'attr_spec_list' => array(
11395
  'async' => array(
11729
  ),
11730
  ),
11731
  ),
11732
+ array(
11733
+ 'attr_spec_list' => array(
11734
+ 'async' => array(
11735
+ 'mandatory' => true,
11736
+ 'value' => array(
11737
+ '',
11738
+ ),
11739
+ ),
11740
+ 'nonce' => array(),
11741
+ 'type' => array(
11742
+ 'value_casei' => array(
11743
+ 'text/javascript',
11744
+ ),
11745
+ ),
11746
+ ),
11747
+ 'tag_spec' => array(
11748
+ 'extension_spec' => array(
11749
+ 'name' => 'amp-date-display',
11750
+ 'version' => array(
11751
+ '0.1',
11752
+ 'latest',
11753
+ ),
11754
+ ),
11755
+ ),
11756
+ ),
11757
  array(
11758
  'attr_spec_list' => array(
11759
  'async' => array(
12774
  ),
12775
  ),
12776
  ),
12777
+ array(
12778
+ 'attr_spec_list' => array(
12779
+ 'nonce' => array(),
12780
+ 'template' => array(
12781
+ 'dispatch_key' => 2,
12782
+ 'mandatory' => true,
12783
+ 'value' => array(
12784
+ 'amp-mustache',
12785
+ ),
12786
+ ),
12787
+ 'type' => array(
12788
+ 'mandatory' => true,
12789
+ 'value_casei' => array(
12790
+ 'text/plain',
12791
+ ),
12792
+ ),
12793
+ ),
12794
+ 'cdata' => array(
12795
+ 'blacklisted_cdata_regex' => array(
12796
+ 'error_message' => 'html comments',
12797
+ 'regex' => '<!--',
12798
+ ),
12799
+ ),
12800
+ 'tag_spec' => array(
12801
+ 'disallowed_ancestor' => array(
12802
+ 'template',
12803
+ 'amp-date-picker',
12804
+ 'form div [submit-success][template]',
12805
+ 'form div [submit-error][template]',
12806
+ 'form div [submitting][template]',
12807
+ 'form div [verify-error][template]',
12808
+ ),
12809
+ 'requires_extension' => array(
12810
+ 'amp-mustache',
12811
+ ),
12812
+ 'spec_name' => 'SCRIPT type=text/plain',
12813
+ ),
12814
+ ),
12815
  array(
12816
  'attr_spec_list' => array(
12817
  'async' => array(
13112
  ),
13113
  ),
13114
  ),
13115
+ array(
13116
+ 'attr_spec_list' => array(
13117
+ 'async' => array(
13118
+ 'mandatory' => true,
13119
+ 'value' => array(
13120
+ '',
13121
+ ),
13122
+ ),
13123
+ 'nonce' => array(),
13124
+ 'type' => array(
13125
+ 'value_casei' => array(
13126
+ 'text/javascript',
13127
+ ),
13128
+ ),
13129
+ ),
13130
+ 'tag_spec' => array(
13131
+ 'extension_spec' => array(
13132
+ 'name' => 'amp-recaptcha-input',
13133
+ 'version' => array(
13134
+ '0.1',
13135
+ 'latest',
13136
+ ),
13137
+ ),
13138
+ ),
13139
+ ),
13140
  array(
13141
  'attr_spec_list' => array(
13142
  'async' => array(
13188
  ),
13189
  ),
13190
  ),
13191
+ array(
13192
+ 'attr_spec_list' => array(
13193
+ 'async' => array(
13194
+ 'mandatory' => true,
13195
+ 'value' => array(
13196
+ '',
13197
+ ),
13198
+ ),
13199
+ 'nonce' => array(),
13200
+ 'type' => array(
13201
+ 'value_casei' => array(
13202
+ 'text/javascript',
13203
+ ),
13204
+ ),
13205
+ ),
13206
+ 'tag_spec' => array(
13207
+ 'extension_spec' => array(
13208
+ 'name' => 'amp-script',
13209
+ 'version' => array(
13210
+ '0.1',
13211
+ 'latest',
13212
+ ),
13213
+ ),
13214
+ ),
13215
+ ),
13216
  array(
13217
  'attr_spec_list' => array(
13218
  'async' => array(
13291
  ),
13292
  ),
13293
  ),
13294
+ array(
13295
+ 'attr_spec_list' => array(
13296
+ 'async' => array(
13297
+ 'mandatory' => true,
13298
+ 'value' => array(
13299
+ '',
13300
+ ),
13301
+ ),
13302
+ 'nonce' => array(),
13303
+ 'type' => array(
13304
+ 'value_casei' => array(
13305
+ 'text/javascript',
13306
+ ),
13307
+ ),
13308
+ ),
13309
+ 'tag_spec' => array(
13310
+ 'extension_spec' => array(
13311
+ 'name' => 'amp-smartlinks',
13312
+ 'version' => array(
13313
+ '0.1',
13314
+ 'latest',
13315
+ ),
13316
+ ),
13317
+ ),
13318
+ ),
13319
  array(
13320
  'attr_spec_list' => array(
13321
  'async' => array(
13495
  ),
13496
  'tag_spec' => array(
13497
  'extension_spec' => array(
13498
+ 'deprecated_version' => array(
13499
+ '0.1',
13500
+ ),
13501
  'name' => 'amp-story',
13502
  'version' => array(
13503
  '0.1',
13719
  ),
13720
  ),
13721
  ),
13722
+ array(
13723
+ 'attr_spec_list' => array(
13724
+ 'async' => array(
13725
+ 'mandatory' => true,
13726
+ 'value' => array(
13727
+ '',
13728
+ ),
13729
+ ),
13730
+ 'nonce' => array(),
13731
+ 'type' => array(
13732
+ 'value_casei' => array(
13733
+ 'text/javascript',
13734
+ ),
13735
+ ),
13736
+ ),
13737
+ 'tag_spec' => array(
13738
+ 'extension_spec' => array(
13739
+ 'name' => 'amp-video-docking',
13740
+ 'version' => array(
13741
+ '0.1',
13742
+ 'latest',
13743
+ ),
13744
+ ),
13745
+ 'spec_name' => 'amp-video-docking',
13746
+ ),
13747
+ ),
13748
+ array(
13749
+ 'attr_spec_list' => array(
13750
+ 'async' => array(
13751
+ 'mandatory' => true,
13752
+ 'value' => array(
13753
+ '',
13754
+ ),
13755
+ ),
13756
+ 'nonce' => array(),
13757
+ 'type' => array(
13758
+ 'value_casei' => array(
13759
+ 'text/javascript',
13760
+ ),
13761
+ ),
13762
+ ),
13763
+ 'tag_spec' => array(
13764
+ 'extension_spec' => array(
13765
+ 'name' => 'amp-video-iframe',
13766
+ 'version' => array(
13767
+ '0.1',
13768
+ 'latest',
13769
+ ),
13770
+ ),
13771
+ ),
13772
+ ),
13773
  array(
13774
  'attr_spec_list' => array(
13775
  'async' => array(
14023
  ),
14024
  ),
14025
  'tag_spec' => array(
14026
+ 'child_tags' => array(
14027
+ 'first_child_tag_name_oneof' => array(
14028
+ 'h1',
14029
+ 'h2',
14030
+ 'h3',
14031
+ 'h4',
14032
+ 'h5',
14033
+ 'h6',
14034
+ 'header',
14035
+ ),
14036
+ 'mandatory_num_child_tags' => 2,
14037
+ ),
14038
  'mandatory_parent' => 'amp-accordion',
14039
  'spec_name' => 'amp-accordion > section',
14040
  ),
14070
  'slot' => array(
14071
  array(
14072
  'attr_spec_list' => array(
14073
+ 'name' => array(
14074
+ 'blacklisted_value_regex' => '(^|\\s)(__amp_\\S*|__count__|__defineGetter__|__defineSetter__|__lookupGetter__|__lookupSetter__|__noSuchMethod__|__parent__|__proto__|__AMP_\\S*|\\$p|\\$proxy|acceptCharset|addEventListener|appendChild|assignedSlot|attachShadow|baseURI|checkValidity|childElementCount|childNodes|classList|className|clientHeight|clientLeft|clientTop|clientWidth|compareDocumentPosition|computedName|computedRole|contentEditable|createShadowRoot|enqueAction|firstChild|firstElementChild|getAnimations|getAttribute|getAttributeNS|getAttributeNode|getAttributeNodeNS|getBoundingClientRect|getClientRects|getDestinationInsertionPoints|getElementsByClassName|getElementsByTagName|getElementsByTagNameNS|getRootNode|hasAttribute|hasAttributeNS|hasAttributes|hasChildNodes|hasPointerCapture|innerHTML|innerText|inputMode|insertAdjacentElement|insertAdjacentHTML|insertAdjacentText|isContentEditable|isDefaultNamespace|isEqualNode|isSameNode|lastChild|lastElementChild|lookupNamespaceURI|namespaceURI|nextElementSibling|nextSibling|nodeName|nodeType|nodeValue|offsetHeight|offsetLeft|offsetParent|offsetTop|offsetWidth|outerHTML|outerText|ownerDocument|parentElement|parentNode|previousElementSibling|previousSibling|querySelector|querySelectorAll|releasePointerCapture|removeAttribute|removeAttributeNS|removeAttributeNode|removeChild|removeEventListener|replaceChild|reportValidity|requestPointerLock|scrollHeight|scrollIntoView|scrollIntoViewIfNeeded|scrollLeft|scrollWidth|setAttribute|setAttributeNS|setAttributeNode|setAttributeNodeNS|setPointerCapture|shadowRoot|styleMap|tabIndex|tagName|textContent|toString|valueOf|(webkit|ms|moz|o)dropzone|(webkit|moz|ms|o)MatchesSelector|(webkit|moz|ms|o)RequestFullScreen|(webkit|moz|ms|o)RequestFullscreen)(\\s|$)',
14075
+ ),
14076
  ),
14077
  'tag_spec' => array(),
14078
  ),
14142
  'stroke-opacity' => array(),
14143
  'stroke-width' => array(),
14144
  'style' => array(
14145
+ 'blacklisted_value_regex' => '!\\s*important',
14146
  ),
14147
  'text-anchor' => array(),
14148
  'text-decoration' => array(),
14321
  'stop-color' => array(),
14322
  'stop-opacity' => array(),
14323
  'style' => array(
14324
+ 'blacklisted_value_regex' => '!\\s*important',
14325
  ),
14326
  ),
14327
  'tag_spec' => array(
14336
  'stop-color' => array(),
14337
  'stop-opacity' => array(),
14338
  'style' => array(
14339
+ 'blacklisted_value_regex' => '!\\s*important',
14340
  ),
14341
  ),
14342
  'tag_spec' => array(
14377
  'cdata' => array(
14378
  'blacklisted_cdata_regex' => array(
14379
  'error_message' => 'CSS !important',
14380
+ 'regex' => '!\\s*important',
14381
  ),
14382
  'css_spec' => array(
14383
  'allowed_at_rules' => array(
14417
  'unique' => true,
14418
  ),
14419
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14420
  array(
14421
  'attr_spec_list' => array(
14422
  'amp-boilerplate' => array(
14432
  'cdata_regex' => '\\s*body\\s*{\\s*-webkit-animation:\\s*-amp-start\\s+8s\\s+steps\\(1,\\s*end\\)\\s+0s\\s+1\\s+normal\\s+both;\\s*-moz-animation:\\s*-amp-start\\s+8s\\s+steps\\s*\\(1\\s*,\\s*end\\s*\\)\\s+0s\\s+1\\s+normal\\s+both;\\s*-ms-animation:\\s*-amp-start\\s+8s\\s+steps\\s*\\(1\\s*,\\s*end\\s*\\)\\s+0s\\s+1\\s+normal\\s+both;\\s*animation:\\s*-amp-start\\s+8s\\s+steps\\(1,\\s*end\\)\\s+0s\\s+1\\s+normal\\s+both;?\\s*}\\s*@-webkit-keyframes\\s+-amp-start\\s*{\\s*from\\s*{\\s*visibility:\\s*hidden;?\\s*}\\s*to\\s*{\\s*visibility:\\s*visible;?\\s*}\\s*}\\s*@-moz-keyframes\\s+-amp-start\\s*{\\s*from\\s*{\\s*visibility:\\s*hidden;?\\s*}\\s*to\\s*{\\s*visibility:\\s*visible;?\\s*}\\s*}\\s*@-ms-keyframes\\s+-amp-start\\s*{\\s*from\\s*{\\s*visibility:\\s*hidden;?\\s*}\\s*to\\s*{\\s*visibility:\\s*visible;?\\s*}\\s*}\\s*@-o-keyframes\\s+-amp-start\\s*{\\s*from\\s*{\\s*visibility:\\s*hidden;?\\s*}\\s*to\\s*{\\s*visibility:\\s*visible;?\\s*}\\s*}\\s*@keyframes\\s+-amp-start\\s*{\\s*from\\s*{\\s*visibility:\\s*hidden;?\\s*}\\s*to\\s*{\\s*visibility:\\s*visible;?\\s*}\\s*}\\s*',
14433
  ),
14434
  'tag_spec' => array(
14435
+ 'mandatory' => true,
14436
  'mandatory_parent' => 'head',
14437
  'spec_name' => 'head > style[amp-boilerplate]',
14438
  'spec_url' => 'https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md',
14454
  'cdata_regex' => '\\s*body\\s*{\\s*-webkit-animation:\\s*none;\\s*-moz-animation:\\s*none;\\s*-ms-animation:\\s*none;\\s*animation:\\s*none;?\\s*}\\s*',
14455
  ),
14456
  'tag_spec' => array(
14457
+ 'mandatory' => true,
14458
  'mandatory_ancestor' => 'head',
14459
  'mandatory_parent' => 'noscript',
14460
  'spec_name' => 'noscript > style[amp-boilerplate]',
14506
  'tag_spec' => array(),
14507
  ),
14508
  ),
14509
+ 'summary' => array(
14510
+ array(
14511
+ 'attr_spec_list' => array(),
14512
+ 'tag_spec' => array(
14513
+ 'mandatory_parent' => 'details',
14514
+ ),
14515
+ ),
14516
+ ),
14517
  'sup' => array(
14518
  array(
14519
  'attr_spec_list' => array(),
14584
  'stroke-opacity' => array(),
14585
  'stroke-width' => array(),
14586
  'style' => array(
14587
+ 'blacklisted_value_regex' => '!\\s*important',
14588
  ),
14589
  'systemlanguage' => array(),
14590
  'text-anchor' => array(),
14675
  'stroke-opacity' => array(),
14676
  'stroke-width' => array(),
14677
  'style' => array(
14678
+ 'blacklisted_value_regex' => '!\\s*important',
14679
  ),
14680
  'systemlanguage' => array(),
14681
  'text-anchor' => array(),
14756
  'stroke-opacity' => array(),
14757
  'stroke-width' => array(),
14758
  'style' => array(
14759
+ 'blacklisted_value_regex' => '!\\s*important',
14760
  ),
14761
  'text-anchor' => array(),
14762
  'text-decoration' => array(),
14885
  'form div [submitting][template]',
14886
  'form div [verify-error][template]',
14887
  ),
14888
+ 'mandatory_ancestor' => 'body',
14889
  'requires_extension' => array(
14890
  'amp-mustache',
14891
  ),
14902
  ),
14903
  ),
14904
  'tag_spec' => array(
14905
+ 'descendant_tag_list' => 'amp-story-grid-layer-allowed-descendants',
14906
  'mandatory_parent' => 'amp-story-auto-ads',
14907
  'reference_points' => array(
14908
  'AMP-STORY-GRID-LAYER animate-in' => array(
14985
  'stroke-opacity' => array(),
14986
  'stroke-width' => array(),
14987
  'style' => array(
14988
+ 'blacklisted_value_regex' => '!\\s*important',
14989
  ),
14990
  'systemlanguage' => array(),
14991
  'text-anchor' => array(),
15020
  '[disabled]' => array(),
15021
  '[maxlength]' => array(),
15022
  '[minlength]' => array(),
15023
+ '[pattern]' => array(),
15024
  '[placeholder]' => array(),
15025
  '[readonly]' => array(),
15026
  '[required]' => array(),
15031
  '[spellcheck]' => array(),
15032
  '[wrap]' => array(),
15033
  'autocomplete' => array(),
15034
+ 'autoexpand' => array(
15035
+ 'requires_extension' => array(
15036
+ 'amp-form',
15037
+ ),
15038
+ ),
15039
  'autofocus' => array(),
15040
  'cols' => array(),
15041
  'disabled' => array(),
15049
  '',
15050
  ),
15051
  ),
15052
+ 'pattern' => array(),
15053
  'placeholder' => array(),
15054
  'readonly' => array(),
15055
  'required' => array(),
15128
  'stroke-opacity' => array(),
15129
  'stroke-width' => array(),
15130
  'style' => array(
15131
+ 'blacklisted_value_regex' => '!\\s*important',
15132
  ),
15133
  'systemlanguage' => array(),
15134
  'text-anchor' => array(),
15218
  array(
15219
  'attr_spec_list' => array(
15220
  'style' => array(
15221
+ 'blacklisted_value_regex' => '!\\s*important',
15222
  ),
15223
  'xml:lang' => array(),
15224
  'xml:space' => array(),
15520
  'spec_name' => 'amp-video > track[kind=subtitles]',
15521
  ),
15522
  ),
15523
+ array(
15524
+ 'attr_spec_list' => array(
15525
+ '[label]' => array(),
15526
+ '[src]' => array(),
15527
+ '[srclang]' => array(),
15528
+ 'default' => array(
15529
+ 'value' => array(
15530
+ '',
15531
+ ),
15532
+ ),
15533
+ 'kind' => array(
15534
+ 'value' => array(
15535
+ 'captions',
15536
+ 'chapters',
15537
+ 'descriptions',
15538
+ 'metadata',
15539
+ ),
15540
+ ),
15541
+ 'label' => array(),
15542
+ 'src' => array(
15543
+ 'blacklisted_value_regex' => '__amp_source_origin',
15544
+ 'mandatory' => true,
15545
+ 'value_url' => array(
15546
+ 'allow_relative' => false,
15547
+ 'protocol' => array(
15548
+ 'https',
15549
+ ),
15550
+ ),
15551
+ ),
15552
+ 'srclang' => array(),
15553
+ ),
15554
+ 'tag_spec' => array(
15555
+ 'mandatory_parent' => 'amp-ima-video',
15556
+ 'spec_name' => 'amp-ima-video > track',
15557
+ ),
15558
+ ),
15559
  array(
15560
  'attr_spec_list' => array(
15561
  '[label]' => array(),
15654
  'stroke-opacity' => array(),
15655
  'stroke-width' => array(),
15656
  'style' => array(
15657
+ 'blacklisted_value_regex' => '!\\s*important',
15658
  ),
15659
  'systemlanguage' => array(),
15660
  'text-anchor' => array(),
15758
  'stroke-opacity' => array(),
15759
  'stroke-width' => array(),
15760
  'style' => array(
15761
+ 'blacklisted_value_regex' => '!\\s*important',
15762
  ),
15763
  'systemlanguage' => array(),
15764
  'text-anchor' => array(),
15862
  'stroke-opacity' => array(),
15863
  'stroke-width' => array(),
15864
  'style' => array(
15865
+ 'blacklisted_value_regex' => '!\\s*important',
15866
  ),
15867
  'systemlanguage' => array(),
15868
  'text-anchor' => array(),
15948
  'externalresourcesrequired' => array(),
15949
  'preserveaspectratio' => array(),
15950
  'style' => array(
15951
+ 'blacklisted_value_regex' => '!\\s*important',
15952
  ),
15953
  'viewbox' => array(),
15954
  'viewtarget' => array(),
15971
  'g2' => array(),
15972
  'k' => array(),
15973
  'style' => array(
15974
+ 'blacklisted_value_regex' => '!\\s*important',
15975
  ),
15976
  'u1' => array(),
15977
  'u2' => array(),
16058
  'amp-access-style' => array(),
16059
  'amp-access-template' => array(),
16060
  'amp-fx' => array(
16061
+ 'requires_extension' => array(
16062
+ 'amp-fx-collection',
16063
+ ),
16064
+ 'value_regex_casei' => '(fade-in|fade-in-scroll|float-in-bottom|float-in-top|fly-in-bottom|fly-in-left|fly-in-right|fly-in-top|parallax)(\\s|fade-in|fade-in-scroll|float-in-bottom|float-in-top|fly-in-bottom|fly-in-left|fly-in-right|fly-in-top|parallax)*',
16065
  ),
16066
  'aria-activedescendant' => array(),
16067
  'aria-atomic' => array(),
16099
  'aria-valuemin' => array(),
16100
  'aria-valuenow' => array(),
16101
  'aria-valuetext' => array(),
16102
+ 'autoscroll' => array(),
16103
  'class' => array(
16104
  'blacklisted_value_regex' => '(^|\\W)i-amphtml-',
16105
  ),
16144
  'rev' => array(),
16145
  'role' => array(),
16146
  'style' => array(
16147
+ 'blacklisted_value_regex' => '(!\\s*important|<!--)',
16148
+ ),
16149
+ 'subscriptions-action' => array(
16150
+ 'requires_extension' => array(
16151
+ 'amp-subscriptions',
16152
+ ),
16153
  ),
 
16154
  'subscriptions-actions' => array(
16155
+ 'requires_extension' => array(
16156
+ 'amp-subscriptions',
16157
+ ),
16158
  'value' => array(
16159
  '',
16160
  ),
16161
  ),
16162
+ 'subscriptions-decorate' => array(
16163
+ 'requires_extension' => array(
16164
+ 'amp-subscriptions',
16165
+ ),
16166
+ ),
16167
  'subscriptions-dialog' => array(
16168
+ 'requires_extension' => array(
16169
+ 'amp-subscriptions',
16170
+ ),
16171
  'value' => array(
16172
  '',
16173
  ),
16174
  ),
16175
+ 'subscriptions-display' => array(
16176
+ 'requires_extension' => array(
16177
+ 'amp-subscriptions',
16178
+ ),
16179
+ ),
16180
  'subscriptions-section' => array(
16181
+ 'requires_extension' => array(
16182
+ 'amp-subscriptions',
16183
+ ),
16184
  'value_casei' => array(
16185
  'actions',
16186
  'content',
16188
  'loading',
16189
  ),
16190
  ),
16191
+ 'subscriptions-service' => array(
16192
+ 'requires_extension' => array(
16193
+ 'amp-subscriptions',
16194
+ ),
16195
+ ),
16196
  'tabindex' => array(),
16197
  'title' => array(),
16198
  'translate' => array(),
16216
 
16217
 
16218
  private static $reference_points = array(
16219
+ 'AMP-BASE-CAROUSEL lightbox [child]' => array(
16220
+ 'attr_spec_list' => array(
16221
+ 'lightbox-thumbnail-id' => array(
16222
+ 'value_regex_casei' => '^[a-z][a-z\\d_-]*',
16223
+ ),
16224
+ ),
16225
+ 'tag_spec' => array(
16226
+ 'spec_name' => 'AMP-BASE-CAROUSEL lightbox [child]',
16227
+ ),
16228
+ ),
16229
+ 'AMP-BASE-CAROUSEL lightbox [lightbox-exclude]' => array(
16230
+ 'attr_spec_list' => array(
16231
+ 'lightbox-exclude' => array(
16232
+ 'mandatory' => true,
16233
+ ),
16234
+ ),
16235
+ 'tag_spec' => array(
16236
+ 'spec_name' => 'AMP-BASE-CAROUSEL lightbox [lightbox-exclude]',
16237
+ ),
16238
+ ),
16239
  'AMP-CAROUSEL lightbox [child]' => array(
16240
  'attr_spec_list' => array(
16241
  'lightbox-thumbnail-id' => array(
16281
  'data-tombstone' => array(),
16282
  'data-update-time' => array(),
16283
  'id' => array(
16284
+ 'blacklisted_value_regex' => '(^|\\s)(__amp_\\S*|__count__|__defineGetter__|__defineSetter__|__lookupGetter__|__lookupSetter__|__noSuchMethod__|__parent__|__proto__|__AMP_\\S*|\\$p|\\$proxy|acceptCharset|addEventListener|appendChild|assignedSlot|attachShadow|AMP|baseURI|checkValidity|childElementCount|childNodes|classList|className|clientHeight|clientLeft|clientTop|clientWidth|compareDocumentPosition|computedName|computedRole|contentEditable|createShadowRoot|enqueAction|firstChild|firstElementChild|getAnimations|getAttribute|getAttributeNS|getAttributeNode|getAttributeNodeNS|getBoundingClientRect|getClientRects|getDestinationInsertionPoints|getElementsByClassName|getElementsByTagName|getElementsByTagNameNS|getRootNode|hasAttribute|hasAttributeNS|hasAttributes|hasChildNodes|hasPointerCapture|i-amphtml-\\S*|innerHTML|innerText|inputMode|insertAdjacentElement|insertAdjacentHTML|insertAdjacentText|isContentEditable|isDefaultNamespace|isEqualNode|isSameNode|lastChild|lastElementChild|lookupNamespaceURI|namespaceURI|nextElementSibling|nextSibling|nodeName|nodeType|nodeValue|offsetHeight|offsetLeft|offsetParent|offsetTop|offsetWidth|outerHTML|outerText|ownerDocument|parentElement|parentNode|previousElementSibling|previousSibling|querySelector|querySelectorAll|releasePointerCapture|removeAttribute|removeAttributeNS|removeAttributeNode|removeChild|removeEventListener|replaceChild|reportValidity|requestPointerLock|scrollHeight|scrollIntoView|scrollIntoViewIfNeeded|scrollLeft|scrollWidth|setAttribute|setAttributeNS|setAttributeNode|setAttributeNodeNS|setPointerCapture|shadowRoot|styleMap|tabIndex|tagName|textContent|toString|valueOf|(webkit|ms|moz|o)dropzone|(webkit|moz|ms|o)MatchesSelector|(webkit|moz|ms|o)RequestFullScreen|(webkit|moz|ms|o)RequestFullscreen)(\\s|$)',
16285
  'mandatory' => true,
16286
  ),
16287
  ),
16387
  'animate-in-after' => array(),
16388
  'animate-in-delay' => array(),
16389
  'animate-in-duration' => array(),
16390
+ 'animate-in-timing-function' => array(),
16391
+ 'scale-end' => array(
16392
+ 'value_regex' => '[0-9]+([.][0-9]+)?',
16393
+ ),
16394
+ 'scale-start' => array(
16395
+ 'value_regex' => '[0-9]+([.][0-9]+)?',
16396
+ ),
16397
+ 'translate-x' => array(
16398
+ 'value_regex_casei' => '[0-9]+px',
16399
+ ),
16400
+ 'translate-y' => array(
16401
+ 'value_regex_casei' => '[0-9]+px',
16402
+ ),
16403
  ),
16404
  'tag_spec' => array(
16405
  'reference_points' => array(
16439
  'animate-in-after' => array(),
16440
  'animate-in-delay' => array(),
16441
  'animate-in-duration' => array(),
16442
+ 'animate-in-timing-function' => array(),
16443
  'data-tooltip-icon' => array(
16444
  'value_url' => array(
16445
  'protocol' => array(
16449
  ),
16450
  ),
16451
  ),
16452
+ 'interactive' => array(
16453
+ 'value' => array(
16454
+ '',
16455
+ ),
16456
+ ),
16457
+ 'scale-end' => array(
16458
+ 'value_regex' => '[0-9]+([.][0-9]+)?',
16459
+ ),
16460
+ 'scale-start' => array(
16461
+ 'value_regex' => '[0-9]+([.][0-9]+)?',
16462
+ ),
16463
  'target' => array(
16464
  'value' => array(
16465
  '_blank',
16466
  ),
16467
  ),
16468
+ 'translate-x' => array(
16469
+ 'value_regex_casei' => '[0-9]+px',
16470
+ ),
16471
+ 'translate-y' => array(
16472
+ 'value_regex_casei' => '[0-9]+px',
16473
+ ),
16474
  ),
16475
  'tag_spec' => array(
16476
  'reference_points' => array(
16537
  'animate-in-after' => array(),
16538
  'animate-in-delay' => array(),
16539
  'animate-in-duration' => array(),
16540
+ 'animate-in-timing-function' => array(),
16541
  'data-tooltip-icon' => array(
16542
  'value_url' => array(
16543
  'protocol' => array(
16548
  ),
16549
  ),
16550
  'grid-area' => array(),
16551
+ 'interactive' => array(
16552
+ 'value' => array(
16553
+ '',
16554
+ ),
16555
+ ),
16556
  'justify-content' => array(
16557
  'value' => array(
16558
  'center',
16580
  'stretch',
16581
  ),
16582
  ),
16583
+ 'scale-end' => array(
16584
+ 'value_regex' => '[0-9]+([.][0-9]+)?',
16585
+ ),
16586
+ 'scale-start' => array(
16587
+ 'value_regex' => '[0-9]+([.][0-9]+)?',
16588
+ ),
16589
  'target' => array(
16590
  'value' => array(
16591
  '_blank',
16592
  ),
16593
  ),
16594
+ 'translate-x' => array(
16595
+ 'value_regex_casei' => '[0-9]+px',
16596
+ ),
16597
+ 'translate-y' => array(
16598
+ 'value_regex_casei' => '[0-9]+px',
16599
+ ),
16600
  ),
16601
  'tag_spec' => array(
16602
  'reference_points' => array(
16609
  'spec_url' => 'https://www.ampproject.org/docs/reference/components/amp-story',
16610
  ),
16611
  ),
16612
+ 'AMP-VIDEO-IFRAME > [placeholder]' => array(
16613
+ 'attr_spec_list' => array(
16614
+ 'placeholder' => array(
16615
+ 'mandatory' => true,
16616
+ ),
16617
+ ),
16618
+ 'tag_spec' => array(
16619
+ 'spec_name' => 'AMP-VIDEO-IFRAME > [placeholder]',
16620
+ 'spec_url' => 'https://www.ampproject.org/docs/reference/components/amp-video-iframe',
16621
+ ),
16622
+ ),
16623
  );
16624
 
16625
 
16649
  return null;
16650
  }
16651
 
16652
+ /**
16653
+ * Get descendant tag lists.
16654
+ *
16655
+ * @since 1.1
16656
+ * @return array Descendant tags list.
16657
+ */
16658
+ public static function get_descendant_tag_lists() {
16659
+ return self::$descendant_tag_lists;
16660
+ }
16661
+
16662
+ /**
16663
+ * Get allowed descendant tag list for a tag.
16664
+ *
16665
+ * Get the descendant rules for a single tag so that the entire data structure needn't be passed around.
16666
+ *
16667
+ * @since 1.1
16668
+ * @param string $name Name for the descendants list.
16669
+ * @return array|bool Allowed tags list, or false if there are no restrictions.
16670
+ */
16671
+ public static function get_descendant_tag_list( $name ) {
16672
+ if ( isset( self::$descendant_tag_lists[ $name ] ) ) {
16673
+ return self::$descendant_tag_lists[ $name ];
16674
+ }
16675
+ return false;
16676
+ }
16677
+
16678
  /**
16679
  * Get reference point spec.
16680
  *
16710
  }
16711
 
16712
  }
16713
+
includes/sanitizers/class-amp-audio-sanitizer.php CHANGED
@@ -11,6 +11,7 @@
11
  * Converts <audio> tags to <amp-audio>
12
  */
13
  class AMP_Audio_Sanitizer extends AMP_Base_Sanitizer {
 
14
 
15
  /**
16
  * Tag.
@@ -20,6 +21,15 @@ class AMP_Audio_Sanitizer extends AMP_Base_Sanitizer {
20
  */
21
  public static $tag = 'audio';
22
 
 
 
 
 
 
 
 
 
 
23
  /**
24
  * Get mapping of HTML selectors to the AMP component selectors which they may be converted into.
25
  *
@@ -43,68 +53,108 @@ class AMP_Audio_Sanitizer extends AMP_Base_Sanitizer {
43
  return;
44
  }
45
 
 
 
 
 
46
  for ( $i = $num_nodes - 1; $i >= 0; $i-- ) {
47
- $node = $nodes->item( $i );
48
- $amp_data = $this->get_data_amp_attributes( $node );
49
- $old_attributes = AMP_DOM_Utils::get_node_attributes_as_assoc_array( $node );
50
- $old_attributes = $this->filter_data_amp_attributes( $old_attributes, $amp_data );
51
 
52
- $new_attributes = $this->filter_attributes( $old_attributes );
 
 
 
53
 
54
- $new_node = AMP_DOM_Utils::create_node( $this->dom, 'amp-audio', $new_attributes );
55
 
56
- foreach ( $node->childNodes as $child_node ) {
 
 
 
 
 
57
 
58
- /**
59
- * Child node.
60
- *
61
- * @todo: Fix when `source` has no closing tag as DOMDocument does not handle well.
62
- *
63
- * @var DOMNode $child_node
64
- */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
 
66
- $new_child_node = $child_node->cloneNode( true );
67
- if ( ! $new_child_node instanceof DOMElement ) {
68
- continue;
69
  }
70
 
71
- $old_child_attributes = AMP_DOM_Utils::get_node_attributes_as_assoc_array( $new_child_node );
72
- $new_child_attributes = $this->filter_attributes( $old_child_attributes );
73
 
74
- if ( empty( $new_child_attributes['src'] ) ) {
75
- continue;
76
- }
77
- if ( 'source' !== $new_child_node->tagName ) {
78
- continue;
79
- }
 
 
 
 
 
80
 
81
- // The textContent is invalid for `source` nodes.
82
- $new_child_node->textContent = null;
 
 
 
83
 
84
- // Only append source tags with a valid src attribute.
85
- $new_node->appendChild( $new_child_node );
 
 
 
 
 
 
86
 
 
 
 
 
 
87
  }
88
 
89
- /**
90
  * If the node has at least one valid source, replace the old node with it.
91
  * Otherwise, just remove the node.
92
  *
93
- * @todo: Add a fallback handler.
94
- * @see: https://github.com/ampproject/amphtml/issues/2261
95
  */
96
- if ( 0 === $new_node->childNodes->length && empty( $new_attributes['src'] ) ) {
97
  $this->remove_invalid_child( $node );
98
  } else {
 
99
 
100
- $layout = isset( $new_attributes['layout'] ) ? $new_attributes['layout'] : false;
101
-
102
- // The width has to be unset / auto in case of fixed-height.
103
- if ( 'fixed-height' === $layout ) {
104
- $new_node->setAttribute( 'width', 'auto' );
105
  }
106
-
107
- $node->parentNode->replaceChild( $new_node, $node );
108
  }
109
 
110
  $this->did_convert_elements = true;
@@ -163,7 +213,7 @@ class AMP_Audio_Sanitizer extends AMP_Base_Sanitizer {
163
  break;
164
 
165
  default:
166
- break;
167
  }
168
  }
169
 
11
  * Converts <audio> tags to <amp-audio>
12
  */
13
  class AMP_Audio_Sanitizer extends AMP_Base_Sanitizer {
14
+ use AMP_Noscript_Fallback;
15
 
16
  /**
17
  * Tag.
21
  */
22
  public static $tag = 'audio';
23
 
24
+ /**
25
+ * Default args.
26
+ *
27
+ * @var array
28
+ */
29
+ protected $DEFAULT_ARGS = array(
30
+ 'add_noscript_fallback' => true,
31
+ );
32
+
33
  /**
34
  * Get mapping of HTML selectors to the AMP component selectors which they may be converted into.
35
  *
53
  return;
54
  }
55
 
56
+ if ( $this->args['add_noscript_fallback'] ) {
57
+ $this->initialize_noscript_allowed_attributes( self::$tag );
58
+ }
59
+
60
  for ( $i = $num_nodes - 1; $i >= 0; $i-- ) {
61
+ $node = $nodes->item( $i );
 
 
 
62
 
63
+ // Skip element if already inside of an AMP element as a noscript fallback.
64
+ if ( $this->is_inside_amp_noscript( $node ) ) {
65
+ continue;
66
+ }
67
 
68
+ $old_attributes = AMP_DOM_Utils::get_node_attributes_as_assoc_array( $node );
69
 
70
+ // For amp-audio, the default width and height are inferred from browser.
71
+ $sources = array();
72
+ $new_attributes = $this->filter_attributes( $old_attributes );
73
+ if ( ! empty( $new_attributes['src'] ) ) {
74
+ $sources[] = $new_attributes['src'];
75
+ }
76
 
77
+ /**
78
+ * Original node.
79
+ *
80
+ * @var DOMElement $old_node
81
+ */
82
+ $old_node = $node->cloneNode( false );
83
+
84
+ // Gather all child nodes and supply empty video dimensions from sources.
85
+ $fallback = null;
86
+ $child_nodes = array();
87
+ while ( $node->firstChild ) {
88
+ $child_node = $node->removeChild( $node->firstChild );
89
+ if ( $child_node instanceof DOMElement && 'source' === $child_node->nodeName && $child_node->hasAttribute( 'src' ) ) {
90
+ $src = $this->maybe_enforce_https_src( $child_node->getAttribute( 'src' ), true );
91
+ if ( ! $src ) {
92
+ // @todo $this->remove_invalid_child( $child_node ), but this will require refactoring the while loop since it uses firstChild.
93
+ continue; // Skip adding source.
94
+ }
95
+ $sources[] = $src;
96
+ $child_node->setAttribute( 'src', $src );
97
+ $new_attributes = $this->filter_attributes( $new_attributes );
98
+ }
99
 
100
+ if ( ! $fallback && $child_node instanceof DOMElement && ! ( 'source' === $child_node->nodeName || 'track' === $child_node->nodeName ) ) {
101
+ $fallback = $child_node;
102
+ $fallback->setAttribute( 'fallback', '' );
103
  }
104
 
105
+ $child_nodes[] = $child_node;
106
+ }
107
 
108
+ /*
109
+ * Add fallback for audio shortcode which is not present by default since wp_mediaelement_fallback()
110
+ * is not called when wp_audio_shortcode_library is filtered from mediaelement to amp.
111
+ */
112
+ if ( ! $fallback && ! empty( $sources ) ) {
113
+ $fallback = $this->dom->createElement( 'a' );
114
+ $fallback->setAttribute( 'href', $sources[0] );
115
+ $fallback->setAttribute( 'fallback', '' );
116
+ $fallback->appendChild( $this->dom->createTextNode( $sources[0] ) );
117
+ $child_nodes[] = $fallback;
118
+ }
119
 
120
+ /*
121
+ * Audio in WordPress is responsive with 100% width, so this infers fixed-layout.
122
+ * In AMP, the amp-audio's default height is inferred from the browser.
123
+ */
124
+ $new_attributes['width'] = 'auto';
125
 
126
+ // @todo Make sure poster and artwork attributes are HTTPS.
127
+ $new_node = AMP_DOM_Utils::create_node( $this->dom, 'amp-audio', $new_attributes );
128
+ foreach ( $child_nodes as $child_node ) {
129
+ $new_node->appendChild( $child_node );
130
+ if ( ! ( $child_node instanceof DOMElement ) || ! $child_node->hasAttribute( 'fallback' ) ) {
131
+ $old_node->appendChild( $child_node->cloneNode( true ) );
132
+ }
133
+ }
134
 
135
+ // Make sure the updated src and poster are applied to the original.
136
+ foreach ( array( 'src', 'poster', 'artwork' ) as $attr_name ) {
137
+ if ( $new_node->hasAttribute( $attr_name ) ) {
138
+ $old_node->setAttribute( $attr_name, $new_node->getAttribute( $attr_name ) );
139
+ }
140
  }
141
 
142
+ /*
143
  * If the node has at least one valid source, replace the old node with it.
144
  * Otherwise, just remove the node.
145
  *
146
+ * @todo Add a fallback handler.
147
+ * See: https://github.com/ampproject/amphtml/issues/2261
148
  */
149
+ if ( empty( $sources ) ) {
150
  $this->remove_invalid_child( $node );
151
  } else {
152
+ $node->parentNode->replaceChild( $new_node, $node );
153
 
154
+ if ( $this->args['add_noscript_fallback'] ) {
155
+ // Preserve original node in noscript for no-JS environments.
156
+ $this->append_old_node_noscript( $new_node, $old_node, $this->dom );
 
 
157
  }
 
 
158
  }
159
 
160
  $this->did_convert_elements = true;
213
  break;
214
 
215
  default:
216
+ $out[ $name ] = $value;
217
  }
218
  }
219
 
includes/sanitizers/class-amp-base-sanitizer.php CHANGED
@@ -573,11 +573,15 @@ abstract class AMP_Base_Sanitizer {
573
  return;
574
  }
575
  $body_node = $nodes->item( 0 );
576
- $amp_image_lightbox = AMP_DOM_Utils::create_node( $this->dom, 'amp-image-lightbox', array(
577
- 'id' => self::AMP_IMAGE_LIGHTBOX_ID,
578
- 'layout' => 'nodisplay',
579
- 'data-close-button-aria-label' => __( 'Close', 'amp' ),
580
- ) );
 
 
 
 
581
  $body_node->appendChild( $amp_image_lightbox );
582
  }
583
  }
573
  return;
574
  }
575
  $body_node = $nodes->item( 0 );
576
+ $amp_image_lightbox = AMP_DOM_Utils::create_node(
577
+ $this->dom,
578
+ 'amp-image-lightbox',
579
+ array(
580
+ 'id' => self::AMP_IMAGE_LIGHTBOX_ID,
581
+ 'layout' => 'nodisplay',
582
+ 'data-close-button-aria-label' => __( 'Close', 'amp' ),
583
+ )
584
+ );
585
  $body_node->appendChild( $amp_image_lightbox );
586
  }
587
  }
includes/sanitizers/class-amp-blacklist-sanitizer.php CHANGED
@@ -23,8 +23,8 @@ class AMP_Blacklist_Sanitizer extends AMP_Base_Sanitizer {
23
  * @var array
24
  */
25
  protected $DEFAULT_ARGS = array(
26
- 'add_blacklisted_protocols' => array(),
27
- 'add_blacklisted_tags' => array(),
28
  'add_blacklisted_attributes' => array(),
29
  );
30
 
@@ -246,9 +246,12 @@ class AMP_Blacklist_Sanitizer extends AMP_Base_Sanitizer {
246
  * @return array Protocols.
247
  */
248
  private function get_blacklisted_protocols() {
249
- return $this->merge_defaults_with_args( 'add_blacklisted_protocols', array(
250
- 'javascript',
251
- ) );
 
 
 
252
  }
253
 
254
  /**
@@ -257,31 +260,34 @@ class AMP_Blacklist_Sanitizer extends AMP_Base_Sanitizer {
257
  * @return array Tags.
258
  */
259
  private function get_blacklisted_tags() {
260
- return $this->merge_defaults_with_args( 'add_blacklisted_tags', array(
261
- 'script',
262
- 'noscript',
263
- 'style',
264
- 'frame',
265
- 'frameset',
266
- 'object',
267
- 'param',
268
- 'applet',
269
- 'form',
270
- 'label',
271
- 'input',
272
- 'textarea',
273
- 'select',
274
- 'option',
275
- 'link',
276
- 'picture',
277
-
278
- // Sanitizers run after embed handlers, so if anything wasn't matched, it needs to be removed.
279
- 'embed',
280
- 'embedvideo',
281
-
282
- // Other weird ones.
283
- 'comments-count',
284
- ) );
 
 
 
285
  }
286
 
287
  /**
@@ -290,12 +296,15 @@ class AMP_Blacklist_Sanitizer extends AMP_Base_Sanitizer {
290
  * @return array Attributes.
291
  */
292
  private function get_blacklisted_attributes() {
293
- return $this->merge_defaults_with_args( 'add_blacklisted_attributes', array(
294
- 'style',
295
- 'size',
296
- 'clear',
297
- 'align',
298
- 'valign',
299
- ) );
 
 
 
300
  }
301
  }
23
  * @var array
24
  */
25
  protected $DEFAULT_ARGS = array(
26
+ 'add_blacklisted_protocols' => array(),
27
+ 'add_blacklisted_tags' => array(),
28
  'add_blacklisted_attributes' => array(),
29
  );
30
 
246
  * @return array Protocols.
247
  */
248
  private function get_blacklisted_protocols() {
249
+ return $this->merge_defaults_with_args(
250
+ 'add_blacklisted_protocols',
251
+ array(
252
+ 'javascript',
253
+ )
254
+ );
255
  }
256
 
257
  /**
260
  * @return array Tags.
261
  */
262
  private function get_blacklisted_tags() {
263
+ return $this->merge_defaults_with_args(
264
+ 'add_blacklisted_tags',
265
+ array(
266
+ 'script',
267
+ 'noscript',
268
+ 'style',
269
+ 'frame',
270
+ 'frameset',
271
+ 'object',
272
+ 'param',
273
+ 'applet',
274
+ 'form',
275
+ 'label',
276
+ 'input',
277
+ 'textarea',
278
+ 'select',
279
+ 'option',
280
+ 'link',
281
+ 'picture',
282
+
283
+ // Sanitizers run after embed handlers, so if anything wasn't matched, it needs to be removed.
284
+ 'embed',
285
+ 'embedvideo',
286
+
287
+ // Other weird ones.
288
+ 'comments-count',
289
+ )
290
+ );
291
  }
292
 
293
  /**
296
  * @return array Attributes.
297
  */
298
  private function get_blacklisted_attributes() {
299
+ return $this->merge_defaults_with_args(
300
+ 'add_blacklisted_attributes',
301
+ array(
302
+ 'style',
303
+ 'size',
304
+ 'clear',
305
+ 'align',
306
+ 'valign',
307
+ )
308
+ );
309
  }
310
  }
includes/sanitizers/class-amp-comments-sanitizer.php CHANGED
@@ -12,13 +12,23 @@
12
  */
13
  class AMP_Comments_Sanitizer extends AMP_Base_Sanitizer {
14
 
 
 
 
 
 
 
 
 
 
 
 
15
  /**
16
  * Pre-process the comment form and comment list for AMP.
17
  *
18
  * @since 0.7
19
  */
20
  public function sanitize() {
21
-
22
  foreach ( $this->dom->getElementsByTagName( 'form' ) as $comment_form ) {
23
  /**
24
  * Comment form.
@@ -34,11 +44,22 @@ class AMP_Comments_Sanitizer extends AMP_Base_Sanitizer {
34
  $this->process_comment_form( $comment_form );
35
  }
36
  }
 
 
 
 
 
 
 
 
 
37
  }
38
 
39
  /**
40
  * Comment form.
41
  *
 
 
42
  * @param DOMElement $comment_form Comment form.
43
  */
44
  protected function process_comment_form( $comment_form ) {
@@ -109,11 +130,14 @@ class AMP_Comments_Sanitizer extends AMP_Base_Sanitizer {
109
  }
110
 
111
  // Update the state in response to changing the input.
112
- $element->setAttribute( 'on', sprintf(
113
- 'change:AMP.setState( { %s: { values: { %s: event.value } } } )',
114
- $state_id,
115
- wp_json_encode( $name )
116
- ) );
 
 
 
117
  }
118
  }
119
 
@@ -153,4 +177,42 @@ class AMP_Comments_Sanitizer extends AMP_Base_Sanitizer {
153
  );
154
  $comment_form->setAttribute( 'on', implode( ';', $on ) );
155
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
156
  }
12
  */
13
  class AMP_Comments_Sanitizer extends AMP_Base_Sanitizer {
14
 
15
+ /**
16
+ * Default args.
17
+ *
18
+ * @since 1.1
19
+ *
20
+ * @var array
21
+ */
22
+ protected $DEFAULT_ARGS = array(
23
+ 'comment_live_list' => false,
24
+ );
25
+
26
  /**
27
  * Pre-process the comment form and comment list for AMP.
28
  *
29
  * @since 0.7
30
  */
31
  public function sanitize() {
 
32
  foreach ( $this->dom->getElementsByTagName( 'form' ) as $comment_form ) {
33
  /**
34
  * Comment form.
44
  $this->process_comment_form( $comment_form );
45
  }
46
  }
47
+
48
+ if ( ! empty( $this->args['comments_live_list'] ) ) {
49
+ $xpath = new DOMXPath( $this->dom );
50
+ $comments = $xpath->query( '//amp-live-list/*[ @items ]/*[ starts-with( @id, "comment-" ) ]' );
51
+
52
+ foreach ( $comments as $comment ) {
53
+ $this->add_amp_live_list_comment_attributes( $comment );
54
+ }
55
+ }
56
  }
57
 
58
  /**
59
  * Comment form.
60
  *
61
+ * @since 0.7
62
+ *
63
  * @param DOMElement $comment_form Comment form.
64
  */
65
  protected function process_comment_form( $comment_form ) {
130
  }
131
 
132
  // Update the state in response to changing the input.
133
+ $element->setAttribute(
134
+ 'on',
135
+ sprintf(
136
+ 'change:AMP.setState( { %s: { values: { %s: event.value } } } )',
137
+ $state_id,
138
+ wp_json_encode( $name )
139
+ )
140
+ );
141
  }
142
  }
143
 
177
  );
178
  $comment_form->setAttribute( 'on', implode( ';', $on ) );
179
  }
180
+
181
+ /**
182
+ * Add attributes to comment elements when comments are being presented in amp-live-list, when comments_live_list theme support flag is present.
183
+ *
184
+ * @since 1.1
185
+ *
186
+ * @param DOMElement $comment_element Comment element.
187
+ */
188
+ protected function add_amp_live_list_comment_attributes( $comment_element ) {
189
+ $comment_id = (int) str_replace( 'comment-', '', $comment_element->getAttribute( 'id' ) );
190
+ if ( ! $comment_id ) {
191
+ return;
192
+ }
193
+ $comment_object = get_comment( $comment_id );
194
+
195
+ // Skip if the comment is not valid or the comment has a parent, since in that case it is not relevant for amp-live-list.
196
+ if ( ! ( $comment_object instanceof WP_Comment ) || $comment_object->comment_parent ) {
197
+ return;
198
+ }
199
+
200
+ $comment_element->setAttribute( 'data-sort-time', strtotime( $comment_object->comment_date ) );
201
+
202
+ $update_time = strtotime( $comment_object->comment_date );
203
+
204
+ // Ensure the top-level data-update-time reflects the max time of the comments in the thread.
205
+ $children = $comment_object->get_children(
206
+ array(
207
+ 'format' => 'flat',
208
+ 'hierarchical' => 'flat',
209
+ 'orderby' => 'none',
210
+ )
211
+ );
212
+ foreach ( $children as $child_comment ) {
213
+ $update_time = max( strtotime( $child_comment->comment_date ), $update_time );
214
+ }
215
+
216
+ $comment_element->setAttribute( 'data-update-time', $update_time );
217
+ }
218
  }
includes/sanitizers/class-amp-core-theme-sanitizer.php CHANGED
@@ -53,20 +53,18 @@ class AMP_Core_Theme_Sanitizer extends AMP_Base_Sanitizer {
53
  protected static $theme_features = array(
54
  // Twenty Nineteen.
55
  'twentynineteen' => array(
56
- 'dequeue_scripts' => array(
57
  'twentynineteen-skip-link-focus-fix', // This is part of AMP. See <https://github.com/ampproject/amphtml/issues/18671>.
58
  'twentynineteen-priority-menu',
59
  'twentynineteen-touch-navigation', // @todo There could be an AMP implementation of this, similar to what is implemented on ampproject.org.
60
  ),
61
- 'remove_actions' => array(
62
  'wp_print_footer_scripts' => array(
63
  'twentynineteen_skip_link_focus_fix', // See <https://github.com/WordPress/twentynineteen/pull/47>.
64
  ),
65
  ),
66
- 'add_twentynineteen_masthead_styles' => array(),
67
- 'add_twentynineteen_image_styles' => array(),
68
- 'remove_twentynineteen_thumbnail_image_sizes' => array(),
69
-
70
  ),
71
 
72
  // Twenty Seventeen.
@@ -90,9 +88,9 @@ class AMP_Core_Theme_Sanitizer extends AMP_Base_Sanitizer {
90
  'add_twentyseventeen_image_styles' => array(),
91
  'add_twentyseventeen_sticky_nav_menu' => array(),
92
  'add_has_header_video_body_class' => array(),
93
- 'add_nav_menu_styles' => array(),
94
- 'add_nav_menu_toggle' => array(),
95
- 'add_nav_sub_menu_buttons' => array(),
96
  'add_smooth_scrolling' => array(
97
  '//header[@id = "masthead"]//a[ contains( @class, "menu-scroll-down" ) ]',
98
  ),
@@ -104,38 +102,38 @@ class AMP_Core_Theme_Sanitizer extends AMP_Base_Sanitizer {
104
  'twentysixteen' => array(
105
  // @todo Figure out an AMP solution for onResizeARIA().
106
  // @todo Try to implement belowEntryMetaClass().
107
- 'dequeue_scripts' => array(
108
  'twentysixteen-script',
109
  'twentysixteen-html5', // Only relevant for IE<9.
110
  'twentysixteen-keyboard-image-navigation', // AMP does not yet allow for listening to keydown events.
111
  'twentysixteen-skip-link-focus-fix', // Only needed by IE11 and when admin bar is present.
112
  ),
113
- 'remove_actions' => array(
114
  'wp_head' => array(
115
  'twentysixteen_javascript_detection', // AMP is essentially no-js, with any interactively added explicitly via amp-bind.
116
  ),
117
  ),
118
- 'add_nav_menu_styles' => array(),
119
- 'add_nav_menu_toggle' => array(),
120
- 'add_nav_sub_menu_buttons' => array(),
121
  ),
122
 
123
  // Twenty Fifteen.
124
  'twentyfifteen' => array(
125
  // @todo Figure out an AMP solution for onResizeARIA().
126
- 'dequeue_scripts' => array(
127
  'twentyfifteen-script',
128
  'twentyfifteen-keyboard-image-navigation', // AMP does not yet allow for listening to keydown events.
129
  'twentyfifteen-skip-link-focus-fix', // Only needed by IE11 and when admin bar is present.
130
  ),
131
- 'remove_actions' => array(
132
  'wp_head' => array(
133
  'twentyfifteen_javascript_detection', // AMP is essentially no-js, with any interactively added explicitly via amp-bind.
134
  ),
135
  ),
136
- 'add_nav_menu_styles' => array(),
137
- 'add_nav_menu_toggle' => array(),
138
- 'add_nav_sub_menu_buttons' => array(),
139
  ),
140
  );
141
 
@@ -205,66 +203,120 @@ class AMP_Core_Theme_Sanitizer extends AMP_Base_Sanitizer {
205
  }
206
 
207
  /**
208
- * Get theme config.
209
  *
210
- * @since 1.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
211
  *
212
  * @param string $theme Theme slug.
213
- * @return array Class names.
214
  */
215
- protected static function get_theme_config( $theme ) {
216
  // phpcs:disable WordPress.WP.I18n.TextDomainMismatch
217
- $config = array(
218
- 'sub_menu_button_class' => 'dropdown-toggle',
219
- );
220
  switch ( $theme ) {
221
  case 'twentyfifteen':
222
- return array_merge(
223
- $config,
224
- array(
225
- 'nav_container_id' => 'secondary',
226
- 'nav_container_toggle_class' => 'toggled-on',
227
- 'menu_button_class' => 'secondary-toggle',
228
- 'menu_button_xpath' => '//header[ @id = "masthead" ]//button[ contains( @class, "secondary-toggle" ) ]',
229
- 'menu_button_toggle_class' => 'toggled-on',
 
230
  'sub_menu_button_toggle_class' => 'toggle-on',
231
  'expand_text ' => __( 'expand child menu', 'twentyfifteen' ),
232
  'collapse_text' => __( 'collapse child menu', 'twentyfifteen' ),
233
- )
234
  );
235
 
236
  case 'twentysixteen':
237
- return array_merge(
238
- $config,
239
- array(
240
- 'nav_container_id' => 'site-header-menu',
241
- 'nav_container_toggle_class' => 'toggled-on',
242
- 'menu_button_class' => 'menu-toggle',
243
- 'menu_button_xpath' => '//header[@id = "masthead"]//button[ @id = "menu-toggle" ]',
244
- 'menu_button_toggle_class' => 'toggled-on',
 
245
  'sub_menu_button_toggle_class' => 'toggled-on',
246
  'expand_text ' => __( 'expand child menu', 'twentysixteen' ),
247
  'collapse_text' => __( 'collapse child menu', 'twentysixteen' ),
248
- )
249
  );
250
 
251
  case 'twentyseventeen':
252
- default:
253
- return array_merge(
254
- $config,
255
- array(
256
- 'nav_container_id' => 'site-navigation',
257
- 'nav_container_toggle_class' => 'toggled-on',
258
- 'menu_button_class' => 'menu-toggle',
259
- 'menu_button_xpath' => '//nav[@id = "site-navigation"]//button[ contains( @class, "menu-toggle" ) ]',
260
- 'menu_button_toggle_class' => 'toggled-on',
261
  'sub_menu_button_toggle_class' => 'toggled-on',
262
  'expand_text ' => __( 'expand child menu', 'twentyseventeen' ),
263
  'collapse_text' => __( 'collapse child menu', 'twentyseventeen' ),
264
- )
265
  );
 
 
 
 
 
 
 
 
 
 
 
266
  }
267
  // phpcs:enable WordPress.WP.I18n.TextDomainMismatch
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
268
  }
269
 
270
  /**
@@ -333,36 +385,19 @@ class AMP_Core_Theme_Sanitizer extends AMP_Base_Sanitizer {
333
  * @link https://github.com/WordPress/wordpress-develop/blob/f4580c122b7d0d2d66d22f806c6fe6e11023c6f0/src/wp-content/themes/twentyseventeen/assets/js/global.js#L105-L108
334
  */
335
  public static function set_twentyseventeen_quotes_icon() {
336
- add_filter( 'the_content', function ( $content ) {
337
-
338
- // Why isn't Twenty Seventeen doing this to begin with? Why is it using JS to add the quote icon?
339
- if ( function_exists( 'twentyseventeen_get_svg' ) && 'quote' === get_post_format() ) {
340
- $icon = twentyseventeen_get_svg( array( 'icon' => 'quote-right' ) );
341
- $content = preg_replace( '#(<blockquote.*?>)#s', '$1' . $icon, $content );
342
- }
343
-
344
- return $content;
345
- } );
346
- }
347
 
348
- /**
349
- * Remove the sizes attribute from thumbnail images in Twenty Nineteen.
350
- *
351
- * The AMP runtime sets an inline style on an <amp-img> based on the sizes attribute if it's present.
352
- * For example, <amp-img style="width:calc(50vw)">.
353
- * Removing the 'sizes' attribute isn't ideal, but it looks like it's not possible to override that inline style.
354
- *
355
- * @todo: remove when this is resolved: https://github.com/ampproject/amphtml/issues/17053
356
- * @since 1.0
357
- */
358
- public static function remove_twentynineteen_thumbnail_image_sizes() {
359
- add_filter( 'wp_get_attachment_image_attributes', function( $attr ) {
360
- if ( isset( $attr['class'] ) && false !== strpos( $attr['class'], 'attachment-post-thumbnail' ) ) {
361
- unset( $attr['sizes'] );
362
  }
363
-
364
- return $attr;
365
- }, 11 );
366
  }
367
 
368
  /**
@@ -374,55 +409,31 @@ class AMP_Core_Theme_Sanitizer extends AMP_Base_Sanitizer {
374
  * @link https://github.com/WordPress/wordpress-develop/blob/ddc8f803c6e99118998191fd2ea24124feb53659/src/wp-content/themes/twentyseventeen/functions.php#L545:L554
375
  */
376
  public static function add_twentyseventeen_attachment_image_attributes() {
377
- add_filter( 'wp_get_attachment_image_attributes', function ( $attr, $attachment, $size ) {
378
- if (
379
- isset( $attr['class'] )
380
- &&
381
- (
382
- 'custom-logo' === $attr['class']
383
- ||
384
- false !== strpos( $attr['class'], 'attachment-twentyseventeen-featured-image' )
385
- )
386
- ) {
387
- /*
388
- * The AMP runtime sets an inline style on an <amp-img> based on the sizes attribute if it's present.
389
- * For example, <amp-img style="width:100%">.
390
- * Removing the 'sizes' attribute is only a workaround, as it looks like it's not possible to override that inline style.
391
- *
392
- * @todo: remove when this is resolved: https://github.com/ampproject/amphtml/issues/17053
393
- */
394
- unset( $attr['sizes'] );
395
- } elseif ( is_attachment() ) {
396
- $sizes = wp_get_attachment_image_sizes( $attachment->ID, $size );
397
- if ( false !== $sizes ) {
398
- $attr['sizes'] = $sizes;
399
- }
400
- }
401
- return $attr;
402
- }, 11, 3 );
403
-
404
  /*
405
  * The max-height of the `.custom-logo-link img` is defined as being 80px, unless
406
  * there is header media in which case it is 200px. Issues related to vertically-squashed
407
  * images can be avoided if we just make sure that the image has this height to begin with.
408
  */
409
- add_filter( 'get_custom_logo', function( $html ) {
410
- $src = wp_get_attachment_image_src( get_theme_mod( 'custom_logo' ), 'full' );
411
- if ( ! $src ) {
412
- return $html;
413
- }
 
 
414
 
415
- if ( 'blank' === get_header_textcolor() && has_custom_header() ) {
416
- $height = 200;
417
- } else {
418
- $height = 80;
419
- }
420
- $width = $height * ( $src[1] / $src[2] ); // Note that float values are allowed.
421
 
422
- $html = preg_replace( '/(?<=width=")\d+(?=")/', $width, $html );
423
- $html = preg_replace( '/(?<=height=")\d+(?=")/', $height, $html );
424
- return $html;
425
- } );
 
426
  }
427
 
428
  /**
@@ -454,11 +465,15 @@ class AMP_Core_Theme_Sanitizer extends AMP_Base_Sanitizer {
454
  * @param string[] $handles Handles, where each item value is the script handle.
455
  */
456
  public static function dequeue_scripts( $handles = array() ) {
457
- add_action( 'wp_enqueue_scripts', function() use ( $handles ) {
458
- foreach ( $handles as $handle ) {
459
- wp_dequeue_script( $handle );
460
- }
461
- }, PHP_INT_MAX );
 
 
 
 
462
  }
463
 
464
  /**
@@ -551,12 +566,15 @@ class AMP_Core_Theme_Sanitizer extends AMP_Base_Sanitizer {
551
  $args
552
  );
553
 
554
- add_filter( 'body_class', function( $body_classes ) use ( $args ) {
555
- if ( has_header_video() ) {
556
- $body_classes[] = $args['class_name'];
 
 
 
 
557
  }
558
- return $body_classes;
559
- } );
560
  }
561
 
562
  /**
@@ -582,39 +600,43 @@ class AMP_Core_Theme_Sanitizer extends AMP_Base_Sanitizer {
582
  * @since 1.0
583
  */
584
  public static function add_twentynineteen_masthead_styles() {
585
- add_action( 'wp_enqueue_scripts', function() {
586
- ob_start();
587
- ?>
588
- <style>
589
- .site-header.featured-image .site-featured-image .post-thumbnail amp-img > img {
590
- height: auto;
591
- left: 50%;
592
- max-width: 1000%;
593
- min-height: 100%;
594
- min-width: 100vw;
595
- position: absolute;
596
- top: 50%;
597
- transform: translateX(-50%) translateY(-50%);
598
- width: auto;
599
- z-index: 1;
600
- /* When image filters are active, make it grayscale to colorize it blue. */
601
- }
602
-
603
- @supports (object-fit: cover) {
604
  .site-header.featured-image .site-featured-image .post-thumbnail amp-img > img {
605
- height: 100%;
606
- left: 0;
607
- object-fit: cover;
608
- top: 0;
609
- transform: none;
610
- width: 100%;
 
 
 
 
 
611
  }
612
- }
613
- </style>
614
- <?php
615
- $styles = str_replace( array( '<style>', '</style>' ), '', ob_get_clean() );
616
- wp_add_inline_style( get_template() . '-style', $styles );
617
- }, 11 );
 
 
 
 
 
 
 
 
 
 
 
 
618
  }
619
 
620
  /**
@@ -627,18 +649,18 @@ class AMP_Core_Theme_Sanitizer extends AMP_Base_Sanitizer {
627
  * @link https://github.com/WordPress/wordpress-develop/blob/1af1f65a21a1a697fb5f33027497f9e5ae638453/src/wp-content/themes/twentyseventeen/style.css#L1743
628
  */
629
  public static function add_twentyseventeen_masthead_styles() {
630
- $args = self::get_theme_config( get_template() );
631
-
632
  /*
633
  * The following is necessary because the styles in the theme apply to img and video,
634
  * and the CSS parser will then convert the selectors to amp-img and amp-video respectively.
635
  * Nevertheless, object-fit does not apply on amp-img and it needs to apply on an actual img.
636
  */
637
- add_action( 'wp_enqueue_scripts', function() use ( $args ) {
638
- $is_front_page_layout = ( is_front_page() && 'posts' !== get_option( 'show_on_front' ) ) || ( is_home() && is_front_page() );
639
- ob_start();
640
- ?>
641
- <style>
 
 
642
  .has-header-image .custom-header-media amp-img > img,
643
  .has-header-video .custom-header-media amp-video > video{
644
  position: fixed;
@@ -714,11 +736,13 @@ class AMP_Core_Theme_Sanitizer extends AMP_Base_Sanitizer {
714
  display: block;
715
  }
716
  }
717
- </style>
718
- <?php
719
- $styles = str_replace( array( '<style>', '</style>' ), '', ob_get_clean() );
720
- wp_add_inline_style( get_template() . '-style', $styles );
721
- }, 11 );
 
 
722
  }
723
 
724
  /**
@@ -729,10 +753,12 @@ class AMP_Core_Theme_Sanitizer extends AMP_Base_Sanitizer {
729
  * @link https://github.com/WordPress/wordpress-develop/blob/1af1f65a21a1a697fb5f33027497f9e5ae638453/src/wp-content/themes/twentyseventeen/style.css#L2100
730
  */
731
  public static function add_twentyseventeen_image_styles() {
732
- add_action( 'wp_enqueue_scripts', function() {
733
- ob_start();
734
- ?>
735
- <style>
 
 
736
  /* Override the display: block in twentyseventeen/style.css, as <amp-img> is usually inline-block. */
737
  .single-featured-image-header amp-img {
738
  display: inline-block;
@@ -742,11 +768,13 @@ class AMP_Core_Theme_Sanitizer extends AMP_Base_Sanitizer {
742
  .single-featured-image-header {
743
  text-align: center;
744
  }
745
- </style>
746
- <?php
747
- $styles = str_replace( array( '<style>', '</style>' ), '', ob_get_clean() );
748
- wp_add_inline_style( get_template() . '-style', $styles );
749
- }, 11 );
 
 
750
  }
751
 
752
  /**
@@ -766,6 +794,7 @@ class AMP_Core_Theme_Sanitizer extends AMP_Base_Sanitizer {
766
  * Elements.
767
  *
768
  * @var DOMElement $link
 
769
  * @var DOMElement $navigation_top
770
  * @var DOMElement $navigation_top_fixed
771
  */
@@ -783,14 +812,20 @@ class AMP_Core_Theme_Sanitizer extends AMP_Base_Sanitizer {
783
  }
784
 
785
  $navigation_top->parentNode->insertBefore( $navigation_top_fixed, $navigation_top->nextSibling );
 
 
 
786
 
787
  $attributes = array(
788
  'layout' => 'nodisplay',
789
  'intersection-ratios' => 1,
790
- 'on' => implode( ';', array(
791
- 'exit:navigationTopShow.start',
792
- 'enter:navigationTopHide.start',
793
- ) ),
 
 
 
794
  );
795
  if ( is_admin_bar_showing() ) {
796
  $attributes['viewport-margins'] = '32px 0';
@@ -826,10 +861,14 @@ class AMP_Core_Theme_Sanitizer extends AMP_Base_Sanitizer {
826
  );
827
 
828
  foreach ( $animations as $animation_id => $animation ) {
829
- $amp_animation = AMP_DOM_Utils::create_node( $this->dom, 'amp-animation', array(
830
- 'id' => $animation_id,
831
- 'layout' => 'nodisplay',
832
- ) );
 
 
 
 
833
  $position_script = $this->dom->createElement( 'script' );
834
  $position_script->setAttribute( 'type', 'application/json' );
835
  $position_script->appendChild( $this->dom->createTextNode( wp_json_encode( $animation ) ) );
@@ -846,15 +885,12 @@ class AMP_Core_Theme_Sanitizer extends AMP_Base_Sanitizer {
846
  * @param array $args Args.
847
  */
848
  public static function add_nav_menu_styles( $args = array() ) {
849
- $args = array_merge(
850
- self::get_theme_config( get_template() ),
851
- $args
852
- );
853
-
854
- add_action( 'wp_enqueue_scripts', function() use ( $args ) {
855
- ob_start();
856
- ?>
857
- <style>
858
  /* Override no-js selector in parent theme. */
859
  .no-js .main-navigation ul ul {
860
  display: none;
@@ -867,18 +903,18 @@ class AMP_Core_Theme_Sanitizer extends AMP_Base_Sanitizer {
867
 
868
  <?php if ( 'twentyseventeen' === get_template() ) : ?>
869
  /* Show the button*/
870
- .no-js .<?php echo esc_html( $args['menu_button_class'] ); ?> {
871
  display: block;
872
  }
873
  .no-js .main-navigation > div > ul {
874
  display: none;
875
  }
876
- .no-js .main-navigation.<?php echo esc_html( $args['nav_container_toggle_class'] ); ?> > div > ul {
877
  display: block;
878
  }
879
  @media screen and (min-width: 48em) {
880
- .no-js .<?php echo esc_html( $args['menu_button_class'] ); ?>,
881
- .no-js .<?php echo esc_html( $args['sub_menu_button_class'] ); ?> {
882
  display: none;
883
  }
884
  .no-js .main-navigation ul,
@@ -930,7 +966,7 @@ class AMP_Core_Theme_Sanitizer extends AMP_Base_Sanitizer {
930
  <?php elseif ( 'twentysixteen' === get_template() ) : ?>
931
  @media screen and (max-width: 56.875em) {
932
  /* Show the button*/
933
- .no-js .<?php echo esc_html( $args['menu_button_class'] ); ?> {
934
  display: block;
935
  }
936
  .no-js .site-header-menu {
@@ -978,184 +1014,31 @@ class AMP_Core_Theme_Sanitizer extends AMP_Base_Sanitizer {
978
  }
979
 
980
  <?php endif; ?>
981
- </style>
982
- <?php
983
- $styles = str_replace( array( '<style>', '</style>' ), '', ob_get_clean() );
984
- wp_add_inline_style( get_template() . '-style', $styles );
985
- }, 11 );
986
- }
987
-
988
- /**
989
- * Ensure that JS-only nav menu styles apply to AMP as well since even though scripts are not allowed, there are AMP-bind implementations.
990
- *
991
- * @since 1.0
992
- *
993
- * @param array $args Args.
994
- */
995
- public function add_nav_menu_toggle( $args = array() ) {
996
- $args = array_merge(
997
- self::get_theme_config( get_template() ),
998
- $args
999
- );
1000
-
1001
- $nav_el = $this->dom->getElementById( $args['nav_container_id'] );
1002
- $button_el = $this->xpath->query( $args['menu_button_xpath'] )->item( 0 );
1003
- if ( ! $nav_el ) {
1004
- if ( $button_el ) {
1005
-
1006
- // Remove the button since it won't be used.
1007
- $button_el->parentNode->removeChild( $button_el );
1008
- }
1009
- return;
1010
- }
1011
-
1012
- if ( ! $button_el ) {
1013
- return;
1014
- }
1015
-
1016
- $state_id = 'navMenuToggledOn';
1017
- $expanded = false;
1018
-
1019
- $nav_el->setAttribute(
1020
- AMP_DOM_Utils::get_amp_bind_placeholder_prefix() . 'class',
1021
- sprintf(
1022
- "%s + ( $state_id ? %s : '' )",
1023
- wp_json_encode( $nav_el->getAttribute( 'class' ) ),
1024
- wp_json_encode( ' ' . $args['nav_container_toggle_class'] )
1025
- )
1026
- );
1027
-
1028
- $state_el = $this->dom->createElement( 'amp-state' );
1029
- $state_el->setAttribute( 'id', $state_id );
1030
- $script_el = $this->dom->createElement( 'script' );
1031
- $script_el->setAttribute( 'type', 'application/json' );
1032
- $script_el->appendChild( $this->dom->createTextNode( wp_json_encode( $expanded ) ) );
1033
- $state_el->appendChild( $script_el );
1034
- $nav_el->parentNode->insertBefore( $state_el, $nav_el );
1035
-
1036
- $button_on = sprintf( "tap:AMP.setState({ $state_id: ! $state_id })" );
1037
- $button_el->setAttribute( 'on', $button_on );
1038
- $button_el->setAttribute( 'aria-expanded', 'false' );
1039
- $button_el->setAttribute( AMP_DOM_Utils::get_amp_bind_placeholder_prefix() . 'aria-expanded', "$state_id ? 'true' : 'false'" );
1040
- $button_el->setAttribute(
1041
- AMP_DOM_Utils::get_amp_bind_placeholder_prefix() . 'class',
1042
- sprintf( "%s + ( $state_id ? %s : '' )", wp_json_encode( $button_el->getAttribute( 'class' ) ), wp_json_encode( ' ' . $args['menu_button_toggle_class'] ) )
1043
  );
1044
  }
1045
 
1046
  /**
1047
- * Add buttons for nav sub-menu items.
1048
- *
1049
- * @since 1.0
1050
- * @link https://github.com/WordPress/wordpress-develop/blob/a26c24226c6b131a0ed22c722a836c100d3ba254/src/wp-content/themes/twentyseventeen/assets/js/navigation.js#L11-L43
1051
  *
1052
- * @param array $args Args.
1053
  */
1054
- public static function add_nav_sub_menu_buttons( $args = array() ) {
1055
- $default_args = self::get_theme_config( get_template() );
1056
- switch ( get_template() ) {
1057
- case 'twentyseventeen':
1058
- if ( function_exists( 'twentyseventeen_get_svg' ) ) {
1059
- $default_args['icon'] = twentyseventeen_get_svg( array(
1060
- 'icon' => 'angle-down',
1061
- 'fallback' => true,
1062
- ) );
1063
  }
1064
- break;
1065
- }
1066
- $args = array_merge( $default_args, $args );
1067
-
1068
- /**
1069
- * Filter the HTML output of a nav menu item to add the AMP dropdown button to reveal the sub-menu.
1070
- *
1071
- * @see twentyfifteen_amp_setup_hooks()
1072
- *
1073
- * @param string $item_output Nav menu item HTML.
1074
- * @param object $item Nav menu item.
1075
- * @return string Modified nav menu item HTML.
1076
- */
1077
- add_filter( 'walker_nav_menu_start_el', function( $item_output, $item, $depth, $nav_menu_args ) use ( $args ) {
1078
- unset( $depth );
1079
-
1080
- // Skip adding buttons to nav menu widgets for now.
1081
- if ( empty( $nav_menu_args->theme_location ) ) {
1082
- return $item_output;
1083
  }
1084
-
1085
- if ( ! in_array( 'menu-item-has-children', $item->classes, true ) ) {
1086
- return $item_output;
1087
- }
1088
- static $nav_menu_item_number = 0;
1089
- $nav_menu_item_number++;
1090
-
1091
- $expanded = in_array( 'current-menu-ancestor', $item->classes, true );
1092
-
1093
- $expanded_state_id = 'navMenuItemExpanded' . $nav_menu_item_number;
1094
-
1095
- // Create new state for managing storing the whether the sub-menu is expanded.
1096
- $item_output .= sprintf(
1097
- '<amp-state id="%s"><script type="application/json">%s</script></amp-state>',
1098
- esc_attr( $expanded_state_id ),
1099
- wp_json_encode( $expanded )
1100
- );
1101
-
1102
- $dropdown_button = '<button';
1103
- $dropdown_button .= sprintf(
1104
- ' class="%s" [class]="%s"',
1105
- esc_attr( $args['sub_menu_button_class'] . ( $expanded ? ' ' . $args['sub_menu_button_toggle_class'] : '' ) ),
1106
- esc_attr( sprintf( "%s + ( $expanded_state_id ? %s : '' )", wp_json_encode( $args['sub_menu_button_class'] ), wp_json_encode( ' ' . $args['sub_menu_button_toggle_class'] ) ) )
1107
- );
1108
- $dropdown_button .= sprintf(
1109
- ' aria-expanded="%s" [aria-expanded]="%s"',
1110
- esc_attr( wp_json_encode( $expanded ) ),
1111
- esc_attr( "$expanded_state_id ? 'true' : 'false'" )
1112
- );
1113
- $dropdown_button .= sprintf(
1114
- ' on="%s"',
1115
- esc_attr( "tap:AMP.setState( { $expanded_state_id: ! $expanded_state_id } )" )
1116
- );
1117
- $dropdown_button .= '>';
1118
-
1119
- if ( isset( $args['icon'] ) ) {
1120
- $dropdown_button .= $args['icon'];
1121
- }
1122
- if ( isset( $args['expand_text'] ) && isset( $args['collapse_text'] ) ) {
1123
- $dropdown_button .= sprintf(
1124
- '<span class="screen-reader-text" [text]="%s">%s</span>',
1125
- esc_attr( sprintf( "$expanded_state_id ? %s : %s", wp_json_encode( $args['collapse_text'] ), wp_json_encode( $args['expand_text'] ) ) ),
1126
- esc_html( $expanded ? $args['collapse_text'] : $args['expand_text'] )
1127
- );
1128
- }
1129
-
1130
- $dropdown_button .= '</button>';
1131
-
1132
- $item_output .= $dropdown_button;
1133
- return $item_output;
1134
- }, 10, 4 );
1135
- }
1136
-
1137
- /**
1138
- * Output image styles for twentynineteen.
1139
- *
1140
- * When <img> tags have an 'aligncenter' class, AMP_Img_Sanitizer::handle_centering() wraps theme in <figure class="aligncenter">.
1141
- * This ensures that the image inside it is centered.
1142
- *
1143
- * @since 1.0
1144
- *
1145
- * @param array $args Arguments.
1146
- */
1147
- public static function add_twentynineteen_image_styles( $args = array() ) {
1148
- add_action( 'wp_enqueue_scripts', function() use ( $args ) {
1149
- ob_start();
1150
- ?>
1151
- <style>
1152
- figure.aligncenter {
1153
- text-align: center
1154
- }
1155
- </style>
1156
- <?php
1157
- $styles = str_replace( array( '<style>', '</style>' ), '', ob_get_clean() );
1158
- wp_add_inline_style( get_template() . '-style', $styles );
1159
- }, 11 );
1160
  }
1161
  }
53
  protected static $theme_features = array(
54
  // Twenty Nineteen.
55
  'twentynineteen' => array(
56
+ 'dequeue_scripts' => array(
57
  'twentynineteen-skip-link-focus-fix', // This is part of AMP. See <https://github.com/ampproject/amphtml/issues/18671>.
58
  'twentynineteen-priority-menu',
59
  'twentynineteen-touch-navigation', // @todo There could be an AMP implementation of this, similar to what is implemented on ampproject.org.
60
  ),
61
+ 'remove_actions' => array(
62
  'wp_print_footer_scripts' => array(
63
  'twentynineteen_skip_link_focus_fix', // See <https://github.com/WordPress/twentynineteen/pull/47>.
64
  ),
65
  ),
66
+ 'add_twentynineteen_masthead_styles' => array(),
67
+ 'adjust_twentynineteen_images' => array(),
 
 
68
  ),
69
 
70
  // Twenty Seventeen.
88
  'add_twentyseventeen_image_styles' => array(),
89
  'add_twentyseventeen_sticky_nav_menu' => array(),
90
  'add_has_header_video_body_class' => array(),
91
+ 'add_nav_menu_styles' => array(
92
+ 'sub_menu_button_toggle_class' => 'toggled-on',
93
+ ),
94
  'add_smooth_scrolling' => array(
95
  '//header[@id = "masthead"]//a[ contains( @class, "menu-scroll-down" ) ]',
96
  ),
102
  'twentysixteen' => array(
103
  // @todo Figure out an AMP solution for onResizeARIA().
104
  // @todo Try to implement belowEntryMetaClass().
105
+ 'dequeue_scripts' => array(
106
  'twentysixteen-script',
107
  'twentysixteen-html5', // Only relevant for IE<9.
108
  'twentysixteen-keyboard-image-navigation', // AMP does not yet allow for listening to keydown events.
109
  'twentysixteen-skip-link-focus-fix', // Only needed by IE11 and when admin bar is present.
110
  ),
111
+ 'remove_actions' => array(
112
  'wp_head' => array(
113
  'twentysixteen_javascript_detection', // AMP is essentially no-js, with any interactively added explicitly via amp-bind.
114
  ),
115
  ),
116
+ 'add_nav_menu_styles' => array(
117
+ 'sub_menu_button_toggle_class' => 'toggled-on',
118
+ ),
119
  ),
120
 
121
  // Twenty Fifteen.
122
  'twentyfifteen' => array(
123
  // @todo Figure out an AMP solution for onResizeARIA().
124
+ 'dequeue_scripts' => array(
125
  'twentyfifteen-script',
126
  'twentyfifteen-keyboard-image-navigation', // AMP does not yet allow for listening to keydown events.
127
  'twentyfifteen-skip-link-focus-fix', // Only needed by IE11 and when admin bar is present.
128
  ),
129
+ 'remove_actions' => array(
130
  'wp_head' => array(
131
  'twentyfifteen_javascript_detection', // AMP is essentially no-js, with any interactively added explicitly via amp-bind.
132
  ),
133
  ),
134
+ 'add_nav_menu_styles' => array(
135
+ 'sub_menu_button_toggle_class' => 'toggle-on',
136
+ ),
137
  ),
138
  );
139
 
203
  }
204
 
205
  /**
206
+ * Adds extra theme support arguments on the fly.
207
  *
208
+ * This method is neither a buffering hook nor a sanitization callback and is called manually by
209
+ * {@see AMP_Theme_Support}. Typically themes will add theme support directly and don't need such
210
+ * a method. In this case, it is a workaround for adding theme support on behalf of external themes.
211
+ *
212
+ * @since 1.1
213
+ */
214
+ public static function extend_theme_support() {
215
+ $args = self::get_theme_support_args( get_template() );
216
+
217
+ if ( empty( $args ) ) {
218
+ return;
219
+ }
220
+
221
+ $support = AMP_Theme_Support::get_theme_support_args();
222
+ if ( ! is_array( $support ) ) {
223
+ $support = array();
224
+ }
225
+
226
+ add_theme_support( AMP_Theme_Support::SLUG, array_merge( $support, $args ) );
227
+ }
228
+
229
+ /**
230
+ * Returns extra arguments to pass to `add_theme_support()`.
231
+ *
232
+ * @since 1.1
233
  *
234
  * @param string $theme Theme slug.
235
+ * @return array Arguments to merge with existing theme support arguments.
236
  */
237
+ protected static function get_theme_support_args( $theme ) {
238
  // phpcs:disable WordPress.WP.I18n.TextDomainMismatch
 
 
 
239
  switch ( $theme ) {
240
  case 'twentyfifteen':
241
+ return array(
242
+ 'nav_menu_toggle' => array(
243
+ 'nav_container_id' => 'secondary',
244
+ 'nav_container_toggle_class' => 'toggled-on',
245
+ 'menu_button_xpath' => '//header[ @id = "masthead" ]//button[ contains( @class, "secondary-toggle" ) ]',
246
+ 'menu_button_toggle_class' => 'toggled-on',
247
+ ),
248
+ 'nav_menu_dropdown' => array(
249
+ 'sub_menu_button_class' => 'dropdown-toggle',
250
  'sub_menu_button_toggle_class' => 'toggle-on',
251
  'expand_text ' => __( 'expand child menu', 'twentyfifteen' ),
252
  'collapse_text' => __( 'collapse child menu', 'twentyfifteen' ),
253
+ ),
254
  );
255
 
256
  case 'twentysixteen':
257
+ return array(
258
+ 'nav_menu_toggle' => array(
259
+ 'nav_container_id' => 'site-header-menu',
260
+ 'nav_container_toggle_class' => 'toggled-on',
261
+ 'menu_button_xpath' => '//header[@id = "masthead"]//button[ @id = "menu-toggle" ]',
262
+ 'menu_button_toggle_class' => 'toggled-on',
263
+ ),
264
+ 'nav_menu_dropdown' => array(
265
+ 'sub_menu_button_class' => 'dropdown-toggle',
266
  'sub_menu_button_toggle_class' => 'toggled-on',
267
  'expand_text ' => __( 'expand child menu', 'twentysixteen' ),
268
  'collapse_text' => __( 'collapse child menu', 'twentysixteen' ),
269
+ ),
270
  );
271
 
272
  case 'twentyseventeen':
273
+ $config = array(
274
+ 'nav_menu_toggle' => array(
275
+ 'nav_container_id' => 'site-navigation',
276
+ 'nav_container_toggle_class' => 'toggled-on',
277
+ 'menu_button_xpath' => '//nav[@id = "site-navigation"]//button[ contains( @class, "menu-toggle" ) ]',
278
+ 'menu_button_toggle_class' => 'toggled-on',
279
+ ),
280
+ 'nav_menu_dropdown' => array(
281
+ 'sub_menu_button_class' => 'dropdown-toggle',
282
  'sub_menu_button_toggle_class' => 'toggled-on',
283
  'expand_text ' => __( 'expand child menu', 'twentyseventeen' ),
284
  'collapse_text' => __( 'collapse child menu', 'twentyseventeen' ),
285
+ ),
286
  );
287
+
288
+ if ( function_exists( 'twentyseventeen_get_svg' ) ) {
289
+ $config['nav_menu_dropdown']['icon'] = twentyseventeen_get_svg(
290
+ array(
291
+ 'icon' => 'angle-down',
292
+ 'fallback' => true,
293
+ )
294
+ );
295
+ }
296
+
297
+ return $config;
298
  }
299
  // phpcs:enable WordPress.WP.I18n.TextDomainMismatch
300
+
301
+ return array();
302
+ }
303
+
304
+ /**
305
+ * Get theme config.
306
+ *
307
+ * @since 1.0
308
+ * @deprecated 1.1
309
+ *
310
+ * @param string $theme Theme slug.
311
+ * @return array Class names.
312
+ */
313
+ protected static function get_theme_config( $theme ) {
314
+ _deprecated_function( __METHOD__, '1.1' );
315
+
316
+ $args = self::get_theme_support_args( $theme );
317
+
318
+ // This returns arguments in a backward-compatible way.
319
+ return array_merge( $args['nav_menu_toggle'], $args['nav_menu_dropdown'] );
320
  }
321
 
322
  /**
385
  * @link https://github.com/WordPress/wordpress-develop/blob/f4580c122b7d0d2d66d22f806c6fe6e11023c6f0/src/wp-content/themes/twentyseventeen/assets/js/global.js#L105-L108
386
  */
387
  public static function set_twentyseventeen_quotes_icon() {
388
+ add_filter(
389
+ 'the_content',
390
+ function ( $content ) {
391
+
392
+ // Why isn't Twenty Seventeen doing this to begin with? Why is it using JS to add the quote icon?
393
+ if ( function_exists( 'twentyseventeen_get_svg' ) && 'quote' === get_post_format() ) {
394
+ $icon = twentyseventeen_get_svg( array( 'icon' => 'quote-right' ) );
395
+ $content = preg_replace( '#(<blockquote.*?>)#s', '$1' . $icon, $content );
396
+ }
 
 
397
 
398
+ return $content;
 
 
 
 
 
 
 
 
 
 
 
 
 
399
  }
400
+ );
 
 
401
  }
402
 
403
  /**
409
  * @link https://github.com/WordPress/wordpress-develop/blob/ddc8f803c6e99118998191fd2ea24124feb53659/src/wp-content/themes/twentyseventeen/functions.php#L545:L554
410
  */
411
  public static function add_twentyseventeen_attachment_image_attributes() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
412
  /*
413
  * The max-height of the `.custom-logo-link img` is defined as being 80px, unless
414
  * there is header media in which case it is 200px. Issues related to vertically-squashed
415
  * images can be avoided if we just make sure that the image has this height to begin with.
416
  */
417
+ add_filter(
418
+ 'get_custom_logo',
419
+ function( $html ) {
420
+ $src = wp_get_attachment_image_src( get_theme_mod( 'custom_logo' ), 'full' );
421
+ if ( ! $src ) {
422
+ return $html;
423
+ }
424
 
425
+ if ( 'blank' === get_header_textcolor() && has_custom_header() ) {
426
+ $height = 200;
427
+ } else {
428
+ $height = 80;
429
+ }
430
+ $width = $height * ( $src[1] / $src[2] ); // Note that float values are allowed.
431
 
432
+ $html = preg_replace( '/(?<=width=")\d+(?=")/', $width, $html );
433
+ $html = preg_replace( '/(?<=height=")\d+(?=")/', $height, $html );
434
+ return $html;
435
+ }
436
+ );
437
  }
438
 
439
  /**
465
  * @param string[] $handles Handles, where each item value is the script handle.
466
  */
467
  public static function dequeue_scripts( $handles = array() ) {
468
+ add_action(
469
+ 'wp_enqueue_scripts',
470
+ function() use ( $handles ) {
471
+ foreach ( $handles as $handle ) {
472
+ wp_dequeue_script( $handle );
473
+ }
474
+ },
475
+ PHP_INT_MAX
476
+ );
477
  }
478
 
479
  /**
566
  $args
567
  );
568
 
569
+ add_filter(
570
+ 'body_class',
571
+ function( $body_classes ) use ( $args ) {
572
+ if ( has_header_video() ) {
573
+ $body_classes[] = $args['class_name'];
574
+ }
575
+ return $body_classes;
576
  }
577
+ );
 
578
  }
579
 
580
  /**
600
  * @since 1.0
601
  */
602
  public static function add_twentynineteen_masthead_styles() {
603
+ add_action(
604
+ 'wp_enqueue_scripts',
605
+ function() {
606
+ ob_start();
607
+ ?>
608
+ <style>
 
 
 
 
 
 
 
 
 
 
 
 
 
609
  .site-header.featured-image .site-featured-image .post-thumbnail amp-img > img {
610
+ height: auto;
611
+ left: 50%;
612
+ max-width: 1000%;
613
+ min-height: 100%;
614
+ min-width: 100vw;
615
+ position: absolute;
616
+ top: 50%;
617
+ transform: translateX(-50%) translateY(-50%);
618
+ width: auto;
619
+ z-index: 1;
620
+ /* When image filters are active, make it grayscale to colorize it blue. */
621
  }
622
+
623
+ @supports (object-fit: cover) {
624
+ .site-header.featured-image .site-featured-image .post-thumbnail amp-img > img {
625
+ height: 100%;
626
+ left: 0;
627
+ object-fit: cover;
628
+ top: 0;
629
+ transform: none;
630
+ width: 100%;
631
+ }
632
+ }
633
+ </style>
634
+ <?php
635
+ $styles = str_replace( array( '<style>', '</style>' ), '', ob_get_clean() );
636
+ wp_add_inline_style( get_template() . '-style', $styles );
637
+ },
638
+ 11
639
+ );
640
  }
641
 
642
  /**
649
  * @link https://github.com/WordPress/wordpress-develop/blob/1af1f65a21a1a697fb5f33027497f9e5ae638453/src/wp-content/themes/twentyseventeen/style.css#L1743
650
  */
651
  public static function add_twentyseventeen_masthead_styles() {
 
 
652
  /*
653
  * The following is necessary because the styles in the theme apply to img and video,
654
  * and the CSS parser will then convert the selectors to amp-img and amp-video respectively.
655
  * Nevertheless, object-fit does not apply on amp-img and it needs to apply on an actual img.
656
  */
657
+ add_action(
658
+ 'wp_enqueue_scripts',
659
+ function() {
660
+ $is_front_page_layout = ( is_front_page() && 'posts' !== get_option( 'show_on_front' ) ) || ( is_home() && is_front_page() );
661
+ ob_start();
662
+ ?>
663
+ <style>
664
  .has-header-image .custom-header-media amp-img > img,
665
  .has-header-video .custom-header-media amp-video > video{
666
  position: fixed;
736
  display: block;
737
  }
738
  }
739
+ </style>
740
+ <?php
741
+ $styles = str_replace( array( '<style>', '</style>' ), '', ob_get_clean() );
742
+ wp_add_inline_style( get_template() . '-style', $styles );
743
+ },
744
+ 11
745
+ );
746
  }
747
 
748
  /**
753
  * @link https://github.com/WordPress/wordpress-develop/blob/1af1f65a21a1a697fb5f33027497f9e5ae638453/src/wp-content/themes/twentyseventeen/style.css#L2100
754
  */
755
  public static function add_twentyseventeen_image_styles() {
756
+ add_action(
757
+ 'wp_enqueue_scripts',
758
+ function() {
759
+ ob_start();
760
+ ?>
761
+ <style>
762
  /* Override the display: block in twentyseventeen/style.css, as <amp-img> is usually inline-block. */
763
  .single-featured-image-header amp-img {
764
  display: inline-block;
768
  .single-featured-image-header {
769
  text-align: center;
770
  }
771
+ </style>
772
+ <?php
773
+ $styles = str_replace( array( '<style>', '</style>' ), '', ob_get_clean() );
774
+ wp_add_inline_style( get_template() . '-style', $styles );
775
+ },
776
+ 11
777
+ );
778
  }
779
 
780
  /**
794
  * Elements.
795
  *
796
  * @var DOMElement $link
797
+ * @var DOMElement $element
798
  * @var DOMElement $navigation_top
799
  * @var DOMElement $navigation_top_fixed
800
  */
812
  }
813
 
814
  $navigation_top->parentNode->insertBefore( $navigation_top_fixed, $navigation_top->nextSibling );
815
+ foreach ( $this->xpath->query( './/*[ @id ]', $navigation_top_fixed ) as $element ) {
816
+ $element->setAttribute( 'id', $element->getAttribute( 'id' ) . '-fixed' );
817
+ }
818
 
819
  $attributes = array(
820
  'layout' => 'nodisplay',
821
  'intersection-ratios' => 1,
822
+ 'on' => implode(
823
+ ';',
824
+ array(
825
+ 'exit:navigationTopShow.start',
826
+ 'enter:navigationTopHide.start',
827
+ )
828
+ ),
829
  );
830
  if ( is_admin_bar_showing() ) {
831
  $attributes['viewport-margins'] = '32px 0';
861
  );
862
 
863
  foreach ( $animations as $animation_id => $animation ) {
864
+ $amp_animation = AMP_DOM_Utils::create_node(
865
+ $this->dom,
866
+ 'amp-animation',
867
+ array(
868
+ 'id' => $animation_id,
869
+ 'layout' => 'nodisplay',
870
+ )
871
+ );
872
  $position_script = $this->dom->createElement( 'script' );
873
  $position_script->setAttribute( 'type', 'application/json' );
874
  $position_script->appendChild( $this->dom->createTextNode( wp_json_encode( $animation ) ) );
885
  * @param array $args Args.
886
  */
887
  public static function add_nav_menu_styles( $args = array() ) {
888
+ add_action(
889
+ 'wp_enqueue_scripts',
890
+ function() use ( $args ) {
891
+ ob_start();
892
+ ?>
893
+ <style>
 
 
 
894
  /* Override no-js selector in parent theme. */
895
  .no-js .main-navigation ul ul {
896
  display: none;
903
 
904
  <?php if ( 'twentyseventeen' === get_template() ) : ?>
905
  /* Show the button*/
906
+ .no-js .menu-toggle {
907
  display: block;
908
  }
909
  .no-js .main-navigation > div > ul {
910
  display: none;
911
  }
912
+ .no-js .main-navigation.toggled-on > div > ul {
913
  display: block;
914
  }
915
  @media screen and (min-width: 48em) {
916
+ .no-js .menu-toggle,
917
+ .no-js .dropdown-toggle {
918
  display: none;
919
  }
920
  .no-js .main-navigation ul,
966
  <?php elseif ( 'twentysixteen' === get_template() ) : ?>
967
  @media screen and (max-width: 56.875em) {
968
  /* Show the button*/
969
+ .no-js .menu-toggle {
970
  display: block;
971
  }
972
  .no-js .site-header-menu {
1014
  }
1015
 
1016
  <?php endif; ?>
1017
+ </style>
1018
+ <?php
1019
+ $styles = str_replace( array( '<style>', '</style>' ), '', ob_get_clean() );
1020
+ wp_add_inline_style( get_template() . '-style', $styles );
1021
+ },
1022
+ 11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1023
  );
1024
  }
1025
 
1026
  /**
1027
+ * Adjust images in twentynineteen.
 
 
 
1028
  *
1029
+ * @since 1.1
1030
  */
1031
+ public static function adjust_twentynineteen_images() {
1032
+
1033
+ // Make sure the featured image gets responsive layout.
1034
+ add_filter(
1035
+ 'wp_get_attachment_image_attributes',
1036
+ function( $attributes ) {
1037
+ if ( preg_match( '/(^|\s)(attachment-post-thumbnail)(\s|$)/', $attributes['class'] ) ) {
1038
+ $attributes['data-amp-layout'] = 'responsive';
 
1039
  }
1040
+ return $attributes;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1041
  }
1042
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1043
  }
1044
  }
includes/sanitizers/class-amp-form-sanitizer.php CHANGED
@@ -24,17 +24,6 @@ class AMP_Form_Sanitizer extends AMP_Base_Sanitizer {
24
  */
25
  public static $tag = 'form';
26
 
27
- /**
28
- * Get mapping of HTML selectors to the AMP component selectors which they may be converted into.
29
- *
30
- * @return array Mapping.
31
- */
32
- public function get_selector_conversion_mapping() {
33
- return array(
34
- 'form' => array( 'amp-form' ),
35
- );
36
- }
37
-
38
  /**
39
  * Sanitize the <form> elements from the HTML contained in this instance's DOMDocument.
40
  *
@@ -75,7 +64,7 @@ class AMP_Form_Sanitizer extends AMP_Base_Sanitizer {
75
  * https URL and must not be a link to a CDN".
76
  */
77
  if ( ! $node->getAttribute( 'action' ) ) {
78
- $action_url = esc_url_raw( '//' . $_SERVER['HTTP_HOST'] . wp_unslash( $_SERVER['REQUEST_URI'] ) ); // WPCS: ignore. input var okay, sanitization ok.
79
  } else {
80
  $action_url = $node->getAttribute( 'action' );
81
  // Check if action_url is a relative path and add the host to it.
@@ -91,9 +80,10 @@ class AMP_Form_Sanitizer extends AMP_Base_Sanitizer {
91
  }
92
 
93
  /*
94
- * "For GET submissions, provide at least one of action or action-xhr".
95
- * "This attribute is required for method=GET. For method=POST, the
96
- * action attribute is invalid, use action-xhr instead".
 
97
  */
98
  if ( 'get' === $method ) {
99
  if ( $action_url !== $node->getAttribute( 'action' ) ) {
24
  */
25
  public static $tag = 'form';
26
 
 
 
 
 
 
 
 
 
 
 
 
27
  /**
28
  * Sanitize the <form> elements from the HTML contained in this instance's DOMDocument.
29
  *
64
  * https URL and must not be a link to a CDN".
65
  */
66
  if ( ! $node->getAttribute( 'action' ) ) {
67
+ $action_url = esc_url_raw( '//' . $_SERVER['HTTP_HOST'] . wp_unslash( $_SERVER['REQUEST_URI'] ) );
68
  } else {
69
  $action_url = $node->getAttribute( 'action' );
70
  // Check if action_url is a relative path and add the host to it.
80
  }
81
 
82
  /*
83
+ * According to the AMP spec:
84
+ * For GET submissions, provide at least one of action or action-xhr.
85
+ * This attribute is required for method=GET. For method=POST, the
86
+ * action attribute is invalid, use action-xhr instead.
87
  */
88
  if ( 'get' === $method ) {
89
  if ( $action_url !== $node->getAttribute( 'action' ) ) {
includes/sanitizers/class-amp-gallery-block-sanitizer.php CHANGED
@@ -128,11 +128,15 @@ class AMP_Gallery_Block_Sanitizer extends AMP_Base_Sanitizer {
128
  continue;
129
  }
130
 
131
- $amp_carousel = AMP_DOM_Utils::create_node( $this->dom, 'amp-carousel', array(
132
- 'height' => $this->get_carousel_height( $node ),
133
- 'type' => 'slides',
134
- 'layout' => 'fixed-height',
135
- ) );
 
 
 
 
136
  foreach ( $images as $image ) {
137
  $amp_carousel->appendChild( $image );
138
  }
128
  continue;
129
  }
130
 
131
+ $amp_carousel = AMP_DOM_Utils::create_node(
132
+ $this->dom,
133
+ 'amp-carousel',
134
+ array(
135
+ 'height' => $this->get_carousel_height( $node ),
136
+ 'type' => 'slides',
137
+ 'layout' => 'fixed-height',
138
+ )
139
+ );
140
  foreach ( $images as $image ) {
141
  $amp_carousel->appendChild( $image );
142
  }
includes/sanitizers/class-amp-iframe-sanitizer.php CHANGED
@@ -11,6 +11,7 @@
11
  * Converts <iframe> tags to <amp-iframe>
12
  */
13
  class AMP_Iframe_Sanitizer extends AMP_Base_Sanitizer {
 
14
 
15
  /**
16
  * Value used for height attribute when $attributes['height'] is empty.
@@ -45,7 +46,8 @@ class AMP_Iframe_Sanitizer extends AMP_Base_Sanitizer {
45
  * @var array
46
  */
47
  protected $DEFAULT_ARGS = array(
48
- 'add_placeholder' => false,
 
49
  );
50
 
51
  /**
@@ -73,8 +75,18 @@ class AMP_Iframe_Sanitizer extends AMP_Base_Sanitizer {
73
  return;
74
  }
75
 
 
 
 
 
76
  for ( $i = $num_nodes - 1; $i >= 0; $i-- ) {
77
- $node = $nodes->item( $i );
 
 
 
 
 
 
78
  $normalized_attributes = $this->normalize_attributes( AMP_DOM_Utils::get_node_attributes_as_assoc_array( $node ) );
79
 
80
  /**
@@ -104,13 +116,19 @@ class AMP_Iframe_Sanitizer extends AMP_Base_Sanitizer {
104
  }
105
 
106
  $node->parentNode->replaceChild( $new_node, $node );
 
 
 
 
 
 
 
107
  }
108
  }
109
 
110
  /**
111
  * Normalize HTML attributes for <amp-iframe> elements.
112
  *
113
- *
114
  * @param string[] $attributes {
115
  * Attributes.
116
  *
@@ -185,10 +203,14 @@ class AMP_Iframe_Sanitizer extends AMP_Base_Sanitizer {
185
  * @return DOMElement|false
186
  */
187
  private function build_placeholder( $parent_attributes ) {
188
- $placeholder_node = AMP_DOM_Utils::create_node( $this->dom, 'span', array(
189
- 'placeholder' => '',
190
- 'class' => 'amp-wp-iframe-placeholder',
191
- ) );
 
 
 
 
192
 
193
  return $placeholder_node;
194
  }
11
  * Converts <iframe> tags to <amp-iframe>
12
  */
13
  class AMP_Iframe_Sanitizer extends AMP_Base_Sanitizer {
14
+ use AMP_Noscript_Fallback;
15
 
16
  /**
17
  * Value used for height attribute when $attributes['height'] is empty.
46
  * @var array
47
  */
48
  protected $DEFAULT_ARGS = array(
49
+ 'add_placeholder' => false,
50
+ 'add_noscript_fallback' => true,
51
  );
52
 
53
  /**
75
  return;
76
  }
77
 
78
+ if ( $this->args['add_noscript_fallback'] ) {
79
+ $this->initialize_noscript_allowed_attributes( self::$tag );
80
+ }
81
+
82
  for ( $i = $num_nodes - 1; $i >= 0; $i-- ) {
83
+ $node = $nodes->item( $i );
84
+
85
+ // Skip element if already inside of an AMP element as a noscript fallback.
86
+ if ( $this->is_inside_amp_noscript( $node ) ) {
87
+ continue;
88
+ }
89
+
90
  $normalized_attributes = $this->normalize_attributes( AMP_DOM_Utils::get_node_attributes_as_assoc_array( $node ) );
91
 
92
  /**
116
  }
117
 
118
  $node->parentNode->replaceChild( $new_node, $node );
119
+
120
+ if ( $this->args['add_noscript_fallback'] ) {
121
+ $node->setAttribute( 'src', $normalized_attributes['src'] );
122
+
123
+ // Preserve original node in noscript for no-JS environments.
124
+ $this->append_old_node_noscript( $new_node, $node, $this->dom );
125
+ }
126
  }
127
  }
128
 
129
  /**
130
  * Normalize HTML attributes for <amp-iframe> elements.
131
  *
 
132
  * @param string[] $attributes {
133
  * Attributes.
134
  *
203
  * @return DOMElement|false
204
  */
205
  private function build_placeholder( $parent_attributes ) {
206
+ $placeholder_node = AMP_DOM_Utils::create_node(
207
+ $this->dom,
208
+ 'span',
209
+ array(
210
+ 'placeholder' => '',
211
+ 'class' => 'amp-wp-iframe-placeholder',
212
+ )
213
+ );
214
 
215
  return $placeholder_node;
216
  }
includes/sanitizers/class-amp-img-sanitizer.php CHANGED
@@ -11,6 +11,7 @@
11
  * Converts <img> tags to <amp-img> or <amp-anim>
12
  */
13
  class AMP_Img_Sanitizer extends AMP_Base_Sanitizer {
 
14
 
15
  /**
16
  * Value used for width attribute when $attributes['width'] is empty.
@@ -39,6 +40,15 @@ class AMP_Img_Sanitizer extends AMP_Base_Sanitizer {
39
  */
40
  public static $tag = 'img';
41
 
 
 
 
 
 
 
 
 
 
42
  /**
43
  * Animation extension.
44
  *
@@ -81,12 +91,21 @@ class AMP_Img_Sanitizer extends AMP_Base_Sanitizer {
81
  return;
82
  }
83
 
 
 
 
 
84
  for ( $i = $num_nodes - 1; $i >= 0; $i-- ) {
85
  $node = $nodes->item( $i );
86
  if ( ! $node instanceof DOMElement ) {
87
  continue;
88
  }
89
 
 
 
 
 
 
90
  if ( ! $node->hasAttribute( 'src' ) || '' === trim( $node->getAttribute( 'src' ) ) ) {
91
  $this->remove_invalid_child( $node );
92
  continue;
@@ -102,6 +121,21 @@ class AMP_Img_Sanitizer extends AMP_Base_Sanitizer {
102
 
103
  $this->determine_dimensions( $need_dimensions );
104
  $this->adjust_and_replace_nodes_in_array_map( $need_dimensions );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  }
106
 
107
  /**
@@ -229,7 +263,7 @@ class AMP_Img_Sanitizer extends AMP_Base_Sanitizer {
229
  /**
230
  * Make final modifications to DOMNode
231
  *
232
- * @param DOMElement $node The DOMNode to adjust and replace.
233
  */
234
  private function adjust_and_replace_node( $node ) {
235
 
@@ -244,9 +278,17 @@ class AMP_Img_Sanitizer extends AMP_Base_Sanitizer {
244
 
245
  $this->add_or_append_attribute( $new_attributes, 'class', 'amp-wp-enforced-sizes' );
246
  if ( empty( $new_attributes['layout'] ) && ! empty( $new_attributes['height'] ) && ! empty( $new_attributes['width'] ) ) {
247
- $new_attributes['layout'] = 'intrinsic';
 
 
 
 
 
248
  }
249
 
 
 
 
250
  if ( $this->is_gif_url( $new_attributes['src'] ) ) {
251
  $this->did_convert_elements = true;
252
 
@@ -254,10 +296,21 @@ class AMP_Img_Sanitizer extends AMP_Base_Sanitizer {
254
  } else {
255
  $new_tag = 'amp-img';
256
  }
257
- $new_node = AMP_DOM_Utils::create_node( $this->dom, $new_tag, $new_attributes );
258
- $new_node = $this->handle_centering( $new_node );
259
- $node->parentNode->replaceChild( $new_node, $node );
260
- $this->add_auto_width_to_figure( $new_node );
 
 
 
 
 
 
 
 
 
 
 
261
  }
262
 
263
  /**
@@ -301,76 +354,4 @@ class AMP_Img_Sanitizer extends AMP_Base_Sanitizer {
301
  $path = wp_parse_url( $url, PHP_URL_PATH );
302
  return substr( $path, -strlen( $ext ) ) === $ext;
303
  }
304
-
305
- /**
306
- * Handles an issue with the aligncenter class.
307
- *
308
- * If the <amp-img> has the class aligncenter, this strips the class and wraps it in a <figure> to center the image.
309
- * There was an issue where the aligncenter class overrode the "display: inline-block" rule of AMP's layout="intrinsic" attribute.
310
- * So this strips that class, and instead wraps the image in a <figure> to center it.
311
- *
312
- * @since 0.7
313
- * @see https://github.com/ampproject/amp-wp/issues/1104
314
- *
315
- * @param DOMElement $node The <amp-img> node.
316
- * @return DOMElement $node The <amp-img> node, possibly wrapped in a <figure>.
317
- */
318
- public function handle_centering( $node ) {
319
- $align_class = 'aligncenter';
320
- $classes = $node->getAttribute( 'class' );
321
- $width = $node->getAttribute( 'width' );
322
-
323
- // If this doesn't have a width attribute, centering it in the <figure> wrapper won't work.
324
- if ( empty( $width ) || ! in_array( $align_class, preg_split( '/\s+/', trim( $classes ) ), true ) ) {
325
- return $node;
326
- }
327
-
328
- // Strip the class, and wrap the <amp-img> in a <figure>.
329
- $classes = trim( str_replace( $align_class, '', $classes ) );
330
- $node->setAttribute( 'class', $classes );
331
- $figure = AMP_DOM_Utils::create_node(
332
- $this->dom,
333
- 'figure',
334
- array(
335
- 'class' => $align_class,
336
- 'style' => "max-width: {$width}px;",
337
- )
338
- );
339
- $figure->appendChild( $node );
340
-
341
- return $figure;
342
- }
343
-
344
- /**
345
- * Add an inline style to set the `<figure>` element's width to `auto` instead of `fit-content`.
346
- *
347
- * @since 1.0
348
- * @see https://github.com/ampproject/amp-wp/issues/1086
349
- *
350
- * @param DOMElement $node The DOMNode to adjust and replace.
351
- */
352
- protected function add_auto_width_to_figure( $node ) {
353
- $figure = $node->parentNode;
354
- if ( ! ( $figure instanceof DOMElement ) || 'figure' !== $figure->tagName ) {
355
- return;
356
- }
357
-
358
- $class = $figure->getAttribute( 'class' );
359
- // Target only the <figure> with a 'wp-block-image' class attribute.
360
- if ( false === strpos( $class, 'wp-block-image' ) ) {
361
- return;
362
- }
363
-
364
- // Target only <figure> without a 'is-resized' class attribute.
365
- if ( false !== strpos( $class, 'is-resized' ) ) {
366
- return;
367
- }
368
-
369
- $new_style = 'width: auto;';
370
- if ( $figure->hasAttribute( 'style' ) ) {
371
- $figure->setAttribute( 'style', $new_style . $figure->getAttribute( 'style' ) );
372
- } else {
373
- $figure->setAttribute( 'style', $new_style );
374
- }
375
- }
376
  }
11
  * Converts <img> tags to <amp-img> or <amp-anim>
12
  */
13
  class AMP_Img_Sanitizer extends AMP_Base_Sanitizer {
14
+ use AMP_Noscript_Fallback;
15
 
16
  /**
17
  * Value used for width attribute when $attributes['width'] is empty.
40
  */
41
  public static $tag = 'img';
42
 
43
+ /**
44
+ * Default args.
45
+ *
46
+ * @var array
47
+ */
48
+ protected $DEFAULT_ARGS = array(
49
+ 'add_noscript_fallback' => true,
50
+ );
51
+
52
  /**
53
  * Animation extension.
54
  *
91
  return;
92
  }
93
 
94
+ if ( $this->args['add_noscript_fallback'] ) {
95
+ $this->initialize_noscript_allowed_attributes( self::$tag );
96
+ }
97
+
98
  for ( $i = $num_nodes - 1; $i >= 0; $i-- ) {
99
  $node = $nodes->item( $i );
100
  if ( ! $node instanceof DOMElement ) {
101
  continue;
102
  }
103
 
104
+ // Skip element if already inside of an AMP element as a noscript fallback.
105
+ if ( $this->is_inside_amp_noscript( $node ) ) {
106
+ continue;
107
+ }
108
+
109
  if ( ! $node->hasAttribute( 'src' ) || '' === trim( $node->getAttribute( 'src' ) ) ) {
110
  $this->remove_invalid_child( $node );
111
  continue;
121
 
122
  $this->determine_dimensions( $need_dimensions );
123
  $this->adjust_and_replace_nodes_in_array_map( $need_dimensions );
124
+
125
+ /*
126
+ * Opt-in to amp-img-auto-sizes experiment.
127
+ * This is needed because the sizes attribute is removed from all img elements converted to amp-img
128
+ * in order to prevent the undesirable setting of the width. This $meta tag can be removed once the
129
+ * experiment ends (and the feature has been fully launched).
130
+ * See <https://github.com/ampproject/amphtml/issues/21371> and <https://github.com/ampproject/amp-wp/pull/2036>.
131
+ */
132
+ $head = $this->dom->getElementsByTagName( 'head' )->item( 0 );
133
+ if ( $head ) {
134
+ $meta = $this->dom->createElement( 'meta' );
135
+ $meta->setAttribute( 'name', 'amp-experiments-opt-in' );
136
+ $meta->setAttribute( 'content', 'amp-img-auto-sizes' );
137
+ $head->insertBefore( $meta, $head->firstChild );
138
+ }
139
  }
140
 
141
  /**
263
  /**
264
  * Make final modifications to DOMNode
265
  *
266
+ * @param DOMElement $node The img element to adjust and replace.
267
  */
268
  private function adjust_and_replace_node( $node ) {
269
 
278
 
279
  $this->add_or_append_attribute( $new_attributes, 'class', 'amp-wp-enforced-sizes' );
280
  if ( empty( $new_attributes['layout'] ) && ! empty( $new_attributes['height'] ) && ! empty( $new_attributes['width'] ) ) {
281
+ // Use responsive images when a theme supports wide and full-bleed images.
282
+ if ( ! empty( $this->args['align_wide_support'] ) && $node->parentNode && 'figure' === $node->parentNode->nodeName && preg_match( '/(^|\s)(alignwide|alignfull)(\s|$)/', $node->parentNode->getAttribute( 'class' ) ) ) {
283
+ $new_attributes['layout'] = 'responsive';
284
+ } else {
285
+ $new_attributes['layout'] = 'intrinsic';
286
+ }
287
  }
288
 
289
+ // Remove sizes attribute since it causes headaches in AMP and because AMP will generate it for us. See <https://github.com/ampproject/amphtml/issues/21371>.
290
+ unset( $new_attributes['sizes'] );
291
+
292
  if ( $this->is_gif_url( $new_attributes['src'] ) ) {
293
  $this->did_convert_elements = true;
294
 
296
  } else {
297
  $new_tag = 'amp-img';
298
  }
299
+
300
+ $img_node = AMP_DOM_Utils::create_node( $this->dom, $new_tag, $new_attributes );
301
+ $node->parentNode->replaceChild( $img_node, $node );
302
+
303
+ $can_include_noscript = (
304
+ $this->args['add_noscript_fallback']
305
+ &&
306
+ ( $node->hasAttribute( 'src' ) && ! preg_match( '/^http:/', $node->getAttribute( 'src' ) ) )
307
+ &&
308
+ ( ! $node->hasAttribute( 'srcset' ) || ! preg_match( '/http:/', $node->getAttribute( 'srcset' ) ) )
309
+ );
310
+ if ( $can_include_noscript ) {
311
+ // Preserve original node in noscript for no-JS environments.
312
+ $this->append_old_node_noscript( $img_node, $node, $this->dom );
313
+ }
314
  }
315
 
316
  /**
354
  $path = wp_parse_url( $url, PHP_URL_PATH );
355
  return substr( $path, -strlen( $ext ) ) === $ext;
356
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
357
  }
includes/sanitizers/class-amp-nav-menu-dropdown-sanitizer.php ADDED
@@ -0,0 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class AMP_Nav_Menu_Dropdown_Sanitizer
4
+ *
5
+ * @package AMP
6
+ */
7
+
8
+ /**
9
+ * Class AMP_Nav_Menu_Dropdown_Sanitizer
10
+ *
11
+ * Handles state for navigation menu dropdown toggles, based on theme support.
12
+ *
13
+ * @since 1.1.0
14
+ */
15
+ class AMP_Nav_Menu_Dropdown_Sanitizer extends AMP_Base_Sanitizer {
16
+
17
+ /**
18
+ * Default args.
19
+ *
20
+ * @since 1.1.0
21
+ * @var array
22
+ */
23
+ protected $DEFAULT_ARGS = array(
24
+ 'sub_menu_button_class' => '',
25
+ 'sub_menu_button_toggle_class' => '',
26
+ 'expand_text' => '',
27
+ 'collapse_text' => '',
28
+ 'icon' => null, // Optional.
29
+ 'sub_menu_item_state_id' => 'navMenuItemExpanded',
30
+ );
31
+
32
+ /**
33
+ * AMP_Nav_Menu_Dropdown_Sanitizer constructor.
34
+ *
35
+ * @since 1.1.0
36
+ *
37
+ * @param DOMDocument $dom DOM.
38
+ * @param array $args Args.
39
+ */
40
+ public function __construct( $dom, $args = array() ) {
41
+ parent::__construct( $dom, $args );
42
+
43
+ $this->args = self::ensure_defaults( $this->args );
44
+ }
45
+
46
+ /**
47
+ * Add filter to manipulate output during output buffering to add AMP-compatible dropdown toggles.
48
+ *
49
+ * @since 1.0
50
+ *
51
+ * @param array $args Args.
52
+ */
53
+ public static function add_buffering_hooks( $args = array() ) {
54
+ if ( empty( $args['sub_menu_button_class'] ) || empty( $args['sub_menu_button_toggle_class'] ) ) {
55
+ return;
56
+ }
57
+
58
+ $args = self::ensure_defaults( $args );
59
+
60
+ /**
61
+ * Filter the HTML output of a nav menu item to add the AMP dropdown button to reveal the sub-menu.
62
+ *
63
+ * @param string $item_output Nav menu item HTML.
64
+ * @param object $item Nav menu item.
65
+ * @return string Modified nav menu item HTML.
66
+ */
67
+ add_filter(
68
+ 'walker_nav_menu_start_el',
69
+ function( $item_output, $item, $depth, $nav_menu_args ) use ( $args ) {
70
+ unset( $depth );
71
+
72
+ // Skip adding buttons to nav menu widgets for now.
73
+ if ( empty( $nav_menu_args->theme_location ) ) {
74
+ return $item_output;
75
+ }
76
+
77
+ if ( ! in_array( 'menu-item-has-children', $item->classes, true ) ) {
78
+ return $item_output;
79
+ }
80
+
81
+ static $nav_menu_item_number = 0;
82
+ $nav_menu_item_number++;
83
+
84
+ $expanded = in_array( 'current-menu-ancestor', $item->classes, true );
85
+
86
+ $expanded_state_id = $args['nav_menu_item_state_id'] . $nav_menu_item_number;
87
+
88
+ // Create new state for managing storing the whether the sub-menu is expanded.
89
+ $item_output .= sprintf(
90
+ '<amp-state id="%s"><script type="application/json">%s</script></amp-state>',
91
+ esc_attr( $expanded_state_id ),
92
+ wp_json_encode( $expanded )
93
+ );
94
+
95
+ $dropdown_button = '<button';
96
+ $dropdown_button .= sprintf(
97
+ ' class="%s" [class]="%s"',
98
+ esc_attr( $args['sub_menu_button_class'] . ( $expanded ? ' ' . $args['sub_menu_button_toggle_class'] : '' ) ),
99
+ esc_attr( sprintf( "%s + ( $expanded_state_id ? %s : '' )", wp_json_encode( $args['sub_menu_button_class'] ), wp_json_encode( ' ' . $args['sub_menu_button_toggle_class'] ) ) )
100
+ );
101
+ $dropdown_button .= sprintf(
102
+ ' aria-expanded="%s" [aria-expanded]="%s"',
103
+ esc_attr( wp_json_encode( $expanded ) ),
104
+ esc_attr( "$expanded_state_id ? 'true' : 'false'" )
105
+ );
106
+ $dropdown_button .= sprintf(
107
+ ' on="%s"',
108
+ esc_attr( "tap:AMP.setState( { $expanded_state_id: ! $expanded_state_id } )" )
109
+ );
110
+ $dropdown_button .= '>';
111
+
112
+ if ( isset( $args['icon'] ) ) {
113
+ $dropdown_button .= $args['icon'];
114
+ }
115
+ if ( isset( $args['expand_text'] ) && isset( $args['collapse_text'] ) ) {
116
+ $dropdown_button .= sprintf(
117
+ '<span class="screen-reader-text" [text]="%s">%s</span>',
118
+ esc_attr( sprintf( "$expanded_state_id ? %s : %s", wp_json_encode( $args['collapse_text'] ), wp_json_encode( $args['expand_text'] ) ) ),
119
+ esc_html( $expanded ? $args['collapse_text'] : $args['expand_text'] )
120
+ );
121
+ }
122
+
123
+ $dropdown_button .= '</button>';
124
+
125
+ $item_output .= $dropdown_button;
126
+ return $item_output;
127
+ },
128
+ 10,
129
+ 4
130
+ );
131
+ }
132
+
133
+ /**
134
+ * Method needs to be stubbed to fulfill base class requirements.
135
+ *
136
+ * @since 1.1.0
137
+ */
138
+ public function sanitize() {
139
+ // Empty method body.
140
+ }
141
+
142
+ /**
143
+ * Ensure that some defaults are always set as fallback.
144
+ *
145
+ * @param array $args Arguments to set the defaults in as necessary.
146
+ * @return array Arguments with defaults filled.
147
+ */
148
+ protected static function ensure_defaults( $args ) {
149
+ // Ensure accessibility labels are always set.
150
+ if ( empty( $args['expand_text'] ) ) {
151
+ $args['expand_text'] = __( 'expand child menu', 'amp' );
152
+ }
153
+ if ( empty( $args['collapse_text'] ) ) {
154
+ $args['collapse_text'] = __( 'collapse child menu', 'amp' );
155
+ }
156
+
157
+ // Ensure the state ID is always set.
158
+ if ( empty( $args['nav_menu_item_state_id'] ) ) {
159
+ $args['nav_menu_item_state_id'] = 'navMenuItemExpanded';
160
+ }
161
+
162
+ return $args;
163
+ }
164
+ }
includes/sanitizers/class-amp-nav-menu-toggle-sanitizer.php ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class AMP_Nav_Menu_Toggle_Sanitizer
4
+ *
5
+ * @package AMP
6
+ */
7
+
8
+ /**
9
+ * Class AMP_Nav_Menu_Toggle_Sanitizer
10
+ *
11
+ * Handles state for navigation menu toggles, based on theme support.
12
+ *
13
+ * @since 1.1.0
14
+ */
15
+ class AMP_Nav_Menu_Toggle_Saniti