Read more: %1$s"),t||(0,tt.__)("(no title)")),{a:(0,Ke.createElement)("a",{className:"wp-block-latest-posts__read-more",href:e.link,rel:"noopener noreferrer",onClick:M}),span:(0,Ke.createElement)("span",{className:"screen-reader-text"})})):n;return(0,Ke.createElement)("li",{key:e.id},s&&(0,Ke.createElement)("div",{className:i},x?(0,Ke.createElement)("a",{className:"wp-block-latest-posts__post-title",href:e.link,rel:"noreferrer noopener",onClick:M},c):c),(0,Ke.createElement)("a",{href:e.link,rel:"noreferrer noopener",dangerouslySetInnerHTML:t?{__html:t}:void 0,onClick:M},t?null:(0,tt.__)("(no title)")),g&&a&&(0,Ke.createElement)("div",{className:"wp-block-latest-posts__post-author"},(0,tt.sprintf)((0,tt.__)("by %s"),a.name)),d&&e.date_gmt&&(0,Ke.createElement)("time",{dateTime:(0,So.format)("c",e.date_gmt),className:"wp-block-latest-posts__post-date"},(0,So.dateI18n)(V,e.date_gmt)),p&&"excerpt"===u&&(0,Ke.createElement)("div",{className:"wp-block-latest-posts__post-excerpt"},h),p&&"full_post"===u&&(0,Ke.createElement)("div",{className:"wp-block-latest-posts__post-full-content",dangerouslySetInnerHTML:{__html:e.content.raw.trim()}}))}))))},deprecated:Np},Ap=()=>Xe({name:zp,metadata:Mp,settings:Rp}),Hp={A:"upper-alpha",a:"lower-alpha",I:"upper-roman",i:"lower-roman"};function Lp(e){const{values:t,start:n,reversed:a,ordered:o,type:r,...l}=e,i=document.createElement(o?"ol":"ul");i.innerHTML=t,n&&i.setAttribute("start",n),a&&i.setAttribute("reversed",!0),r&&i.setAttribute("type",r);const[s]=(0,Qe.rawHandler)({HTML:i.outerHTML});return[{...l,...s.attributes},s.innerBlocks]}const Dp={attributes:{ordered:{type:"boolean",default:!1,__experimentalRole:"content"},values:{type:"string",source:"html",selector:"ol,ul",multiline:"li",__unstableMultilineWrapperTags:["ol","ul"],default:"",__experimentalRole:"content"},type:{type:"string"},start:{type:"number"},reversed:{type:"boolean"},placeholder:{type:"string"}},supports:{anchor:!0,className:!1,typography:{fontSize:!0,__experimentalFontFamily:!0},color:{gradients:!0,link:!0},__unstablePasteTextInline:!0,__experimentalSelector:"ol,ul",__experimentalSlashInserter:!0},save({attributes:e}){const{ordered:t,values:n,type:a,reversed:o,start:r}=e,l=t?"ol":"ul";return(0,Ke.createElement)(l,{...nt.useBlockProps.save({type:a,reversed:o,start:r})},(0,Ke.createElement)(nt.RichText.Content,{value:n,multiline:"li"}))},migrate:ln,isEligible:({style:e})=>e?.typography?.fontFamily},Fp={attributes:{ordered:{type:"boolean",default:!1,__experimentalRole:"content"},values:{type:"string",source:"html",selector:"ol,ul",multiline:"li",__unstableMultilineWrapperTags:["ol","ul"],default:"",__experimentalRole:"content"},type:{type:"string"},start:{type:"number"},reversed:{type:"boolean"},placeholder:{type:"string"}},supports:{anchor:!0,className:!1,typography:{fontSize:!0,__experimentalFontFamily:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},__unstablePasteTextInline:!0,__experimentalSelector:"ol,ul",__experimentalSlashInserter:!0},save({attributes:e}){const{ordered:t,values:n,type:a,reversed:o,start:r}=e,l=t?"ol":"ul";return(0,Ke.createElement)(l,{...nt.useBlockProps.save({type:a,reversed:o,start:r})},(0,Ke.createElement)(nt.RichText.Content,{value:n,multiline:"li"}))},migrate:Lp},Vp={attributes:{ordered:{type:"boolean",default:!1,__experimentalRole:"content"},values:{type:"string",source:"html",selector:"ol,ul",multiline:"li",__unstableMultilineWrapperTags:["ol","ul"],default:"",__experimentalRole:"content"},type:{type:"string"},start:{type:"number"},reversed:{type:"boolean"},placeholder:{type:"string"}},supports:{anchor:!0,className:!1,typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},__unstablePasteTextInline:!0,__experimentalSelector:"ol,ul",__experimentalSlashInserter:!0},isEligible:({type:e})=>!!e,save({attributes:e}){const{ordered:t,type:n,reversed:a,start:o}=e,r=t?"ol":"ul";return(0,Ke.createElement)(r,{...nt.useBlockProps.save({type:n,reversed:a,start:o})},(0,Ke.createElement)(nt.InnerBlocks.Content,null))},migrate:function(e){const{type:t}=e;return t&&Hp[t]?{...e,type:Hp[t]}:e}},$p=[Vp,Fp,Dp],Op=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{d:"M20 5.5H4V4H20V5.5ZM12 12.5H4V11H12V12.5ZM20 20V18.5H4V20H20ZM15.4697 14.9697L18.4393 12L15.4697 9.03033L16.5303 7.96967L20.0303 11.4697L20.5607 12L20.0303 12.5303L16.5303 16.0303L15.4697 14.9697Z"})),Gp=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{d:"M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-4-4.6l-4 4 4 4 1-1-3-3 3-3-1-1z"})),Up=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{d:"M4 8.8h8.9V7.2H4v1.6zm0 7h8.9v-1.5H4v1.5zM18 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"})),qp=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})),jp=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{d:"M3.8 15.8h8.9v-1.5H3.8v1.5zm0-7h8.9V7.2H3.8v1.6zm14.7-2.1V10h1V5.3l-2.2.7.3 1 .9-.3zm1.2 6.1c-.5-.6-1.2-.5-1.7-.4-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5H20v-1h-.9c.3-.6.8-1.4.9-2.1 0-.3 0-.8-.3-1.1z"})),Wp=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM5 6.7V10h1V5.3L3.8 6l.4 1 .8-.3zm-.4 5.7c-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5h2.7v-1h-1c.3-.6.8-1.4.9-2.1.1-.3 0-.8-.2-1.1-.5-.6-1.3-.5-1.7-.4z"})),Zp=window.wp.deprecated;var Qp=n.n(Zp);const Kp=({setAttributes:e,reversed:t,start:n,type:a})=>(0,Ke.createElement)(nt.InspectorControls,null,(0,Ke.createElement)(et.PanelBody,{title:(0,tt.__)("Ordered list settings")},(0,Ke.createElement)(et.TextControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Start value"),type:"number",onChange:t=>{const n=parseInt(t,10);e({start:isNaN(n)?void 0:n})},value:Number.isInteger(n)?n.toString(10):"",step:"1"}),(0,Ke.createElement)(et.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Numbering style"),options:[{label:(0,tt.__)("Numbers"),value:"decimal"},{label:(0,tt.__)("Uppercase letters"),value:"upper-alpha"},{label:(0,tt.__)("Lowercase letters"),value:"lower-alpha"},{label:(0,tt.__)("Uppercase Roman numerals"),value:"upper-roman"},{label:(0,tt.__)("Lowercase Roman numerals"),value:"lower-roman"}],value:a,onChange:t=>e({type:t})}),(0,Ke.createElement)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Reverse list numbering"),checked:t||!1,onChange:t=>{e({reversed:t||void 0})}})));const Yp=(0,_t.forwardRef)((function(e,t){const{ordered:n,...a}=e,o=n?"ol":"ul";return(0,Ke.createElement)(o,{ref:t,...a})})),Jp=[["core/list-item"]];function Xp({clientId:e}){const t=function(e){const{replaceBlocks:t,selectionChange:n}=(0,gt.useDispatch)(nt.store),{getBlockRootClientId:a,getBlockAttributes:o,getBlock:r}=(0,gt.useSelect)(nt.store);return(0,_t.useCallback)((()=>{const l=a(e),i=o(l),s=(0,Qe.createBlock)("core/list-item",i),{innerBlocks:c}=r(e);t([l],[s,...c]),n(c[c.length-1].clientId)}),[e])}(e),n=(0,gt.useSelect)((t=>{const{getBlockRootClientId:n,getBlockName:a}=t(nt.store);return"core/list-item"===a(n(e))}),[e]);return(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(et.ToolbarButton,{icon:(0,tt.isRTL)()?Op:Gp,title:(0,tt.__)("Outdent"),describedBy:(0,tt.__)("Outdent list item"),disabled:!n,onClick:t}))}function ed({phrasingContentSchema:e}){const t={...e,ul:{},ol:{attributes:["type","start","reversed"]}};return["ul","ol"].forEach((e=>{t[e].children={li:{children:t}}})),t}function td(e){return e.flatMap((({name:e,attributes:t,innerBlocks:n=[]})=>"core/list-item"===e?[t.content,...td(n)]:td(n)))}const nd={from:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph","core/heading"],transform:e=>{let t=[];if(e.length>1)t=e.map((({content:e})=>(0,Qe.createBlock)("core/list-item",{content:e})));else if(1===e.length){const n=(0,Rn.create)({html:e[0].content});t=(0,Rn.split)(n,"\n").map((e=>(0,Qe.createBlock)("core/list-item",{content:(0,Rn.toHTMLString)({value:e})})))}return(0,Qe.createBlock)("core/list",{anchor:e.anchor},t)}},{type:"raw",selector:"ol,ul",schema:e=>({ol:ed(e).ol,ul:ed(e).ul}),transform:function e(t){const n=t.getAttribute("type"),a={ordered:"OL"===t.tagName,anchor:""===t.id?void 0:t.id,start:t.getAttribute("start")?parseInt(t.getAttribute("start"),10):void 0,reversed:!!t.hasAttribute("reversed")||void 0,type:n&&Hp[n]?Hp[n]:void 0},o=Array.from(t.children).map((t=>{const n=Array.from(t.childNodes).filter((e=>e.nodeType!==e.TEXT_NODE||0!==e.textContent.trim().length));n.reverse();const[a,...o]=n;if(!("UL"===a?.tagName||"OL"===a?.tagName))return(0,Qe.createBlock)("core/list-item",{content:t.innerHTML});const r=o.map((e=>e.nodeType===e.TEXT_NODE?e.textContent:e.outerHTML));r.reverse();const l={content:r.join("").trim()},i=[e(a)];return(0,Qe.createBlock)("core/list-item",l,i)}));return(0,Qe.createBlock)("core/list",a,o)}},...["*","-"].map((e=>({type:"prefix",prefix:e,transform:e=>(0,Qe.createBlock)("core/list",{},[(0,Qe.createBlock)("core/list-item",{content:e})])}))),...["1.","1)"].map((e=>({type:"prefix",prefix:e,transform:e=>(0,Qe.createBlock)("core/list",{ordered:!0},[(0,Qe.createBlock)("core/list-item",{content:e})])})))],to:[...["core/paragraph","core/heading"].map((e=>({type:"block",blocks:[e],transform:(t,n)=>td(n).map((t=>(0,Qe.createBlock)(e,{content:t})))})))]},ad=nd,od={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/list",title:"List",category:"text",allowedBlocks:["core/list-item"],description:"Create a bulleted or numbered list.",keywords:["bullet list","ordered list","numbered list"],textdomain:"default",attributes:{ordered:{type:"boolean",default:!1,__experimentalRole:"content"},values:{type:"string",source:"html",selector:"ol,ul",multiline:"li",__unstableMultilineWrapperTags:["ol","ul"],default:"",__experimentalRole:"content"},type:{type:"string"},start:{type:"number"},reversed:{type:"boolean"},placeholder:{type:"string"}},supports:{anchor:!0,className:!1,typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},__unstablePasteTextInline:!0,__experimentalSelector:"ol,ul",__experimentalOnMerge:!0,__experimentalSlashInserter:!0,interactivity:{clientNavigation:!0}},editorStyle:"wp-block-list-editor",style:"wp-block-list"},{name:rd}=od,ld={icon:Tp,example:{innerBlocks:[{name:"core/list-item",attributes:{content:(0,tt.__)("Alice.")}},{name:"core/list-item",attributes:{content:(0,tt.__)("The White Rabbit.")}},{name:"core/list-item",attributes:{content:(0,tt.__)("The Cheshire Cat.")}},{name:"core/list-item",attributes:{content:(0,tt.__)("The Mad Hatter.")}},{name:"core/list-item",attributes:{content:(0,tt.__)("The Queen of Hearts.")}}]},transforms:ad,edit:function({attributes:e,setAttributes:t,clientId:n,style:a}){const{ordered:o,type:r,reversed:l,start:i}=e,s=(0,nt.useBlockProps)({style:{..._t.Platform.isNative&&a,listStyleType:o&&"decimal"!==r?r:void 0}}),c=(0,nt.useInnerBlocksProps)(s,{template:Jp,templateLock:!1,templateInsertUpdatesSelection:!0,..._t.Platform.isNative&&{marginVertical:8,marginHorizontal:8,renderAppender:!1},__experimentalCaptureToolbars:!0});!function(e,t){const n=(0,gt.useRegistry)(),{updateBlockAttributes:a,replaceInnerBlocks:o}=(0,gt.useDispatch)(nt.store);(0,_t.useEffect)((()=>{if(!e.values)return;const[r,l]=Lp(e);Qp()("Value attribute on the list block",{since:"6.0",version:"6.5",alternative:"inner blocks"}),n.batch((()=>{a(t,r),o(t,l)}))}),[e.values])}(e,n);const m=(0,Ke.createElement)(nt.BlockControls,{group:"block"},(0,Ke.createElement)(et.ToolbarButton,{icon:(0,tt.isRTL)()?Up:qp,title:(0,tt.__)("Unordered"),describedBy:(0,tt.__)("Convert to unordered list"),isActive:!1===o,onClick:()=>{t({ordered:!1})}}),(0,Ke.createElement)(et.ToolbarButton,{icon:(0,tt.isRTL)()?jp:Wp,title:(0,tt.__)("Ordered"),describedBy:(0,tt.__)("Convert to ordered list"),isActive:!0===o,onClick:()=>{t({ordered:!0})}}),(0,Ke.createElement)(Xp,{clientId:n}));return(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(Yp,{ordered:o,reversed:l,start:i,...c}),m,o&&(0,Ke.createElement)(Kp,{setAttributes:t,reversed:l,start:i,type:r}))},save:function({attributes:e}){const{ordered:t,type:n,reversed:a,start:o}=e,r=t?"ol":"ul";return(0,Ke.createElement)(r,{...nt.useBlockProps.save({reversed:a,start:o,style:{listStyleType:t&&"decimal"!==n?n:void 0}})},(0,Ke.createElement)(nt.InnerBlocks.Content,null))},deprecated:$p},id=()=>Xe({name:rd,metadata:od,settings:ld}),sd=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{d:"M12 11v1.5h8V11h-8zm-6-1c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})),cd=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{d:"M20 5.5H4V4H20V5.5ZM12 12.5H4V11H12V12.5ZM20 20V18.5H4V20H20ZM20.0303 9.03033L17.0607 12L20.0303 14.9697L18.9697 16.0303L15.4697 12.5303L14.9393 12L15.4697 11.4697L18.9697 7.96967L20.0303 9.03033Z"})),md=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{d:"M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-8-3.5l3 3-3 3 1 1 4-4-4-4-1 1z"}));function ud(e){const{replaceBlocks:t,selectionChange:n,multiSelect:a}=(0,gt.useDispatch)(nt.store),{getBlock:o,getPreviousBlockClientId:r,getSelectionStart:l,getSelectionEnd:i,hasMultiSelection:s,getMultiSelectedBlockClientIds:c}=(0,gt.useSelect)(nt.store);return(0,_t.useCallback)((()=>{const m=s(),u=m?c():[e],p=u.map((e=>(0,Qe.cloneBlock)(o(e)))),d=r(e),g=(0,Qe.cloneBlock)(o(d));g.innerBlocks?.length||(g.innerBlocks=[(0,Qe.createBlock)("core/list")]),g.innerBlocks[g.innerBlocks.length-1].innerBlocks.push(...p);const h=l(),b=i();t([d,...u],[g]),m?a(p[0].clientId,p[p.length-1].clientId):n(p[0].clientId,b.attributeKey,b.clientId===h.clientId?h.offset:b.offset,b.offset)}),[e])}function pd(){const e=(0,gt.useRegistry)(),{moveBlocksToPosition:t,removeBlock:n,insertBlock:a,updateBlockListSettings:o}=(0,gt.useDispatch)(nt.store),{getBlockRootClientId:r,getBlockName:l,getBlockOrder:i,getBlockIndex:s,getSelectedBlockClientIds:c,getBlock:m,getBlockListSettings:u}=(0,gt.useSelect)(nt.store);return(0,_t.useCallback)(((p=c())=>{if(Array.isArray(p)||(p=[p]),!p.length)return;const d=p[0];if("core/list-item"!==l(d))return;const g=function(e){const t=r(e),n=r(t);if(n&&"core/list-item"===l(n))return n}(d);if(!g)return;const h=r(d),b=p[p.length-1],_=i(h).slice(s(b)+1);e.batch((()=>{if(_.length){let e=i(d)[0];if(!e){const t=(0,Qe.cloneBlock)(m(h),{},[]);e=t.clientId,a(t,0,d,!1),o(e,u(h))}t(_,h,e)}if(t(p,h,r(g),s(g)+1),!i(h).length){n(h,!1)}}))}),[])}function dd(e,t){const n=(0,gt.useRegistry)(),{getPreviousBlockClientId:a,getNextBlockClientId:o,getBlockOrder:r,getBlockRootClientId:l,getBlockName:i}=(0,gt.useSelect)(nt.store),{mergeBlocks:s,moveBlocksToPosition:c}=(0,gt.useDispatch)(nt.store),m=pd();function u(e){const t=r(e);return t.length?u(t[t.length-1]):e}function p(e){const t=l(e),n=l(t);if(n&&"core/list-item"===i(n))return n}function d(e){const t=o(e);if(t)return t;const n=p(e);return n?d(n):void 0}function g(e){const t=r(e);return t.length?r(t[0])[0]:d(e)}return o=>{function i(e,t){n.batch((()=>{const[n]=r(t);n&&c(r(n),n,l(e)),s(e,t)}))}if(o){const n=g(e);if(!n)return void t(o);p(n)?m(n):i(e,n)}else{const n=a(e);if(p(e))m(e);else if(n){i(u(n),e)}else t(o)}}}function gd(e){const t=(0,Qe.switchToBlockType)(e,"core/list");if(t)return t;const n=(0,Qe.switchToBlockType)(e,"core/paragraph");return n?(0,Qe.switchToBlockType)(n,"core/list"):null}function hd({clientId:e}){const t=ud(e),n=pd(),{canIndent:a,canOutdent:o}=(0,gt.useSelect)((t=>{const{getBlockIndex:n,getBlockRootClientId:a,getBlockName:o}=t(nt.store);return{canIndent:n(e)>0,canOutdent:"core/list-item"===o(a(a(e)))}}),[e]);return(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(et.ToolbarButton,{icon:(0,tt.isRTL)()?Op:Gp,title:(0,tt.__)("Outdent"),describedBy:(0,tt.__)("Outdent list item"),disabled:!o,onClick:()=>n()}),(0,Ke.createElement)(et.ToolbarButton,{icon:(0,tt.isRTL)()?cd:md,title:(0,tt.__)("Indent"),describedBy:(0,tt.__)("Indent list item"),isDisabled:!a,onClick:()=>t()}))}const bd={to:[{type:"block",blocks:["core/paragraph"],transform:(e,t=[])=>[(0,Qe.createBlock)("core/paragraph",e),...t.map((e=>(0,Qe.cloneBlock)(e)))]}]},_d=bd,yd={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/list-item",title:"List item",category:"text",parent:["core/list"],allowedBlocks:["core/list"],description:"Create a list item.",textdomain:"default",attributes:{placeholder:{type:"string"},content:{type:"rich-text",source:"rich-text",selector:"li",__experimentalRole:"content"}},supports:{className:!1,__experimentalSelector:"li",spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}}},{name:vd}=yd,fd={icon:sd,edit:function({attributes:e,setAttributes:t,onReplace:n,clientId:a,mergeBlocks:o}){const{placeholder:r,content:l}=e,i=(0,nt.useBlockProps)(),s=(0,nt.useInnerBlocksProps)(i,{renderAppender:!1,__unstableDisableDropZone:!0}),c=function(e){const{replaceBlocks:t,selectionChange:n}=(0,gt.useDispatch)(nt.store),{getBlock:a,getBlockRootClientId:o,getBlockIndex:r,getBlockName:l}=(0,gt.useSelect)(nt.store),i=(0,_t.useRef)(e);i.current=e;const s=pd();return(0,jt.useRefEffect)((e=>{function c(e){if(e.defaultPrevented||e.keyCode!==fn.ENTER)return;const{content:c,clientId:m}=i.current;if(c.length)return;if(e.preventDefault(),"core/list-item"===l(o(o(i.current.clientId))))return void s();const u=a(o(m)),p=r(m),d=(0,Qe.cloneBlock)({...u,innerBlocks:u.innerBlocks.slice(0,p)}),g=(0,Qe.createBlock)((0,Qe.getDefaultBlockName)()),h=[...u.innerBlocks[p].innerBlocks[0]?.innerBlocks||[],...u.innerBlocks.slice(p+1)],b=h.length?[(0,Qe.cloneBlock)({...u,innerBlocks:h})]:[];t(u.clientId,[d,g,...b],1),n(g.clientId)}return e.addEventListener("keydown",c),()=>{e.removeEventListener("keydown",c)}}),[])}({content:l,clientId:a}),m=function(e){const{getSelectionStart:t,getSelectionEnd:n,getBlockIndex:a}=(0,gt.useSelect)(nt.store),o=ud(e);return(0,jt.useRefEffect)((r=>{function l(r){const{keyCode:l,shiftKey:i,altKey:s,metaKey:c,ctrlKey:m}=r;if(r.defaultPrevented||l!==fn.SPACE||i||s||c||m)return;if(0===a(e))return;const u=t(),p=n();0===u.offset&&0===p.offset&&(r.preventDefault(),o())}return r.addEventListener("keydown",l),()=>{r.removeEventListener("keydown",l)}}),[e,o])}(a),u=function(e){const t=(0,_t.useRef)(!1),{getBlock:n}=(0,gt.useSelect)(nt.store);return(0,_t.useCallback)((a=>{const o=n(e);return t.current?(0,Qe.cloneBlock)(o,{content:a}):(t.current=!0,(0,Qe.createBlock)(o.name,{...o.attributes,content:a}))}),[e,n])}(a),p=dd(a,o);return(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)("li",{...s},(0,Ke.createElement)(nt.RichText,{ref:(0,jt.useMergeRefs)([c,m]),identifier:"content",tagName:"div",onChange:e=>t({content:e}),value:l,"aria-label":(0,tt.__)("List text"),placeholder:r||(0,tt.__)("List"),onSplit:u,onMerge:p,onReplace:n?(e,...t)=>{n(function(e){const t=[];for(let n of e)if("core/list-item"===n.name)t.push(n);else if("core/list"===n.name)t.push(...n.innerBlocks);else if(n=gd(n))for(const{innerBlocks:e}of n)t.push(...e);return t}(e),...t)}:void 0}),s.children),(0,Ke.createElement)(nt.BlockControls,{group:"block"},(0,Ke.createElement)(hd,{clientId:a})))},save:function({attributes:e}){return(0,Ke.createElement)("li",{...nt.useBlockProps.save()},(0,Ke.createElement)(nt.RichText.Content,{value:e.content}),(0,Ke.createElement)(nt.InnerBlocks.Content,null))},merge:(e,t)=>({...e,content:e.content+t.content}),transforms:_d,[Ft(nt.privateApis).requiresWrapperOnCopy]:!0},kd=()=>Xe({name:vd,metadata:yd,settings:fd}),xd=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{d:"M11 14.5l1.1 1.1 3-3 .5-.5-.6-.6-3-3-1 1 1.7 1.7H5v1.5h7.7L11 14.5zM16.8 5h-7c-1.1 0-2 .9-2 2v1.5h1.5V7c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v10c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5v-1.5H7.8V17c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2z"}));const wd={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/loginout",title:"Login/out",category:"theme",description:"Show login & logout links.",keywords:["login","logout","form"],textdomain:"default",attributes:{displayLoginAsForm:{type:"boolean",default:!1},redirectToCurrent:{type:"boolean",default:!0}},supports:{className:!0,spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}}},{name:Ed}=wd,Cd={icon:xd,edit:function({attributes:e,setAttributes:t}){const{displayLoginAsForm:n,redirectToCurrent:a}=e;return(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(nt.InspectorControls,null,(0,Ke.createElement)(et.PanelBody,{title:(0,tt.__)("Settings")},(0,Ke.createElement)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Display login as form"),checked:n,onChange:()=>t({displayLoginAsForm:!n})}),(0,Ke.createElement)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Redirect to current URL"),checked:a,onChange:()=>t({redirectToCurrent:!a})}))),(0,Ke.createElement)("div",{...(0,nt.useBlockProps)({className:"logged-in"})},(0,Ke.createElement)("a",{href:"#login-pseudo-link"},(0,tt.__)("Log out"))))}},Sd=()=>Xe({name:Ed,metadata:wd,settings:Cd}),Bd=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{d:"M3 6v11.5h8V6H3Zm11 3h7V7.5h-7V9Zm7 3.5h-7V11h7v1.5ZM14 16h7v-1.5h-7V16Z"})),Nd="full",Td="media",Id="attachment",Pd=[["core/paragraph",{placeholder:(0,tt._x)("Content…","content placeholder")}]],Md=(e,t)=>e?{backgroundImage:`url(${e})`,backgroundPosition:t?`${100*t.x}% ${100*t.y}%`:"50% 50%"}:{},zd=50,Rd=()=>{},Ad=e=>{if(!e.customBackgroundColor)return e;const t={color:{background:e.customBackgroundColor}},{customBackgroundColor:n,...a}=e;return{...a,style:t}},Hd=e=>e.align?e:{...e,align:"wide"},Ld={align:{type:"string",default:"wide"},mediaAlt:{type:"string",source:"attribute",selector:"figure img",attribute:"alt",default:""},mediaPosition:{type:"string",default:"left"},mediaId:{type:"number"},mediaType:{type:"string"},mediaWidth:{type:"number",default:50},isStackedOnMobile:{type:"boolean",default:!1}},Dd={...Ld,isStackedOnMobile:{type:"boolean",default:!0},mediaUrl:{type:"string",source:"attribute",selector:"figure video,figure img",attribute:"src"},mediaLink:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure a",attribute:"target"},href:{type:"string",source:"attribute",selector:"figure a",attribute:"href"},rel:{type:"string",source:"attribute",selector:"figure a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure a",attribute:"class"},mediaSizeSlug:{type:"string"},verticalAlignment:{type:"string"},imageFill:{type:"boolean"},focalPoint:{type:"object"}},Fd={anchor:!0,align:["wide","full"],html:!1,color:{gradients:!0,link:!0}},Vd={attributes:{...Dd,mediaAlt:{type:"string",source:"attribute",selector:"figure img",attribute:"alt",default:"",__experimentalRole:"content"},mediaId:{type:"number",__experimentalRole:"content"},mediaUrl:{type:"string",source:"attribute",selector:"figure video,figure img",attribute:"src",__experimentalRole:"content"},href:{type:"string",source:"attribute",selector:"figure a",attribute:"href",__experimentalRole:"content"},mediaType:{type:"string",__experimentalRole:"content"}},supports:{...Fd,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}}},save({attributes:e}){const{isStackedOnMobile:t,mediaAlt:n,mediaPosition:a,mediaType:o,mediaUrl:r,mediaWidth:l,mediaId:i,verticalAlignment:s,imageFill:c,focalPoint:m,linkClass:u,href:p,linkTarget:d,rel:g}=e,h=e.mediaSizeSlug||Nd,b=g||void 0,_=ut()({[`wp-image-${i}`]:i&&"image"===o,[`size-${h}`]:i&&"image"===o});let y=(0,Ke.createElement)("img",{src:r,alt:n,className:_||null});p&&(y=(0,Ke.createElement)("a",{className:u,href:p,target:d,rel:b},y));const v={image:()=>y,video:()=>(0,Ke.createElement)("video",{controls:!0,src:r})},f=ut()({"has-media-on-the-right":"right"===a,"is-stacked-on-mobile":t,[`is-vertically-aligned-${s}`]:s,"is-image-fill":c}),k=c?((e,t)=>e?{backgroundImage:`url(${e})`,backgroundPosition:t?`${Math.round(100*t.x)}% ${Math.round(100*t.y)}%`:"50% 50%"}:{})(r,m):{};let x;l!==zd&&(x="right"===a?`auto ${l}%`:`${l}% auto`);const w={gridTemplateColumns:x};return"right"===a?(0,Ke.createElement)("div",{...nt.useBlockProps.save({className:f,style:w})},(0,Ke.createElement)("div",{...nt.useInnerBlocksProps.save({className:"wp-block-media-text__content"})}),(0,Ke.createElement)("figure",{className:"wp-block-media-text__media",style:k},(v[o]||Rd)())):(0,Ke.createElement)("div",{...nt.useBlockProps.save({className:f,style:w})},(0,Ke.createElement)("figure",{className:"wp-block-media-text__media",style:k},(v[o]||Rd)()),(0,Ke.createElement)("div",{...nt.useInnerBlocksProps.save({className:"wp-block-media-text__content"})}))},migrate:Hd,isEligible(e,t,{block:n}){const{attributes:a}=n;return void 0===e.align&&!!a.className?.includes("alignwide")}},$d={attributes:Dd,supports:Fd,save({attributes:e}){const{isStackedOnMobile:t,mediaAlt:n,mediaPosition:a,mediaType:o,mediaUrl:r,mediaWidth:l,mediaId:i,verticalAlignment:s,imageFill:c,focalPoint:m,linkClass:u,href:p,linkTarget:d,rel:g}=e,h=e.mediaSizeSlug||Nd,b=g||void 0,_=ut()({[`wp-image-${i}`]:i&&"image"===o,[`size-${h}`]:i&&"image"===o});let y=(0,Ke.createElement)("img",{src:r,alt:n,className:_||null});p&&(y=(0,Ke.createElement)("a",{className:u,href:p,target:d,rel:b},y));const v={image:()=>y,video:()=>(0,Ke.createElement)("video",{controls:!0,src:r})},f=ut()({"has-media-on-the-right":"right"===a,"is-stacked-on-mobile":t,[`is-vertically-aligned-${s}`]:s,"is-image-fill":c}),k=c?Md(r,m):{};let x;l!==zd&&(x="right"===a?`auto ${l}%`:`${l}% auto`);const w={gridTemplateColumns:x};return"right"===a?(0,Ke.createElement)("div",{...nt.useBlockProps.save({className:f,style:w})},(0,Ke.createElement)("div",{...nt.useInnerBlocksProps.save({className:"wp-block-media-text__content"})}),(0,Ke.createElement)("figure",{className:"wp-block-media-text__media",style:k},(v[o]||Rd)())):(0,Ke.createElement)("div",{...nt.useBlockProps.save({className:f,style:w})},(0,Ke.createElement)("figure",{className:"wp-block-media-text__media",style:k},(v[o]||Rd)()),(0,Ke.createElement)("div",{...nt.useInnerBlocksProps.save({className:"wp-block-media-text__content"})}))},migrate:Hd},Od={attributes:Dd,supports:Fd,save({attributes:e}){const{isStackedOnMobile:t,mediaAlt:n,mediaPosition:a,mediaType:o,mediaUrl:r,mediaWidth:l,mediaId:i,verticalAlignment:s,imageFill:c,focalPoint:m,linkClass:u,href:p,linkTarget:d,rel:g}=e,h=e.mediaSizeSlug||Nd,b=g||void 0,_=ut()({[`wp-image-${i}`]:i&&"image"===o,[`size-${h}`]:i&&"image"===o});let y=(0,Ke.createElement)("img",{src:r,alt:n,className:_||null});p&&(y=(0,Ke.createElement)("a",{className:u,href:p,target:d,rel:b},y));const v={image:()=>y,video:()=>(0,Ke.createElement)("video",{controls:!0,src:r})},f=ut()({"has-media-on-the-right":"right"===a,"is-stacked-on-mobile":t,[`is-vertically-aligned-${s}`]:s,"is-image-fill":c}),k=c?Md(r,m):{};let x;l!==zd&&(x="right"===a?`auto ${l}%`:`${l}% auto`);const w={gridTemplateColumns:x};return(0,Ke.createElement)("div",{...nt.useBlockProps.save({className:f,style:w})},(0,Ke.createElement)("figure",{className:"wp-block-media-text__media",style:k},(v[o]||Rd)()),(0,Ke.createElement)("div",{...nt.useInnerBlocksProps.save({className:"wp-block-media-text__content"})}))},migrate:Hd},Gd={attributes:{...Ld,isStackedOnMobile:{type:"boolean",default:!0},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},mediaLink:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure a",attribute:"target"},href:{type:"string",source:"attribute",selector:"figure a",attribute:"href"},rel:{type:"string",source:"attribute",selector:"figure a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure a",attribute:"class"},verticalAlignment:{type:"string"},imageFill:{type:"boolean"},focalPoint:{type:"object"}},migrate:(0,jt.compose)(Ad,Hd),save({attributes:e}){const{backgroundColor:t,customBackgroundColor:n,isStackedOnMobile:a,mediaAlt:o,mediaPosition:r,mediaType:l,mediaUrl:i,mediaWidth:s,mediaId:c,verticalAlignment:m,imageFill:u,focalPoint:p,linkClass:d,href:g,linkTarget:h,rel:b}=e,_=b||void 0;let y=(0,Ke.createElement)("img",{src:i,alt:o,className:c&&"image"===l?`wp-image-${c}`:null});g&&(y=(0,Ke.createElement)("a",{className:d,href:g,target:h,rel:_},y));const v={image:()=>y,video:()=>(0,Ke.createElement)("video",{controls:!0,src:i})},f=(0,nt.getColorClassName)("background-color",t),k=ut()({"has-media-on-the-right":"right"===r,"has-background":f||n,[f]:f,"is-stacked-on-mobile":a,[`is-vertically-aligned-${m}`]:m,"is-image-fill":u}),x=u?Md(i,p):{};let w;s!==zd&&(w="right"===r?`auto ${s}%`:`${s}% auto`);const E={backgroundColor:f?void 0:n,gridTemplateColumns:w};return(0,Ke.createElement)("div",{className:k,style:E},(0,Ke.createElement)("figure",{className:"wp-block-media-text__media",style:x},(v[l]||Rd)()),(0,Ke.createElement)("div",{className:"wp-block-media-text__content"},(0,Ke.createElement)(nt.InnerBlocks.Content,null)))}},Ud={attributes:{...Ld,backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},mediaUrl:{type:"string",source:"attribute",selector:"figure video,figure img",attribute:"src"},verticalAlignment:{type:"string"},imageFill:{type:"boolean"},focalPoint:{type:"object"}},migrate:(0,jt.compose)(Ad,Hd),save({attributes:e}){const{backgroundColor:t,customBackgroundColor:n,isStackedOnMobile:a,mediaAlt:o,mediaPosition:r,mediaType:l,mediaUrl:i,mediaWidth:s,mediaId:c,verticalAlignment:m,imageFill:u,focalPoint:p}=e,d={image:()=>(0,Ke.createElement)("img",{src:i,alt:o,className:c&&"image"===l?`wp-image-${c}`:null}),video:()=>(0,Ke.createElement)("video",{controls:!0,src:i})},g=(0,nt.getColorClassName)("background-color",t),h=ut()({"has-media-on-the-right":"right"===r,[g]:g,"is-stacked-on-mobile":a,[`is-vertically-aligned-${m}`]:m,"is-image-fill":u}),b=u?Md(i,p):{};let _;s!==zd&&(_="right"===r?`auto ${s}%`:`${s}% auto`);const y={backgroundColor:g?void 0:n,gridTemplateColumns:_};return(0,Ke.createElement)("div",{className:h,style:y},(0,Ke.createElement)("figure",{className:"wp-block-media-text__media",style:b},(d[l]||Rd)()),(0,Ke.createElement)("div",{className:"wp-block-media-text__content"},(0,Ke.createElement)(nt.InnerBlocks.Content,null)))}},qd={attributes:{...Ld,backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},mediaUrl:{type:"string",source:"attribute",selector:"figure video,figure img",attribute:"src"}},migrate:Hd,save({attributes:e}){const{backgroundColor:t,customBackgroundColor:n,isStackedOnMobile:a,mediaAlt:o,mediaPosition:r,mediaType:l,mediaUrl:i,mediaWidth:s}=e,c={image:()=>(0,Ke.createElement)("img",{src:i,alt:o}),video:()=>(0,Ke.createElement)("video",{controls:!0,src:i})},m=(0,nt.getColorClassName)("background-color",t),u=ut()({"has-media-on-the-right":"right"===r,[m]:m,"is-stacked-on-mobile":a});let p;s!==zd&&(p="right"===r?`auto ${s}%`:`${s}% auto`);const d={backgroundColor:m?void 0:n,gridTemplateColumns:p};return(0,Ke.createElement)("div",{className:u,style:d},(0,Ke.createElement)("figure",{className:"wp-block-media-text__media"},(c[l]||Rd)()),(0,Ke.createElement)("div",{className:"wp-block-media-text__content"},(0,Ke.createElement)(nt.InnerBlocks.Content,null)))}},jd=[Vd,$d,Od,Gd,Ud,qd],Wd=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{d:"M4 18h6V6H4v12zm9-9.5V10h7V8.5h-7zm0 7h7V14h-7v1.5z"})),Zd=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{d:"M14 6v12h6V6h-6zM4 10h7V8.5H4V10zm0 5.5h7V14H4v1.5z"})),Qd=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{d:"m7 6.5 4 2.5-4 2.5z"}),(0,Ke.createElement)(Ye.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"m5 3c-1.10457 0-2 .89543-2 2v14c0 1.1046.89543 2 2 2h14c1.1046 0 2-.8954 2-2v-14c0-1.10457-.8954-2-2-2zm14 1.5h-14c-.27614 0-.5.22386-.5.5v10.7072l3.62953-2.6465c.25108-.1831.58905-.1924.84981-.0234l2.92666 1.8969 3.5712-3.4719c.2911-.2831.7545-.2831 1.0456 0l2.9772 2.8945v-9.3568c0-.27614-.2239-.5-.5-.5zm-14.5 14.5v-1.4364l4.09643-2.987 2.99567 1.9417c.2936.1903.6798.1523.9307-.0917l3.4772-3.3806 3.4772 3.3806.0228-.0234v2.5968c0 .2761-.2239.5-.5.5h-14c-.27614 0-.5-.2239-.5-.5z"})),Kd=["image","video"],Yd=()=>{};function Jd(e,t){return e?{backgroundImage:`url(${e})`,backgroundPosition:t?`${Math.round(100*t.x)}% ${Math.round(100*t.y)}%`:"50% 50%"}:{}}const Xd=(0,_t.forwardRef)((({isSelected:e,isStackedOnMobile:t,...n},a)=>{const o=(0,jt.useViewportMatch)("small","<");return(0,Ke.createElement)(et.ResizableBox,{ref:a,showHandle:e&&(!o||!t),...n})}));function eg({mediaId:e,mediaUrl:t,onSelectMedia:n}){return(0,Ke.createElement)(nt.BlockControls,{group:"other"},(0,Ke.createElement)(nt.MediaReplaceFlow,{mediaId:e,mediaURL:t,allowedTypes:Kd,accept:"image/*,video/*",onSelect:n}))}function tg({className:e,mediaUrl:t,onSelectMedia:n}){const{createErrorNotice:a}=(0,gt.useDispatch)(Pt.store);return(0,Ke.createElement)(nt.MediaPlaceholder,{icon:(0,Ke.createElement)(nt.BlockIcon,{icon:Qd}),labels:{title:(0,tt.__)("Media area")},className:e,onSelect:n,accept:"image/*,video/*",allowedTypes:Kd,onError:e=>{a(e,{type:"snackbar"})},disableMediaButtons:t})}const ng=(0,_t.forwardRef)((function(e,t){const{className:n,commitWidthChange:a,focalPoint:o,imageFill:r,isSelected:l,isStackedOnMobile:i,mediaAlt:s,mediaId:c,mediaPosition:m,mediaType:u,mediaUrl:p,mediaWidth:d,onSelectMedia:g,onWidthChange:h,enableResize:b}=e,_=!c&&(0,It.isBlobURL)(p),{toggleSelection:y}=(0,gt.useDispatch)(nt.store);if(p){const v=()=>{y(!1)},f=(e,t,n)=>{h(parseInt(n.style.width))},k=(e,t,n)=>{y(!0),a(parseInt(n.style.width))},x={right:b&&"left"===m,left:b&&"right"===m},w="image"===u&&r?Jd(p,o):{},E={image:()=>(0,Ke.createElement)("img",{src:p,alt:s}),video:()=>(0,Ke.createElement)("video",{controls:!0,src:p})};return(0,Ke.createElement)(Xd,{as:"figure",className:ut()(n,"editor-media-container__resizer",{"is-transient":_}),style:w,size:{width:d+"%"},minWidth:"10%",maxWidth:"100%",enable:x,onResizeStart:v,onResize:f,onResizeStop:k,axis:"x",isSelected:l,isStackedOnMobile:i,ref:t},(0,Ke.createElement)(eg,{onSelectMedia:g,mediaUrl:p,mediaId:c}),(E[u]||Yd)(),_&&(0,Ke.createElement)(et.Spinner,null),(0,Ke.createElement)(tg,{...e}))}return(0,Ke.createElement)(tg,{...e})})),ag=e=>Math.max(15,Math.min(e,85));function og(e,t){return e?.media_details?.sizes?.[t]?.source_url}const rg=function({attributes:e,isSelected:t,setAttributes:n}){const{focalPoint:a,href:o,imageFill:r,isStackedOnMobile:l,linkClass:i,linkDestination:s,linkTarget:c,mediaAlt:m,mediaId:u,mediaPosition:p,mediaType:d,mediaUrl:g,mediaWidth:h,rel:b,verticalAlignment:_,allowedBlocks:y}=e,v=e.mediaSizeSlug||Nd,{imageSizes:f,image:k}=(0,gt.useSelect)((e=>{const{getSettings:n}=e(nt.store);return{image:u&&t?e(dt.store).getMedia(u,{context:"view"}):null,imageSizes:n()?.imageSizes}}),[t,u]),x=(0,_t.useRef)(),w=e=>{const{style:t}=x.current.resizable,{x:n,y:a}=e;t.backgroundPosition=`${100*n}% ${100*a}%`},[E,C]=(0,_t.useState)(null),S=function({attributes:{linkDestination:e,href:t},setAttributes:n}){return a=>{if(!a||!a.url)return void n({mediaAlt:void 0,mediaId:void 0,mediaType:void 0,mediaUrl:void 0,mediaLink:void 0,href:void 0,focalPoint:void 0});let o,r;(0,It.isBlobURL)(a.url)&&(a.type=(0,It.getBlobTypeByURL)(a.url)),o=a.media_type?"image"===a.media_type?"image":"video":a.type,"image"===o&&(r=a.sizes?.large?.url||a.media_details?.sizes?.large?.source_url);let l=t;e===Td&&(l=a.url),e===Id&&(l=a.link),n({mediaAlt:a.alt,mediaId:a.id,mediaType:o,mediaUrl:r||a.url,mediaLink:a.link||void 0,href:l,focalPoint:void 0})}}({attributes:e,setAttributes:n}),B=e=>{n({mediaWidth:ag(e)}),C(null)},N=ut()({"has-media-on-the-right":"right"===p,"is-selected":t,"is-stacked-on-mobile":l,[`is-vertically-aligned-${_}`]:_,"is-image-fill":r}),T=`${E||h}%`,I="right"===p?`1fr ${T}`:`${T} 1fr`,P={gridTemplateColumns:I,msGridColumns:I},M=f.filter((({slug:e})=>og(k,e))).map((({name:e,slug:t})=>({value:t,label:e}))),z=(0,Ke.createElement)(et.PanelBody,{title:(0,tt.__)("Settings")},(0,Ke.createElement)(et.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,tt.__)("Media width"),value:E||h,onChange:B,min:15,max:85}),(0,Ke.createElement)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Stack on mobile"),checked:l,onChange:()=>n({isStackedOnMobile:!l})}),"image"===d&&(0,Ke.createElement)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Crop image to fill"),checked:!!r,onChange:()=>n({imageFill:!r})}),r&&g&&"image"===d&&(0,Ke.createElement)(et.FocalPointPicker,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,tt.__)("Focal point"),url:g,value:a,onChange:e=>n({focalPoint:e}),onDragStart:w,onDrag:w}),"image"===d&&(0,Ke.createElement)(et.TextareaControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Alternative text"),value:m,onChange:e=>{n({mediaAlt:e})},help:(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(et.ExternalLink,{href:"https://www.w3.org/WAI/tutorials/images/decision-tree"},(0,tt.__)("Describe the purpose of the image.")),(0,Ke.createElement)("br",null),(0,tt.__)("Leave empty if decorative."))}),"image"===d&&(0,Ke.createElement)(nt.__experimentalImageSizeControl,{onChangeImage:e=>{const t=og(k,e);if(!t)return null;n({mediaUrl:t,mediaSizeSlug:e})},slug:v,imageSizeOptions:M,isResizable:!1,imageSizeHelp:(0,tt.__)("Select the size of the source image.")})),R=(0,nt.useBlockProps)({className:N,style:P}),A=(0,nt.useInnerBlocksProps)({className:"wp-block-media-text__content"},{template:Pd,allowedBlocks:y}),H=(0,nt.useBlockEditingMode)();return(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(nt.InspectorControls,null,z),(0,Ke.createElement)(nt.BlockControls,{group:"block"},"default"===H&&(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(nt.BlockVerticalAlignmentControl,{onChange:e=>{n({verticalAlignment:e})},value:_}),(0,Ke.createElement)(et.ToolbarButton,{icon:Wd,title:(0,tt.__)("Show media on left"),isActive:"left"===p,onClick:()=>n({mediaPosition:"left"})}),(0,Ke.createElement)(et.ToolbarButton,{icon:Zd,title:(0,tt.__)("Show media on right"),isActive:"right"===p,onClick:()=>n({mediaPosition:"right"})})),"image"===d&&(0,Ke.createElement)(nt.__experimentalImageURLInputUI,{url:o||"",onChangeUrl:e=>{n(e)},linkDestination:s,mediaType:d,mediaUrl:k&&k.source_url,mediaLink:k&&k.link,linkTarget:c,linkClass:i,rel:b})),(0,Ke.createElement)("div",{...R},"right"===p&&(0,Ke.createElement)("div",{...A}),(0,Ke.createElement)(ng,{className:"wp-block-media-text__media",onSelectMedia:S,onWidthChange:e=>{C(ag(e))},commitWidthChange:B,ref:x,enableResize:"default"===H,focalPoint:a,imageFill:r,isSelected:t,isStackedOnMobile:l,mediaAlt:m,mediaId:u,mediaPosition:p,mediaType:d,mediaUrl:g,mediaWidth:h}),"right"!==p&&(0,Ke.createElement)("div",{...A})))},lg=()=>{};const ig={from:[{type:"block",blocks:["core/image"],transform:({alt:e,url:t,id:n,anchor:a})=>(0,Qe.createBlock)("core/media-text",{mediaAlt:e,mediaId:n,mediaUrl:t,mediaType:"image",anchor:a})},{type:"block",blocks:["core/video"],transform:({src:e,id:t,anchor:n})=>(0,Qe.createBlock)("core/media-text",{mediaId:t,mediaUrl:e,mediaType:"video",anchor:n})},{type:"block",blocks:["core/cover"],transform:({align:e,alt:t,anchor:n,backgroundType:a,customGradient:o,customOverlayColor:r,gradient:l,id:i,overlayColor:s,style:c,textColor:m,url:u},p)=>{let d={};return o?d={style:{color:{gradient:o}}}:r&&(d={style:{color:{background:r}}}),c?.color?.text&&(d.style={color:{...d.style?.color,text:c.color.text}}),(0,Qe.createBlock)("core/media-text",{align:e,anchor:n,backgroundColor:s,gradient:l,mediaAlt:t,mediaId:i,mediaType:a,mediaUrl:u,textColor:m,...d},p)}}],to:[{type:"block",blocks:["core/image"],isMatch:({mediaType:e,mediaUrl:t})=>!t||"image"===e,transform:({mediaAlt:e,mediaId:t,mediaUrl:n,anchor:a})=>(0,Qe.createBlock)("core/image",{alt:e,id:t,url:n,anchor:a})},{type:"block",blocks:["core/video"],isMatch:({mediaType:e,mediaUrl:t})=>!t||"video"===e,transform:({mediaId:e,mediaUrl:t,anchor:n})=>(0,Qe.createBlock)("core/video",{id:e,src:t,anchor:n})},{type:"block",blocks:["core/cover"],transform:({align:e,anchor:t,backgroundColor:n,focalPoint:a,gradient:o,mediaAlt:r,mediaId:l,mediaType:i,mediaUrl:s,style:c,textColor:m},u)=>{const p={};c?.color?.gradient?p.customGradient=c.color.gradient:c?.color?.background&&(p.customOverlayColor=c.color.background),c?.color?.text&&(p.style={color:{text:c.color.text}});const d={align:e,alt:r,anchor:t,backgroundType:i,dimRatio:s?50:100,focalPoint:a,gradient:o,id:l,overlayColor:n,textColor:m,url:s,...p};return(0,Qe.createBlock)("core/cover",d,u)}}]},sg=ig,cg={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/media-text",title:"Media & Text",category:"media",description:"Set media and words side-by-side for a richer layout.",keywords:["image","video"],textdomain:"default",attributes:{align:{type:"string",default:"none"},mediaAlt:{type:"string",source:"attribute",selector:"figure img",attribute:"alt",default:"",__experimentalRole:"content"},mediaPosition:{type:"string",default:"left"},mediaId:{type:"number",__experimentalRole:"content"},mediaUrl:{type:"string",source:"attribute",selector:"figure video,figure img",attribute:"src",__experimentalRole:"content"},mediaLink:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure a",attribute:"target"},href:{type:"string",source:"attribute",selector:"figure a",attribute:"href",__experimentalRole:"content"},rel:{type:"string",source:"attribute",selector:"figure a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure a",attribute:"class"},mediaType:{type:"string",__experimentalRole:"content"},mediaWidth:{type:"number",default:50},mediaSizeSlug:{type:"string"},isStackedOnMobile:{type:"boolean",default:!0},verticalAlignment:{type:"string"},imageFill:{type:"boolean"},focalPoint:{type:"object"},allowedBlocks:{type:"array"}},supports:{anchor:!0,align:["wide","full"],html:!1,color:{gradients:!0,heading:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-media-text-editor",style:"wp-block-media-text"},{name:mg}=cg,ug={icon:Bd,example:{viewportWidth:601,attributes:{mediaType:"image",mediaUrl:"https://s.w.org/images/core/5.3/Biologia_Centrali-Americana_-_Cantorchilus_semibadius_1902.jpg"},innerBlocks:[{name:"core/paragraph",attributes:{content:(0,tt.__)("The wren
Earns his living
Noiselessly.")}},{name:"core/paragraph",attributes:{content:(0,tt.__)("— Kobayashi Issa (一茶)")}}]},transforms:sg,edit:rg,save:function({attributes:e}){const{isStackedOnMobile:t,mediaAlt:n,mediaPosition:a,mediaType:o,mediaUrl:r,mediaWidth:l,mediaId:i,verticalAlignment:s,imageFill:c,focalPoint:m,linkClass:u,href:p,linkTarget:d,rel:g}=e,h=e.mediaSizeSlug||Nd,b=g||void 0,_=ut()({[`wp-image-${i}`]:i&&"image"===o,[`size-${h}`]:i&&"image"===o});let y=(0,Ke.createElement)("img",{src:r,alt:n,className:_||null});p&&(y=(0,Ke.createElement)("a",{className:u,href:p,target:d,rel:b},y));const v={image:()=>y,video:()=>(0,Ke.createElement)("video",{controls:!0,src:r})},f=ut()({"has-media-on-the-right":"right"===a,"is-stacked-on-mobile":t,[`is-vertically-aligned-${s}`]:s,"is-image-fill":c}),k=c?Jd(r,m):{};let x;50!==l&&(x="right"===a?`auto ${l}%`:`${l}% auto`);const w={gridTemplateColumns:x};return"right"===a?(0,Ke.createElement)("div",{...nt.useBlockProps.save({className:f,style:w})},(0,Ke.createElement)("div",{...nt.useInnerBlocksProps.save({className:"wp-block-media-text__content"})}),(0,Ke.createElement)("figure",{className:"wp-block-media-text__media",style:k},(v[o]||lg)())):(0,Ke.createElement)("div",{...nt.useBlockProps.save({className:f,style:w})},(0,Ke.createElement)("figure",{className:"wp-block-media-text__media",style:k},(v[o]||lg)()),(0,Ke.createElement)("div",{...nt.useInnerBlocksProps.save({className:"wp-block-media-text__content"})}))},deprecated:jd},pg=()=>Xe({name:mg,metadata:cg,settings:ug});const dg=(0,gt.withDispatch)(((e,{clientId:t,attributes:n})=>{const{replaceBlock:a}=e(nt.store);return{convertToHTML(){a(t,(0,Qe.createBlock)("core/html",{content:n.originalUndelimitedContent}))}}}))((function({attributes:e,convertToHTML:t,clientId:n}){const{originalName:a,originalUndelimitedContent:o}=e,r=!!o,{hasFreeformBlock:l,hasHTMLBlock:i}=(0,gt.useSelect)((e=>{const{canInsertBlockType:t,getBlockRootClientId:a}=e(nt.store);return{hasFreeformBlock:t("core/freeform",a(n)),hasHTMLBlock:t("core/html",a(n))}}),[n]),s=[];let c;const m=(0,Ke.createElement)(et.Button,{key:"convert",onClick:t,variant:"primary"},(0,tt.__)("Keep as HTML"));return!r||l||a?r&&i?(c=(0,tt.sprintf)((0,tt.__)('Your site doesn’t include support for the "%s" block. You can leave this block intact, convert its content to a Custom HTML block, or remove it entirely.'),a),s.push(m)):c=(0,tt.sprintf)((0,tt.__)('Your site doesn’t include support for the "%s" block. You can leave this block intact or remove it entirely.'),a):i?(c=(0,tt.__)("It appears you are trying to use the deprecated Classic block. You can leave this block intact, convert its content to a Custom HTML block, or remove it entirely. Alternatively, you can refresh the page to use the Classic block."),s.push(m)):c=(0,tt.__)("It appears you are trying to use the deprecated Classic block. You can leave this block intact, or remove it entirely. Alternatively, you can refresh the page to use the Classic block."),(0,Ke.createElement)("div",{...(0,nt.useBlockProps)({className:"has-warning"})},(0,Ke.createElement)(nt.Warning,{actions:s},c),(0,Ke.createElement)(_t.RawHTML,null,(0,ac.safeHTML)(o)))})),gg=dg;const hg={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/missing",title:"Unsupported",category:"text",description:"Your site doesn’t include support for this block.",textdomain:"default",attributes:{originalName:{type:"string"},originalUndelimitedContent:{type:"string"},originalContent:{type:"string",source:"raw"}},supports:{className:!1,customClassName:!1,inserter:!1,html:!1,reusable:!1,interactivity:{clientNavigation:!0}}},{name:bg}=hg,_g={name:bg,__experimentalLabel(e,{context:t}){if("accessibility"===t){const{originalName:t}=e,n=t?(0,Qe.getBlockType)(t):void 0;return n?n.settings.title||t:""}},edit:gg,save:function({attributes:e}){return(0,Ke.createElement)(_t.RawHTML,null,e.originalContent)}},yg=()=>Xe({name:bg,metadata:hg,settings:_g}),vg=(0,Ke.createElement)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,Ke.createElement)(Ye.Path,{d:"M4 9v1.5h16V9H4zm12 5.5h4V13h-4v1.5zm-6 0h4V13h-4v1.5zm-6 0h4V13H4v1.5z"})),fg=(0,tt.__)("Read more");const kg={from:[{type:"raw",schema:{"wp-block":{attributes:["data-block"]}},isMatch:e=>e.dataset&&"core/more"===e.dataset.block,transform(e){const{customText:t,noTeaser:n}=e.dataset,a={};return t&&(a.customText=t),""===n&&(a.noTeaser=!0),(0,Qe.createBlock)("core/more",a)}}]},xg={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/more",title:"More",category:"design",description:"Content before this block will be shown in the excerpt on your archives page.",keywords:["read more"],textdomain:"default",attributes:{customText:{type:"string"},noTeaser:{type:"boolean",default:!1}},supports:{customClassName:!1,className:!1,html:!1,multiple:!1,interactivity:{clientNavigation:!0}},editorStyle:"wp-block-more-editor"},{name:wg}=xg,Eg={icon:vg,example:{},__experimentalLabel(e,{context:t}){const n=e?.metadata?.name;return"list-view"===t&&n?n:"accessibility"===t?e.customText:void 0},transforms:kg,edit:function({attributes:{customText:e,noTeaser:t},insertBlocksAfter:n,setAttributes:a}){const o={width:`${(e||fg).length+1.2}em`};return(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(nt.InspectorControls,null,(0,Ke.createElement)(et.PanelBody,null,(0,Ke.createElement)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Hide the excerpt on the full content page"),checked:!!t,onChange:()=>a({noTeaser:!t}),help:e=>e?(0,tt.__)("The excerpt is hidden."):(0,tt.__)("The excerpt is visible.")}))),(0,Ke.createElement)("div",{...(0,nt.useBlockProps)()},(0,Ke.createElement)("input",{"aria-label":(0,tt.__)("“Read more” link text"),type:"text",value:e,placeholder:fg,onChange:e=>{a({customText:""!==e.target.value?e.target.value:void 0})},onKeyDown:({keyCode:e})=>{e===fn.ENTER&&n([(0,Qe.createBlock)((0,Qe.getDefaultBlockName)())])},style:o})))},save:function({attributes:{customText:e,noTeaser:t}}){const n=e?`\x3c!--more ${e}--\x3e`:"\x3c!--more--\x3e",a=t?"\x3c!--noteaser--\x3e":"";return(0,Ke.createElement)(_t.RawHTML,null,[n,a].filter(Boolean).join("\n"))}},Cg=()=>Xe({name:wg,metadata:xg,settings:Eg}),Sg=(0,Ke.createElement)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,Ke.createElement)(Ye.Path,{d:"M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z"})),Bg=window.wp.a11y;const Ng=(0,_t.forwardRef)((function({icon:e,size:t=24,...n},a){return(0,_t.cloneElement)(e,{width:t,height:t,...n,ref:a})})),Tg=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"})),Ig={name:"core/navigation-link"},Pg=["core/navigation-link/page","core/navigation-link"],Mg={per_page:100,status:["publish","draft"],order:"desc",orderby:"date"},zg=["postType","wp_navigation",Mg];function Rg(e){const t=(0,dt.useResourcePermissions)("navigation",e),{navigationMenu:n,isNavigationMenuResolved:a,isNavigationMenuMissing:o}=(0,gt.useSelect)((t=>function(e,t){if(!t)return{isNavigationMenuResolved:!1,isNavigationMenuMissing:!0};const{getEntityRecord:n,getEditedEntityRecord:a,hasFinishedResolution:o}=e(dt.store),r=["postType","wp_navigation",t],l=n(...r),i=a(...r),s=o("getEditedEntityRecord",r),c="publish"===i.status||"draft"===i.status;return{isNavigationMenuResolved:s,isNavigationMenuMissing:s&&(!l||!c),navigationMenu:c?i:null}}(t,e)),[e]),{canCreate:r,canUpdate:l,canDelete:i,isResolving:s,hasResolved:c}=t,{records:m,isResolving:u,hasResolved:p}=(0,dt.useEntityRecords)("postType","wp_navigation",Mg);return{navigationMenu:n,isNavigationMenuResolved:a,isNavigationMenuMissing:o,navigationMenus:m,isResolvingNavigationMenus:u,hasResolvedNavigationMenus:p,canSwitchNavigationMenu:e?m?.length>1:m?.length>0,canUserCreateNavigationMenu:r,isResolvingCanUserCreateNavigationMenu:s,hasResolvedCanUserCreateNavigationMenu:c,canUserUpdateNavigationMenu:l,hasResolvedCanUserUpdateNavigationMenu:e?c:void 0,canUserDeleteNavigationMenu:i,hasResolvedCanUserDeleteNavigationMenu:e?c:void 0}}function Ag(e){const{records:t,isResolving:n,hasResolved:a}=(0,dt.useEntityRecords)("root","menu",{per_page:-1,context:"view"}),{records:o,isResolving:r,hasResolved:l}=(0,dt.useEntityRecords)("postType","page",{parent:0,order:"asc",orderby:"id",per_page:-1,context:"view"}),{records:i,hasResolved:s}=(0,dt.useEntityRecords)("root","menuItem",{menus:e,per_page:-1,context:"view"},{enabled:!!e});return{pages:o,isResolvingPages:r,hasResolvedPages:l,hasPages:!(!l||!o?.length),menus:t,isResolvingMenus:n,hasResolvedMenus:a,hasMenus:!(!a||!t?.length),menuItems:i,hasResolvedMenuItems:s}}const Hg=({isVisible:e=!0})=>(0,Ke.createElement)("div",{"aria-hidden":!e||void 0,className:"wp-block-navigation-placeholder__preview"},(0,Ke.createElement)("div",{className:"wp-block-navigation-placeholder__actions__indicator"},(0,Ke.createElement)(Ng,{icon:Sg}),(0,tt.__)("Navigation"))),Lg=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));const Dg=function({currentMenuId:e,onSelectNavigationMenu:t,onSelectClassicMenu:n,onCreateNew:a,actionLabel:o,createNavigationMenuIsSuccess:r,createNavigationMenuIsError:l}){const i=(0,tt.__)("Create from '%s'"),[s,c]=(0,_t.useState)(!1);o=o||i;const{menus:m}=Ag(),{navigationMenus:u,isResolvingNavigationMenus:p,hasResolvedNavigationMenus:d,canUserCreateNavigationMenu:g,canSwitchNavigationMenu:h}=Rg(),[b]=(0,dt.useEntityProp)("postType","wp_navigation","title"),_=(0,_t.useMemo)((()=>u?.map((({id:e,title:t,status:n},a)=>{const r=function(e,t,n){return e?"publish"===n?(0,Jn.decodeEntities)(e):(0,tt.sprintf)((0,tt.__)("%1$s (%2$s)"),(0,Jn.decodeEntities)(e),n):(0,tt.sprintf)((0,tt.__)("(no title %s)"),t)}(t?.rendered,a+1,n);return{value:e,label:r,ariaLabel:(0,tt.sprintf)(o,r),disabled:s||p||!d}}))||[]),[u,o,p,d,s]),y=!!u?.length,v=!!m?.length,f=!!h,k=!!g,x=y&&!e,w=!y&&d,E=d&&null===e;let C="";C=p?(0,tt.__)("Loading…"):x||w||E?(0,tt.__)("Choose or create a Navigation menu"):b,(0,_t.useEffect)((()=>{s&&(r||l)&&c(!1)}),[d,r,g,l,s,E,w,x]);const S=(0,Ke.createElement)(et.DropdownMenu,{label:C,icon:Lg,toggleProps:{isSmall:!0}},(({onClose:o})=>(0,Ke.createElement)(Ke.Fragment,null,f&&y&&(0,Ke.createElement)(et.MenuGroup,{label:(0,tt.__)("Menus")},(0,Ke.createElement)(et.MenuItemsChoice,{value:e,onSelect:e=>{t(e),o()},choices:_})),k&&v&&(0,Ke.createElement)(et.MenuGroup,{label:(0,tt.__)("Import Classic Menus")},m?.map((e=>{const t=(0,Jn.decodeEntities)(e.name);return(0,Ke.createElement)(et.MenuItem,{onClick:async()=>{c(!0),await n(e),c(!1),o()},key:e.id,"aria-label":(0,tt.sprintf)(i,t),disabled:s||p||!d},t)}))),g&&(0,Ke.createElement)(et.MenuGroup,{label:(0,tt.__)("Tools")},(0,Ke.createElement)(et.MenuItem,{onClick:async()=>{c(!0),await a(),c(!1),o()},disabled:s||p||!d},(0,tt.__)("Create new menu"))))));return S};function Fg({isSelected:e,currentMenuId:t,clientId:n,canUserCreateNavigationMenu:a=!1,isResolvingCanUserCreateNavigationMenu:o,onSelectNavigationMenu:r,onSelectClassicMenu:l,onCreateEmpty:i}){const{isResolvingMenus:s,hasResolvedMenus:c}=Ag();(0,_t.useEffect)((()=>{e&&(s&&(0,Bg.speak)((0,tt.__)("Loading navigation block setup options…")),c&&(0,Bg.speak)((0,tt.__)("Navigation block setup options ready.")))}),[c,s,e]);const m=s&&o;return(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(et.Placeholder,{className:"wp-block-navigation-placeholder"},(0,Ke.createElement)(Hg,{isVisible:!e}),(0,Ke.createElement)("div",{"aria-hidden":!e||void 0,className:"wp-block-navigation-placeholder__controls"},(0,Ke.createElement)("div",{className:"wp-block-navigation-placeholder__actions"},(0,Ke.createElement)("div",{className:"wp-block-navigation-placeholder__actions__indicator"},(0,Ke.createElement)(Ng,{icon:Sg})," ",(0,tt.__)("Navigation")),(0,Ke.createElement)("hr",null),m&&(0,Ke.createElement)(et.Spinner,null),(0,Ke.createElement)(Dg,{currentMenuId:t,clientId:n,onSelectNavigationMenu:r,onSelectClassicMenu:l}),(0,Ke.createElement)("hr",null),a&&(0,Ke.createElement)(et.Button,{variant:"tertiary",onClick:i},(0,tt.__)("Start empty"))))))}const Vg=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{d:"M5 5v1.5h14V5H5zm0 7.8h14v-1.5H5v1.5zM5 19h14v-1.5H5V19z"}));function $g({icon:e}){return"menu"===e?(0,Ke.createElement)(Ng,{icon:Vg}):(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true",focusable:"false"},(0,Ke.createElement)(Ye.Rect,{x:"4",y:"7.5",width:"16",height:"1.5"}),(0,Ke.createElement)(Ye.Rect,{x:"4",y:"15",width:"16",height:"1.5"}))}function Og({children:e,id:t,isOpen:n,isResponsive:a,onToggle:o,isHiddenByDefault:r,overlayBackgroundColor:l,overlayTextColor:i,hasIcon:s,icon:c}){if(!a)return e;const m=ut()("wp-block-navigation__responsive-container",{"has-text-color":!!i.color||!!i?.class,[(0,nt.getColorClassName)("color",i?.slug)]:!!i?.slug,"has-background":!!l.color||l?.class,[(0,nt.getColorClassName)("background-color",l?.slug)]:!!l?.slug,"is-menu-open":n,"hidden-by-default":r}),u={color:!i?.slug&&i?.color,backgroundColor:!l?.slug&&l?.color&&l.color},p=ut()("wp-block-navigation__responsive-container-open",{"always-shown":r}),d=`${t}-modal`,g={className:"wp-block-navigation__responsive-dialog",...n&&{role:"dialog","aria-modal":!0,"aria-label":(0,tt.__)("Menu")}};return(0,Ke.createElement)(Ke.Fragment,null,!n&&(0,Ke.createElement)(et.Button,{"aria-haspopup":"true","aria-label":s&&(0,tt.__)("Open menu"),className:p,onClick:()=>o(!0)},s&&(0,Ke.createElement)($g,{icon:c}),!s&&(0,tt.__)("Menu")),(0,Ke.createElement)("div",{className:m,style:u,id:d},(0,Ke.createElement)("div",{className:"wp-block-navigation__responsive-close",tabIndex:"-1"},(0,Ke.createElement)("div",{...g},(0,Ke.createElement)(et.Button,{className:"wp-block-navigation__responsive-container-close","aria-label":s&&(0,tt.__)("Close menu"),onClick:()=>o(!1)},s&&(0,Ke.createElement)(Ng,{icon:Tg}),!s&&(0,tt.__)("Close")),(0,Ke.createElement)("div",{className:"wp-block-navigation__responsive-container-content",id:`${d}-content`},e)))))}function Gg({clientId:e,hasCustomPlaceholder:t,orientation:n,templateLock:a}){const{isImmediateParentOfSelectedBlock:o,selectedBlockHasChildren:r,isSelected:l}=(0,gt.useSelect)((t=>{const{getBlockCount:n,hasSelectedInnerBlock:a,getSelectedBlockClientId:o}=t(nt.store),r=o();return{isImmediateParentOfSelectedBlock:a(e,!1),selectedBlockHasChildren:!!n(r),isSelected:r===e}}),[e]),[i,s,c]=(0,dt.useEntityBlockEditor)("postType","wp_navigation"),m=l||o&&!r,u=(0,_t.useMemo)((()=>(0,Ke.createElement)(Hg,null)),[]),p=!t&&!!!i?.length&&!l,d=(0,nt.useInnerBlocksProps)({className:"wp-block-navigation__container"},{value:i,onInput:s,onChange:c,prioritizedInserterBlocks:Pg,defaultBlock:Ig,directInsert:!0,orientation:n,templateLock:a,renderAppender:!!(l||o&&!r||m)&&nt.InnerBlocks.ButtonBlockAppender,placeholder:p?u:void 0,__experimentalCaptureToolbars:!0,__unstableDisableLayoutClassNames:!0});return(0,Ke.createElement)("div",{...d})}function Ug(){const[e,t]=(0,dt.useEntityProp)("postType","wp_navigation","title");return(0,Ke.createElement)(et.TextControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Menu name"),value:e,onChange:t})}const qg=(e,t,n)=>{if(e===t)return!0;if("object"==typeof e&&null!=e&&"object"==typeof t&&null!=t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const a in e){if(!t.hasOwnProperty(a))return!1;if(n&&n(a,e))return!0;if(!qg(e[a],t[a],n))return!1}return!0}return!1},jg={};function Wg({blocks:e,createNavigationMenu:t,hasSelection:n}){const a=(0,_t.useRef)();(0,_t.useEffect)((()=>{a?.current||(a.current=e)}),[e]);const o=function(e,t){return!qg(e,t,((e,t)=>{if("core/page-list"===t?.name&&"innerBlocks"===e)return!0}))}(a?.current,e),r=(0,_t.useContext)(et.Disabled.Context),l=(0,nt.useInnerBlocksProps)({className:"wp-block-navigation__container"},{renderAppender:!!n&&void 0,defaultBlock:Ig,directInsert:!0}),{isSaving:i,hasResolvedAllNavigationMenus:s}=(0,gt.useSelect)((e=>{if(r)return jg;const{hasFinishedResolution:t,isSavingEntityRecord:n}=e(dt.store);return{isSaving:n("postType","wp_navigation"),hasResolvedAllNavigationMenus:t("getEntityRecords",zg)}}),[r]);(0,_t.useEffect)((()=>{!r&&!i&&s&&n&&o&&t(null,e)}),[e,t,r,i,s,o,n]);const c=i?et.Disabled:"div";return(0,Ke.createElement)(c,{...l})}function Zg({onDelete:e}){const[t,n]=(0,_t.useState)(!1),a=(0,dt.useEntityId)("postType","wp_navigation"),[o]=(0,dt.useEntityProp)("postType","wp_navigation","title"),{deleteEntityRecord:r}=(0,gt.useDispatch)(dt.store);return(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(et.Button,{className:"wp-block-navigation-delete-menu-button",variant:"secondary",isDestructive:!0,onClick:()=>{n(!0)}},(0,tt.__)("Delete menu")),t&&(0,Ke.createElement)(et.Modal,{title:(0,tt.sprintf)((0,tt.__)("Delete %s"),o),onRequestClose:()=>n(!1)},(0,Ke.createElement)("p",null,(0,tt.__)("Are you sure you want to delete this navigation menu?")),(0,Ke.createElement)(et.__experimentalHStack,{justify:"right"},(0,Ke.createElement)(et.Button,{variant:"tertiary",onClick:()=>{n(!1)}},(0,tt.__)("Cancel")),(0,Ke.createElement)(et.Button,{variant:"primary",onClick:()=>{r("postType","wp_navigation",a,{force:!0}),e(o)}},(0,tt.__)("Confirm")))))}const Qg=function({name:e,message:t=""}={}){const n=(0,_t.useRef)(),{createWarningNotice:a,removeNotice:o}=(0,gt.useDispatch)(Pt.store);return[(0,_t.useCallback)((o=>{n.current||(n.current=e,a(o||t,{id:n.current,type:"snackbar"}))}),[n,a,t,e]),(0,_t.useCallback)((()=>{n.current&&(o(n.current),n.current=null)}),[n,o])]};function Kg({setAttributes:e,hasIcon:t,icon:n}){return(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Show icon button"),help:(0,tt.__)("Configure the visual appearance of the button that toggles the overlay menu."),onChange:t=>e({hasIcon:t}),checked:t}),(0,Ke.createElement)(et.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Icon"),value:n,onChange:t=>e({icon:t}),isBlock:!0},(0,Ke.createElement)(et.__experimentalToggleGroupControlOption,{value:"handle","aria-label":(0,tt.__)("handle"),label:(0,Ke.createElement)($g,{icon:"handle"})}),(0,Ke.createElement)(et.__experimentalToggleGroupControlOption,{value:"menu","aria-label":(0,tt.__)("menu"),label:(0,Ke.createElement)($g,{icon:"menu"})})))}function Yg(e){if(!e)return null;const t=Jg(function(e,t="id",n="parent"){const a=Object.create(null),o=[];for(const r of e)a[r[t]]={...r,children:[]},r[n]?(a[r[n]]=a[r[n]]||{},a[r[n]].children=a[r[n]].children||[],a[r[n]].children.push(a[r[t]])):o.push(a[r[t]]);return o}(e));return(0,_i.applyFilters)("blocks.navigation.__unstableMenuItemsToBlocks",t,e)}function Jg(e,t=0){let n={};const a=[...e].sort(((e,t)=>e.menu_order-t.menu_order)),o=a.map((e=>{if("block"===e.type){const[t]=(0,Qe.parse)(e.content.raw);return t||(0,Qe.createBlock)("core/freeform",{content:e.content})}const a=e.children?.length?"core/navigation-submenu":"core/navigation-link",o=function({title:e,xfn:t,classes:n,attr_title:a,object:o,object_id:r,description:l,url:i,type:s,target:c},m,u){o&&"post_tag"===o&&(o="tag");return{label:e?.rendered||"",...o?.length&&{type:o},kind:s?.replace("_","-")||"custom",url:i||"",...t?.length&&t.join(" ").trim()&&{rel:t.join(" ").trim()},...n?.length&&n.join(" ").trim()&&{className:n.join(" ").trim()},...a?.length&&{title:a},...r&&"custom"!==o&&{id:r},...l?.length&&{description:l},..."_blank"===c&&{opensInNewTab:!0},..."core/navigation-submenu"===m&&{isTopLevelItem:0===u},..."core/navigation-link"===m&&{isTopLevelLink:0===u}}}(e,a,t),{innerBlocks:r=[],mapping:l={}}=e.children?.length?Jg(e.children,t+1):{};n={...n,...l};const i=(0,Qe.createBlock)(a,o,r);return n[e.id]=i.clientId,i}));return{innerBlocks:o,mapping:n}}const Xg="success",eh="error",th="pending";let nh=null;const ah=function(e,{throwOnError:t=!1}={}){const n=(0,gt.useRegistry)(),{editEntityRecord:a}=(0,gt.useDispatch)(dt.store),[o,r]=(0,_t.useState)("idle"),[l,i]=(0,_t.useState)(null),s=(0,_t.useCallback)((async(t,o,r="publish")=>{let l,i;try{i=await n.resolveSelect(dt.store).getMenuItems({menus:t,per_page:-1,context:"view"})}catch(e){throw new Error((0,tt.sprintf)((0,tt.__)('Unable to fetch classic menu "%s" from API.'),o),{cause:e})}if(null===i)throw new Error((0,tt.sprintf)((0,tt.__)('Unable to fetch classic menu "%s" from API.'),o));const{innerBlocks:s}=Yg(i);try{l=await e(o,s,r),await a("postType","wp_navigation",l.id,{status:"publish"},{throwOnError:!0})}catch(e){throw new Error((0,tt.sprintf)((0,tt.__)('Unable to create Navigation Menu "%s".'),o),{cause:e})}return l}),[e,a,n]);return{convert:(0,_t.useCallback)((async(e,n,a)=>{if(nh!==e)return nh=e,e&&n?(r(th),i(null),await s(e,n,a).then((e=>(r(Xg),nh=null,e))).catch((e=>{if(i(e?.message),r(eh),nh=null,t)throw new Error((0,tt.sprintf)((0,tt.__)('Unable to create Navigation Menu "%s".'),n),{cause:e})}))):(i("Unable to convert menu. Missing menu details."),void r(eh))}),[s,t]),status:o,error:l}};function oh(e,t){return e&&t?e+"//"+t:null}const rh=["postType","wp_navigation",{status:"draft",per_page:-1}],lh=["postType","wp_navigation",{per_page:-1,status:"publish"}];function ih(e){const t=(0,_t.useContext)(et.Disabled.Context),n=function(e){return(0,gt.useSelect)((t=>{if(!e)return;const{getBlock:n,getBlockParentsByBlockName:a}=t(nt.store),o=a(e,"core/template-part",!0);if(!o?.length)return;const r=t("core/editor").__experimentalGetDefaultTemplatePartAreas(),{getCurrentTheme:l,getEditedEntityRecord:i}=t(dt.store);for(const e of o){const t=n(e),{theme:a=l()?.stylesheet,slug:o}=t.attributes,s=i("postType","wp_template_part",oh(a,o));if(s?.area)return r.find((e=>"uncategorized"!==e.area&&e.area===s.area))?.label}}),[e])}(t?void 0:e),a=(0,gt.useRegistry)();return(0,_t.useCallback)((async()=>{if(t)return"";const{getEntityRecords:e}=a.resolveSelect(dt.store),[o,r]=await Promise.all([e(...rh),e(...lh)]),l=n?(0,tt.sprintf)((0,tt.__)("%s navigation"),n):(0,tt.__)("Navigation"),i=[...o,...r].reduce(((e,t)=>t?.title?.raw?.startsWith(l)?e+1:e),0);return(i>0?`${l} ${i+1}`:l)||""}),[t,n,a])}const sh="success",ch="error",mh="pending",uh="idle";const ph=[];function dh(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function gh(e,t,n){if(!e)return;t(dh(e).color);let a=e,o=dh(a).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&a.parentNode&&a.parentNode.nodeType===a.parentNode.ELEMENT_NODE;)a=a.parentNode,o=dh(a).backgroundColor;n(o)}function hh(e,t){const{textColor:n,customTextColor:a,backgroundColor:o,customBackgroundColor:r,overlayTextColor:l,customOverlayTextColor:i,overlayBackgroundColor:s,customOverlayBackgroundColor:c,style:m}=e,u={};return t&&i?u.customTextColor=i:t&&l?u.textColor=l:a?u.customTextColor=a:n?u.textColor=n:m?.color?.text&&(u.customTextColor=m.color.text),t&&c?u.customBackgroundColor=c:t&&s?u.backgroundColor=s:r?u.customBackgroundColor=r:o?u.backgroundColor=o:m?.color?.background&&(u.customTextColor=m.color.background),u}function bh(e){return{className:ut()("wp-block-navigation__submenu-container",{"has-text-color":!(!e.textColor&&!e.customTextColor),[`has-${e.textColor}-color`]:!!e.textColor,"has-background":!(!e.backgroundColor&&!e.customBackgroundColor),[`has-${e.backgroundColor}-background-color`]:!!e.backgroundColor}),style:{color:e.customTextColor,backgroundColor:e.customBackgroundColor}}}const _h=({className:e="",disabled:t,isMenuItem:n=!1})=>{let a=et.Button;return n&&(a=et.MenuItem),(0,Ke.createElement)(a,{variant:"link",disabled:t,className:e,href:(0,pt.addQueryArgs)("edit.php",{post_type:"wp_navigation"})},(0,tt.__)("Manage menus"))};const yh=function({onCreateNew:e}){return(0,Ke.createElement)(nt.Warning,null,(0,_t.createInterpolateElement)((0,tt.__)("Navigation menu has been deleted or is unavailable. "),{button:(0,Ke.createElement)(et.Button,{onClick:e,variant:"link"})}))},vh=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{d:"M2 12c0 3.6 2.4 5.5 6 5.5h.5V19l3-2.5-3-2.5v2H8c-2.5 0-4.5-1.5-4.5-4s2-4.5 4.5-4.5h3.5V6H8c-3.6 0-6 2.4-6 6zm19.5-1h-8v1.5h8V11zm0 5h-8v1.5h8V16zm0-10h-8v1.5h8V6z"})),fh=(0,Ke.createElement)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,Ke.createElement)(Ye.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})),kh=(0,Ke.createElement)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,Ke.createElement)(Ye.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})),xh={className:"block-editor-block-settings-menu__popover",placement:"bottom-start"},wh=["core/navigation-link","core/navigation-submenu"];function Eh({block:e,onClose:t,expandedState:n,expand:a,setInsertedBlock:o}){const{insertBlock:r,replaceBlock:l,replaceInnerBlocks:i}=(0,gt.useDispatch)(nt.store),s=e.clientId,c=!wh.includes(e.name);return(0,Ke.createElement)(et.MenuItem,{icon:vh,disabled:c,onClick:()=>{const c=(0,Qe.createBlock)("core/navigation-link");if("core/navigation-submenu"===e.name)r(c,e.innerBlocks.length,s,false);else{const t=(0,Qe.createBlock)("core/navigation-submenu",e.attributes,e.innerBlocks);l(s,t),i(t.clientId,[c],false)}o(c),n[e.clientId]||a(e.clientId),t()}},(0,tt.__)("Add submenu link"))}function Ch(e){const{block:t}=e,{clientId:n}=t,{moveBlocksDown:a,moveBlocksUp:o,removeBlocks:r}=(0,gt.useDispatch)(nt.store),l=(0,tt.sprintf)((0,tt.__)("Remove %s"),(0,nt.BlockTitle)({clientId:n,maximumLength:25})),i=(0,gt.useSelect)((e=>{const{getBlockRootClientId:t}=e(nt.store);return t(n)}),[n]);return(0,Ke.createElement)(et.DropdownMenu,{icon:Lg,label:(0,tt.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:xh,noIcons:!0,...e},(({onClose:s})=>(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(et.MenuGroup,null,(0,Ke.createElement)(et.MenuItem,{icon:fh,onClick:()=>{o([n],i),s()}},(0,tt.__)("Move up")),(0,Ke.createElement)(et.MenuItem,{icon:kh,onClick:()=>{a([n],i),s()}},(0,tt.__)("Move down")),(0,Ke.createElement)(Eh,{block:t,onClose:s,expanded:!0,expandedState:e.expandedState,expand:e.expand,setInsertedBlock:e.setInsertedBlock})),(0,Ke.createElement)(et.MenuGroup,null,(0,Ke.createElement)(et.MenuItem,{onClick:()=>{r([n],!1),s()}},l)))))}const Sh=window.wp.escapeHtml,Bh=(e={},t,n={})=>{const{label:a="",kind:o="",type:r=""}=n,{title:l="",url:i="",opensInNewTab:s,id:c,kind:m=o,type:u=r}=e,p=l.replace(/http(s?):\/\//gi,""),d=i.replace(/http(s?):\/\//gi,""),g=l&&l!==a&&p!==d?(0,Sh.escapeHTML)(l):a||(0,Sh.escapeHTML)(d),h="post_tag"===u?"tag":u.replace("-","_"),b=["post","page","tag","category"].indexOf(h)>-1,_=!m&&!b||"custom"===m?"custom":m;t({...i&&{url:encodeURI((0,pt.safeDecodeURI)(i))},...g&&{label:g},...void 0!==s&&{opensInNewTab:s},...c&&Number.isInteger(c)&&{id:c},..._&&{kind:_},...h&&"URL"!==h&&{type:h}})},Nh=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"})),Th=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})),{PrivateQuickInserter:Ih}=Ft(nt.privateApis);function Ph(e,t){switch(e){case"post":case"page":return{type:"post",subtype:e};case"category":return{type:"term",subtype:"category"};case"tag":return{type:"term",subtype:"post_tag"};case"post_format":return{type:"post-format"};default:return"taxonomy"===t?{type:"term",subtype:e}:"post-type"===t?{type:"post",subtype:e}:{initialSuggestionsSearchOptions:{type:"post",subtype:"page",perPage:20}}}}function Mh({clientId:e,onBack:t,onSelectBlock:n}){const{rootBlockClientId:a}=(0,gt.useSelect)((t=>{const{getBlockRootClientId:n}=t(nt.store);return{rootBlockClientId:n(e)}}),[e]),o=(0,jt.useFocusOnMount)("firstElement"),r=(0,jt.useInstanceId)(nt.__experimentalLinkControl,"link-ui-block-inserter__title"),l=(0,jt.useInstanceId)(nt.__experimentalLinkControl,"link-ui-block-inserter__description");return e?(0,Ke.createElement)("div",{className:"link-ui-block-inserter",role:"dialog","aria-labelledby":r,"aria-describedby":l,ref:o},(0,Ke.createElement)(et.VisuallyHidden,null,(0,Ke.createElement)("h2",{id:r},(0,tt.__)("Add block")),(0,Ke.createElement)("p",{id:l},(0,tt.__)("Choose a block to add to your Navigation."))),(0,Ke.createElement)(et.Button,{className:"link-ui-block-inserter__back",icon:Nh,onClick:e=>{e.preventDefault(),t()},size:"small"},(0,tt.__)("Back")),(0,Ke.createElement)(Ih,{rootClientId:a,clientId:e,isAppender:!1,prioritizePatterns:!1,selectBlockOnInsert:!0,hasSearch:!1,onSelect:n})):null}function zh(e){const[t,n]=(0,_t.useState)(!1),[a,o]=(0,_t.useState)(!1),[r,l]=(0,_t.useState)(!0),{saveEntityRecord:i}=(0,gt.useDispatch)(dt.store),s=(0,dt.useResourcePermissions)("pages"),c=(0,dt.useResourcePermissions)("posts");const{label:m,url:u,opensInNewTab:p,type:d,kind:g}=e.link;let h=!1;d&&"page"!==d?"post"===d&&(h=c.canCreate):h=s.canCreate;const b=(0,_t.useMemo)((()=>({url:u,opensInNewTab:p,title:m&&(0,ac.__unstableStripHTML)(m)})),[m,p,u]),_=(0,jt.useInstanceId)(zh,"link-ui-link-control__title"),y=(0,jt.useInstanceId)(zh,"link-ui-link-control__description"),{onClose:v}=e;return(0,Ke.createElement)(Ke.Fragment,null,r&&(0,Ke.createElement)("div",{className:"components-popover-pointer-events-trap","aria-hidden":"true",onClick:()=>l(!1)}),(0,Ke.createElement)(et.Popover,{placement:"bottom",onClose:e.onClose,anchor:e.anchor,shift:!0},!t&&(0,Ke.createElement)("div",{role:"dialog","aria-labelledby":_,"aria-describedby":y},(0,Ke.createElement)(et.VisuallyHidden,null,(0,Ke.createElement)("h2",{id:_},(0,tt.__)("Add link")),(0,Ke.createElement)("p",{id:y},(0,tt.__)("Search for and add a link to your Navigation."))),(0,Ke.createElement)(nt.__experimentalLinkControl,{hasTextControl:!0,hasRichPreviews:!0,value:b,showInitialSuggestions:!0,withCreateSuggestion:h,createSuggestion:async function(t){const n=e.link.type||"page",a=await i("postType",n,{title:t,status:"draft"});return{id:a.id,type:n,title:(0,Jn.decodeEntities)(a.title.rendered),url:a.link,kind:"post-type"}},createSuggestionButtonText:e=>{let t;return t="post"===d?(0,tt.__)("Create draft post: %s"):(0,tt.__)("Create draft page: %s"),(0,_t.createInterpolateElement)((0,tt.sprintf)(t,e),{mark:(0,Ke.createElement)("mark",null)})},noDirectEntry:!!d,noURLSuggestion:!!d,suggestionsQuery:Ph(d,g),onChange:e.onChange,onRemove:e.onRemove,onCancel:e.onCancel,renderControlBottom:()=>!b?.url?.length&&(0,Ke.createElement)(Rh,{focusAddBlockButton:a,setAddingBlock:()=>{n(!0),o(!1)}})})),t&&(0,Ke.createElement)(Mh,{clientId:e.clientId,onBack:()=>{n(!1),o(!0)},onSelectBlock:v})))}const Rh=({setAddingBlock:e,focusAddBlockButton:t})=>{const n=(0,_t.useRef)();return(0,_t.useEffect)((()=>{t&&n.current?.focus()}),[t]),(0,Ke.createElement)(et.__experimentalVStack,{className:"link-ui-tools"},(0,Ke.createElement)(et.Button,{ref:n,icon:Th,onClick:t=>{t.preventDefault(),e(!0)},"aria-haspopup":"listbox"},(0,tt.__)("Add block")))},Ah=(0,tt.__)("Switch to '%s'"),Hh=["core/navigation-link","core/navigation-submenu"],{PrivateListView:Lh}=Ft(nt.privateApis);function Dh({block:e,insertedBlock:t,setInsertedBlock:n}){const{updateBlockAttributes:a}=(0,gt.useDispatch)(nt.store),o=Hh?.includes(t?.name),r=t?.clientId===e.clientId;if(!(o&&r))return null;return(0,Ke.createElement)(zh,{clientId:t?.clientId,link:t?.attributes,onClose:()=>{n(null)},onChange:e=>{var o;Bh(e,(o=t?.clientId,e=>{o&&a(o,e)}),t?.attributes),n(null)},onCancel:()=>{n(null)}})}const Fh=({clientId:e,currentMenuId:t,isLoading:n,isNavigationMenuMissing:a,onCreateNew:o})=>{const r=(0,gt.useSelect)((t=>!!t(nt.store).getBlockCount(e)),[e]),{navigationMenu:l}=Rg(t);if(t&&a)return(0,Ke.createElement)(yh,{onCreateNew:o});if(n)return(0,Ke.createElement)(et.Spinner,null);const i=l?(0,tt.sprintf)((0,tt.__)("Structure for navigation menu: %s"),l?.title||(0,tt.__)("Untitled menu")):(0,tt.__)("You have not yet created any menus. Displaying a list of your Pages");return(0,Ke.createElement)("div",{className:"wp-block-navigation__menu-inspector-controls"},!r&&(0,Ke.createElement)("p",{className:"wp-block-navigation__menu-inspector-controls__empty-message"},(0,tt.__)("This navigation menu is empty.")),(0,Ke.createElement)(Lh,{rootClientId:e,isExpanded:!0,description:i,showAppender:!0,blockSettingsMenu:Ch,additionalBlockContent:Dh}))},Vh=e=>{const{createNavigationMenuIsSuccess:t,createNavigationMenuIsError:n,currentMenuId:a=null,onCreateNew:o,onSelectClassicMenu:r,onSelectNavigationMenu:l,isManageMenusButtonDisabled:i,blockEditingMode:s}=e;return(0,Ke.createElement)(nt.InspectorControls,{group:"list"},(0,Ke.createElement)(et.PanelBody,{title:null},(0,Ke.createElement)(et.__experimentalHStack,{className:"wp-block-navigation-off-canvas-editor__header"},(0,Ke.createElement)(et.__experimentalHeading,{className:"wp-block-navigation-off-canvas-editor__title",level:2},(0,tt.__)("Menu")),"default"===s&&(0,Ke.createElement)(Dg,{currentMenuId:a,onSelectClassicMenu:r,onSelectNavigationMenu:l,onCreateNew:o,createNavigationMenuIsSuccess:t,createNavigationMenuIsError:n,actionLabel:Ah,isManageMenusButtonDisabled:i})),(0,Ke.createElement)(Fh,{...e})))};function $h({id:e,children:t}){return(0,Ke.createElement)(et.VisuallyHidden,null,(0,Ke.createElement)("div",{id:e,className:"wp-block-navigation__description"},t))}function Oh({id:e}){const[t]=(0,dt.useEntityProp)("postType","wp_navigation","title"),n=(0,tt.sprintf)((0,tt.__)('Navigation menu: "%s"'),t);return(0,Ke.createElement)($h,{id:e},n)}const Gh=(0,nt.withColors)({textColor:"color"},{backgroundColor:"color"},{overlayBackgroundColor:"color"},{overlayTextColor:"color"})((function({attributes:e,setAttributes:t,clientId:n,isSelected:a,className:o,backgroundColor:r,setBackgroundColor:l,textColor:i,setTextColor:s,overlayBackgroundColor:c,setOverlayBackgroundColor:m,overlayTextColor:u,setOverlayTextColor:p,hasSubmenuIndicatorSetting:d=!0,customPlaceholder:g=null,__unstableLayoutClassNames:h}){const{openSubmenusOnClick:b,overlayMenu:_,showSubmenuIcon:y,templateLock:v,layout:{justifyContent:f,orientation:k="horizontal",flexWrap:x="wrap"}={},hasIcon:w,icon:E="handle"}=e,C=e.ref,S=(0,_t.useCallback)((e=>{t({ref:e})}),[t]),B=`navigationMenu/${C}`,N=(0,nt.useHasRecursion)(B),T=(0,nt.useBlockEditingMode)(),{menus:I}=Ag(),[P,M]=Qg({name:"block-library/core/navigation/status"}),[z,R]=Qg({name:"block-library/core/navigation/classic-menu-conversion"}),[A,H]=Qg({name:"block-library/core/navigation/permissions/update"}),{create:L,status:D,error:F,value:V,isPending:$,isSuccess:O,isError:G}=function(e){const[t,n]=(0,_t.useState)(uh),[a,o]=(0,_t.useState)(null),[r,l]=(0,_t.useState)(null),{saveEntityRecord:i,editEntityRecord:s}=(0,gt.useDispatch)(dt.store),c=ih(e),m=(0,_t.useCallback)((async(e=null,t=[],a)=>{if(e&&"string"!=typeof e)throw l("Invalid title supplied when creating Navigation Menu."),n(ch),new Error("Value of supplied title argument was not a string.");n(mh),o(null),l(null),e||(e=await c().catch((e=>{throw l(e?.message),n(ch),new Error("Failed to create title when saving new Navigation Menu.",{cause:e})})));const r={title:e,content:(0,Qe.serialize)(t),status:a};return i("postType","wp_navigation",r).then((e=>(o(e),n(sh),"publish"!==a&&s("postType","wp_navigation",e.id,{status:"publish"}),e))).catch((e=>{throw l(e?.message),n(ch),new Error("Unable to save new Navigation Menu",{cause:e})}))}),[i,s,c]);return{create:m,status:t,value:a,error:r,isIdle:t===uh,isPending:t===mh,isSuccess:t===sh,isError:t===ch}}(n),U=async()=>{await L("")},{hasUncontrolledInnerBlocks:q,uncontrolledInnerBlocks:j,isInnerBlockSelected:W,innerBlocks:Z}=function(e){return(0,gt.useSelect)((t=>{const{getBlock:n,getBlocks:a,hasSelectedInnerBlock:o}=t(nt.store),r=n(e).innerBlocks,l=!!r?.length,i=l?ph:a(e);return{innerBlocks:l?r:i,hasUncontrolledInnerBlocks:l,uncontrolledInnerBlocks:r,controlledInnerBlocks:i,isInnerBlockSelected:o(e,!0)}}),[e])}(n),Q=!!Z.find((e=>"core/navigation-submenu"===e.name)),{replaceInnerBlocks:K,selectBlock:Y,__unstableMarkNextChangeAsNotPersistent:J}=(0,gt.useDispatch)(nt.store),[X,ee]=(0,_t.useState)(!1),[te,ne]=(0,_t.useState)(!1),{hasResolvedNavigationMenus:ae,isNavigationMenuResolved:oe,isNavigationMenuMissing:re,canUserUpdateNavigationMenu:le,hasResolvedCanUserUpdateNavigationMenu:ie,canUserDeleteNavigationMenu:se,hasResolvedCanUserDeleteNavigationMenu:ce,canUserCreateNavigationMenu:me,isResolvingCanUserCreateNavigationMenu:ue,hasResolvedCanUserCreateNavigationMenu:pe}=Rg(C),de=ae&&re,{convert:ge,status:he,error:be}=ah(L),_e=he===th,ye=(0,_t.useCallback)(((e,t={focusNavigationBlock:!1})=>{const{focusNavigationBlock:a}=t;S(e),a&&Y(n)}),[Y,n,S]),ve=!re&&oe,fe=q&&!ve,{getNavigationFallbackId:ke}=Ft((0,gt.useSelect)(dt.store)),xe=C||fe?null:ke();(0,_t.useEffect)((()=>{C||fe||!xe||(J(),S(xe))}),[C,S,fe,xe,J]);const we=(0,_t.useRef)(),Ee="nav",Ce=!C&&!$&&!_e&&ae&&0===I?.length&&!q,Se=!ae||$||_e||!(!C||ve||_e),Be=e.style?.typography?.textDecoration,Ne=(0,gt.useSelect)((e=>e(nt.store).__unstableHasActiveBlockOverlayActive(n)),[n]),Te="never"!==_,Ie=(0,nt.useBlockProps)({ref:we,className:ut()(o,{"items-justified-right":"right"===f,"items-justified-space-between":"space-between"===f,"items-justified-left":"left"===f,"items-justified-center":"center"===f,"is-vertical":"vertical"===k,"no-wrap":"nowrap"===x,"is-responsive":Te,"has-text-color":!!i.color||!!i?.class,[(0,nt.getColorClassName)("color",i?.slug)]:!!i?.slug,"has-background":!!r.color||r.class,[(0,nt.getColorClassName)("background-color",r?.slug)]:!!r?.slug,[`has-text-decoration-${Be}`]:Be,"block-editor-block-content-overlay":Ne},h),style:{color:!i?.slug&&i?.color,backgroundColor:!r?.slug&&r?.color}}),Pe="web"===_t.Platform.OS,[Me,ze]=(0,_t.useState)(),[Re,Ae]=(0,_t.useState)(),[He,Le]=(0,_t.useState)(),[De,Fe]=(0,_t.useState)(),Ve=async e=>ge(e.id,e.name,"draft"),$e=e=>{ye(e)};(0,_t.useEffect)((()=>{M(),$&&(0,Bg.speak)((0,tt.__)("Creating Navigation Menu.")),O&&(ye(V?.id,{focusNavigationBlock:!0}),P((0,tt.__)("Navigation Menu successfully created."))),G&&P((0,tt.__)("Failed to create Navigation Menu."))}),[D,F,V?.id,G,O,$,ye,M,P]),(0,_t.useEffect)((()=>{R(),he===th&&(0,Bg.speak)((0,tt.__)("Classic menu importing.")),he===Xg&&(z((0,tt.__)("Classic menu imported successfully.")),ye(V?.id,{focusNavigationBlock:!0})),he===eh&&z((0,tt.__)("Classic menu import failed."))}),[he,be,R,z,V?.id,ye]),(0,_t.useEffect)((()=>{if(!Pe)return;gh(we.current,Ae,ze);const e=we.current?.querySelector('[data-type="core/navigation-submenu"] [data-type="core/navigation-link"]');e&&(u.color||c.color)&&gh(e,Fe,Le)}),[Pe,u.color,c.color]),(0,_t.useEffect)((()=>{a||W||H(),(a||W)&&(C&&!de&&ie&&!le&&A((0,tt.__)("You do not have permission to edit this Menu. Any changes made will not be saved.")),C||!pe||me||A((0,tt.__)("You do not have permission to create Navigation Menus.")))}),[a,W,le,ie,me,pe,C,H,A,de]);const Oe=me||le,Ge=ut()("wp-block-navigation__overlay-menu-preview",{open:te}),Ue=y||b?"":(0,tt.__)('The current menu options offer reduced accessibility for users and are not recommended. Enabling either "Open on Click" or "Show arrow" offers enhanced accessibility by allowing keyboard users to browse submenus selectively.'),qe=(0,_t.useRef)(!0);(0,_t.useEffect)((()=>{!qe.current&&Ue&&(0,Bg.speak)(Ue),qe.current=!1}),[Ue]);const je=(0,jt.useInstanceId)(Kg,"overlay-menu-preview"),We=(0,nt.__experimentalUseMultipleOriginColorsAndGradients)(),Ze=(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(nt.InspectorControls,null,d&&(0,Ke.createElement)(et.PanelBody,{title:(0,tt.__)("Display")},Te&&(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(et.Button,{className:Ge,onClick:()=>{ne(!te)},"aria-label":(0,tt.__)("Overlay menu controls"),"aria-controls":je,"aria-expanded":te},w&&(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)($g,{icon:E}),(0,Ke.createElement)(Ng,{icon:Tg})),!w&&(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)("span",null,(0,tt.__)("Menu")),(0,Ke.createElement)("span",null,(0,tt.__)("Close")))),(0,Ke.createElement)("div",{id:je},te&&(0,Ke.createElement)(Kg,{setAttributes:t,hasIcon:w,icon:E,hidden:!te}))),(0,Ke.createElement)("h3",null,(0,tt.__)("Overlay Menu")),(0,Ke.createElement)(et.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Configure overlay menu"),value:_,help:(0,tt.__)("Collapses the navigation options in a menu icon opening an overlay."),onChange:e=>t({overlayMenu:e}),isBlock:!0,hideLabelFromVision:!0},(0,Ke.createElement)(et.__experimentalToggleGroupControlOption,{value:"never",label:(0,tt.__)("Off")}),(0,Ke.createElement)(et.__experimentalToggleGroupControlOption,{value:"mobile",label:(0,tt.__)("Mobile")}),(0,Ke.createElement)(et.__experimentalToggleGroupControlOption,{value:"always",label:(0,tt.__)("Always")})),Q&&(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)("h3",null,(0,tt.__)("Submenus")),(0,Ke.createElement)(et.ToggleControl,{__nextHasNoMarginBottom:!0,checked:b,onChange:e=>{t({openSubmenusOnClick:e,...e&&{showSubmenuIcon:!0}})},label:(0,tt.__)("Open on click")}),(0,Ke.createElement)(et.ToggleControl,{__nextHasNoMarginBottom:!0,checked:y,onChange:e=>{t({showSubmenuIcon:e})},disabled:e.openSubmenusOnClick,label:(0,tt.__)("Show arrow")}),Ue&&(0,Ke.createElement)("div",null,(0,Ke.createElement)(et.Notice,{spokenMessage:null,status:"warning",isDismissible:!1},Ue))))),We.hasColorsOrGradients&&(0,Ke.createElement)(nt.InspectorControls,{group:"color"},(0,Ke.createElement)(nt.__experimentalColorGradientSettingsDropdown,{__experimentalIsRenderedInSidebar:!0,settings:[{colorValue:i.color,label:(0,tt.__)("Text"),onColorChange:s,resetAllFilter:()=>s()},{colorValue:r.color,label:(0,tt.__)("Background"),onColorChange:l,resetAllFilter:()=>l()},{colorValue:u.color,label:(0,tt.__)("Submenu & overlay text"),onColorChange:p,resetAllFilter:()=>p()},{colorValue:c.color,label:(0,tt.__)("Submenu & overlay background"),onColorChange:m,resetAllFilter:()=>m()}],panelId:n,...We,gradients:[],disableCustomGradients:!0}),Pe&&(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(nt.ContrastChecker,{backgroundColor:Me,textColor:Re}),(0,Ke.createElement)(nt.ContrastChecker,{backgroundColor:He,textColor:De})))),Ye=`${n}-desc`,Je=!Oe||!ae;if(fe&&!$)return(0,Ke.createElement)(Ee,{...Ie,"aria-describedby":Ce?void 0:Ye},(0,Ke.createElement)($h,{id:Ye},(0,tt.__)("Unsaved Navigation Menu.")),(0,Ke.createElement)(Vh,{clientId:n,createNavigationMenuIsSuccess:O,createNavigationMenuIsError:G,currentMenuId:C,isNavigationMenuMissing:re,isManageMenusButtonDisabled:Je,onCreateNew:U,onSelectClassicMenu:Ve,onSelectNavigationMenu:$e,isLoading:Se,blockEditingMode:T}),"default"===T&&Ze,(0,Ke.createElement)(Og,{id:n,onToggle:ee,isOpen:X,hasIcon:w,icon:E,isResponsive:Te,isHiddenByDefault:"always"===_,overlayBackgroundColor:c,overlayTextColor:u},(0,Ke.createElement)(Wg,{createNavigationMenu:L,blocks:j,hasSelection:a||W})));if(C&&re)return(0,Ke.createElement)(Ee,{...Ie},(0,Ke.createElement)(Vh,{clientId:n,createNavigationMenuIsSuccess:O,createNavigationMenuIsError:G,currentMenuId:C,isNavigationMenuMissing:re,isManageMenusButtonDisabled:Je,onCreateNew:U,onSelectClassicMenu:Ve,onSelectNavigationMenu:$e,isLoading:Se,blockEditingMode:T}),(0,Ke.createElement)(yh,{onCreateNew:U}));if(ve&&N)return(0,Ke.createElement)("div",{...Ie},(0,Ke.createElement)(nt.Warning,null,(0,tt.__)("Block cannot be rendered inside itself.")));const Xe=g||Fg;return Ce&&g?(0,Ke.createElement)(Ee,{...Ie},(0,Ke.createElement)(Xe,{isSelected:a,currentMenuId:C,clientId:n,canUserCreateNavigationMenu:me,isResolvingCanUserCreateNavigationMenu:ue,onSelectNavigationMenu:$e,onSelectClassicMenu:Ve,onCreateEmpty:U})):(0,Ke.createElement)(dt.EntityProvider,{kind:"postType",type:"wp_navigation",id:C},(0,Ke.createElement)(nt.RecursionProvider,{uniqueId:B},(0,Ke.createElement)(Vh,{clientId:n,createNavigationMenuIsSuccess:O,createNavigationMenuIsError:G,currentMenuId:C,isNavigationMenuMissing:re,isManageMenusButtonDisabled:Je,onCreateNew:U,onSelectClassicMenu:Ve,onSelectNavigationMenu:$e,isLoading:Se,blockEditingMode:T}),"default"===T&&Ze,"default"===T&&ve&&(0,Ke.createElement)(nt.InspectorControls,{group:"advanced"},ie&&le&&(0,Ke.createElement)(Ug,null),ce&&se&&(0,Ke.createElement)(Zg,{onDelete:(e="")=>{K(n,[]),P((0,tt.sprintf)((0,tt.__)("Navigation menu %s successfully deleted."),e))}}),(0,Ke.createElement)(_h,{disabled:Je,className:"wp-block-navigation-manage-menus-button"})),(0,Ke.createElement)(Ee,{...Ie,"aria-describedby":Ce||Se?void 0:Ye},Se&&(0,Ke.createElement)("div",{className:"wp-block-navigation__loading-indicator-container"},(0,Ke.createElement)(et.Spinner,{className:"wp-block-navigation__loading-indicator"})),!Se&&(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(Oh,{id:Ye}),(0,Ke.createElement)(Og,{id:n,onToggle:ee,hasIcon:w,icon:E,isOpen:X,isResponsive:Te,isHiddenByDefault:"always"===_,overlayBackgroundColor:c,overlayTextColor:u},ve&&(0,Ke.createElement)(Gg,{clientId:n,hasCustomPlaceholder:!!g,templateLock:v,orientation:k}))))))}));const Uh={fontStyle:"var:preset|font-style|",fontWeight:"var:preset|font-weight|",textDecoration:"var:preset|text-decoration|",textTransform:"var:preset|text-transform|"},qh=({navigationMenuId:e,...t})=>({...t,ref:e}),jh=e=>{if(e.layout)return e;const{itemsJustification:t,orientation:n,...a}=e;return(t||n)&&Object.assign(a,{layout:{type:"flex",...t&&{justifyContent:t},...n&&{orientation:n}}}),a},Wh={attributes:{navigationMenuId:{type:"number"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0},openSubmenusOnClick:{type:"boolean",default:!1},overlayMenu:{type:"string",default:"mobile"},__unstableLocation:{type:"string"},overlayBackgroundColor:{type:"string"},customOverlayBackgroundColor:{type:"string"},overlayTextColor:{type:"string"},customOverlayTextColor:{type:"string"}},supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0,__experimentalDefaultControls:{fontSize:!0}},spacing:{blockGap:!0,units:["px","em","rem","vh","vw"],__experimentalDefaultControls:{blockGap:!0}},layout:{allowSwitching:!1,allowInheriting:!1,default:{type:"flex"}}},save:()=>(0,Ke.createElement)(nt.InnerBlocks.Content,null),isEligible:({navigationMenuId:e})=>!!e,migrate:qh},Zh={attributes:{navigationMenuId:{type:"number"},orientation:{type:"string",default:"horizontal"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},itemsJustification:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0},openSubmenusOnClick:{type:"boolean",default:!1},overlayMenu:{type:"string",default:"never"},__unstableLocation:{type:"string"},overlayBackgroundColor:{type:"string"},customOverlayBackgroundColor:{type:"string"},overlayTextColor:{type:"string"},customOverlayTextColor:{type:"string"}},supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0,__experimentalDefaultControls:{fontSize:!0}},spacing:{blockGap:!0,units:["px","em","rem","vh","vw"],__experimentalDefaultControls:{blockGap:!0}}},save:()=>(0,Ke.createElement)(nt.InnerBlocks.Content,null),isEligible:({itemsJustification:e,orientation:t})=>!!e||!!t,migrate:(0,jt.compose)(qh,jh)},Qh={attributes:{orientation:{type:"string",default:"horizontal"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},itemsJustification:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0},openSubmenusOnClick:{type:"boolean",default:!1},overlayMenu:{type:"string",default:"never"},__unstableLocation:{type:"string"},overlayBackgroundColor:{type:"string"},customOverlayBackgroundColor:{type:"string"},overlayTextColor:{type:"string"},customOverlayTextColor:{type:"string"}},supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0},spacing:{blockGap:!0,units:["px","em","rem","vh","vw"],__experimentalDefaultControls:{blockGap:!0}}},save:()=>(0,Ke.createElement)(nt.InnerBlocks.Content,null),migrate:(0,jt.compose)(qh,jh,ln),isEligible:({style:e})=>e?.typography?.fontFamily},Kh=[Wh,Zh,Qh,{attributes:{orientation:{type:"string",default:"horizontal"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},itemsJustification:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0},openSubmenusOnClick:{type:"boolean",default:!1},isResponsive:{type:"boolean",default:"false"},__unstableLocation:{type:"string"},overlayBackgroundColor:{type:"string"},customOverlayBackgroundColor:{type:"string"},overlayTextColor:{type:"string"},customOverlayTextColor:{type:"string"}},supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0}},isEligible:e=>e.isResponsive,migrate:(0,jt.compose)(qh,jh,ln,(function(e){return delete e.isResponsive,{...e,overlayMenu:"mobile"}})),save:()=>(0,Ke.createElement)(nt.InnerBlocks.Content,null)},{attributes:{orientation:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},itemsJustification:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0}},supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0,fontSize:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,color:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0},save:()=>(0,Ke.createElement)(nt.InnerBlocks.Content,null),isEligible(e){if(!e.style||!e.style.typography)return!1;for(const t in Uh){const n=e.style.typography[t];if(n&&n.startsWith(Uh[t]))return!0}return!1},migrate:(0,jt.compose)(qh,jh,ln,(function(e){var t;return{...e,style:{...e.style,typography:Object.fromEntries(Object.entries(null!==(t=e.style.typography)&&void 0!==t?t:{}).map((([e,t])=>{const n=Uh[e];if(n&&t.startsWith(n)){const a=t.slice(n.length);return"textDecoration"===e&&"strikethrough"===a?[e,"line-through"]:[e,a]}return[e,t]})))}}}))},{attributes:{className:{type:"string"},textColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"},itemsJustification:{type:"string"},showSubmenuIcon:{type:"boolean"}},isEligible:e=>e.rgbTextColor||e.rgbBackgroundColor,supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0},migrate:(0,jt.compose)(qh,(e=>{const{rgbTextColor:t,rgbBackgroundColor:n,...a}=e;return{...a,customTextColor:e.textColor?void 0:e.rgbTextColor,customBackgroundColor:e.backgroundColor?void 0:e.rgbBackgroundColor}})),save:()=>(0,Ke.createElement)(nt.InnerBlocks.Content,null)}],Yh=Kh,Jh={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/navigation",title:"Navigation",category:"theme",allowedBlocks:["core/navigation-link","core/search","core/social-links","core/page-list","core/spacer","core/home-link","core/site-title","core/site-logo","core/navigation-submenu","core/loginout","core/buttons"],description:"A collection of blocks that allow visitors to get around your site.",keywords:["menu","navigation","links"],textdomain:"default",attributes:{ref:{type:"number"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0},openSubmenusOnClick:{type:"boolean",default:!1},overlayMenu:{type:"string",default:"mobile"},icon:{type:"string",default:"handle"},hasIcon:{type:"boolean",default:!0},__unstableLocation:{type:"string"},overlayBackgroundColor:{type:"string"},customOverlayBackgroundColor:{type:"string"},overlayTextColor:{type:"string"},customOverlayTextColor:{type:"string"},maxNestingLevel:{type:"number",default:5},templateLock:{type:["string","boolean"],enum:["all","insert","contentOnly",!1]}},providesContext:{textColor:"textColor",customTextColor:"customTextColor",backgroundColor:"backgroundColor",customBackgroundColor:"customBackgroundColor",overlayTextColor:"overlayTextColor",customOverlayTextColor:"customOverlayTextColor",overlayBackgroundColor:"overlayBackgroundColor",customOverlayBackgroundColor:"customOverlayBackgroundColor",fontSize:"fontSize",customFontSize:"customFontSize",showSubmenuIcon:"showSubmenuIcon",openSubmenusOnClick:"openSubmenusOnClick",style:"style",maxNestingLevel:"maxNestingLevel"},supports:{align:["wide","full"],ariaLabel:!0,html:!1,inserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0,__experimentalLetterSpacing:!0,__experimentalTextDecoration:!0,__experimentalSkipSerialization:["textDecoration"],__experimentalDefaultControls:{fontSize:!0}},spacing:{blockGap:!0,units:["px","em","rem","vh","vw"],__experimentalDefaultControls:{blockGap:!0}},layout:{allowSwitching:!1,allowInheriting:!1,allowVerticalAlignment:!1,allowSizingOnChildren:!0,default:{type:"flex"}},__experimentalStyle:{elements:{link:{color:{text:"inherit"}}}},interactivity:!0,renaming:!1},editorStyle:"wp-block-navigation-editor",style:"wp-block-navigation"},{name:Xh}=Jh,eb={icon:Sg,example:{attributes:{overlayMenu:"never"},innerBlocks:[{name:"core/navigation-link",attributes:{label:(0,tt.__)("Home"),url:"https://make.wordpress.org/"}},{name:"core/navigation-link",attributes:{label:(0,tt.__)("About"),url:"https://make.wordpress.org/"}},{name:"core/navigation-link",attributes:{label:(0,tt.__)("Contact"),url:"https://make.wordpress.org/"}}]},edit:Gh,save:function({attributes:e}){if(!e.ref)return(0,Ke.createElement)(nt.InnerBlocks.Content,null)},deprecated:Yh},tb=()=>Xe({name:Xh,metadata:Jh,settings:eb}),nb=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{d:"M12.5 14.5h-1V16h1c2.2 0 4-1.8 4-4s-1.8-4-4-4h-1v1.5h1c1.4 0 2.5 1.1 2.5 2.5s-1.1 2.5-2.5 2.5zm-4 1.5v-1.5h-1C6.1 14.5 5 13.4 5 12s1.1-2.5 2.5-2.5h1V8h-1c-2.2 0-4 1.8-4 4s1.8 4 4 4h1zm-1-3.2h5v-1.5h-5v1.5zM18 4H9c-1.1 0-2 .9-2 2v.5h1.5V6c0-.3.2-.5.5-.5h9c.3 0 .5.2.5.5v12c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5v-.5H7v.5c0 1.1.9 2 2 2h9c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2z"})),ab={name:"core/navigation-link"};const ob=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{d:"M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"}),(0,Ke.createElement)(Ye.Path,{d:"M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z"})),rb=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{d:"M4.75 4a.75.75 0 0 0-.75.75v7.826c0 .2.08.39.22.53l6.72 6.716a2.313 2.313 0 0 0 3.276-.001l5.61-5.611-.531-.53.532.528a2.315 2.315 0 0 0 0-3.264L13.104 4.22a.75.75 0 0 0-.53-.22H4.75ZM19 12.576a.815.815 0 0 1-.236.574l-5.61 5.611a.814.814 0 0 1-1.153 0L5.5 12.264V5.5h6.763l6.5 6.502a.816.816 0 0 1 .237.574ZM8.75 9.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"})),lb=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{d:"M4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4zm.8-4l.7.7 2-2V12h1V9.2l2 2 .7-.7-2-2H12v-1H9.2l2-2-.7-.7-2 2V4h-1v2.8l-2-2-.7.7 2 2H4v1h2.8l-2 2z"}));function ib(e){switch(e){case"post":return Sp;case"page":return ob;case"tag":return rb;case"category":return Yn;default:return lb}}function sb(e,t){if("core/navigation-link"!==t)return e;if(e.variations){const t=(e,t)=>e.type===t.type,n=e.variations.map((e=>({...e,...!e.icon&&{icon:ib(e.name)},...!e.isActive&&{isActive:t}})));return{...e,variations:n}}return e}const cb={from:[{type:"block",blocks:["core/site-logo"],transform:()=>(0,Qe.createBlock)("core/navigation-link")},{type:"block",blocks:["core/spacer"],transform:()=>(0,Qe.createBlock)("core/navigation-link")},{type:"block",blocks:["core/home-link"],transform:()=>(0,Qe.createBlock)("core/navigation-link")},{type:"block",blocks:["core/social-links"],transform:()=>(0,Qe.createBlock)("core/navigation-link")},{type:"block",blocks:["core/search"],transform:()=>(0,Qe.createBlock)("core/navigation-link")},{type:"block",blocks:["core/page-list"],transform:()=>(0,Qe.createBlock)("core/navigation-link")},{type:"block",blocks:["core/buttons"],transform:()=>(0,Qe.createBlock)("core/navigation-link")}],to:[{type:"block",blocks:["core/navigation-submenu"],transform:(e,t)=>(0,Qe.createBlock)("core/navigation-submenu",e,t)},{type:"block",blocks:["core/spacer"],transform:()=>(0,Qe.createBlock)("core/spacer")},{type:"block",blocks:["core/site-logo"],transform:()=>(0,Qe.createBlock)("core/site-logo")},{type:"block",blocks:["core/home-link"],transform:()=>(0,Qe.createBlock)("core/home-link")},{type:"block",blocks:["core/social-links"],transform:()=>(0,Qe.createBlock)("core/social-links")},{type:"block",blocks:["core/search"],transform:()=>(0,Qe.createBlock)("core/search",{showLabel:!1,buttonUseIcon:!0,buttonPosition:"button-inside"})},{type:"block",blocks:["core/page-list"],transform:()=>(0,Qe.createBlock)("core/page-list")},{type:"block",blocks:["core/buttons"],transform:({label:e,url:t,rel:n,title:a,opensInNewTab:o})=>(0,Qe.createBlock)("core/buttons",{},[(0,Qe.createBlock)("core/button",{text:e,url:t,rel:n,title:a,linkTarget:o?"_blank":void 0})])}]},mb=cb,ub={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/navigation-link",title:"Custom Link",category:"design",parent:["core/navigation"],allowedBlocks:["core/navigation-link","core/navigation-submenu","core/page-list"],description:"Add a page, link, or another item to your navigation.",textdomain:"default",attributes:{label:{type:"string"},type:{type:"string"},description:{type:"string"},rel:{type:"string"},id:{type:"number"},opensInNewTab:{type:"boolean",default:!1},url:{type:"string"},title:{type:"string"},kind:{type:"string"},isTopLevelLink:{type:"boolean"}},usesContext:["textColor","customTextColor","backgroundColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","fontSize","customFontSize","showSubmenuIcon","maxNestingLevel","style"],supports:{reusable:!1,html:!1,__experimentalSlashInserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},renaming:!1,interactivity:{clientNavigation:!0}},editorStyle:"wp-block-navigation-link-editor",style:"wp-block-navigation-link"},{name:pb}=ub,db={icon:nb,__experimentalLabel:({label:e})=>e,merge:(e,{label:t=""})=>({...e,label:e.label+t}),edit:function({attributes:e,isSelected:t,setAttributes:n,insertBlocksAfter:a,mergeBlocks:o,onReplace:r,context:l,clientId:i}){const{id:s,label:c,type:m,url:u,description:p,rel:d,title:g,kind:h}=e,[b,_]=((e,t,n)=>{const a="post-type"===e||"post"===t||"page"===t,o=Number.isInteger(n),r=(0,gt.useSelect)((e=>{if(!a)return null;const{getEntityRecord:o}=e(dt.store);return o("postType",t,n)?.status}),[a,t,n]);return[a&&o&&r&&"trash"===r,"draft"===r]})(h,m,s),{maxNestingLevel:y}=l,{replaceBlock:v,__unstableMarkNextChangeAsNotPersistent:f}=(0,gt.useDispatch)(nt.store),[k,x]=(0,_t.useState)(!1),[w,E]=(0,_t.useState)(null),C=(0,_t.useRef)(null),S=(e=>{const[t,n]=(0,_t.useState)(!1);return(0,_t.useEffect)((()=>{const{ownerDocument:t}=e.current;function a(e){r(e)}function o(){n(!1)}function r(t){e.current.contains(t.target)?n(!0):n(!1)}return t.addEventListener("dragstart",a),t.addEventListener("dragend",o),t.addEventListener("dragenter",r),()=>{t.removeEventListener("dragstart",a),t.removeEventListener("dragend",o),t.removeEventListener("dragenter",r)}}),[]),t})(C),B=(0,tt.__)("Add label…"),N=(0,_t.useRef)(),[T,I]=(0,_t.useState)(!1),{innerBlocks:P,isAtMaxNesting:M,isTopLevelLink:z,isParentOfSelectedBlock:R,hasChildren:A}=(0,gt.useSelect)((e=>{const{getBlocks:t,getBlockCount:n,getBlockName:a,getBlockRootClientId:o,hasSelectedInnerBlock:r,getBlockParentsByBlockName:l}=e(nt.store);return{innerBlocks:t(i),isAtMaxNesting:l(i,["core/navigation-link","core/navigation-submenu"]).length>=y,isTopLevelLink:"core/navigation"===a(o(i)),isParentOfSelectedBlock:r(i,!0),hasChildren:!!n(i)}}),[i]);function H(){const t=(0,Qe.createBlock)("core/navigation-submenu",e,P.length>0?P:[(0,Qe.createBlock)("core/navigation-link")]);v(i,t)}(0,_t.useEffect)((()=>{u||x(!0)}),[u]),(0,_t.useEffect)((()=>{A&&(f(),H())}),[A]),(0,_t.useEffect)((()=>{t||x(!1)}),[t]),(0,_t.useEffect)((()=>{k&&u&&((0,pt.isURL)((0,pt.prependHTTP)(c))&&/^.+\.[a-z]+/.test(c)?function(){N.current.focus();const{ownerDocument:e}=N.current,{defaultView:t}=e,n=t.getSelection(),a=e.createRange();a.selectNodeContents(N.current),n.removeAllRanges(),n.addRange(a)}():(0,ac.placeCaretAtHorizontalEdge)(N.current,!0))}),[u]);const{textColor:L,customTextColor:D,backgroundColor:F,customBackgroundColor:V}=hh(l,!z),$=(0,nt.useBlockProps)({ref:(0,jt.useMergeRefs)([E,C]),className:ut()("wp-block-navigation-item",{"is-editing":t||R,"is-dragging-within":S,"has-link":!!u,"has-child":A,"has-text-color":!!L||!!D,[(0,nt.getColorClassName)("color",L)]:!!L,"has-background":!!F||V,[(0,nt.getColorClassName)("background-color",F)]:!!F}),style:{color:!L&&D,backgroundColor:!F&&V},onKeyDown:function(e){(fn.isKeyboardEvent.primary(e,"k")||(!u||_||b)&&e.keyCode===fn.ENTER)&&(e.preventDefault(),x(!0))}}),O=(0,nt.useInnerBlocksProps)({...$,className:"remove-outline"},{defaultBlock:ab,directInsert:!0,renderAppender:!1});(!u||b||_)&&($.onClick=()=>x(!0));const G=ut()("wp-block-navigation-item__content",{"wp-block-navigation-link__placeholder":!u||b||_}),U=function(e){let t="";switch(e){case"post":t=(0,tt.__)("Select post");break;case"page":t=(0,tt.__)("Select page");break;case"category":t=(0,tt.__)("Select category");break;case"tag":t=(0,tt.__)("Select tag");break;default:t=(0,tt.__)("Add link")}return t}(m),q=`(${b?(0,tt.__)("Invalid"):(0,tt.__)("Draft")})`,j=b||_?(0,tt.__)("This item has been deleted, or is a draft"):(0,tt.__)("This item is missing a link");return(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(nt.BlockControls,null,(0,Ke.createElement)(et.ToolbarGroup,null,(0,Ke.createElement)(et.ToolbarButton,{name:"link",icon:kn,title:(0,tt.__)("Link"),shortcut:fn.displayShortcut.primary("k"),onClick:()=>x(!0)}),!M&&(0,Ke.createElement)(et.ToolbarButton,{name:"submenu",icon:vh,title:(0,tt.__)("Add submenu"),onClick:H}))),(0,Ke.createElement)(nt.InspectorControls,null,(0,Ke.createElement)(et.PanelBody,{title:(0,tt.__)("Settings")},(0,Ke.createElement)(et.TextControl,{__nextHasNoMarginBottom:!0,value:c?(0,ac.__unstableStripHTML)(c):"",onChange:e=>{n({label:e})},label:(0,tt.__)("Label"),autoComplete:"off",onFocus:()=>I(!0),onBlur:()=>I(!1)}),(0,Ke.createElement)(et.TextControl,{__nextHasNoMarginBottom:!0,value:u?(0,pt.safeDecodeURI)(u):"",onChange:t=>{Bh({url:t},n,e)},label:(0,tt.__)("URL"),autoComplete:"off"}),(0,Ke.createElement)(et.TextareaControl,{__nextHasNoMarginBottom:!0,value:p||"",onChange:e=>{n({description:e})},label:(0,tt.__)("Description"),help:(0,tt.__)("The description will be displayed in the menu if the current theme supports it.")}),(0,Ke.createElement)(et.TextControl,{__nextHasNoMarginBottom:!0,value:g||"",onChange:e=>{n({title:e})},label:(0,tt.__)("Title attribute"),autoComplete:"off",help:(0,tt.__)("Additional information to help clarify the purpose of the link.")}),(0,Ke.createElement)(et.TextControl,{__nextHasNoMarginBottom:!0,value:d||"",onChange:e=>{n({rel:e})},label:(0,tt.__)("Rel attribute"),autoComplete:"off",help:(0,tt.__)("The relationship of the linked URL as space-separated link types.")}))),(0,Ke.createElement)("div",{...$},(0,Ke.createElement)("a",{className:G},u?(0,Ke.createElement)(Ke.Fragment,null,!b&&!_&&!T&&(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(nt.RichText,{ref:N,identifier:"label",className:"wp-block-navigation-item__label",value:c,onChange:e=>n({label:e}),onMerge:o,onReplace:r,__unstableOnSplitAtEnd:()=>a((0,Qe.createBlock)("core/navigation-link")),"aria-label":(0,tt.__)("Navigation link text"),placeholder:B,withoutInteractiveFormatting:!0,allowedFormats:["core/bold","core/italic","core/image","core/strikethrough"],onClick:()=>{u||x(!0)}}),p&&(0,Ke.createElement)("span",{className:"wp-block-navigation-item__description"},p)),(b||_||T)&&(0,Ke.createElement)("div",{className:"wp-block-navigation-link__placeholder-text wp-block-navigation-link__label"},(0,Ke.createElement)(et.Tooltip,{text:j},(0,Ke.createElement)("span",{"aria-label":(0,tt.__)("Navigation link text")},`${(0,Jn.decodeEntities)(c)} ${b||_?q:""}`.trim())))):(0,Ke.createElement)("div",{className:"wp-block-navigation-link__placeholder-text"},(0,Ke.createElement)(et.Tooltip,{text:j},(0,Ke.createElement)("span",null,U))),k&&(0,Ke.createElement)(zh,{clientId:i,link:e,onClose:()=>{u||r([])},anchor:w,onRemove:function(){n({url:void 0,label:void 0,id:void 0,kind:void 0,type:void 0,opensInNewTab:!1}),x(!1)},onChange:t=>{Bh(t,n,e)}})),(0,Ke.createElement)("div",{...O})))},save:function(){return(0,Ke.createElement)(nt.InnerBlocks.Content,null)},example:{attributes:{label:(0,tt._x)("Example Link","navigation link preview example"),url:"https://example.com"}},deprecated:[{isEligible:e=>e.nofollow,attributes:{label:{type:"string"},type:{type:"string"},nofollow:{type:"boolean"},description:{type:"string"},id:{type:"number"},opensInNewTab:{type:"boolean",default:!1},url:{type:"string"}},migrate:({nofollow:e,...t})=>({rel:e?"nofollow":"",...t}),save:()=>(0,Ke.createElement)(nt.InnerBlocks.Content,null)}],transforms:mb},gb=()=>((0,_i.addFilter)("blocks.registerBlockType","core/navigation-link",sb),Xe({name:pb,metadata:ub,settings:db})),hb=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"m13.955 20.748 8-17.5-.91-.416L19.597 6H13.5v1.5h5.411l-1.6 3.5H13.5v1.5h3.126l-1.6 3.5H13.5l.028 1.5h.812l-1.295 2.832.91.416ZM17.675 16l-.686 1.5h4.539L21.5 16h-3.825Zm2.286-5-.686 1.5H21.5V11h-1.54ZM2 12c0 3.58 2.42 5.5 6 5.5h.5V19l3-2.5-3-2.5v2H8c-2.48 0-4.5-1.52-4.5-4S5.52 7.5 8 7.5h3.5V6H8c-3.58 0-6 2.42-6 6Z"})),bb=()=>(0,Ke.createElement)(et.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},(0,Ke.createElement)(et.Path,{d:"M1.50002 4L6.00002 8L10.5 4",strokeWidth:"1.5"})),_b=["core/navigation-link","core/navigation-submenu","core/page-list"],yb={name:"core/navigation-link"};const vb={to:[{type:"block",blocks:["core/navigation-link"],isMatch:(e,t)=>0===t?.innerBlocks?.length,transform:e=>(0,Qe.createBlock)("core/navigation-link",e)},{type:"block",blocks:["core/spacer"],isMatch:(e,t)=>0===t?.innerBlocks?.length,transform:()=>(0,Qe.createBlock)("core/spacer")},{type:"block",blocks:["core/site-logo"],isMatch:(e,t)=>0===t?.innerBlocks?.length,transform:()=>(0,Qe.createBlock)("core/site-logo")},{type:"block",blocks:["core/home-link"],isMatch:(e,t)=>0===t?.innerBlocks?.length,transform:()=>(0,Qe.createBlock)("core/home-link")},{type:"block",blocks:["core/social-links"],isMatch:(e,t)=>0===t?.innerBlocks?.length,transform:()=>(0,Qe.createBlock)("core/social-links")},{type:"block",blocks:["core/search"],isMatch:(e,t)=>0===t?.innerBlocks?.length,transform:()=>(0,Qe.createBlock)("core/search")}]},fb=vb,kb={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/navigation-submenu",title:"Submenu",category:"design",parent:["core/navigation"],description:"Add a submenu to your navigation.",textdomain:"default",attributes:{label:{type:"string"},type:{type:"string"},description:{type:"string"},rel:{type:"string"},id:{type:"number"},opensInNewTab:{type:"boolean",default:!1},url:{type:"string"},title:{type:"string"},kind:{type:"string"},isTopLevelItem:{type:"boolean"}},usesContext:["textColor","customTextColor","backgroundColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","fontSize","customFontSize","showSubmenuIcon","maxNestingLevel","openSubmenusOnClick","style"],supports:{reusable:!1,html:!1,interactivity:{clientNavigation:!0}},editorStyle:"wp-block-navigation-submenu-editor",style:"wp-block-navigation-submenu"},{name:xb}=kb,wb={icon:({context:e})=>"list-view"===e?ob:vh,__experimentalLabel(e,{context:t}){const{label:n}=e,a=e?.metadata?.name;return"list-view"===t&&(a||n)&&e?.metadata?.name||n},edit:function({attributes:e,isSelected:t,setAttributes:n,mergeBlocks:a,onReplace:o,context:r,clientId:l}){const{label:i,type:s,url:c,description:m,rel:u,title:p}=e,{showSubmenuIcon:d,maxNestingLevel:g,openSubmenusOnClick:h}=r,{__unstableMarkNextChangeAsNotPersistent:b,replaceBlock:_}=(0,gt.useDispatch)(nt.store),[y,v]=(0,_t.useState)(!1),[f,k]=(0,_t.useState)(null),x=(0,_t.useRef)(null),w=(e=>{const[t,n]=(0,_t.useState)(!1);return(0,_t.useEffect)((()=>{const{ownerDocument:t}=e.current;function a(e){r(e)}function o(){n(!1)}function r(t){e.current.contains(t.target)?n(!0):n(!1)}return t.addEventListener("dragstart",a),t.addEventListener("dragend",o),t.addEventListener("dragenter",r),()=>{t.removeEventListener("dragstart",a),t.removeEventListener("dragend",o),t.removeEventListener("dragenter",r)}}),[]),t})(x),E=(0,tt.__)("Add text…"),C=(0,_t.useRef)(),S=(0,dt.useResourcePermissions)("pages"),B=(0,dt.useResourcePermissions)("posts"),{parentCount:N,isParentOfSelectedBlock:T,isImmediateParentOfSelectedBlock:I,hasChildren:P,selectedBlockHasChildren:M,onlyDescendantIsEmptyLink:z}=(0,gt.useSelect)((e=>{const{hasSelectedInnerBlock:t,getSelectedBlockClientId:n,getBlockParentsByBlockName:a,getBlock:o,getBlockCount:r,getBlockOrder:i}=e(nt.store);let s;const c=i(n());if(1===c?.length){const e=o(c[0]);s="core/navigation-link"===e?.name&&!e?.attributes?.label}return{parentCount:a(l,"core/navigation-submenu").length,isParentOfSelectedBlock:t(l,!0),isImmediateParentOfSelectedBlock:t(l,!1),hasChildren:!!r(l),selectedBlockHasChildren:!!c?.length,onlyDescendantIsEmptyLink:s}}),[l]),R=(0,jt.usePrevious)(P);(0,_t.useEffect)((()=>{h||c||v(!0)}),[]),(0,_t.useEffect)((()=>{t||v(!1)}),[t]),(0,_t.useEffect)((()=>{y&&c&&((0,pt.isURL)((0,pt.prependHTTP)(i))&&/^.+\.[a-z]+/.test(i)?function(){C.current.focus();const{ownerDocument:e}=C.current,{defaultView:t}=e,n=t.getSelection(),a=e.createRange();a.selectNodeContents(C.current),n.removeAllRanges(),n.addRange(a)}():(0,ac.placeCaretAtHorizontalEdge)(C.current,!0))}),[c]);let A=!1;s&&"page"!==s?"post"===s&&(A=B.canCreate):A=S.canCreate;const{textColor:H,customTextColor:L,backgroundColor:D,customBackgroundColor:F}=hh(r,N>0),V=(0,nt.useBlockProps)({ref:(0,jt.useMergeRefs)([k,x]),className:ut()("wp-block-navigation-item",{"is-editing":t||T,"is-dragging-within":w,"has-link":!!c,"has-child":P,"has-text-color":!!H||!!L,[(0,nt.getColorClassName)("color",H)]:!!H,"has-background":!!D||F,[(0,nt.getColorClassName)("background-color",D)]:!!D,"open-on-click":h}),style:{color:!H&&L,backgroundColor:!D&&F},onKeyDown:function(e){fn.isKeyboardEvent.primary(e,"k")&&(e.preventDefault(),v(!0))}}),$=hh(r,!0),O=N>=g?_b.filter((e=>"core/navigation-submenu"!==e)):_b,G=bh($),U=(0,nt.useInnerBlocksProps)(G,{allowedBlocks:O,defaultBlock:yb,directInsert:!0,__experimentalCaptureToolbars:!0,renderAppender:!!(t||I&&!M||P)&&nt.InnerBlocks.ButtonBlockAppender}),q=h?"button":"a";function j(){const t=(0,Qe.createBlock)("core/navigation-link",e);_(l,t)}(0,_t.useEffect)((()=>{!P&&R&&(b(),j())}),[P,R]);const W=!M||z;return(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(nt.BlockControls,null,(0,Ke.createElement)(et.ToolbarGroup,null,!h&&(0,Ke.createElement)(et.ToolbarButton,{name:"link",icon:kn,title:(0,tt.__)("Link"),shortcut:fn.displayShortcut.primary("k"),onClick:()=>v(!0)}),(0,Ke.createElement)(et.ToolbarButton,{name:"revert",icon:hb,title:(0,tt.__)("Convert to Link"),onClick:j,className:"wp-block-navigation__submenu__revert",isDisabled:!W}))),(0,Ke.createElement)(nt.InspectorControls,null,(0,Ke.createElement)(et.PanelBody,{title:(0,tt.__)("Settings")},(0,Ke.createElement)(et.TextControl,{__nextHasNoMarginBottom:!0,value:i||"",onChange:e=>{n({label:e})},label:(0,tt.__)("Label"),autoComplete:"off"}),(0,Ke.createElement)(et.TextControl,{__nextHasNoMarginBottom:!0,value:c||"",onChange:e=>{n({url:e})},label:(0,tt.__)("URL"),autoComplete:"off"}),(0,Ke.createElement)(et.TextareaControl,{__nextHasNoMarginBottom:!0,value:m||"",onChange:e=>{n({description:e})},label:(0,tt.__)("Description"),help:(0,tt.__)("The description will be displayed in the menu if the current theme supports it.")}),(0,Ke.createElement)(et.TextControl,{__nextHasNoMarginBottom:!0,value:p||"",onChange:e=>{n({title:e})},label:(0,tt.__)("Title attribute"),autoComplete:"off",help:(0,tt.__)("Additional information to help clarify the purpose of the link.")}),(0,Ke.createElement)(et.TextControl,{__nextHasNoMarginBottom:!0,value:u||"",onChange:e=>{n({rel:e})},label:(0,tt.__)("Rel attribute"),autoComplete:"off",help:(0,tt.__)("The relationship of the linked URL as space-separated link types.")}))),(0,Ke.createElement)("div",{...V},(0,Ke.createElement)(q,{className:"wp-block-navigation-item__content"},(0,Ke.createElement)(nt.RichText,{ref:C,identifier:"label",className:"wp-block-navigation-item__label",value:i,onChange:e=>n({label:e}),onMerge:a,onReplace:o,"aria-label":(0,tt.__)("Navigation link text"),placeholder:E,withoutInteractiveFormatting:!0,allowedFormats:["core/bold","core/italic","core/image","core/strikethrough"],onClick:()=>{h||c||v(!0)}}),!h&&y&&(0,Ke.createElement)(zh,{clientId:l,link:e,onClose:()=>v(!1),anchor:f,hasCreateSuggestion:A,onRemove:()=>{n({url:""}),(0,Bg.speak)((0,tt.__)("Link removed."),"assertive")},onChange:t=>{Bh(t,n,e)}})),(d||h)&&(0,Ke.createElement)("span",{className:"wp-block-navigation__submenu-icon"},(0,Ke.createElement)(bb,null)),(0,Ke.createElement)("div",{...U})))},save:function(){return(0,Ke.createElement)(nt.InnerBlocks.Content,null)},transforms:fb},Eb=()=>Xe({name:xb,metadata:kb,settings:wb}),Cb=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{d:"M17.5 9V6a2 2 0 0 0-2-2h-7a2 2 0 0 0-2 2v3H8V6a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5v3h1.5Zm0 6.5V18a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2v-2.5H8V18a.5.5 0 0 0 .5.5h7a.5.5 0 0 0 .5-.5v-2.5h1.5ZM4 13h16v-1.5H4V13Z"}));const Sb={from:[{type:"raw",schema:{"wp-block":{attributes:["data-block"]}},isMatch:e=>e.dataset&&"core/nextpage"===e.dataset.block,transform:()=>(0,Qe.createBlock)("core/nextpage",{})}]},Bb={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/nextpage",title:"Page Break",category:"design",description:"Separate your content into a multi-page experience.",keywords:["next page","pagination"],parent:["core/post-content"],textdomain:"default",supports:{customClassName:!1,className:!1,html:!1,interactivity:{clientNavigation:!0}},editorStyle:"wp-block-nextpage-editor"},{name:Nb}=Bb,Tb={icon:Cb,example:{},transforms:Sb,edit:function(){return(0,Ke.createElement)("div",{...(0,nt.useBlockProps)()},(0,Ke.createElement)("span",null,(0,tt.__)("Page break")))},save:function(){return(0,Ke.createElement)(_t.RawHTML,null,"\x3c!--nextpage--\x3e")}},Ib=()=>Xe({name:Nb,metadata:Bb,settings:Tb}),Pb=new WeakMap;function Mb(){const e=(0,gt.useRegistry)();if(!Pb.has(e)){const t=new Map;Pb.set(e,zb.bind(null,t))}return Pb.get(e)}function zb(e,{name:t,blocks:n}){const a=[...n];for(;a.length;){const n=a.shift();for(const e of null!==(o=n.innerBlocks)&&void 0!==o?o:[]){var o;a.unshift(e)}"core/pattern"===n.name&&Rb(e,t,n.attributes.slug)}}function Rb(e,t,n){if(e.has(t)||e.set(t,new Set),e.get(t).add(n),Ab(e,t))throw new TypeError(`Pattern ${t} has a circular dependency and cannot be rendered.`)}function Ab(e,t,n=new Set,a=new Set){var o;n.add(t),a.add(t);const r=null!==(o=e.get(t))&&void 0!==o?o:new Set;for(const t of r)if(n.has(t)){if(a.has(t))return!0}else if(Ab(e,t,n,a))return!0;return a.delete(t),!1}const Hb=({attributes:e,clientId:t})=>{const n=(0,gt.useSelect)((t=>t(nt.store).__experimentalGetParsedPattern(e.slug)),[e.slug]),a=(0,gt.useSelect)((e=>e(dt.store).getCurrentTheme()?.stylesheet),[]),{replaceBlocks:o,setBlockEditingMode:r,__unstableMarkNextChangeAsNotPersistent:l}=(0,gt.useDispatch)(nt.store),{getBlockRootClientId:i,getBlockEditingMode:s}=(0,gt.useSelect)(nt.store),[c,m]=(0,_t.useState)(!1),u=Mb();(0,_t.useEffect)((()=>{if(!c&&n?.blocks){try{u(n)}catch(e){return void m(!0)}window.queueMicrotask((()=>{const e=i(t),c=n.blocks.map((e=>(0,Qe.cloneBlock)(function(e){return e.innerBlocks.find((e=>"core/template-part"===e.name))&&(e.innerBlocks=e.innerBlocks.map((e=>("core/template-part"===e.name&&void 0===e.attributes.theme&&(e.attributes.theme=a),e)))),"core/template-part"===e.name&&void 0===e.attributes.theme&&(e.attributes.theme=a),e}(e)))),m=s(e);l(),r(e,"default"),l(),o(t,c),l(),r(e,m)}))}}),[t,c,n,l,o,s,r,i]);const p=(0,nt.useBlockProps)();return c?(0,Ke.createElement)("div",{...p},(0,Ke.createElement)(nt.Warning,null,(0,tt.sprintf)((0,tt.__)('Pattern "%s" cannot be rendered inside itself.'),n?.name))):(0,Ke.createElement)("div",{...p})},Lb={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/pattern",title:"Pattern placeholder",category:"theme",description:"Show a block pattern.",supports:{html:!1,inserter:!1,renaming:!1,interactivity:{clientNavigation:!0}},textdomain:"default",attributes:{slug:{type:"string"}}},{name:Db}=Lb,Fb={edit:Hb},Vb=()=>Xe({name:Db,metadata:Lb,settings:Fb}),$b=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{d:"M14.5 5.5h-7V7h7V5.5ZM7.5 9h7v1.5h-7V9Zm7 3.5h-7V14h7v-1.5Z"}),(0,Ke.createElement)(Ye.Path,{d:"M16 2H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2ZM6 3.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H6a.5.5 0 0 1-.5-.5V4a.5.5 0 0 1 .5-.5Z"}),(0,Ke.createElement)(Ye.Path,{d:"M20 8v11c0 .69-.31 1-.999 1H6v1.5h13.001c1.52 0 2.499-.982 2.499-2.5V8H20Z"}));function Ob(e,t){for(const n of e){if(n.attributes.id===t)return n;if(n.innerBlocks&&n.innerBlocks.length){const e=Ob(n.innerBlocks,t);if(e)return e}}return null}function Gb(e=[],t=null){let n=function(e=[]){const t={},n=[];return e.forEach((({id:e,title:a,link:o,type:r,parent:l})=>{var i;const s=null!==(i=t[e]?.innerBlocks)&&void 0!==i?i:[];t[e]=(0,Qe.createBlock)("core/navigation-link",{id:e,label:a.rendered,url:o,type:r,kind:"post-type"},s),l?(t[l]||(t[l]={innerBlocks:[]}),t[l].innerBlocks.push(t[e])):n.push(t[e])})),n}(e);if(t){const e=Ob(n,t);e&&e.innerBlocks&&(n=e.innerBlocks)}const a=e=>{e.forEach(((e,t,n)=>{const{attributes:o,innerBlocks:r}=e;if(0!==r.length){a(r);const e=(0,Qe.createBlock)("core/navigation-submenu",o,r);n[t]=e}}))};return a(n),n}function Ub({clientId:e,pages:t,parentClientId:n,parentPageID:a}){const{replaceBlock:o,selectBlock:r}=(0,gt.useDispatch)(nt.store);return()=>{const l=Gb(t,a);o(e,l),r(n)}}const qb=(0,tt.__)("This navigation menu displays your website's pages. Editing it will enable you to add, delete, or reorder pages. However, new pages will no longer be added automatically.");function jb({onClick:e,onClose:t,disabled:n}){return(0,Ke.createElement)(et.Modal,{onRequestClose:t,title:(0,tt.__)("Edit Page List"),className:"wp-block-page-list-modal",aria:{describedby:"wp-block-page-list-modal__description"}},(0,Ke.createElement)("p",{id:"wp-block-page-list-modal__description"},qb),(0,Ke.createElement)("div",{className:"wp-block-page-list-modal-buttons"},(0,Ke.createElement)(et.Button,{variant:"tertiary",onClick:t},(0,tt.__)("Cancel")),(0,Ke.createElement)(et.Button,{variant:"primary",disabled:n,onClick:e},(0,tt.__)("Edit"))))}const Wb=()=>{};function Zb({blockProps:e,innerBlocksProps:t,hasResolvedPages:n,blockList:a,pages:o,parentPageID:r}){if(!n)return(0,Ke.createElement)("div",{...e},(0,Ke.createElement)("div",{className:"wp-block-page-list__loading-indicator-container"},(0,Ke.createElement)(et.Spinner,{className:"wp-block-page-list__loading-indicator"})));if(null===o)return(0,Ke.createElement)("div",{...e},(0,Ke.createElement)(et.Notice,{status:"warning",isDismissible:!1},(0,tt.__)("Page List: Cannot retrieve Pages.")));if(0===o.length)return(0,Ke.createElement)("div",{...e},(0,Ke.createElement)(et.Notice,{status:"info",isDismissible:!1},(0,tt.__)("Page List: Cannot retrieve Pages.")));if(0===a.length){const t=o.find((e=>e.id===r));return t?.title?.rendered?(0,Ke.createElement)("div",{...e},(0,Ke.createElement)(nt.Warning,null,(0,tt.sprintf)((0,tt.__)('Page List: "%s" page has no children.'),t.title.rendered))):(0,Ke.createElement)("div",{...e},(0,Ke.createElement)(et.Notice,{status:"warning",isDismissible:!1},(0,tt.__)("Page List: Cannot retrieve Pages.")))}return o.length>0?(0,Ke.createElement)("ul",{...t}):void 0}const Qb={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/page-list",title:"Page List",category:"widgets",allowedBlocks:["core/page-list-item"],description:"Display a list of all pages.",keywords:["menu","navigation"],textdomain:"default",attributes:{parentPageID:{type:"integer",default:0},isNested:{type:"boolean",default:!1}},usesContext:["textColor","customTextColor","backgroundColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","fontSize","customFontSize","showSubmenuIcon","style","openSubmenusOnClick"],supports:{reusable:!1,html:!1,typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-page-list-editor",style:"wp-block-page-list"},{name:Kb}=Qb,Yb={icon:$b,example:{},edit:function({context:e,clientId:t,attributes:n,setAttributes:a}){const{parentPageID:o}=n,[r,l]=(0,_t.useState)(!1),i=(0,_t.useCallback)((()=>l(!0)),[]),{records:s,hasResolved:c}=(0,dt.useEntityRecords)("postType","page",{per_page:100,_fields:["id","link","menu_order","parent","title","type"],orderby:"menu_order",order:"asc"}),m="showSubmenuIcon"in e&&s?.length>0&&s?.length<=100,u=(0,_t.useMemo)((()=>{if(null===s)return new Map;const e=s.sort(((e,t)=>e.menu_order===t.menu_order?e.title.rendered.localeCompare(t.title.rendered):e.menu_order-t.menu_order));return e.reduce(((e,t)=>{const{parent:n}=t;return e.has(n)?e.get(n).push(t):e.set(n,[t]),e}),new Map)}),[s]),p=(0,nt.useBlockProps)({className:ut()("wp-block-page-list",{"has-text-color":!!e.textColor,[(0,nt.getColorClassName)("color",e.textColor)]:!!e.textColor,"has-background":!!e.backgroundColor,[(0,nt.getColorClassName)("background-color",e.backgroundColor)]:!!e.backgroundColor}),style:{...e.style?.color}}),d=(0,_t.useMemo)((function e(t=0,n=0){const a=u.get(t);return a?.length?a.reduce(((t,a)=>{const o=u.has(a.id),r={value:a.id,label:"— ".repeat(n)+a.title.rendered,rawName:a.title.rendered};return t.push(r),o&&t.push(...e(a.id,n+1)),t}),[]):[]}),[u]),g=(0,_t.useMemo)((function e(t=o){const n=u.get(t);return n?.length?n.reduce(((t,n)=>{const a=u.has(n.id),o={id:n.id,label:""!==n.title?.rendered?.trim()?n.title?.rendered:(0,tt.__)("(no title)"),title:n.title?.rendered,link:n.url,hasChildren:a};let r=null;const l=e(n.id);return r=(0,Qe.createBlock)("core/page-list-item",o,l),t.push(r),t}),[]):[]}),[u,o]),{isNested:h,hasSelectedChild:b,parentClientId:_,hasDraggedChild:y,isChildOfNavigation:v}=(0,gt.useSelect)((e=>{const{getBlockParentsByBlockName:n,hasSelectedInnerBlock:a,hasDraggedInnerBlock:o}=e(nt.store),r=n(t,"core/navigation-submenu",!0),l=n(t,"core/navigation",!0);return{isNested:r.length>0,isChildOfNavigation:l.length>0,hasSelectedChild:a(t,!0),hasDraggedChild:o(t,!0),parentClientId:l[0]}}),[t]),f=Ub({clientId:t,pages:s,parentClientId:_,parentPageID:o}),k=(0,nt.useInnerBlocksProps)(p,{renderAppender:!1,__unstableDisableDropZone:!0,templateLock:!v&&"all",onInput:Wb,onChange:Wb,value:g}),{selectBlock:x}=(0,gt.useDispatch)(nt.store);return(0,_t.useEffect)((()=>{(b||y)&&(i(),x(_))}),[b,y,_,x,i]),(0,_t.useEffect)((()=>{a({isNested:h})}),[h,a]),(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(nt.InspectorControls,null,d.length>0&&(0,Ke.createElement)(et.PanelBody,null,(0,Ke.createElement)(et.ComboboxControl,{__next40pxDefaultSize:!0,className:"editor-page-attributes__parent",label:(0,tt.__)("Parent"),value:o,options:d,onChange:e=>a({parentPageID:null!=e?e:0}),help:(0,tt.__)("Choose a page to show only its subpages.")})),m&&(0,Ke.createElement)(et.PanelBody,{title:(0,tt.__)("Edit this menu")},(0,Ke.createElement)("p",null,qb),(0,Ke.createElement)(et.Button,{variant:"primary",disabled:!c,onClick:f},(0,tt.__)("Edit")))),m&&(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(nt.BlockControls,{group:"other"},(0,Ke.createElement)(et.ToolbarButton,{title:(0,tt.__)("Edit"),onClick:i},(0,tt.__)("Edit"))),r&&(0,Ke.createElement)(jb,{onClick:f,onClose:()=>l(!1),disabled:!c})),(0,Ke.createElement)(Zb,{blockProps:p,innerBlocksProps:k,hasResolvedPages:c,blockList:g,pages:s,parentPageID:o}))}},Jb=()=>Xe({name:Kb,metadata:Qb,settings:Yb}),Xb=()=>(0,Ke.createElement)(et.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},(0,Ke.createElement)(et.Path,{d:"M1.50002 4L6.00002 8L10.5 4",strokeWidth:"1.5"}));const e_={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/page-list-item",title:"Page List Item",category:"widgets",parent:["core/page-list"],description:"Displays a page inside a list of all pages.",keywords:["page","menu","navigation"],textdomain:"default",attributes:{id:{type:"number"},label:{type:"string"},title:{type:"string"},link:{type:"string"},hasChildren:{type:"boolean"}},usesContext:["textColor","customTextColor","backgroundColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","fontSize","customFontSize","showSubmenuIcon","style","openSubmenusOnClick"],supports:{reusable:!1,html:!1,lock:!1,inserter:!1,__experimentalToolbar:!1,interactivity:{clientNavigation:!0}},editorStyle:"wp-block-page-list-editor",style:"wp-block-page-list"},{name:t_}=e_,n_={__experimentalLabel:({label:e})=>e,icon:ob,example:{},edit:function({context:e,attributes:t}){const{id:n,label:a,link:o,hasChildren:r,title:l}=t,i="showSubmenuIcon"in e,s=(0,gt.useSelect)((e=>{if(!e(dt.store).canUser("read","settings"))return;const t=e(dt.store).getEntityRecord("root","site");return"page"===t?.show_on_front&&t?.page_on_front}),[]),c=bh(hh(e,!0)),m=(0,nt.useBlockProps)(c,{className:"wp-block-pages-list__item"}),u=(0,nt.useInnerBlocksProps)(m);return(0,Ke.createElement)("li",{key:n,className:ut()("wp-block-pages-list__item",{"has-child":r,"wp-block-navigation-item":i,"open-on-click":e.openSubmenusOnClick,"open-on-hover-click":!e.openSubmenusOnClick&&e.showSubmenuIcon,"menu-item-home":n===s})},r&&e.openSubmenusOnClick?(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)("button",{type:"button",className:"wp-block-navigation-item__content wp-block-navigation-submenu__toggle","aria-expanded":"false"},(0,Jn.decodeEntities)(a)),(0,Ke.createElement)("span",{className:"wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon"},(0,Ke.createElement)(Xb,null))):(0,Ke.createElement)("a",{className:ut()("wp-block-pages-list__item__link",{"wp-block-navigation-item__content":i}),href:o},(0,Jn.decodeEntities)(l)),r&&(0,Ke.createElement)(Ke.Fragment,null,!e.openSubmenusOnClick&&e.showSubmenuIcon&&(0,Ke.createElement)("button",{className:"wp-block-navigation-item__content wp-block-navigation-submenu__toggle wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon","aria-expanded":"false",type:"button"},(0,Ke.createElement)(Xb,null)),(0,Ke.createElement)("ul",{...u})))}},a_=()=>Xe({name:t_,metadata:e_,settings:n_}),o_=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{d:"m9.99609 14v-.2251l.00391.0001v6.225h1.5v-14.5h2.5v14.5h1.5v-14.5h3v-1.5h-8.50391c-2.76142 0-5 2.23858-5 5 0 2.7614 2.23858 5 5 5z"})),r_={className:!1},l_={align:{type:"string"},content:{type:"string",source:"html",selector:"p",default:""},dropCap:{type:"boolean",default:!1},placeholder:{type:"string"},textColor:{type:"string"},backgroundColor:{type:"string"},fontSize:{type:"string"},direction:{type:"string",enum:["ltr","rtl"]},style:{type:"object"}},i_=e=>{if(!e.customTextColor&&!e.customBackgroundColor&&!e.customFontSize)return e;const t={};(e.customTextColor||e.customBackgroundColor)&&(t.color={}),e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor),e.customFontSize&&(t.typography={fontSize:e.customFontSize});const{customTextColor:n,customBackgroundColor:a,customFontSize:o,...r}=e;return{...r,style:t}},{style:s_,...c_}=l_,m_=[{supports:r_,attributes:{...c_,customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"}},save({attributes:e}){const{align:t,content:n,dropCap:a,direction:o}=e,r=ut()({"has-drop-cap":t!==((0,tt.isRTL)()?"left":"right")&&"center"!==t&&a,[`has-text-align-${t}`]:t});return(0,Ke.createElement)("p",{...nt.useBlockProps.save({className:r,dir:o})},(0,Ke.createElement)(nt.RichText.Content,{value:n}))}},{supports:r_,attributes:{...c_,customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"}},migrate:i_,save({attributes:e}){const{align:t,content:n,dropCap:a,backgroundColor:o,textColor:r,customBackgroundColor:l,customTextColor:i,fontSize:s,customFontSize:c,direction:m}=e,u=(0,nt.getColorClassName)("color",r),p=(0,nt.getColorClassName)("background-color",o),d=(0,nt.getFontSizeClass)(s),g=ut()({"has-text-color":r||i,"has-background":o||l,"has-drop-cap":a,[`has-text-align-${t}`]:t,[d]:d,[u]:u,[p]:p}),h={backgroundColor:p?void 0:l,color:u?void 0:i,fontSize:d?void 0:c};return(0,Ke.createElement)(nt.RichText.Content,{tagName:"p",style:h,className:g||void 0,value:n,dir:m})}},{supports:r_,attributes:{...c_,customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"}},migrate:i_,save({attributes:e}){const{align:t,content:n,dropCap:a,backgroundColor:o,textColor:r,customBackgroundColor:l,customTextColor:i,fontSize:s,customFontSize:c,direction:m}=e,u=(0,nt.getColorClassName)("color",r),p=(0,nt.getColorClassName)("background-color",o),d=(0,nt.getFontSizeClass)(s),g=ut()({"has-text-color":r||i,"has-background":o||l,"has-drop-cap":a,[d]:d,[u]:u,[p]:p}),h={backgroundColor:p?void 0:l,color:u?void 0:i,fontSize:d?void 0:c,textAlign:t};return(0,Ke.createElement)(nt.RichText.Content,{tagName:"p",style:h,className:g||void 0,value:n,dir:m})}},{supports:r_,attributes:{...c_,customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"},width:{type:"string"}},migrate:i_,save({attributes:e}){const{width:t,align:n,content:a,dropCap:o,backgroundColor:r,textColor:l,customBackgroundColor:i,customTextColor:s,fontSize:c,customFontSize:m}=e,u=(0,nt.getColorClassName)("color",l),p=(0,nt.getColorClassName)("background-color",r),d=c&&`is-${c}-text`,g=ut()({[`align${t}`]:t,"has-background":r||i,"has-drop-cap":o,[d]:d,[u]:u,[p]:p}),h={backgroundColor:p?void 0:i,color:u?void 0:s,fontSize:d?void 0:m,textAlign:n};return(0,Ke.createElement)(nt.RichText.Content,{tagName:"p",style:h,className:g||void 0,value:a})}},{supports:r_,attributes:{...c_,fontSize:{type:"number"}},save({attributes:e}){const{width:t,align:n,content:a,dropCap:o,backgroundColor:r,textColor:l,fontSize:i}=e,s=ut()({[`align${t}`]:t,"has-background":r,"has-drop-cap":o}),c={backgroundColor:r,color:l,fontSize:i,textAlign:n};return(0,Ke.createElement)("p",{style:c,className:s||void 0},a)},migrate:e=>i_({...e,customFontSize:Number.isFinite(e.fontSize)?e.fontSize:void 0,customTextColor:e.textColor&&"#"===e.textColor[0]?e.textColor:void 0,customBackgroundColor:e.backgroundColor&&"#"===e.backgroundColor[0]?e.backgroundColor:void 0})},{supports:r_,attributes:{...l_,content:{type:"string",source:"html",default:""}},save:({attributes:e})=>(0,Ke.createElement)(_t.RawHTML,null,e.content),migrate:e=>e}],u_=m_,p_=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,Ke.createElement)(Ye.Path,{d:"M5.52 2h7.43c.55 0 1 .45 1 1s-.45 1-1 1h-1v13c0 .55-.45 1-1 1s-1-.45-1-1V5c0-.55-.45-1-1-1s-1 .45-1 1v12c0 .55-.45 1-1 1s-1-.45-1-1v-5.96h-.43C3.02 11.04 1 9.02 1 6.52S3.02 2 5.52 2zM14 14l5-4-5-4v8z"}));function d_(e){const{batch:t}=(0,gt.useRegistry)(),{moveBlocksToPosition:n,replaceInnerBlocks:a,duplicateBlocks:o,insertBlock:r}=(0,gt.useDispatch)(nt.store),{getBlockRootClientId:l,getBlockIndex:i,getBlockOrder:s,getBlockName:c,getBlock:m,getNextBlockClientId:u,canInsertBlockType:p}=(0,gt.useSelect)(nt.store),d=(0,_t.useRef)(e);return d.current=e,(0,jt.useRefEffect)((e=>{function g(e){if(e.defaultPrevented)return;if(e.keyCode!==fn.ENTER)return;const{content:g,clientId:h}=d.current;if(g.length)return;const b=l(h);if(!(0,Qe.hasBlockSupport)(c(b),"__experimentalOnEnter",!1))return;const _=s(b),y=_.indexOf(h);if(y===_.length-1){let t=b;for(;!p(c(h),l(t));)t=l(t);return void("string"==typeof t&&(e.preventDefault(),n([h],b,l(t),i(t)+1)))}const v=(0,Qe.getDefaultBlockName)();if(!p(v,l(b)))return;e.preventDefault();const f=m(b);t((()=>{o([b]);const e=i(b);a(b,f.innerBlocks.slice(0,y)),a(u(b),f.innerBlocks.slice(y+1)),r((0,Qe.createBlock)(v),e+1,l(b),!0)}))}return e.addEventListener("keydown",g),()=>{e.removeEventListener("keydown",g)}}),[])}function g_({direction:e,setDirection:t}){return(0,tt.isRTL)()&&(0,Ke.createElement)(et.ToolbarButton,{icon:p_,title:(0,tt._x)("Left to right","editor button"),isActive:"ltr"===e,onClick:()=>{t("ltr"===e?void 0:"ltr")}})}function h_(e){return e===((0,tt.isRTL)()?"left":"right")||"center"===e}function b_({clientId:e,attributes:t,setAttributes:n}){const[a]=(0,nt.useSettings)("typography.dropCap");if(!a)return null;const{align:o,dropCap:r}=t;let l;return l=h_(o)?(0,tt.__)("Not available for aligned text."):r?(0,tt.__)("Showing large initial letter."):(0,tt.__)("Toggle to show a large initial letter."),(0,Ke.createElement)(et.__experimentalToolsPanelItem,{hasValue:()=>!!r,label:(0,tt.__)("Drop cap"),onDeselect:()=>n({dropCap:void 0}),resetAllFilter:()=>({dropCap:void 0}),panelId:e},(0,Ke.createElement)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Drop cap"),checked:!!r,onChange:()=>n({dropCap:!r}),help:l,disabled:!!h_(o)}))}const __=function({attributes:e,mergeBlocks:t,onReplace:n,onRemove:a,setAttributes:o,clientId:r}){const{align:l,content:i,direction:s,dropCap:c,placeholder:m}=e,u=(0,nt.useBlockProps)({ref:d_({clientId:r,content:i}),className:ut()({"has-drop-cap":!h_(l)&&c,[`has-text-align-${l}`]:l}),style:{direction:s}}),p=(0,nt.useBlockEditingMode)();return(0,Ke.createElement)(Ke.Fragment,null,"default"===p&&(0,Ke.createElement)(nt.BlockControls,{group:"block"},(0,Ke.createElement)(nt.AlignmentControl,{value:l,onChange:e=>o({align:e,dropCap:!h_(e)&&c})}),(0,Ke.createElement)(g_,{direction:s,setDirection:e=>o({direction:e})})),(0,Ke.createElement)(nt.InspectorControls,{group:"typography"},(0,Ke.createElement)(b_,{clientId:r,attributes:e,setAttributes:o})),(0,Ke.createElement)(nt.RichText,{identifier:"content",tagName:"p",...u,value:i,onChange:e=>o({content:e}),onSplit:(t,n)=>{let a;(n||t)&&(a={...e,content:t});const o=(0,Qe.createBlock)("core/paragraph",a);return n&&(o.clientId=r),o},onMerge:t,onReplace:n,onRemove:a,"aria-label":nt.RichText.isEmpty(i)?(0,tt.__)("Empty block; start writing or type forward slash to choose a block"):(0,tt.__)("Block: Paragraph"),"data-empty":nt.RichText.isEmpty(i),placeholder:m||(0,tt.__)("Type / to choose a block"),"data-custom-placeholder":!!m||void 0,__unstableEmbedURLOnPaste:!0,__unstableAllowPrefixTransformations:!0}))};const{name:y_}={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/paragraph",title:"Paragraph",category:"text",description:"Start with the basic building block of all narrative.",keywords:["text"],textdomain:"default",usesContext:["postId"],attributes:{align:{type:"string"},content:{type:"rich-text",source:"rich-text",selector:"p",__experimentalRole:"content"},dropCap:{type:"boolean",default:!1},placeholder:{type:"string"},direction:{type:"string",enum:["ltr","rtl"]}},supports:{anchor:!0,className:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalWritingMode:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalSelector:"p",__unstablePasteTextInline:!0,interactivity:{clientNavigation:!0}},editorStyle:"wp-block-paragraph-editor",style:"wp-block-paragraph"},v_={from:[{type:"raw",priority:20,selector:"p",schema:({phrasingContentSchema:e,isPaste:t})=>({p:{children:e,attributes:t?[]:["style","id"]}}),transform(e){const t=(0,Qe.getBlockAttributes)(y_,e.outerHTML),{textAlign:n}=e.style||{};return"left"!==n&&"center"!==n&&"right"!==n||(t.align=n),(0,Qe.createBlock)(y_,t)}}]},f_=v_,k_={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/paragraph",title:"Paragraph",category:"text",description:"Start with the basic building block of all narrative.",keywords:["text"],textdomain:"default",usesContext:["postId"],attributes:{align:{type:"string"},content:{type:"rich-text",source:"rich-text",selector:"p",__experimentalRole:"content"},dropCap:{type:"boolean",default:!1},placeholder:{type:"string"},direction:{type:"string",enum:["ltr","rtl"]}},supports:{anchor:!0,className:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalWritingMode:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalSelector:"p",__unstablePasteTextInline:!0,interactivity:{clientNavigation:!0}},editorStyle:"wp-block-paragraph-editor",style:"wp-block-paragraph"},{name:x_}=k_,w_={icon:o_,example:{attributes:{content:(0,tt.__)("In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.")}},__experimentalLabel(e,{context:t}){const n=e?.metadata?.name;if("list-view"===t&&n)return n;if("accessibility"===t){if(n)return n;const{content:t}=e;return t&&0!==t.length?t:(0,tt.__)("Empty")}},transforms:f_,deprecated:u_,merge:(e,t)=>({content:(e.content||"")+(t.content||"")}),edit:__,save:function({attributes:e}){const{align:t,content:n,dropCap:a,direction:o}=e,r=ut()({"has-drop-cap":t!==((0,tt.isRTL)()?"left":"right")&&"center"!==t&&a,[`has-text-align-${t}`]:t});return(0,Ke.createElement)("p",{...nt.useBlockProps.save({className:r,dir:o})},(0,Ke.createElement)(nt.RichText.Content,{value:n}))}},E_=()=>Xe({name:x_,metadata:k_,settings:w_}),C_=(0,Ke.createElement)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,Ke.createElement)(Ye.Path,{d:"M10 4.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0zm2.25 7.5v-1A2.75 2.75 0 0011 8.25H7A2.75 2.75 0 004.25 11v1h1.5v-1c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v1h1.5zM4 20h9v-1.5H4V20zm16-4H4v-1.5h16V16z",fillRule:"evenodd",clipRule:"evenodd"})),S_={who:"authors",per_page:100};const B_=function({isSelected:e,context:{postType:t,postId:n,queryId:a},attributes:o,setAttributes:r}){const l=Number.isFinite(a),{authorId:i,authorDetails:s,authors:c}=(0,gt.useSelect)((e=>{const{getEditedEntityRecord:a,getUser:o,getUsers:r}=e(dt.store),l=a("postType",t,n)?.author;return{authorId:l,authorDetails:l?o(l):null,authors:r(S_)}}),[t,n]),{editEntityRecord:m}=(0,gt.useDispatch)(dt.store),{textAlign:u,showAvatar:p,showBio:d,byline:g,isLink:h,linkTarget:b}=o,_=[],y=s?.name||(0,tt.__)("Post Author");s?.avatar_urls&&Object.keys(s.avatar_urls).forEach((e=>{_.push({value:e,label:`${e} x ${e}`})}));const v=(0,nt.useBlockProps)({className:ut()({[`has-text-align-${u}`]:u})}),f=c?.length?c.map((({id:e,name:t})=>({value:e,label:t}))):[],k=e=>{m("postType",t,n,{author:e})},x=f.length>=25,w=!!n&&!l&&f.length>0;return(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(nt.InspectorControls,null,(0,Ke.createElement)(et.PanelBody,{title:(0,tt.__)("Settings")},w&&(x&&(0,Ke.createElement)(et.ComboboxControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Author"),options:f,value:i,onChange:k,allowReset:!1})||(0,Ke.createElement)(et.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Author"),value:i,options:f,onChange:k})),(0,Ke.createElement)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Show avatar"),checked:p,onChange:()=>r({showAvatar:!p})}),p&&(0,Ke.createElement)(et.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Avatar size"),value:o.avatarSize,options:_,onChange:e=>{r({avatarSize:Number(e)})}}),(0,Ke.createElement)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Show bio"),checked:d,onChange:()=>r({showBio:!d})}),(0,Ke.createElement)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Link author name to author page"),checked:h,onChange:()=>r({isLink:!h})}),h&&(0,Ke.createElement)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Open in new tab"),onChange:e=>r({linkTarget:e?"_blank":"_self"}),checked:"_blank"===b}))),(0,Ke.createElement)(nt.BlockControls,{group:"block"},(0,Ke.createElement)(nt.AlignmentControl,{value:u,onChange:e=>{r({textAlign:e})}})),(0,Ke.createElement)("div",{...v},p&&s?.avatar_urls&&(0,Ke.createElement)("div",{className:"wp-block-post-author__avatar"},(0,Ke.createElement)("img",{width:o.avatarSize,src:s.avatar_urls[o.avatarSize],alt:s.name})),(0,Ke.createElement)("div",{className:"wp-block-post-author__content"},(!nt.RichText.isEmpty(g)||e)&&(0,Ke.createElement)(nt.RichText,{className:"wp-block-post-author__byline","aria-label":(0,tt.__)("Post author byline text"),placeholder:(0,tt.__)("Write byline…"),value:g,onChange:e=>r({byline:e})}),(0,Ke.createElement)("p",{className:"wp-block-post-author__name"},h?(0,Ke.createElement)("a",{href:"#post-author-pseudo-link",onClick:e=>e.preventDefault()},y):y),d&&(0,Ke.createElement)("p",{className:"wp-block-post-author__bio",dangerouslySetInnerHTML:{__html:s?.description}}))))},N_={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-author",title:"Author",category:"theme",description:"Display post author details such as name, avatar, and bio.",textdomain:"default",attributes:{textAlign:{type:"string"},avatarSize:{type:"number",default:48},showAvatar:{type:"boolean",default:!0},showBio:{type:"boolean"},byline:{type:"string"},isLink:{type:"boolean",default:!1},linkTarget:{type:"string",default:"_self"}},usesContext:["postType","postId","queryId"],supports:{html:!1,spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},color:{gradients:!0,link:!0,__experimentalDuotone:".wp-block-post-author__avatar img",__experimentalDefaultControls:{background:!0,text:!0}},interactivity:{clientNavigation:!0}},style:"wp-block-post-author"},{name:T_}=N_,I_={icon:C_,edit:B_},P_=()=>Xe({name:T_,metadata:N_,settings:I_});const M_=function({context:{postType:e,postId:t},attributes:{textAlign:n,isLink:a,linkTarget:o},setAttributes:r}){const{authorName:l}=(0,gt.useSelect)((n=>{const{getEditedEntityRecord:a,getUser:o}=n(dt.store),r=a("postType",e,t)?.author;return{authorName:r?o(r):null}}),[e,t]),i=(0,nt.useBlockProps)({className:ut()({[`has-text-align-${n}`]:n})}),s=l?.name||(0,tt.__)("Author Name"),c=a?(0,Ke.createElement)("a",{href:"#author-pseudo-link",onClick:e=>e.preventDefault(),className:"wp-block-post-author-name__link"},s):s;return(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(nt.BlockControls,{group:"block"},(0,Ke.createElement)(nt.AlignmentControl,{value:n,onChange:e=>{r({textAlign:e})}})),(0,Ke.createElement)(nt.InspectorControls,null,(0,Ke.createElement)(et.PanelBody,{title:(0,tt.__)("Settings")},(0,Ke.createElement)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Link to author archive"),onChange:()=>r({isLink:!a}),checked:a}),a&&(0,Ke.createElement)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Open in new tab"),onChange:e=>r({linkTarget:e?"_blank":"_self"}),checked:"_blank"===o}))),(0,Ke.createElement)("div",{...i}," ",c," "))},z_={from:[{type:"block",blocks:["core/post-author"],transform:({textAlign:e})=>(0,Qe.createBlock)("core/post-author-name",{textAlign:e})}],to:[{type:"block",blocks:["core/post-author"],transform:({textAlign:e})=>(0,Qe.createBlock)("core/post-author",{textAlign:e})}]},R_={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-author-name",title:"Author Name",category:"theme",description:"The author name.",textdomain:"default",attributes:{textAlign:{type:"string"},isLink:{type:"boolean",default:!1},linkTarget:{type:"string",default:"_self"}},usesContext:["postType","postId"],supports:{html:!1,spacing:{margin:!0,padding:!0},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}}},{name:A_}=R_,H_={icon:C_,transforms:z_,edit:M_},L_=()=>Xe({name:A_,metadata:R_,settings:H_});const D_=function({context:{postType:e,postId:t},attributes:{textAlign:n},setAttributes:a}){const{authorDetails:o}=(0,gt.useSelect)((n=>{const{getEditedEntityRecord:a,getUser:o}=n(dt.store),r=a("postType",e,t)?.author;return{authorDetails:r?o(r):null}}),[e,t]),r=(0,nt.useBlockProps)({className:ut()({[`has-text-align-${n}`]:n})}),l=o?.description||(0,tt.__)("Author Biography");return(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(nt.BlockControls,{group:"block"},(0,Ke.createElement)(nt.AlignmentControl,{value:n,onChange:e=>{a({textAlign:e})}})),(0,Ke.createElement)("div",{...r,dangerouslySetInnerHTML:{__html:l}}))},F_={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-author-biography",title:"Author Biography",category:"theme",description:"The author biography.",textdomain:"default",attributes:{textAlign:{type:"string"}},usesContext:["postType","postId"],supports:{spacing:{margin:!0,padding:!0},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}}},{name:V_}=F_,$_={icon:C_,edit:D_},O_=()=>Xe({name:V_,metadata:F_,settings:$_}),G_=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})),U_=[["core/avatar"],["core/comment-author-name"],["core/comment-date"],["core/comment-content"],["core/comment-reply-link"],["core/comment-edit-link"]];const q_={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,__experimental:"fse",name:"core/post-comment",title:"Comment (deprecated)",category:"theme",allowedBlocks:["core/avatar","core/comment-author-name","core/comment-content","core/comment-date","core/comment-edit-link","core/comment-reply-link"],description:"This block is deprecated. Please use the Comments block instead.",textdomain:"default",attributes:{commentId:{type:"number"}},providesContext:{commentId:"commentId"},supports:{html:!1,inserter:!1,interactivity:{clientNavigation:!0}}},{name:j_}=q_,W_={icon:kp,edit:function({attributes:{commentId:e},setAttributes:t}){const[n,a]=(0,_t.useState)(e),o=(0,nt.useBlockProps)(),r=(0,nt.useInnerBlocksProps)(o,{template:U_});return e?(0,Ke.createElement)("div",{...r}):(0,Ke.createElement)("div",{...o},(0,Ke.createElement)(et.Placeholder,{icon:G_,label:(0,tt._x)("Post Comment","block title"),instructions:(0,tt.__)("To show a comment, input the comment ID.")},(0,Ke.createElement)(et.TextControl,{__nextHasNoMarginBottom:!0,value:e,onChange:e=>a(parseInt(e))}),(0,Ke.createElement)(et.Button,{variant:"primary",onClick:()=>{t({commentId:n})}},(0,tt.__)("Save"))))},save:function(){const e=nt.useBlockProps.save(),t=nt.useInnerBlocksProps.save(e);return(0,Ke.createElement)("div",{...t})}},Z_=()=>Xe({name:j_,metadata:q_,settings:W_}),Q_=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{d:"M13 8H4v1.5h9V8zM4 4v1.5h16V4H4zm9 8H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1V13c0-.6-.4-1-1-1zm-2.2 6.6H7l1.6-2.2c.3-.4.5-.7.6-.9.1-.2.2-.4.2-.5 0-.2-.1-.3-.1-.4-.1-.1-.2-.1-.4-.1s-.4 0-.6.1c-.3.1-.5.3-.7.4l-.2.2-.2-1.2.1-.1c.3-.2.5-.3.8-.4.3-.1.6-.1.9-.1.3 0 .6.1.9.2.2.1.4.3.6.5.1.2.2.5.2.7 0 .3-.1.6-.2.9-.1.3-.4.7-.7 1.1l-.5.6h1.6v1.2z"}));const K_={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,__experimental:"fse",name:"core/post-comments-count",title:"Comments Count",category:"theme",description:"Display a post's comments count.",textdomain:"default",attributes:{textAlign:{type:"string"}},usesContext:["postId"],supports:{html:!1,color:{gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}}},{name:Y_}=K_,J_={icon:Q_,edit:function({attributes:e,context:t,setAttributes:n}){const{textAlign:a}=e,{postId:o}=t,[r,l]=(0,_t.useState)(),i=(0,nt.useBlockProps)({className:ut()({[`has-text-align-${a}`]:a})});(0,_t.useEffect)((()=>{if(!o)return;const e=o;jo()({path:(0,pt.addQueryArgs)("/wp/v2/comments",{post:o}),parse:!1}).then((t=>{e===o&&l(t.headers.get("X-WP-Total"))}))}),[o]);const s=o&&void 0!==r,c={...i.style,textDecoration:s?i.style?.textDecoration:void 0};return(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(nt.BlockControls,{group:"block"},(0,Ke.createElement)(nt.AlignmentControl,{value:a,onChange:e=>{n({textAlign:e})}})),(0,Ke.createElement)("div",{...i,style:c},s?r:(0,Ke.createElement)(nt.Warning,null,(0,tt.__)("Post Comments Count block: post not found."))))}},X_=()=>Xe({name:Y_,metadata:K_,settings:J_}),ey=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{d:"M13 8H4v1.5h9V8zM4 4v1.5h16V4H4zm9 8H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1V13c0-.6-.4-1-1-1zm-.5 6.6H6.7l-1.2 1.2v-6.3h7v5.1z"}));const ty={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-comments-form",title:"Comments Form",category:"theme",description:"Display a post's comments form.",textdomain:"default",attributes:{textAlign:{type:"string"}},usesContext:["postId","postType"],supports:{html:!1,color:{gradients:!0,heading:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}}},editorStyle:"wp-block-post-comments-form-editor",style:["wp-block-post-comments-form","wp-block-buttons","wp-block-button"]},{name:ny}=ty,ay={icon:ey,edit:function e({attributes:t,context:n,setAttributes:a}){const{textAlign:o}=t,{postId:r,postType:l}=n,i=(0,jt.useInstanceId)(e),s=(0,tt.sprintf)("comments-form-edit-%d-desc",i),c=(0,nt.useBlockProps)({className:ut()({[`has-text-align-${o}`]:o}),"aria-describedby":s});return(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(nt.BlockControls,{group:"block"},(0,Ke.createElement)(nt.AlignmentControl,{value:o,onChange:e=>{a({textAlign:e})}})),(0,Ke.createElement)("div",{...c},(0,Ke.createElement)(eo,{postId:r,postType:l}),(0,Ke.createElement)(et.VisuallyHidden,{id:s},(0,tt.__)("Comments form disabled in editor."))))}},oy=()=>Xe({name:ny,metadata:ty,settings:ay});const ry=function({context:e,attributes:t,setAttributes:n}){const{textAlign:a}=t,{postType:o,postId:r}=e,[l,i]=(0,_t.useState)(),s=(0,nt.useBlockProps)({className:ut()({[`has-text-align-${a}`]:a})});(0,_t.useEffect)((()=>{if(!r)return;const e=r;jo()({path:(0,pt.addQueryArgs)("/wp/v2/comments",{post:r}),parse:!1}).then((t=>{e===r&&i(t.headers.get("X-WP-Total"))}))}),[r]);const c=(0,gt.useSelect)((e=>e(dt.store).getEditedEntityRecord("postType",o,r)),[o,r]);if(!c)return null;const{link:m}=c;let u;if(void 0!==l){const e=parseInt(l);u=0===e?(0,tt.__)("No comments"):(0,tt.sprintf)((0,tt._n)("%s comment","%s comments",e),e.toLocaleString())}return(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(nt.BlockControls,{group:"block"},(0,Ke.createElement)(nt.AlignmentControl,{value:a,onChange:e=>{n({textAlign:e})}})),(0,Ke.createElement)("div",{...s},m&&void 0!==u?(0,Ke.createElement)("a",{href:m+"#comments",onClick:e=>e.preventDefault()},u):(0,Ke.createElement)(nt.Warning,null,(0,tt.__)("Post Comments Link block: post not found."))))},ly={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,__experimental:"fse",name:"core/post-comments-link",title:"Comments Link",category:"theme",description:"Displays the link to the current post comments.",textdomain:"default",usesContext:["postType","postId"],attributes:{textAlign:{type:"string"}},supports:{html:!1,color:{link:!0,text:!1,__experimentalDefaultControls:{background:!0,link:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}}},{name:iy}=ly,sy={edit:ry,icon:Q_},cy=()=>Xe({name:iy,metadata:ly,settings:sy}),my=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{d:"M4 6h12V4.5H4V6Zm16 4.5H4V9h16v1.5ZM4 15h16v-1.5H4V15Zm0 4.5h16V18H4v1.5Z"}));function uy(e,t,n){return(0,gt.useSelect)((a=>a(dt.store).canUserEditEntityRecord(e,t,n)),[e,t,n])}function py({layoutClassNames:e,userCanEdit:t,postType:n,postId:a}){const[,,o]=(0,dt.useEntityProp)("postType",n,"content",a),r=(0,nt.useBlockProps)({className:e});return o?.protected&&!t?(0,Ke.createElement)("div",{...r},(0,Ke.createElement)(nt.Warning,null,(0,tt.__)("This content is password protected."))):(0,Ke.createElement)("div",{...r,dangerouslySetInnerHTML:{__html:o?.rendered}})}function dy({context:e={}}){const{postType:t,postId:n}=e,[a,o,r]=(0,dt.useEntityBlockEditor)("postType",t,{id:n}),l=(0,gt.useSelect)((e=>e(dt.store).getEntityRecord("postType",t,n)),[t,n]),i=!!l?.content?.raw||a?.length,s=(0,nt.useInnerBlocksProps)((0,nt.useBlockProps)({className:"entry-content"}),{value:a,onInput:o,onChange:r,template:i?void 0:[["core/paragraph"]]});return(0,Ke.createElement)("div",{...s})}function gy(e){const{context:{queryId:t,postType:n,postId:a}={},layoutClassNames:o}=e,r=uy("postType",n,a);if(void 0===r)return null;const l=Number.isFinite(t);return r&&!l?(0,Ke.createElement)(dy,{...e}):(0,Ke.createElement)(py,{layoutClassNames:o,userCanEdit:r,postType:n,postId:a})}function hy({layoutClassNames:e}){const t=(0,nt.useBlockProps)({className:e});return(0,Ke.createElement)("div",{...t},(0,Ke.createElement)("p",null,(0,tt.__)("This is the Content block, it will display all the blocks in any single post or page.")),(0,Ke.createElement)("p",null,(0,tt.__)("That might be a simple arrangement like consecutive paragraphs in a blog post, or a more elaborate composition that includes image galleries, videos, tables, columns, and any other block types.")),(0,Ke.createElement)("p",null,(0,tt.__)("If there are any Custom Post Types registered at your site, the Content block can display the contents of those entries as well.")))}function by(){const e=(0,nt.useBlockProps)();return(0,Ke.createElement)("div",{...e},(0,Ke.createElement)(nt.Warning,null,(0,tt.__)("Block cannot be rendered inside itself.")))}const _y={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-content",title:"Content",category:"theme",description:"Displays the contents of a post or page.",textdomain:"default",usesContext:["postId","postType","queryId"],supports:{align:["wide","full"],html:!1,layout:!0,dimensions:{minHeight:!0},spacing:{blockGap:!0},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!1,text:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}}},editorStyle:"wp-block-post-content-editor"},{name:yy}=_y,vy={icon:my,edit:function({context:e,__unstableLayoutClassNames:t}){const{postId:n,postType:a}=e,o=(0,nt.useHasRecursion)(n);return n&&a&&o?(0,Ke.createElement)(by,null):(0,Ke.createElement)(nt.RecursionProvider,{uniqueId:n},n&&a?(0,Ke.createElement)(gy,{context:e,layoutClassNames:t}):(0,Ke.createElement)(hy,{layoutClassNames:t}))}},fy=()=>Xe({name:yy,metadata:_y,settings:vy});function ky(e){return/(?:^|[^\\])[aAgh]/.test(e)}const xy={attributes:{textAlign:{type:"string"},format:{type:"string"},isLink:{type:"boolean",default:!1}},supports:{html:!1,color:{gradients:!0,link:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalLetterSpacing:!0}},save:()=>null,migrate:ln,isEligible:({style:e})=>e?.typography?.fontFamily},wy=[xy],Ey=[{name:"post-date-modified",title:(0,tt.__)("Modified Date"),description:(0,tt.__)("Display a post's last updated date."),attributes:{displayType:"modified"},scope:["block","inserter"],isActive:e=>"modified"===e.displayType,icon:Co}],Cy=Ey,Sy={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-date",title:"Date",category:"theme",description:"Display the publish date for an entry such as a post or page.",textdomain:"default",attributes:{textAlign:{type:"string"},format:{type:"string"},isLink:{type:"boolean",default:!1},displayType:{type:"string",default:"date"}},usesContext:["postId","postType","queryId"],supports:{html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}}},{name:By}=Sy,Ny={icon:Co,edit:function({attributes:{textAlign:e,format:t,isLink:n,displayType:a},context:{postId:o,postType:r,queryId:l},setAttributes:i}){const s=(0,nt.useBlockProps)({className:ut()({[`has-text-align-${e}`]:e,"wp-block-post-date__modified-date":"modified"===a})}),[c,m]=(0,_t.useState)(null),u=(0,_t.useMemo)((()=>({anchor:c})),[c]),p=Number.isFinite(l),d=(0,So.getSettings)(),[g=d.formats.date]=(0,dt.useEntityProp)("root","site","date_format"),[h=d.formats.time]=(0,dt.useEntityProp)("root","site","time_format"),[b,_]=(0,dt.useEntityProp)("postType",r,a,o),y=(0,gt.useSelect)((e=>r?e(dt.store).getPostType(r):null),[r]),v="date"===a?(0,tt.__)("Post Date"):(0,tt.__)("Post Modified Date");let f=b?(0,Ke.createElement)("time",{dateTime:(0,So.dateI18n)("c",b),ref:m},(0,So.dateI18n)(t||g,b)):v;return n&&b&&(f=(0,Ke.createElement)("a",{href:"#post-date-pseudo-link",onClick:e=>e.preventDefault()},f)),(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(nt.BlockControls,{group:"block"},(0,Ke.createElement)(nt.AlignmentControl,{value:e,onChange:e=>{i({textAlign:e})}}),b&&"date"===a&&!p&&(0,Ke.createElement)(et.ToolbarGroup,null,(0,Ke.createElement)(et.Dropdown,{popoverProps:u,renderContent:({onClose:e})=>(0,Ke.createElement)(nt.__experimentalPublishDateTimePicker,{currentDate:b,onChange:_,is12Hour:ky(h),onClose:e}),renderToggle:({isOpen:e,onToggle:t})=>(0,Ke.createElement)(et.ToolbarButton,{"aria-expanded":e,icon:Di,title:(0,tt.__)("Change Date"),onClick:t,onKeyDown:n=>{e||n.keyCode!==fn.DOWN||(n.preventDefault(),t())}})}))),(0,Ke.createElement)(nt.InspectorControls,null,(0,Ke.createElement)(et.PanelBody,{title:(0,tt.__)("Settings")},(0,Ke.createElement)(nt.__experimentalDateFormatPicker,{format:t,defaultFormat:g,onChange:e=>i({format:e})}),(0,Ke.createElement)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:y?.labels.singular_name?(0,tt.sprintf)((0,tt.__)("Link to %s"),y.labels.singular_name.toLowerCase()):(0,tt.__)("Link to post"),onChange:()=>i({isLink:!n}),checked:n}),(0,Ke.createElement)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Display last modified date"),onChange:e=>i({displayType:e?"modified":"date"}),checked:"modified"===a,help:(0,tt.__)("Only shows if the post has been modified")}))),(0,Ke.createElement)("div",{...s},f))},deprecated:wy,variations:Cy},Ty=()=>Xe({name:By,metadata:Sy,settings:Ny}),Iy=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{d:"M8.001 3.984V9.47c0 1.518-.98 2.5-2.499 2.5h-.5v-1.5h.5c.69 0 1-.31 1-1V6.984H4v-3h4.001ZM4 20h9v-1.5H4V20Zm16-4H4v-1.5h16V16ZM13.001 3.984V9.47c0 1.518-.98 2.5-2.499 2.5h-.5v-1.5h.5c.69 0 1-.31 1-1V6.984H9v-3h4.001Z"}));const Py={from:[{type:"block",blocks:["core/post-content"],transform:()=>(0,Qe.createBlock)("core/post-excerpt")}],to:[{type:"block",blocks:["core/post-content"],transform:()=>(0,Qe.createBlock)("core/post-content")}]},My={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-excerpt",title:"Excerpt",category:"theme",description:"Display the excerpt.",textdomain:"default",attributes:{textAlign:{type:"string"},moreText:{type:"string"},showMoreOnNewLine:{type:"boolean",default:!0},excerptLength:{type:"number",default:55}},usesContext:["postId","postType","queryId"],supports:{html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-post-excerpt-editor",style:"wp-block-post-excerpt"},{name:zy}=My,Ry={icon:Iy,transforms:Py,edit:function({attributes:{textAlign:e,moreText:t,showMoreOnNewLine:n,excerptLength:a},setAttributes:o,isSelected:r,context:{postId:l,postType:i,queryId:s}}){const c=Number.isFinite(s),m=uy("postType",i,l),[u,p,{rendered:d,protected:g}={}]=(0,dt.useEntityProp)("postType",i,"excerpt",l),h=(0,gt.useSelect)((e=>"page"===i||!!e(dt.store).getPostType(i)?.supports?.excerpt),[i]),b=m&&!c&&h,_=(0,nt.useBlockProps)({className:ut()({[`has-text-align-${e}`]:e})}),y=(0,tt._x)("words","Word count type. Do not translate!"),v=(0,_t.useMemo)((()=>{if(!d)return"";const e=(new window.DOMParser).parseFromString(d,"text/html");return e.body.textContent||e.body.innerText||""}),[d]);if(!i||!l)return(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(nt.BlockControls,null,(0,Ke.createElement)(nt.AlignmentToolbar,{value:e,onChange:e=>o({textAlign:e})})),(0,Ke.createElement)("div",{..._},(0,Ke.createElement)("p",null,(0,tt.__)("This block will display the excerpt."))));if(g&&!m)return(0,Ke.createElement)("div",{..._},(0,Ke.createElement)(nt.Warning,null,(0,tt.__)("The content is currently protected and does not have the available excerpt.")));const f=(0,Ke.createElement)(nt.RichText,{className:"wp-block-post-excerpt__more-link",tagName:"a","aria-label":(0,tt.__)("“Read more” link text"),placeholder:(0,tt.__)('Add "read more" link text'),value:t,onChange:e=>o({moreText:e}),withoutInteractiveFormatting:!0}),k=ut()("wp-block-post-excerpt__excerpt",{"is-inline":!n}),x=(u||v).trim();let w="";if("words"===y)w=x.split(" ",a).join(" ");else if("characters_excluding_spaces"===y){const e=x.split("",a).join(""),t=e.length-e.replaceAll(" ","").length;w=x.split("",a+t).join("")}else"characters_including_spaces"===y&&(w=x.split("",a).join(""));const E=w!==x,C=b?(0,Ke.createElement)(nt.RichText,{className:k,"aria-label":(0,tt.__)("Excerpt text"),value:r?x:(E?w+"…":x)||(0,tt.__)("No excerpt found"),onChange:p,tagName:"p"}):(0,Ke.createElement)("p",{className:k},E?w+"…":x||(0,tt.__)("No excerpt found"));return(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(nt.BlockControls,null,(0,Ke.createElement)(nt.AlignmentToolbar,{value:e,onChange:e=>o({textAlign:e})})),(0,Ke.createElement)(nt.InspectorControls,null,(0,Ke.createElement)(et.PanelBody,{title:(0,tt.__)("Settings")},(0,Ke.createElement)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Show link on new line"),checked:n,onChange:e=>o({showMoreOnNewLine:e})}),(0,Ke.createElement)(et.RangeControl,{label:(0,tt.__)("Max number of words"),value:a,onChange:e=>{o({excerptLength:e})},min:"10",max:"100"}))),(0,Ke.createElement)("div",{..._},C,!n&&" ",n?(0,Ke.createElement)("p",{className:"wp-block-post-excerpt__more-text"},f):f))}},Ay=()=>Xe({name:zy,metadata:My,settings:Ry}),Hy=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{d:"M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z"})),Ly=(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(et.__experimentalToggleGroupControlOption,{value:"cover",label:(0,tt._x)("Cover","Scale option for Image dimension control")}),(0,Ke.createElement)(et.__experimentalToggleGroupControlOption,{value:"contain",label:(0,tt._x)("Contain","Scale option for Image dimension control")}),(0,Ke.createElement)(et.__experimentalToggleGroupControlOption,{value:"fill",label:(0,tt._x)("Fill","Scale option for Image dimension control")})),Dy="cover",Fy={cover:(0,tt.__)("Image is scaled and cropped to fill the entire space without being distorted."),contain:(0,tt.__)("Image is scaled to fill the space without clipping nor distorting."),fill:(0,tt.__)("Image will be stretched and distorted to completely fill the space.")},Vy=({clientId:e,attributes:{aspectRatio:t,width:n,height:a,scale:o,sizeSlug:r},setAttributes:l,imageSizeOptions:i=[]})=>{const[s]=(0,nt.useSettings)("spacing.units"),c=(0,et.__experimentalUseCustomUnits)({availableUnits:s||["px","%","vw","em","rem"]}),m=(e,t)=>{const n=parseFloat(t);isNaN(n)&&t||l({[e]:n<0?"0":t})},u=(0,tt._x)("Scale","Image scaling options"),p=a||t&&"auto"!==t;return(0,Ke.createElement)(nt.InspectorControls,{group:"dimensions"},(0,Ke.createElement)(et.__experimentalToolsPanelItem,{hasValue:()=>!!t,label:(0,tt.__)("Aspect ratio"),onDeselect:()=>l({aspectRatio:void 0}),resetAllFilter:()=>({aspectRatio:void 0}),isShownByDefault:!0,panelId:e},(0,Ke.createElement)(et.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Aspect ratio"),value:t,options:[{label:(0,tt.__)("Original"),value:"auto"},{label:(0,tt.__)("Square"),value:"1"},{label:(0,tt.__)("16:9"),value:"16/9"},{label:(0,tt.__)("4:3"),value:"4/3"},{label:(0,tt.__)("3:2"),value:"3/2"},{label:(0,tt.__)("9:16"),value:"9/16"},{label:(0,tt.__)("3:4"),value:"3/4"},{label:(0,tt.__)("2:3"),value:"2/3"}],onChange:e=>l({aspectRatio:e})})),(0,Ke.createElement)(et.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>!!a,label:(0,tt.__)("Height"),onDeselect:()=>l({height:void 0}),resetAllFilter:()=>({height:void 0}),isShownByDefault:!0,panelId:e},(0,Ke.createElement)(et.__experimentalUnitControl,{label:(0,tt.__)("Height"),labelPosition:"top",value:a||"",min:0,onChange:e=>m("height",e),units:c})),(0,Ke.createElement)(et.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>!!n,label:(0,tt.__)("Width"),onDeselect:()=>l({width:void 0}),resetAllFilter:()=>({width:void 0}),isShownByDefault:!0,panelId:e},(0,Ke.createElement)(et.__experimentalUnitControl,{label:(0,tt.__)("Width"),labelPosition:"top",value:n||"",min:0,onChange:e=>m("width",e),units:c})),p&&(0,Ke.createElement)(et.__experimentalToolsPanelItem,{hasValue:()=>!!o&&o!==Dy,label:u,onDeselect:()=>l({scale:Dy}),resetAllFilter:()=>({scale:Dy}),isShownByDefault:!0,panelId:e},(0,Ke.createElement)(et.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:u,value:o,help:Fy[o],onChange:e=>l({scale:e}),isBlock:!0},Ly)),!!i.length&&(0,Ke.createElement)(et.__experimentalToolsPanelItem,{hasValue:()=>!!r,label:(0,tt.__)("Resolution"),onDeselect:()=>l({sizeSlug:void 0}),resetAllFilter:()=>({sizeSlug:void 0}),isShownByDefault:!1,panelId:e},(0,Ke.createElement)(et.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Resolution"),value:r||"full",options:i,onChange:e=>l({sizeSlug:e}),help:(0,tt.__)("Select the size of the source image.")})))};const $y=(0,jt.compose)([(0,nt.withColors)({overlayColor:"background-color"})])((({clientId:e,attributes:t,setAttributes:n,overlayColor:a,setOverlayColor:o})=>{const{dimRatio:r}=t,{gradientClass:l,gradientValue:i,setGradient:s}=(0,nt.__experimentalUseGradient)(),c=(0,nt.__experimentalUseMultipleOriginColorsAndGradients)(),m=(0,nt.__experimentalUseBorderProps)(t),u={backgroundColor:a.color,backgroundImage:i,...m.style};return c.hasColorsOrGradients?(0,Ke.createElement)(Ke.Fragment,null,!!r&&(0,Ke.createElement)("span",{"aria-hidden":"true",className:ut()("wp-block-post-featured-image__overlay",(p=r,void 0===p?null:"has-background-dim-"+10*Math.round(p/10)),{[a.class]:a.class,"has-background-dim":void 0!==r,"has-background-gradient":i,[l]:l},m.className),style:u}),(0,Ke.createElement)(nt.InspectorControls,{group:"color"},(0,Ke.createElement)(nt.__experimentalColorGradientSettingsDropdown,{__experimentalIsRenderedInSidebar:!0,settings:[{colorValue:a.color,gradientValue:i,label:(0,tt.__)("Overlay"),onColorChange:o,onGradientChange:s,isShownByDefault:!0,resetAllFilter:()=>({overlayColor:void 0,customOverlayColor:void 0,gradient:void 0,customGradient:void 0})}],panelId:e,...c}),(0,Ke.createElement)(et.__experimentalToolsPanelItem,{hasValue:()=>void 0!==r,label:(0,tt.__)("Overlay opacity"),onDeselect:()=>n({dimRatio:0}),resetAllFilter:()=>({dimRatio:0}),isShownByDefault:!0,panelId:e},(0,Ke.createElement)(et.RangeControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Overlay opacity"),value:r,onChange:e=>n({dimRatio:e}),min:0,max:100,step:10,required:!0,__next40pxDefaultSize:!0})))):null;var p})),Oy=["image"];const Gy={onClick:e=>e.preventDefault(),"aria-disabled":!0};const Uy={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-featured-image",title:"Featured Image",category:"theme",description:"Display a post's featured image.",textdomain:"default",attributes:{isLink:{type:"boolean",default:!1},aspectRatio:{type:"string"},width:{type:"string"},height:{type:"string"},scale:{type:"string",default:"cover"},sizeSlug:{type:"string"},rel:{type:"string",attribute:"rel",default:""},linkTarget:{type:"string",default:"_self"},overlayColor:{type:"string"},customOverlayColor:{type:"string"},dimRatio:{type:"number",default:0},gradient:{type:"string"},customGradient:{type:"string"},useFirstImageFromPost:{type:"boolean",default:!1}},usesContext:["postId","postType","queryId"],supports:{align:["left","right","center","wide","full"],color:{__experimentalDuotone:"img, .wp-block-post-featured-image__placeholder, .components-placeholder__illustration, .components-placeholder::before",text:!1,background:!1},__experimentalBorder:{color:!0,radius:!0,width:!0,__experimentalSelector:"img, .block-editor-media-placeholder, .wp-block-post-featured-image__overlay",__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!0,radius:!0,width:!0}},html:!1,spacing:{margin:!0,padding:!0},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-post-featured-image-editor",style:"wp-block-post-featured-image"},{name:qy}=Uy,jy={icon:Hy,edit:function({clientId:e,attributes:t,setAttributes:n,context:{postId:a,postType:o,queryId:r}}){const l=Number.isFinite(r),{isLink:i,aspectRatio:s,height:c,width:m,scale:u,sizeSlug:p,rel:d,linkTarget:g,useFirstImageFromPost:h}=t,[b,_]=(0,dt.useEntityProp)("postType",o,"featured_media",a),[y]=(0,dt.useEntityProp)("postType",o,"content",a),v=(0,_t.useMemo)((()=>{if(b)return b;if(!h)return;const e=/).)*)?}\s+)?-->/.exec(y);return e?.groups?.attrs&&JSON.parse(e.groups.attrs)?.id}),[b,h,y]),{media:f,postType:k,postPermalink:x}=(0,gt.useSelect)((e=>{const{getMedia:t,getPostType:n,getEditedEntityRecord:r}=e(dt.store);return{media:v&&t(v,{context:"view"}),postType:o&&n(o),postPermalink:r("postType",o,a)?.link}}),[v,o,a]),w=function(e,t){return e?.media_details?.sizes?.[t]?.source_url||e?.source_url}(f,p),E=(0,gt.useSelect)((e=>e(nt.store).getSettings().imageSizes),[]).filter((({slug:e})=>f?.media_details?.sizes?.[e]?.source_url)).map((({name:e,slug:t})=>({value:t,label:e}))),C=(0,nt.useBlockProps)({style:{width:m,height:c,aspectRatio:s}}),S=(0,nt.__experimentalUseBorderProps)(t),B=(0,nt.useBlockEditingMode)(),N=e=>(0,Ke.createElement)(et.Placeholder,{className:ut()("block-editor-media-placeholder",S.className),withIllustration:!0,style:{height:!!s&&"100%",width:!!s&&"100%",...S.style}},e),T=e=>{e?.id&&_(e.id)},{createErrorNotice:I}=(0,gt.useDispatch)(Pt.store),P=e=>{I(e,{type:"snackbar"})},M="default"===B&&(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)($y,{attributes:t,setAttributes:n,clientId:e}),(0,Ke.createElement)(Vy,{clientId:e,attributes:t,setAttributes:n,imageSizeOptions:E}),(0,Ke.createElement)(nt.InspectorControls,null,(0,Ke.createElement)(et.PanelBody,{title:(0,tt.__)("Settings")},(0,Ke.createElement)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:k?.labels.singular_name?(0,tt.sprintf)((0,tt.__)("Link to %s"),k.labels.singular_name):(0,tt.__)("Link to post"),onChange:()=>n({isLink:!i}),checked:i}),i&&(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Open in new tab"),onChange:e=>n({linkTarget:e?"_blank":"_self"}),checked:"_blank"===g}),(0,Ke.createElement)(et.TextControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Link rel"),value:d,onChange:e=>n({rel:e})})))));let z;if(!v&&(l||!a))return(0,Ke.createElement)(Ke.Fragment,null,M,(0,Ke.createElement)("div",{...C},i?(0,Ke.createElement)("a",{href:x,target:g,...Gy},N()):N()));const R=(0,tt.__)("Add a featured image"),A={...S.style,height:s?"100%":c,width:!!s&&"100%",objectFit:!(!c&&!s)&&u};return z=v?f?(0,Ke.createElement)("img",{className:S.className,src:w,alt:f.alt_text?(0,tt.sprintf)((0,tt.__)("Featured image: %s"),f.alt_text):(0,tt.__)("Featured image"),style:A}):N():(0,Ke.createElement)(nt.MediaPlaceholder,{onSelect:T,accept:"image/*",allowedTypes:Oy,onError:P,placeholder:N,mediaLibraryButton:({open:e})=>(0,Ke.createElement)(et.Button,{icon:np,variant:"primary",label:R,showTooltip:!0,tooltipPosition:"top center",onClick:()=>{e()}})}),(0,Ke.createElement)(Ke.Fragment,null,M,!!f&&!l&&(0,Ke.createElement)(nt.BlockControls,{group:"other"},(0,Ke.createElement)(nt.MediaReplaceFlow,{mediaId:v,mediaURL:w,allowedTypes:Oy,accept:"image/*",onSelect:T,onError:P},(0,Ke.createElement)(et.MenuItem,{onClick:()=>_(0)},(0,tt.__)("Reset")))),(0,Ke.createElement)("figure",{...C},i?(0,Ke.createElement)("a",{href:x,target:g,...Gy},z):z))}},Wy=()=>Xe({name:qy,metadata:Uy,settings:jy});const Zy=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{d:"M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z"})),Qy=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{d:"M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z"})),Ky=[{isDefault:!0,name:"post-next",title:(0,tt.__)("Next post"),description:(0,tt.__)("Displays the post link that follows the current post."),icon:Zy,attributes:{type:"next"},scope:["inserter","transform"]},{name:"post-previous",title:(0,tt.__)("Previous post"),description:(0,tt.__)("Displays the post link that precedes the current post."),icon:Qy,attributes:{type:"previous"},scope:["inserter","transform"]}];Ky.forEach((e=>{e.isActive||(e.isActive=(e,t)=>e.type===t.type)}));const Yy=Ky,Jy={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-navigation-link",title:"Post Navigation Link",category:"theme",description:"Displays the next or previous post link that is adjacent to the current post.",textdomain:"default",attributes:{textAlign:{type:"string"},type:{type:"string",default:"next"},label:{type:"string"},showTitle:{type:"boolean",default:!1},linkLabel:{type:"boolean",default:!1},arrow:{type:"string",default:"none"},taxonomy:{type:"string",default:""}},usesContext:["postType"],supports:{reusable:!1,html:!1,color:{link:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalWritingMode:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},style:"wp-block-post-navigation-link"},{name:Xy}=Jy,ev={edit:function({context:{postType:e},attributes:{type:t,label:n,showTitle:a,textAlign:o,linkLabel:r,arrow:l,taxonomy:i},setAttributes:s}){const c="next"===t;let m=c?(0,tt.__)("Next"):(0,tt.__)("Previous");const u={none:"",arrow:c?"→":"←",chevron:c?"»":"«"}[l];a&&(m=c?(0,tt.__)("Next: "):(0,tt.__)("Previous: "));const p=c?(0,tt.__)("Next post"):(0,tt.__)("Previous post"),d=(0,nt.useBlockProps)({className:ut()({[`has-text-align-${o}`]:o})}),g=(0,gt.useSelect)((t=>{const{getTaxonomies:n}=t(dt.store);return n({type:e,per_page:-1})}),[e]);return(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(nt.InspectorControls,null,(0,Ke.createElement)(et.PanelBody,null,(0,Ke.createElement)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Display the title as a link"),help:(0,tt.__)("If you have entered a custom label, it will be prepended before the title."),checked:!!a,onChange:()=>s({showTitle:!a})}),a&&(0,Ke.createElement)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Include the label as part of the link"),checked:!!r,onChange:()=>s({linkLabel:!r})}),(0,Ke.createElement)(et.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Arrow"),value:l,onChange:e=>{s({arrow:e})},help:(0,tt.__)("A decorative arrow for the next and previous link."),isBlock:!0},(0,Ke.createElement)(et.__experimentalToggleGroupControlOption,{value:"none",label:(0,tt._x)("None","Arrow option for Next/Previous link")}),(0,Ke.createElement)(et.__experimentalToggleGroupControlOption,{value:"arrow",label:(0,tt._x)("Arrow","Arrow option for Next/Previous link")}),(0,Ke.createElement)(et.__experimentalToggleGroupControlOption,{value:"chevron",label:(0,tt._x)("Chevron","Arrow option for Next/Previous link")})))),(0,Ke.createElement)(nt.InspectorControls,{group:"advanced"},(0,Ke.createElement)(et.SelectControl,{label:(0,tt.__)("Filter by taxonomy"),value:i,options:[{label:(0,tt.__)("Unfiltered"),value:""},...(null!=g?g:[]).filter((({visibility:e})=>!!e?.publicly_queryable)).map((e=>({value:e.slug,label:e.name})))],onChange:e=>s({taxonomy:e}),help:(0,tt.__)("Only link to posts that have the same taxonomy terms as the current post. For example the same tags or categories.")})),(0,Ke.createElement)(nt.BlockControls,null,(0,Ke.createElement)(nt.AlignmentToolbar,{value:o,onChange:e=>{s({textAlign:e})}})),(0,Ke.createElement)("div",{...d},!c&&u&&(0,Ke.createElement)("span",{className:`wp-block-post-navigation-link__arrow-previous is-arrow-${l}`},u),(0,Ke.createElement)(nt.RichText,{tagName:"a","aria-label":p,placeholder:m,value:n,allowedFormats:["core/bold","core/italic"],onChange:e=>s({label:e})}),a&&(0,Ke.createElement)("a",{href:"#post-navigation-pseudo-link",onClick:e=>e.preventDefault()},(0,tt.__)("An example title")),c&&u&&(0,Ke.createElement)("span",{className:`wp-block-post-navigation-link__arrow-next is-arrow-${l}`,"aria-hidden":!0},u)))},variations:Yy},tv=()=>Xe({name:Xy,metadata:Jy,settings:ev}),nv=[["core/post-title"],["core/post-date"],["core/post-excerpt"]];function av(){const e=(0,nt.useInnerBlocksProps)({className:"wp-block-post"},{template:nv,__unstableDisableLayoutClassNames:!0});return(0,Ke.createElement)("li",{...e})}const ov=(0,_t.memo)((function({blocks:e,blockContextId:t,isHidden:n,setActiveBlockContextId:a}){const o=(0,nt.__experimentalUseBlockPreview)({blocks:e,props:{className:"wp-block-post"}}),r=()=>{a(t)},l={display:n?"none":void 0};return(0,Ke.createElement)("li",{...o,tabIndex:0,role:"button",onClick:r,onKeyPress:r,style:l})}));const rv={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-template",title:"Post Template",category:"theme",parent:["core/query"],description:"Contains the block elements used to render a post, like the title, date, featured image, content or excerpt, and more.",textdomain:"default",usesContext:["queryId","query","displayLayout","templateSlug","previewPostType","enhancedPagination"],supports:{reusable:!1,html:!1,align:["wide","full"],layout:!0,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},spacing:{blockGap:{__experimentalDefault:"1.25em"},__experimentalDefaultControls:{blockGap:!0}},interactivity:{clientNavigation:!0}},style:"wp-block-post-template",editorStyle:"wp-block-post-template-editor"},{name:lv}=rv,iv={icon:Uo,edit:function({setAttributes:e,clientId:t,context:{query:{perPage:n,offset:a=0,postType:o,order:r,orderBy:l,author:i,search:s,exclude:c,sticky:m,inherit:u,taxQuery:p,parents:d,pages:g,...h}={},templateSlug:b,previewPostType:_},attributes:{layout:y},__unstableLayoutClassNames:v}){const{type:f,columnCount:k=3}=y||{},[x,w]=(0,_t.useState)(),{posts:E,blocks:C}=(0,gt.useSelect)((e=>{const{getEntityRecords:g,getTaxonomies:y}=e(dt.store),{getBlocks:v}=e(nt.store),f=u&&b?.startsWith("category-")&&g("taxonomy","category",{context:"view",per_page:1,_fields:["id"],slug:b.replace("category-","")}),k={offset:a||0,order:r,orderby:l};if(p&&!u){const e=y({type:o,per_page:-1,context:"view"}),t=Object.entries(p).reduce(((t,[n,a])=>{const o=e?.find((({slug:e})=>e===n));return o?.rest_base&&(t[o?.rest_base]=a),t}),{});Object.keys(t).length&&Object.assign(k,t)}n&&(k.per_page=n),i&&(k.author=i),s&&(k.search=s),c?.length&&(k.exclude=c),d?.length&&(k.parent=d),m&&(k.sticky="only"===m),u&&(b?.startsWith("archive-")?(k.postType=b.replace("archive-",""),o=k.postType):f&&(k.categories=f[0]?.id));return{posts:g("postType",_||o,{...k,...h}),blocks:v(t)}}),[n,a,r,l,t,i,s,o,c,m,u,b,p,d,h,_]),S=(0,_t.useMemo)((()=>E?.map((e=>({postType:e.type,postId:e.id})))),[E]),B=(0,nt.useBlockProps)({className:ut()(v,{[`columns-${k}`]:"grid"===f&&k})});if(!E)return(0,Ke.createElement)("p",{...B},(0,Ke.createElement)(et.Spinner,null));if(!E.length)return(0,Ke.createElement)("p",{...B}," ",(0,tt.__)("No results found."));const N=t=>e({layout:{...y,...t}}),T=[{icon:Tp,title:(0,tt.__)("List view"),onClick:()=>N({type:"default"}),isActive:"default"===f||"constrained"===f},{icon:Xm,title:(0,tt.__)("Grid view"),onClick:()=>N({type:"grid",columnCount:k}),isActive:"grid"===f}];return(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(nt.BlockControls,null,(0,Ke.createElement)(et.ToolbarGroup,{controls:T})),(0,Ke.createElement)("ul",{...B},S&&S.map((e=>(0,Ke.createElement)(nt.BlockContextProvider,{key:e.postId,value:e},e.postId===(x||S[0]?.postId)?(0,Ke.createElement)(av,null):null,(0,Ke.createElement)(ov,{blocks:C,blockContextId:e.postId,setActiveBlockContextId:w,isHidden:e.postId===(x||S[0]?.postId)}))))))},save:function(){return(0,Ke.createElement)(nt.InnerBlocks.Content,null)}},sv=()=>Xe({name:lv,metadata:rv,settings:iv}),cv=(0,Ke.createElement)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,Ke.createElement)(Ye.Path,{d:"M20 4H4v1.5h16V4zm-2 9h-3c-1.1 0-2 .9-2 2v3c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2zm.5 5c0 .3-.2.5-.5.5h-3c-.3 0-.5-.2-.5-.5v-3c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3zM4 9.5h9V8H4v1.5zM9 13H6c-1.1 0-2 .9-2 2v3c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2zm.5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-3c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3z",fillRule:"evenodd",clipRule:"evenodd"})),mv=[];const uv=["core/bold","core/image","core/italic","core/link","core/strikethrough","core/text-color"];const pv=(0,Ke.createElement)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,Ke.createElement)(Ye.Path,{d:"M8.1 12.3c.1.1.3.3.5.3.2.1.4.1.6.1.2 0 .4 0 .6-.1.2-.1.4-.2.5-.3l3-3c.3-.3.5-.7.5-1.1 0-.4-.2-.8-.5-1.1L9.7 3.5c-.1-.2-.3-.3-.5-.3H5c-.4 0-.8.4-.8.8v4.2c0 .2.1.4.2.5l3.7 3.6zM5.8 4.8h3.1l3.4 3.4v.1l-3 3 .5.5-.7-.5-3.3-3.4V4.8zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"})),dv={category:cv,post_tag:pv};function gv(e,t){if("core/post-terms"!==t)return e;const n=e.variations.map((e=>{var t;return{...e,icon:null!==(t=dv[e.name])&&void 0!==t?t:cv}}));return{...e,variations:n}}const hv={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-terms",title:"Post Terms",category:"theme",description:"Post terms.",textdomain:"default",attributes:{term:{type:"string"},textAlign:{type:"string"},separator:{type:"string",default:", "},prefix:{type:"string",default:""},suffix:{type:"string",default:""}},usesContext:["postId","postType"],supports:{html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},style:"wp-block-post-terms"},{name:bv}=hv,_v={icon:cv,edit:function({attributes:e,clientId:t,context:n,isSelected:a,setAttributes:o,insertBlocksAfter:r}){const{term:l,textAlign:i,separator:s,prefix:c,suffix:m}=e,{postId:u,postType:p}=n,d=(0,gt.useSelect)((e=>{if(!l)return{};const{getTaxonomy:t}=e(dt.store),n=t(l);return n?.visibility?.publicly_queryable?n:{}}),[l]),{postTerms:g,hasPostTerms:h,isLoading:b}=function({postId:e,term:t}){const{slug:n}=t;return(0,gt.useSelect)((a=>{const o=t?.visibility?.publicly_queryable;if(!o)return{postTerms:mv,isLoading:!1,hasPostTerms:!1};const{getEntityRecords:r,isResolving:l}=a(dt.store),i=["taxonomy",n,{post:e,per_page:-1,context:"view"}],s=r(...i);return{postTerms:s,isLoading:l("getEntityRecords",i),hasPostTerms:!!s?.length}}),[e,t?.visibility?.publicly_queryable,n])}({postId:u,term:d}),_=u&&p,y=(0,nt.useBlockDisplayInformation)(t),v=(0,nt.useBlockProps)({className:ut()({[`has-text-align-${i}`]:i,[`taxonomy-${l}`]:l})});return(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(nt.BlockControls,null,(0,Ke.createElement)(nt.AlignmentToolbar,{value:i,onChange:e=>{o({textAlign:e})}})),(0,Ke.createElement)(nt.InspectorControls,{group:"advanced"},(0,Ke.createElement)(et.TextControl,{__nextHasNoMarginBottom:!0,autoComplete:"off",label:(0,tt.__)("Separator"),value:s||"",onChange:e=>{o({separator:e})},help:(0,tt.__)("Enter character(s) used to separate terms.")})),(0,Ke.createElement)("div",{...v},b&&_&&(0,Ke.createElement)(et.Spinner,null),!b&&(a||c)&&(0,Ke.createElement)(nt.RichText,{allowedFormats:uv,className:"wp-block-post-terms__prefix","aria-label":(0,tt.__)("Prefix"),placeholder:(0,tt.__)("Prefix")+" ",value:c,onChange:e=>o({prefix:e}),tagName:"span"}),(!_||!l)&&(0,Ke.createElement)("span",null,y.title),_&&!b&&h&&g.map((e=>(0,Ke.createElement)("a",{key:e.id,href:e.link,onClick:e=>e.preventDefault()},(0,Jn.decodeEntities)(e.name)))).reduce(((e,t)=>(0,Ke.createElement)(Ke.Fragment,null,e,(0,Ke.createElement)("span",{className:"wp-block-post-terms__separator"},s||" "),t))),_&&!b&&!h&&(d?.labels?.no_terms||(0,tt.__)("Term items not found.")),!b&&(a||m)&&(0,Ke.createElement)(nt.RichText,{allowedFormats:uv,className:"wp-block-post-terms__suffix","aria-label":(0,tt.__)("Suffix"),placeholder:" "+(0,tt.__)("Suffix"),value:m,onChange:e=>o({suffix:e}),tagName:"span",__unstableOnSplitAtEnd:()=>r((0,Qe.createBlock)((0,Qe.getDefaultBlockName)()))})))}},yv=()=>((0,_i.addFilter)("blocks.registerBlockType","core/template-part",gv),Xe({name:bv,metadata:hv,settings:_v})),vv=window.wp.wordcount;const fv=function({attributes:e,setAttributes:t,context:n}){const{textAlign:a}=e,{postId:o,postType:r}=n,[l]=(0,dt.useEntityProp)("postType",r,"content",o),[i]=(0,dt.useEntityBlockEditor)("postType",r,{id:o}),s=(0,_t.useMemo)((()=>{let e;e=l instanceof Function?l({blocks:i}):i?(0,Qe.__unstableSerializeAndClean)(i):l;const t=(0,tt._x)("words","Word count type. Do not translate!"),n=Math.max(1,Math.round((0,vv.count)(e,t)/189));return(0,tt.sprintf)((0,tt._n)("%d minute","%d minutes",n),n)}),[l,i]),c=(0,nt.useBlockProps)({className:ut()({[`has-text-align-${a}`]:a})});return(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(nt.BlockControls,{group:"block"},(0,Ke.createElement)(nt.AlignmentControl,{value:a,onChange:e=>{t({textAlign:e})}})),(0,Ke.createElement)("div",{...c},s))},kv=(0,Ke.createElement)(et.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,Ke.createElement)(et.Path,{d:"M12 3c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 16.5c-4.1 0-7.5-3.4-7.5-7.5S7.9 4.5 12 4.5s7.5 3.4 7.5 7.5-3.4 7.5-7.5 7.5zM12 7l-1 5c0 .3.2.6.4.8l4.2 2.8-2.7-4.1L12 7z"})),xv={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,__experimental:!0,name:"core/post-time-to-read",title:"Time To Read",category:"theme",description:"Show minutes required to finish reading the post.",textdomain:"default",usesContext:["postId","postType"],attributes:{textAlign:{type:"string"}},supports:{color:{gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},html:!1,spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}}},{name:wv}=xv,Ev={icon:kv,edit:fv},Cv=()=>Xe({name:wv,metadata:xv,settings:Ev});const Sv={attributes:{textAlign:{type:"string"},level:{type:"number",default:2},isLink:{type:"boolean",default:!1},rel:{type:"string",attribute:"rel",default:""},linkTarget:{type:"string",default:"_self"}},supports:{align:["wide","full"],html:!1,color:{gradients:!0,link:!0},spacing:{margin:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0}},save:()=>null,migrate:ln,isEligible:({style:e})=>e?.typography?.fontFamily},Bv=[Sv],Nv={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-title",title:"Title",category:"theme",description:"Displays the title of a post, page, or any other content-type.",textdomain:"default",usesContext:["postId","postType","queryId"],attributes:{textAlign:{type:"string"},level:{type:"number",default:2},isLink:{type:"boolean",default:!1},rel:{type:"string",attribute:"rel",default:""},linkTarget:{type:"string",default:"_self"}},supports:{align:["wide","full"],html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},style:"wp-block-post-title"},{name:Tv}=Nv,Iv={icon:Br,edit:function({attributes:{level:e,textAlign:t,isLink:n,rel:a,linkTarget:o},setAttributes:r,context:{postType:l,postId:i,queryId:s},insertBlocksAfter:c}){const m="h"+e,u=uy("postType",!Number.isFinite(s)&&l,i),[p="",d,g]=(0,dt.useEntityProp)("postType",l,"title",i),[h]=(0,dt.useEntityProp)("postType",l,"link",i),b=()=>{c((0,Qe.createBlock)((0,Qe.getDefaultBlockName)()))},_=(0,nt.useBlockProps)({className:ut()({[`has-text-align-${t}`]:t})}),y=(0,nt.useBlockEditingMode)();let v=(0,Ke.createElement)(m,{..._},(0,tt.__)("Title"));return l&&i&&(v=u?(0,Ke.createElement)(nt.PlainText,{tagName:m,placeholder:(0,tt.__)("No Title"),value:p,onChange:d,__experimentalVersion:2,__unstableOnSplitAtEnd:b,..._}):(0,Ke.createElement)(m,{..._,dangerouslySetInnerHTML:{__html:g?.rendered}})),n&&l&&i&&(v=u?(0,Ke.createElement)(m,{..._},(0,Ke.createElement)(nt.PlainText,{tagName:"a",href:h,target:o,rel:a,placeholder:p.length?null:(0,tt.__)("No Title"),value:p,onChange:d,__experimentalVersion:2,__unstableOnSplitAtEnd:b})):(0,Ke.createElement)(m,{..._},(0,Ke.createElement)("a",{href:h,target:o,rel:a,onClick:e=>e.preventDefault(),dangerouslySetInnerHTML:{__html:g?.rendered}}))),(0,Ke.createElement)(Ke.Fragment,null,"default"===y&&(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(nt.BlockControls,{group:"block"},(0,Ke.createElement)(nt.HeadingLevelDropdown,{value:e,onChange:e=>r({level:e})}),(0,Ke.createElement)(nt.AlignmentControl,{value:t,onChange:e=>{r({textAlign:e})}})),(0,Ke.createElement)(nt.InspectorControls,null,(0,Ke.createElement)(et.PanelBody,{title:(0,tt.__)("Settings")},(0,Ke.createElement)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Make title a link"),onChange:()=>r({isLink:!n}),checked:n}),n&&(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Open in new tab"),onChange:e=>r({linkTarget:e?"_blank":"_self"}),checked:"_blank"===o}),(0,Ke.createElement)(et.TextControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Link rel"),value:a,onChange:e=>r({rel:e})}))))),v)},deprecated:Bv},Pv=()=>Xe({name:Tv,metadata:Nv,settings:Iv}),Mv=(0,Ke.createElement)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,Ke.createElement)(Ye.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12zM7 16.5h6V15H7v1.5zm4-4h6V11h-6v1.5zM9 11H7v1.5h2V11zm6 5.5h2V15h-2v1.5z"}));const zv={from:[{type:"block",blocks:["core/code","core/paragraph"],transform:({content:e,anchor:t})=>(0,Qe.createBlock)("core/preformatted",{content:e,anchor:t})},{type:"raw",isMatch:e=>"PRE"===e.nodeName&&!(1===e.children.length&&"CODE"===e.firstChild.nodeName),schema:({phrasingContentSchema:e})=>({pre:{children:e}})}],to:[{type:"block",blocks:["core/paragraph"],transform:e=>(0,Qe.createBlock)("core/paragraph",e)},{type:"block",blocks:["core/code"],transform:e=>(0,Qe.createBlock)("core/code",e)}]},Rv=zv,Av={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/preformatted",title:"Preformatted",category:"text",description:"Add text that respects your spacing and tabs, and also allows styling.",textdomain:"default",attributes:{content:{type:"rich-text",source:"rich-text",selector:"pre",__unstablePreserveWhiteSpace:!0,__experimentalRole:"content"}},supports:{anchor:!0,color:{gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{padding:!0,margin:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},style:"wp-block-preformatted"},{name:Hv}=Av,Lv={icon:Mv,example:{attributes:{content:(0,tt.__)("EXT. XANADU - FAINT DAWN - 1940 (MINIATURE)\nWindow, very small in the distance, illuminated.\nAll around this is an almost totally black screen. Now, as the camera moves slowly towards the window which is almost a postage stamp in the frame, other forms appear;")}},transforms:Rv,edit:function({attributes:e,mergeBlocks:t,setAttributes:n,onRemove:a,insertBlocksAfter:o,style:r}){const{content:l}=e,i=(0,nt.useBlockProps)({style:r});return(0,Ke.createElement)(nt.RichText,{tagName:"pre",identifier:"content",preserveWhiteSpace:!0,value:l,onChange:e=>{n({content:e})},onRemove:a,"aria-label":(0,tt.__)("Preformatted text"),placeholder:(0,tt.__)("Write preformatted text…"),onMerge:t,...i,__unstablePastePlainText:!0,__unstableOnSplitAtDoubleLineEnd:()=>o((0,Qe.createBlock)((0,Qe.getDefaultBlockName)()))})},save:function({attributes:e}){const{content:t}=e;return(0,Ke.createElement)("pre",{...nt.useBlockProps.save()},(0,Ke.createElement)(nt.RichText.Content,{value:t}))},merge:(e,t)=>({content:e.content+"\n\n"+t.content})},Dv=()=>Xe({name:Hv,metadata:Av,settings:Lv}),Fv=(0,Ke.createElement)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,Ke.createElement)(Ye.Path,{d:"M18 8H6c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-4c0-1.1-.9-2-2-2zm.5 6c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-4c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v4zM4 4v1.5h16V4H4zm0 16h16v-1.5H4V20z"})),Vv="is-style-solid-color",$v={value:{type:"string",source:"html",selector:"blockquote",multiline:"p"},citation:{type:"string",source:"html",selector:"cite",default:""},mainColor:{type:"string"},customMainColor:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string"}};function Ov(e){if(!e)return;const t=e.match(/border-color:([^;]+)[;]?/);return t&&t[1]?t[1]:void 0}function Gv(e){const t=`${e=e||""}`.split("
");return t.shift(),t.pop(),t.join("
")}const Uv={attributes:{value:{type:"string",source:"html",selector:"blockquote",multiline:"p",__experimentalRole:"content"},citation:{type:"string",source:"html",selector:"cite",default:"",__experimentalRole:"content"},textAlign:{type:"string"}},save({attributes:e}){const{textAlign:t,citation:n,value:a}=e,o=!nt.RichText.isEmpty(n);return(0,Ke.createElement)("figure",{...nt.useBlockProps.save({className:ut()({[`has-text-align-${t}`]:t})})},(0,Ke.createElement)("blockquote",null,(0,Ke.createElement)(nt.RichText.Content,{value:a,multiline:!0}),o&&(0,Ke.createElement)(nt.RichText.Content,{tagName:"cite",value:n})))},migrate:({value:e,...t})=>({value:Gv(e),...t})},qv={attributes:{...$v},save({attributes:e}){const{mainColor:t,customMainColor:n,customTextColor:a,textColor:o,value:r,citation:l,className:i}=e,s=i?.includes(Vv);let c,m;if(s){const e=(0,nt.getColorClassName)("background-color",t);c=ut()({"has-background":e||n,[e]:e}),m={backgroundColor:e?void 0:n}}else n&&(m={borderColor:n});const u=(0,nt.getColorClassName)("color",o),p=ut()({"has-text-color":o||a,[u]:u}),d=u?void 0:{color:a};return(0,Ke.createElement)("figure",{...nt.useBlockProps.save({className:c,style:m})},(0,Ke.createElement)("blockquote",{className:p,style:d},(0,Ke.createElement)(nt.RichText.Content,{value:r,multiline:!0}),!nt.RichText.isEmpty(l)&&(0,Ke.createElement)(nt.RichText.Content,{tagName:"cite",value:l})))},migrate({value:e,className:t,mainColor:n,customMainColor:a,customTextColor:o,...r}){const l=t?.includes(Vv);let i;return a&&(i=l?{color:{background:a}}:{border:{color:a}}),o&&i&&(i.color={...i.color,text:o}),{value:Gv(e),className:t,backgroundColor:l?n:void 0,borderColor:l?void 0:n,textAlign:l?"left":void 0,style:i,...r}}},jv={attributes:{...$v,figureStyle:{source:"attribute",selector:"figure",attribute:"style"}},save({attributes:e}){const{mainColor:t,customMainColor:n,textColor:a,customTextColor:o,value:r,citation:l,className:i,figureStyle:s}=e,c=i?.includes(Vv);let m,u;if(c){const e=(0,nt.getColorClassName)("background-color",t);m=ut()({"has-background":e||n,[e]:e}),u={backgroundColor:e?void 0:n}}else if(n)u={borderColor:n};else if(t){u={borderColor:Ov(s)}}const p=(0,nt.getColorClassName)("color",a),d=(a||o)&&ut()("has-text-color",{[p]:p}),g=p?void 0:{color:o};return(0,Ke.createElement)("figure",{className:m,style:u},(0,Ke.createElement)("blockquote",{className:d,style:g},(0,Ke.createElement)(nt.RichText.Content,{value:r,multiline:!0}),!nt.RichText.isEmpty(l)&&(0,Ke.createElement)(nt.RichText.Content,{tagName:"cite",value:l})))},migrate({value:e,className:t,figureStyle:n,mainColor:a,customMainColor:o,customTextColor:r,...l}){const i=t?.includes(Vv);let s;if(o&&(s=i?{color:{background:o}}:{border:{color:o}}),r&&s&&(s.color={...s.color,text:r}),!i&&a&&n){const a=Ov(n);if(a)return{value:Gv(e),...l,className:t,style:{border:{color:a}}}}return{value:Gv(e),className:t,backgroundColor:i?a:void 0,borderColor:i?void 0:a,textAlign:i?"left":void 0,style:s,...l}}},Wv={attributes:$v,save({attributes:e}){const{mainColor:t,customMainColor:n,textColor:a,customTextColor:o,value:r,citation:l,className:i}=e,s=i?.includes(Vv);let c,m;if(s)c=(0,nt.getColorClassName)("background-color",t),c||(m={backgroundColor:n});else if(n)m={borderColor:n};else if(t){var u;const e=null!==(u=(0,gt.select)(nt.store).getSettings().colors)&&void 0!==u?u:[];m={borderColor:(0,nt.getColorObjectByAttributeValues)(e,t).color}}const p=(0,nt.getColorClassName)("color",a),d=a||o?ut()("has-text-color",{[p]:p}):void 0,g=p?void 0:{color:o};return(0,Ke.createElement)("figure",{className:c,style:m},(0,Ke.createElement)("blockquote",{className:d,style:g},(0,Ke.createElement)(nt.RichText.Content,{value:r,multiline:!0}),!nt.RichText.isEmpty(l)&&(0,Ke.createElement)(nt.RichText.Content,{tagName:"cite",value:l})))},migrate({value:e,className:t,mainColor:n,customMainColor:a,customTextColor:o,...r}){const l=t?.includes(Vv);let i={};return a&&(i=l?{color:{background:a}}:{border:{color:a}}),o&&i&&(i.color={...i.color,text:o}),{value:Gv(e),className:t,backgroundColor:l?n:void 0,borderColor:l?void 0:n,textAlign:l?"left":void 0,style:i,...r}}},Zv={attributes:{...$v},save({attributes:e}){const{value:t,citation:n}=e;return(0,Ke.createElement)("blockquote",null,(0,Ke.createElement)(nt.RichText.Content,{value:t,multiline:!0}),!nt.RichText.isEmpty(n)&&(0,Ke.createElement)(nt.RichText.Content,{tagName:"cite",value:n}))},migrate:({value:e,...t})=>({value:Gv(e),...t})},Qv={attributes:{...$v,citation:{type:"string",source:"html",selector:"footer"},align:{type:"string",default:"none"}},save({attributes:e}){const{value:t,citation:n,align:a}=e;return(0,Ke.createElement)("blockquote",{className:`align${a}`},(0,Ke.createElement)(nt.RichText.Content,{value:t,multiline:!0}),!nt.RichText.isEmpty(n)&&(0,Ke.createElement)(nt.RichText.Content,{tagName:"footer",value:n}))},migrate:({value:e,...t})=>({value:Gv(e),...t})},Kv=[Uv,qv,jv,Wv,Zv,Qv],Yv="web"===_t.Platform.OS;const Jv=function({attributes:e,setAttributes:t,isSelected:n,insertBlocksAfter:a}){const{textAlign:o,citation:r,value:l}=e,i=(0,nt.useBlockProps)({className:ut()({[`has-text-align-${o}`]:o})}),s=!nt.RichText.isEmpty(r)||n;return(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(nt.BlockControls,{group:"block"},(0,Ke.createElement)(nt.AlignmentControl,{value:o,onChange:e=>{t({textAlign:e})}})),(0,Ke.createElement)("figure",{...i},(0,Ke.createElement)("blockquote",null,(0,Ke.createElement)(nt.RichText,{identifier:"value",tagName:"p",value:l,onChange:e=>t({value:e}),"aria-label":(0,tt.__)("Pullquote text"),placeholder:(0,tt.__)("Add quote"),textAlign:"center"}),s&&(0,Ke.createElement)(nt.RichText,{identifier:"citation",tagName:Yv?"cite":void 0,style:{display:"block"},value:r,"aria-label":(0,tt.__)("Pullquote citation text"),placeholder:(0,tt.__)("Add citation"),onChange:e=>t({citation:e}),className:"wp-block-pullquote__citation",__unstableMobileNoFocusOnMount:!0,textAlign:"center",__unstableOnSplitAtEnd:()=>a((0,Qe.createBlock)((0,Qe.getDefaultBlockName)()))}))))};const Xv={from:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>(0,Qe.createBlock)("core/pullquote",{value:(0,Rn.toHTMLString)({value:(0,Rn.join)(e.map((({content:e})=>(0,Rn.create)({html:e}))),"\n")}),anchor:e.anchor})},{type:"block",blocks:["core/heading"],transform:({content:e,anchor:t})=>(0,Qe.createBlock)("core/pullquote",{value:e,anchor:t})}],to:[{type:"block",blocks:["core/paragraph"],transform:({value:e,citation:t})=>{const n=[];return e&&n.push((0,Qe.createBlock)("core/paragraph",{content:e})),t&&n.push((0,Qe.createBlock)("core/paragraph",{content:t})),0===n.length?(0,Qe.createBlock)("core/paragraph",{content:""}):n}},{type:"block",blocks:["core/heading"],transform:({value:e,citation:t})=>{if(!e)return(0,Qe.createBlock)("core/heading",{content:t});const n=(0,Qe.createBlock)("core/heading",{content:e});return t?[n,(0,Qe.createBlock)("core/heading",{content:t})]:n}}]},ef=Xv,tf={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/pullquote",title:"Pullquote",category:"text",description:"Give special visual emphasis to a quote from your text.",textdomain:"default",attributes:{value:{type:"rich-text",source:"rich-text",selector:"p",__experimentalRole:"content"},citation:{type:"rich-text",source:"rich-text",selector:"cite",__experimentalRole:"content"},textAlign:{type:"string"}},supports:{anchor:!0,align:["left","right","wide","full"],color:{gradients:!0,background:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},__experimentalStyle:{typography:{fontSize:"1.5em",lineHeight:"1.6"}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-pullquote-editor",style:"wp-block-pullquote"},{name:nf}=tf,af={icon:Fv,example:{attributes:{value:(0,tt.__)("One of the hardest things to do in technology is disrupt yourself."),citation:(0,tt.__)("Matt Mullenweg")}},transforms:ef,edit:Jv,save:function({attributes:e}){const{textAlign:t,citation:n,value:a}=e,o=!nt.RichText.isEmpty(n);return(0,Ke.createElement)("figure",{...nt.useBlockProps.save({className:ut()({[`has-text-align-${t}`]:t})})},(0,Ke.createElement)("blockquote",null,(0,Ke.createElement)(nt.RichText.Content,{tagName:"p",value:a}),o&&(0,Ke.createElement)(nt.RichText.Content,{tagName:"cite",value:n})))},deprecated:Kv},of=()=>Xe({name:nf,metadata:tf,settings:af}),rf=(0,Ke.createElement)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,Ke.createElement)(Ye.Path,{d:"M18.1823 11.6392C18.1823 13.0804 17.0139 14.2487 15.5727 14.2487C14.3579 14.2487 13.335 13.4179 13.0453 12.2922L13.0377 12.2625L13.0278 12.2335L12.3985 10.377L12.3942 10.3785C11.8571 8.64997 10.246 7.39405 8.33961 7.39405C5.99509 7.39405 4.09448 9.29465 4.09448 11.6392C4.09448 13.9837 5.99509 15.8843 8.33961 15.8843C8.88499 15.8843 9.40822 15.781 9.88943 15.5923L9.29212 14.0697C8.99812 14.185 8.67729 14.2487 8.33961 14.2487C6.89838 14.2487 5.73003 13.0804 5.73003 11.6392C5.73003 10.1979 6.89838 9.02959 8.33961 9.02959C9.55444 9.02959 10.5773 9.86046 10.867 10.9862L10.8772 10.9836L11.4695 12.7311C11.9515 14.546 13.6048 15.8843 15.5727 15.8843C17.9172 15.8843 19.8178 13.9837 19.8178 11.6392C19.8178 9.29465 17.9172 7.39404 15.5727 7.39404C15.0287 7.39404 14.5066 7.4968 14.0264 7.6847L14.6223 9.20781C14.9158 9.093 15.2358 9.02959 15.5727 9.02959C17.0139 9.02959 18.1823 10.1979 18.1823 11.6392Z"})),lf=(0,Ke.createElement)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Ke.createElement)(Ye.Path,{d:"m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z"}),(0,Ke.createElement)(Ye.Path,{d:"m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z"})),sf=e=>{const t=e?.reduce(((e,t)=>{const{mapById:n,mapByName:a,names:o}=e;return n[t.id]=t,a[t.name]=t,o.push(t.name),e}),{mapById:{},mapByName:{},names:[]});return{entities:e,...t}},cf=(e,t)=>{const n=t.split(".");let a=e;return n.forEach((e=>{a=a?.[e]})),a},mf=(e,t)=>(e||[]).map((e=>({...e,name:(0,Jn.decodeEntities)(cf(e,t))}))),uf=()=>{const e=(0,gt.useSelect)((e=>{const{getPostTypes:t}=e(dt.store),n=["attachment"],a=t({per_page:-1})?.filter((({viewable:e,slug:t})=>e&&!n.includes(t)));return a}),[]);return{postTypesTaxonomiesMap:(0,_t.useMemo)((()=>{if(e?.length)return e.reduce(((e,t)=>(e[t.slug]=t.taxonomies,e)),{})}),[e]),postTypesSelectOptions:(0,_t.useMemo)((()=>(e||[]).map((({labels:e,slug:t})=>({label:e.singular_name,value:t})))),[e])}},pf=e=>(0,gt.useSelect)((t=>{const{getTaxonomies:n}=t(dt.store);return n({type:e,per_page:-1,context:"view"})}),[e]);function df(e,t){return!e||e.includes(t)}function gf(e,t){const n=(0,gt.useSelect)((e=>e(Qe.store).getActiveBlockVariation("core/query",t)?.name),[t]),a=`core/query/${n}`;return(0,gt.useSelect)((t=>{if(!n)return!1;const{getBlockRootClientId:o,getPatternsByBlockTypes:r}=t(nt.store),l=o(e);return r(a,l).length>0}),[e,n,a])?a:"core/query"}const hf=(e,t)=>(0,gt.useSelect)((n=>{const{getBlockRootClientId:a,getPatternsByBlockTypes:o}=n(nt.store),r=a(e);return o(t,r)}),[t,e]),bf=e=>(0,gt.useSelect)((t=>{const{getClientIdsOfDescendants:n,getBlockName:a}=t(nt.store),o={};return n(e).forEach((e=>{const t=a(e),n=Object.is((0,Qe.getBlockSupport)(t,"interactivity"),!0),r=(0,Qe.getBlockSupport)(t,"interactivity.clientNavigation");n||r?"core/post-content"===t&&(o.hasPostContentBlock=!0):o.hasBlocksFromPlugins=!0})),o.hasUnsupportedBlocks=o.hasBlocksFromPlugins||o.hasPostContentBlock,o}),[e]);function _f({attributes:{query:e},setQuery:t,openPatternSelectionModal:n,name:a,clientId:o}){const r=!!hf(o,a).length,l=(0,jt.useInstanceId)(_f,"blocks-query-pagination-max-page-input");return(0,Ke.createElement)(Ke.Fragment,null,!e.inherit&&(0,Ke.createElement)(et.ToolbarGroup,null,(0,Ke.createElement)(et.Dropdown,{contentClassName:"block-library-query-toolbar__popover",renderToggle:({onToggle:e})=>(0,Ke.createElement)(et.ToolbarButton,{icon:lf,label:(0,tt.__)("Display settings"),onClick:e}),renderContent:()=>(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(et.BaseControl,null,(0,Ke.createElement)(et.__experimentalNumberControl,{__unstableInputWidth:"60px",label:(0,tt.__)("Items per Page"),labelPosition:"edge",min:1,max:100,onChange:e=>{isNaN(e)||e<1||e>100||t({perPage:e})},step:"1",value:e.perPage,isDragEnabled:!1})),(0,Ke.createElement)(et.BaseControl,null,(0,Ke.createElement)(et.__experimentalNumberControl,{__unstableInputWidth:"60px",label:(0,tt.__)("Offset"),labelPosition:"edge",min:0,max:100,onChange:e=>{isNaN(e)||e<0||e>100||t({offset:e})},step:"1",value:e.offset,isDragEnabled:!1})),(0,Ke.createElement)(et.BaseControl,{id:l,help:(0,tt.__)("Limit the pages you want to show, even if the query has more results. To show all pages use 0 (zero).")},(0,Ke.createElement)(et.__experimentalNumberControl,{id:l,__unstableInputWidth:"60px",label:(0,tt.__)("Max page to show"),labelPosition:"edge",min:0,onChange:e=>{isNaN(e)||e<0||t({pages:e})},step:"1",value:e.pages,isDragEnabled:!1})))})),r&&(0,Ke.createElement)(et.ToolbarGroup,{className:"wp-block-template-part__block-control-group"},(0,Ke.createElement)(et.ToolbarButton,{onClick:n},(0,tt.__)("Replace"))))}const yf=[{label:(0,tt.__)("Newest to oldest"),value:"date/desc"},{label:(0,tt.__)("Oldest to newest"),value:"date/asc"},{label:(0,tt.__)("A → Z"),value:"title/asc"},{label:(0,tt.__)("Z → A"),value:"title/desc"}];const vf=function({order:e,orderBy:t,onChange:n}){return(0,Ke.createElement)(et.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Order by"),value:`${t}/${e}`,options:yf,onChange:e=>{const[t,a]=e.split("/");n({order:a,orderBy:t})}})},ff={who:"authors",per_page:-1,_fields:"id,name",context:"view"};const kf=function({value:e,onChange:t}){const n=(0,gt.useSelect)((e=>{const{getUsers:t}=e(dt.store);return t(ff)}),[]);if(!n)return null;const a=sf(n),o=(e?e.toString().split(","):[]).reduce(((e,t)=>{const n=a.mapById[t];return n&&e.push({id:t,value:n.name}),e}),[]);return(0,Ke.createElement)(et.FormTokenField,{label:(0,tt.__)("Authors"),value:o,suggestions:a.names,onChange:e=>{const n=Array.from(e.reduce(((e,t)=>{const n=((e,t)=>{const n=t?.id||e[t]?.id;if(n)return n})(a.mapByName,t);return n&&e.add(n),e}),new Set));t({author:n.join(",")})},__experimentalShowHowTo:!1})},xf=[],wf={order:"asc",_fields:"id,title",context:"view"};const Ef=function({parents:e,postType:t,onChange:n}){const[a,o]=(0,_t.useState)(""),[r,l]=(0,_t.useState)(xf),[i,s]=(0,_t.useState)(xf),c=(0,jt.useDebounce)(o,250),{searchResults:m,searchHasResolved:u}=(0,gt.useSelect)((n=>{if(!a)return{searchResults:xf,searchHasResolved:!0};const{getEntityRecords:o,hasFinishedResolution:r}=n(dt.store),l=["postType",t,{...wf,search:a,orderby:"relevance",exclude:e,per_page:20}];return{searchResults:o(...l),searchHasResolved:r("getEntityRecords",l)}}),[a,e]),p=(0,gt.useSelect)((n=>{if(!e?.length)return xf;const{getEntityRecords:a}=n(dt.store);return a("postType",t,{...wf,include:e,per_page:e.length})}),[e]);(0,_t.useEffect)((()=>{if(e?.length||l(xf),!p?.length)return;const t=sf(mf(p,"title.rendered")),n=e.reduce(((e,n)=>{const a=t.mapById[n];return a&&e.push({id:n,value:a.name}),e}),[]);l(n)}),[e,p]);const d=(0,_t.useMemo)((()=>m?.length?sf(mf(m,"title.rendered")):xf),[m]);return(0,_t.useEffect)((()=>{u&&s(d.names)}),[d.names,u]),(0,Ke.createElement)(et.FormTokenField,{label:(0,tt.__)("Parents"),value:r,onInputChange:c,suggestions:i,onChange:e=>{const t=Array.from(e.reduce(((e,t)=>{const n=((e,t)=>{const n=t?.id||e?.[t]?.id;if(n)return n})(d.mapByName,t);return n&&e.add(n),e}),new Set));s(xf),n({parents:t})},__experimentalShowHowTo:!1})},Cf=[],Sf={order:"asc",_fields:"id,name",context:"view"},Bf=(e,t)=>{const n=t?.id||e?.find((e=>e.name===t))?.id;if(n)return n;const a=t.toLocaleLowerCase();return e?.find((e=>e.name.toLocaleLowerCase()===a))?.id};function Nf({onChange:e,query:t}){const{postType:n,taxQuery:a}=t,o=pf(n);return o&&0!==o.length?(0,Ke.createElement)(Ke.Fragment,null,o.map((t=>{const n=a?.[t.slug]||[];return(0,Ke.createElement)(Tf,{key:t.slug,taxonomy:t,termIds:n,onChange:n=>e({taxQuery:{...a,[t.slug]:n}})})}))):null}function Tf({taxonomy:e,termIds:t,onChange:n}){const[a,o]=(0,_t.useState)(""),[r,l]=(0,_t.useState)(Cf),[i,s]=(0,_t.useState)(Cf),c=(0,jt.useDebounce)(o,250),{searchResults:m,searchHasResolved:u}=(0,gt.useSelect)((n=>{if(!a)return{searchResults:Cf,searchHasResolved:!0};const{getEntityRecords:o,hasFinishedResolution:r}=n(dt.store),l=["taxonomy",e.slug,{...Sf,search:a,orderby:"name",exclude:t,per_page:20}];return{searchResults:o(...l),searchHasResolved:r("getEntityRecords",l)}}),[a,t]),p=(0,gt.useSelect)((n=>{if(!t?.length)return Cf;const{getEntityRecords:a}=n(dt.store);return a("taxonomy",e.slug,{...Sf,include:t,per_page:t.length})}),[t]);(0,_t.useEffect)((()=>{if(t?.length||l(Cf),!p?.length)return;const e=t.reduce(((e,t)=>{const n=p.find((e=>e.id===t));return n&&e.push({id:t,value:n.name}),e}),[]);l(e)}),[t,p]),(0,_t.useEffect)((()=>{u&&s(m.map((e=>e.name)))}),[m,u]);return(0,Ke.createElement)("div",{className:"block-library-query-inspector__taxonomy-control"},(0,Ke.createElement)(et.FormTokenField,{label:e.name,value:r,onInputChange:c,suggestions:i,displayTransform:Jn.decodeEntities,onChange:e=>{const t=new Set;for(const n of e){const e=Bf(m,n);e&&t.add(e)}s(Cf),n(Array.from(t))},__experimentalShowHowTo:!1}))}const If=[{label:(0,tt.__)("Include"),value:""},{label:(0,tt.__)("Exclude"),value:"exclude"},{label:(0,tt.__)("Only"),value:"only"}];function Pf({value:e,onChange:t}){return(0,Ke.createElement)(et.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Sticky posts"),options:If,value:e,onChange:t,help:(0,tt.__)("Blog posts can be “stickied”, a feature that places them at the top of the front page of posts, keeping it there until new sticky posts are published.")})}function Mf({enhancedPagination:e,setAttributes:t,clientId:n}){const{hasUnsupportedBlocks:a}=bf(n);let o=(0,tt.__)("Browsing between pages requires a full page reload.");return e?o=(0,tt.__)("Browsing between pages won't require a full page reload, unless non-compatible blocks are detected."):a&&(o=(0,tt.__)("Force page reload can't be disabled because there are non-compatible blocks inside the Query block.")),(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(et.ToggleControl,{label:(0,tt.__)("Force page reload"),help:o,checked:!e,disabled:a,onChange:e=>{t({enhancedPagination:!e})}}))}const zf=({attributes:{query:{postType:e}={}}={}})=>{if(!e)return null;const t=(0,pt.addQueryArgs)("post-new.php",{post_type:e});return(0,Ke.createElement)("div",{className:"wp-block-query__create-new-link"},(0,_t.createInterpolateElement)((0,tt.__)("Add new post"),{a:(0,Ke.createElement)("a",{href:t})}))},{BlockInfo:Rf}=Ft(nt.privateApis);function Af(e){const{attributes:t,setQuery:n,setDisplayLayout:a,setAttributes:o,clientId:r}=e,{query:l,displayLayout:i,enhancedPagination:s}=t,{order:c,orderBy:m,author:u,postType:p,sticky:d,inherit:g,taxQuery:h,parents:b}=l,_=function(e){return(0,gt.useSelect)((t=>t(Qe.store).getActiveBlockVariation("core/query",e)?.allowedControls),[e])}(t),[y,v]=(0,_t.useState)("post"===p),{postTypesTaxonomiesMap:f,postTypesSelectOptions:k}=uf(),x=pf(p),w=function(e){return(0,gt.useSelect)((t=>{const n=t(dt.store).getPostType(e);return n?.viewable&&n?.hierarchical}),[e])}(p);(0,_t.useEffect)((()=>{v("post"===p)}),[p]);const[E,C]=(0,_t.useState)(l.search),S=(0,_t.useCallback)((0,jt.debounce)((()=>{l.search!==E&&n({search:E})}),250),[E,l.search]);(0,_t.useEffect)((()=>(S(),S.cancel)),[E,S]);const B=df(_,"inherit"),N=!g&&df(_,"postType"),T=!g&&df(_,"order"),I=!g&&y&&df(_,"sticky"),P=B||N||T||I,M=!!x?.length&&df(_,"taxQuery"),z=df(_,"author"),R=df(_,"search"),A=df(_,"parents")&&w,H=M||z||R||A;return(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(Rf,null,(0,Ke.createElement)(zf,{...e})),P&&(0,Ke.createElement)(et.PanelBody,{title:(0,tt.__)("Settings")},B&&(0,Ke.createElement)(et.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Inherit query from template"),help:(0,tt.__)("Toggle to use the global query context that is set with the current template, such as an archive or search. Disable to customize the settings independently."),checked:!!g,onChange:e=>n({inherit:!!e})}),N&&(0,Ke.createElement)(et.SelectControl,{__nextHasNoMarginBottom:!0,options:k,value:p,label:(0,tt.__)("Post type"),onChange:e=>{const t={postType:e},a=f[e],o=Object.entries(h||{}).reduce(((e,[t,n])=>(a.includes(t)&&(e[t]=n),e)),{});t.taxQuery=Object.keys(o).length?o:void 0,"post"!==e&&(t.sticky=""),t.parents=[],n(t)},help:(0,tt.__)("WordPress contains different types of content and they are divided into collections called “Post types”. By default there are a few different ones such as blog posts and pages, but plugins could add more.")}),false,T&&(0,Ke.createElement)(vf,{order:c,orderBy:m,onChange:n}),I&&(0,Ke.createElement)(Pf,{value:d,onChange:e=>n({sticky:e})}),(0,Ke.createElement)(Mf,{enhancedPagination:s,setAttributes:o,clientId:r})),!g&&H&&(0,Ke.createElement)(et.__experimentalToolsPanel,{className:"block-library-query-toolspanel__filters",label:(0,tt.__)("Filters"),resetAll:()=>{n({author:"",parents:[],search:"",taxQuery:null}),C("")},dropdownMenuProps:op},M&&(0,Ke.createElement)(et.__experimentalToolsPanelItem,{label:(0,tt.__)("Taxonomies"),hasValue:()=>Object.values(h||{}).some((e=>!!e.length)),onDeselect:()=>n({taxQuery:null})},(0,Ke.createElement)(Nf,{onChange:n,query:l})),z&&(0,Ke.createElement)(et.__experimentalToolsPanelItem,{hasValue:()=>!!u,label:(0,tt.__)("Authors"),onDeselect:()=>n({author:""})},(0,Ke.createElement)(kf,{value:u,onChange:n})),R&&(0,Ke.createElement)(et.__experimentalToolsPanelItem,{hasValue:()=>!!E,label:(0,tt.__)("Keyword"),onDeselect:()=>C("")},(0,Ke.createElement)(et.TextControl,{__nextHasNoMarginBottom:!0,label:(0,tt.__)("Keyword"),value:E,onChange:C})),A&&(0,Ke.createElement)(et.__experimentalToolsPanelItem,{hasValue:()=>!!b?.length,label:(0,tt.__)("Parents"),onDeselect:()=>n({parents:[]})},(0,Ke.createElement)(Ef,{parents:b,postType:p,onChange:n}))))}const Hf="wp-block-query-enhanced-pagination-modal__description";function Lf({clientId:e,attributes:{enhancedPagination:t},setAttributes:n}){const[a,o]=(0,_t.useState)(!1),{hasBlocksFromPlugins:r,hasPostContentBlock:l,hasUnsupportedBlocks:i}=bf(e);(0,_t.useEffect)((()=>{t&&i&&(n({enhancedPagination:!1}),o(!0))}),[t,i,n]);const s=()=>{o(!1)};let c=(0,tt.__)('If you still want to prevent full page reloads, remove that block, then disable "Force page reload" again in the Query Block settings.');return r?c=(0,tt.__)("Currently, avoiding full page reloads is not possible when non-interactive or non-clientNavigation compatible blocks from plugins are present inside the Query block.")+" "+c:l&&(c=(0,tt.__)("Currently, avoiding full page reloads is not possible when a Content block is present inside the Query block.")+" "+c),a&&(0,Ke.createElement)(et.Modal,{title:(0,tt.__)("Query block: Force page reload enabled"),className:"wp-block-query__enhanced-pagination-modal",aria:{describedby:Hf},role:"alertdialog",focusOnMount:"firstElement",isDismissible:!1,onRequestClose:s},(0,Ke.createElement)(et.__experimentalVStack,{alignment:"right",spacing:5},(0,Ke.createElement)("span",{id:Hf},c),(0,Ke.createElement)(et.Button,{variant:"primary",onClick:s},(0,tt.__)("OK"))))}const Df=[["core/post-template"]];function Ff({attributes:e,setAttributes:t,openPatternSelectionModal:n,name:a,clientId:o}){const{queryId:r,query:l,displayLayout:i,tagName:s="div",query:{inherit:c}={}}=e,{__unstableMarkNextChangeAsNotPersistent:m}=(0,gt.useDispatch)(nt.store),u=(0,jt.useInstanceId)(Ff),p=(0,nt.useBlockProps)(),d=(0,nt.useInnerBlocksProps)(p,{template:Df}),{postsPerPage:g}=(0,gt.useSelect)((e=>{const{getSettings:t}=e(nt.store),{getEntityRecord:n,canUser:a}=e(dt.store);return{postsPerPage:(a("read","settings")?+n("root","site")?.posts_per_page:+t().postsPerPage)||3}}),[]);(0,_t.useEffect)((()=>{const e={};(c&&l.perPage!==g||!l.perPage&&g)&&(e.perPage=g),Object.keys(e).length&&(m(),h(e))}),[l.perPage,g,c]),(0,_t.useEffect)((()=>{Number.isFinite(r)||(m(),t({queryId:u}))}),[r,u]);const h=e=>t({query:{...l,...e}}),b={main:(0,tt.__)("The element should be used for the primary content of your document only. "),section:(0,tt.__)("The element should represent a standalone portion of the document that can't be better represented by another element."),aside:(0,tt.__)("The