(()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.i18n,r=window.wp.blocks,n=window.wp.blockEditor,o=window.wp.components,s=window.wp.data,i=window.wp.serverSideRender;var a=e.n(i);function l(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}const c=function(e){var r=e.attributes,s=e.setAttributes,i=e.allowedPostTypes;return React.createElement(n.InspectorControls,null,React.createElement(o.PanelBody,{title:(0,t.__)("Post types to display","wp-seopress")},i&&React.createElement(React.Fragment,null,React.createElement("p",null,(0,t.__)("By default, if you have not selected any post types below, we’ll automatically take the ones set from the Sitemap setting page.","wp-seopress")),React.createElement("ul",null,i.map((function(e){return React.createElement("li",{key:e.slug},React.createElement(o.CheckboxControl,{label:e.name,checked:r.postTypes.includes(e.slug),onChange:function(t){return o=e.slug,(n=r.postTypes,i=function(e){if(Array.isArray(e))return l(e)}(n)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||function(e,t){if(e){if("string"==typeof e)return l(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)?l(e,t):void 0}}(n)||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.")}()).includes(o)?i=i.filter((function(e){return e!==o})):i.push(o),void s({postTypes:i});var n,o,i}}))}))))))};function u(e){return u="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},u(e)}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}const y=JSON.parse('{"u2":"wpseopress/sitemap"}');(0,r.registerBlockType)(y.u2,{title:(0,t.__)("Sitemap","wp-seopress"),description:(0,t.__)("Display an HTML sitemap.","wp-seopress"),keywords:[(0,t.__)("sitemap","wp-seopress"),(0,t.__)("navigation","wp-seopress")],edit:function(e){var r=e.attributes,i=e.setAttributes,l=r.isSiteMapEnabled,y=r.optionsPageUrl,f=(0,t.__)("It looks like the Sitemap feature is not enabled from your SEO settings. You must activate it to use this block. Make sure the HTML sitemap option is also enabled.","wp-seopress"),b=[{label:(0,t.__)("Review settings","wp-seopress"),url:y,variant:"primary",isPrimary:!0,noDefaultClasses:!0}],m=["attachment"],w=(0,s.withSelect)((function(e,t){var r=e("core").getPostTypes({per_page:-1})||[],n=[];return r&&r.length&&(n=r.filter((function(e){return e.viewable&&!m.includes(e.slug)}))),function(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){var n,o,s,i;n=e,o=t,s=r[t],i=function(e,t){if("object"!=u(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=u(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),(o="symbol"==u(i)?i:String(i))in n?Object.defineProperty(n,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[o]=s})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({allowedPostTypes:n},t)}))(c);return React.createElement("div",(0,n.useBlockProps)(),React.createElement(w,{attributes:r,setAttributes:i}),l?React.createElement(a(),{block:"wpseopress/sitemap",attributes:r}):React.createElement(o.Notice,{status:"warning",isDismissible:!1,actions:b},React.createElement("p",null,f)))},save:function(){return null}})})();