(()=>{"use strict";const e=window.wp.components,t=window.wp.data,r=window.wp.editPost,n=window.wp.i18n,o=window.wp.plugins,i=window.wp.wordcount;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 c(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 l(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 a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){u(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function u(e,t,r){var n;return n=function(e,t){if("object"!=s(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==s(n)?n:String(n))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var p={title:{selector:"#seopress_titles_title_meta",type:"text",key:"_seopress_titles_title"},description:{selector:"#seopress_titles_desc_meta",type:"text",key:"_seopress_titles_desc"},noindex:{selector:"#seopress_robots_index_meta",type:"checkbox",key:"_seopress_robots_index"}};document.addEventListener("DOMContentLoaded",(function(){if(wp.plugins){if(null===document.querySelector("#seopress-js-module-seo-metabox")){for(var e=function(){var e,o,i=(e=n[r],o=2,function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,s,c=[],l=!0,a=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){a=!0,o=e}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(a)throw o}}return c}}(e,o)||function(e,t){if(e){if("string"==typeof e)return c(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)?c(e,t):void 0}}(e,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=(i[0],i[1]);jQuery(s.selector).on("change paste keyup",(function(e){!function(e,r){r.value="checkbox"==r.type?e.target.checked?"yes":"":e.target.value;var n=(0,t.select)("core/editor").getEditedPostAttribute("meta");(0,t.dispatch)("core/editor").editPost({meta:a(a({},n),{},u({},r.key,r.value))})}(e,s)}))},r=0,n=Object.entries(p);r<n.length;r++)e();jQuery("#seopress-tag-single-excerpt").click((function(){jQuery("#seopress_titles_desc_meta").trigger("paste")}))}(0,o.registerPlugin)("pre-publish-checklist",{render:y})}}));var y=function(){var o=(0,t.useSelect)((function(e){return{isTyping:e("core/block-editor").isTyping(),meta:e("core/editor").getEditedPostAttribute("meta")}}),[]),s=(o.isTyping,o.meta);if(!s)return"";var c=(0,t.select)("core/editor").getEditedPostAttribute("content"),l=(0,i.count)(c,"words"),a=(null==s?void 0:s._seopress_titles_title)||"",u=(null==s?void 0:s._seopress_titles_desc)||"",p="yes"===(null==s?void 0:s._seopress_robots_index),y=React.createElement(e.Icon,{icon:"yes",style:{color:"green"}}),d=React.createElement(e.Icon,{icon:"no",style:{color:"red"}});return React.createElement(r.PluginPrePublishPanel,{title:(0,n.__)("SEO Checklist","wp-seopress")},React.createElement("ul",null,React.createElement("li",{key:"wordCount"},l>300?y:d,React.createElement("strong",null,(0,n.__)("Word count: ","wp-seopress")),React.createElement("span",null,l)),React.createElement("li",{key:"metaTitle"},a?y:d,React.createElement("strong",null,a?(0,n.__)("Meta title is set.","wp-seopress"):(0,n.__)("Custom meta title is not set.","wp-seopress"))),React.createElement("li",{key:"metaDescription"},u?y:d,React.createElement("strong",null,u?(0,n.__)("Meta description is set.","wp-seopress"):(0,n.__)("Custom meta description is not set.","wp-seopress"))),React.createElement("li",{key:"metaIndex"},p?d:y,React.createElement("strong",null,p?(0,n.__)("This content is set to noindex.","wp-seopress"):(0,n.__)("This content is set to be indexed.","wp-seopress")))))}})();