text: !function(){var e={152:function(e){var t;t=function(){return function(){var e={134:function(e,t,n){"use strict";n.d(t,{default:function(){return E}});var r=n(279),o=n.n(r),i=n(370),c=n.n(i),a=n(817),l=n.n(a);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var d=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.resolveOptions(t),this.initSelection()}var t,n;return t=e,n=[{key:"resolveOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action=e.action,this.container=e.container,this.emitter=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"createFakeElement",value:function(){var e="rtl"===document.documentElement.getAttribute("dir");this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var t=window.pageYOffset||document.documentElement.scrollTop;return this.fakeElem.style.top="".concat(t,"px"),this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.fakeElem}},{key:"selectFake",value:function(){var e=this,t=this.createFakeElement();this.fakeHandlerCallback=function(){return e.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.container.appendChild(t),this.selectedText=l()(t),this.copyText(),this.removeFake()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=l()(this.target),this.copyText()}},{key:"copyText",value:function(){var e;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function(e){this.emitter.emit(e?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),document.activeElement.blur(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(e){if(void 0!==e){if(!e||"object"!==s(e)||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=e}},get:function(){return this._target}}],n&&u(t.prototype,n),e}(),f=d;function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function y(e,t){return y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},y(e,t)}function m(e,t){return!t||"object"!==h(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function g(e,t){var n="data-clipboard-".concat(e);if(t.hasAttribute(n))return t.getAttribute(n)}var b=function(e){!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&&y(e,t)}(l,e);var t,n,r,o,i,a=(o=l,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=v(o);if(i){var n=v(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return m(this,e)});function l(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),(n=a.call(this)).resolveOptions(t),n.listenClick(e),n}return t=l,n=[{key:"resolveOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===h(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=c()(e,"click",(function(e){return t.onClick(e)}))}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new f({action:this.action(t),target:this.target(t),text:this.text(t),container:this.container,trigger:t,emitter:this})}},{key:"defaultAction",value:function(e){return g("action",e)}},{key:"defaultTarget",value:function(e){var t=g("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return g("text",e)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],r=[{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof e?[e]:e,n=!!document.queryCommandSupported;return t.forEach((function(e){n=n&&!!document.queryCommandSupported(e)})),n}}],n&&p(t.prototype,n),r&&p(t,r),l}(o()),E=b},828:function(e){if("undefined"!=typeof Element&&!Element.prototype.matches){var t=Element.prototype;t.matches=t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}e.exports=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}}},438:function(e,t,n){var r=n(828);function o(e,t,n,r,o){var c=i.apply(this,arguments);return e.addEventListener(n,c,o),{destroy:function(){e.removeEventListener(n,c,o)}}}function i(e,t,n,o){return function(n){n.delegateTarget=r(n.target,t),n.delegateTarget&&o.call(e,n)}}e.exports=function(e,t,n,r,i){return"function"==typeof e.addEventListener?o.apply(null,arguments):"function"==typeof n?o.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return o(e,t,n,r,i)})))}},879:function(e,t){t.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},t.nodeList=function(e){var n=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in e&&(0===e.length||t.node(e[0]))},t.string=function(e){return"string"==typeof e||e instanceof String},t.fn=function(e){return"[object Function]"===Object.prototype.toString.call(e)}},370:function(e,t,n){var r=n(879),o=n(438);e.exports=function(e,t,n){if(!e&&!t&&!n)throw new Error("Missing required arguments");if(!r.string(t))throw new TypeError("Second argument must be a String");if(!r.fn(n))throw new TypeError("Third argument must be a Function");if(r.node(e))return function(e,t,n){return e.addEventListener(t,n),{destroy:function(){e.removeEventListener(t,n)}}}(e,t,n);if(r.nodeList(e))return function(e,t,n){return Array.prototype.forEach.call(e,(function(e){e.addEventListener(t,n)})),{destroy:function(){Array.prototype.forEach.call(e,(function(e){e.removeEventListener(t,n)}))}}}(e,t,n);if(r.string(e))return function(e,t,n){return o(document.body,e,t,n)}(e,t,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},817:function(e){e.exports=function(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var r=window.getSelection(),o=document.createRange();o.selectNodeContents(e),r.removeAllRanges(),r.addRange(o),t=r.toString()}return t}},279:function(e){function t(){}t.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function o(){r.off(e,o),t.apply(n,arguments)}return o._=t,this.on(e,o,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,o=n.length;r<o;r++)n[r].fn.apply(n[r].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),r=n[e],o=[];if(r&&t)for(var i=0,c=r.length;i<c;i++)r[i].fn!==t&&r[i].fn._!==t&&o.push(r[i]);return o.length?n[e]=o:delete n[e],this}},e.exports=t,e.exports.TinyEmitter=t}},t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}return n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n(134)}().default},e.exports=t()}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";var e=window.wp.domReady,t=n.n(e),r=window.wp.i18n,o=n(152),i=n.n(o);function c(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[...document.querySelectorAll("select.amp-validation-error-status")].map((e=>e.closest("tr")));return!0!==e.checkedOnly?t:t.filter((e=>e.querySelector(".check-column input[type=checkbox]").checked))}function a(e){let{trigger:t}=e;t.focus();const n=(0,r.__)("Copied to clipboard","amp");if(t.innerText===n)return;const o=t.innerText;t.innerText=n,setTimeout((()=>{document.body.contains(t)&&(t.innerText=o)}),4e3)}const l="number-errors",s="show-all-errors";t()((()=>{m(),v(),g(),b(),E(),f(),k(),function(){const e=[];e.push(new(i())("button.single-url-detail-copy",{text:e=>JSON.stringify(JSON.parse(e.getAttribute("data-error-json")),null,"\t")})),e.push(new(i())("button.copy-all",{text:()=>{const e=c({checkedOnly:!0}).map((e=>{const t=e.querySelector(".single-url-detail-copy");return t?JSON.parse(t.getAttribute("data-error-json")):null})).filter((e=>e));return JSON.stringify(e,null,"\t")}})),e.forEach((e=>{e.on("success",a)}))}()}));let u=!1;const d=()=>{u||(n.g.addEventListener("beforeunload",h),document.querySelector("#major-publishing-actions").addEventListener("click",(()=>{n.g.removeEventListener("beforeunload",h)})),u=!0)},f=()=>{const e=t=>{(t.target.matches(".amp-validation-error-status")||t.target.matches(".amp-validation-error-status-review"))&&(document.getElementById("post").removeEventListener("change",e),d())};document.getElementById("post").addEventListener("change",e)},h=e=>(e.preventDefault(),e.returnValue=(0,r.__)("You have unsaved changes. Are you sure you want to leave?","amp"),(0,r.__)("You have unsaved changes. Are you sure you want to leave?","amp")),p=(e,t)=>{const n=document.getElementById(s);let o,i,c=document.getElementById(l);const a=document.getElementsByTagName("thead");a[0]&&!c&&(o=a[0],c=document.createElement("tr"),i=document.createElement("th"),i.setAttribute("id",l),i.setAttribute("colspan","6"),c.appendChild(i),o.appendChild(c)),e===t?(n&&n.classList.add("hidden"),c.classList.add("hidden")):null!==e&&(document.getElementById(l).innerText=(0,r.sprintf)(
  /* translators: 1: number of errors being displayed. 2: total number of errors found. */
  (0,r._n)("Showing %1$s of %2$s validation error","Showing %1$s of %2$s validation errors",t,"amp"),e,t),document.getElementById(l).classList.remove("hidden"),y(),document.getElementById(s)&&document.getElementById(s).classList.remove("hidden"))},y=()=>{const e=document.getElementById("url-post-filter");let t=document.getElementById(s);!t&&e&&(t=document.createElement("button"),t.id=s,t.classList.add("button"),t.innerText=(0,r.__)("Show all","amp"),e.appendChild(t))},m=()=>{document.getElementById("url-post-filter").addEventListener("click",(e=>{if(!e.target.matches("#"+s))return;e.preventDefault();const t=document.querySelectorAll("[data-error-type]");t.forEach((e=>{e.parentElement.parentElement.classList.remove("hidden")})),p(t.length,t.length),e.target.classList.add("hidden"),document.getElementById("amp_validation_error_type").selectedIndex=0}))},v=()=>{document.getElementById("amp_validation_error_type").addEventListener("change",(e=>{if(!e.target.matches("select"))return;e.preventDefault();const t=document.getElementById(s),n="-1"===e.target.value,r=document.querySelectorAll("[data-error-type]");n&&t&&t.classList.add("hidden");let o=0;r.forEach((t=>{const r=t.getAttribute("data-error-type");n||!e.target.value||e.target.value===r?(t.parentElement.parentElement.classList.remove("hidden"),o++):t.parentElement.parentElement.classList.add("hidden")})),p(o,r.length)}))},g=()=>{const e=document.getElementById("search-submit");e&&e.addEventListener("click",(e=>{if(e.preventDefault(),!e.target.matches("input"))return;const t=document.getElementById("invalid-url-search-search-input").value,n=document.querySelectorAll("tbody .column-details");let r=0;n.forEach((e=>{let n=!1;e.querySelectorAll(".detailed").forEach((e=>{-1!==e.innerText.indexOf(t)&&(n=!0)})),n?(e.parentElement.classList.remove("hidden"),r++):e.parentElement.classList.add("hidden")})),p(r,n.length)}))},b=()=>{document.querySelectorAll('tr[id^="tag-"]').forEach((e=>{const t=e.querySelector(".amp-validation-error-status"),n=e.querySelector(".amp-validation-error-status-review");t&&t.addEventListener("change",(()=>e.classList.toggle("kept"))),n&&n.addEventListener("change",(()=>e.classList.toggle("new")))}))},E=()=>{const e=document.querySelector("button.action.remove"),t=document.querySelector("button.action.keep"),r=document.getElementById("remove-keep-buttons"),o=e=>{let t;e.target.matches("[type=checkbox]")&&(e.target.checked?r.classList.remove("hidden"):(t=!1,document.querySelectorAll(".check-column [type=checkbox]").forEach((e=>{e.checked&&(t=!0)})),t||r.classList.add("hidden")))};document.querySelectorAll(".check-column [type=checkbox]").forEach((e=>{e.addEventListener("change",o)})),e.addEventListener("click",(()=>{Array.prototype.forEach.call(document.querySelectorAll("select.amp-validation-error-status"),(e=>{const t=e.closest("tr");t.querySelector(".check-column input[type=checkbox]").checked&&(e.value="3",t.classList.remove("kept"),d())}))})),t.addEventListener("click",(()=>{Array.prototype.forEach.call(document.querySelectorAll("select.amp-validation-error-status"),(e=>{const t=e.closest("tr");t.querySelector(".check-column input[type=checkbox]").checked&&(e.value="2",t.classList.add("kept"),d())}))})),n.g.addEventListener("click",(e=>{let{target:t}=e;if(!t.classList.contains("reviewed-toggle"))return;const n=t.classList.contains("reviewed");c({checkedOnly:!0}).forEach((e=>{e.querySelector("input[type=checkbox].amp-validation-error-status-review").checked=n,e.classList.toggle("new",!n),d()}))}))},k=()=>{const e=document.getElementById("amp_stylesheets");for(const t of e.querySelectorAll(".toggle-stylesheet-details")){const e=t.closest("tr");t.addEventListener("click",(()=>{e.classList.toggle("expanded")}))}for(const t of e.querySelectorAll(".stylesheet-details")){const e=t.querySelector(".shaken-stylesheet"),n=t.querySelector(".show-removed-styles");n&&n.addEventListener("click",(()=>{e.classList.toggle("removed-styles-shown",n.checked)}))}}}()}();