var k=Object.defineProperty;var n=Object.getOwnPropertySymbols;var h=Object.prototype.hasOwnProperty,g=Object.prototype.propertyIsEnumerable;var l=(o,e,t)=>e in o?k(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,s=(o,e)=>{for(var t in e||(e={}))h.call(e,t)&&l(o,t,e[t]);if(n)for(var t of n(e))g.call(e,t)&&l(o,t,e[t]);return o};import{r as u,S as v}from"../server-side-render-qGFKBtC_.js";import{useBlockProps as R,InspectorControls as y}from"../shims/wp-block-editor.js";import{PanelBody as E,TextControl as f,RangeControl as w,SelectControl as x,ToggleControl as C}from"../shims/wp-components.js";import{__ as a}from"../shims/wp-i18n.js";const b=()=>React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},React.createElement("path",{fill:"currentColor",d:"M4 4h16v2H4zm0 6h10v2H4zm0 6h16v2H4zm12-6h4v2h-4z"})),L=({attributes:o,setAttributes:e,name:t})=>{const i=R({className:"prorank-related-content-editor"}),{heading:c,maxLinks:p,layout:m,withExcerpt:d}=o;return React.createElement("div",s({},i),React.createElement(y,null,React.createElement(E,{title:a("Related Posts","prorank-seo"),initialOpen:!0},React.createElement(f,{label:a("Heading","prorank-seo"),value:c,onChange:r=>e({heading:r}),help:a("Leave blank to omit the heading.","prorank-seo")}),React.createElement(w,{label:a("Maximum links","prorank-seo"),min:1,max:12,value:p,onChange:r=>e({maxLinks:Math.max(1,Math.min(12,r||1))})}),React.createElement(x,{label:a("Layout","prorank-seo"),value:m,onChange:r=>e({layout:r}),options:[{value:"list",label:a("List","prorank-seo")},{value:"grid",label:a("Compact grid","prorank-seo")}]}),React.createElement(C,{label:a("Show excerpt under each link","prorank-seo"),checked:!!d,onChange:r=>e({withExcerpt:!!r})}))),React.createElement(v,{block:t,attributes:o}))};u("prorank-seo/related-posts",{apiVersion:3,title:a("ProRank Related Posts","prorank-seo"),description:a("Lists internally-relevant posts based on prominent words, with category/tag fallback.","prorank-seo"),category:"prorank-seo",icon:b,keywords:[a("related","prorank-seo"),a("internal links","prorank-seo"),a("prorank-seo","prorank-seo")],supports:{html:!1,align:!0},attributes:{heading:{type:"string",default:a("Related Posts","prorank-seo")},maxLinks:{type:"number",default:5},layout:{type:"string",default:"list"},className:{type:"string",default:""},withExcerpt:{type:"boolean",default:!1}},edit:L,save:()=>null});
