AMP for WordPress - Version 2.0.10

Version Description

Download this release

Release Info

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

Code changes from version 2.0.9 to 2.0.10

amp.php CHANGED
@@ -5,7 +5,7 @@
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: 2.0.9
9
  * License: GPLv2 or later
10
  * Requires at least: 4.9
11
  * Requires PHP: 5.6
@@ -15,7 +15,7 @@
15
 
16
  define( 'AMP__FILE__', __FILE__ );
17
  define( 'AMP__DIR__', dirname( __FILE__ ) );
18
- define( 'AMP__VERSION', '2.0.9' );
19
 
20
  /**
21
  * Errors encountered while loading the plugin.
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: 2.0.10
9
  * License: GPLv2 or later
10
  * Requires at least: 4.9
11
  * Requires PHP: 5.6
15
 
16
  define( 'AMP__FILE__', __FILE__ );
17
  define( 'AMP__DIR__', dirname( __FILE__ ) );
18
+ define( 'AMP__VERSION', '2.0.10' );
19
 
20
  /**
21
  * Errors encountered while loading the plugin.
assets/js/amp-block-editor.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'moment', 'react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-polyfill', 'wp-url'), 'version' => '2f1bc3e07d3de9b2451813c8881566dd');
1
+ <?php return array('dependencies' => array('lodash', 'moment', 'react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-polyfill', 'wp-url'), 'version' => 'd8be68c60e1eb1b4e1cf9223c9f07a27');
assets/js/amp-block-editor.js CHANGED
@@ -10,7 +10,7 @@ Object(i.sprintf)(Object(i.__)("The featured image should have a size of at leas
10
  /* translators: placeholder is minimum width. */
11
  Object(i.sprintf)(Object(i.__)("The featured image should have a width of at least %s pixels.","amp"),Math.ceil(n))):t.height&&r.push(
12
  /* translators: placeholder is minimum height. */
13
- Object(i.sprintf)(Object(i.__)("The featured image should have a height of at least %s pixels.","amp"),Math.ceil(o)))}return 0===r.length?null:r},s=function(e){var t=Object(r.template)("<p>".concat(e,"</p>"),{evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g});return function(e){return t(e)}},d=function(e,t){if(e){var a=Object(r.get)(this,["options","allowedTypes"],null),n=this.get("select");a&&e.get("type")&&!function(e,t){var a=e.get("type"),r=e.get("mime");return!(!t.includes(a)&&!t.includes(r))&&"video"!==a}(e,a)?(this.secondary.set(o.a,new t({mimeType:e.get("mime")})),n&&n.model&&n.model.set("disabled",!0)):(this.secondary.unset(o.a),n&&n.model&&n.model.set("disabled",!1))}},m=function(e){var t=e.url,a=e.id,n=e.width,i=e.height,o=e.onSelect,c=e.dispatchImage,l={};l.url=t,l.thumbnail_url=t,l.timestamp=Object(r.now)(),a&&(l.attachment_id=a),n&&(l.width=n),i&&(l.height=i),o(l),c(a)}},function(e,t){e.exports=function(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}},function(e,t){function a(){return e.exports=a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},a.apply(this,arguments)}e.exports=a},function(e,t,a){"use strict";a.d(t,"c",(function(){return r})),a.d(t,"b",(function(){return n})),a.d(t,"a",(function(){return i}));var r=6,n=72,i="select-file-type-error"},function(e,t){!function(){e.exports=this.lodash}()},function(e,t){!function(){e.exports=this.wp.compose}()},function(e,t){function a(t){return e.exports=a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},a(t)}e.exports=a},function(e,t){!function(){e.exports=this.moment}()},function(e,t,a){"use strict";a.d(t,"a",(function(){return b})),a.d(t,"c",(function(){return p})),a.d(t,"b",(function(){return O})),a.d(t,"d",(function(){return x}));var r=a(0),n=(a(5),a(22),a(1)),i=a(2),o=a(4),c=a(3),l=a(7),u=a(11);function s(e,t){var a;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(a=function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);"Object"===a&&e.constructor&&(a=e.constructor.name);if("Map"===a||"Set"===a)return Array.from(e);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return d(e,t)}(e))||t&&e&&"number"==typeof e.length){a&&(e=a);var r=0,n=function(){};return{s:n,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,c=!1;return{s:function(){a=e[Symbol.iterator]()},n:function(){var e=a.next();return o=e.done,e},e:function(e){c=!0,i=e},f:function(){try{o||null==a.return||a.return()}finally{if(c)throw i}}}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,r=new Array(t);a<t;a++)r[a]=e[a];return r}var m=[{value:"nodisplay",label:Object(n.__)("No Display","amp"),notAvailable:["core-embed/vimeo","core-embed/dailymotion","core-embed/reddit","core-embed/soundcloud"]},{value:"fixed",label:Object(n.__)("Fixed","amp"),notAvailable:["core-embed/soundcloud"]},{value:"responsive",label:Object(n.__)("Responsive","amp"),notAvailable:["core-embed/soundcloud"]},{value:"fixed-height",label:Object(n.__)("Fixed Height","amp"),notAvailable:[]},{value:"fill",label:Object(n.__)("Fill","amp"),notAvailable:["core-embed/soundcloud"]},{value:"flex-item",label:Object(n.__)("Flex Item","amp"),notAvailable:["core-embed/soundcloud"]},{value:"intrinsic",label:Object(n.__)("Intrinsic","amp"),notAvailable:["core/video","core-embed/youtube","core-embed/facebook","core-embed/instagram","core-embed/vimeo","core-embed/dailymotion","core-embed/reddit","core-embed/soundcloud"]}],b=function(e,t){return"core/gallery"===t&&(e.attributes||(e.attributes={}),e.attributes.ampCarousel={type:"boolean",default:!Object(c.select)("amp/block-editor").hasThemeSupport()},e.attributes.ampLightbox={type:"boolean",default:!1}),"core/image"===t&&(e.attributes||(e.attributes={}),e.attributes.ampLightbox={type:"boolean",default:!1}),l.e.includes(t)&&(e.attributes||(e.attributes={}),e.attributes.ampFitText={type:"boolean",default:!1},e.attributes.minFont={default:u.c,source:"attribute",selector:"amp-fit-text",attribute:"min-font-size"},e.attributes.maxFont={default:u.b,source:"attribute",selector:"amp-fit-text",attribute:"max-font-size"},e.attributes.height={default:"core/image"===t?200:10*Math.ceil(u.b/10),source:"attribute",selector:"amp-fit-text",attribute:"height"}),(0===t.indexOf("core-embed")||l.c.includes(t))&&(e.attributes||(e.attributes={}),e.attributes.ampLayout={type:"string"},e.attributes.ampNoLoading={type:"boolean"}),e},p=function(e,t,a){var n={layout:"fixed-height"};if("core/paragraph"!==t.name||a.ampFitText){if(l.e.includes(t.name)&&a.ampFitText)return a.minFont&&(n["min-font-size"]=a.minFont),a.maxFont&&(n["max-font-size"]=a.maxFont),a.height&&(n.height=a.height),n.children=e,Object(r.createElement)("amp-fit-text",n)}else{var i=f(a.content);if(i!==a.content)return Object(r.cloneElement)(e,{key:"new",value:i})}return e},f=function(e){var t=/<amp-fit-text\b[^>]*>(.*?)<\/amp-fit-text>/.exec(e),a=e;return t&&t[1]&&(a=t[1]),a},h=function(e){var t,a=[{value:"",label:Object(n.__)("Default","amp")}],r=s(m);try{for(r.s();!(t=r.n()).done;){var i=t.value;!i.notAvailable.includes(e)&&a.push({value:i.value,label:i.label})}}catch(e){r.e(e)}finally{r.f()}return a},O=function(e){return function(t){var a,n=t.attributes.ampLayout,i=t.name;return"core/gallery"===i?a=E(t):"core/image"===i?a=P(t):l.c.includes(i)||0===i.indexOf("core-embed/")?a=y(t):l.e.includes(i)&&(a=v(t)),n&&"nodisplay"===n?[a]:Object(r.createElement)(r.Fragment,null,Object(r.createElement)(e,t),a)}},y=function(e){return e.isSelected?Object(r.createElement)(o.InspectorControls,null,Object(r.createElement)(i.PanelBody,{title:Object(n.__)("AMP Settings","amp")},Object(r.createElement)(g,e),Object(r.createElement)(j,e))):null},g=function(e){var t=e.name,a=e.attributes.ampLayout,o=e.setAttributes,c=Object(n.__)("AMP Layout","amp");return"core/image"===t&&(c=Object(n.__)("AMP Layout (modifies width/height)","amp")),Object(r.createElement)(i.SelectControl,{label:c,value:a,options:h(t),onChange:function(t){o({ampLayout:t}),"core/image"===e.name&&function(e,t){var a=e.attributes,r=e.setAttributes;switch(t){case"fixed-height":a.height||r({height:l.a}),a.ampLightbox&&r({ampLightbox:!1});break;case"fixed":a.height||r({height:l.a}),a.width||r({width:l.b})}}(e,t)}})},j=function(e){var t=e.attributes.ampNoLoading,a=e.setAttributes,o=Object(n.__)("AMP Noloading","amp");return Object(r.createElement)(i.ToggleControl,{label:o,checked:t,onChange:function(){return a({ampNoLoading:!t})}})},v=function(e){var t=e.isSelected,a=e.attributes,c=e.setAttributes,l=a.ampFitText,s=a.minFont,d=a.maxFont,m=a.height,b=[{name:"small",shortName:Object(n._x)("S","font size","amp"),size:14},{name:"regular",shortName:Object(n._x)("M","font size","amp"),size:16},{name:"large",shortName:Object(n._x)("L","font size","amp"),size:36},{name:"larger",shortName:Object(n._x)("XL","font size","amp"),size:48}];if(!t)return null;var p=Object(n.__)("Automatically fit text to container","amp");return l&&(d=parseInt(d),m=parseInt(m),s=parseInt(s)),Object(r.createElement)(o.InspectorControls,null,Object(r.createElement)(i.PanelBody,{title:Object(n.__)("AMP Settings","amp"),className:l?"is-amp-fit-text":""},Object(r.createElement)(i.ToggleControl,{label:p,checked:l,onChange:function(){return c({ampFitText:!l})}})),l&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)(i.TextControl,{label:Object(n.__)("Height","amp"),value:m,min:1,onChange:function(e){c({height:e})}}),d>m&&Object(r.createElement)(i.Notice,{status:"error",isDismissible:!1},Object(n.__)("The height must be greater than the max font size.","amp")),Object(r.createElement)(i.PanelBody,{title:Object(n.__)("Minimum font size","amp")},Object(r.createElement)(i.FontSizePicker,{fallbackFontSize:14,value:s,fontSizes:b,onChange:function(e){e||(e=u.c),parseInt(e)<=d&&c({minFont:e})}})),s>d&&Object(r.createElement)(i.Notice,{status:"error",isDismissible:!1},Object(n.__)("The min font size must less than the max font size.","amp")),Object(r.createElement)(i.PanelBody,{title:Object(n.__)("Maximum font size","amp")},Object(r.createElement)(i.FontSizePicker,{fallbackFontSize:48,value:d,fontSizes:b,onChange:function(e){e||(e=u.b),c({maxFont:e,height:Math.max(e,m)})}}))))},_=function(e){var t=e.attributes,a=t.ampLightbox,o=t.linkTo,c=t.ampLayout,l=e.setAttributes;return Object(r.createElement)(i.ToggleControl,{label:Object(n.__)("Add lightbox effect","amp"),checked:a,onChange:function(e){l({ampLightbox:!a}),e&&("fixed-height"===c&&l({ampLayout:"fixed"}),o&&"none"!==o&&l({linkTo:"none"}))}})},w=function(e){var t=e.attributes.ampCarousel,a=e.setAttributes;return Object(r.createElement)(i.ToggleControl,{label:Object(n.__)("Display as carousel","amp"),checked:t,onChange:function(){return a({ampCarousel:!t})}})},P=function(e){return e.isSelected?Object(r.createElement)(o.InspectorControls,null,Object(r.createElement)(i.PanelBody,{title:Object(n.__)("AMP Settings","amp")},Object(r.createElement)(g,e),Object(r.createElement)(j,e),Object(r.createElement)(_,e))):null},E=function(e){return e.isSelected?Object(r.createElement)(o.InspectorControls,null,Object(r.createElement)(i.PanelBody,{title:Object(n.__)("AMP Settings","amp")},Object(r.createElement)(w,e),Object(r.createElement)(_,e))):null},x=function(){return(0,Object(c.select)("core/editor").getEditedPostAttribute)("amp_enabled")||!1}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t){!function(){e.exports=this.wp.hooks}()},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,a){var r=a(38);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}},function(e,t,a){var r=a(39),n=a(17);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?n(e):t}},function(e,t){!function(){e.exports=this.React}()},function(e,t){e.exports=ampBlockEditor},function(e,t){function a(e,t){for(var a=0;a<t.length;a++){var r=t[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),e}},function(e,t,a){"use strict";a.d(t,"b",(function(){return p})),a.d(t,"a",(function(){return f})),a.d(t,"c",(function(){return h}));var r=a(9),n=a.n(r),i=a(12),o=a(1),c=a(8);function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function u(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?l(Object(a),!0).forEach((function(t){n()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):l(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var s,d=window.wp,m=d.media.View.extend({className:"notice notice-warning notice-alt inline",template:(s=Object(o.sprintf)(
14
  /* translators: 1: image width in pixels. 2: image height in pixels. */
15
  Object(o.__)("The selected image is too small (%1$s by %2$s pixels).","amp"),"{{width}}","{{height}}"),s+=" <# if ( minWidth && minHeight ) { #>",s+=Object(o.sprintf)(
16
  /* translators: 1: required minimum width in pixels. 2: required minimum height in pixels. */
10
  /* translators: placeholder is minimum width. */
11
  Object(i.sprintf)(Object(i.__)("The featured image should have a width of at least %s pixels.","amp"),Math.ceil(n))):t.height&&r.push(
12
  /* translators: placeholder is minimum height. */
13
+ Object(i.sprintf)(Object(i.__)("The featured image should have a height of at least %s pixels.","amp"),Math.ceil(o)))}return 0===r.length?null:r},s=function(e){var t=Object(r.template)("<p>".concat(e,"</p>"),{evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g});return function(e){return t(e)}},d=function(e,t){if(e){var a=Object(r.get)(this,["options","allowedTypes"],null),n=this.get("select");a&&e.get("type")&&!function(e,t){var a=e.get("type"),r=e.get("mime");return!(!t.includes(a)&&!t.includes(r))&&"video"!==a}(e,a)?(this.secondary.set(o.a,new t({mimeType:e.get("mime")})),n&&n.model&&n.model.set("disabled",!0)):(this.secondary.unset(o.a),n&&n.model&&n.model.set("disabled",!1))}},m=function(e){var t=e.url,a=e.id,n=e.width,i=e.height,o=e.onSelect,c=e.dispatchImage,l={};l.url=t,l.thumbnail_url=t,l.timestamp=Object(r.now)(),a&&(l.attachment_id=a),n&&(l.width=n),i&&(l.height=i),o(l),c(a)}},function(e,t){e.exports=function(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}},function(e,t){function a(){return e.exports=a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},a.apply(this,arguments)}e.exports=a},function(e,t,a){"use strict";a.d(t,"c",(function(){return r})),a.d(t,"b",(function(){return n})),a.d(t,"a",(function(){return i}));var r=6,n=72,i="select-file-type-error"},function(e,t){!function(){e.exports=this.lodash}()},function(e,t){!function(){e.exports=this.wp.compose}()},function(e,t){function a(t){return e.exports=a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},a(t)}e.exports=a},function(e,t){!function(){e.exports=this.moment}()},function(e,t,a){"use strict";a.d(t,"a",(function(){return b})),a.d(t,"c",(function(){return p})),a.d(t,"b",(function(){return O})),a.d(t,"d",(function(){return x}));var r=a(0),n=(a(5),a(22),a(1)),i=a(2),o=a(4),c=a(3),l=a(7),u=a(11);function s(e,t){var a;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(a=function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);"Object"===a&&e.constructor&&(a=e.constructor.name);if("Map"===a||"Set"===a)return Array.from(e);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return d(e,t)}(e))||t&&e&&"number"==typeof e.length){a&&(e=a);var r=0,n=function(){};return{s:n,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,c=!1;return{s:function(){a=e[Symbol.iterator]()},n:function(){var e=a.next();return o=e.done,e},e:function(e){c=!0,i=e},f:function(){try{o||null==a.return||a.return()}finally{if(c)throw i}}}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,r=new Array(t);a<t;a++)r[a]=e[a];return r}var m=[{value:"nodisplay",label:Object(n.__)("No Display","amp"),notAvailable:["core-embed/vimeo","core-embed/dailymotion","core-embed/reddit","core-embed/soundcloud"]},{value:"fixed",label:Object(n.__)("Fixed","amp"),notAvailable:["core-embed/soundcloud"]},{value:"responsive",label:Object(n.__)("Responsive","amp"),notAvailable:["core-embed/soundcloud"]},{value:"fixed-height",label:Object(n.__)("Fixed Height","amp"),notAvailable:[]},{value:"fill",label:Object(n.__)("Fill","amp"),notAvailable:["core-embed/soundcloud"]},{value:"flex-item",label:Object(n.__)("Flex Item","amp"),notAvailable:["core-embed/soundcloud"]},{value:"intrinsic",label:Object(n.__)("Intrinsic","amp"),notAvailable:["core-embed/youtube","core-embed/facebook","core-embed/instagram","core-embed/vimeo","core-embed/dailymotion","core-embed/reddit","core-embed/soundcloud"]}],b=function(e,t){return"core/gallery"===t&&(e.attributes||(e.attributes={}),e.attributes.ampCarousel={type:"boolean",default:!Object(c.select)("amp/block-editor").hasThemeSupport()},e.attributes.ampLightbox={type:"boolean",default:!1}),"core/image"===t&&(e.attributes||(e.attributes={}),e.attributes.ampLightbox={type:"boolean",default:!1}),l.e.includes(t)&&(e.attributes||(e.attributes={}),e.attributes.ampFitText={type:"boolean",default:!1},e.attributes.minFont={default:u.c,source:"attribute",selector:"amp-fit-text",attribute:"min-font-size"},e.attributes.maxFont={default:u.b,source:"attribute",selector:"amp-fit-text",attribute:"max-font-size"},e.attributes.height={default:"core/image"===t?200:10*Math.ceil(u.b/10),source:"attribute",selector:"amp-fit-text",attribute:"height"}),(0===t.indexOf("core-embed")||l.c.includes(t))&&(e.attributes||(e.attributes={}),e.attributes.ampLayout={type:"string"},e.attributes.ampNoLoading={type:"boolean"}),e},p=function(e,t,a){var n={layout:"fixed-height"};if("core/paragraph"!==t.name||a.ampFitText){if(l.e.includes(t.name)&&a.ampFitText)return a.minFont&&(n["min-font-size"]=a.minFont),a.maxFont&&(n["max-font-size"]=a.maxFont),a.height&&(n.height=a.height),n.children=e,Object(r.createElement)("amp-fit-text",n)}else{var i=f(a.content);if(i!==a.content)return Object(r.cloneElement)(e,{key:"new",value:i})}return e},f=function(e){var t=/<amp-fit-text\b[^>]*>(.*?)<\/amp-fit-text>/.exec(e),a=e;return t&&t[1]&&(a=t[1]),a},h=function(e){var t,a=[{value:"",label:Object(n.__)("Default","amp")}],r=s(m);try{for(r.s();!(t=r.n()).done;){var i=t.value;!i.notAvailable.includes(e)&&a.push({value:i.value,label:i.label})}}catch(e){r.e(e)}finally{r.f()}return a},O=function(e){return function(t){var a,n=t.attributes.ampLayout,i=t.name;return"core/gallery"===i?a=E(t):"core/image"===i?a=P(t):l.c.includes(i)||0===i.indexOf("core-embed/")?a=y(t):l.e.includes(i)&&(a=v(t)),n&&"nodisplay"===n?[a]:Object(r.createElement)(r.Fragment,null,Object(r.createElement)(e,t),a)}},y=function(e){return e.isSelected?Object(r.createElement)(o.InspectorControls,null,Object(r.createElement)(i.PanelBody,{title:Object(n.__)("AMP Settings","amp")},Object(r.createElement)(g,e),Object(r.createElement)(j,e))):null},g=function(e){var t=e.name,a=e.attributes.ampLayout,o=e.setAttributes,c=Object(n.__)("AMP Layout","amp");return"core/image"===t&&(c=Object(n.__)("AMP Layout (modifies width/height)","amp")),Object(r.createElement)(i.SelectControl,{label:c,value:a,options:h(t),onChange:function(t){o({ampLayout:t}),"core/image"===e.name&&function(e,t){var a=e.attributes,r=e.setAttributes;switch(t){case"fixed-height":a.height||r({height:l.a}),a.ampLightbox&&r({ampLightbox:!1});break;case"fixed":a.height||r({height:l.a}),a.width||r({width:l.b})}}(e,t)}})},j=function(e){var t=e.attributes.ampNoLoading,a=e.setAttributes,o=Object(n.__)("AMP Noloading","amp");return Object(r.createElement)(i.ToggleControl,{label:o,checked:t,onChange:function(){return a({ampNoLoading:!t})}})},v=function(e){var t=e.isSelected,a=e.attributes,c=e.setAttributes,l=a.ampFitText,s=a.minFont,d=a.maxFont,m=a.height,b=[{name:"small",shortName:Object(n._x)("S","font size","amp"),size:14},{name:"regular",shortName:Object(n._x)("M","font size","amp"),size:16},{name:"large",shortName:Object(n._x)("L","font size","amp"),size:36},{name:"larger",shortName:Object(n._x)("XL","font size","amp"),size:48}];if(!t)return null;var p=Object(n.__)("Automatically fit text to container","amp");return l&&(d=parseInt(d),m=parseInt(m),s=parseInt(s)),Object(r.createElement)(o.InspectorControls,null,Object(r.createElement)(i.PanelBody,{title:Object(n.__)("AMP Settings","amp"),className:l?"is-amp-fit-text":""},Object(r.createElement)(i.ToggleControl,{label:p,checked:l,onChange:function(){return c({ampFitText:!l})}})),l&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)(i.TextControl,{label:Object(n.__)("Height","amp"),value:m,min:1,onChange:function(e){c({height:e})}}),d>m&&Object(r.createElement)(i.Notice,{status:"error",isDismissible:!1},Object(n.__)("The height must be greater than the max font size.","amp")),Object(r.createElement)(i.PanelBody,{title:Object(n.__)("Minimum font size","amp")},Object(r.createElement)(i.FontSizePicker,{fallbackFontSize:14,value:s,fontSizes:b,onChange:function(e){e||(e=u.c),parseInt(e)<=d&&c({minFont:e})}})),s>d&&Object(r.createElement)(i.Notice,{status:"error",isDismissible:!1},Object(n.__)("The min font size must less than the max font size.","amp")),Object(r.createElement)(i.PanelBody,{title:Object(n.__)("Maximum font size","amp")},Object(r.createElement)(i.FontSizePicker,{fallbackFontSize:48,value:d,fontSizes:b,onChange:function(e){e||(e=u.b),c({maxFont:e,height:Math.max(e,m)})}}))))},_=function(e){var t=e.attributes,a=t.ampLightbox,o=t.linkTo,c=t.ampLayout,l=e.setAttributes;return Object(r.createElement)(i.ToggleControl,{label:Object(n.__)("Add lightbox effect","amp"),checked:a,onChange:function(e){l({ampLightbox:!a}),e&&("fixed-height"===c&&l({ampLayout:"fixed"}),o&&"none"!==o&&l({linkTo:"none"}))}})},w=function(e){var t=e.attributes.ampCarousel,a=e.setAttributes;return Object(r.createElement)(i.ToggleControl,{label:Object(n.__)("Display as carousel","amp"),checked:t,onChange:function(){return a({ampCarousel:!t})}})},P=function(e){return e.isSelected?Object(r.createElement)(o.InspectorControls,null,Object(r.createElement)(i.PanelBody,{title:Object(n.__)("AMP Settings","amp")},Object(r.createElement)(g,e),Object(r.createElement)(j,e),Object(r.createElement)(_,e))):null},E=function(e){return e.isSelected?Object(r.createElement)(o.InspectorControls,null,Object(r.createElement)(i.PanelBody,{title:Object(n.__)("AMP Settings","amp")},Object(r.createElement)(w,e),Object(r.createElement)(_,e))):null},x=function(){return(0,Object(c.select)("core/editor").getEditedPostAttribute)("amp_enabled")||!1}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t){!function(){e.exports=this.wp.hooks}()},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,a){var r=a(38);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}},function(e,t,a){var r=a(39),n=a(17);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?n(e):t}},function(e,t){!function(){e.exports=this.React}()},function(e,t){e.exports=ampBlockEditor},function(e,t){function a(e,t){for(var a=0;a<t.length;a++){var r=t[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),e}},function(e,t,a){"use strict";a.d(t,"b",(function(){return p})),a.d(t,"a",(function(){return f})),a.d(t,"c",(function(){return h}));var r=a(9),n=a.n(r),i=a(12),o=a(1),c=a(8);function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function u(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?l(Object(a),!0).forEach((function(t){n()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):l(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var s,d=window.wp,m=d.media.View.extend({className:"notice notice-warning notice-alt inline",template:(s=Object(o.sprintf)(
14
  /* translators: 1: image width in pixels. 2: image height in pixels. */
15
  Object(o.__)("The selected image is too small (%1$s by %2$s pixels).","amp"),"{{width}}","{{height}}"),s+=" <# if ( minWidth && minHeight ) { #>",s+=Object(o.sprintf)(
16
  /* translators: 1: required minimum width in pixels. 2: required minimum height in pixels. */
assets/js/amp-block-validation.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'react', 'wp-block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-polyfill'), 'version' => '275c6fea236f39058c10e2c2a0cf2f61');
1
+ <?php return array('dependencies' => array('lodash', 'react', 'wp-block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-polyfill'), 'version' => 'eb33c6b46f1673d94c9b64041ee3b477');
assets/js/amp-block-validation.js CHANGED
@@ -1,4 +1,4 @@
1
- !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=50)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t){!function(){e.exports=this.wp.blockEditor}()},function(e,t,r){e.exports=r(28)()},,function(e,t,r){"use strict";r.d(t,"e",(function(){return n})),r.d(t,"c",(function(){return o})),r.d(t,"b",(function(){return i})),r.d(t,"a",(function(){return a})),r.d(t,"d",(function(){return c}));var n=["core/paragraph","core/heading","core/code","core/quote","core/subhead"],o=["core/image","core/video"],i=608,a=400,c="editor-post-preview"},,function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},,function(e,t,r){"use strict";r.d(t,"c",(function(){return n})),r.d(t,"b",(function(){return o})),r.d(t,"a",(function(){return i}));var n=6,o=72,i="select-file-type-error"},function(e,t){!function(){e.exports=this.lodash}()},function(e,t){!function(){e.exports=this.wp.compose}()},,,function(e,t,r){"use strict";r.d(t,"a",(function(){return m})),r.d(t,"c",(function(){return p})),r.d(t,"b",(function(){return h})),r.d(t,"d",(function(){return P}));var n=r(0),o=(r(5),r(22),r(1)),i=r(2),a=r(4),c=r(3),u=r(7),l=r(11);function s(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var b=[{value:"nodisplay",label:Object(o.__)("No Display","amp"),notAvailable:["core-embed/vimeo","core-embed/dailymotion","core-embed/reddit","core-embed/soundcloud"]},{value:"fixed",label:Object(o.__)("Fixed","amp"),notAvailable:["core-embed/soundcloud"]},{value:"responsive",label:Object(o.__)("Responsive","amp"),notAvailable:["core-embed/soundcloud"]},{value:"fixed-height",label:Object(o.__)("Fixed Height","amp"),notAvailable:[]},{value:"fill",label:Object(o.__)("Fill","amp"),notAvailable:["core-embed/soundcloud"]},{value:"flex-item",label:Object(o.__)("Flex Item","amp"),notAvailable:["core-embed/soundcloud"]},{value:"intrinsic",label:Object(o.__)("Intrinsic","amp"),notAvailable:["core/video","core-embed/youtube","core-embed/facebook","core-embed/instagram","core-embed/vimeo","core-embed/dailymotion","core-embed/reddit","core-embed/soundcloud"]}],m=function(e,t){return"core/gallery"===t&&(e.attributes||(e.attributes={}),e.attributes.ampCarousel={type:"boolean",default:!Object(c.select)("amp/block-editor").hasThemeSupport()},e.attributes.ampLightbox={type:"boolean",default:!1}),"core/image"===t&&(e.attributes||(e.attributes={}),e.attributes.ampLightbox={type:"boolean",default:!1}),u.e.includes(t)&&(e.attributes||(e.attributes={}),e.attributes.ampFitText={type:"boolean",default:!1},e.attributes.minFont={default:l.c,source:"attribute",selector:"amp-fit-text",attribute:"min-font-size"},e.attributes.maxFont={default:l.b,source:"attribute",selector:"amp-fit-text",attribute:"max-font-size"},e.attributes.height={default:"core/image"===t?200:10*Math.ceil(l.b/10),source:"attribute",selector:"amp-fit-text",attribute:"height"}),(0===t.indexOf("core-embed")||u.c.includes(t))&&(e.attributes||(e.attributes={}),e.attributes.ampLayout={type:"string"},e.attributes.ampNoLoading={type:"boolean"}),e},p=function(e,t,r){var o={layout:"fixed-height"};if("core/paragraph"!==t.name||r.ampFitText){if(u.e.includes(t.name)&&r.ampFitText)return r.minFont&&(o["min-font-size"]=r.minFont),r.maxFont&&(o["max-font-size"]=r.maxFont),r.height&&(o.height=r.height),o.children=e,Object(n.createElement)("amp-fit-text",o)}else{var i=d(r.content);if(i!==r.content)return Object(n.cloneElement)(e,{key:"new",value:i})}return e},d=function(e){var t=/<amp-fit-text\b[^>]*>(.*?)<\/amp-fit-text>/.exec(e),r=e;return t&&t[1]&&(r=t[1]),r},O=function(e){var t,r=[{value:"",label:Object(o.__)("Default","amp")}],n=s(b);try{for(n.s();!(t=n.n()).done;){var i=t.value;!i.notAvailable.includes(e)&&r.push({value:i.value,label:i.label})}}catch(e){n.e(e)}finally{n.f()}return r},h=function(e){return function(t){var r,o=t.attributes.ampLayout,i=t.name;return"core/gallery"===i?r=x(t):"core/image"===i?r=w(t):u.c.includes(i)||0===i.indexOf("core-embed/")?r=v(t):u.e.includes(i)&&(r=j(t)),o&&"nodisplay"===o?[r]:Object(n.createElement)(n.Fragment,null,Object(n.createElement)(e,t),r)}},v=function(e){return e.isSelected?Object(n.createElement)(a.InspectorControls,null,Object(n.createElement)(i.PanelBody,{title:Object(o.__)("AMP Settings","amp")},Object(n.createElement)(y,e),Object(n.createElement)(g,e))):null},y=function(e){var t=e.name,r=e.attributes.ampLayout,a=e.setAttributes,c=Object(o.__)("AMP Layout","amp");return"core/image"===t&&(c=Object(o.__)("AMP Layout (modifies width/height)","amp")),Object(n.createElement)(i.SelectControl,{label:c,value:r,options:O(t),onChange:function(t){a({ampLayout:t}),"core/image"===e.name&&function(e,t){var r=e.attributes,n=e.setAttributes;switch(t){case"fixed-height":r.height||n({height:u.a}),r.ampLightbox&&n({ampLightbox:!1});break;case"fixed":r.height||n({height:u.a}),r.width||n({width:u.b})}}(e,t)}})},g=function(e){var t=e.attributes.ampNoLoading,r=e.setAttributes,a=Object(o.__)("AMP Noloading","amp");return Object(n.createElement)(i.ToggleControl,{label:a,checked:t,onChange:function(){return r({ampNoLoading:!t})}})},j=function(e){var t=e.isSelected,r=e.attributes,c=e.setAttributes,u=r.ampFitText,s=r.minFont,f=r.maxFont,b=r.height,m=[{name:"small",shortName:Object(o._x)("S","font size","amp"),size:14},{name:"regular",shortName:Object(o._x)("M","font size","amp"),size:16},{name:"large",shortName:Object(o._x)("L","font size","amp"),size:36},{name:"larger",shortName:Object(o._x)("XL","font size","amp"),size:48}];if(!t)return null;var p=Object(o.__)("Automatically fit text to container","amp");return u&&(f=parseInt(f),b=parseInt(b),s=parseInt(s)),Object(n.createElement)(a.InspectorControls,null,Object(n.createElement)(i.PanelBody,{title:Object(o.__)("AMP Settings","amp"),className:u?"is-amp-fit-text":""},Object(n.createElement)(i.ToggleControl,{label:p,checked:u,onChange:function(){return c({ampFitText:!u})}})),u&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(i.TextControl,{label:Object(o.__)("Height","amp"),value:b,min:1,onChange:function(e){c({height:e})}}),f>b&&Object(n.createElement)(i.Notice,{status:"error",isDismissible:!1},Object(o.__)("The height must be greater than the max font size.","amp")),Object(n.createElement)(i.PanelBody,{title:Object(o.__)("Minimum font size","amp")},Object(n.createElement)(i.FontSizePicker,{fallbackFontSize:14,value:s,fontSizes:m,onChange:function(e){e||(e=l.c),parseInt(e)<=f&&c({minFont:e})}})),s>f&&Object(n.createElement)(i.Notice,{status:"error",isDismissible:!1},Object(o.__)("The min font size must less than the max font size.","amp")),Object(n.createElement)(i.PanelBody,{title:Object(o.__)("Maximum font size","amp")},Object(n.createElement)(i.FontSizePicker,{fallbackFontSize:48,value:f,fontSizes:m,onChange:function(e){e||(e=l.b),c({maxFont:e,height:Math.max(e,b)})}}))))},_=function(e){var t=e.attributes,r=t.ampLightbox,a=t.linkTo,c=t.ampLayout,u=e.setAttributes;return Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Add lightbox effect","amp"),checked:r,onChange:function(e){u({ampLightbox:!r}),e&&("fixed-height"===c&&u({ampLayout:"fixed"}),a&&"none"!==a&&u({linkTo:"none"}))}})},E=function(e){var t=e.attributes.ampCarousel,r=e.setAttributes;return Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Display as carousel","amp"),checked:t,onChange:function(){return r({ampCarousel:!t})}})},w=function(e){return e.isSelected?Object(n.createElement)(a.InspectorControls,null,Object(n.createElement)(i.PanelBody,{title:Object(o.__)("AMP Settings","amp")},Object(n.createElement)(y,e),Object(n.createElement)(g,e),Object(n.createElement)(_,e))):null},x=function(e){return e.isSelected?Object(n.createElement)(a.InspectorControls,null,Object(n.createElement)(i.PanelBody,{title:Object(o.__)("AMP Settings","amp")},Object(n.createElement)(E,e),Object(n.createElement)(_,e))):null},P=function(){return(0,Object(c.select)("core/editor").getEditedPostAttribute)("amp_enabled")||!1}},,function(e,t){!function(){e.exports=this.wp.hooks}()},,,,function(e,t){!function(){e.exports=this.React}()},,,,,,function(e,t,r){"use strict";var n=r(29);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,i,a){if(a!==n){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return r.PropTypes=r,r}},function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,r){"use strict";var n={};r.r(n),r.d(n,"hasThemeSupport",(function(){return c})),r.d(n,"isStandardMode",(function(){return u})),r.d(n,"getErrorMessages",(function(){return l})),r.d(n,"getAmpSlug",(function(){return s}));var o=r(9),i=r.n(o),a=r(3);function c(e){return Boolean(e.hasThemeSupport)}function u(e){return Boolean(e.isStandardMode)}function l(e){return e.errorMessages}function s(e){return e.ampSlug}function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}Object(a.registerStore)("amp/block-editor",{reducer:function(e){return e},selectors:n,initialState:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},window.ampBlockEditor)})},,function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}},,,,function(e,t,r){var n=r(46),o=r(47),i=r(48),a=r(49);e.exports=function(e){return n(e)||o(e)||i(e)||a()}},,,,,,,,,function(e,t,r){},function(e,t,r){var n=r(32);e.exports=function(e){if(Array.isArray(e))return n(e)}},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},function(e,t,r){var n=r(32);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t,r){"use strict";r.r(t);var n={};r.r(n),r.d(n,"addValidationError",(function(){return A})),r.d(n,"resetValidationErrors",(function(){return T})),r.d(n,"updateReviewLink",(function(){return I}));var o={};r.r(o),r.d(o,"getValidationErrors",(function(){return D})),r.d(o,"getBlockValidationErrors",(function(){return L})),r.d(o,"getReviewLink",(function(){return C})),r.d(o,"isSanitizationAutoAccepted",(function(){return M}));var i=r(18),a=r(3),c=r(16),u=r(9),l=r.n(u),s=r(12),f=r(1);function b(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return m(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var O=function(){var e=Object(a.select)("core/notices").getNotices,t=Object(a.dispatch)("core/notices").removeNotice;e().filter((function(e){return"amp-errors-notice"===e.id}))&&t("amp-errors-notice")},h=[],v=function(){var e,t=Object(a.select)("amp/block-validation"),r=t.getValidationErrors,n=t.getReviewLink,o=Object(a.dispatch)("core/notices").createWarningNotice,i=r(),c=i.length;e=Object(f.sprintf)(
2
  /* translators: %s: number of issues */
3
  Object(f._n)("There is %s issue from AMP validation which needs review.","There are %s issues from AMP validation which need review.",c,"amp"),c);var u=i.filter((function(e){return e.clientId})),l=u.length;l>0?e+=" "+Object(f.sprintf)(
4
  /* translators: %s: number of block errors. */
1
+ !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=50)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t){!function(){e.exports=this.wp.blockEditor}()},function(e,t,r){e.exports=r(28)()},,function(e,t,r){"use strict";r.d(t,"e",(function(){return n})),r.d(t,"c",(function(){return o})),r.d(t,"b",(function(){return i})),r.d(t,"a",(function(){return a})),r.d(t,"d",(function(){return c}));var n=["core/paragraph","core/heading","core/code","core/quote","core/subhead"],o=["core/image","core/video"],i=608,a=400,c="editor-post-preview"},,function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},,function(e,t,r){"use strict";r.d(t,"c",(function(){return n})),r.d(t,"b",(function(){return o})),r.d(t,"a",(function(){return i}));var n=6,o=72,i="select-file-type-error"},function(e,t){!function(){e.exports=this.lodash}()},function(e,t){!function(){e.exports=this.wp.compose}()},,,function(e,t,r){"use strict";r.d(t,"a",(function(){return m})),r.d(t,"c",(function(){return p})),r.d(t,"b",(function(){return h})),r.d(t,"d",(function(){return P}));var n=r(0),o=(r(5),r(22),r(1)),i=r(2),a=r(4),c=r(3),u=r(7),l=r(11);function s(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var b=[{value:"nodisplay",label:Object(o.__)("No Display","amp"),notAvailable:["core-embed/vimeo","core-embed/dailymotion","core-embed/reddit","core-embed/soundcloud"]},{value:"fixed",label:Object(o.__)("Fixed","amp"),notAvailable:["core-embed/soundcloud"]},{value:"responsive",label:Object(o.__)("Responsive","amp"),notAvailable:["core-embed/soundcloud"]},{value:"fixed-height",label:Object(o.__)("Fixed Height","amp"),notAvailable:[]},{value:"fill",label:Object(o.__)("Fill","amp"),notAvailable:["core-embed/soundcloud"]},{value:"flex-item",label:Object(o.__)("Flex Item","amp"),notAvailable:["core-embed/soundcloud"]},{value:"intrinsic",label:Object(o.__)("Intrinsic","amp"),notAvailable:["core-embed/youtube","core-embed/facebook","core-embed/instagram","core-embed/vimeo","core-embed/dailymotion","core-embed/reddit","core-embed/soundcloud"]}],m=function(e,t){return"core/gallery"===t&&(e.attributes||(e.attributes={}),e.attributes.ampCarousel={type:"boolean",default:!Object(c.select)("amp/block-editor").hasThemeSupport()},e.attributes.ampLightbox={type:"boolean",default:!1}),"core/image"===t&&(e.attributes||(e.attributes={}),e.attributes.ampLightbox={type:"boolean",default:!1}),u.e.includes(t)&&(e.attributes||(e.attributes={}),e.attributes.ampFitText={type:"boolean",default:!1},e.attributes.minFont={default:l.c,source:"attribute",selector:"amp-fit-text",attribute:"min-font-size"},e.attributes.maxFont={default:l.b,source:"attribute",selector:"amp-fit-text",attribute:"max-font-size"},e.attributes.height={default:"core/image"===t?200:10*Math.ceil(l.b/10),source:"attribute",selector:"amp-fit-text",attribute:"height"}),(0===t.indexOf("core-embed")||u.c.includes(t))&&(e.attributes||(e.attributes={}),e.attributes.ampLayout={type:"string"},e.attributes.ampNoLoading={type:"boolean"}),e},p=function(e,t,r){var o={layout:"fixed-height"};if("core/paragraph"!==t.name||r.ampFitText){if(u.e.includes(t.name)&&r.ampFitText)return r.minFont&&(o["min-font-size"]=r.minFont),r.maxFont&&(o["max-font-size"]=r.maxFont),r.height&&(o.height=r.height),o.children=e,Object(n.createElement)("amp-fit-text",o)}else{var i=d(r.content);if(i!==r.content)return Object(n.cloneElement)(e,{key:"new",value:i})}return e},d=function(e){var t=/<amp-fit-text\b[^>]*>(.*?)<\/amp-fit-text>/.exec(e),r=e;return t&&t[1]&&(r=t[1]),r},O=function(e){var t,r=[{value:"",label:Object(o.__)("Default","amp")}],n=s(b);try{for(n.s();!(t=n.n()).done;){var i=t.value;!i.notAvailable.includes(e)&&r.push({value:i.value,label:i.label})}}catch(e){n.e(e)}finally{n.f()}return r},h=function(e){return function(t){var r,o=t.attributes.ampLayout,i=t.name;return"core/gallery"===i?r=x(t):"core/image"===i?r=w(t):u.c.includes(i)||0===i.indexOf("core-embed/")?r=v(t):u.e.includes(i)&&(r=j(t)),o&&"nodisplay"===o?[r]:Object(n.createElement)(n.Fragment,null,Object(n.createElement)(e,t),r)}},v=function(e){return e.isSelected?Object(n.createElement)(a.InspectorControls,null,Object(n.createElement)(i.PanelBody,{title:Object(o.__)("AMP Settings","amp")},Object(n.createElement)(y,e),Object(n.createElement)(g,e))):null},y=function(e){var t=e.name,r=e.attributes.ampLayout,a=e.setAttributes,c=Object(o.__)("AMP Layout","amp");return"core/image"===t&&(c=Object(o.__)("AMP Layout (modifies width/height)","amp")),Object(n.createElement)(i.SelectControl,{label:c,value:r,options:O(t),onChange:function(t){a({ampLayout:t}),"core/image"===e.name&&function(e,t){var r=e.attributes,n=e.setAttributes;switch(t){case"fixed-height":r.height||n({height:u.a}),r.ampLightbox&&n({ampLightbox:!1});break;case"fixed":r.height||n({height:u.a}),r.width||n({width:u.b})}}(e,t)}})},g=function(e){var t=e.attributes.ampNoLoading,r=e.setAttributes,a=Object(o.__)("AMP Noloading","amp");return Object(n.createElement)(i.ToggleControl,{label:a,checked:t,onChange:function(){return r({ampNoLoading:!t})}})},j=function(e){var t=e.isSelected,r=e.attributes,c=e.setAttributes,u=r.ampFitText,s=r.minFont,f=r.maxFont,b=r.height,m=[{name:"small",shortName:Object(o._x)("S","font size","amp"),size:14},{name:"regular",shortName:Object(o._x)("M","font size","amp"),size:16},{name:"large",shortName:Object(o._x)("L","font size","amp"),size:36},{name:"larger",shortName:Object(o._x)("XL","font size","amp"),size:48}];if(!t)return null;var p=Object(o.__)("Automatically fit text to container","amp");return u&&(f=parseInt(f),b=parseInt(b),s=parseInt(s)),Object(n.createElement)(a.InspectorControls,null,Object(n.createElement)(i.PanelBody,{title:Object(o.__)("AMP Settings","amp"),className:u?"is-amp-fit-text":""},Object(n.createElement)(i.ToggleControl,{label:p,checked:u,onChange:function(){return c({ampFitText:!u})}})),u&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(i.TextControl,{label:Object(o.__)("Height","amp"),value:b,min:1,onChange:function(e){c({height:e})}}),f>b&&Object(n.createElement)(i.Notice,{status:"error",isDismissible:!1},Object(o.__)("The height must be greater than the max font size.","amp")),Object(n.createElement)(i.PanelBody,{title:Object(o.__)("Minimum font size","amp")},Object(n.createElement)(i.FontSizePicker,{fallbackFontSize:14,value:s,fontSizes:m,onChange:function(e){e||(e=l.c),parseInt(e)<=f&&c({minFont:e})}})),s>f&&Object(n.createElement)(i.Notice,{status:"error",isDismissible:!1},Object(o.__)("The min font size must less than the max font size.","amp")),Object(n.createElement)(i.PanelBody,{title:Object(o.__)("Maximum font size","amp")},Object(n.createElement)(i.FontSizePicker,{fallbackFontSize:48,value:f,fontSizes:m,onChange:function(e){e||(e=l.b),c({maxFont:e,height:Math.max(e,b)})}}))))},_=function(e){var t=e.attributes,r=t.ampLightbox,a=t.linkTo,c=t.ampLayout,u=e.setAttributes;return Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Add lightbox effect","amp"),checked:r,onChange:function(e){u({ampLightbox:!r}),e&&("fixed-height"===c&&u({ampLayout:"fixed"}),a&&"none"!==a&&u({linkTo:"none"}))}})},E=function(e){var t=e.attributes.ampCarousel,r=e.setAttributes;return Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Display as carousel","amp"),checked:t,onChange:function(){return r({ampCarousel:!t})}})},w=function(e){return e.isSelected?Object(n.createElement)(a.InspectorControls,null,Object(n.createElement)(i.PanelBody,{title:Object(o.__)("AMP Settings","amp")},Object(n.createElement)(y,e),Object(n.createElement)(g,e),Object(n.createElement)(_,e))):null},x=function(e){return e.isSelected?Object(n.createElement)(a.InspectorControls,null,Object(n.createElement)(i.PanelBody,{title:Object(o.__)("AMP Settings","amp")},Object(n.createElement)(E,e),Object(n.createElement)(_,e))):null},P=function(){return(0,Object(c.select)("core/editor").getEditedPostAttribute)("amp_enabled")||!1}},,function(e,t){!function(){e.exports=this.wp.hooks}()},,,,function(e,t){!function(){e.exports=this.React}()},,,,,,function(e,t,r){"use strict";var n=r(29);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,i,a){if(a!==n){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return r.PropTypes=r,r}},function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,r){"use strict";var n={};r.r(n),r.d(n,"hasThemeSupport",(function(){return c})),r.d(n,"isStandardMode",(function(){return u})),r.d(n,"getErrorMessages",(function(){return l})),r.d(n,"getAmpSlug",(function(){return s}));var o=r(9),i=r.n(o),a=r(3);function c(e){return Boolean(e.hasThemeSupport)}function u(e){return Boolean(e.isStandardMode)}function l(e){return e.errorMessages}function s(e){return e.ampSlug}function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}Object(a.registerStore)("amp/block-editor",{reducer:function(e){return e},selectors:n,initialState:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},window.ampBlockEditor)})},,function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}},,,,function(e,t,r){var n=r(46),o=r(47),i=r(48),a=r(49);e.exports=function(e){return n(e)||o(e)||i(e)||a()}},,,,,,,,,function(e,t,r){},function(e,t,r){var n=r(32);e.exports=function(e){if(Array.isArray(e))return n(e)}},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},function(e,t,r){var n=r(32);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t,r){"use strict";r.r(t);var n={};r.r(n),r.d(n,"addValidationError",(function(){return A})),r.d(n,"resetValidationErrors",(function(){return T})),r.d(n,"updateReviewLink",(function(){return I}));var o={};r.r(o),r.d(o,"getValidationErrors",(function(){return D})),r.d(o,"getBlockValidationErrors",(function(){return L})),r.d(o,"getReviewLink",(function(){return C})),r.d(o,"isSanitizationAutoAccepted",(function(){return M}));var i=r(18),a=r(3),c=r(16),u=r(9),l=r.n(u),s=r(12),f=r(1);function b(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return m(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var O=function(){var e=Object(a.select)("core/notices").getNotices,t=Object(a.dispatch)("core/notices").removeNotice;e().filter((function(e){return"amp-errors-notice"===e.id}))&&t("amp-errors-notice")},h=[],v=function(){var e,t=Object(a.select)("amp/block-validation"),r=t.getValidationErrors,n=t.getReviewLink,o=Object(a.dispatch)("core/notices").createWarningNotice,i=r(),c=i.length;e=Object(f.sprintf)(
2
  /* translators: %s: number of issues */
3
  Object(f._n)("There is %s issue from AMP validation which needs review.","There are %s issues from AMP validation which need review.",c,"amp"),c);var u=i.filter((function(e){return e.clientId})),l=u.length;l>0?e+=" "+Object(f.sprintf)(
4
  /* translators: %s: number of block errors. */
assets/js/mobile-redirection.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('wp-polyfill'), 'version' => 'cec55caf46598b1234364cdaee8207e3');
1
+ <?php return array('dependencies' => array('wp-polyfill'), 'version' => '8f22d53bf105f94174f5f13bc5a7e517');
assets/js/mobile-redirection.js CHANGED
@@ -1 +1 @@
1
- !function(e){var n={};function r(t){if(n[t])return n[t].exports;var o=n[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=n,r.d=function(e,n,t){r.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,n){if(1&n&&(e=r(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(r.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)r.d(t,o,function(n){return e[n]}.bind(null,o));return t},r.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(n,"a",n),n},r.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},r.p="",r(r.s=0)}([function(e,n){!function(e){var n=e.ampUrl,r=e.isCustomizePreview,t=e.isAmpDevMode,o=e.noampQueryVarName,i=e.noampQueryVarValue,a=e.disabledStorageKey,u=e.mobileUserAgents,s=e.regexRegex;if("undefined"!=typeof sessionStorage){var c=new RegExp(s);if(u.some((function(e){var n=e.match(c);if(n&&new RegExp(n[1],n[2]).test(navigator.userAgent))return!0;return navigator.userAgent.includes(e)}))){document.addEventListener("DOMContentLoaded",(function(){var e=document.getElementById("amp-mobile-version-switcher");if(e){e.hidden=!1;var n=e.querySelector("a[href]");n&&n.addEventListener("click",(function(){sessionStorage.removeItem(a)}))}}));var f=t&&["paired-browsing-non-amp","paired-browsing-amp"].includes(window.name);if(!(sessionStorage.getItem(a)||r||f)){var d=new URL(location.href);d.searchParams.has(o)&&i===d.searchParams.get(o)?sessionStorage.setItem(a,"1"):(window.stop(),location.replace(n))}}}}(AMP_MOBILE_REDIRECTION)}]);
1
+ !function(e){var r={};function n(t){if(r[t])return r[t].exports;var o=r[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=r,n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,r){if(1&r&&(e=n(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(n.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)n.d(t,o,function(r){return e[r]}.bind(null,o));return t},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},n.p="",n(n.s=0)}([function(e,r){!function(e){var r=e.ampUrl,n=e.isCustomizePreview,t=e.isAmpDevMode,o=e.noampQueryVarName,a=e.noampQueryVarValue,i=e.disabledStorageKey,u=e.mobileUserAgents,s=e.regexRegex;if("undefined"!=typeof sessionStorage){var f=new RegExp(s);if(u.some((function(e){var r=e.match(f);if(r&&new RegExp(r[1],r[2]).test(navigator.userAgent))return!0;return navigator.userAgent.includes(e)}))){document.addEventListener("DOMContentLoaded",(function(){var e=document.getElementById("amp-mobile-version-switcher");if(e){e.hidden=!1;var r=e.querySelector("a[href]");r&&r.addEventListener("click",(function(){sessionStorage.removeItem(i)}))}}));var c=t&&["paired-browsing-non-amp","paired-browsing-amp"].includes(window.name);if(!(sessionStorage.getItem(i)||n||c)){var d=new URL(location.href),l=new URL(r);l.hash=d.hash,d.searchParams.has(o)&&a===d.searchParams.get(o)?sessionStorage.setItem(i,"1"):l.href!==d.href&&(window.stop(),location.replace(l.href))}}}}(AMP_MOBILE_REDIRECTION)}]);
includes/admin/class-amp-template-customizer.php CHANGED
@@ -553,7 +553,7 @@ class AMP_Template_Customizer {
553
  <li id="accordion-section-{{ data.id }}" class="accordion-section control-section control-section-{{ data.type }}">
554
  <h3 class="accordion-section-title">
555
  <button type="button" class="button button-secondary" aria-label="<?php esc_attr_e( 'Import settings', 'amp' ); ?>">
556
- <?php echo esc_html( _ex( 'Import', 'theme', 'amp' ) ); ?>
557
  </button>
558
  <details>
559
  <summary>{{ data.title }}</summary>
553
  <li id="accordion-section-{{ data.id }}" class="accordion-section control-section control-section-{{ data.type }}">
554
  <h3 class="accordion-section-title">
555
  <button type="button" class="button button-secondary" aria-label="<?php esc_attr_e( 'Import settings', 'amp' ); ?>">
556
+ <?php echo esc_html( _x( 'Import', 'theme', 'amp' ) ); ?>
557
  </button>
558
  <details>
559
  <summary>{{ data.title }}</summary>
includes/amp-helper-functions.php CHANGED
@@ -325,42 +325,35 @@ function amp_correct_query_when_is_front_page( WP_Query $query ) {
325
  *
326
  * Themes can register support for this with `add_theme_support( AMP_Theme_Support::SLUG )`:
327
  *
328
- * add_theme_support( AMP_Theme_Support::SLUG );
 
 
329
  *
330
  * This will serve templates in AMP-first, allowing you to use AMP components in your theme templates.
331
  * If you want to make available in transitional mode, where templates are served in AMP or non-AMP documents, do:
332
  *
333
- * add_theme_support( AMP_Theme_Support::SLUG, array(
334
- * 'paired' => true,
335
- * ) );
 
 
336
  *
337
- * Transitional mode is also implied if you define a template_dir:
338
  *
339
- * add_theme_support( AMP_Theme_Support::SLUG, array(
340
- * 'template_dir' => 'amp',
341
- * ) );
 
 
342
  *
343
  * If you want to have AMP-specific templates in addition to serving AMP-first, do:
344
  *
345
- * add_theme_support( AMP_Theme_Support::SLUG, array(
346
- * 'paired' => false,
347
- * 'template_dir' => 'amp',
348
- * ) );
349
- *
350
- * If you want to force AMP to always be served on a given template, you can use the templates_supported arg,
351
- * for example to always serve the Category template in AMP:
352
- *
353
- * add_theme_support( AMP_Theme_Support::SLUG, array(
354
- * 'templates_supported' => array(
355
- * 'is_category' => true,
356
- * ),
357
- * ) );
358
- *
359
- * Or if you want to force AMP to be used on all templates:
360
- *
361
- * add_theme_support( AMP_Theme_Support::SLUG, array(
362
- * 'templates_supported' => 'all',
363
- * ) );
364
  *
365
  * @see AMP_Theme_Support::read_theme_support()
366
  * @return boolean Whether this is in AMP 'canonical' mode, that is whether it is AMP-first and there is not a separate (paired) AMP URL.
@@ -1450,7 +1443,7 @@ function amp_get_content_embed_handlers( $post = null ) {
1450
  /**
1451
  * Determine whether AMP dev mode is enabled.
1452
  *
1453
- * When enabled, the <html> element will get the data-ampdevmode attribute and the plugin will add the same attribute
1454
  * to elements associated with the admin bar and other elements that are provided by the `amp_dev_mode_element_xpaths`
1455
  * filter.
1456
  *
@@ -1468,7 +1461,7 @@ function amp_is_dev_mode() {
1468
  * queries for the expressions returned by the 'amp_dev_mode_element_xpaths' filter.
1469
  *
1470
  * @since 1.3
1471
- * @param bool Whether AMP dev mode is enabled.
1472
  */
1473
  return apply_filters(
1474
  'amp_dev_mode_enabled',
325
  *
326
  * Themes can register support for this with `add_theme_support( AMP_Theme_Support::SLUG )`:
327
  *
328
+ * ```php
329
+ * add_theme_support( AMP_Theme_Support::SLUG );
330
+ * ```
331
  *
332
  * This will serve templates in AMP-first, allowing you to use AMP components in your theme templates.
333
  * If you want to make available in transitional mode, where templates are served in AMP or non-AMP documents, do:
334
  *
335
+ * ```php
336
+ * add_theme_support( AMP_Theme_Support::SLUG, array(
337
+ * 'paired' => true,
338
+ * ) );
339
+ * ```
340
  *
341
+ * Transitional mode is also implied if you define a `template_dir`:
342
  *
343
+ * ```php
344
+ * add_theme_support( AMP_Theme_Support::SLUG, array(
345
+ * 'template_dir' => 'amp',
346
+ * ) );
347
+ * ```
348
  *
349
  * If you want to have AMP-specific templates in addition to serving AMP-first, do:
350
  *
351
+ * ```php
352
+ * add_theme_support( AMP_Theme_Support::SLUG, array(
353
+ * 'paired' => false,
354
+ * 'template_dir' => 'amp',
355
+ * ) );
356
+ * ```
 
 
 
 
 
 
 
 
 
 
 
 
 
357
  *
358
  * @see AMP_Theme_Support::read_theme_support()
359
  * @return boolean Whether this is in AMP 'canonical' mode, that is whether it is AMP-first and there is not a separate (paired) AMP URL.
1443
  /**
1444
  * Determine whether AMP dev mode is enabled.
1445
  *
1446
+ * When enabled, the `<html>` element will get the data-ampdevmode attribute and the plugin will add the same attribute
1447
  * to elements associated with the admin bar and other elements that are provided by the `amp_dev_mode_element_xpaths`
1448
  * filter.
1449
  *
1461
  * queries for the expressions returned by the 'amp_dev_mode_element_xpaths' filter.
1462
  *
1463
  * @since 1.3
1464
+ * @param bool $is_dev_mode_enabled Whether AMP dev mode is enabled.
1465
  */
1466
  return apply_filters(
1467
  'amp_dev_mode_enabled',
includes/sanitizers/class-amp-allowed-tags-generated.php CHANGED
@@ -15,7 +15,7 @@
15
  */
16
  class AMP_Allowed_Tags_Generated {
17
 
18
- private static $spec_file_revision = 1095;
19
  private static $minimum_validator_revision_required = 475;
20
 
21
  private static $descendant_tag_lists = array(
@@ -246,7 +246,6 @@ class AMP_Allowed_Tags_Generated {
246
  'amp-fit-text',
247
  'amp-font',
248
  'amp-gist',
249
- 'amp-google-vrview-image',
250
  'amp-img',
251
  'amp-install-serviceworker',
252
  'amp-list',
@@ -258,6 +257,7 @@ class AMP_Allowed_Tags_Generated {
258
  'amp-story-interactive-poll',
259
  'amp-story-interactive-quiz',
260
  'amp-story-interactive-results',
 
261
  'amp-timeago',
262
  'amp-twitter',
263
  'amp-video',
@@ -404,7 +404,6 @@ class AMP_Allowed_Tags_Generated {
404
  'amp-gfycat',
405
  'amp-gist',
406
  'amp-google-document-embed',
407
- 'amp-google-vrview-image',
408
  'amp-hulu',
409
  'amp-ima-video',
410
  'amp-image-slider',
@@ -555,6 +554,10 @@ class AMP_Allowed_Tags_Generated {
555
  'vkern',
556
  'wbr',
557
  ),
 
 
 
 
558
  );
559
 
560
  private static $allowed_tags = array(
@@ -1480,6 +1483,7 @@ class AMP_Allowed_Tags_Generated {
1480
  '',
1481
  ),
1482
  ),
 
1483
  'query' => array(),
1484
  'src' => array(
1485
  'value_url' => array(
@@ -2272,6 +2276,11 @@ class AMP_Allowed_Tags_Generated {
2272
  'seconds',
2273
  ),
2274
  ),
 
 
 
 
 
2275
  'end-date' => array(
2276
  'value_regex' => '\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d(:[0-5]\\d(\\.\\d+)?)?(Z|[+-][0-1][0-9]:[0-5][0-9])',
2277
  ),
@@ -3905,7 +3914,7 @@ class AMP_Allowed_Tags_Generated {
3905
  ),
3906
  ),
3907
  'data-media-id' => array(
3908
- 'value_regex_casei' => '[0-9a-z]{8}',
3909
  ),
3910
  'data-player-id' => array(
3911
  'mandatory' => true,
@@ -4707,6 +4716,37 @@ class AMP_Allowed_Tags_Generated {
4707
  ),
4708
  ),
4709
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4710
  'amp-ooyala-player' => array(
4711
  array(
4712
  'attr_spec_list' => array(
@@ -5764,6 +5804,11 @@ class AMP_Allowed_Tags_Generated {
5764
  'amp-story-360' => array(
5765
  array(
5766
  'attr_spec_list' => array(
 
 
 
 
 
5767
  'duration' => array(
5768
  'value_regex' => '([0-9\\.]+)\\s*(s|ms)',
5769
  ),
@@ -5779,6 +5824,15 @@ class AMP_Allowed_Tags_Generated {
5779
  'pitch-start' => array(
5780
  'value_regex' => '-?\\d+\\.?\\d*',
5781
  ),
 
 
 
 
 
 
 
 
 
5782
  'zoom-end' => array(
5783
  'value_regex' => '\\d+\\.?\\d*',
5784
  ),
@@ -5794,12 +5848,12 @@ class AMP_Allowed_Tags_Generated {
5794
  3,
5795
  7,
5796
  1,
5797
- 4,
5798
  ),
5799
  ),
5800
  'child_tags' => array(
5801
  'child_tag_name_oneof' => array(
5802
  'amp-img',
 
5803
  ),
5804
  'mandatory_num_child_tags' => 1,
5805
  ),
@@ -6152,21 +6206,39 @@ class AMP_Allowed_Tags_Generated {
6152
  'amp-story-interactive-results' => array(
6153
  array(
6154
  'attr_spec_list' => array(
 
 
 
 
 
 
6155
  'option-1-image' => array(),
6156
  'option-1-results-category' => array(
6157
  'mandatory' => true,
6158
  ),
 
 
 
6159
  'option-1-text' => array(),
6160
  'option-2-image' => array(),
6161
  'option-2-results-category' => array(
6162
  'mandatory' => true,
6163
  ),
 
 
 
6164
  'option-2-text' => array(),
6165
  'option-3-image' => array(),
6166
  'option-3-results-category' => array(),
 
 
 
6167
  'option-3-text' => array(),
6168
  'option-4-image' => array(),
6169
  'option-4-results-category' => array(),
 
 
 
6170
  'option-4-text' => array(),
6171
  'prompt-text' => array(),
6172
  'theme' => array(
@@ -6276,6 +6348,23 @@ class AMP_Allowed_Tags_Generated {
6276
  ),
6277
  ),
6278
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6279
  'amp-story-player' => array(
6280
  array(
6281
  'attr_spec_list' => array(),
@@ -6286,15 +6375,11 @@ class AMP_Allowed_Tags_Generated {
6286
  2,
6287
  3,
6288
  7,
6289
- 9,
6290
  4,
 
6291
  ),
6292
  ),
6293
- 'child_tags' => array(
6294
- 'child_tag_name_oneof' => array(
6295
- 'a',
6296
- ),
6297
- ),
6298
  'requires_extension' => array(
6299
  'amp-story-player',
6300
  ),
@@ -6578,6 +6663,7 @@ class AMP_Allowed_Tags_Generated {
6578
  2,
6579
  3,
6580
  7,
 
6581
  1,
6582
  4,
6583
  ),
@@ -6691,6 +6777,7 @@ class AMP_Allowed_Tags_Generated {
6691
  2,
6692
  3,
6693
  7,
 
6694
  1,
6695
  4,
6696
  ),
@@ -9581,7 +9668,6 @@ class AMP_Allowed_Tags_Generated {
9581
  'disallowed_value_regex' => '__amp_source_origin',
9582
  'mandatory' => true,
9583
  'value_url' => array(
9584
- 'allow_relative' => true,
9585
  'protocol' => array(
9586
  'data',
9587
  'http',
@@ -9594,6 +9680,7 @@ class AMP_Allowed_Tags_Generated {
9594
  'tag_spec' => array(
9595
  'mandatory_ancestor' => 'noscript',
9596
  'mandatory_ancestor_suggested_alternative' => 'amp-img',
 
9597
  'spec_url' => 'https://amp.dev/documentation/components/amp-img/',
9598
  ),
9599
  ),
@@ -12380,9 +12467,9 @@ class AMP_Allowed_Tags_Generated {
12380
  ),
12381
  ),
12382
  'tag_spec' => array(
12383
- 'mandatory_alternatives' => 'amphtml engine v0.js script',
12384
  'mandatory_parent' => 'head',
12385
- 'spec_name' => 'amphtml engine v0.js script',
12386
  'spec_url' => 'https://amp.dev/documentation/guides-and-tutorials/learn/spec/amphtml/#required-markup',
12387
  'unique' => true,
12388
  ),
@@ -12423,9 +12510,9 @@ class AMP_Allowed_Tags_Generated {
12423
  ),
12424
  ),
12425
  'tag_spec' => array(
12426
- 'mandatory_alternatives' => 'amphtml engine v0.js script',
12427
  'mandatory_parent' => 'head',
12428
- 'spec_name' => 'amphtml engine v0.js lts script',
12429
  'spec_url' => 'https://amp.dev/documentation/guides-and-tutorials/learn/spec/amphtml/#required-markup',
12430
  'unique' => true,
12431
  ),
@@ -12819,7 +12906,6 @@ class AMP_Allowed_Tags_Generated {
12819
  '0.1',
12820
  ),
12821
  ),
12822
- 'spec_name' => 'amp-ad-custom extension .js script',
12823
  ),
12824
  ),
12825
  array(
@@ -12850,7 +12936,7 @@ class AMP_Allowed_Tags_Generated {
12850
  '0.1',
12851
  ),
12852
  ),
12853
- 'spec_name' => 'amp-ad extension .js script',
12854
  ),
12855
  ),
12856
  array(
@@ -15213,6 +15299,36 @@ class AMP_Allowed_Tags_Generated {
15213
  ),
15214
  ),
15215
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15216
  array(
15217
  'attr_spec_list' => array(
15218
  'async' => array(
@@ -15996,7 +16112,37 @@ class AMP_Allowed_Tags_Generated {
15996
  'name' => 'amp-story-interactive',
15997
  'requires_usage' => true,
15998
  'version' => array(
15999
- '1.0',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16000
  ),
16001
  ),
16002
  ),
@@ -16461,7 +16607,6 @@ class AMP_Allowed_Tags_Generated {
16461
  '0.1',
16462
  ),
16463
  ),
16464
- 'spec_name' => 'amp-video-docking',
16465
  ),
16466
  ),
16467
  array(
@@ -16522,7 +16667,7 @@ class AMP_Allowed_Tags_Generated {
16522
  '0.1',
16523
  ),
16524
  ),
16525
- 'spec_name' => 'amp-video extension .js script',
16526
  ),
16527
  ),
16528
  array(
@@ -16789,6 +16934,11 @@ class AMP_Allowed_Tags_Generated {
16789
  ),
16790
  array(
16791
  'attr_spec_list' => array(
 
 
 
 
 
16792
  'data-amp-bind-data-expand' => array(),
16793
  'expanded' => array(
16794
  'value' => array(
15
  */
16
  class AMP_Allowed_Tags_Generated {
17
 
18
+ private static $spec_file_revision = 1132;
19
  private static $minimum_validator_revision_required = 475;
20
 
21
  private static $descendant_tag_lists = array(
246
  'amp-fit-text',
247
  'amp-font',
248
  'amp-gist',
 
249
  'amp-img',
250
  'amp-install-serviceworker',
251
  'amp-list',
257
  'amp-story-interactive-poll',
258
  'amp-story-interactive-quiz',
259
  'amp-story-interactive-results',
260
+ 'amp-story-panning-media',
261
  'amp-timeago',
262
  'amp-twitter',
263
  'amp-video',
404
  'amp-gfycat',
405
  'amp-gist',
406
  'amp-google-document-embed',
 
407
  'amp-hulu',
408
  'amp-ima-video',
409
  'amp-image-slider',
554
  'vkern',
555
  'wbr',
556
  ),
557
+ 'amp-story-player-allowed-descendants' => array(
558
+ 'a',
559
+ 'span',
560
+ ),
561
  );
562
 
563
  private static $allowed_tags = array(
1483
  '',
1484
  ),
1485
  ),
1486
+ 'prefetch' => array(),
1487
  'query' => array(),
1488
  'src' => array(
1489
  'value_url' => array(
2276
  'seconds',
2277
  ),
2278
  ),
2279
+ 'data-count-up' => array(
2280
+ 'value' => array(
2281
+ '',
2282
+ ),
2283
+ ),
2284
  'end-date' => array(
2285
  'value_regex' => '\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d(:[0-5]\\d(\\.\\d+)?)?(Z|[+-][0-1][0-9]:[0-5][0-9])',
2286
  ),
3914
  ),
3915
  ),
3916
  'data-media-id' => array(
3917
+ 'value_regex_casei' => '[0-9a-z]{8}|outstream',
3918
  ),
3919
  'data-player-id' => array(
3920
  'mandatory' => true,
4716
  ),
4717
  ),
4718
  ),
4719
+ 'amp-onetap-google' => array(
4720
+ array(
4721
+ 'attr_spec_list' => array(
4722
+ 'data-src' => array(
4723
+ 'mandatory' => true,
4724
+ 'value_url' => array(
4725
+ 'protocol' => array(
4726
+ 'https',
4727
+ ),
4728
+ ),
4729
+ ),
4730
+ 'media' => array(),
4731
+ 'noloading' => array(
4732
+ 'value' => array(
4733
+ '',
4734
+ ),
4735
+ ),
4736
+ ),
4737
+ 'tag_spec' => array(
4738
+ 'amp_layout' => array(
4739
+ 'supported_layouts' => array(
4740
+ 1,
4741
+ ),
4742
+ ),
4743
+ 'requires_extension' => array(
4744
+ 'amp-onetap-google',
4745
+ ),
4746
+ 'unique' => true,
4747
+ ),
4748
+ ),
4749
+ ),
4750
  'amp-ooyala-player' => array(
4751
  array(
4752
  'attr_spec_list' => array(
5804
  'amp-story-360' => array(
5805
  array(
5806
  'attr_spec_list' => array(
5807
+ 'controls' => array(
5808
+ 'value' => array(
5809
+ 'gyroscope',
5810
+ ),
5811
+ ),
5812
  'duration' => array(
5813
  'value_regex' => '([0-9\\.]+)\\s*(s|ms)',
5814
  ),
5824
  'pitch-start' => array(
5825
  'value_regex' => '-?\\d+\\.?\\d*',
5826
  ),
5827
+ 'scene-heading' => array(
5828
+ 'value_regex' => '-?\\d+\\.?\\d*',
5829
+ ),
5830
+ 'scene-pitch' => array(
5831
+ 'value_regex' => '-?\\d+\\.?\\d*',
5832
+ ),
5833
+ 'scene-roll' => array(
5834
+ 'value_regex' => '-?\\d+\\.?\\d*',
5835
+ ),
5836
  'zoom-end' => array(
5837
  'value_regex' => '\\d+\\.?\\d*',
5838
  ),
5848
  3,
5849
  7,
5850
  1,
 
5851
  ),
5852
  ),
5853
  'child_tags' => array(
5854
  'child_tag_name_oneof' => array(
5855
  'amp-img',
5856
+ 'amp-video',
5857
  ),
5858
  'mandatory_num_child_tags' => 1,
5859
  ),
6206
  'amp-story-interactive-results' => array(
6207
  array(
6208
  'attr_spec_list' => array(
6209
+ 'chip-style' => array(
6210
+ 'value' => array(
6211
+ 'flat',
6212
+ 'transparent',
6213
+ ),
6214
+ ),
6215
  'option-1-image' => array(),
6216
  'option-1-results-category' => array(
6217
  'mandatory' => true,
6218
  ),
6219
+ 'option-1-results-threshold' => array(
6220
+ 'value_regex' => '\\d+(\\.\\d+)?',
6221
+ ),
6222
  'option-1-text' => array(),
6223
  'option-2-image' => array(),
6224
  'option-2-results-category' => array(
6225
  'mandatory' => true,
6226
  ),
6227
+ 'option-2-results-threshold' => array(
6228
+ 'value_regex' => '\\d+(\\.\\d+)?',
6229
+ ),
6230
  'option-2-text' => array(),
6231
  'option-3-image' => array(),
6232
  'option-3-results-category' => array(),
6233
+ 'option-3-results-threshold' => array(
6234
+ 'value_regex' => '\\d+(\\.\\d+)?',
6235
+ ),
6236
  'option-3-text' => array(),
6237
  'option-4-image' => array(),
6238
  'option-4-results-category' => array(),
6239
+ 'option-4-results-threshold' => array(
6240
+ 'value_regex' => '\\d+(\\.\\d+)?',
6241
+ ),
6242
  'option-4-text' => array(),
6243
  'prompt-text' => array(),
6244
  'theme' => array(
6348
  ),
6349
  ),
6350
  ),
6351
+ 'amp-story-panning-media' => array(
6352
+ array(
6353
+ 'attr_spec_list' => array(),
6354
+ 'tag_spec' => array(
6355
+ 'amp_layout' => array(
6356
+ 'supported_layouts' => array(
6357
+ 6,
6358
+ ),
6359
+ ),
6360
+ 'mandatory_ancestor' => 'amp-story-grid-layer',
6361
+ 'requires_extension' => array(
6362
+ 'amp-story-panning-media',
6363
+ ),
6364
+ 'spec_url' => 'https://amp.dev/documentation/components/amp-story-panning-media',
6365
+ ),
6366
+ ),
6367
+ ),
6368
  'amp-story-player' => array(
6369
  array(
6370
  'attr_spec_list' => array(),
6375
  2,
6376
  3,
6377
  7,
 
6378
  4,
6379
+ 9,
6380
  ),
6381
  ),
6382
+ 'descendant_tag_list' => 'amp-story-player-allowed-descendants',
 
 
 
 
6383
  'requires_extension' => array(
6384
  'amp-story-player',
6385
  ),
6663
  2,
6664
  3,
6665
  7,
6666
+ 9,
6667
  1,
6668
  4,
6669
  ),
6777
  2,
6778
  3,
6779
  7,
6780
+ 9,
6781
  1,
6782
  4,
6783
  ),
9668
  'disallowed_value_regex' => '__amp_source_origin',
9669
  'mandatory' => true,
9670
  'value_url' => array(
 
9671
  'protocol' => array(
9672
  'data',
9673
  'http',
9680
  'tag_spec' => array(
9681
  'mandatory_ancestor' => 'noscript',
9682
  'mandatory_ancestor_suggested_alternative' => 'amp-img',
9683
+ 'spec_name' => 'noscript > img',
9684
  'spec_url' => 'https://amp.dev/documentation/components/amp-img/',
9685
  ),
9686
  ),
12467
  ),
12468
  ),
12469
  'tag_spec' => array(
12470
+ 'mandatory_alternatives' => 'amphtml engine script',
12471
  'mandatory_parent' => 'head',
12472
+ 'spec_name' => 'amphtml engine script',
12473
  'spec_url' => 'https://amp.dev/documentation/guides-and-tutorials/learn/spec/amphtml/#required-markup',
12474
  'unique' => true,
12475
  ),
12510
  ),
12511
  ),
12512
  'tag_spec' => array(
12513
+ 'mandatory_alternatives' => 'amphtml engine script',
12514
  'mandatory_parent' => 'head',
12515
+ 'spec_name' => 'amphtml engine script (LTS)',
12516
  'spec_url' => 'https://amp.dev/documentation/guides-and-tutorials/learn/spec/amphtml/#required-markup',
12517
  'unique' => true,
12518
  ),
12906
  '0.1',
12907
  ),
12908
  ),
 
12909
  ),
12910
  ),
12911
  array(
12936
  '0.1',
12937
  ),
12938
  ),
12939
+ 'spec_name' => 'amp-ad extension script',
12940
  ),
12941
  ),
12942
  array(
15299
  ),
15300
  ),
15301
  ),
15302
+ array(
15303
+ 'attr_spec_list' => array(
15304
+ 'async' => array(
15305
+ 'mandatory' => true,
15306
+ 'value' => array(
15307
+ '',
15308
+ ),
15309
+ ),
15310
+ 'crossorigin' => array(
15311
+ 'value' => array(
15312
+ 'anonymous',
15313
+ ),
15314
+ ),
15315
+ 'nonce' => array(),
15316
+ 'type' => array(
15317
+ 'value_casei' => array(
15318
+ 'text/javascript',
15319
+ ),
15320
+ ),
15321
+ ),
15322
+ 'tag_spec' => array(
15323
+ 'extension_spec' => array(
15324
+ 'name' => 'amp-onetap-google',
15325
+ 'requires_usage' => true,
15326
+ 'version' => array(
15327
+ '0.1',
15328
+ ),
15329
+ ),
15330
+ ),
15331
+ ),
15332
  array(
15333
  'attr_spec_list' => array(
15334
  'async' => array(
16112
  'name' => 'amp-story-interactive',
16113
  'requires_usage' => true,
16114
  'version' => array(
16115
+ '0.1',
16116
+ ),
16117
+ ),
16118
+ ),
16119
+ ),
16120
+ array(
16121
+ 'attr_spec_list' => array(
16122
+ 'async' => array(
16123
+ 'mandatory' => true,
16124
+ 'value' => array(
16125
+ '',
16126
+ ),
16127
+ ),
16128
+ 'crossorigin' => array(
16129
+ 'value' => array(
16130
+ 'anonymous',
16131
+ ),
16132
+ ),
16133
+ 'nonce' => array(),
16134
+ 'type' => array(
16135
+ 'value_casei' => array(
16136
+ 'text/javascript',
16137
+ ),
16138
+ ),
16139
+ ),
16140
+ 'tag_spec' => array(
16141
+ 'extension_spec' => array(
16142
+ 'name' => 'amp-story-panning-media',
16143
+ 'requires_usage' => true,
16144
+ 'version' => array(
16145
+ '0.1',
16146
  ),
16147
  ),
16148
  ),
16607
  '0.1',
16608
  ),
16609
  ),
 
16610
  ),
16611
  ),
16612
  array(
16667
  '0.1',
16668
  ),
16669
  ),
16670
+ 'spec_name' => 'amp-video extension script',
16671
  ),
16672
  ),
16673
  array(
16934
  ),
16935
  array(
16936
  'attr_spec_list' => array(
16937
+ 'access-hide' => array(
16938
+ 'value' => array(
16939
+ '',
16940
+ ),
16941
+ ),
16942
  'data-amp-bind-data-expand' => array(),
16943
  'expanded' => array(
16944
  'value' => array(
includes/sanitizers/class-amp-core-theme-sanitizer.php CHANGED
@@ -1885,6 +1885,9 @@ class AMP_Core_Theme_Sanitizer extends AMP_Base_Sanitizer {
1885
  // the actionable elements in the modal. Therefore, the lightbox represents the "background".
1886
  $close_button_xpaths[] = "//*[ @id = '{$modal_id}' ]";
1887
 
 
 
 
1888
  // Then, add the inner element of the lightbox as an open button xpath.
1889
  // This is done to prevent the above close action from closing the modal when an inner element is clicked.
1890
  // Workaround found here: https://stackoverflow.com/a/45971501 .
@@ -2159,6 +2162,21 @@ class AMP_Core_Theme_Sanitizer extends AMP_Base_Sanitizer {
2159
  AMP_DOM_Utils::add_amp_action( $menu_toggle, 'tap', "{$body_id}.toggleClass(class=primary-navigation-open)" );
2160
  AMP_DOM_Utils::add_amp_action( $menu_toggle, 'tap', "{$body_id}.toggleClass(class=lock-scrolling)" );
2161
  $menu_toggle->setAttribute( 'data-amp-bind-aria-expanded', "{$state_string} ? 'true' : 'false'" );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2162
  }
2163
 
2164
  /**
1885
  // the actionable elements in the modal. Therefore, the lightbox represents the "background".
1886
  $close_button_xpaths[] = "//*[ @id = '{$modal_id}' ]";
1887
 
1888
+ // Ensure anchor links also close the modal the same as the the Close Menu button.
1889
+ $close_button_xpaths[] = sprintf( "//*[ @id = '{$modal_id}' ]//a[ @href and contains( @href, '#' ) ]" );
1890
+
1891
  // Then, add the inner element of the lightbox as an open button xpath.
1892
  // This is done to prevent the above close action from closing the modal when an inner element is clicked.
1893
  // Workaround found here: https://stackoverflow.com/a/45971501 .
2162
  AMP_DOM_Utils::add_amp_action( $menu_toggle, 'tap', "{$body_id}.toggleClass(class=primary-navigation-open)" );
2163
  AMP_DOM_Utils::add_amp_action( $menu_toggle, 'tap', "{$body_id}.toggleClass(class=lock-scrolling)" );
2164
  $menu_toggle->setAttribute( 'data-amp-bind-aria-expanded', "{$state_string} ? 'true' : 'false'" );
2165
+
2166
+ // Close the mobile modal when clicking in-page anchor links in the menu.
2167
+ foreach ( $this->dom->xpath->query( '//*[ @id = "site-navigation" ]//a[ @href and contains( @href, "#" ) ]' ) as $link ) {
2168
+ /** @var DOMElement $link */
2169
+ AMP_DOM_Utils::add_amp_action( $link, 'tap', "AMP.setState({{$state_string}: false})" );
2170
+ AMP_DOM_Utils::add_amp_action( $link, 'tap', "{$body_id}.toggleClass(class=primary-navigation-open,force=false)" );
2171
+ AMP_DOM_Utils::add_amp_action( $link, 'tap', "{$body_id}.toggleClass(class=lock-scrolling,force=false)" );
2172
+
2173
+ // Ensure target is scrolled into view. Note that in-page anchor links currently do not work in the non-AMP
2174
+ // version. Normally scrollTo shouldn't be necessary but it appears necessary due to scroll locking.
2175
+ $target = preg_replace( '/.*#/', '', $link->getAttribute( 'href' ) );
2176
+ if ( $target && $this->dom->getElementById( $target ) ) {
2177
+ AMP_DOM_Utils::add_amp_action( $link, 'tap', "{$target}.scrollTo" );
2178
+ }
2179
+ }
2180
  }
2181
 
2182
  /**
includes/validation/class-amp-validation-manager.php CHANGED
@@ -2170,7 +2170,7 @@ class AMP_Validation_Manager {
2170
  */
2171
  public static function serialize_validation_error_messages( $messages ) {
2172
  $encoded_messages = base64_encode( wp_json_encode( array_unique( $messages ) ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode
2173
- return wp_hash( $encoded_messages ) . ':' . $encoded_messages;
2174
  }
2175
 
2176
  /**
@@ -2184,7 +2184,14 @@ class AMP_Validation_Manager {
2184
  */
2185
  public static function unserialize_validation_error_messages( $serialized ) {
2186
  $parts = explode( ':', $serialized, 2 );
2187
- if ( count( $parts ) !== 2 || wp_hash( $parts[1] ) !== $parts[0] ) {
 
 
 
 
 
 
 
2188
  return null;
2189
  }
2190
  return json_decode( base64_decode( $parts[1] ), true ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_decode
2170
  */
2171
  public static function serialize_validation_error_messages( $messages ) {
2172
  $encoded_messages = base64_encode( wp_json_encode( array_unique( $messages ) ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode
2173
+ return wp_hash( $encoded_messages . wp_nonce_tick(), 'nonce' ) . ':' . $encoded_messages;
2174
  }
2175
 
2176
  /**
2184
  */
2185
  public static function unserialize_validation_error_messages( $serialized ) {
2186
  $parts = explode( ':', $serialized, 2 );
2187
+ if (
2188
+ count( $parts ) !== 2
2189
+ ||
2190
+ ! hash_equals(
2191
+ $parts[0],
2192
+ wp_hash( $parts[1] . wp_nonce_tick(), 'nonce' )
2193
+ )
2194
+ ) {
2195
  return null;
2196
  }
2197
  return json_decode( base64_decode( $parts[1] ), true ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_decode
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: google, xwp, automattic, westonruter, albertomedina, schlessera, s
3
  Tags: amp, mobile, optimization, accelerated mobile pages, framework, components, blocks, performance, ux, seo, official
4
  Requires at least: 4.9
5
  Tested up to: 5.6
6
- Stable tag: 2.0.9
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
  Requires PHP: 5.6
3
  Tags: amp, mobile, optimization, accelerated mobile pages, framework, components, blocks, performance, ux, seo, official
4
  Requires at least: 4.9
5
  Tested up to: 5.6
6
+ Stable tag: 2.0.10
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
  Requires PHP: 5.6
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInitbe01305164cb00d8e2490f2257b43397::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit74ae9b1e5d841728c62963ae6b648805::getLoader();
vendor/composer/ClassLoader.php CHANGED
@@ -60,7 +60,7 @@ class ClassLoader
60
  public function getPrefixes()
61
  {
62
  if (!empty($this->prefixesPsr0)) {
63
- return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
64
  }
65
 
66
  return array();
60
  public function getPrefixes()
61
  {
62
  if (!empty($this->prefixesPsr0)) {
63
+ return call_user_func_array('array_merge', $this->prefixesPsr0);
64
  }
65
 
66
  return array();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInitbe01305164cb00d8e2490f2257b43397
6
  {
7
  private static $loader;
8
 
@@ -22,15 +22,15 @@ class ComposerAutoloaderInitbe01305164cb00d8e2490f2257b43397
22
  return self::$loader;
23
  }
24
 
25
- spl_autoload_register(array('ComposerAutoloaderInitbe01305164cb00d8e2490f2257b43397', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
- spl_autoload_unregister(array('ComposerAutoloaderInitbe01305164cb00d8e2490f2257b43397', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require_once __DIR__ . '/autoload_static.php';
32
 
33
- call_user_func(\Composer\Autoload\ComposerStaticInitbe01305164cb00d8e2490f2257b43397::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
@@ -51,19 +51,19 @@ class ComposerAutoloaderInitbe01305164cb00d8e2490f2257b43397
51
  $loader->register(true);
52
 
53
  if ($useStaticLoader) {
54
- $includeFiles = Composer\Autoload\ComposerStaticInitbe01305164cb00d8e2490f2257b43397::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
- composerRequirebe01305164cb00d8e2490f2257b43397($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
63
  }
64
  }
65
 
66
- function composerRequirebe01305164cb00d8e2490f2257b43397($fileIdentifier, $file)
67
  {
68
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
69
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit74ae9b1e5d841728c62963ae6b648805
6
  {
7
  private static $loader;
8
 
22
  return self::$loader;
23
  }
24
 
25
+ spl_autoload_register(array('ComposerAutoloaderInit74ae9b1e5d841728c62963ae6b648805', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
+ spl_autoload_unregister(array('ComposerAutoloaderInit74ae9b1e5d841728c62963ae6b648805', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require_once __DIR__ . '/autoload_static.php';
32
 
33
+ call_user_func(\Composer\Autoload\ComposerStaticInit74ae9b1e5d841728c62963ae6b648805::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
51
  $loader->register(true);
52
 
53
  if ($useStaticLoader) {
54
+ $includeFiles = Composer\Autoload\ComposerStaticInit74ae9b1e5d841728c62963ae6b648805::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
+ composerRequire74ae9b1e5d841728c62963ae6b648805($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
63
  }
64
  }
65
 
66
+ function composerRequire74ae9b1e5d841728c62963ae6b648805($fileIdentifier, $file)
67
  {
68
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
69
  require $file;
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInitbe01305164cb00d8e2490f2257b43397
8
  {
9
  public static $files = array (
10
  '6f5653f9af3eab04254ad2c7f20515c8' => __DIR__ . '/../..' . '/back-compat/back-compat.php',
@@ -338,9 +338,9 @@ class ComposerStaticInitbe01305164cb00d8e2490f2257b43397
338
  public static function getInitializer(ClassLoader $loader)
339
  {
340
  return \Closure::bind(function () use ($loader) {
341
- $loader->prefixLengthsPsr4 = ComposerStaticInitbe01305164cb00d8e2490f2257b43397::$prefixLengthsPsr4;
342
- $loader->prefixDirsPsr4 = ComposerStaticInitbe01305164cb00d8e2490f2257b43397::$prefixDirsPsr4;
343
- $loader->classMap = ComposerStaticInitbe01305164cb00d8e2490f2257b43397::$classMap;
344
 
345
  }, null, ClassLoader::class);
346
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit74ae9b1e5d841728c62963ae6b648805
8
  {
9
  public static $files = array (
10
  '6f5653f9af3eab04254ad2c7f20515c8' => __DIR__ . '/../..' . '/back-compat/back-compat.php',
338
  public static function getInitializer(ClassLoader $loader)
339
  {
340
  return \Closure::bind(function () use ($loader) {
341
+ $loader->prefixLengthsPsr4 = ComposerStaticInit74ae9b1e5d841728c62963ae6b648805::$prefixLengthsPsr4;
342
+ $loader->prefixDirsPsr4 = ComposerStaticInit74ae9b1e5d841728c62963ae6b648805::$prefixDirsPsr4;
343
+ $loader->classMap = ComposerStaticInit74ae9b1e5d841728c62963ae6b648805::$classMap;
344
 
345
  }, null, ClassLoader::class);
346
  }
vendor/composer/installed.json CHANGED
@@ -1,12 +1,12 @@
1
  [
2
  {
3
  "name": "ampproject/common",
4
- "version": "2.0.x-dev",
5
- "version_normalized": "2.0.9999999.9999999-dev",
6
  "dist": {
7
  "type": "path",
8
  "url": "lib/common",
9
- "reference": "9ae4d10f085d41c46ae00ee0c32db2f96165a877"
10
  },
11
  "require": {
12
  "ext-dom": "*",
@@ -76,18 +76,17 @@
76
  ],
77
  "description": "PHP library with common base functionality for AMP integrations.",
78
  "transport-options": {
79
- "symlink": true,
80
- "relative": true
81
  }
82
  },
83
  {
84
  "name": "ampproject/optimizer",
85
- "version": "2.0.x-dev",
86
- "version_normalized": "2.0.9999999.9999999-dev",
87
  "dist": {
88
  "type": "path",
89
  "url": "lib/optimizer",
90
- "reference": "d4658dac3e58a9377314cb340f8cafe3b892d06f"
91
  },
92
  "require": {
93
  "ampproject/common": "*",
@@ -165,8 +164,7 @@
165
  ],
166
  "description": "PHP library for optimizing AMP pages.",
167
  "transport-options": {
168
- "symlink": true,
169
- "relative": true
170
  }
171
  },
172
  {
@@ -307,9 +305,9 @@
307
  "type": "library",
308
  "extra": {
309
  "patches_applied": {
310
- "Add additional validation for size unit <https://github.com/sabberworm/PHP-CSS-Parser/pull/193>": "https://github.com/sabberworm/PHP-CSS-Parser/compare/3bc5ded67d77a52b81608cfc97f23b1bb0678e2f%5E...468da3441945e9c1bf402a3340b1d8326723f7d9.patch",
311
- "Validate name-start code points for identifier <https://github.com/sabberworm/PHP-CSS-Parser/pull/185>": "https://github.com/sabberworm/PHP-CSS-Parser/compare/d42b64793f2edaffeb663c63e9de79069cdc0831%5E...113df5d55e94e21c6402021dfa959924941d4c29.patch",
312
- "Fix parsing CSS selectors which contain commas <https://github.com/westonruter/PHP-CSS-Parser/pull/1>": "https://github.com/westonruter/PHP-CSS-Parser/compare/master...10a2501c119abafced3e4014aa3c0a3453a86f67.patch"
313
  }
314
  },
315
  "installation-source": "source",
@@ -318,6 +316,7 @@
318
  "Sabberworm\\CSS\\": "lib/Sabberworm/CSS/"
319
  }
320
  },
 
321
  "license": [
322
  "MIT"
323
  ],
1
  [
2
  {
3
  "name": "ampproject/common",
4
+ "version": "dev-fix/docs-generation-2.0",
5
+ "version_normalized": "dev-fix/docs-generation-2.0",
6
  "dist": {
7
  "type": "path",
8
  "url": "lib/common",
9
+ "reference": "68d6534c512a0ebcd6b3fed94131d4b1738d929a"
10
  },
11
  "require": {
12
  "ext-dom": "*",
76
  ],
77
  "description": "PHP library with common base functionality for AMP integrations.",
78
  "transport-options": {
79
+ "symlink": true
 
80
  }
81
  },
82
  {
83
  "name": "ampproject/optimizer",
84
+ "version": "dev-fix/docs-generation-2.0",
85
+ "version_normalized": "dev-fix/docs-generation-2.0",
86
  "dist": {
87
  "type": "path",
88
  "url": "lib/optimizer",
89
+ "reference": "3c1c51d680d561801981294086d13be509327cc4"
90
  },
91
  "require": {
92
  "ampproject/common": "*",
164
  ],
165
  "description": "PHP library for optimizing AMP pages.",
166
  "transport-options": {
167
+ "symlink": true
 
168
  }
169
  },
170
  {
305
  "type": "library",
306
  "extra": {
307
  "patches_applied": {
308
+ "1. Add additional validation for size unit <https://github.com/sabberworm/PHP-CSS-Parser/pull/193>": "https://github.com/sabberworm/PHP-CSS-Parser/compare/3bc5ded67d77a52b81608cfc97f23b1bb0678e2f%5E...468da3441945e9c1bf402a3340b1d8326723f7d9.patch",
309
+ "2. Validate name-start code points for identifier <https://github.com/sabberworm/PHP-CSS-Parser/pull/185>": "https://github.com/sabberworm/PHP-CSS-Parser/compare/d42b64793f2edaffeb663c63e9de79069cdc0831%5E...113df5d55e94e21c6402021dfa959924941d4c29.patch",
310
+ "3. Fix parsing CSS selectors which contain commas <https://github.com/westonruter/PHP-CSS-Parser/pull/1>": "https://github.com/westonruter/PHP-CSS-Parser/compare/master...10a2501c119abafced3e4014aa3c0a3453a86f67.patch"
311
  }
312
  },
313
  "installation-source": "source",
316
  "Sabberworm\\CSS\\": "lib/Sabberworm/CSS/"
317
  }
318
  },
319
+ "notification-url": "https://packagist.org/downloads/",
320
  "license": [
321
  "MIT"
322
  ],