(()=>{"use strict";const e=window.wp.components,t=window.wp.data,r=window.wp.i18n,n=window.wp.plugins,o=window.wp.wordcount;function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function s(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 c(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 l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function a(e,t,r){var n;return n=function(e,t){if("object"!=i(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==i(n)?n:String(n))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var u={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,n,i=(e=o[r],n=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,n)||function(e,t){if(e){if("string"==typeof e)return s(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)?s(e,t):void 0}}(e,n)||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.")}()),c=(i[0],i[1]);jQuery(c.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:l(l({},n),{},a({},r.key,r.value))})}(e,c)}))},r=0,o=Object.entries(u);r<o.length;r++)e();jQuery("#seopress-tag-single-excerpt").click((function(){jQuery("#seopress_titles_desc_meta").trigger("paste")}))}(0,n.registerPlugin)("pre-publish-checklist",{render:p})}}));var p=function(){var n=(0,t.useSelect)((function(e){return{isTyping:e("core/block-editor").isTyping(),meta:e("core/editor").getEditedPostAttribute("meta")}}),[]),i=(n.isTyping,n.meta);if(!i)return"";var s=(0,t.select)("core/editor").getEditedPostAttribute("content"),c=(0,o.count)(s,"words"),l=(null==i?void 0:i._seopress_titles_title)||"",a=(null==i?void 0:i._seopress_titles_desc)||"",u="yes"===(null==i?void 0:i._seopress_robots_index),p=React.createElement(e.Icon,{icon:"yes",style:{color:"green"}}),y=React.createElement(e.Icon,{icon:"no",style:{color:"red"}}),d=wp.editor.PluginPrePublishPanel;return void 0===d&&(d=wp.editPost.PluginPrePublishPanel),React.createElement(d,{title:(0,r.__)("SEO Checklist","wp-seopress"),initialOpen:!0},React.createElement("ul",null,React.createElement("li",{key:"wordCount"},c>300?p:y,React.createElement("strong",null,(0,r.__)("Word count: ","wp-seopress")),React.createElement("span",null,c)),React.createElement("li",{key:"metaTitle"},l?p:y,React.createElement("strong",null,l?(0,r.__)("Meta title is set.","wp-seopress"):(0,r.__)("Custom meta title is not set.","wp-seopress"))),React.createElement("li",{key:"metaDescription"},a?p:y,React.createElement("strong",null,a?(0,r.__)("Meta description is set.","wp-seopress"):(0,r.__)("Custom meta description is not set.","wp-seopress"))),React.createElement("li",{key:"metaIndex"},u?y:p,React.createElement("strong",null,u?(0,r.__)("This content is set to noindex.","wp-seopress"):(0,r.__)("This content is set to be indexed.","wp-seopress")))))}})();