",value:"div"}],value:t||"",onChange:e=>n({tagName:e})}))}function cx(e){let{postId:t,hasInnerBlocks:n,layout:o,tagName:r,blockProps:a}=e;const l=(0,it.useSelect)((e=>{var t;const{getSettings:n}=e(Ze.store);return null===(t=n())||void 0===t?void 0:t.supportsLayout}),[]),i=(0,Ze.useSetting)("layout")||{},s=o&&o.inherit?i:o,[c,u,m]=(0,lt.useEntityBlockEditor)("postType","wp_template_part",{id:t}),d=(0,Ze.useInnerBlocksProps)(a,{value:c,onInput:u,onChange:m,renderAppender:n?void 0:Ze.InnerBlocks.ButtonBlockAppender,__experimentalLayout:l?s:void 0});return(0,$e.createElement)(r,d)}var ux=(0,$e.createElement)(Ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,$e.createElement)(Ue.Path,{d:"M18.5 10.5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"}));var mx=(0,$e.createElement)(Ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,$e.createElement)(Ue.Path,{fillRule:"evenodd",d:"M18 5.5h-8v8h8.5V6a.5.5 0 00-.5-.5zm-9.5 8h-3V6a.5.5 0 01.5-.5h2.5v8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"}));var dx=(0,$e.createElement)(Ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,$e.createElement)(Ue.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"}));function px(e,t){if("core/template-part"!==t)return e;if(e.variations){const t=(e,t)=>{const{area:n,theme:o,slug:r}=e;if(n)return n===t.area;if(!r)return!1;const a=(0,it.select)(lt.store).getEntityRecord("postType","wp_template_part",`${o}//${r}`);return(null==a?void 0:a.area)===t.area},n=e.variations.map((e=>{return{...e,...!e.isActive&&{isActive:t},..."string"==typeof e.icon&&{icon:(n=e.icon,"header"===n?ux:"footer"===n?mx:"sidebar"===n?dx:Yk)}};var n}));return{...e,variations:n}}return e}const gx={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:2,name:"core/template-part",title:"Template Part",category:"theme",description:"Edit the different global regions of your site, like the header, footer, sidebar, or create your own.",textdomain:"default",attributes:{slug:{type:"string"},theme:{type:"string"},tagName:{type:"string"},area:{type:"string"}},supports:{align:!0,html:!1,reusable:!1},editorStyle:"wp-block-template-part-editor"},{name:hx}=gx,vx={icon:Yk,__experimentalLabel:e=>{var t;let{slug:n,theme:o}=e;if(!n)return;const r=(0,it.select)(lt.store).getEntityRecord("postType","wp_template_part",o+"//"+n);return r?(0,Ad.decodeEntities)(null===(t=r.title)||void 0===t?void 0:t.rendered)||Kk(r.slug):void 0},edit:function(e){let{attributes:t,setAttributes:n,clientId:o,isSelected:r}=e;const{slug:a,theme:l,tagName:i,layout:s={}}=t,c=jd(l,a),u=(0,Ze.__experimentalUseHasRecursion)(c),[m,d]=(0,$e.useState)(!1),{isResolved:p,innerBlocks:g,isMissing:h,area:v}=(0,it.useSelect)((e=>{const{getEditedEntityRecord:n,hasFinishedResolution:r}=e(lt.store),{getBlocks:a}=e(Ze.store),l=["postType","wp_template_part",c],i=c?n(...l):null,s=(null==i?void 0:i.area)||t.area,u=!!c&&r("getEditedEntityRecord",l);return{innerBlocks:a(o),isResolved:u,isMissing:u&&(0,St.isEmpty)(i),area:s}}),[c,o]),{templateParts:b}=Jk(v,c),_=Xk(v,o),y=!!b.length||!!_.length,f=tx(v),k=(0,Ze.useBlockProps)(),x=!a,w=!x&&!h&&p,E=i||f.tagName,C=r&&w&&y&&("header"===v||"footer"===v);return 0===g.length&&(a&&!l||a&&h)?(0,$e.createElement)(E,k,(0,$e.createElement)(Ze.Warning,null,(0,je.sprintf)((0,je.__)("Template part has been deleted or is unavailable: %s"),a))):w&&u?(0,$e.createElement)(E,k,(0,$e.createElement)(Ze.Warning,null,(0,je.__)("Block cannot be rendered inside itself."))):(0,$e.createElement)($e.Fragment,null,(0,$e.createElement)(Ze.__experimentalRecursionProvider,{uniqueId:c},(0,$e.createElement)(sx,{tagName:i,setAttributes:n,isEntityAvailable:w,templatePartId:c,defaultWrapper:f.tagName}),x&&(0,$e.createElement)(E,k,(0,$e.createElement)(ox,{area:t.area,templatePartId:c,clientId:o,setAttributes:n,onOpenSelectionModal:()=>d(!0)})),C&&(0,$e.createElement)(Ze.BlockSettingsMenuControls,null,(()=>(0,$e.createElement)(We.MenuItem,{onClick:()=>{d(!0)}},(0,$e.createInterpolateElement)((0,je.__)("Replace
"),{BlockTitle:(0,$e.createElement)(Ze.BlockTitle,{clientId:o,maximumLength:25})})))),w&&(0,$e.createElement)(cx,{tagName:E,blockProps:k,postId:c,hasInnerBlocks:g.length>0,layout:s}),!x&&!p&&(0,$e.createElement)(E,k,(0,$e.createElement)(We.Spinner,null))),m&&(0,$e.createElement)(We.Modal,{overlayClassName:"block-editor-template-part__selection-modal",title:(0,je.sprintf)((0,je.__)("Choose a %s"),f.label.toLowerCase()),closeLabel:(0,je.__)("Cancel"),onRequestClose:()=>d(!1)},(0,$e.createElement)(ix,{templatePartId:c,clientId:o,area:v,setAttributes:n,onClose:()=>d(!1)})))}},bx=()=>{(0,Xs.addFilter)("blocks.registerBlockType","core/template-part",px);const e=["core/post-template","core/post-content"];return(0,Xs.addFilter)("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromPostTemplates",((t,n,o,r)=>{let{getBlock:a,getBlockParentsByBlockName:l}=r;if("core/template-part"!==n.name)return t;for(const t of e){var i;if((null===(i=a(o))||void 0===i?void 0:i.name)===t||l(o,t).length)return!1}return!0})),qe({name:hx,metadata:gx,settings:vx})};var _x=(0,$e.createElement)(Ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,$e.createElement)(Ue.Path,{d:"M6.08 10.103h2.914L9.657 12h1.417L8.23 4H6.846L4 12h1.417l.663-1.897Zm1.463-4.137.994 2.857h-2l1.006-2.857ZM11 16H4v-1.5h7V16Zm1 0h8v-1.5h-8V16Zm-4 4H4v-1.5h4V20Zm7-1.5V20H9v-1.5h6Z"}));const yx={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:2,name:"core/term-description",title:"Term Description",category:"theme",description:"Display the description of categories, tags and custom taxonomies when viewing an archive.",textdomain:"default",attributes:{textAlign:{type:"string"}},supports:{align:["wide","full"],html:!1,color:{link:!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}}},editorStyle:"wp-block-term-description-editor"},{name:fx}=yx,kx={icon:_x,edit:function(e){let{attributes:t,setAttributes:n,mergedStyle:o}=e;const{textAlign:r}=t,a=(0,Ze.useBlockProps)({className:rt()({[`has-text-align-${r}`]:r}),style:o});return(0,$e.createElement)($e.Fragment,null,(0,$e.createElement)(Ze.BlockControls,{group:"block"},(0,$e.createElement)(Ze.AlignmentControl,{value:r,onChange:e=>{n({textAlign:e})}})),(0,$e.createElement)("div",a,(0,$e.createElement)("div",{className:"wp-block-term-description__placeholder"},(0,$e.createElement)("span",null,(0,je.__)("Term Description")))))}},xx=()=>qe({name:fx,metadata:yx,settings:kx});const wx={to:[{type:"block",blocks:["core/columns"],transform:e=>{let{className:t,columns:n,content:o,width:r}=e;return(0,Ge.createBlock)("core/columns",{align:"wide"===r||"full"===r?r:void 0,className:t,columns:n},o.map((e=>{let{children:t}=e;return(0,Ge.createBlock)("core/column",{},[(0,Ge.createBlock)("core/paragraph",{content:t})])})))}}]};var Ex=wx;const Cx={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:2,name:"core/text-columns",title:"Text Columns (deprecated)",icon:"columns",category:"design",description:"This block is deprecated. Please use the Columns block instead.",textdomain:"default",attributes:{content:{type:"array",source:"query",selector:"p",query:{children:{type:"string",source:"html"}},default:[{},{}]},columns:{type:"number",default:2},width:{type:"string"}},supports:{inserter:!1},editorStyle:"wp-block-text-columns-editor",style:"wp-block-text-columns"},{name:Sx}=Cx,Bx={transforms:Ex,getEditWrapperProps(e){const{width:t}=e;if("wide"===t||"full"===t)return{"data-align":t}},edit:function(e){let{attributes:t,setAttributes:n}=e;const{width:o,content:r,columns:a}=t;return Yu()("The Text Columns block",{since:"5.3",alternative:"the Columns block"}),(0,$e.createElement)($e.Fragment,null,(0,$e.createElement)(Ze.BlockControls,null,(0,$e.createElement)(Ze.BlockAlignmentToolbar,{value:o,onChange:e=>n({width:e}),controls:["center","wide","full"]})),(0,$e.createElement)(Ze.InspectorControls,null,(0,$e.createElement)(We.PanelBody,null,(0,$e.createElement)(We.RangeControl,{label:(0,je.__)("Columns"),value:a,onChange:e=>n({columns:e}),min:2,max:4,required:!0}))),(0,$e.createElement)("div",(0,Ze.useBlockProps)({className:`align${o} columns-${a}`}),Array.from({length:a}).map(((e,t)=>(0,$e.createElement)("div",{className:"wp-block-column",key:`column-${t}`},(0,$e.createElement)(Ze.RichText,{tagName:"p",value:(0,St.get)(r,[t,"children"]),onChange:e=>{n({content:[...r.slice(0,t),{children:e},...r.slice(t+1)]})},"aria-label":(0,je.sprintf)((0,je.__)("Column %d text"),t+1),placeholder:(0,je.__)("New Column")}))))))},save:function(e){let{attributes:t}=e;const{width:n,content:o,columns:r}=t;return(0,$e.createElement)("div",Ze.useBlockProps.save({className:`align${n} columns-${r}`}),Array.from({length:r}).map(((e,t)=>(0,$e.createElement)("div",{className:"wp-block-column",key:`column-${t}`},(0,$e.createElement)(Ze.RichText.Content,{tagName:"p",value:(0,St.get)(o,[t,"children"])})))))}},Tx=()=>qe({name:Sx,metadata:Cx,settings:Bx});var Nx=(0,$e.createElement)(Ue.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,$e.createElement)(Ue.Path,{d:"M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z"}));const Px={attributes:{content:{type:"string",source:"html",selector:"pre",default:""},textAlign:{type:"string"}},save(e){let{attributes:t}=e;const{textAlign:n,content:o}=t;return(0,$e.createElement)(Ze.RichText.Content,{tagName:"pre",style:{textAlign:n},value:o})}},Ix={attributes:{content:{type:"string",source:"html",selector:"pre",default:"",__unstablePreserveWhiteSpace:!0,__experimentalRole:"content"},textAlign:{type:"string"}},supports:{anchor:!0,color:{gradients:!0,link:!0},typography:{fontSize:!0,__experimentalFontFamily:!0},spacing:{padding:!0}},save(e){let{attributes:t}=e;const{textAlign:n,content:o}=t,r=rt()({[`has-text-align-${n}`]:n});return(0,$e.createElement)("pre",Ze.useBlockProps.save({className:r}),(0,$e.createElement)(Ze.RichText.Content,{value:o}))},migrate:Jt,isEligible(e){var t;let{style:n}=e;return null==n||null===(t=n.typography)||void 0===t?void 0:t.fontFamily}};var zx=[Ix,Px];const Mx={from:[{type:"block",blocks:["core/paragraph"],transform:e=>(0,Ge.createBlock)("core/verse",e)}],to:[{type:"block",blocks:["core/paragraph"],transform:e=>(0,Ge.createBlock)("core/paragraph",e)}]};var Lx=Mx;const Rx={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:2,name:"core/verse",title:"Verse",category:"text",description:"Insert poetry. Use special spacing formats. Or quote song lyrics.",keywords:["poetry","poem"],textdomain:"default",attributes:{content:{type:"string",source:"html",selector:"pre",default:"",__unstablePreserveWhiteSpace:!0,__experimentalRole:"content"},textAlign:{type:"string"}},supports:{anchor:!0,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},typography:{fontSize:!0,__experimentalFontFamily:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalDefaultControls:{fontSize:!0,fontAppearance:!0}},spacing:{margin:!0,padding:!0}},style:"wp-block-verse",editorStyle:"wp-block-verse-editor"},{name:Ax}=Rx,Vx={icon:Nx,example:{attributes:{content:(0,je.__)("WHAT was he doing, the great god Pan,\n\tDown in the reeds by the river?\nSpreading ruin and scattering ban,\nSplashing and paddling with hoofs of a goat,\nAnd breaking the golden lilies afloat\n With the dragon-fly on the river.")}},transforms:Lx,deprecated:zx,merge(e,t){return{content:e.content+t.content}},edit:function(e){let{attributes:t,setAttributes:n,mergeBlocks:o,onRemove:r,style:a}=e;const{textAlign:l,content:i}=t,s=(0,Ze.useBlockProps)({className:rt()({[`has-text-align-${l}`]:l}),style:a});return(0,$e.createElement)($e.Fragment,null,(0,$e.createElement)(Ze.BlockControls,null,(0,$e.createElement)(Ze.AlignmentToolbar,{value:l,onChange:e=>{n({textAlign:e})}})),(0,$e.createElement)(Ze.RichText,nt({tagName:"pre",identifier:"content",preserveWhiteSpace:!0,value:i,onChange:e=>{n({content:e})},"aria-label":(0,je.__)("Verse text"),placeholder:(0,je.__)("Write verse…"),onRemove:r,onMerge:o,textAlign:l},s,{__unstablePastePlainText:!0})))},save:function(e){let{attributes:t}=e;const{textAlign:n,content:o}=t,r=rt()({[`has-text-align-${n}`]:n});return(0,$e.createElement)("pre",Ze.useBlockProps.save({className:r}),(0,$e.createElement)(Ze.RichText.Content,{value:o}))}},Hx=()=>qe({name:Ax,metadata:Rx,settings:Vx});var Fx=(0,$e.createElement)(Ue.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,$e.createElement)(Ue.Path,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"}));function Dx(e){let{tracks:t=[]}=e;return t.map((e=>(0,$e.createElement)("track",nt({key:e.src},e))))}const{attributes:Gx}={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:2,name:"core/video",title:"Video",category:"media",description:"Embed a video from your media library or upload a new one.",keywords:["movie"],textdomain:"default",attributes:{autoplay:{type:"boolean",source:"attribute",selector:"video",attribute:"autoplay"},caption:{type:"string",source:"html",selector:"figcaption",__experimentalRole:"content"},controls:{type:"boolean",source:"attribute",selector:"video",attribute:"controls",default:!0},id:{type:"number",__experimentalRole:"content"},loop:{type:"boolean",source:"attribute",selector:"video",attribute:"loop"},muted:{type:"boolean",source:"attribute",selector:"video",attribute:"muted"},poster:{type:"string",source:"attribute",selector:"video",attribute:"poster"},preload:{type:"string",source:"attribute",selector:"video",attribute:"preload",default:"metadata"},src:{type:"string",source:"attribute",selector:"video",attribute:"src",__experimentalRole:"content"},playsInline:{type:"boolean",source:"attribute",selector:"video",attribute:"playsinline"},tracks:{__experimentalRole:"content",type:"array",items:{type:"object"},default:[]}},supports:{anchor:!0,align:!0,spacing:{margin:!0,padding:!0}},editorStyle:"wp-block-video-editor",style:"wp-block-video"},$x={attributes:Gx,save(e){let{attributes:t}=e;const{autoplay:n,caption:o,controls:r,loop:a,muted:l,poster:i,preload:s,src:c,playsInline:u,tracks:m}=t;return(0,$e.createElement)("figure",Ze.useBlockProps.save(),c&&(0,$e.createElement)("video",{autoPlay:n,controls:r,loop:a,muted:l,poster:i,preload:"metadata"!==s?s:void 0,src:c,playsInline:u},(0,$e.createElement)(Dx,{tracks:m})),!Ze.RichText.isEmpty(o)&&(0,$e.createElement)(Ze.RichText.Content,{tagName:"figcaption",value:o}))}};var Ux=[$x];const Ox=[{value:"auto",label:(0,je.__)("Auto")},{value:"metadata",label:(0,je.__)("Metadata")},{value:"none",label:(0,je._x)("None","Preload value")}];var qx=e=>{let{setAttributes:t,attributes:n}=e;const{autoplay:o,controls:r,loop:a,muted:l,playsInline:i,preload:s}=n,c=(0,je.__)("Autoplay may cause usability issues for some users."),u=$e.Platform.select({web:(0,$e.useCallback)((e=>e?c:null),[]),native:c}),m=(0,$e.useMemo)((()=>{const e=e=>n=>{t({[e]:n})};return{autoplay:e("autoplay"),loop:e("loop"),muted:e("muted"),controls:e("controls"),playsInline:e("playsInline")}}),[]),d=(0,$e.useCallback)((e=>{t({preload:e})}),[]);return(0,$e.createElement)($e.Fragment,null,(0,$e.createElement)(We.ToggleControl,{label:(0,je.__)("Autoplay"),onChange:m.autoplay,checked:o,help:u}),(0,$e.createElement)(We.ToggleControl,{label:(0,je.__)("Loop"),onChange:m.loop,checked:a}),(0,$e.createElement)(We.ToggleControl,{label:(0,je.__)("Muted"),onChange:m.muted,checked:l}),(0,$e.createElement)(We.ToggleControl,{label:(0,je.__)("Playback controls"),onChange:m.controls,checked:r}),(0,$e.createElement)(We.ToggleControl,{label:(0,je.__)("Play inline"),onChange:m.playsInline,checked:i}),(0,$e.createElement)(We.SelectControl,{label:(0,je.__)("Preload"),value:s,onChange:d,options:Ox,hideCancelButton:!0}))};var Wx=(0,$e.createElement)(Ue.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,$e.createElement)(Ue.Path,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"}));const jx=["text/vtt"],Zx="subtitles",Qx=[{label:(0,je.__)("Subtitles"),value:"subtitles"},{label:(0,je.__)("Captions"),value:"captions"},{label:(0,je.__)("Descriptions"),value:"descriptions"},{label:(0,je.__)("Chapters"),value:"chapters"},{label:(0,je.__)("Metadata"),value:"metadata"}],Kx=(0,$e.createElement)(We.SVG,{width:"18",height:"14",viewBox:"0 0 18 14",role:"img",fill:"none"},(0,$e.createElement)(We.Rect,{x:"0.75",y:"0.75",width:"16.5",height:"12.5",rx:"1.25",stroke:"black",strokeWidth:"1.5",fill:"none"}),(0,$e.createElement)(We.Path,{d:"M3 7H15",stroke:"black",strokeWidth:"1.5"}),(0,$e.createElement)(We.Path,{d:"M3 10L15 10",stroke:"black",strokeWidth:"1.5"}));function Yx(e){let t,{tracks:n,onEditPress:o}=e;return t=0===n.length?(0,$e.createElement)("p",{className:"block-library-video-tracks-editor__tracks-informative-message"},(0,je.__)("Tracks can be subtitles, captions, chapters, or descriptions. They help make your content more accessible to a wider range of users.")):n.map(((e,t)=>(0,$e.createElement)("div",{key:t,className:"block-library-video-tracks-editor__track-list-track"},(0,$e.createElement)("span",null,e.label," "),(0,$e.createElement)(We.Button,{variant:"tertiary",onClick:()=>o(t),"aria-label":(0,je.sprintf)((0,je.__)("Edit %s"),e.label)},(0,je.__)("Edit"))))),(0,$e.createElement)(We.MenuGroup,{label:(0,je.__)("Text tracks"),className:"block-library-video-tracks-editor__track-list"},t)}function Jx(e){let{track:t,onChange:n,onClose:o,onRemove:r}=e;const{src:a="",label:l="",srcLang:i="",kind:s=Zx}=t,c=a.startsWith("blob:")?"":(0,at.getFilename)(a)||"";return(0,$e.createElement)(We.NavigableMenu,null,(0,$e.createElement)("div",{className:"block-library-video-tracks-editor__single-track-editor"},(0,$e.createElement)("span",{className:"block-library-video-tracks-editor__single-track-editor-edit-track-label"},(0,je.__)("Edit track")),(0,$e.createElement)("span",null,(0,je.__)("File"),": ",(0,$e.createElement)("b",null,c)),(0,$e.createElement)("div",{className:"block-library-video-tracks-editor__single-track-editor-label-language"},(0,$e.createElement)(We.TextControl,{autoFocus:!0,onChange:e=>n({...t,label:e}),label:(0,je.__)("Label"),value:l,help:(0,je.__)("Title of track")}),(0,$e.createElement)(We.TextControl,{onChange:e=>n({...t,srcLang:e}),label:(0,je.__)("Source language"),value:i,help:(0,je.__)("Language tag (en, fr, etc.)")})),(0,$e.createElement)(We.SelectControl,{className:"block-library-video-tracks-editor__single-track-editor-kind-select",options:Qx,value:s,label:(0,je.__)("Kind"),onChange:e=>{n({...t,kind:e})}}),(0,$e.createElement)("div",{className:"block-library-video-tracks-editor__single-track-editor-buttons-container"},(0,$e.createElement)(We.Button,{variant:"secondary",onClick:()=>{const e={};let r=!1;""===l&&(e.label=(0,je.__)("English"),r=!0),""===i&&(e.srcLang="en",r=!0),void 0===t.kind&&(e.kind=Zx,r=!0),r&&n({...t,...e}),o()}},(0,je.__)("Close")),(0,$e.createElement)(We.Button,{isDestructive:!0,variant:"link",onClick:r},(0,je.__)("Remove track")))))}function Xx(e){let{tracks:t=[],onChange:n}=e;const o=(0,it.useSelect)((e=>e(Ze.store).getSettings().mediaUpload),[]),[r,a]=(0,$e.useState)(null);return o?(0,$e.createElement)(We.Dropdown,{contentClassName:"block-library-video-tracks-editor",renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,$e.createElement)(We.ToolbarButton,{label:(0,je.__)("Text tracks"),showTooltip:!0,"aria-expanded":t,"aria-haspopup":"true",onClick:n,icon:Kx})},renderContent:()=>null!==r?(0,$e.createElement)(Jx,{track:t[r],onChange:e=>{const o=[...t];o[r]=e,n(o)},onClose:()=>a(null),onRemove:()=>{n(t.filter(((e,t)=>t!==r))),a(null)}}):(0,$e.createElement)($e.Fragment,null,(0,$e.createElement)(We.NavigableMenu,null,(0,$e.createElement)(Yx,{tracks:t,onEditPress:a}),(0,$e.createElement)(We.MenuGroup,{className:"block-library-video-tracks-editor__add-tracks-container",label:(0,je.__)("Add tracks")},(0,$e.createElement)(Ze.MediaUpload,{onSelect:e=>{let{url:o}=e;const r=t.length;n([...t,{src:o}]),a(r)},allowedTypes:jx,render:e=>{let{open:t}=e;return(0,$e.createElement)(We.MenuItem,{icon:Wx,onClick:t},(0,je.__)("Open Media Library"))}}),(0,$e.createElement)(Ze.MediaUploadCheck,null,(0,$e.createElement)(We.FormFileUpload,{onChange:e=>{const r=e.target.files,l=t.length;o({allowedTypes:jx,filesList:r,onFileChange:e=>{let[{url:o}]=e;const r=[...t];r[l]||(r[l]={}),r[l]={...t[l],src:o},n(r),a(l)}})},accept:".vtt,text/vtt",render:e=>{let{openFileDialog:t}=e;return(0,$e.createElement)(We.MenuItem,{icon:su,onClick:()=>{t()}},(0,je.__)("Upload"))}})))))}):null}const ew=["video"],tw=["image"];var nw=function e(t){let{isSelected:n,attributes:o,className:r,setAttributes:a,insertBlocksAfter:l,onReplace:i}=t;const s=(0,Zt.useInstanceId)(e),c=(0,$e.useRef)(),u=(0,$e.useRef)(),{id:m,caption:d,controls:p,poster:g,src:h,tracks:v}=o,b=!m&&(0,xt.isBlobURL)(h),_=(0,it.useSelect)((e=>e(Ze.store).getSettings().mediaUpload),[]);function y(e){var t,n;e&&e.url?a({src:e.url,id:e.id,poster:(null===(t=e.image)||void 0===t?void 0:t.src)!==e.icon?null===(n=e.image)||void 0===n?void 0:n.src:void 0}):a({src:void 0,id:void 0,poster:void 0})}function f(e){if(e!==h){const t=Lt({attributes:{url:e}});if(void 0!==t)return void i(t);a({src:e,id:void 0,poster:void 0})}}(0,$e.useEffect)((()=>{if(!m&&(0,xt.isBlobURL)(h)){const e=(0,xt.getBlobByURL)(h);e&&_({filesList:[e],onFileChange:e=>{let[t]=e;return y(t)},onError:x,allowedTypes:ew})}}),[]),(0,$e.useEffect)((()=>{c.current&&c.current.load()}),[g]);const{createErrorNotice:k}=(0,it.useDispatch)(wt.store);function x(e){k(e,{type:"snackbar"})}const w=rt()(r,{"is-transient":b}),E=(0,Ze.useBlockProps)({className:w});if(!h)return(0,$e.createElement)("div",E,(0,$e.createElement)(Ze.MediaPlaceholder,{icon:(0,$e.createElement)(Ze.BlockIcon,{icon:Fx}),onSelect:y,onSelectURL:f,accept:"video/*",allowedTypes:ew,value:o,onError:x}));const C=`video-block__poster-image-description-${s}`;return(0,$e.createElement)($e.Fragment,null,(0,$e.createElement)(Ze.BlockControls,{group:"block"},(0,$e.createElement)(Xx,{tracks:v,onChange:e=>{a({tracks:e})}})),(0,$e.createElement)(Ze.BlockControls,{group:"other"},(0,$e.createElement)(Ze.MediaReplaceFlow,{mediaId:m,mediaURL:h,allowedTypes:ew,accept:"video/*",onSelect:y,onSelectURL:f,onError:x})),(0,$e.createElement)(Ze.InspectorControls,null,(0,$e.createElement)(We.PanelBody,{title:(0,je.__)("Settings")},(0,$e.createElement)(qx,{setAttributes:a,attributes:o}),(0,$e.createElement)(Ze.MediaUploadCheck,null,(0,$e.createElement)(We.BaseControl,{className:"editor-video-poster-control"},(0,$e.createElement)(We.BaseControl.VisualLabel,null,(0,je.__)("Poster image")),(0,$e.createElement)(Ze.MediaUpload,{title:(0,je.__)("Select poster image"),onSelect:function(e){a({poster:e.url})},allowedTypes:tw,render:e=>{let{open:t}=e;return(0,$e.createElement)(We.Button,{variant:"primary",onClick:t,ref:u,"aria-describedby":C},g?(0,je.__)("Replace"):(0,je.__)("Select"))}}),(0,$e.createElement)("p",{id:C,hidden:!0},g?(0,je.sprintf)((0,je.__)("The current poster image url is %s"),g):(0,je.__)("There is no poster image currently selected")),!!g&&(0,$e.createElement)(We.Button,{onClick:function(){a({poster:void 0}),u.current.focus()},variant:"tertiary"},(0,je.__)("Remove")))))),(0,$e.createElement)("figure",E,(0,$e.createElement)(We.Disabled,{isDisabled:!n},(0,$e.createElement)("video",{controls:p,poster:g,src:h,ref:c},(0,$e.createElement)(Dx,{tracks:v}))),b&&(0,$e.createElement)(We.Spinner,null),(!Ze.RichText.isEmpty(d)||n)&&(0,$e.createElement)(Ze.RichText,{tagName:"figcaption",className:(0,Ze.__experimentalGetElementClassName)("caption"),"aria-label":(0,je.__)("Video caption text"),placeholder:(0,je.__)("Add caption"),value:d,onChange:e=>a({caption:e}),inlineToolbar:!0,__unstableOnSplitAtEnd:()=>l((0,Ge.createBlock)((0,Ge.getDefaultBlockName)()))})))};const ow={from:[{type:"files",isMatch(e){return 1===e.length&&0===e[0].type.indexOf("video/")},transform(e){const t=e[0];return(0,Ge.createBlock)("core/video",{src:(0,xt.createBlobURL)(t)})}},{type:"shortcode",tag:"video",attributes:{src:{type:"string",shortcode:e=>{let{named:{src:t,mp4:n,m4v:o,webm:r,ogv:a,flv:l}}=e;return t||n||o||r||a||l}},poster:{type:"string",shortcode:e=>{let{named:{poster:t}}=e;return t}},loop:{type:"string",shortcode:e=>{let{named:{loop:t}}=e;return t}},autoplay:{type:"string",shortcode:e=>{let{named:{autoplay:t}}=e;return t}},preload:{type:"string",shortcode:e=>{let{named:{preload:t}}=e;return t}}}}]};var rw=ow;const aw={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:2,name:"core/video",title:"Video",category:"media",description:"Embed a video from your media library or upload a new one.",keywords:["movie"],textdomain:"default",attributes:{autoplay:{type:"boolean",source:"attribute",selector:"video",attribute:"autoplay"},caption:{type:"string",source:"html",selector:"figcaption",__experimentalRole:"content"},controls:{type:"boolean",source:"attribute",selector:"video",attribute:"controls",default:!0},id:{type:"number",__experimentalRole:"content"},loop:{type:"boolean",source:"attribute",selector:"video",attribute:"loop"},muted:{type:"boolean",source:"attribute",selector:"video",attribute:"muted"},poster:{type:"string",source:"attribute",selector:"video",attribute:"poster"},preload:{type:"string",source:"attribute",selector:"video",attribute:"preload",default:"metadata"},src:{type:"string",source:"attribute",selector:"video",attribute:"src",__experimentalRole:"content"},playsInline:{type:"boolean",source:"attribute",selector:"video",attribute:"playsinline"},tracks:{__experimentalRole:"content",type:"array",items:{type:"object"},default:[]}},supports:{anchor:!0,align:!0,spacing:{margin:!0,padding:!0}},editorStyle:"wp-block-video-editor",style:"wp-block-video"},{name:lw}=aw,iw={icon:Fx,example:{attributes:{src:"https://upload.wikimedia.org/wikipedia/commons/c/ca/Wood_thrush_in_Central_Park_switch_sides_%2816510%29.webm",caption:(0,je.__)("Wood thrush singing in Central Park, NYC.")}},transforms:rw,deprecated:Ux,edit:nw,save:function(e){let{attributes:t}=e;const{autoplay:n,caption:o,controls:r,loop:a,muted:l,poster:i,preload:s,src:c,playsInline:u,tracks:m}=t;return(0,$e.createElement)("figure",Ze.useBlockProps.save(),c&&(0,$e.createElement)("video",{autoPlay:n,controls:r,loop:a,muted:l,poster:i,preload:"metadata"!==s?s:void 0,src:c,playsInline:u},(0,$e.createElement)(Dx,{tracks:m})),!Ze.RichText.isEmpty(o)&&(0,$e.createElement)(Ze.RichText.Content,{className:(0,Ze.__experimentalGetElementClassName)("caption"),tagName:"figcaption",value:o}))}},sw=()=>qe({name:lw,metadata:aw,settings:iw});var cw=n(7078),uw=n.n(cw);const mw=()=>[Q,L,I,N,V,H,fe,e,r,a,l,i,s,...window.wp&&window.wp.oldEditor?[c]:[],u,m,d,g,S,B,T,P,M,R,A,D,G,$,W,Z,j,me,de,ke,we,Ee,Ce,Se,Pe,Ie,ze,Me,Re,He,Fe,De,U,O,q,Be,Ne,Te,pe,Ae,t,ue,ae,le,oe,K,Y,X,ee,ne,re,ce,ie,se,he,ve,be,_e,ge,xe,p,h,v,b,_,y,f,C,x,w,E,k,te,Le,z,F,Ve,ye,J].filter(Boolean).filter((e=>{let{metadata:t}=e;return!uw()(t)})),dw=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:mw();e.forEach((e=>{let{init:t}=e;return t()})),(0,Ge.setDefaultBlockName)(jg),window.wp&&window.wp.oldEditor&&(0,Ge.setFreeformContentHandlerName)(Kn),(0,Ge.setUnregisteredTypeHandlerName)(bd),(0,Ge.setGroupingBlockName)(yc)},pw=void 0}(),(window.wp=window.wp||{}).blockLibrary=o}();
\ No newline at end of file
diff --git a/wp-includes/js/dist/edit-post.js b/wp-includes/js/dist/edit-post.js
index d62b4e1cc2..d769817ba9 100644
--- a/wp-includes/js/dist/edit-post.js
+++ b/wp-includes/js/dist/edit-post.js
@@ -5896,6 +5896,9 @@ function DevicePreview() {
className: "edit-post-post-preview-dropdown",
deviceType: deviceType,
setDeviceType: setPreviewDeviceType
+ /* translators: button label text should, if possible, be under 16 characters. */
+ ,
+ viewLabel: (0,external_wp_i18n_namespaceObject.__)('Preview')
}, isViewable && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, null, (0,external_wp_element_namespaceObject.createElement)("div", {
className: "edit-post-header-preview__grouping-external"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_editor_namespaceObject.PostPreviewButton, {
diff --git a/wp-includes/js/dist/edit-post.min.js b/wp-includes/js/dist/edit-post.min.js
index 154ef69b3a..6c5fa55321 100644
--- a/wp-includes/js/dist/edit-post.min.js
+++ b/wp-includes/js/dist/edit-post.min.js
@@ -4,4 +4,4 @@
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
-*/!function(){"use strict";var l={}.hasOwnProperty;function o(){for(var e=[],t=0;t
m.MediaUpload));var g=window.lodash,h=window.wp.components,E=window.wp.blockEditor,_=window.wp.i18n,b=window.wp.compose;const f=(0,b.compose)((0,c.withSelect)(((e,t)=>{if((0,s.hasBlockSupport)(t.name,"multiple",!0))return{};const n=e(E.store).getBlocks(),l=(0,g.find)(n,(e=>{let{name:n}=e;return t.name===n}));return{originalBlockClientId:l&&l.clientId!==t.clientId&&l.clientId}})),(0,c.withDispatch)(((e,t)=>{let{originalBlockClientId:n}=t;return{selectFirst:()=>e(E.store).selectBlock(n)}}))),v=(0,b.createHigherOrderComponent)((e=>f((t=>{let{originalBlockClientId:n,selectFirst:l,...o}=t;if(!n)return(0,a.createElement)(e,o);const r=(0,s.getBlockType)(o.name),i=function(e){const t=(0,s.findTransform)((0,s.getBlockTransforms)("to",e),(e=>{let{type:t,blocks:n}=e;return"block"===t&&1===n.length}));if(!t)return null;return(0,s.getBlockType)(t.blocks[0])}(o.name);return[(0,a.createElement)("div",{key:"invalid-preview",style:{minHeight:"60px"}},(0,a.createElement)(e,p({key:"block-edit"},o))),(0,a.createElement)(E.Warning,{key:"multiple-use-warning",actions:[(0,a.createElement)(h.Button,{key:"find-original",variant:"secondary",onClick:l},(0,_.__)("Find original")),(0,a.createElement)(h.Button,{key:"remove",variant:"secondary",onClick:()=>o.onReplace([])},(0,_.__)("Remove")),i&&(0,a.createElement)(h.Button,{key:"transform",variant:"secondary",onClick:()=>o.onReplace((0,s.createBlock)(i.name,o.attributes))},(0,_.__)("Transform into:")," ",i.title)]},(0,a.createElement)("strong",null,null==r?void 0:r.title,": "),(0,_.__)("This block can only be used once."))]}))),"withMultipleValidation");(0,u.addFilter)("editor.BlockEdit","core/edit-post/validate-multiple-use/with-multiple-validation",v);var y=window.wp.primitives;var w=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.Path,{d:"M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"})),S=window.wp.plugins,k=window.wp.url,P=window.wp.notices,T=window.wp.editor;function C(){const{createNotice:e}=(0,c.useDispatch)(P.store),t=(0,c.useSelect)((e=>()=>e(T.store).getEditedPostAttribute("content")),[]);const n=(0,b.useCopyToClipboard)(t,(function(){e("info",(0,_.__)("All content copied."),{isDismissible:!0,type:"snackbar"})}));return(0,a.createElement)(h.MenuItem,{ref:n},(0,_.__)("Copy all blocks"))}var x=window.wp.keycodes;const B=(0,c.combineReducers)({isSaving:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"REQUEST_META_BOX_UPDATES":return!0;case"META_BOX_UPDATES_SUCCESS":case"META_BOX_UPDATES_FAILURE":return!1;default:return e}},locations:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"SET_META_BOXES_PER_LOCATIONS"===t.type?t.metaBoxesPerLocation:e},initialized:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"META_BOXES_INITIALIZED"===t.type||e}});var M=(0,c.combineReducers)({activeModal:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"OPEN_MODAL":return t.name;case"CLOSE_MODAL":return null}return e},metaBoxes:B,publishSidebarActive:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"OPEN_PUBLISH_SIDEBAR":return!0;case"CLOSE_PUBLISH_SIDEBAR":return!1;case"TOGGLE_PUBLISH_SIDEBAR":return!e}return e},removedPanels:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;if("REMOVE_PANEL"===t.type)if(!(0,g.includes)(e,t.panelName))return[...e,t.panelName];return e},deviceType:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Desktop",t=arguments.length>1?arguments[1]:void 0;return"SET_PREVIEW_DEVICE_TYPE"===t.type?t.deviceType:e},blockInserterPanel:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_IS_LIST_VIEW_OPENED":return!t.isOpen&&e;case"SET_IS_INSERTER_OPENED":return t.value}return e},listViewPanel:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_IS_INSERTER_OPENED":return!t.value&&e;case"SET_IS_LIST_VIEW_OPENED":return t.isOpen}return e},isEditingTemplate:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"SET_IS_EDITING_TEMPLATE"===t.type?t.value:e}}),I=window.wp.apiFetch,N=n.n(I),A=n(4403),L=n.n(A);var O=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));var D=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.Path,{d:"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"}));var R=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.Path,{fillRule:"evenodd",d:"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",clipRule:"evenodd"})),F=window.wp.viewport;var V=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"})),U=window.wp.deprecated,G=n.n(U);const H=(e,t)=>({type:"SET_DEFAULT_COMPLEMENTARY_AREA",scope:e,area:t}),z=(e,t)=>n=>{let{registry:l,dispatch:o}=n;if(!t)return;l.select(d.store).get(e,"isComplementaryAreaVisible")||l.dispatch(d.store).set(e,"isComplementaryAreaVisible",!0),o({type:"ENABLE_COMPLEMENTARY_AREA",scope:e,area:t})},$=e=>t=>{let{registry:n}=t;n.select(d.store).get(e,"isComplementaryAreaVisible")&&n.dispatch(d.store).set(e,"isComplementaryAreaVisible",!1)},W=(e,t)=>n=>{let{registry:l}=n;if(!t)return;const o=l.select(d.store).get(e,"pinnedItems");!0!==(null==o?void 0:o[t])&&l.dispatch(d.store).set(e,"pinnedItems",{...o,[t]:!0})},q=(e,t)=>n=>{let{registry:l}=n;if(!t)return;const o=l.select(d.store).get(e,"pinnedItems");l.dispatch(d.store).set(e,"pinnedItems",{...o,[t]:!1})};function j(e,t){return function(n){let{registry:l}=n;G()("dispatch( 'core/interface' ).toggleFeature",{since:"6.0",alternative:"dispatch( 'core/preferences' ).toggle"}),l.dispatch(d.store).toggle(e,t)}}function K(e,t,n){return function(l){let{registry:o}=l;G()("dispatch( 'core/interface' ).setFeatureValue",{since:"6.0",alternative:"dispatch( 'core/preferences' ).set"}),o.dispatch(d.store).set(e,t,!!n)}}function Y(e,t){return function(n){let{registry:l}=n;G()("dispatch( 'core/interface' ).setFeatureDefaults",{since:"6.0",alternative:"dispatch( 'core/preferences' ).setDefaults"}),l.dispatch(d.store).setDefaults(e,t)}}const X=(0,c.createRegistrySelector)((e=>(t,n)=>{var l;const o=e(d.store).get(n,"isComplementaryAreaVisible");if(void 0!==o)return o?null==t||null===(l=t.complementaryAreas)||void 0===l?void 0:l[n]:null})),Q=(0,c.createRegistrySelector)((e=>(t,n,l)=>{var o;const r=e(d.store).get(n,"pinnedItems");return null===(o=null==r?void 0:r[l])||void 0===o||o})),Z=(0,c.createRegistrySelector)((e=>(t,n,l)=>(G()("select( 'core/interface' ).isFeatureActive( scope, featureName )",{since:"6.0",alternative:"select( 'core/preferences' ).get( scope, featureName )"}),!!e(d.store).get(n,l))));var J=(0,c.combineReducers)({complementaryAreas:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_DEFAULT_COMPLEMENTARY_AREA":{const{scope:n,area:l}=t;return e[n]?e:{...e,[n]:l}}case"ENABLE_COMPLEMENTARY_AREA":{const{scope:n,area:l}=t;return{...e,[n]:l}}}return e}});const ee=(0,c.createReduxStore)("core/interface",{reducer:J,actions:e,selectors:t});(0,c.register)(ee);var te=(0,S.withPluginContext)(((e,t)=>({icon:t.icon||e.icon,identifier:t.identifier||`${e.name}/${t.name}`})));var ne=te((function(e){let{as:t=h.Button,scope:n,identifier:l,icon:o,selectedIcon:r,name:s,...i}=e;const u=t,d=(0,c.useSelect)((e=>e(ee).getActiveComplementaryArea(n)===l),[l]),{enableComplementaryArea:m,disableComplementaryArea:g}=(0,c.useDispatch)(ee);return(0,a.createElement)(u,p({icon:r&&d?r:o,onClick:()=>{d?g(n):m(n,l)}},i))}));var le=e=>{let{smallScreenTitle:t,children:n,className:l,toggleButtonProps:o}=e;const r=(0,a.createElement)(ne,p({icon:V},o));return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:"components-panel__header interface-complementary-area-header__small"},t&&(0,a.createElement)("span",{className:"interface-complementary-area-header__small-title"},t),r),(0,a.createElement)("div",{className:L()("components-panel__header","interface-complementary-area-header",l),tabIndex:-1},n,r))};const oe=()=>{};function re(e){let{name:t,as:n=h.Button,onClick:l,...o}=e;return(0,a.createElement)(h.Fill,{name:t},(e=>{let{onClick:t}=e;return(0,a.createElement)(n,p({onClick:l||t?function(){(l||oe)(...arguments),(t||oe)(...arguments)}:void 0},o))}))}re.Slot=function(e){let{name:t,as:n=h.ButtonGroup,fillProps:l={},bubblesVirtually:o,...r}=e;return(0,a.createElement)(h.Slot,{name:t,bubblesVirtually:o,fillProps:l},(e=>{if(!a.Children.toArray(e).length)return null;const t=[];a.Children.forEach(e,(e=>{let{props:{__unstableExplicitMenuItem:n,__unstableTarget:l}}=e;l&&n&&t.push(l)}));const l=a.Children.map(e,(e=>!e.props.__unstableExplicitMenuItem&&t.includes(e.props.__unstableTarget)?null:e));return(0,a.createElement)(n,r,l)}))};var ae=re;const se=e=>{let{__unstableExplicitMenuItem:t,__unstableTarget:n,...l}=e;return(0,a.createElement)(h.MenuItem,l)};function ie(e){let{scope:t,target:n,__unstableExplicitMenuItem:l,...o}=e;return(0,a.createElement)(ne,p({as:e=>(0,a.createElement)(ae,p({__unstableExplicitMenuItem:l,__unstableTarget:`${t}/${n}`,as:se,name:`${t}/plugin-more-menu`},e)),role:"menuitemcheckbox",selectedIcon:O,name:n,scope:t},o))}function ce(e){let{scope:t,...n}=e;return(0,a.createElement)(h.Fill,p({name:`PinnedItems/${t}`},n))}ce.Slot=function(e){let{scope:t,className:n,...l}=e;return(0,a.createElement)(h.Slot,p({name:`PinnedItems/${t}`},l),(e=>(null==e?void 0:e.length)>0&&(0,a.createElement)("div",{className:L()(n,"interface-pinned-items")},e)))};var ue=ce;function de(e){let{scope:t,children:n,className:l}=e;return(0,a.createElement)(h.Fill,{name:`ComplementaryArea/${t}`},(0,a.createElement)("div",{className:l},n))}const me=te((function(e){let{children:t,className:n,closeLabel:l=(0,_.__)("Close plugin"),identifier:o,header:r,headerClassName:s,icon:i,isPinnable:u=!0,panelClassName:d,scope:m,name:p,smallScreenTitle:g,title:E,toggleShortcut:b,isActiveByDefault:f,showIconLabels:v=!1}=e;const{isActive:y,isPinned:w,activeArea:S,isSmall:k,isLarge:P}=(0,c.useSelect)((e=>{const{getActiveComplementaryArea:t,isItemPinned:n}=e(ee),l=t(m);return{isActive:l===o,isPinned:n(m,o),activeArea:l,isSmall:e(F.store).isViewportMatch("< medium"),isLarge:e(F.store).isViewportMatch("large")}}),[o,m]);!function(e,t,n,l,o){const r=(0,a.useRef)(!1),s=(0,a.useRef)(!1),{enableComplementaryArea:i,disableComplementaryArea:u}=(0,c.useDispatch)(ee);(0,a.useEffect)((()=>{l&&o&&!r.current?(u(e),s.current=!0):s.current&&!o&&r.current?(s.current=!1,i(e,t)):s.current&&n&&n!==t&&(s.current=!1),o!==r.current&&(r.current=o)}),[l,o,e,t,n])}(m,o,S,y,k);const{enableComplementaryArea:T,disableComplementaryArea:C,pinItem:x,unpinItem:B}=(0,c.useDispatch)(ee);return(0,a.useEffect)((()=>{f&&void 0===S&&!k&&T(m,o)}),[S,f,m,o,k]),(0,a.createElement)(a.Fragment,null,u&&(0,a.createElement)(ue,{scope:m},w&&(0,a.createElement)(ne,{scope:m,identifier:o,isPressed:y&&(!v||P),"aria-expanded":y,label:E,icon:v?O:i,showTooltip:!v,variant:v?"tertiary":void 0})),p&&u&&(0,a.createElement)(ie,{target:p,scope:m,icon:i},E),y&&(0,a.createElement)(de,{className:L()("interface-complementary-area",n),scope:m},(0,a.createElement)(le,{className:s,closeLabel:l,onClose:()=>C(m),smallScreenTitle:g,toggleButtonProps:{label:l,shortcut:b,scope:m,identifier:o}},r||(0,a.createElement)(a.Fragment,null,(0,a.createElement)("strong",null,E),u&&(0,a.createElement)(h.Button,{className:"interface-complementary-area__pin-unpin-item",icon:w?D:R,label:w?(0,_.__)("Unpin from toolbar"):(0,_.__)("Pin to toolbar"),onClick:()=>(w?B:x)(m,o),isPressed:w,"aria-expanded":w}))),(0,a.createElement)(h.Panel,{className:d},t)))}));me.Slot=function(e){let{scope:t,...n}=e;return(0,a.createElement)(h.Slot,p({name:`ComplementaryArea/${t}`},n))};var pe=me;var ge=e=>{let{isActive:t}=e;return(0,a.useEffect)((()=>{let e=!1;return document.body.classList.contains("sticky-menu")&&(e=!0,document.body.classList.remove("sticky-menu")),()=>{e&&document.body.classList.add("sticky-menu")}}),[]),(0,a.useEffect)((()=>(t?document.body.classList.add("is-fullscreen-mode"):document.body.classList.remove("is-fullscreen-mode"),()=>{t&&document.body.classList.remove("is-fullscreen-mode")})),[t]),null};var he=(0,a.forwardRef)((function(e,t){let{footer:n,header:l,sidebar:o,secondarySidebar:r,notices:s,content:i,drawer:c,actions:u,labels:d,className:m,shortcuts:g}=e;const E=(0,h.__unstableUseNavigateRegions)(g);!function(e){(0,a.useEffect)((()=>{const t=document&&document.querySelector(`html:not(.${e})`);if(t)return t.classList.toggle(e),()=>{t.classList.toggle(e)}}),[e])}("interface-interface-skeleton__html-container");const f={...{drawer:(0,_.__)("Drawer"),header:(0,_.__)("Header"),body:(0,_.__)("Content"),secondarySidebar:(0,_.__)("Block Library"),sidebar:(0,_.__)("Settings"),actions:(0,_.__)("Publish"),footer:(0,_.__)("Footer")},...d};return(0,a.createElement)("div",p({},E,{ref:(0,b.useMergeRefs)([t,E.ref]),className:L()(m,"interface-interface-skeleton",E.className,!!n&&"has-footer")}),!!c&&(0,a.createElement)("div",{className:"interface-interface-skeleton__drawer",role:"region","aria-label":f.drawer,tabIndex:"-1"},c),(0,a.createElement)("div",{className:"interface-interface-skeleton__editor"},!!l&&(0,a.createElement)("div",{className:"interface-interface-skeleton__header",role:"region","aria-label":f.header,tabIndex:"-1"},l),(0,a.createElement)("div",{className:"interface-interface-skeleton__body"},!!r&&(0,a.createElement)("div",{className:"interface-interface-skeleton__secondary-sidebar",role:"region","aria-label":f.secondarySidebar,tabIndex:"-1"},r),!!s&&(0,a.createElement)("div",{className:"interface-interface-skeleton__notices"},s),(0,a.createElement)("div",{className:"interface-interface-skeleton__content",role:"region","aria-label":f.body,tabIndex:"-1"},i),!!o&&(0,a.createElement)("div",{className:"interface-interface-skeleton__sidebar",role:"region","aria-label":f.sidebar,tabIndex:"-1"},o),!!u&&(0,a.createElement)("div",{className:"interface-interface-skeleton__actions",role:"region","aria-label":f.actions,tabIndex:"-1"},u))),!!n&&(0,a.createElement)("div",{className:"interface-interface-skeleton__footer",role:"region","aria-label":f.footer,tabIndex:"-1"},n))}));var Ee=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));function _e(e){let{as:t=h.DropdownMenu,className:n,label:l=(0,_.__)("Options"),popoverProps:o,toggleProps:r,children:s}=e;return(0,a.createElement)(t,{className:L()("interface-more-menu-dropdown",n),icon:Ee,label:l,popoverProps:{position:"bottom left",...o,className:L()("interface-more-menu-dropdown__content",null==o?void 0:o.className)},toggleProps:{tooltipPosition:"bottom",...r}},(e=>s(e)))}function be(e){let{closeModal:t,children:n}=e;return(0,a.createElement)(h.Modal,{className:"interface-preferences-modal",title:(0,_.__)("Preferences"),closeLabel:(0,_.__)("Close"),onRequestClose:t},n)}var fe=function(e){let{icon:t,size:n=24,...l}=e;return(0,a.cloneElement)(t,{width:n,height:n,...l})};var ve=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));var ye=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));const we="preferences-menu";function Se(e){let{sections:t}=e;const n=(0,b.useViewportMatch)("medium"),[l,o]=(0,a.useState)(we),{tabs:r,sectionsContentMap:s}=(0,a.useMemo)((()=>{let e={tabs:[],sectionsContentMap:{}};return t.length&&(e=t.reduce(((e,t)=>{let{name:n,tabLabel:l,content:o}=t;return e.tabs.push({name:n,title:l}),e.sectionsContentMap[n]=o,e}),{tabs:[],sectionsContentMap:{}})),e}),[t]),i=(0,a.useCallback)((e=>s[e.name]||null),[s]);let c;return c=n?(0,a.createElement)(h.TabPanel,{className:"interface-preferences__tabs",tabs:r,initialTabName:l!==we?l:void 0,onSelect:o,orientation:"vertical"},i):(0,a.createElement)(h.__experimentalNavigatorProvider,{initialPath:"/",className:"interface-preferences__provider"},(0,a.createElement)(h.__experimentalNavigatorScreen,{path:"/"},(0,a.createElement)(h.Card,{isBorderless:!0,size:"small"},(0,a.createElement)(h.CardBody,null,(0,a.createElement)(h.__experimentalItemGroup,null,r.map((e=>(0,a.createElement)(h.__experimentalNavigatorButton,{key:e.name,path:e.name,as:h.__experimentalItem,isAction:!0},(0,a.createElement)(h.__experimentalHStack,{justify:"space-between"},(0,a.createElement)(h.FlexItem,null,(0,a.createElement)(h.__experimentalTruncate,null,e.title)),(0,a.createElement)(h.FlexItem,null,(0,a.createElement)(fe,{icon:(0,_.isRTL)()?ve:ye})))))))))),t.length&&t.map((e=>(0,a.createElement)(h.__experimentalNavigatorScreen,{key:`${e.name}-menu`,path:e.name},(0,a.createElement)(h.Card,{isBorderless:!0,size:"large"},(0,a.createElement)(h.CardHeader,{isBorderless:!1,justify:"left",size:"small",gap:"6"},(0,a.createElement)(h.__experimentalNavigatorBackButton,{icon:(0,_.isRTL)()?ye:ve,"aria-label":(0,_.__)("Navigate to the previous view")}),(0,a.createElement)(h.__experimentalText,{size:"16"},e.tabLabel)),(0,a.createElement)(h.CardBody,null,e.content)))))),c}var ke=e=>{let{description:t,title:n,children:l}=e;return(0,a.createElement)("fieldset",{className:"interface-preferences-modal__section"},(0,a.createElement)("legend",{className:"interface-preferences-modal__section-legend"},(0,a.createElement)("h2",{className:"interface-preferences-modal__section-title"},n),t&&(0,a.createElement)("p",{className:"interface-preferences-modal__section-description"},t)),l)};var Pe=function(e){let{help:t,label:n,isChecked:l,onChange:o,children:r}=e;return(0,a.createElement)("div",{className:"interface-preferences-modal__option"},(0,a.createElement)(h.ToggleControl,{__nextHasNoMarginBottom:!0,help:t,label:n,checked:l,onChange:o}),r)},Te=window.wp.a11y,Ce=window.wp.coreData;const xe=e=>t=>{let{registry:n}=t;return n.dispatch(ee).enableComplementaryArea(Rt.name,e)},Be=()=>e=>{let{registry:t}=e;return t.dispatch(ee).disableComplementaryArea(Rt.name)};function Me(e){return{type:"OPEN_MODAL",name:e}}function Ie(){return{type:"CLOSE_MODAL"}}function Ne(){return{type:"OPEN_PUBLISH_SIDEBAR"}}function Ae(){return{type:"CLOSE_PUBLISH_SIDEBAR"}}function Le(){return{type:"TOGGLE_PUBLISH_SIDEBAR"}}const Oe=e=>t=>{var n;let{registry:l}=t;const o=null!==(n=l.select(d.store).get("core/edit-post","inactivePanels"))&&void 0!==n?n:[];let r;r=!(null==o||!o.includes(e))?o.filter((t=>t!==e)):[...o,e],l.dispatch(d.store).set("core/edit-post","inactivePanels",r)},De=e=>t=>{var n;let{registry:l}=t;const o=null!==(n=l.select(d.store).get("core/edit-post","openPanels"))&&void 0!==n?n:[];let r;r=!(null==o||!o.includes(e))?o.filter((t=>t!==e)):[...o,e],l.dispatch(d.store).set("core/edit-post","openPanels",r)};function Re(e){return{type:"REMOVE_PANEL",panelName:e}}const Fe=e=>t=>{let{registry:n}=t;return n.dispatch(d.store).toggle("core/edit-post",e)},Ve=e=>t=>{let{registry:n}=t;n.dispatch(d.store).set("core/edit-post","editorMode",e),"visual"!==e&&n.dispatch(E.store).clearSelectedBlock();const l="visual"===e?(0,_.__)("Visual editor selected"):(0,_.__)("Code editor selected");(0,Te.speak)(l,"assertive")},Ue=e=>t=>{let{registry:n}=t;const l=n.select(ee).isItemPinned("core/edit-post",e);n.dispatch(ee)[l?"unpinItem":"pinItem"]("core/edit-post",e)},Ge=(e,t)=>n=>{var l;let{registry:o}=n;if(!e)return;const r=null!==(l=o.select(d.store).get("core/edit-post","preferredStyleVariations"))&&void 0!==l?l:{};if(t)o.dispatch(d.store).set("core/edit-post","preferredStyleVariations",{...r,[e]:t});else{const t={...r};delete t[e],o.dispatch(d.store).set("core/edit-post","preferredStyleVariations",t)}},He=e=>t=>{var n;let{registry:l}=t;const o=null!==(n=l.select(d.store).get("core/edit-post","hiddenBlockTypes"))&&void 0!==n?n:[],r=(0,g.without)(o,...(0,g.castArray)(e));l.dispatch(d.store).set("core/edit-post","hiddenBlockTypes",r)},ze=e=>t=>{var n;let{registry:l}=t;const o=null!==(n=l.select(d.store).get("core/edit-post","hiddenBlockTypes"))&&void 0!==n?n:[],r=new Set([...o,...(0,g.castArray)(e)]);l.dispatch(d.store).set("core/edit-post","hiddenBlockTypes",[...r])},$e=e=>t=>{let{dispatch:n}=t;return n({type:"SET_META_BOXES_PER_LOCATIONS",metaBoxesPerLocation:e})},We=()=>async e=>{let{registry:t,select:n,dispatch:l}=e;l({type:"REQUEST_META_BOX_UPDATES"}),window.tinyMCE&&window.tinyMCE.triggerSave();const o=t.select(T.store).getCurrentPost(),r=[!!o.comment_status&&["comment_status",o.comment_status],!!o.ping_status&&["ping_status",o.ping_status],!!o.sticky&&["sticky",o.sticky],!!o.author&&["post_author",o.author]].filter(Boolean),a=[new window.FormData(document.querySelector(".metabox-base-form")),...n.getActiveMetaBoxLocations().map((e=>new window.FormData((e=>document.querySelector(`.edit-post-meta-boxes-area.is-${e} .metabox-location-${e}`)||document.querySelector("#metaboxes .metabox-location-"+e))(e))))],s=(0,g.reduce)(a,((e,t)=>{for(const[n,l]of t)e.append(n,l);return e}),new window.FormData);r.forEach((e=>{let[t,n]=e;return s.append(t,n)}));try{await N()({url:window._wpMetaBoxUrl,method:"POST",body:s,parse:!1}),l.metaBoxUpdatesSuccess()}catch{l.metaBoxUpdatesFailure()}};function qe(){return{type:"META_BOX_UPDATES_SUCCESS"}}function je(){return{type:"META_BOX_UPDATES_FAILURE"}}function Ke(e){return{type:"SET_PREVIEW_DEVICE_TYPE",deviceType:e}}function Ye(e){return{type:"SET_IS_INSERTER_OPENED",value:e}}function Xe(e){return{type:"SET_IS_LIST_VIEW_OPENED",isOpen:e}}function Qe(e){return{type:"SET_IS_EDITING_TEMPLATE",value:e}}const Ze=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return t=>{let{registry:n,select:l,dispatch:o}=t;o(Qe(!0));if(!l.isFeatureActive("welcomeGuideTemplate")){const t=e?(0,_.__)("Custom template created. You're in template mode now."):(0,_.__)("Editing template. Changes made here affect all posts and pages that use the template.");n.dispatch(P.store).createSuccessNotice(t,{type:"snackbar"})}}},Je=e=>async t=>{let{registry:n}=t;const l=await n.dispatch(Ce.store).saveEntityRecord("postType","wp_template",e),o=n.select(T.store).getCurrentPost();n.dispatch(Ce.store).editEntityRecord("postType",o.type,o.id,{template:l.slug})};let et=!1;const tt=()=>e=>{let{registry:t,select:n,dispatch:l}=e;if(!t.select(T.store).__unstableIsEditorReady())return;if(et)return;const o=t.select(T.store).getCurrentPostType();window.postboxes.page!==o&&window.postboxes.add_postbox_toggles(o),et=!0;let r=t.select(T.store).isSavingPost(),a=t.select(T.store).isAutosavingPost();const s=n.hasMetaBoxes();t.subscribe((async()=>{const e=t.select(T.store).isSavingPost(),n=t.select(T.store).isAutosavingPost(),o=s&&r&&!e&&!a;r=e,a=n,o&&await l.requestMetaBoxUpdates()})),l({type:"META_BOXES_INITIALIZED"})};var nt={};function lt(e){return[e]}function ot(e,t,n){var l;if(e.length!==t.length)return!1;for(l=n;l()=>{var t;return null!==(t=e(d.store).get("core/edit-post","editorMode"))&&void 0!==t?t:"visual"})),ct=(0,c.createRegistrySelector)((e=>()=>{const t=e(ee).getActiveComplementaryArea("core/edit-post");return["edit-post/document","edit-post/block"].includes(t)})),ut=(0,c.createRegistrySelector)((e=>()=>{const t=e(ee).getActiveComplementaryArea("core/edit-post");return!!t&&!["edit-post/document","edit-post/block"].includes(t)})),dt=(0,c.createRegistrySelector)((e=>()=>e(ee).getActiveComplementaryArea("core/edit-post")));const mt=(0,c.createRegistrySelector)((e=>()=>{G()("select( 'core/edit-post' ).getPreferences",{since:"6.0",alternative:"select( 'core/preferences' ).get"});const t=["hiddenBlockTypes","editorMode","preferredStyleVariations"].reduce(((t,n)=>({...t,[n]:e(d.store).get("core/edit-post",n)})),{}),n=function(e,t){var n;const l=null==e?void 0:e.reduce(((e,t)=>({...e,[t]:{enabled:!1}})),{}),o=null==t?void 0:t.reduce(((e,t)=>{const n=null==e?void 0:e[t];return{...e,[t]:{...n,opened:!0}}}),null!=l?l:{});return null!==(n=null!=o?o:l)&&void 0!==n?n:st}(e(d.store).get("core/edit-post","inactivePanels"),e(d.store).get("core/edit-post","openPanels"));return{...t,panels:n}}));function pt(e,t,n){G()("select( 'core/edit-post' ).getPreference",{since:"6.0",alternative:"select( 'core/preferences' ).get"});const l=mt(e)[t];return void 0===l?n:l}const gt=(0,c.createRegistrySelector)((e=>()=>{var t;return null!==(t=e(d.store).get("core/edit-post","hiddenBlockTypes"))&&void 0!==t?t:at}));function ht(e){return e.publishSidebarActive}function Et(e,t){return e.removedPanels.includes(t)}const _t=(0,c.createRegistrySelector)((e=>(t,n)=>{const l=e(d.store).get("core/edit-post","inactivePanels");return!(Et(t,n)||null!=l&&l.includes(n))})),bt=(0,c.createRegistrySelector)((e=>(t,n)=>{const l=e(d.store).get("core/edit-post","openPanels");return!(null==l||!l.includes(n))}));function ft(e,t){return e.activeModal===t}const vt=(0,c.createRegistrySelector)((e=>(t,n)=>!!e(d.store).get("core/edit-post",n))),yt=(0,c.createRegistrySelector)((e=>(t,n)=>e(ee).isItemPinned("core/edit-post",n))),wt=rt((e=>Object.keys(e.metaBoxes.locations).filter((t=>kt(e,t)))),(e=>[e.metaBoxes.locations]));function St(e,t){var n;return kt(e,t)&&(null===(n=Pt(e,t))||void 0===n?void 0:n.some((t=>{let{id:n}=t;return _t(e,`meta-box-${n}`)})))}function kt(e,t){const n=Pt(e,t);return!!n&&0!==n.length}function Pt(e,t){return e.metaBoxes.locations[t]}const Tt=rt((e=>Object.values(e.metaBoxes.locations).flat()),(e=>[e.metaBoxes.locations]));function Ct(e){return wt(e).length>0}function xt(e){return e.metaBoxes.isSaving}function Bt(e){return e.deviceType}function Mt(e){return!!e.blockInserterPanel}function It(e){const{rootClientId:t,insertionIndex:n,filterValue:l}=e.blockInserterPanel;return{rootClientId:t,insertionIndex:n,filterValue:l}}function Nt(e){return e.listViewPanel}function At(e){return e.isEditingTemplate}function Lt(e){return e.metaBoxes.initialized}const Ot=(0,c.createRegistrySelector)((e=>()=>{const t=e(T.store).getEditedPostAttribute("template");if(t){var n;const l=null===(n=e(Ce.store).getEntityRecords("postType","wp_template",{per_page:-1}))||void 0===n?void 0:n.find((e=>e.slug===t));return l?e(Ce.store).getEditedEntityRecord("postType","wp_template",l.id):l}const l=e(T.store).getCurrentPost();return l.link?e(Ce.store).__experimentalGetTemplateForLink(l.link):null})),Dt="core/edit-post",Rt=(0,c.createReduxStore)(Dt,{reducer:M,actions:o,selectors:r});(0,c.register)(Rt);var Ft=(0,c.withDispatch)((e=>{const{openModal:t}=e(Rt);return{openModal:t}}))((function(e){let{openModal:t}=e;return(0,a.createElement)(h.MenuItem,{onClick:()=>{t("edit-post/keyboard-shortcut-help")},shortcut:x.displayShortcut.access("h")},(0,_.__)("Keyboard shortcuts"))}));const{Fill:Vt,Slot:Ut}=(0,h.createSlotFill)("ToolsMoreMenuGroup");Vt.Slot=e=>{let{fillProps:t}=e;return(0,a.createElement)(Ut,{fillProps:t},(e=>!(0,g.isEmpty)(e)&&(0,a.createElement)(h.MenuGroup,{label:(0,_.__)("Tools")},e)))};var Gt=Vt;function Ht(){const e=(0,c.useSelect)((e=>e(Rt).isEditingTemplate()),[]);return(0,a.createElement)(d.PreferenceToggleMenuItem,{scope:"core/edit-post",name:e?"welcomeGuideTemplate":"welcomeGuide",label:(0,_.__)("Welcome Guide")})}(0,S.registerPlugin)("edit-post",{render(){return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Gt,null,(e=>{let{onClose:t}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(h.MenuItem,{role:"menuitem",href:(0,k.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,_.__)("Manage Reusable blocks")),(0,a.createElement)(Ft,{onSelect:t}),(0,a.createElement)(Ht,null),(0,a.createElement)(C,null),(0,a.createElement)(h.MenuItem,{role:"menuitem",icon:w,href:(0,_.__)("https://wordpress.org/support/article/wordpress-editor/"),target:"_blank",rel:"noopener noreferrer"},(0,_.__)("Help"),(0,a.createElement)(h.VisuallyHidden,{as:"span"},(0,_.__)("(opens in a new tab)"))))})))}});var zt=window.wp.keyboardShortcuts;function $t(){const e=(0,c.useSelect)((e=>e(T.store).getEditorSettings().richEditingEnabled),[]),{switchEditorMode:t}=(0,c.useDispatch)(Rt);return(0,a.createElement)("div",{className:"edit-post-text-editor"},(0,a.createElement)(T.TextEditorGlobalKeyboardShortcuts,null),e&&(0,a.createElement)("div",{className:"edit-post-text-editor__toolbar"},(0,a.createElement)("h2",null,(0,_.__)("Editing code")),(0,a.createElement)(h.Button,{variant:"tertiary",onClick:()=>t("visual"),shortcut:x.displayShortcut.secondary("m")},(0,_.__)("Exit code editor"))),(0,a.createElement)("div",{className:"edit-post-text-editor__body"},(0,a.createElement)(T.PostTitle,null),(0,a.createElement)(T.PostTextEditor,null)))}var Wt=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.Path,{d:"M20 10.8H6.7l4.1-4.5-1.1-1.1-5.8 6.3 5.8 5.8 1.1-1.1-4-3.9H20z"}));const qt=()=>{};var jt=function(e){let{onClick:t=qt,small:n=!1}=e;const{shortcut:l,areAdvancedSettingsOpened:o}=(0,c.useSelect)((e=>({shortcut:e(zt.store).getShortcutRepresentation("core/edit-post/toggle-sidebar"),areAdvancedSettingsOpened:"edit-post/block"===e(Rt).getActiveGeneralSidebarName()})),[]),{openGeneralSidebar:r,closeGeneralSidebar:s}=(0,c.useDispatch)(Rt),i=o?(0,_.__)("Hide more settings"):(0,_.__)("Show more settings");return(0,a.createElement)(h.MenuItem,{onClick:()=>{o?(s(),(0,Te.speak)((0,_.__)("Block settings closed"))):(r("edit-post/block"),(0,Te.speak)((0,_.__)("Additional settings are now available in the Editor block settings sidebar"))),t()},shortcut:l},!n&&i)};function Kt(e){let{children:t,contentRef:n,shouldIframe:l,styles:o,assets:r,style:s}=e;const i=(0,E.__unstableUseMouseMoveTypingReset)();return l?(0,a.createElement)(E.__unstableIframe,{head:(0,a.createElement)(E.__unstableEditorStyles,{styles:o}),assets:r,ref:i,contentRef:n,style:{width:"100%",height:"100%",display:"block"},name:"editor-canvas"},t):(0,a.createElement)(a.Fragment,null,(0,a.createElement)(E.__unstableEditorStyles,{styles:o}),(0,a.createElement)(E.WritingFlow,{ref:n,className:"editor-styles-wrapper",style:{flex:"1",...s},tabIndex:-1},t))}function Yt(e){for(let t=0;t{const{isFeatureActive:t,isEditingTemplate:n,__experimentalGetPreviewDeviceType:l,getEditedPostTemplate:o}=e(Rt),{getCurrentPostId:r,getCurrentPostType:a,getEditorSettings:s}=e(T.store),i=n();let c;"wp_block"===a()?c="core/block":i||(c="core/post-content");const u=s().supportsTemplateMode;return{deviceType:l(),isWelcomeGuideVisible:t("welcomeGuide"),isTemplateMode:i,editedPostTemplate:u?o():{},wrapperBlockName:c,wrapperUniqueId:r()}}),[]),{isCleanNewPost:m}=(0,c.useSelect)(T.store),p=(0,c.useSelect)((e=>e(Rt).hasMetaBoxes()),[]),{themeHasDisabledLayoutStyles:g,themeSupportsLayout:f,assets:v}=(0,c.useSelect)((e=>{const t=e(E.store).getSettings();return{themeHasDisabledLayoutStyles:t.disableLayoutStyles,themeSupportsLayout:t.supportsLayout,assets:t.__unstableResolvedAssets}}),[]),{clearSelectedBlock:y}=(0,c.useDispatch)(E.store),{setIsEditingTemplate:w}=(0,c.useDispatch)(Rt),S={height:"100%",width:"100%",margin:0,display:"flex",flexFlow:"column",background:"white"},k={...S,borderRadius:"2px 2px 0 0",border:"1px solid #ddd",borderBottom:0},P=(0,E.__experimentalUseResizeCanvas)(l,r),C=(0,E.useSetting)("layout"),x="is-"+l.toLowerCase()+"-preview";let B,M=r?k:S;P&&(M=P),p||P||r||(B="40vh");const I=(0,a.useRef)(),N=(0,b.useMergeRefs)([I,(0,E.__unstableUseClipboardHandler)(),(0,E.__unstableUseTypewriter)(),(0,E.__unstableUseTypingObserver)(),(0,E.__unstableUseBlockSelectionClearer)()]),A=(0,E.__unstableUseBlockSelectionClearer)(),O=(0,a.useMemo)((()=>r?{type:"default"}:f?{...C,type:"constrained"}:{type:"default"}),[r,f,C]),D=(0,a.useMemo)((()=>{if(null!=i&&i.blocks)return Yt(null==i?void 0:i.blocks);const e="string"==typeof(null==i?void 0:i.content)?null==i?void 0:i.content:"";return Yt((0,s.parse)(e))||{}}),[null==i?void 0:i.content,null==i?void 0:i.blocks]),R=(0,E.__experimentaluseLayoutClasses)(D),F=L()({"is-layout-flow":!f},f&&R),V=(0,E.__experimentaluseLayoutStyles)(D,".block-editor-block-list__layout.is-root-container"),U=(null==D||null===(t=D.attributes)||void 0===t?void 0:t.layout)||{},G=(0,a.useMemo)((()=>U&&("constrained"===(null==U?void 0:U.type)||null!=U&&U.inherit||null!=U&&U.contentSize||null!=U&&U.wideSize)?{...C,...U,type:"constrained"}:{...C,...U,type:"default"}),[null==U?void 0:U.type,null==U?void 0:U.inherit,null==U?void 0:U.contentSize,null==U?void 0:U.wideSize,C]),H=D?G:O,z=(0,a.useRef)();return(0,a.useEffect)((()=>{var e;!o&&m()&&(null==z||null===(e=z.current)||void 0===e||e.focus())}),[o,m]),(0,a.createElement)(E.BlockTools,{__unstableContentRef:I,className:L()("edit-post-visual-editor",{"is-template-mode":r})},(0,a.createElement)(T.VisualEditorGlobalKeyboardShortcuts,null),(0,a.createElement)(h.__unstableMotion.div,{className:"edit-post-visual-editor__content-area",animate:{padding:r?"48px 48px 0":"0"},ref:A},r&&(0,a.createElement)(h.Button,{className:"edit-post-visual-editor__exit-template-mode",icon:Wt,onClick:()=>{y(),w(!1)}},(0,_.__)("Back")),(0,a.createElement)(h.__unstableMotion.div,{animate:M,initial:S,className:x},(0,a.createElement)(Kt,{shouldIframe:r||"Tablet"===l||"Mobile"===l,contentRef:N,styles:n,assets:v,style:{paddingBottom:B}},f&&!g&&!r&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(E.__experimentalLayoutStyle,{selector:".edit-post-visual-editor__post-title-wrapper, .block-editor-block-list__layout.is-root-container",layout:O,layoutDefinitions:null==C?void 0:C.definitions}),V&&(0,a.createElement)(E.__experimentalLayoutStyle,{layout:G,css:V,layoutDefinitions:null==C?void 0:C.definitions})),!r&&(0,a.createElement)("div",{className:"edit-post-visual-editor__post-title-wrapper",contentEditable:!1},(0,a.createElement)(T.PostTitle,{ref:z})),(0,a.createElement)(E.__experimentalRecursionProvider,{blockName:u,uniqueId:d},(0,a.createElement)(E.BlockList,{className:r?"wp-site-blocks":`${F} wp-block-post-content`,__experimentalLayout:H}))))),(0,a.createElement)(E.__unstableBlockSettingsMenuFirstItem,null,(e=>{let{onClose:t}=e;return(0,a.createElement)(jt,{onClick:t})})))}var Qt=function(){const{getBlockSelectionStart:e}=(0,c.useSelect)(E.store),{getEditorMode:t,isEditorSidebarOpened:n,isListViewOpened:l}=(0,c.useSelect)(Rt),o=(0,c.useSelect)((e=>{const{richEditingEnabled:t,codeEditingEnabled:n}=e(T.store).getEditorSettings();return!t||!n}),[]),{switchEditorMode:r,openGeneralSidebar:s,closeGeneralSidebar:i,toggleFeature:u,setIsListViewOpened:d}=(0,c.useDispatch)(Rt),{registerShortcut:m}=(0,c.useDispatch)(zt.store);return(0,a.useEffect)((()=>{m({name:"core/edit-post/toggle-mode",category:"global",description:(0,_.__)("Switch between visual editor and code editor."),keyCombination:{modifier:"secondary",character:"m"}}),m({name:"core/edit-post/toggle-fullscreen",category:"global",description:(0,_.__)("Toggle fullscreen mode."),keyCombination:{modifier:"secondary",character:"f"}}),m({name:"core/edit-post/toggle-list-view",category:"global",description:(0,_.__)("Open the block list view."),keyCombination:{modifier:"access",character:"o"}}),m({name:"core/edit-post/toggle-sidebar",category:"global",description:(0,_.__)("Show or hide the settings sidebar."),keyCombination:{modifier:"primaryShift",character:","}}),m({name:"core/edit-post/next-region",category:"global",description:(0,_.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),m({name:"core/edit-post/previous-region",category:"global",description:(0,_.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"}]}),m({name:"core/edit-post/keyboard-shortcuts",category:"main",description:(0,_.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}})}),[]),(0,zt.useShortcut)("core/edit-post/toggle-mode",(()=>{r("visual"===t()?"text":"visual")}),{isDisabled:o}),(0,zt.useShortcut)("core/edit-post/toggle-fullscreen",(()=>{u("fullscreenMode")})),(0,zt.useShortcut)("core/edit-post/toggle-sidebar",(t=>{if(t.preventDefault(),n())i();else{const t=e()?"edit-post/block":"edit-post/document";s(t)}})),(0,zt.useShortcut)("core/edit-post/toggle-list-view",(()=>d(!l()))),null};const Zt=[{keyCombination:{modifier:"primary",character:"b"},description:(0,_.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,_.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,_.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,_.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,_.__)("Insert a link to a post or page")},{keyCombination:{modifier:"primary",character:"u"},description:(0,_.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,_.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,_.__)("Make the selected text inline code.")}];function Jt(e){let{keyCombination:t,forceAriaLabel:n}=e;const l=t.modifier?x.displayShortcutList[t.modifier](t.character):t.character,o=t.modifier?x.shortcutAriaLabel[t.modifier](t.character):t.character;return(0,a.createElement)("kbd",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":n||o},(0,g.castArray)(l).map(((e,t)=>"+"===e?(0,a.createElement)(a.Fragment,{key:t},e):(0,a.createElement)("kbd",{key:t,className:"edit-post-keyboard-shortcut-help-modal__shortcut-key"},e))))}var en=function(e){let{description:t,keyCombination:n,aliases:l=[],ariaLabel:o}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-description"},t),(0,a.createElement)("div",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-term"},(0,a.createElement)(Jt,{keyCombination:n,forceAriaLabel:o}),l.map(((e,t)=>(0,a.createElement)(Jt,{keyCombination:e,forceAriaLabel:o,key:t})))))};var tn=function(e){let{name:t}=e;const{keyCombination:n,description:l,aliases:o}=(0,c.useSelect)((e=>{const{getShortcutKeyCombination:n,getShortcutDescription:l,getShortcutAliases:o}=e(zt.store);return{keyCombination:n(t),aliases:o(t),description:l(t)}}),[t]);return n?(0,a.createElement)(en,{keyCombination:n,description:l,aliases:o}):null};const nn="edit-post/keyboard-shortcut-help",ln=e=>{let{shortcuts:t}=e;return(0,a.createElement)("ul",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-list",role:"list"},t.map(((e,t)=>(0,a.createElement)("li",{className:"edit-post-keyboard-shortcut-help-modal__shortcut",key:t},"string"==typeof e?(0,a.createElement)(tn,{name:e}):(0,a.createElement)(en,e)))))},on=e=>{let{title:t,shortcuts:n,className:l}=e;return(0,a.createElement)("section",{className:L()("edit-post-keyboard-shortcut-help-modal__section",l)},!!t&&(0,a.createElement)("h2",{className:"edit-post-keyboard-shortcut-help-modal__section-title"},t),(0,a.createElement)(ln,{shortcuts:n}))},rn=e=>{let{title:t,categoryName:n,additionalShortcuts:l=[]}=e;const o=(0,c.useSelect)((e=>e(zt.store).getCategoryShortcuts(n)),[n]);return(0,a.createElement)(on,{title:t,shortcuts:o.concat(l)})};var an=(0,b.compose)([(0,c.withSelect)((e=>({isModalActive:e(Rt).isModalActive(nn)}))),(0,c.withDispatch)(((e,t)=>{let{isModalActive:n}=t;const{openModal:l,closeModal:o}=e(Rt);return{toggleModal:()=>n?o():l(nn)}}))])((function(e){let{isModalActive:t,toggleModal:n}=e;return(0,zt.useShortcut)("core/edit-post/keyboard-shortcuts",n),t?(0,a.createElement)(h.Modal,{className:"edit-post-keyboard-shortcut-help-modal",title:(0,_.__)("Keyboard shortcuts"),closeLabel:(0,_.__)("Close"),onRequestClose:n},(0,a.createElement)(on,{className:"edit-post-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/edit-post/keyboard-shortcuts"]}),(0,a.createElement)(rn,{title:(0,_.__)("Global shortcuts"),categoryName:"global"}),(0,a.createElement)(rn,{title:(0,_.__)("Selection shortcuts"),categoryName:"selection"}),(0,a.createElement)(rn,{title:(0,_.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,_.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,_.__)("Forward-slash")}]}),(0,a.createElement)(on,{title:(0,_.__)("Text formatting"),shortcuts:Zt})):null}));function sn(e){let{willEnable:t}=e;const[n,l]=(0,a.useState)(!1);return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("p",{className:"edit-post-preferences-modal__custom-fields-confirmation-message"},(0,_.__)("A page reload is required for this change. Make sure your content is saved before reloading.")),(0,a.createElement)(h.Button,{className:"edit-post-preferences-modal__custom-fields-confirmation-button",variant:"secondary",isBusy:n,disabled:n,onClick:()=>{l(!0),document.getElementById("toggle-custom-fields-form").submit()}},t?(0,_.__)("Enable & Reload"):(0,_.__)("Disable & Reload")))}var cn=(0,c.withSelect)((e=>({areCustomFieldsEnabled:!!e(T.store).getEditorSettings().enableCustomFields})))((function(e){let{label:t,areCustomFieldsEnabled:n}=e;const[l,o]=(0,a.useState)(n);return(0,a.createElement)(Pe,{label:t,isChecked:l,onChange:o},l!==n&&(0,a.createElement)(sn,{willEnable:l}))})),un=(0,b.compose)((0,c.withSelect)(((e,t)=>{let{panelName:n}=t;const{isEditorPanelEnabled:l,isEditorPanelRemoved:o}=e(Rt);return{isRemoved:o(n),isChecked:l(n)}})),(0,b.ifCondition)((e=>{let{isRemoved:t}=e;return!t})),(0,c.withDispatch)(((e,t)=>{let{panelName:n}=t;return{onChange:()=>e(Rt).toggleEditorPanelEnabled(n)}})))(Pe);const{Fill:dn,Slot:mn}=(0,h.createSlotFill)("EnablePluginDocumentSettingPanelOption"),pn=e=>{let{label:t,panelName:n}=e;return(0,a.createElement)(dn,null,(0,a.createElement)(un,{label:t,panelName:n}))};pn.Slot=mn;var gn=pn,hn=(0,b.compose)((0,c.withSelect)((e=>({isChecked:e(T.store).isPublishSidebarEnabled()}))),(0,c.withDispatch)((e=>{const{enablePublishSidebar:t,disablePublishSidebar:n}=e(T.store);return{onChange:e=>e?t():n()}})),(0,F.ifViewportMatches)("medium"))(Pe),En=(0,b.compose)((0,c.withSelect)(((e,t)=>{let{featureName:n}=t;const{isFeatureActive:l}=e(Rt);return{isChecked:l(n)}})),(0,c.withDispatch)(((e,t)=>{let{featureName:n}=t;return{onChange:()=>e(Rt).toggleFeature(n)}})))(Pe);var _n=(0,c.withSelect)((e=>{const{getEditorSettings:t}=e(T.store),{getAllMetaBoxes:n}=e(Rt);return{areCustomFieldsRegistered:void 0!==t().enableCustomFields,metaBoxes:n()}}))((function(e){let{areCustomFieldsRegistered:t,metaBoxes:n,...l}=e;const o=(0,g.filter)(n,(e=>{let{id:t}=e;return"postcustom"!==t}));return t||0!==o.length?(0,a.createElement)(ke,l,t&&(0,a.createElement)(cn,{label:(0,_.__)("Custom fields")}),(0,g.map)(o,(e=>{let{id:t,title:n}=e;return(0,a.createElement)(un,{key:t,label:n,panelName:`meta-box-${t}`})}))):null}));var bn=function(e){let{blockTypes:t,value:n,onItemChange:l}=e;return(0,a.createElement)("ul",{className:"edit-post-block-manager__checklist"},t.map((e=>(0,a.createElement)("li",{key:e.name,className:"edit-post-block-manager__checklist-item"},(0,a.createElement)(h.CheckboxControl,{label:(0,a.createElement)(a.Fragment,null,e.title,(0,a.createElement)(E.BlockIcon,{icon:e.icon})),checked:n.includes(e.name),onChange:function(){for(var t=arguments.length,n=new Array(t),o=0;o{const{getEditorSettings:t}=e(T.store),{getHiddenBlockTypes:n}=e(Rt);return{defaultAllowedBlockTypes:t().defaultAllowedBlockTypes,hiddenBlockTypes:n()}}),[]),i=(0,a.useMemo)((()=>!0===r?l:l.filter((e=>{let{name:t}=e;return(0,g.includes)(r||[],t)}))),[r,l]),{showBlockTypes:u,hideBlockTypes:d}=(0,c.useDispatch)(Rt),m=(0,a.useCallback)(((e,t)=>{t?u(e):d(e)}),[]),p=(0,a.useCallback)((e=>{const t=(0,g.map)(l,"name");e?u(t):d(t)}),[l]);if(!i.length)return null;const E=(0,g.without)((0,g.map)(i,"name"),...s),_="edit-post-block-manager__category-title-"+o,f=E.length===i.length;let v;return v=f?"true":E.length>0?"mixed":"false",(0,a.createElement)("div",{role:"group","aria-labelledby":_,className:"edit-post-block-manager__category"},(0,a.createElement)(h.CheckboxControl,{checked:f,onChange:p,className:"edit-post-block-manager__category-title","aria-checked":v,label:(0,a.createElement)("span",{id:_},n)}),(0,a.createElement)(bn,{blockTypes:i,value:E,onItemChange:m}))};var vn=(0,c.withSelect)((e=>{const{getBlockTypes:t,getCategories:n,hasBlockSupport:l,isMatchingSearchTerm:o}=e(s.store),{getHiddenBlockTypes:r}=e(Rt),a=t(),i=r().filter((e=>a.some((t=>t.name===e)))),c=Array.isArray(i)&&i.length;return{blockTypes:a,categories:n(),hasBlockSupport:l,isMatchingSearchTerm:o,numberOfHiddenBlocks:c}}))((function(e){let{blockTypes:t,categories:n,hasBlockSupport:l,isMatchingSearchTerm:o,numberOfHiddenBlocks:r}=e;const s=(0,b.useDebounce)(Te.speak,500),[i,c]=(0,a.useState)("");return t=t.filter((e=>l(e,"inserter",!0)&&(!i||o(e,i))&&(!e.parent||(0,g.includes)(e.parent,"core/post-content")))),(0,a.useEffect)((()=>{if(!i)return;const e=t.length,n=(0,_.sprintf)((0,_._n)("%d result found.","%d results found.",e),e);s(n)}),[t.length,i,s]),(0,a.createElement)("div",{className:"edit-post-block-manager__content"},!!r&&(0,a.createElement)("div",{className:"edit-post-block-manager__disabled-blocks-count"},(0,_.sprintf)((0,_._n)("%d block is hidden.","%d blocks are hidden.",r),r)),(0,a.createElement)(h.SearchControl,{label:(0,_.__)("Search for a block"),placeholder:(0,_.__)("Search for a block"),value:i,onChange:e=>c(e),className:"edit-post-block-manager__search"}),(0,a.createElement)("div",{tabIndex:"0",role:"region","aria-label":(0,_.__)("Available block types"),className:"edit-post-block-manager__results"},0===t.length&&(0,a.createElement)("p",{className:"edit-post-block-manager__no-results"},(0,_.__)("No blocks found.")),n.map((e=>(0,a.createElement)(fn,{key:e.slug,title:e.title,blockTypes:(0,g.filter)(t,{category:e.slug})}))),(0,a.createElement)(fn,{title:(0,_.__)("Uncategorized"),blockTypes:(0,g.filter)(t,(e=>{let{category:t}=e;return!t}))})))}));function yn(){const e=(0,b.useViewportMatch)("medium"),{closeModal:t}=(0,c.useDispatch)(Rt),n=(0,c.useSelect)((e=>e(Rt).isModalActive("edit-post/preferences")),[]),l=(0,c.useSelect)((t=>{const{getEditorSettings:n}=t(T.store),{getEditorMode:l,isFeatureActive:o}=t(Rt),r=l(),a=n().richEditingEnabled;return!o("reducedUI")&&e&&a&&"visual"===r}),[e]),o=(0,a.useMemo)((()=>[{name:"general",tabLabel:(0,_.__)("General"),content:(0,a.createElement)(a.Fragment,null,e&&(0,a.createElement)(ke,{title:(0,_.__)("Publishing"),description:(0,_.__)("Change options related to publishing.")},(0,a.createElement)(hn,{help:(0,_.__)("Review settings, such as visibility and tags."),label:(0,_.__)("Include pre-publish checklist")})),(0,a.createElement)(ke,{title:(0,_.__)("Appearance"),description:(0,_.__)("Customize options related to the block editor interface and editing flow.")},(0,a.createElement)(En,{featureName:"focusMode",help:(0,_.__)("Highlights the current block and fades other content."),label:(0,_.__)("Spotlight mode")}),(0,a.createElement)(En,{featureName:"showIconLabels",label:(0,_.__)("Show button text labels"),help:(0,_.__)("Show text instead of icons on buttons.")}),(0,a.createElement)(En,{featureName:"showListViewByDefault",help:(0,_.__)("Opens the block list view sidebar by default."),label:(0,_.__)("Always open list view")}),(0,a.createElement)(En,{featureName:"reducedUI",help:(0,_.__)("Compacts options and outlines in the toolbar."),label:(0,_.__)("Reduce the interface")}),(0,a.createElement)(En,{featureName:"themeStyles",help:(0,_.__)("Make the editor look like your theme."),label:(0,_.__)("Use theme styles")}),l&&(0,a.createElement)(En,{featureName:"showBlockBreadcrumbs",help:(0,_.__)("Shows block breadcrumbs at the bottom of the editor."),label:(0,_.__)("Display block breadcrumbs")})))},{name:"blocks",tabLabel:(0,_.__)("Blocks"),content:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(ke,{title:(0,_.__)("Block interactions"),description:(0,_.__)("Customize how you interact with blocks in the block library and editing canvas.")},(0,a.createElement)(En,{featureName:"mostUsedBlocks",help:(0,_.__)("Places the most frequent blocks in the block library."),label:(0,_.__)("Show most used blocks")}),(0,a.createElement)(En,{featureName:"keepCaretInsideBlock",help:(0,_.__)("Aids screen readers by stopping text caret from leaving blocks."),label:(0,_.__)("Contain text cursor inside block")})),(0,a.createElement)(ke,{title:(0,_.__)("Visible blocks"),description:(0,_.__)("Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.")},(0,a.createElement)(vn,null)))},{name:"panels",tabLabel:(0,_.__)("Panels"),content:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(ke,{title:(0,_.__)("Document settings"),description:(0,_.__)("Choose what displays in the panel.")},(0,a.createElement)(gn.Slot,null),(0,a.createElement)(T.PostTaxonomies,{taxonomyWrapper:(e,t)=>(0,a.createElement)(un,{label:(0,g.get)(t,["labels","menu_name"]),panelName:`taxonomy-panel-${t.slug}`})}),(0,a.createElement)(T.PostFeaturedImageCheck,null,(0,a.createElement)(un,{label:(0,_.__)("Featured image"),panelName:"featured-image"})),(0,a.createElement)(T.PostExcerptCheck,null,(0,a.createElement)(un,{label:(0,_.__)("Excerpt"),panelName:"post-excerpt"})),(0,a.createElement)(T.PostTypeSupportCheck,{supportKeys:["comments","trackbacks"]},(0,a.createElement)(un,{label:(0,_.__)("Discussion"),panelName:"discussion-panel"})),(0,a.createElement)(T.PageAttributesCheck,null,(0,a.createElement)(un,{label:(0,_.__)("Page attributes"),panelName:"page-attributes"}))),(0,a.createElement)(_n,{title:(0,_.__)("Additional"),description:(0,_.__)("Add extra areas to the editor.")}))}]),[e,l]);return n?(0,a.createElement)(be,{closeModal:t},(0,a.createElement)(Se,{sections:o})):null}class wn extends a.Component{constructor(){super(...arguments),this.state={historyId:null}}componentDidUpdate(e){const{postId:t,postStatus:n,postType:l,isSavingPost:o}=this.props,{historyId:r}=this.state;"trash"!==n||o?t===e.postId&&t===r||"auto-draft"===n||!t||this.setBrowserURL(t):this.setTrashURL(t,l)}setTrashURL(e,t){window.location.href=function(e,t){return(0,k.addQueryArgs)("edit.php",{trashed:1,post_type:t,ids:e})}(e,t)}setBrowserURL(e){window.history.replaceState({id:e},"Post "+e,function(e){return(0,k.addQueryArgs)("post.php",{post:e,action:"edit"})}(e)),this.setState((()=>({historyId:e})))}render(){return null}}var Sn=(0,c.withSelect)((e=>{const{getCurrentPost:t,isSavingPost:n}=e(T.store),l=t();let{id:o,status:r,type:a}=l;return["wp_template","wp_template_part"].includes(a)&&(o=l.wp_id),{postId:o,postStatus:r,postType:a,isSavingPost:n()}}))(wn);var kn=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,a.createElement)(y.Path,{d:"M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"}));var Pn=function(e){let{showTooltip:t,icon:n,href:l}=e;const{isActive:o,isRequestingSiteIcon:r,postType:s,siteIconUrl:i}=(0,c.useSelect)((e=>{const{getCurrentPostType:t}=e(T.store),{isFeatureActive:n}=e(Rt),{getEntityRecord:l,getPostType:o,isResolving:r}=e(Ce.store),a=l("root","__unstableBase",void 0)||{};return{isActive:n("fullscreenMode"),isRequestingSiteIcon:r("getEntityRecord",["root","__unstableBase",void 0]),postType:o(t()),siteIconUrl:a.site_icon_url}}),[]),u=(0,b.useReducedMotion)();if(!o||!s)return null;let d=(0,a.createElement)(h.Icon,{size:"36px",icon:kn});const m={expand:{scale:1.25,transition:{type:"tween",duration:"0.3"}}};i&&(d=(0,a.createElement)(h.__unstableMotion.img,{variants:!u&&m,alt:(0,_.__)("Site Icon"),className:"edit-post-fullscreen-mode-close_site-icon",src:i})),r&&(d=null),n&&(d=(0,a.createElement)(h.Icon,{size:"36px",icon:n}));const p=L()({"edit-post-fullscreen-mode-close":!0,"has-icon":i});return(0,a.createElement)(h.__unstableMotion.div,{whileHover:"expand"},(0,a.createElement)(h.Button,{className:p,href:null!=l?l:(0,k.addQueryArgs)("edit.php",{post_type:s.slug}),label:(0,g.get)(s,["labels","view_items"],(0,_.__)("Back")),showTooltip:t},d))};var Tn=(0,a.createElement)(y.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(y.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));var Cn=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));const xn=e=>{e.preventDefault()};var Bn=function(){const e=(0,a.useRef)(),{setIsInserterOpened:t,setIsListViewOpened:n}=(0,c.useDispatch)(Rt),{isInserterEnabled:l,isInserterOpened:o,isTextModeEnabled:r,showIconLabels:s,isListViewOpen:i,listViewShortcut:u}=(0,c.useSelect)((e=>{const{hasInserterItems:t,getBlockRootClientId:n,getBlockSelectionEnd:l}=e(E.store),{getEditorSettings:o}=e(T.store),{getEditorMode:r,isFeatureActive:a,isListViewOpened:s}=e(Rt),{getShortcutRepresentation:i}=e(zt.store);return{isInserterEnabled:"visual"===r()&&o().richEditingEnabled&&t(n(l())),isInserterOpened:e(Rt).isInserterOpened(),isTextModeEnabled:"text"===r(),showIconLabels:a("showIconLabels"),isListViewOpen:s(),listViewShortcut:i("core/edit-post/toggle-list-view")}}),[]),d=(0,b.useViewportMatch)("medium"),m=(0,b.useViewportMatch)("wide"),p=(0,_.__)("Document tools"),g=(0,a.useCallback)((()=>n(!i)),[n,i]),f=(0,a.createElement)(a.Fragment,null,(0,a.createElement)(h.ToolbarItem,{as:T.TableOfContents,hasOutlineItemsDisabled:r,repositionDropdown:s&&!m,showTooltip:!s,variant:s?"tertiary":void 0}),(0,a.createElement)(h.ToolbarItem,{as:h.Button,className:"edit-post-header-toolbar__list-view-toggle",icon:Tn,disabled:r,isPressed:i,label:(0,_.__)("List View"),onClick:g,shortcut:u,showTooltip:!s,variant:s?"tertiary":void 0})),v=(0,a.useCallback)((()=>{o?e.current.focus():t(!0)}),[o,t]),y=(0,_._x)("Toggle block inserter","Generic label for block inserter button"),w=o?(0,_.__)("Close"):(0,_.__)("Add");return(0,a.createElement)(E.NavigableToolbar,{className:"edit-post-header-toolbar","aria-label":p},(0,a.createElement)("div",{className:"edit-post-header-toolbar__left"},(0,a.createElement)(h.ToolbarItem,{ref:e,as:h.Button,className:"edit-post-header-toolbar__inserter-toggle",variant:"primary",isPressed:o,onMouseDown:xn,onClick:v,disabled:!l,icon:Cn,label:s?w:y,showTooltip:!s}),(m||!s)&&(0,a.createElement)(a.Fragment,null,d&&(0,a.createElement)(h.ToolbarItem,{as:E.ToolSelector,showTooltip:!s,variant:s?"tertiary":void 0,disabled:r}),(0,a.createElement)(h.ToolbarItem,{as:T.EditorHistoryUndo,showTooltip:!s,variant:s?"tertiary":void 0}),(0,a.createElement)(h.ToolbarItem,{as:T.EditorHistoryRedo,showTooltip:!s,variant:s?"tertiary":void 0}),f)))};const Mn=[{value:"visual",label:(0,_.__)("Visual editor")},{value:"text",label:(0,_.__)("Code editor")}];var In=function(){const{shortcut:e,isRichEditingEnabled:t,isCodeEditingEnabled:n,isEditingTemplate:l,mode:o}=(0,c.useSelect)((e=>({shortcut:e(zt.store).getShortcutRepresentation("core/edit-post/toggle-mode"),isRichEditingEnabled:e(T.store).getEditorSettings().richEditingEnabled,isCodeEditingEnabled:e(T.store).getEditorSettings().codeEditingEnabled,isEditingTemplate:e(Rt).isEditingTemplate(),mode:e(Rt).getEditorMode()})),[]),{switchEditorMode:r}=(0,c.useDispatch)(Rt);if(l)return null;if(!t||!n)return null;const s=Mn.map((t=>t.value!==o?{...t,shortcut:e}:t));return(0,a.createElement)(h.MenuGroup,{label:(0,_.__)("Editor")},(0,a.createElement)(h.MenuItemsChoice,{choices:s,value:o,onSelect:r}))};function Nn(){const{openModal:e}=(0,c.useDispatch)(Rt);return(0,a.createElement)(h.MenuItem,{onClick:()=>{e("edit-post/preferences")}},(0,_.__)("Preferences"))}var An=function(){return(0,b.useViewportMatch)("medium")?(0,a.createElement)(h.MenuGroup,{label:(0,_._x)("View","noun")},(0,a.createElement)(d.PreferenceToggleMenuItem,{scope:"core/edit-post",name:"fixedToolbar",label:(0,_.__)("Top toolbar"),info:(0,_.__)("Access all block and document tools in a single place"),messageActivated:(0,_.__)("Top toolbar activated"),messageDeactivated:(0,_.__)("Top toolbar deactivated")}),(0,a.createElement)(d.PreferenceToggleMenuItem,{scope:"core/edit-post",name:"focusMode",label:(0,_.__)("Spotlight mode"),info:(0,_.__)("Focus on one block at a time"),messageActivated:(0,_.__)("Spotlight mode activated"),messageDeactivated:(0,_.__)("Spotlight mode deactivated")}),(0,a.createElement)(d.PreferenceToggleMenuItem,{scope:"core/edit-post",name:"fullscreenMode",label:(0,_.__)("Fullscreen mode"),info:(0,_.__)("Work without distraction"),messageActivated:(0,_.__)("Fullscreen mode activated"),messageDeactivated:(0,_.__)("Fullscreen mode deactivated"),shortcut:x.displayShortcut.secondary("f")})):null};var Ln=e=>{let{showIconLabels:t}=e;const n=(0,b.useViewportMatch)("large");return(0,a.createElement)(_e,{toggleProps:{showTooltip:!t,...t&&{variant:"tertiary"}}},(e=>{let{onClose:l}=e;return(0,a.createElement)(a.Fragment,null,t&&!n&&(0,a.createElement)(ue.Slot,{className:t&&"show-icon-labels",scope:"core/edit-post"}),(0,a.createElement)(An,null),(0,a.createElement)(In,null),(0,a.createElement)(ae.Slot,{name:"core/edit-post/plugin-more-menu",label:(0,_.__)("Plugins"),as:h.MenuGroup,fillProps:{onClick:l}}),(0,a.createElement)(Gt.Slot,{fillProps:{onClose:l}}),(0,a.createElement)(h.MenuGroup,null,(0,a.createElement)(Nn,null)))}))};var On=(0,b.compose)((0,c.withSelect)((e=>({hasPublishAction:(0,g.get)(e(T.store).getCurrentPost(),["_links","wp:action-publish"],!1),isBeingScheduled:e(T.store).isEditedPostBeingScheduled(),isPending:e(T.store).isCurrentPostPending(),isPublished:e(T.store).isCurrentPostPublished(),isPublishSidebarEnabled:e(T.store).isPublishSidebarEnabled(),isPublishSidebarOpened:e(Rt).isPublishSidebarOpened(),isScheduled:e(T.store).isCurrentPostScheduled()}))),(0,c.withDispatch)((e=>{const{togglePublishSidebar:t}=e(Rt);return{togglePublishSidebar:t}})))((function(e){let{forceIsDirty:t,forceIsSaving:n,hasPublishAction:l,isBeingScheduled:o,isPending:r,isPublished:s,isPublishSidebarEnabled:i,isPublishSidebarOpened:c,isScheduled:u,togglePublishSidebar:d,setEntitiesSavedStatesCallback:m}=e;const p="toggle",g="button",h=(0,b.useViewportMatch)("medium","<");let E;return E=s||u&&o||r&&!l&&!h?g:h||i?p:g,(0,a.createElement)(T.PostPublishButton,{forceIsDirty:t,forceIsSaving:n,isOpen:c,isToggle:E===p,onToggle:d,setEntitiesSavedStatesCallback:m})}));function Dn(){const{hasActiveMetaboxes:e,isPostSaveable:t,isSaving:n,isViewable:l,deviceType:o}=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t}=e(T.store),{getPostType:n}=e(Ce.store),l=n(t("type"));return{hasActiveMetaboxes:e(Rt).hasMetaBoxes(),isSaving:e(Rt).isSavingMetaBoxes(),isPostSaveable:e(T.store).isEditedPostSaveable(),isViewable:(0,g.get)(l,["viewable"],!1),deviceType:e(Rt).__experimentalGetPreviewDeviceType()}}),[]),{__experimentalSetPreviewDeviceType:r}=(0,c.useDispatch)(Rt);return(0,a.createElement)(E.__experimentalPreviewOptions,{isEnabled:t,className:"edit-post-post-preview-dropdown",deviceType:o,setDeviceType:r},l&&(0,a.createElement)(h.MenuGroup,null,(0,a.createElement)("div",{className:"edit-post-header-preview__grouping-external"},(0,a.createElement)(T.PostPreviewButton,{className:"edit-post-header-preview__button-external",role:"menuitem",forceIsAutosaveable:e,forcePreviewLink:n?null:void 0,textContent:(0,a.createElement)(a.Fragment,null,(0,_.__)("Preview in new tab"),(0,a.createElement)(h.Icon,{icon:w}))}))))}const Rn="__experimentalMainDashboardButton",{Fill:Fn,Slot:Vn}=(0,h.createSlotFill)(Rn),Un=Fn;Un.Slot=e=>{let{children:t}=e;const n=(0,h.__experimentalUseSlot)(Rn);return Boolean(n.fills&&n.fills.length)?(0,a.createElement)(Vn,{bubblesVirtually:!0}):t};var Gn=Un;var Hn=(0,a.createElement)(y.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(y.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));function zn(){const{clearSelectedBlock:e}=(0,c.useDispatch)(E.store),{setIsEditingTemplate:t}=(0,c.useDispatch)(Rt),{getEditorSettings:n}=(0,c.useSelect)(T.store),{updateEditorSettings:l,editPost:o}=(0,c.useDispatch)(T.store),{deleteEntityRecord:r}=(0,c.useDispatch)(Ce.store),{template:s}=(0,c.useSelect)((e=>{const{isEditingTemplate:t,getEditedPostTemplate:n}=e(Rt);return{template:t()?n():null}}),[]),[i,u]=(0,a.useState)(!1);if(!s||!s.wp_id)return null;let d=s.slug;null!=s&&s.title&&(d=s.title);const m=null==s?void 0:s.has_theme_file;return(0,a.createElement)(h.MenuGroup,{className:"edit-post-template-top-area__second-menu-group"},(0,a.createElement)(a.Fragment,null,(0,a.createElement)(h.MenuItem,{className:"edit-post-template-top-area__delete-template-button",isDestructive:!m,onClick:()=>{u(!0)},info:m?(0,_.__)("Use the template as supplied by the theme."):void 0},m?(0,_.__)("Clear customizations"):(0,_.__)("Delete template")),(0,a.createElement)(h.__experimentalConfirmDialog,{isOpen:i,onConfirm:()=>{e(),t(!1),u(!1),o({template:""});const a=n(),i=(0,g.pickBy)(a.availableTemplates,((e,t)=>t!==s.slug));l({...a,availableTemplates:i}),r("postType","wp_template",s.id,{throwOnError:!0})},onCancel:()=>{u(!1)}},(0,_.sprintf)((0,_.__)("Are you sure you want to delete the %s template? It may be used by other pages or posts."),d))))}function $n(){const[e,t]=(0,a.useState)(!1),{template:n}=(0,c.useSelect)((e=>{const{getEditedPostTemplate:t}=e(Rt);return{template:t()}}),[]),{editEntityRecord:l}=(0,c.useDispatch)(Ce.store),{getEditorSettings:o}=(0,c.useSelect)(T.store),{updateEditorSettings:r}=(0,c.useDispatch)(T.store);if(!n.is_custom||n.has_theme_file)return null;let s=(0,_.__)("Default");return null!=n&&n.title?s=n.title:n&&(s=n.slug),(0,a.createElement)("div",{className:"edit-site-template-details__group"},(0,a.createElement)(h.TextControl,{label:(0,_.__)("Title"),value:e?"":s,help:(0,_.__)('Give the template a title that indicates its purpose, e.g. "Full Width".'),onChange:a=>{if(!a&&!e)return void t(!0);t(!1);const s=o(),i=(0,g.mapValues)(s.availableTemplates,((e,t)=>t!==n.slug?e:a));r({...s,availableTemplates:i}),l("postType","wp_template",n.id,{title:a})},onBlur:()=>t(!1)}))}function Wn(){const{description:e,title:t}=(0,c.useSelect)((e=>{const{getEditedPostTemplate:t}=e(Rt);return{title:t().title,description:t().description}}),[]);return e?(0,a.createElement)("div",{className:"edit-site-template-details__group"},(0,a.createElement)(h.__experimentalHeading,{level:4,weight:600},t),(0,a.createElement)(h.__experimentalText,{className:"edit-post-template-details__description",size:"body",as:"p",style:{marginTop:"12px"}},e)):null}var qn=function(){const{template:e,isEditing:t,title:n}=(0,c.useSelect)((e=>{const{isEditingTemplate:t,getEditedPostTemplate:n}=e(Rt),{getEditedPostAttribute:l}=e(T.store),o=t();return{template:o?n():null,isEditing:o,title:l("title")?l("title"):(0,_.__)("Untitled")}}),[]),{clearSelectedBlock:l}=(0,c.useDispatch)(E.store),{setIsEditingTemplate:o}=(0,c.useDispatch)(Rt);if(!t||!e)return null;let r=(0,_.__)("Default");null!=e&&e.title?r=e.title:e&&(r=e.slug);const s=!!(e.custom||e.wp_id||e.description);return(0,a.createElement)("div",{className:"edit-post-template-top-area"},(0,a.createElement)(h.Button,{className:"edit-post-template-post-title",isLink:!0,showTooltip:!0,label:(0,_.sprintf)((0,_.__)("Edit %s"),n),onClick:()=>{l(),o(!1)}},n),s?(0,a.createElement)(h.Dropdown,{position:"bottom center",contentClassName:"edit-post-template-top-area__popover",renderToggle:e=>{let{onToggle:t}=e;return(0,a.createElement)(h.Button,{className:"edit-post-template-title",isLink:!0,icon:Hn,showTooltip:!0,onClick:t,label:(0,_.__)("Template Options")},r)},renderContent:()=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)($n,null),(0,a.createElement)(Wn,null),(0,a.createElement)(zn,null))}):(0,a.createElement)(h.__experimentalText,{className:"edit-post-template-title",size:"body",style:{lineHeight:"24px"}},r))};var jn=function(e){let{setEntitiesSavedStatesCallback:t}=e;const{hasActiveMetaboxes:n,isPublishSidebarOpened:l,isSaving:o,showIconLabels:r,hasReducedUI:s}=(0,c.useSelect)((e=>({hasActiveMetaboxes:e(Rt).hasMetaBoxes(),isPublishSidebarOpened:e(Rt).isPublishSidebarOpened(),isSaving:e(Rt).isSavingMetaBoxes(),showIconLabels:e(Rt).isFeatureActive("showIconLabels"),hasReducedUI:e(Rt).isFeatureActive("reducedUI")})),[]),i=(0,b.useViewportMatch)("large"),u=L()("edit-post-header",{"has-reduced-ui":s});return(0,a.createElement)("div",{className:u},(0,a.createElement)(Gn.Slot,null,(0,a.createElement)(Pn,{showTooltip:!0})),(0,a.createElement)("div",{className:"edit-post-header__toolbar"},(0,a.createElement)(Bn,null),(0,a.createElement)(qn,null)),(0,a.createElement)("div",{className:"edit-post-header__settings"},!l&&(0,a.createElement)(T.PostSavedState,{forceIsDirty:n,forceIsSaving:o,showIconLabels:r}),(0,a.createElement)(Dn,null),(0,a.createElement)(T.PostPreviewButton,{forceIsAutosaveable:n,forcePreviewLink:o?null:void 0}),(0,a.createElement)(On,{forceIsDirty:n,forceIsSaving:o,setEntitiesSavedStatesCallback:t}),(i||!r)&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(ue.Slot,{scope:"core/edit-post"}),(0,a.createElement)(Ln,{showIconLabels:r})),r&&!i&&(0,a.createElement)(Ln,{showIconLabels:r})))};var Kn=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.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"}));function Yn(){const{insertionPoint:e,showMostUsedBlocks:t}=(0,c.useSelect)((e=>{const{isFeatureActive:t,__experimentalGetInsertionPoint:n}=e(Rt);return{insertionPoint:n(),showMostUsedBlocks:t("mostUsedBlocks")}}),[]),{setIsInserterOpened:n}=(0,c.useDispatch)(Rt),l=(0,b.useViewportMatch)("medium","<"),o=l?"div":h.VisuallyHidden,[r,s]=(0,b.__experimentalUseDialog)({onClose:()=>n(!1),focusOnMount:null}),i=(0,a.useRef)();return(0,a.useEffect)((()=>{i.current.focusSearch()}),[]),(0,a.createElement)("div",p({ref:r},s,{className:"edit-post-editor__inserter-panel"}),(0,a.createElement)(o,{className:"edit-post-editor__inserter-panel-header"},(0,a.createElement)(h.Button,{icon:Kn,label:(0,_.__)("Close block inserter"),onClick:()=>n(!1)})),(0,a.createElement)("div",{className:"edit-post-editor__inserter-panel-content"},(0,a.createElement)(E.__experimentalLibrary,{showMostUsedBlocks:t,showInserterHelpPanel:!0,shouldFocusBlock:l,rootClientId:e.rootClientId,__experimentalInsertionIndex:e.insertionIndex,__experimentalFilterValue:e.filterValue,ref:i})))}function Xn(){const{setIsListViewOpened:e}=(0,c.useDispatch)(Rt),t=(0,b.useFocusOnMount)("firstElement"),n=(0,b.useFocusReturn)(),l=(0,b.useFocusReturn)();const o=`edit-post-editor__list-view-panel-label-${(0,b.useInstanceId)(Xn)}`;return(0,a.createElement)("div",{"aria-labelledby":o,className:"edit-post-editor__list-view-panel",onKeyDown:function(t){t.keyCode!==x.ESCAPE||t.defaultPrevented||(t.preventDefault(),e(!1))}},(0,a.createElement)("div",{className:"edit-post-editor__list-view-panel-header",ref:n},(0,a.createElement)("strong",{id:o},(0,_.__)("List View")),(0,a.createElement)(h.Button,{icon:V,label:(0,_.__)("Close List View Sidebar"),onClick:()=>e(!1)})),(0,a.createElement)("div",{className:"edit-post-editor__list-view-panel-content",ref:(0,b.useMergeRefs)([l,t])},(0,a.createElement)(E.__experimentalListView,null)))}var Qn=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.Path,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"}));var Zn=e=>{let{sidebarName:t}=e;const{openGeneralSidebar:n}=(0,c.useDispatch)(Rt),l=()=>n("edit-post/document"),{documentLabel:o,isTemplateMode:r}=(0,c.useSelect)((e=>({documentLabel:e(T.store).getPostTypeLabel()||(0,_._x)("Document","noun"),isTemplateMode:e(Rt).isEditingTemplate()})),[]),[s,i]="edit-post/document"===t?[(0,_.sprintf)((0,_.__)("%s (selected)"),o),"is-active"]:[o,""],[u,d]="edit-post/block"===t?[(0,_.__)("Block (selected)"),"is-active"]:[(0,_.__)("Block"),""],[m,p]="edit-post/document"===t?[(0,_.__)("Template (selected)"),"is-active"]:[(0,_.__)("Template"),""];return(0,a.createElement)("ul",null,!r&&(0,a.createElement)("li",null,(0,a.createElement)(h.Button,{onClick:l,className:`edit-post-sidebar__panel-tab ${i}`,"aria-label":s,"data-label":o},o)),r&&(0,a.createElement)("li",null,(0,a.createElement)(h.Button,{onClick:l,className:`edit-post-sidebar__panel-tab ${p}`,"aria-label":m,"data-label":(0,_.__)("Template")},(0,_.__)("Template"))),(0,a.createElement)("li",null,(0,a.createElement)(h.Button,{onClick:()=>n("edit-post/block"),className:`edit-post-sidebar__panel-tab ${d}`,"aria-label":u,"data-label":(0,_.__)("Block")},(0,_.__)("Block"))))};function Jn(e){let{isOpen:t,onClick:n}=e;const l=(0,T.usePostVisibilityLabel)();return(0,a.createElement)(h.Button,{className:"edit-post-post-visibility__toggle",variant:"tertiary","aria-expanded":t,"aria-label":(0,_.sprintf)((0,_.__)("Select visibility: %s"),l),onClick:n},l)}var el=function(){const[e,t]=(0,a.useState)(null),n=(0,a.useMemo)((()=>({anchor:e})),[e]);return(0,a.createElement)(T.PostVisibilityCheck,{render:e=>{let{canEdit:l}=e;return(0,a.createElement)(h.PanelRow,{ref:t,className:"edit-post-post-visibility"},(0,a.createElement)("span",null,(0,_.__)("Visibility")),!l&&(0,a.createElement)("span",null,(0,a.createElement)(T.PostVisibilityLabel,null)),l&&(0,a.createElement)(h.Dropdown,{position:"bottom left",contentClassName:"edit-post-post-visibility__dialog",popoverProps:n,focusOnMount:!0,renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,a.createElement)(Jn,{isOpen:t,onClick:n})},renderContent:e=>{let{onClose:t}=e;return(0,a.createElement)(T.PostVisibility,{onClose:t})}}))}})};function tl(){return(0,a.createElement)(T.PostTrashCheck,null,(0,a.createElement)(h.PanelRow,null,(0,a.createElement)(T.PostTrash,null)))}function nl(){const[e,t]=(0,a.useState)(null),n=(0,a.useMemo)((()=>({anchor:e})),[e]);return(0,a.createElement)(T.PostScheduleCheck,null,(0,a.createElement)(h.PanelRow,{className:"edit-post-post-schedule",ref:t},(0,a.createElement)("span",null,(0,_.__)("Publish")),(0,a.createElement)(h.Dropdown,{popoverProps:n,position:"bottom left",contentClassName:"edit-post-post-schedule__dialog",focusOnMount:!0,renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,a.createElement)(ll,{isOpen:t,onClick:n})},renderContent:e=>{let{onClose:t}=e;return(0,a.createElement)(T.PostSchedule,{onClose:t})}})))}function ll(e){let{isOpen:t,onClick:n}=e;const l=(0,T.usePostScheduleLabel)(),o=(0,T.usePostScheduleLabel)({full:!0});return(0,a.createElement)(h.Button,{className:"edit-post-post-schedule__toggle",variant:"tertiary",label:o,showTooltip:!0,"aria-expanded":t,"aria-label":(0,_.sprintf)((0,_.__)("Change date: %s"),l),onClick:n},l)}var ol=function(){return(0,a.createElement)(T.PostStickyCheck,null,(0,a.createElement)(h.PanelRow,null,(0,a.createElement)(T.PostSticky,null)))};var rl=function(){return(0,a.createElement)(T.PostAuthorCheck,null,(0,a.createElement)(h.PanelRow,{className:"edit-post-post-author"},(0,a.createElement)(T.PostAuthor,null)))};var al=function(){return(0,a.createElement)(T.PostSlugCheck,null,(0,a.createElement)(h.PanelRow,{className:"edit-post-post-slug"},(0,a.createElement)(T.PostSlug,null)))};var sl=function(){return(0,a.createElement)(T.PostFormatCheck,null,(0,a.createElement)(h.PanelRow,{className:"edit-post-post-format"},(0,a.createElement)(T.PostFormat,null)))};var il=function(){return(0,a.createElement)(T.PostPendingStatusCheck,null,(0,a.createElement)(h.PanelRow,null,(0,a.createElement)(T.PostPendingStatus,null)))};const{Fill:cl,Slot:ul}=(0,h.createSlotFill)("PluginPostStatusInfo"),dl=e=>{let{children:t,className:n}=e;return(0,a.createElement)(cl,null,(0,a.createElement)(h.PanelRow,{className:n},t))};dl.Slot=ul;var ml=dl;var pl=(0,a.createElement)(y.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(y.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18.5 5.5V8H20V5.5H22.5V4H20V1.5H18.5V4H16V5.5H18.5ZM13.9624 4H6C4.89543 4 4 4.89543 4 6V18C4 19.1046 4.89543 20 6 20H18C19.1046 20 20 19.1046 20 18V10.0391H18.5V18C18.5 18.2761 18.2761 18.5 18 18.5H10L10 10.4917L16.4589 10.5139L16.4641 9.01389L5.5 8.97618V6C5.5 5.72386 5.72386 5.5 6 5.5H13.9624V4ZM5.5 10.4762V18C5.5 18.2761 5.72386 18.5 6 18.5H8.5L8.5 10.4865L5.5 10.4762Z"}));const gl=(0,_.__)("Custom Template");function hl(e){let{onClose:t}=e;const n=(0,c.useSelect)((e=>e(T.store).getEditorSettings().defaultBlockTemplate),[]),{__unstableCreateTemplate:l,__unstableSwitchToTemplateMode:o}=(0,c.useDispatch)(Rt),[r,i]=(0,a.useState)(""),[u,d]=(0,a.useState)(!1),m=()=>{i(""),t()};return(0,a.createElement)(h.Modal,{title:(0,_.__)("Create custom template"),closeLabel:(0,_.__)("Close"),onRequestClose:m,className:"edit-post-post-template__create-modal"},(0,a.createElement)("form",{className:"edit-post-post-template__create-form",onSubmit:async e=>{if(e.preventDefault(),u)return;d(!0);const t=null!=n?n:(0,s.serialize)([(0,s.createBlock)("core/group",{tagName:"header",layout:{inherit:!0}},[(0,s.createBlock)("core/site-title"),(0,s.createBlock)("core/site-tagline")]),(0,s.createBlock)("core/separator"),(0,s.createBlock)("core/group",{tagName:"main"},[(0,s.createBlock)("core/group",{layout:{inherit:!0}},[(0,s.createBlock)("core/post-title")]),(0,s.createBlock)("core/post-content",{layout:{inherit:!0}})])]);await l({slug:(0,k.cleanForSlug)(r||gl),content:t,title:r||gl}),d(!1),m(),o(!0)}},(0,a.createElement)(h.Flex,{align:"flex-start",gap:8},(0,a.createElement)(h.FlexItem,null,(0,a.createElement)(h.TextControl,{label:(0,_.__)("Name"),value:r,onChange:i,placeholder:gl,disabled:u,help:(0,_.__)('Describe the template, e.g. "Post with sidebar". Custom templates can be applied to any post or page.')}))),(0,a.createElement)(h.Flex,{justify:"flex-end",expanded:!1},(0,a.createElement)(h.FlexItem,null,(0,a.createElement)(h.Button,{variant:"tertiary",onClick:m},(0,_.__)("Cancel"))),(0,a.createElement)(h.FlexItem,null,(0,a.createElement)(h.Button,{variant:"primary",type:"submit",isBusy:u,"aria-disabled":u},(0,_.__)("Create"))))))}function El(e){var t,n;let{onClose:l}=e;const{isPostsPage:o,availableTemplates:r,fetchedTemplates:s,selectedTemplateSlug:i,canCreate:u,canEdit:d}=(0,c.useSelect)((e=>{const{canUser:t,getEntityRecord:n,getEntityRecords:l}=e(Ce.store),o=e(T.store).getEditorSettings(),r=t("read","settings")?n("root","site"):void 0,a=e(T.store).getCurrentPostId()===(null==r?void 0:r.page_for_posts),s=t("create","templates");return{isPostsPage:a,availableTemplates:o.availableTemplates,fetchedTemplates:s?l("postType","wp_template",{post_type:e(T.store).getCurrentPostType(),per_page:-1}):void 0,selectedTemplateSlug:e(T.store).getEditedPostAttribute("template"),canCreate:s&&!a&&o.supportsTemplateMode,canEdit:s&&o.supportsTemplateMode&&!!e(Rt).getEditedPostTemplate()}}),[]),m=(0,a.useMemo)((()=>Object.entries({...r,...Object.fromEntries((null!=s?s:[]).map((e=>{let{slug:t,title:n}=e;return[t,n.rendered]})))}).map((e=>{let[t,n]=e;return{value:t,label:n}}))),[r,s]),p=null!==(t=m.find((e=>e.value===i)))&&void 0!==t?t:m.find((e=>!e.value)),{editPost:g}=(0,c.useDispatch)(T.store),{__unstableSwitchToTemplateMode:b}=(0,c.useDispatch)(Rt),[f,v]=(0,a.useState)(!1);return(0,a.createElement)("div",{className:"edit-post-post-template__form"},(0,a.createElement)(E.__experimentalInspectorPopoverHeader,{title:(0,_.__)("Template"),help:(0,_.__)("Templates define the way content is displayed when viewing your site."),actions:u?[{icon:pl,label:(0,_.__)("Add template"),onClick:()=>v(!0)}]:[],onClose:l}),o?(0,a.createElement)(h.Notice,{className:"edit-post-post-template__notice",status:"warning",isDismissible:!1},(0,_.__)("The posts page template cannot be changed.")):(0,a.createElement)(h.SelectControl,{hideLabelFromVision:!0,label:(0,_.__)("Template"),value:null!==(n=null==p?void 0:p.value)&&void 0!==n?n:"",options:m,onChange:e=>g({template:e||""})}),d&&(0,a.createElement)("p",null,(0,a.createElement)(h.Button,{variant:"link",onClick:()=>b()},(0,_.__)("Edit template"))),f&&(0,a.createElement)(hl,{onClose:()=>v(!1)}))}function _l(){const[e,t]=(0,a.useState)(null),n=(0,a.useMemo)((()=>({anchor:e})),[e]);return(0,c.useSelect)((e=>{var t;const n=e(T.store).getCurrentPostType(),l=e(Ce.store).getPostType(n);if(null==l||!l.viewable)return!1;const o=e(T.store).getEditorSettings();if(!!o.availableTemplates&&Object.keys(o.availableTemplates).length>0)return!0;if(!o.supportsTemplateMode)return!1;return null!==(t=e(Ce.store).canUser("create","templates"))&&void 0!==t&&t}),[])?(0,a.createElement)(h.PanelRow,{className:"edit-post-post-template",ref:t},(0,a.createElement)("span",null,(0,_.__)("Template")),(0,a.createElement)(h.Dropdown,{popoverProps:n,position:"bottom left",className:"edit-post-post-template__dropdown",contentClassName:"edit-post-post-template__dialog",focusOnMount:!0,renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,a.createElement)(bl,{isOpen:t,onClick:n})},renderContent:e=>{let{onClose:t}=e;return(0,a.createElement)(El,{onClose:t})}})):null}function bl(e){let{isOpen:t,onClick:n}=e;const l=(0,c.useSelect)((e=>{var t;const n=e(T.store).getEditedPostAttribute("template"),{supportsTemplateMode:l,availableTemplates:o}=e(T.store).getEditorSettings();if(!l&&o[n])return o[n];const r=e(Rt).getEditedPostTemplate();return null!==(t=null==r?void 0:r.title)&&void 0!==t?t:null==r?void 0:r.slug}),[]);return(0,a.createElement)(h.Button,{className:"edit-post-post-template__toggle",variant:"tertiary","aria-expanded":t,"aria-label":l?(0,_.sprintf)((0,_.__)("Select template: %s"),l):(0,_.__)("Select template"),onClick:n},null!=l?l:(0,_.__)("Default template"))}function fl(){const[e,t]=(0,a.useState)(null),n=(0,a.useMemo)((()=>({anchor:e})),[e]);return(0,a.createElement)(T.PostURLCheck,null,(0,a.createElement)(h.PanelRow,{className:"edit-post-post-url",ref:t},(0,a.createElement)("span",null,(0,_.__)("URL")),(0,a.createElement)(h.Dropdown,{popoverProps:n,position:"bottom left",className:"edit-post-post-url__dropdown",contentClassName:"edit-post-post-url__dialog",focusOnMount:!0,renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,a.createElement)(vl,{isOpen:t,onClick:n})},renderContent:e=>{let{onClose:t}=e;return(0,a.createElement)(T.PostURL,{onClose:t})}})))}function vl(e){let{isOpen:t,onClick:n}=e;const l=(0,T.usePostURLLabel)();return(0,a.createElement)(h.Button,{className:"edit-post-post-url__toggle",variant:"tertiary","aria-expanded":t,"aria-label":(0,_.sprintf)((0,_.__)("Change URL: %s"),l),onClick:n},l)}const yl="post-status";var wl=(0,b.compose)([(0,c.withSelect)((e=>{const{isEditorPanelRemoved:t,isEditorPanelOpened:n}=e(Rt);return{isRemoved:t(yl),isOpened:n(yl)}})),(0,b.ifCondition)((e=>{let{isRemoved:t}=e;return!t})),(0,c.withDispatch)((e=>({onTogglePanel(){return e(Rt).toggleEditorPanelOpened(yl)}})))])((function(e){let{isOpened:t,onTogglePanel:n}=e;return(0,a.createElement)(h.PanelBody,{className:"edit-post-post-status",title:(0,_.__)("Summary"),opened:t,onToggle:n},(0,a.createElement)(ml.Slot,null,(e=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)(el,null),(0,a.createElement)(nl,null),(0,a.createElement)(fl,null),(0,a.createElement)(_l,null),(0,a.createElement)(ol,null),(0,a.createElement)(il,null),(0,a.createElement)(sl,null),(0,a.createElement)(al,null),(0,a.createElement)(rl,null),e,(0,a.createElement)(tl,null)))))}));var Sl=function(){return(0,a.createElement)(T.PostLastRevisionCheck,null,(0,a.createElement)(h.PanelBody,{className:"edit-post-last-revision__panel"},(0,a.createElement)(T.PostLastRevision,null)))};var kl=(0,b.compose)((0,c.withSelect)(((e,t)=>{const n=(0,g.get)(t.taxonomy,["slug"]),l=n?`taxonomy-panel-${n}`:"";return{panelName:l,isEnabled:!!n&&e(Rt).isEditorPanelEnabled(l),isOpened:!!n&&e(Rt).isEditorPanelOpened(l)}})),(0,c.withDispatch)(((e,t)=>({onTogglePanel:()=>{e(Rt).toggleEditorPanelOpened(t.panelName)}}))))((function(e){let{isEnabled:t,taxonomy:n,isOpened:l,onTogglePanel:o,children:r}=e;if(!t)return null;const s=(0,g.get)(n,["labels","menu_name"]);return s?(0,a.createElement)(h.PanelBody,{title:s,opened:l,onToggle:o},r):null}));var Pl=function(){return(0,a.createElement)(T.PostTaxonomiesCheck,null,(0,a.createElement)(T.PostTaxonomies,{taxonomyWrapper:(e,t)=>(0,a.createElement)(kl,{taxonomy:t},e)}))};const Tl="featured-image";const Cl=(0,c.withSelect)((e=>{const{getEditedPostAttribute:t}=e(T.store),{getPostType:n}=e(Ce.store),{isEditorPanelEnabled:l,isEditorPanelOpened:o}=e(Rt);return{postType:n(t("type")),isEnabled:l(Tl),isOpened:o(Tl)}})),xl=(0,c.withDispatch)((e=>{const{toggleEditorPanelOpened:t}=e(Rt);return{onTogglePanel:function(){for(var e=arguments.length,n=new Array(e),l=0;l({isEnabled:e(Rt).isEditorPanelEnabled(Ml),isOpened:e(Rt).isEditorPanelOpened(Ml)}))),(0,c.withDispatch)((e=>({onTogglePanel(){return e(Rt).toggleEditorPanelOpened(Ml)}})))])((function(e){let{isEnabled:t,isOpened:n,onTogglePanel:l}=e;return t?(0,a.createElement)(T.PostExcerptCheck,null,(0,a.createElement)(h.PanelBody,{title:(0,_.__)("Excerpt"),opened:n,onToggle:l},(0,a.createElement)(T.PostExcerpt,null))):null}));const Nl="discussion-panel";var Al=(0,b.compose)([(0,c.withSelect)((e=>({isEnabled:e(Rt).isEditorPanelEnabled(Nl),isOpened:e(Rt).isEditorPanelOpened(Nl)}))),(0,c.withDispatch)((e=>({onTogglePanel(){return e(Rt).toggleEditorPanelOpened(Nl)}})))])((function(e){let{isEnabled:t,isOpened:n,onTogglePanel:l}=e;return t?(0,a.createElement)(T.PostTypeSupportCheck,{supportKeys:["comments","trackbacks"]},(0,a.createElement)(h.PanelBody,{title:(0,_.__)("Discussion"),opened:n,onToggle:l},(0,a.createElement)(T.PostTypeSupportCheck,{supportKeys:"comments"},(0,a.createElement)(h.PanelRow,null,(0,a.createElement)(T.PostComments,null))),(0,a.createElement)(T.PostTypeSupportCheck,{supportKeys:"trackbacks"},(0,a.createElement)(h.PanelRow,null,(0,a.createElement)(T.PostPingbacks,null))))):null}));const Ll="page-attributes";var Ol=function(){const{isEnabled:e,isOpened:t,postType:n}=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t}=e(T.store),{isEditorPanelEnabled:n,isEditorPanelOpened:l}=e(Rt),{getPostType:o}=e(Ce.store);return{isEnabled:n(Ll),isOpened:l(Ll),postType:o(t("type"))}}),[]),{toggleEditorPanelOpened:l}=(0,c.useDispatch)(Rt);return e&&n?(0,a.createElement)(T.PageAttributesCheck,null,(0,a.createElement)(h.PanelBody,{title:(0,g.get)(n,["labels","attributes"],(0,_.__)("Page attributes")),opened:t,onToggle:function(){for(var e=arguments.length,t=new Array(e),n=0;n(l.current=document.querySelector(".metabox-location-"+t),l.current&&n.current.appendChild(l.current),()=>{l.current&&document.querySelector("#metaboxes").appendChild(l.current)})),[t]);const o=(0,c.useSelect)((e=>e(Rt).isSavingMetaBoxes()),[]),r=L()("edit-post-meta-boxes-area",`is-${t}`,{"is-loading":o});return(0,a.createElement)("div",{className:r},o&&(0,a.createElement)(h.Spinner,null),(0,a.createElement)("div",{className:"edit-post-meta-boxes-area__container",ref:n}),(0,a.createElement)("div",{className:"edit-post-meta-boxes-area__clear"}))};class Rl extends a.Component{componentDidMount(){this.updateDOM()}componentDidUpdate(e){this.props.isVisible!==e.isVisible&&this.updateDOM()}updateDOM(){const{id:e,isVisible:t}=this.props,n=document.getElementById(e);n&&(t?n.classList.remove("is-hidden"):n.classList.add("is-hidden"))}render(){return null}}var Fl=(0,c.withSelect)(((e,t)=>{let{id:n}=t;return{isVisible:e(Rt).isEditorPanelEnabled(`meta-box-${n}`)}}))(Rl);function Vl(e){let{location:t}=e;const n=(0,c.useRegistry)(),{metaBoxes:l,areMetaBoxesInitialized:o,isEditorReady:r}=(0,c.useSelect)((e=>{const{__unstableIsEditorReady:n}=e(T.store),{getMetaBoxesPerLocation:l,areMetaBoxesInitialized:o}=e(Rt);return{metaBoxes:l(t),areMetaBoxesInitialized:o(),isEditorReady:n()}}),[t]);return(0,a.useEffect)((()=>{r&&!o&&n.dispatch(Rt).initializeMetaBoxes()}),[r,o]),o?(0,a.createElement)(a.Fragment,null,(0,g.map)(l,(e=>{let{id:t}=e;return(0,a.createElement)(Fl,{key:t,id:t})})),(0,a.createElement)(Dl,{location:t})):null}window.wp.warning;const{Fill:Ul,Slot:Gl}=(0,h.createSlotFill)("PluginDocumentSettingPanel"),Hl=(0,b.compose)((0,S.withPluginContext)(((e,t)=>(void 0===t.name&&"undefined"!=typeof process&&process.env,{panelName:`${e.name}/${t.name}`}))),(0,c.withSelect)(((e,t)=>{let{panelName:n}=t;return{opened:e(Rt).isEditorPanelOpened(n),isEnabled:e(Rt).isEditorPanelEnabled(n)}})),(0,c.withDispatch)(((e,t)=>{let{panelName:n}=t;return{onToggle(){return e(Rt).toggleEditorPanelOpened(n)}}})))((e=>{let{isEnabled:t,panelName:n,opened:l,onToggle:o,className:r,title:s,icon:i,children:c}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(gn,{label:s,panelName:n}),(0,a.createElement)(Ul,null,t&&(0,a.createElement)(h.PanelBody,{className:r,title:s,icon:i,opened:l,onToggle:o},c)))}));Hl.Slot=Gl;var zl=Hl;function $l(e){let{className:t,...n}=e;const{postTitle:l,shortcut:o,showIconLabels:r}=(0,c.useSelect)((e=>({postTitle:e(T.store).getEditedPostAttribute("title"),shortcut:e(zt.store).getShortcutRepresentation("core/edit-post/toggle-sidebar"),showIconLabels:e(Rt).isFeatureActive("showIconLabels")})),[]);return(0,a.createElement)(pe,p({panelClassName:t,className:"edit-post-sidebar",smallScreenTitle:l||(0,_.__)("(no title)"),scope:"core/edit-post",toggleShortcut:o,showIconLabels:r},n))}var Wl=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"}));var ql=function(){const e=(0,c.useSelect)((e=>{const{getEditedPostTemplate:t}=e(Rt);return t()}),[]);return e?(0,a.createElement)(h.PanelBody,null,(0,a.createElement)(h.Flex,{align:"flex-start",gap:"3"},(0,a.createElement)(h.FlexItem,null,(0,a.createElement)(fe,{icon:Wl})),(0,a.createElement)(h.FlexBlock,null,(0,a.createElement)("h2",{className:"edit-post-template-summary__title"},(null==e?void 0:e.title)||(null==e?void 0:e.slug)),(0,a.createElement)("p",null,null==e?void 0:e.description)))):null};const jl=a.Platform.select({web:!0,native:!1});var Kl=()=>{const{sidebarName:e,keyboardShortcut:t,isTemplateMode:n}=(0,c.useSelect)((e=>{let t=e(ee).getActiveComplementaryArea(Rt.name);["edit-post/document","edit-post/block"].includes(t)||(e(E.store).getBlockSelectionStart()&&(t="edit-post/block"),t="edit-post/document");return{sidebarName:t,keyboardShortcut:e(zt.store).getShortcutRepresentation("core/edit-post/toggle-sidebar"),isTemplateMode:e(Rt).isEditingTemplate()}}),[]);return(0,a.createElement)($l,{identifier:e,header:(0,a.createElement)(Zn,{sidebarName:e}),closeLabel:(0,_.__)("Close settings"),headerClassName:"edit-post-sidebar__panel-tabs",title:(0,_.__)("Settings"),toggleShortcut:t,icon:Qn,isActiveByDefault:jl},!n&&"edit-post/document"===e&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(wl,null),(0,a.createElement)(zl.Slot,null),(0,a.createElement)(Sl,null),(0,a.createElement)(Pl,null),(0,a.createElement)(Bl,null),(0,a.createElement)(Il,null),(0,a.createElement)(Al,null),(0,a.createElement)(Ol,null),(0,a.createElement)(Vl,{location:"side"})),n&&"edit-post/document"===e&&(0,a.createElement)(ql,null),"edit-post/block"===e&&(0,a.createElement)(E.BlockInspector,null))};function Yl(e){let{nonAnimatedSrc:t,animatedSrc:n}=e;return(0,a.createElement)("picture",{className:"edit-post-welcome-guide__image"},(0,a.createElement)("source",{srcSet:t,media:"(prefers-reduced-motion: reduce)"}),(0,a.createElement)("img",{src:n,width:"312",height:"240",alt:""}))}function Xl(){const{toggleFeature:e}=(0,c.useDispatch)(Rt);return(0,a.createElement)(h.Guide,{className:"edit-post-welcome-guide",contentLabel:(0,_.__)("Welcome to the block editor"),finishButtonText:(0,_.__)("Get started"),onFinish:()=>e("welcomeGuide"),pages:[{image:(0,a.createElement)(Yl,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.gif"}),content:(0,a.createElement)(a.Fragment,null,(0,a.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,_.__)("Welcome to the block editor")),(0,a.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,_.__)("In the WordPress editor, each paragraph, image, or video is presented as a distinct “block” of content.")))},{image:(0,a.createElement)(Yl,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-editor.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-editor.gif"}),content:(0,a.createElement)(a.Fragment,null,(0,a.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,_.__)("Make each block your own")),(0,a.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,_.__)("Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.")))},{image:(0,a.createElement)(Yl,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-library.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-library.gif"}),content:(0,a.createElement)(a.Fragment,null,(0,a.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,_.__)("Get to know the block library")),(0,a.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,a.createInterpolateElement)((0,_.__)("All of the blocks available to you live in the block library. You’ll find it wherever you see the icon."),{InserterIconImage:(0,a.createElement)("img",{alt:(0,_.__)("inserter"),src:"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A"})})))},{image:(0,a.createElement)(Yl,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.gif"}),content:(0,a.createElement)(a.Fragment,null,(0,a.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,_.__)("Learn how to use the block editor")),(0,a.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,_.__)("New to the block editor? Want to learn more about using it? "),(0,a.createElement)(h.ExternalLink,{href:(0,_.__)("https://wordpress.org/support/article/wordpress-editor/")},(0,_.__)("Here's a detailed guide."))))}]})}function Ql(){const{toggleFeature:e}=(0,c.useDispatch)(Rt);return(0,a.createElement)(h.Guide,{className:"edit-template-welcome-guide",contentLabel:(0,_.__)("Welcome to the template editor"),finishButtonText:(0,_.__)("Get started"),onFinish:()=>e("welcomeGuideTemplate"),pages:[{image:(0,a.createElement)(Yl,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-template-editor.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-template-editor.gif"}),content:(0,a.createElement)(a.Fragment,null,(0,a.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,_.__)("Welcome to the template editor")),(0,a.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,_.__)("Templates help define the layout of the site. You can customize all aspects of your posts and pages using blocks and patterns in this editor.")))}]})}function Zl(){const{isActive:e,isTemplateMode:t}=(0,c.useSelect)((e=>{const{isFeatureActive:t,isEditingTemplate:n}=e(Rt),l=n();return{isActive:t(l?"welcomeGuideTemplate":"welcomeGuide"),isTemplateMode:l}}),[]);return e?t?(0,a.createElement)(Ql,null):(0,a.createElement)(Xl,null):null}const{Fill:Jl,Slot:eo}=(0,h.createSlotFill)("PluginPostPublishPanel"),to=(0,b.compose)((0,S.withPluginContext)(((e,t)=>({icon:t.icon||e.icon}))))((e=>{let{children:t,className:n,title:l,initialOpen:o=!1,icon:r}=e;return(0,a.createElement)(Jl,null,(0,a.createElement)(h.PanelBody,{className:n,initialOpen:o||!l,title:l,icon:r},t))}));to.Slot=eo;var no=to;const{Fill:lo,Slot:oo}=(0,h.createSlotFill)("PluginPrePublishPanel"),ro=(0,b.compose)((0,S.withPluginContext)(((e,t)=>({icon:t.icon||e.icon}))))((e=>{let{children:t,className:n,title:l,initialOpen:o=!1,icon:r}=e;return(0,a.createElement)(lo,null,(0,a.createElement)(h.PanelBody,{className:n,initialOpen:o||!l,title:l,icon:r},t))}));ro.Slot=oo;var ao=ro;const{Fill:so,Slot:io}=(0,h.createSlotFill)("ActionsPanel");function co(e){let{setEntitiesSavedStatesCallback:t,closeEntitiesSavedStates:n,isEntitiesSavedStatesOpen:l}=e;const{closePublishSidebar:o,togglePublishSidebar:r}=(0,c.useDispatch)(Rt),{publishSidebarOpened:s,hasActiveMetaboxes:i,isSavingMetaBoxes:u,hasNonPostEntityChanges:d}=(0,c.useSelect)((e=>({publishSidebarOpened:e(Rt).isPublishSidebarOpened(),hasActiveMetaboxes:e(Rt).hasMetaBoxes(),isSavingMetaBoxes:e(Rt).isSavingMetaBoxes(),hasNonPostEntityChanges:e(T.store).hasNonPostEntityChanges()})),[]),m=(0,a.useCallback)((()=>t(!0)),[]);let p;return p=s?(0,a.createElement)(T.PostPublishPanel,{onClose:o,forceIsDirty:i,forceIsSaving:u,PrePublishExtension:ao.Slot,PostPublishExtension:no.Slot}):d?(0,a.createElement)("div",{className:"edit-post-layout__toggle-entities-saved-states-panel"},(0,a.createElement)(h.Button,{variant:"secondary",className:"edit-post-layout__toggle-entities-saved-states-panel-button",onClick:m,"aria-expanded":!1},(0,_.__)("Open save panel"))):(0,a.createElement)("div",{className:"edit-post-layout__toggle-publish-panel"},(0,a.createElement)(h.Button,{variant:"secondary",className:"edit-post-layout__toggle-publish-panel-button",onClick:r,"aria-expanded":!1},(0,_.__)("Open publish panel"))),(0,a.createElement)(a.Fragment,null,l&&(0,a.createElement)(T.EntitiesSavedStates,{close:n}),(0,a.createElement)(io,{bubblesVirtually:!0}),!l&&p)}function uo(){const{blockPatternsWithPostContentBlockType:e,postType:t}=(0,c.useSelect)((e=>{const{__experimentalGetPatternsByBlockTypes:t}=e(E.store),{getCurrentPostType:n}=e(T.store);return{blockPatternsWithPostContentBlockType:t("core/post-content"),postType:n()}}),[]);return(0,a.useMemo)((()=>e.filter((e=>"page"===t&&!e.postTypes||Array.isArray(e.postTypes)&&e.postTypes.includes(t)))),[t,e])}function mo(e){let{onChoosePattern:t}=e;const n=uo(),l=(0,b.useAsyncList)(n),{resetEditorBlocks:o}=(0,c.useDispatch)(T.store);return(0,a.createElement)(E.__experimentalBlockPatternsList,{blockPatterns:n,shownPatterns:l,onClickPattern:(e,n)=>{o(n),t()}})}const po="INITIAL",go="PATTERN",ho="CLOSED";function Eo(){const[e,t]=(0,a.useState)(po),n=uo().length>0,l=(0,c.useSelect)((t=>{if(!n||e!==po)return!1;const{getEditedPostContent:l,isEditedPostSaveable:o}=t(T.store),{isEditingTemplate:r,isFeatureActive:a}=t(Rt);return!o()&&""===l()&&!r()&&!a("welcomeGuide")}),[e,n]);return(0,a.useEffect)((()=>{l&&t(go)}),[l]),e===po||e===ho?null:(0,a.createElement)(h.Modal,{className:"edit-post-start-page-options__modal",title:(0,_.__)("Choose a pattern"),closeLabel:(0,_.__)("Cancel"),onRequestClose:()=>{t(ho)}},(0,a.createElement)("div",{className:"edit-post-start-page-options__modal-content"},e===go&&(0,a.createElement)(mo,{onChoosePattern:()=>{t(ho)}})))}const _o={header:(0,_.__)("Editor top bar"),body:(0,_.__)("Editor content"),sidebar:(0,_.__)("Editor settings"),actions:(0,_.__)("Editor publish"),footer:(0,_.__)("Editor footer")};var bo=function(e){let{styles:t}=e;const n=(0,b.useViewportMatch)("medium","<"),l=(0,b.useViewportMatch)("huge",">="),{openGeneralSidebar:o,closeGeneralSidebar:r,setIsInserterOpened:s}=(0,c.useDispatch)(Rt),{createErrorNotice:i}=(0,c.useDispatch)(P.store),{mode:u,isFullscreenActive:d,isRichEditingEnabled:m,sidebarIsOpened:p,hasActiveMetaboxes:g,hasFixedToolbar:f,previousShortcut:v,nextShortcut:y,hasBlockSelected:w,isInserterOpened:k,isListViewOpened:C,showIconLabels:x,hasReducedUI:B,showBlockBreadcrumbs:M,isTemplateMode:I,documentLabel:N}=(0,c.useSelect)((e=>{const{getEditorSettings:t,getPostTypeLabel:n}=e(T.store),l=t(),o=n();return{isTemplateMode:e(Rt).isEditingTemplate(),hasFixedToolbar:e(Rt).isFeatureActive("fixedToolbar"),sidebarIsOpened:!(!e(ee).getActiveComplementaryArea(Rt.name)&&!e(Rt).isPublishSidebarOpened()),isFullscreenActive:e(Rt).isFeatureActive("fullscreenMode"),isInserterOpened:e(Rt).isInserterOpened(),isListViewOpened:e(Rt).isListViewOpened(),mode:e(Rt).getEditorMode(),isRichEditingEnabled:l.richEditingEnabled,hasActiveMetaboxes:e(Rt).hasMetaBoxes(),previousShortcut:e(zt.store).getAllShortcutKeyCombinations("core/edit-post/previous-region"),nextShortcut:e(zt.store).getAllShortcutKeyCombinations("core/edit-post/next-region"),showIconLabels:e(Rt).isFeatureActive("showIconLabels"),hasReducedUI:e(Rt).isFeatureActive("reducedUI"),showBlockBreadcrumbs:e(Rt).isFeatureActive("showBlockBreadcrumbs"),documentLabel:o||(0,_._x)("Document","noun")}}),[]),A=L()("edit-post-layout","is-mode-"+u,{"is-sidebar-opened":p,"has-fixed-toolbar":f,"has-metaboxes":g,"show-icon-labels":x});(0,a.useEffect)((()=>{p&&!l&&s(!1)}),[p,l]),(0,a.useEffect)((()=>{k&&!l&&r()}),[k,l]);const[O,D]=(0,a.useState)(!1),R=(0,a.useCallback)((e=>{"function"==typeof O&&O(e),D(!1)}),[O]),F=C?(0,_.__)("List View"):(0,_.__)("Block Library");return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(ge,{isActive:d}),(0,a.createElement)(Sn,null),(0,a.createElement)(T.UnsavedChangesWarning,null),(0,a.createElement)(T.AutosaveMonitor,null),(0,a.createElement)(T.LocalAutosaveMonitor,null),(0,a.createElement)(Qt,null),(0,a.createElement)(T.EditorKeyboardShortcutsRegister,null),(0,a.createElement)(Kl,null),(0,a.createElement)(he,{className:A,labels:{..._o,secondarySidebar:F},header:(0,a.createElement)(jn,{setEntitiesSavedStatesCallback:D}),secondarySidebar:"visual"===u&&k?(0,a.createElement)(Yn,null):"visual"===u&&C?(0,a.createElement)(Xn,null):null,sidebar:(!n||p)&&(0,a.createElement)(a.Fragment,null,!n&&!p&&(0,a.createElement)("div",{className:"edit-post-layout__toggle-sidebar-panel"},(0,a.createElement)(h.Button,{variant:"secondary",className:"edit-post-layout__toggle-sidebar-panel-button",onClick:()=>o(w?"edit-post/block":"edit-post/document"),"aria-expanded":!1},w?(0,_.__)("Open block settings"):(0,_.__)("Open document settings"))),(0,a.createElement)(pe.Slot,{scope:"core/edit-post"})),notices:(0,a.createElement)(T.EditorSnackbars,null),content:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(T.EditorNotices,null),("text"===u||!m)&&(0,a.createElement)($t,null),m&&"visual"===u&&(0,a.createElement)(Xt,{styles:t}),!I&&(0,a.createElement)("div",{className:"edit-post-layout__metaboxes"},(0,a.createElement)(Vl,{location:"normal"}),(0,a.createElement)(Vl,{location:"advanced"})),n&&p&&(0,a.createElement)(h.ScrollLock,null),(0,a.createElement)(E.BlockStyles.Slot,{scope:"core/block-inspector"})),footer:!B&&M&&!n&&m&&"visual"===u&&(0,a.createElement)("div",{className:"edit-post-layout__footer"},(0,a.createElement)(E.BlockBreadcrumb,{rootLabelText:N})),actions:(0,a.createElement)(co,{closeEntitiesSavedStates:R,isEntitiesSavedStatesOpen:O,setEntitiesSavedStatesCallback:D}),shortcuts:{previous:v,next:y}}),(0,a.createElement)(yn,null),(0,a.createElement)(an,null),(0,a.createElement)(Zl,null),(0,a.createElement)(Eo,null),(0,a.createElement)(h.Popover.Slot,null),(0,a.createElement)(S.PluginArea,{onError:function(e){i((0,_.sprintf)((0,_.__)('The "%s" plugin has encountered an error and cannot be rendered.'),e))}}))};function fo(e){let{postId:t}=e;return(e=>{const{hasBlockSelection:t,isEditorSidebarOpened:n}=(0,c.useSelect)((e=>({hasBlockSelection:!!e(E.store).getBlockSelectionStart(),isEditorSidebarOpened:e(Dt).isEditorSidebarOpened()})),[e]),{openGeneralSidebar:l}=(0,c.useDispatch)(Dt);(0,a.useEffect)((()=>{n&&l(t?"edit-post/block":"edit-post/document")}),[t,n])})(t),(e=>{const{newPermalink:t}=(0,c.useSelect)((e=>({newPermalink:e(T.store).getCurrentPost().link})),[e]),n=(0,a.useRef)();(0,a.useEffect)((()=>{n.current=document.querySelector("#wp-admin-bar-preview a")||document.querySelector("#wp-admin-bar-view a")}),[e]),(0,a.useEffect)((()=>{t&&n.current&&n.current.setAttribute("href",t)}),[t])})(t),null}var vo=function(e){let{postId:t,postType:n,settings:l,initialEdits:o,onError:r,...i}=e;const{hasFixedToolbar:u,focusMode:m,hasReducedUI:E,hasInlineToolbar:_,hasThemeStyles:b,post:f,preferredStyleVariations:v,hiddenBlockTypes:y,blockTypes:w,keepCaretInsideBlock:S,isTemplateMode:k,template:P}=(0,c.useSelect)((e=>{var l,o;const{isFeatureActive:r,__experimentalGetPreviewDeviceType:a,isEditingTemplate:i,getEditedPostTemplate:c,getHiddenBlockTypes:u}=e(Rt),{getEntityRecord:m,getPostType:p,getEntityRecords:g,canUser:h}=e(Ce.store),{getEditorSettings:E}=e(T.store),{getBlockTypes:_}=e(s.store);let b;if(["wp_template","wp_template_part"].includes(n)){const e=g("postType",n,{wp_id:t});b=null==e?void 0:e[0]}else b=m("postType",n,t);const f=E().supportsTemplateMode,v=null!==(l=null===(o=p(n))||void 0===o?void 0:o.viewable)&&void 0!==l&&l,y=h("create","templates");return{hasFixedToolbar:r("fixedToolbar")||"Desktop"!==a(),focusMode:r("focusMode"),hasReducedUI:r("reducedUI"),hasInlineToolbar:r("inlineToolbar"),hasThemeStyles:r("themeStyles"),preferredStyleVariations:e(d.store).get("core/edit-post","preferredStyleVariations"),hiddenBlockTypes:u(),blockTypes:_(),keepCaretInsideBlock:r("keepCaretInsideBlock"),isTemplateMode:i(),template:f&&v&&y?c():null,post:b}}),[n,t]),{updatePreferredStyleVariations:C,setIsInserterOpened:x}=(0,c.useDispatch)(Rt),B=(0,a.useMemo)((()=>{const e={...l,__experimentalPreferredStyleVariations:{value:v,onChange:C},hasFixedToolbar:u,focusMode:m,hasReducedUI:E,hasInlineToolbar:_,__experimentalSetIsInserterOpened:x,keepCaretInsideBlock:S,defaultAllowedBlockTypes:l.allowedBlockTypes};if(y.length>0){const t=!0===l.allowedBlockTypes?(0,g.map)(w,"name"):l.allowedBlockTypes||[];e.allowedBlockTypes=(0,g.without)(t,...y)}return e}),[l,u,m,E,y,w,v,x,C,S]),M=(0,a.useMemo)((()=>{var e;const t=[],n=[];null===(e=l.styles)||void 0===e||e.forEach((e=>{e.__unstableType&&"theme"!==e.__unstableType?n.push(e):t.push(e)}));const o=[...l.defaultEditorStyles,...n];return b&&t.length?l.styles:o}),[l,b]);return f?(0,a.createElement)(a.StrictMode,null,(0,a.createElement)(zt.ShortcutProvider,null,(0,a.createElement)(h.SlotFillProvider,null,(0,a.createElement)(T.EditorProvider,p({settings:B,post:f,initialEdits:o,useSubRegistry:!1,__unstableTemplate:k?P:void 0},i),(0,a.createElement)(T.ErrorBoundary,{onError:r},(0,a.createElement)(fo,{postId:t}),(0,a.createElement)(bo,{styles:M})),(0,a.createElement)(T.PostLockedModal,null))))):null};var yo=e=>{let{allowedBlocks:t,icon:n,label:l,onClick:o,small:r,role:s}=e;return(0,a.createElement)(E.BlockSettingsMenuControls,null,(e=>{let{selectedBlocks:i,onClose:c}=e;return((e,t)=>{return!Array.isArray(t)||(n=t,0===e.filter((e=>!n.includes(e))).length);var n})(i,t)?(0,a.createElement)(h.MenuItem,{onClick:(0,b.compose)(o,c),icon:n,label:r?l:void 0,role:s},!r&&l):null}))},wo=(0,b.compose)((0,S.withPluginContext)(((e,t)=>{var n;return{as:null!==(n=t.as)&&void 0!==n?n:h.MenuItem,icon:t.icon||e.icon,name:"core/edit-post/plugin-more-menu"}})))(ae);function So(e){return(0,a.createElement)(ie,p({__unstableExplicitMenuItem:!0,scope:"core/edit-post"},e))}function ko(e,t,n,l,o){(0,a.unmountComponentAtNode)(n);const r=ko.bind(null,e,t,n,l,o);(0,a.render)((0,a.createElement)(vo,{settings:l,onError:r,postId:t,postType:e,initialEdits:o,recovery:!0}),n)}function Po(e,t,n,l,o){const r=document.getElementById(e),m=ko.bind(null,t,n,r,l,o);(0,c.dispatch)(d.store).setDefaults("core/edit-post",{editorMode:"visual",fixedToolbar:!1,fullscreenMode:!0,hiddenBlockTypes:[],inactivePanels:[],isPublishSidebarEnabled:!0,openPanels:["post-status"],preferredStyleVariations:{},showBlockBreadcrumbs:!0,showIconLabels:!1,showListViewByDefault:!1,themeStyles:!0,welcomeGuide:!0,welcomeGuideTemplate:!0}),(0,c.dispatch)(s.store).__experimentalReapplyBlockTypeFilters(),(0,c.select)(Rt).isFeatureActive("showListViewByDefault")&&(0,c.dispatch)(Rt).setIsListViewOpened(!0),(0,i.registerCoreBlocks)(),(0,u.addFilter)("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromInserter",((e,t)=>!(!(0,c.select)(Rt).isEditingTemplate()&&"core/template-part"===t.name)&&e));"Standards"!==("CSS1Compat"===document.compatMode?"Standards":"Quirks")&&console.warn("Your browser is using Quirks Mode. \nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening . Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.");-1!==window.navigator.userAgent.indexOf("iPhone")&&window.addEventListener("scroll",(e=>{const t=document.getElementsByClassName("interface-interface-skeleton__body")[0];e.target===document&&(window.scrollY>100&&(t.scrollTop=t.scrollTop+window.scrollY),document.getElementsByClassName("is-mode-visual")[0]&&window.scrollTo(0,0))})),window.addEventListener("dragover",(e=>e.preventDefault()),!1),window.addEventListener("drop",(e=>e.preventDefault()),!1),(0,a.render)((0,a.createElement)(vo,{settings:l,onError:m,postId:n,postType:t,initialEdits:o}),r)}}(),(window.wp=window.wp||{}).editPost=l}();
\ No newline at end of file
+*/!function(){"use strict";var l={}.hasOwnProperty;function o(){for(var e=[],t=0;tm.MediaUpload));var g=window.lodash,h=window.wp.components,E=window.wp.blockEditor,_=window.wp.i18n,b=window.wp.compose;const f=(0,b.compose)((0,c.withSelect)(((e,t)=>{if((0,s.hasBlockSupport)(t.name,"multiple",!0))return{};const n=e(E.store).getBlocks(),l=(0,g.find)(n,(e=>{let{name:n}=e;return t.name===n}));return{originalBlockClientId:l&&l.clientId!==t.clientId&&l.clientId}})),(0,c.withDispatch)(((e,t)=>{let{originalBlockClientId:n}=t;return{selectFirst:()=>e(E.store).selectBlock(n)}}))),v=(0,b.createHigherOrderComponent)((e=>f((t=>{let{originalBlockClientId:n,selectFirst:l,...o}=t;if(!n)return(0,a.createElement)(e,o);const r=(0,s.getBlockType)(o.name),i=function(e){const t=(0,s.findTransform)((0,s.getBlockTransforms)("to",e),(e=>{let{type:t,blocks:n}=e;return"block"===t&&1===n.length}));if(!t)return null;return(0,s.getBlockType)(t.blocks[0])}(o.name);return[(0,a.createElement)("div",{key:"invalid-preview",style:{minHeight:"60px"}},(0,a.createElement)(e,p({key:"block-edit"},o))),(0,a.createElement)(E.Warning,{key:"multiple-use-warning",actions:[(0,a.createElement)(h.Button,{key:"find-original",variant:"secondary",onClick:l},(0,_.__)("Find original")),(0,a.createElement)(h.Button,{key:"remove",variant:"secondary",onClick:()=>o.onReplace([])},(0,_.__)("Remove")),i&&(0,a.createElement)(h.Button,{key:"transform",variant:"secondary",onClick:()=>o.onReplace((0,s.createBlock)(i.name,o.attributes))},(0,_.__)("Transform into:")," ",i.title)]},(0,a.createElement)("strong",null,null==r?void 0:r.title,": "),(0,_.__)("This block can only be used once."))]}))),"withMultipleValidation");(0,u.addFilter)("editor.BlockEdit","core/edit-post/validate-multiple-use/with-multiple-validation",v);var y=window.wp.primitives;var w=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.Path,{d:"M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"})),S=window.wp.plugins,k=window.wp.url,P=window.wp.notices,T=window.wp.editor;function C(){const{createNotice:e}=(0,c.useDispatch)(P.store),t=(0,c.useSelect)((e=>()=>e(T.store).getEditedPostAttribute("content")),[]);const n=(0,b.useCopyToClipboard)(t,(function(){e("info",(0,_.__)("All content copied."),{isDismissible:!0,type:"snackbar"})}));return(0,a.createElement)(h.MenuItem,{ref:n},(0,_.__)("Copy all blocks"))}var x=window.wp.keycodes;const B=(0,c.combineReducers)({isSaving:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"REQUEST_META_BOX_UPDATES":return!0;case"META_BOX_UPDATES_SUCCESS":case"META_BOX_UPDATES_FAILURE":return!1;default:return e}},locations:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"SET_META_BOXES_PER_LOCATIONS"===t.type?t.metaBoxesPerLocation:e},initialized:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"META_BOXES_INITIALIZED"===t.type||e}});var M=(0,c.combineReducers)({activeModal:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"OPEN_MODAL":return t.name;case"CLOSE_MODAL":return null}return e},metaBoxes:B,publishSidebarActive:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"OPEN_PUBLISH_SIDEBAR":return!0;case"CLOSE_PUBLISH_SIDEBAR":return!1;case"TOGGLE_PUBLISH_SIDEBAR":return!e}return e},removedPanels:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;if("REMOVE_PANEL"===t.type)if(!(0,g.includes)(e,t.panelName))return[...e,t.panelName];return e},deviceType:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Desktop",t=arguments.length>1?arguments[1]:void 0;return"SET_PREVIEW_DEVICE_TYPE"===t.type?t.deviceType:e},blockInserterPanel:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_IS_LIST_VIEW_OPENED":return!t.isOpen&&e;case"SET_IS_INSERTER_OPENED":return t.value}return e},listViewPanel:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_IS_INSERTER_OPENED":return!t.value&&e;case"SET_IS_LIST_VIEW_OPENED":return t.isOpen}return e},isEditingTemplate:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"SET_IS_EDITING_TEMPLATE"===t.type?t.value:e}}),I=window.wp.apiFetch,N=n.n(I),A=n(4403),L=n.n(A);var O=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));var D=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.Path,{d:"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"}));var R=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.Path,{fillRule:"evenodd",d:"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",clipRule:"evenodd"})),F=window.wp.viewport;var V=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"})),U=window.wp.deprecated,G=n.n(U);const H=(e,t)=>({type:"SET_DEFAULT_COMPLEMENTARY_AREA",scope:e,area:t}),z=(e,t)=>n=>{let{registry:l,dispatch:o}=n;if(!t)return;l.select(d.store).get(e,"isComplementaryAreaVisible")||l.dispatch(d.store).set(e,"isComplementaryAreaVisible",!0),o({type:"ENABLE_COMPLEMENTARY_AREA",scope:e,area:t})},$=e=>t=>{let{registry:n}=t;n.select(d.store).get(e,"isComplementaryAreaVisible")&&n.dispatch(d.store).set(e,"isComplementaryAreaVisible",!1)},W=(e,t)=>n=>{let{registry:l}=n;if(!t)return;const o=l.select(d.store).get(e,"pinnedItems");!0!==(null==o?void 0:o[t])&&l.dispatch(d.store).set(e,"pinnedItems",{...o,[t]:!0})},q=(e,t)=>n=>{let{registry:l}=n;if(!t)return;const o=l.select(d.store).get(e,"pinnedItems");l.dispatch(d.store).set(e,"pinnedItems",{...o,[t]:!1})};function j(e,t){return function(n){let{registry:l}=n;G()("dispatch( 'core/interface' ).toggleFeature",{since:"6.0",alternative:"dispatch( 'core/preferences' ).toggle"}),l.dispatch(d.store).toggle(e,t)}}function K(e,t,n){return function(l){let{registry:o}=l;G()("dispatch( 'core/interface' ).setFeatureValue",{since:"6.0",alternative:"dispatch( 'core/preferences' ).set"}),o.dispatch(d.store).set(e,t,!!n)}}function Y(e,t){return function(n){let{registry:l}=n;G()("dispatch( 'core/interface' ).setFeatureDefaults",{since:"6.0",alternative:"dispatch( 'core/preferences' ).setDefaults"}),l.dispatch(d.store).setDefaults(e,t)}}const X=(0,c.createRegistrySelector)((e=>(t,n)=>{var l;const o=e(d.store).get(n,"isComplementaryAreaVisible");if(void 0!==o)return o?null==t||null===(l=t.complementaryAreas)||void 0===l?void 0:l[n]:null})),Q=(0,c.createRegistrySelector)((e=>(t,n,l)=>{var o;const r=e(d.store).get(n,"pinnedItems");return null===(o=null==r?void 0:r[l])||void 0===o||o})),Z=(0,c.createRegistrySelector)((e=>(t,n,l)=>(G()("select( 'core/interface' ).isFeatureActive( scope, featureName )",{since:"6.0",alternative:"select( 'core/preferences' ).get( scope, featureName )"}),!!e(d.store).get(n,l))));var J=(0,c.combineReducers)({complementaryAreas:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_DEFAULT_COMPLEMENTARY_AREA":{const{scope:n,area:l}=t;return e[n]?e:{...e,[n]:l}}case"ENABLE_COMPLEMENTARY_AREA":{const{scope:n,area:l}=t;return{...e,[n]:l}}}return e}});const ee=(0,c.createReduxStore)("core/interface",{reducer:J,actions:e,selectors:t});(0,c.register)(ee);var te=(0,S.withPluginContext)(((e,t)=>({icon:t.icon||e.icon,identifier:t.identifier||`${e.name}/${t.name}`})));var ne=te((function(e){let{as:t=h.Button,scope:n,identifier:l,icon:o,selectedIcon:r,name:s,...i}=e;const u=t,d=(0,c.useSelect)((e=>e(ee).getActiveComplementaryArea(n)===l),[l]),{enableComplementaryArea:m,disableComplementaryArea:g}=(0,c.useDispatch)(ee);return(0,a.createElement)(u,p({icon:r&&d?r:o,onClick:()=>{d?g(n):m(n,l)}},i))}));var le=e=>{let{smallScreenTitle:t,children:n,className:l,toggleButtonProps:o}=e;const r=(0,a.createElement)(ne,p({icon:V},o));return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:"components-panel__header interface-complementary-area-header__small"},t&&(0,a.createElement)("span",{className:"interface-complementary-area-header__small-title"},t),r),(0,a.createElement)("div",{className:L()("components-panel__header","interface-complementary-area-header",l),tabIndex:-1},n,r))};const oe=()=>{};function re(e){let{name:t,as:n=h.Button,onClick:l,...o}=e;return(0,a.createElement)(h.Fill,{name:t},(e=>{let{onClick:t}=e;return(0,a.createElement)(n,p({onClick:l||t?function(){(l||oe)(...arguments),(t||oe)(...arguments)}:void 0},o))}))}re.Slot=function(e){let{name:t,as:n=h.ButtonGroup,fillProps:l={},bubblesVirtually:o,...r}=e;return(0,a.createElement)(h.Slot,{name:t,bubblesVirtually:o,fillProps:l},(e=>{if(!a.Children.toArray(e).length)return null;const t=[];a.Children.forEach(e,(e=>{let{props:{__unstableExplicitMenuItem:n,__unstableTarget:l}}=e;l&&n&&t.push(l)}));const l=a.Children.map(e,(e=>!e.props.__unstableExplicitMenuItem&&t.includes(e.props.__unstableTarget)?null:e));return(0,a.createElement)(n,r,l)}))};var ae=re;const se=e=>{let{__unstableExplicitMenuItem:t,__unstableTarget:n,...l}=e;return(0,a.createElement)(h.MenuItem,l)};function ie(e){let{scope:t,target:n,__unstableExplicitMenuItem:l,...o}=e;return(0,a.createElement)(ne,p({as:e=>(0,a.createElement)(ae,p({__unstableExplicitMenuItem:l,__unstableTarget:`${t}/${n}`,as:se,name:`${t}/plugin-more-menu`},e)),role:"menuitemcheckbox",selectedIcon:O,name:n,scope:t},o))}function ce(e){let{scope:t,...n}=e;return(0,a.createElement)(h.Fill,p({name:`PinnedItems/${t}`},n))}ce.Slot=function(e){let{scope:t,className:n,...l}=e;return(0,a.createElement)(h.Slot,p({name:`PinnedItems/${t}`},l),(e=>(null==e?void 0:e.length)>0&&(0,a.createElement)("div",{className:L()(n,"interface-pinned-items")},e)))};var ue=ce;function de(e){let{scope:t,children:n,className:l}=e;return(0,a.createElement)(h.Fill,{name:`ComplementaryArea/${t}`},(0,a.createElement)("div",{className:l},n))}const me=te((function(e){let{children:t,className:n,closeLabel:l=(0,_.__)("Close plugin"),identifier:o,header:r,headerClassName:s,icon:i,isPinnable:u=!0,panelClassName:d,scope:m,name:p,smallScreenTitle:g,title:E,toggleShortcut:b,isActiveByDefault:f,showIconLabels:v=!1}=e;const{isActive:y,isPinned:w,activeArea:S,isSmall:k,isLarge:P}=(0,c.useSelect)((e=>{const{getActiveComplementaryArea:t,isItemPinned:n}=e(ee),l=t(m);return{isActive:l===o,isPinned:n(m,o),activeArea:l,isSmall:e(F.store).isViewportMatch("< medium"),isLarge:e(F.store).isViewportMatch("large")}}),[o,m]);!function(e,t,n,l,o){const r=(0,a.useRef)(!1),s=(0,a.useRef)(!1),{enableComplementaryArea:i,disableComplementaryArea:u}=(0,c.useDispatch)(ee);(0,a.useEffect)((()=>{l&&o&&!r.current?(u(e),s.current=!0):s.current&&!o&&r.current?(s.current=!1,i(e,t)):s.current&&n&&n!==t&&(s.current=!1),o!==r.current&&(r.current=o)}),[l,o,e,t,n])}(m,o,S,y,k);const{enableComplementaryArea:T,disableComplementaryArea:C,pinItem:x,unpinItem:B}=(0,c.useDispatch)(ee);return(0,a.useEffect)((()=>{f&&void 0===S&&!k&&T(m,o)}),[S,f,m,o,k]),(0,a.createElement)(a.Fragment,null,u&&(0,a.createElement)(ue,{scope:m},w&&(0,a.createElement)(ne,{scope:m,identifier:o,isPressed:y&&(!v||P),"aria-expanded":y,label:E,icon:v?O:i,showTooltip:!v,variant:v?"tertiary":void 0})),p&&u&&(0,a.createElement)(ie,{target:p,scope:m,icon:i},E),y&&(0,a.createElement)(de,{className:L()("interface-complementary-area",n),scope:m},(0,a.createElement)(le,{className:s,closeLabel:l,onClose:()=>C(m),smallScreenTitle:g,toggleButtonProps:{label:l,shortcut:b,scope:m,identifier:o}},r||(0,a.createElement)(a.Fragment,null,(0,a.createElement)("strong",null,E),u&&(0,a.createElement)(h.Button,{className:"interface-complementary-area__pin-unpin-item",icon:w?D:R,label:w?(0,_.__)("Unpin from toolbar"):(0,_.__)("Pin to toolbar"),onClick:()=>(w?B:x)(m,o),isPressed:w,"aria-expanded":w}))),(0,a.createElement)(h.Panel,{className:d},t)))}));me.Slot=function(e){let{scope:t,...n}=e;return(0,a.createElement)(h.Slot,p({name:`ComplementaryArea/${t}`},n))};var pe=me;var ge=e=>{let{isActive:t}=e;return(0,a.useEffect)((()=>{let e=!1;return document.body.classList.contains("sticky-menu")&&(e=!0,document.body.classList.remove("sticky-menu")),()=>{e&&document.body.classList.add("sticky-menu")}}),[]),(0,a.useEffect)((()=>(t?document.body.classList.add("is-fullscreen-mode"):document.body.classList.remove("is-fullscreen-mode"),()=>{t&&document.body.classList.remove("is-fullscreen-mode")})),[t]),null};var he=(0,a.forwardRef)((function(e,t){let{footer:n,header:l,sidebar:o,secondarySidebar:r,notices:s,content:i,drawer:c,actions:u,labels:d,className:m,shortcuts:g}=e;const E=(0,h.__unstableUseNavigateRegions)(g);!function(e){(0,a.useEffect)((()=>{const t=document&&document.querySelector(`html:not(.${e})`);if(t)return t.classList.toggle(e),()=>{t.classList.toggle(e)}}),[e])}("interface-interface-skeleton__html-container");const f={...{drawer:(0,_.__)("Drawer"),header:(0,_.__)("Header"),body:(0,_.__)("Content"),secondarySidebar:(0,_.__)("Block Library"),sidebar:(0,_.__)("Settings"),actions:(0,_.__)("Publish"),footer:(0,_.__)("Footer")},...d};return(0,a.createElement)("div",p({},E,{ref:(0,b.useMergeRefs)([t,E.ref]),className:L()(m,"interface-interface-skeleton",E.className,!!n&&"has-footer")}),!!c&&(0,a.createElement)("div",{className:"interface-interface-skeleton__drawer",role:"region","aria-label":f.drawer,tabIndex:"-1"},c),(0,a.createElement)("div",{className:"interface-interface-skeleton__editor"},!!l&&(0,a.createElement)("div",{className:"interface-interface-skeleton__header",role:"region","aria-label":f.header,tabIndex:"-1"},l),(0,a.createElement)("div",{className:"interface-interface-skeleton__body"},!!r&&(0,a.createElement)("div",{className:"interface-interface-skeleton__secondary-sidebar",role:"region","aria-label":f.secondarySidebar,tabIndex:"-1"},r),!!s&&(0,a.createElement)("div",{className:"interface-interface-skeleton__notices"},s),(0,a.createElement)("div",{className:"interface-interface-skeleton__content",role:"region","aria-label":f.body,tabIndex:"-1"},i),!!o&&(0,a.createElement)("div",{className:"interface-interface-skeleton__sidebar",role:"region","aria-label":f.sidebar,tabIndex:"-1"},o),!!u&&(0,a.createElement)("div",{className:"interface-interface-skeleton__actions",role:"region","aria-label":f.actions,tabIndex:"-1"},u))),!!n&&(0,a.createElement)("div",{className:"interface-interface-skeleton__footer",role:"region","aria-label":f.footer,tabIndex:"-1"},n))}));var Ee=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));function _e(e){let{as:t=h.DropdownMenu,className:n,label:l=(0,_.__)("Options"),popoverProps:o,toggleProps:r,children:s}=e;return(0,a.createElement)(t,{className:L()("interface-more-menu-dropdown",n),icon:Ee,label:l,popoverProps:{position:"bottom left",...o,className:L()("interface-more-menu-dropdown__content",null==o?void 0:o.className)},toggleProps:{tooltipPosition:"bottom",...r}},(e=>s(e)))}function be(e){let{closeModal:t,children:n}=e;return(0,a.createElement)(h.Modal,{className:"interface-preferences-modal",title:(0,_.__)("Preferences"),closeLabel:(0,_.__)("Close"),onRequestClose:t},n)}var fe=function(e){let{icon:t,size:n=24,...l}=e;return(0,a.cloneElement)(t,{width:n,height:n,...l})};var ve=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));var ye=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));const we="preferences-menu";function Se(e){let{sections:t}=e;const n=(0,b.useViewportMatch)("medium"),[l,o]=(0,a.useState)(we),{tabs:r,sectionsContentMap:s}=(0,a.useMemo)((()=>{let e={tabs:[],sectionsContentMap:{}};return t.length&&(e=t.reduce(((e,t)=>{let{name:n,tabLabel:l,content:o}=t;return e.tabs.push({name:n,title:l}),e.sectionsContentMap[n]=o,e}),{tabs:[],sectionsContentMap:{}})),e}),[t]),i=(0,a.useCallback)((e=>s[e.name]||null),[s]);let c;return c=n?(0,a.createElement)(h.TabPanel,{className:"interface-preferences__tabs",tabs:r,initialTabName:l!==we?l:void 0,onSelect:o,orientation:"vertical"},i):(0,a.createElement)(h.__experimentalNavigatorProvider,{initialPath:"/",className:"interface-preferences__provider"},(0,a.createElement)(h.__experimentalNavigatorScreen,{path:"/"},(0,a.createElement)(h.Card,{isBorderless:!0,size:"small"},(0,a.createElement)(h.CardBody,null,(0,a.createElement)(h.__experimentalItemGroup,null,r.map((e=>(0,a.createElement)(h.__experimentalNavigatorButton,{key:e.name,path:e.name,as:h.__experimentalItem,isAction:!0},(0,a.createElement)(h.__experimentalHStack,{justify:"space-between"},(0,a.createElement)(h.FlexItem,null,(0,a.createElement)(h.__experimentalTruncate,null,e.title)),(0,a.createElement)(h.FlexItem,null,(0,a.createElement)(fe,{icon:(0,_.isRTL)()?ve:ye})))))))))),t.length&&t.map((e=>(0,a.createElement)(h.__experimentalNavigatorScreen,{key:`${e.name}-menu`,path:e.name},(0,a.createElement)(h.Card,{isBorderless:!0,size:"large"},(0,a.createElement)(h.CardHeader,{isBorderless:!1,justify:"left",size:"small",gap:"6"},(0,a.createElement)(h.__experimentalNavigatorBackButton,{icon:(0,_.isRTL)()?ye:ve,"aria-label":(0,_.__)("Navigate to the previous view")}),(0,a.createElement)(h.__experimentalText,{size:"16"},e.tabLabel)),(0,a.createElement)(h.CardBody,null,e.content)))))),c}var ke=e=>{let{description:t,title:n,children:l}=e;return(0,a.createElement)("fieldset",{className:"interface-preferences-modal__section"},(0,a.createElement)("legend",{className:"interface-preferences-modal__section-legend"},(0,a.createElement)("h2",{className:"interface-preferences-modal__section-title"},n),t&&(0,a.createElement)("p",{className:"interface-preferences-modal__section-description"},t)),l)};var Pe=function(e){let{help:t,label:n,isChecked:l,onChange:o,children:r}=e;return(0,a.createElement)("div",{className:"interface-preferences-modal__option"},(0,a.createElement)(h.ToggleControl,{__nextHasNoMarginBottom:!0,help:t,label:n,checked:l,onChange:o}),r)},Te=window.wp.a11y,Ce=window.wp.coreData;const xe=e=>t=>{let{registry:n}=t;return n.dispatch(ee).enableComplementaryArea(Rt.name,e)},Be=()=>e=>{let{registry:t}=e;return t.dispatch(ee).disableComplementaryArea(Rt.name)};function Me(e){return{type:"OPEN_MODAL",name:e}}function Ie(){return{type:"CLOSE_MODAL"}}function Ne(){return{type:"OPEN_PUBLISH_SIDEBAR"}}function Ae(){return{type:"CLOSE_PUBLISH_SIDEBAR"}}function Le(){return{type:"TOGGLE_PUBLISH_SIDEBAR"}}const Oe=e=>t=>{var n;let{registry:l}=t;const o=null!==(n=l.select(d.store).get("core/edit-post","inactivePanels"))&&void 0!==n?n:[];let r;r=!(null==o||!o.includes(e))?o.filter((t=>t!==e)):[...o,e],l.dispatch(d.store).set("core/edit-post","inactivePanels",r)},De=e=>t=>{var n;let{registry:l}=t;const o=null!==(n=l.select(d.store).get("core/edit-post","openPanels"))&&void 0!==n?n:[];let r;r=!(null==o||!o.includes(e))?o.filter((t=>t!==e)):[...o,e],l.dispatch(d.store).set("core/edit-post","openPanels",r)};function Re(e){return{type:"REMOVE_PANEL",panelName:e}}const Fe=e=>t=>{let{registry:n}=t;return n.dispatch(d.store).toggle("core/edit-post",e)},Ve=e=>t=>{let{registry:n}=t;n.dispatch(d.store).set("core/edit-post","editorMode",e),"visual"!==e&&n.dispatch(E.store).clearSelectedBlock();const l="visual"===e?(0,_.__)("Visual editor selected"):(0,_.__)("Code editor selected");(0,Te.speak)(l,"assertive")},Ue=e=>t=>{let{registry:n}=t;const l=n.select(ee).isItemPinned("core/edit-post",e);n.dispatch(ee)[l?"unpinItem":"pinItem"]("core/edit-post",e)},Ge=(e,t)=>n=>{var l;let{registry:o}=n;if(!e)return;const r=null!==(l=o.select(d.store).get("core/edit-post","preferredStyleVariations"))&&void 0!==l?l:{};if(t)o.dispatch(d.store).set("core/edit-post","preferredStyleVariations",{...r,[e]:t});else{const t={...r};delete t[e],o.dispatch(d.store).set("core/edit-post","preferredStyleVariations",t)}},He=e=>t=>{var n;let{registry:l}=t;const o=null!==(n=l.select(d.store).get("core/edit-post","hiddenBlockTypes"))&&void 0!==n?n:[],r=(0,g.without)(o,...(0,g.castArray)(e));l.dispatch(d.store).set("core/edit-post","hiddenBlockTypes",r)},ze=e=>t=>{var n;let{registry:l}=t;const o=null!==(n=l.select(d.store).get("core/edit-post","hiddenBlockTypes"))&&void 0!==n?n:[],r=new Set([...o,...(0,g.castArray)(e)]);l.dispatch(d.store).set("core/edit-post","hiddenBlockTypes",[...r])},$e=e=>t=>{let{dispatch:n}=t;return n({type:"SET_META_BOXES_PER_LOCATIONS",metaBoxesPerLocation:e})},We=()=>async e=>{let{registry:t,select:n,dispatch:l}=e;l({type:"REQUEST_META_BOX_UPDATES"}),window.tinyMCE&&window.tinyMCE.triggerSave();const o=t.select(T.store).getCurrentPost(),r=[!!o.comment_status&&["comment_status",o.comment_status],!!o.ping_status&&["ping_status",o.ping_status],!!o.sticky&&["sticky",o.sticky],!!o.author&&["post_author",o.author]].filter(Boolean),a=[new window.FormData(document.querySelector(".metabox-base-form")),...n.getActiveMetaBoxLocations().map((e=>new window.FormData((e=>document.querySelector(`.edit-post-meta-boxes-area.is-${e} .metabox-location-${e}`)||document.querySelector("#metaboxes .metabox-location-"+e))(e))))],s=(0,g.reduce)(a,((e,t)=>{for(const[n,l]of t)e.append(n,l);return e}),new window.FormData);r.forEach((e=>{let[t,n]=e;return s.append(t,n)}));try{await N()({url:window._wpMetaBoxUrl,method:"POST",body:s,parse:!1}),l.metaBoxUpdatesSuccess()}catch{l.metaBoxUpdatesFailure()}};function qe(){return{type:"META_BOX_UPDATES_SUCCESS"}}function je(){return{type:"META_BOX_UPDATES_FAILURE"}}function Ke(e){return{type:"SET_PREVIEW_DEVICE_TYPE",deviceType:e}}function Ye(e){return{type:"SET_IS_INSERTER_OPENED",value:e}}function Xe(e){return{type:"SET_IS_LIST_VIEW_OPENED",isOpen:e}}function Qe(e){return{type:"SET_IS_EDITING_TEMPLATE",value:e}}const Ze=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return t=>{let{registry:n,select:l,dispatch:o}=t;o(Qe(!0));if(!l.isFeatureActive("welcomeGuideTemplate")){const t=e?(0,_.__)("Custom template created. You're in template mode now."):(0,_.__)("Editing template. Changes made here affect all posts and pages that use the template.");n.dispatch(P.store).createSuccessNotice(t,{type:"snackbar"})}}},Je=e=>async t=>{let{registry:n}=t;const l=await n.dispatch(Ce.store).saveEntityRecord("postType","wp_template",e),o=n.select(T.store).getCurrentPost();n.dispatch(Ce.store).editEntityRecord("postType",o.type,o.id,{template:l.slug})};let et=!1;const tt=()=>e=>{let{registry:t,select:n,dispatch:l}=e;if(!t.select(T.store).__unstableIsEditorReady())return;if(et)return;const o=t.select(T.store).getCurrentPostType();window.postboxes.page!==o&&window.postboxes.add_postbox_toggles(o),et=!0;let r=t.select(T.store).isSavingPost(),a=t.select(T.store).isAutosavingPost();const s=n.hasMetaBoxes();t.subscribe((async()=>{const e=t.select(T.store).isSavingPost(),n=t.select(T.store).isAutosavingPost(),o=s&&r&&!e&&!a;r=e,a=n,o&&await l.requestMetaBoxUpdates()})),l({type:"META_BOXES_INITIALIZED"})};var nt={};function lt(e){return[e]}function ot(e,t,n){var l;if(e.length!==t.length)return!1;for(l=n;l()=>{var t;return null!==(t=e(d.store).get("core/edit-post","editorMode"))&&void 0!==t?t:"visual"})),ct=(0,c.createRegistrySelector)((e=>()=>{const t=e(ee).getActiveComplementaryArea("core/edit-post");return["edit-post/document","edit-post/block"].includes(t)})),ut=(0,c.createRegistrySelector)((e=>()=>{const t=e(ee).getActiveComplementaryArea("core/edit-post");return!!t&&!["edit-post/document","edit-post/block"].includes(t)})),dt=(0,c.createRegistrySelector)((e=>()=>e(ee).getActiveComplementaryArea("core/edit-post")));const mt=(0,c.createRegistrySelector)((e=>()=>{G()("select( 'core/edit-post' ).getPreferences",{since:"6.0",alternative:"select( 'core/preferences' ).get"});const t=["hiddenBlockTypes","editorMode","preferredStyleVariations"].reduce(((t,n)=>({...t,[n]:e(d.store).get("core/edit-post",n)})),{}),n=function(e,t){var n;const l=null==e?void 0:e.reduce(((e,t)=>({...e,[t]:{enabled:!1}})),{}),o=null==t?void 0:t.reduce(((e,t)=>{const n=null==e?void 0:e[t];return{...e,[t]:{...n,opened:!0}}}),null!=l?l:{});return null!==(n=null!=o?o:l)&&void 0!==n?n:st}(e(d.store).get("core/edit-post","inactivePanels"),e(d.store).get("core/edit-post","openPanels"));return{...t,panels:n}}));function pt(e,t,n){G()("select( 'core/edit-post' ).getPreference",{since:"6.0",alternative:"select( 'core/preferences' ).get"});const l=mt(e)[t];return void 0===l?n:l}const gt=(0,c.createRegistrySelector)((e=>()=>{var t;return null!==(t=e(d.store).get("core/edit-post","hiddenBlockTypes"))&&void 0!==t?t:at}));function ht(e){return e.publishSidebarActive}function Et(e,t){return e.removedPanels.includes(t)}const _t=(0,c.createRegistrySelector)((e=>(t,n)=>{const l=e(d.store).get("core/edit-post","inactivePanels");return!(Et(t,n)||null!=l&&l.includes(n))})),bt=(0,c.createRegistrySelector)((e=>(t,n)=>{const l=e(d.store).get("core/edit-post","openPanels");return!(null==l||!l.includes(n))}));function ft(e,t){return e.activeModal===t}const vt=(0,c.createRegistrySelector)((e=>(t,n)=>!!e(d.store).get("core/edit-post",n))),yt=(0,c.createRegistrySelector)((e=>(t,n)=>e(ee).isItemPinned("core/edit-post",n))),wt=rt((e=>Object.keys(e.metaBoxes.locations).filter((t=>kt(e,t)))),(e=>[e.metaBoxes.locations]));function St(e,t){var n;return kt(e,t)&&(null===(n=Pt(e,t))||void 0===n?void 0:n.some((t=>{let{id:n}=t;return _t(e,`meta-box-${n}`)})))}function kt(e,t){const n=Pt(e,t);return!!n&&0!==n.length}function Pt(e,t){return e.metaBoxes.locations[t]}const Tt=rt((e=>Object.values(e.metaBoxes.locations).flat()),(e=>[e.metaBoxes.locations]));function Ct(e){return wt(e).length>0}function xt(e){return e.metaBoxes.isSaving}function Bt(e){return e.deviceType}function Mt(e){return!!e.blockInserterPanel}function It(e){const{rootClientId:t,insertionIndex:n,filterValue:l}=e.blockInserterPanel;return{rootClientId:t,insertionIndex:n,filterValue:l}}function Nt(e){return e.listViewPanel}function At(e){return e.isEditingTemplate}function Lt(e){return e.metaBoxes.initialized}const Ot=(0,c.createRegistrySelector)((e=>()=>{const t=e(T.store).getEditedPostAttribute("template");if(t){var n;const l=null===(n=e(Ce.store).getEntityRecords("postType","wp_template",{per_page:-1}))||void 0===n?void 0:n.find((e=>e.slug===t));return l?e(Ce.store).getEditedEntityRecord("postType","wp_template",l.id):l}const l=e(T.store).getCurrentPost();return l.link?e(Ce.store).__experimentalGetTemplateForLink(l.link):null})),Dt="core/edit-post",Rt=(0,c.createReduxStore)(Dt,{reducer:M,actions:o,selectors:r});(0,c.register)(Rt);var Ft=(0,c.withDispatch)((e=>{const{openModal:t}=e(Rt);return{openModal:t}}))((function(e){let{openModal:t}=e;return(0,a.createElement)(h.MenuItem,{onClick:()=>{t("edit-post/keyboard-shortcut-help")},shortcut:x.displayShortcut.access("h")},(0,_.__)("Keyboard shortcuts"))}));const{Fill:Vt,Slot:Ut}=(0,h.createSlotFill)("ToolsMoreMenuGroup");Vt.Slot=e=>{let{fillProps:t}=e;return(0,a.createElement)(Ut,{fillProps:t},(e=>!(0,g.isEmpty)(e)&&(0,a.createElement)(h.MenuGroup,{label:(0,_.__)("Tools")},e)))};var Gt=Vt;function Ht(){const e=(0,c.useSelect)((e=>e(Rt).isEditingTemplate()),[]);return(0,a.createElement)(d.PreferenceToggleMenuItem,{scope:"core/edit-post",name:e?"welcomeGuideTemplate":"welcomeGuide",label:(0,_.__)("Welcome Guide")})}(0,S.registerPlugin)("edit-post",{render(){return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Gt,null,(e=>{let{onClose:t}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(h.MenuItem,{role:"menuitem",href:(0,k.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,_.__)("Manage Reusable blocks")),(0,a.createElement)(Ft,{onSelect:t}),(0,a.createElement)(Ht,null),(0,a.createElement)(C,null),(0,a.createElement)(h.MenuItem,{role:"menuitem",icon:w,href:(0,_.__)("https://wordpress.org/support/article/wordpress-editor/"),target:"_blank",rel:"noopener noreferrer"},(0,_.__)("Help"),(0,a.createElement)(h.VisuallyHidden,{as:"span"},(0,_.__)("(opens in a new tab)"))))})))}});var zt=window.wp.keyboardShortcuts;function $t(){const e=(0,c.useSelect)((e=>e(T.store).getEditorSettings().richEditingEnabled),[]),{switchEditorMode:t}=(0,c.useDispatch)(Rt);return(0,a.createElement)("div",{className:"edit-post-text-editor"},(0,a.createElement)(T.TextEditorGlobalKeyboardShortcuts,null),e&&(0,a.createElement)("div",{className:"edit-post-text-editor__toolbar"},(0,a.createElement)("h2",null,(0,_.__)("Editing code")),(0,a.createElement)(h.Button,{variant:"tertiary",onClick:()=>t("visual"),shortcut:x.displayShortcut.secondary("m")},(0,_.__)("Exit code editor"))),(0,a.createElement)("div",{className:"edit-post-text-editor__body"},(0,a.createElement)(T.PostTitle,null),(0,a.createElement)(T.PostTextEditor,null)))}var Wt=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.Path,{d:"M20 10.8H6.7l4.1-4.5-1.1-1.1-5.8 6.3 5.8 5.8 1.1-1.1-4-3.9H20z"}));const qt=()=>{};var jt=function(e){let{onClick:t=qt,small:n=!1}=e;const{shortcut:l,areAdvancedSettingsOpened:o}=(0,c.useSelect)((e=>({shortcut:e(zt.store).getShortcutRepresentation("core/edit-post/toggle-sidebar"),areAdvancedSettingsOpened:"edit-post/block"===e(Rt).getActiveGeneralSidebarName()})),[]),{openGeneralSidebar:r,closeGeneralSidebar:s}=(0,c.useDispatch)(Rt),i=o?(0,_.__)("Hide more settings"):(0,_.__)("Show more settings");return(0,a.createElement)(h.MenuItem,{onClick:()=>{o?(s(),(0,Te.speak)((0,_.__)("Block settings closed"))):(r("edit-post/block"),(0,Te.speak)((0,_.__)("Additional settings are now available in the Editor block settings sidebar"))),t()},shortcut:l},!n&&i)};function Kt(e){let{children:t,contentRef:n,shouldIframe:l,styles:o,assets:r,style:s}=e;const i=(0,E.__unstableUseMouseMoveTypingReset)();return l?(0,a.createElement)(E.__unstableIframe,{head:(0,a.createElement)(E.__unstableEditorStyles,{styles:o}),assets:r,ref:i,contentRef:n,style:{width:"100%",height:"100%",display:"block"},name:"editor-canvas"},t):(0,a.createElement)(a.Fragment,null,(0,a.createElement)(E.__unstableEditorStyles,{styles:o}),(0,a.createElement)(E.WritingFlow,{ref:n,className:"editor-styles-wrapper",style:{flex:"1",...s},tabIndex:-1},t))}function Yt(e){for(let t=0;t{const{isFeatureActive:t,isEditingTemplate:n,__experimentalGetPreviewDeviceType:l,getEditedPostTemplate:o}=e(Rt),{getCurrentPostId:r,getCurrentPostType:a,getEditorSettings:s}=e(T.store),i=n();let c;"wp_block"===a()?c="core/block":i||(c="core/post-content");const u=s().supportsTemplateMode;return{deviceType:l(),isWelcomeGuideVisible:t("welcomeGuide"),isTemplateMode:i,editedPostTemplate:u?o():{},wrapperBlockName:c,wrapperUniqueId:r()}}),[]),{isCleanNewPost:m}=(0,c.useSelect)(T.store),p=(0,c.useSelect)((e=>e(Rt).hasMetaBoxes()),[]),{themeHasDisabledLayoutStyles:g,themeSupportsLayout:f,assets:v}=(0,c.useSelect)((e=>{const t=e(E.store).getSettings();return{themeHasDisabledLayoutStyles:t.disableLayoutStyles,themeSupportsLayout:t.supportsLayout,assets:t.__unstableResolvedAssets}}),[]),{clearSelectedBlock:y}=(0,c.useDispatch)(E.store),{setIsEditingTemplate:w}=(0,c.useDispatch)(Rt),S={height:"100%",width:"100%",margin:0,display:"flex",flexFlow:"column",background:"white"},k={...S,borderRadius:"2px 2px 0 0",border:"1px solid #ddd",borderBottom:0},P=(0,E.__experimentalUseResizeCanvas)(l,r),C=(0,E.useSetting)("layout"),x="is-"+l.toLowerCase()+"-preview";let B,M=r?k:S;P&&(M=P),p||P||r||(B="40vh");const I=(0,a.useRef)(),N=(0,b.useMergeRefs)([I,(0,E.__unstableUseClipboardHandler)(),(0,E.__unstableUseTypewriter)(),(0,E.__unstableUseTypingObserver)(),(0,E.__unstableUseBlockSelectionClearer)()]),A=(0,E.__unstableUseBlockSelectionClearer)(),O=(0,a.useMemo)((()=>r?{type:"default"}:f?{...C,type:"constrained"}:{type:"default"}),[r,f,C]),D=(0,a.useMemo)((()=>{if(null!=i&&i.blocks)return Yt(null==i?void 0:i.blocks);const e="string"==typeof(null==i?void 0:i.content)?null==i?void 0:i.content:"";return Yt((0,s.parse)(e))||{}}),[null==i?void 0:i.content,null==i?void 0:i.blocks]),R=(0,E.__experimentaluseLayoutClasses)(D),F=L()({"is-layout-flow":!f},f&&R),V=(0,E.__experimentaluseLayoutStyles)(D,".block-editor-block-list__layout.is-root-container"),U=(null==D||null===(t=D.attributes)||void 0===t?void 0:t.layout)||{},G=(0,a.useMemo)((()=>U&&("constrained"===(null==U?void 0:U.type)||null!=U&&U.inherit||null!=U&&U.contentSize||null!=U&&U.wideSize)?{...C,...U,type:"constrained"}:{...C,...U,type:"default"}),[null==U?void 0:U.type,null==U?void 0:U.inherit,null==U?void 0:U.contentSize,null==U?void 0:U.wideSize,C]),H=D?G:O,z=(0,a.useRef)();return(0,a.useEffect)((()=>{var e;!o&&m()&&(null==z||null===(e=z.current)||void 0===e||e.focus())}),[o,m]),(0,a.createElement)(E.BlockTools,{__unstableContentRef:I,className:L()("edit-post-visual-editor",{"is-template-mode":r})},(0,a.createElement)(T.VisualEditorGlobalKeyboardShortcuts,null),(0,a.createElement)(h.__unstableMotion.div,{className:"edit-post-visual-editor__content-area",animate:{padding:r?"48px 48px 0":"0"},ref:A},r&&(0,a.createElement)(h.Button,{className:"edit-post-visual-editor__exit-template-mode",icon:Wt,onClick:()=>{y(),w(!1)}},(0,_.__)("Back")),(0,a.createElement)(h.__unstableMotion.div,{animate:M,initial:S,className:x},(0,a.createElement)(Kt,{shouldIframe:r||"Tablet"===l||"Mobile"===l,contentRef:N,styles:n,assets:v,style:{paddingBottom:B}},f&&!g&&!r&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(E.__experimentalLayoutStyle,{selector:".edit-post-visual-editor__post-title-wrapper, .block-editor-block-list__layout.is-root-container",layout:O,layoutDefinitions:null==C?void 0:C.definitions}),V&&(0,a.createElement)(E.__experimentalLayoutStyle,{layout:G,css:V,layoutDefinitions:null==C?void 0:C.definitions})),!r&&(0,a.createElement)("div",{className:"edit-post-visual-editor__post-title-wrapper",contentEditable:!1},(0,a.createElement)(T.PostTitle,{ref:z})),(0,a.createElement)(E.__experimentalRecursionProvider,{blockName:u,uniqueId:d},(0,a.createElement)(E.BlockList,{className:r?"wp-site-blocks":`${F} wp-block-post-content`,__experimentalLayout:H}))))),(0,a.createElement)(E.__unstableBlockSettingsMenuFirstItem,null,(e=>{let{onClose:t}=e;return(0,a.createElement)(jt,{onClick:t})})))}var Qt=function(){const{getBlockSelectionStart:e}=(0,c.useSelect)(E.store),{getEditorMode:t,isEditorSidebarOpened:n,isListViewOpened:l}=(0,c.useSelect)(Rt),o=(0,c.useSelect)((e=>{const{richEditingEnabled:t,codeEditingEnabled:n}=e(T.store).getEditorSettings();return!t||!n}),[]),{switchEditorMode:r,openGeneralSidebar:s,closeGeneralSidebar:i,toggleFeature:u,setIsListViewOpened:d}=(0,c.useDispatch)(Rt),{registerShortcut:m}=(0,c.useDispatch)(zt.store);return(0,a.useEffect)((()=>{m({name:"core/edit-post/toggle-mode",category:"global",description:(0,_.__)("Switch between visual editor and code editor."),keyCombination:{modifier:"secondary",character:"m"}}),m({name:"core/edit-post/toggle-fullscreen",category:"global",description:(0,_.__)("Toggle fullscreen mode."),keyCombination:{modifier:"secondary",character:"f"}}),m({name:"core/edit-post/toggle-list-view",category:"global",description:(0,_.__)("Open the block list view."),keyCombination:{modifier:"access",character:"o"}}),m({name:"core/edit-post/toggle-sidebar",category:"global",description:(0,_.__)("Show or hide the settings sidebar."),keyCombination:{modifier:"primaryShift",character:","}}),m({name:"core/edit-post/next-region",category:"global",description:(0,_.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),m({name:"core/edit-post/previous-region",category:"global",description:(0,_.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"}]}),m({name:"core/edit-post/keyboard-shortcuts",category:"main",description:(0,_.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}})}),[]),(0,zt.useShortcut)("core/edit-post/toggle-mode",(()=>{r("visual"===t()?"text":"visual")}),{isDisabled:o}),(0,zt.useShortcut)("core/edit-post/toggle-fullscreen",(()=>{u("fullscreenMode")})),(0,zt.useShortcut)("core/edit-post/toggle-sidebar",(t=>{if(t.preventDefault(),n())i();else{const t=e()?"edit-post/block":"edit-post/document";s(t)}})),(0,zt.useShortcut)("core/edit-post/toggle-list-view",(()=>d(!l()))),null};const Zt=[{keyCombination:{modifier:"primary",character:"b"},description:(0,_.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,_.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,_.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,_.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,_.__)("Insert a link to a post or page")},{keyCombination:{modifier:"primary",character:"u"},description:(0,_.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,_.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,_.__)("Make the selected text inline code.")}];function Jt(e){let{keyCombination:t,forceAriaLabel:n}=e;const l=t.modifier?x.displayShortcutList[t.modifier](t.character):t.character,o=t.modifier?x.shortcutAriaLabel[t.modifier](t.character):t.character;return(0,a.createElement)("kbd",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":n||o},(0,g.castArray)(l).map(((e,t)=>"+"===e?(0,a.createElement)(a.Fragment,{key:t},e):(0,a.createElement)("kbd",{key:t,className:"edit-post-keyboard-shortcut-help-modal__shortcut-key"},e))))}var en=function(e){let{description:t,keyCombination:n,aliases:l=[],ariaLabel:o}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-description"},t),(0,a.createElement)("div",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-term"},(0,a.createElement)(Jt,{keyCombination:n,forceAriaLabel:o}),l.map(((e,t)=>(0,a.createElement)(Jt,{keyCombination:e,forceAriaLabel:o,key:t})))))};var tn=function(e){let{name:t}=e;const{keyCombination:n,description:l,aliases:o}=(0,c.useSelect)((e=>{const{getShortcutKeyCombination:n,getShortcutDescription:l,getShortcutAliases:o}=e(zt.store);return{keyCombination:n(t),aliases:o(t),description:l(t)}}),[t]);return n?(0,a.createElement)(en,{keyCombination:n,description:l,aliases:o}):null};const nn="edit-post/keyboard-shortcut-help",ln=e=>{let{shortcuts:t}=e;return(0,a.createElement)("ul",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-list",role:"list"},t.map(((e,t)=>(0,a.createElement)("li",{className:"edit-post-keyboard-shortcut-help-modal__shortcut",key:t},"string"==typeof e?(0,a.createElement)(tn,{name:e}):(0,a.createElement)(en,e)))))},on=e=>{let{title:t,shortcuts:n,className:l}=e;return(0,a.createElement)("section",{className:L()("edit-post-keyboard-shortcut-help-modal__section",l)},!!t&&(0,a.createElement)("h2",{className:"edit-post-keyboard-shortcut-help-modal__section-title"},t),(0,a.createElement)(ln,{shortcuts:n}))},rn=e=>{let{title:t,categoryName:n,additionalShortcuts:l=[]}=e;const o=(0,c.useSelect)((e=>e(zt.store).getCategoryShortcuts(n)),[n]);return(0,a.createElement)(on,{title:t,shortcuts:o.concat(l)})};var an=(0,b.compose)([(0,c.withSelect)((e=>({isModalActive:e(Rt).isModalActive(nn)}))),(0,c.withDispatch)(((e,t)=>{let{isModalActive:n}=t;const{openModal:l,closeModal:o}=e(Rt);return{toggleModal:()=>n?o():l(nn)}}))])((function(e){let{isModalActive:t,toggleModal:n}=e;return(0,zt.useShortcut)("core/edit-post/keyboard-shortcuts",n),t?(0,a.createElement)(h.Modal,{className:"edit-post-keyboard-shortcut-help-modal",title:(0,_.__)("Keyboard shortcuts"),closeLabel:(0,_.__)("Close"),onRequestClose:n},(0,a.createElement)(on,{className:"edit-post-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/edit-post/keyboard-shortcuts"]}),(0,a.createElement)(rn,{title:(0,_.__)("Global shortcuts"),categoryName:"global"}),(0,a.createElement)(rn,{title:(0,_.__)("Selection shortcuts"),categoryName:"selection"}),(0,a.createElement)(rn,{title:(0,_.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,_.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,_.__)("Forward-slash")}]}),(0,a.createElement)(on,{title:(0,_.__)("Text formatting"),shortcuts:Zt})):null}));function sn(e){let{willEnable:t}=e;const[n,l]=(0,a.useState)(!1);return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("p",{className:"edit-post-preferences-modal__custom-fields-confirmation-message"},(0,_.__)("A page reload is required for this change. Make sure your content is saved before reloading.")),(0,a.createElement)(h.Button,{className:"edit-post-preferences-modal__custom-fields-confirmation-button",variant:"secondary",isBusy:n,disabled:n,onClick:()=>{l(!0),document.getElementById("toggle-custom-fields-form").submit()}},t?(0,_.__)("Enable & Reload"):(0,_.__)("Disable & Reload")))}var cn=(0,c.withSelect)((e=>({areCustomFieldsEnabled:!!e(T.store).getEditorSettings().enableCustomFields})))((function(e){let{label:t,areCustomFieldsEnabled:n}=e;const[l,o]=(0,a.useState)(n);return(0,a.createElement)(Pe,{label:t,isChecked:l,onChange:o},l!==n&&(0,a.createElement)(sn,{willEnable:l}))})),un=(0,b.compose)((0,c.withSelect)(((e,t)=>{let{panelName:n}=t;const{isEditorPanelEnabled:l,isEditorPanelRemoved:o}=e(Rt);return{isRemoved:o(n),isChecked:l(n)}})),(0,b.ifCondition)((e=>{let{isRemoved:t}=e;return!t})),(0,c.withDispatch)(((e,t)=>{let{panelName:n}=t;return{onChange:()=>e(Rt).toggleEditorPanelEnabled(n)}})))(Pe);const{Fill:dn,Slot:mn}=(0,h.createSlotFill)("EnablePluginDocumentSettingPanelOption"),pn=e=>{let{label:t,panelName:n}=e;return(0,a.createElement)(dn,null,(0,a.createElement)(un,{label:t,panelName:n}))};pn.Slot=mn;var gn=pn,hn=(0,b.compose)((0,c.withSelect)((e=>({isChecked:e(T.store).isPublishSidebarEnabled()}))),(0,c.withDispatch)((e=>{const{enablePublishSidebar:t,disablePublishSidebar:n}=e(T.store);return{onChange:e=>e?t():n()}})),(0,F.ifViewportMatches)("medium"))(Pe),En=(0,b.compose)((0,c.withSelect)(((e,t)=>{let{featureName:n}=t;const{isFeatureActive:l}=e(Rt);return{isChecked:l(n)}})),(0,c.withDispatch)(((e,t)=>{let{featureName:n}=t;return{onChange:()=>e(Rt).toggleFeature(n)}})))(Pe);var _n=(0,c.withSelect)((e=>{const{getEditorSettings:t}=e(T.store),{getAllMetaBoxes:n}=e(Rt);return{areCustomFieldsRegistered:void 0!==t().enableCustomFields,metaBoxes:n()}}))((function(e){let{areCustomFieldsRegistered:t,metaBoxes:n,...l}=e;const o=(0,g.filter)(n,(e=>{let{id:t}=e;return"postcustom"!==t}));return t||0!==o.length?(0,a.createElement)(ke,l,t&&(0,a.createElement)(cn,{label:(0,_.__)("Custom fields")}),(0,g.map)(o,(e=>{let{id:t,title:n}=e;return(0,a.createElement)(un,{key:t,label:n,panelName:`meta-box-${t}`})}))):null}));var bn=function(e){let{blockTypes:t,value:n,onItemChange:l}=e;return(0,a.createElement)("ul",{className:"edit-post-block-manager__checklist"},t.map((e=>(0,a.createElement)("li",{key:e.name,className:"edit-post-block-manager__checklist-item"},(0,a.createElement)(h.CheckboxControl,{label:(0,a.createElement)(a.Fragment,null,e.title,(0,a.createElement)(E.BlockIcon,{icon:e.icon})),checked:n.includes(e.name),onChange:function(){for(var t=arguments.length,n=new Array(t),o=0;o{const{getEditorSettings:t}=e(T.store),{getHiddenBlockTypes:n}=e(Rt);return{defaultAllowedBlockTypes:t().defaultAllowedBlockTypes,hiddenBlockTypes:n()}}),[]),i=(0,a.useMemo)((()=>!0===r?l:l.filter((e=>{let{name:t}=e;return(0,g.includes)(r||[],t)}))),[r,l]),{showBlockTypes:u,hideBlockTypes:d}=(0,c.useDispatch)(Rt),m=(0,a.useCallback)(((e,t)=>{t?u(e):d(e)}),[]),p=(0,a.useCallback)((e=>{const t=(0,g.map)(l,"name");e?u(t):d(t)}),[l]);if(!i.length)return null;const E=(0,g.without)((0,g.map)(i,"name"),...s),_="edit-post-block-manager__category-title-"+o,f=E.length===i.length;let v;return v=f?"true":E.length>0?"mixed":"false",(0,a.createElement)("div",{role:"group","aria-labelledby":_,className:"edit-post-block-manager__category"},(0,a.createElement)(h.CheckboxControl,{checked:f,onChange:p,className:"edit-post-block-manager__category-title","aria-checked":v,label:(0,a.createElement)("span",{id:_},n)}),(0,a.createElement)(bn,{blockTypes:i,value:E,onItemChange:m}))};var vn=(0,c.withSelect)((e=>{const{getBlockTypes:t,getCategories:n,hasBlockSupport:l,isMatchingSearchTerm:o}=e(s.store),{getHiddenBlockTypes:r}=e(Rt),a=t(),i=r().filter((e=>a.some((t=>t.name===e)))),c=Array.isArray(i)&&i.length;return{blockTypes:a,categories:n(),hasBlockSupport:l,isMatchingSearchTerm:o,numberOfHiddenBlocks:c}}))((function(e){let{blockTypes:t,categories:n,hasBlockSupport:l,isMatchingSearchTerm:o,numberOfHiddenBlocks:r}=e;const s=(0,b.useDebounce)(Te.speak,500),[i,c]=(0,a.useState)("");return t=t.filter((e=>l(e,"inserter",!0)&&(!i||o(e,i))&&(!e.parent||(0,g.includes)(e.parent,"core/post-content")))),(0,a.useEffect)((()=>{if(!i)return;const e=t.length,n=(0,_.sprintf)((0,_._n)("%d result found.","%d results found.",e),e);s(n)}),[t.length,i,s]),(0,a.createElement)("div",{className:"edit-post-block-manager__content"},!!r&&(0,a.createElement)("div",{className:"edit-post-block-manager__disabled-blocks-count"},(0,_.sprintf)((0,_._n)("%d block is hidden.","%d blocks are hidden.",r),r)),(0,a.createElement)(h.SearchControl,{label:(0,_.__)("Search for a block"),placeholder:(0,_.__)("Search for a block"),value:i,onChange:e=>c(e),className:"edit-post-block-manager__search"}),(0,a.createElement)("div",{tabIndex:"0",role:"region","aria-label":(0,_.__)("Available block types"),className:"edit-post-block-manager__results"},0===t.length&&(0,a.createElement)("p",{className:"edit-post-block-manager__no-results"},(0,_.__)("No blocks found.")),n.map((e=>(0,a.createElement)(fn,{key:e.slug,title:e.title,blockTypes:(0,g.filter)(t,{category:e.slug})}))),(0,a.createElement)(fn,{title:(0,_.__)("Uncategorized"),blockTypes:(0,g.filter)(t,(e=>{let{category:t}=e;return!t}))})))}));function yn(){const e=(0,b.useViewportMatch)("medium"),{closeModal:t}=(0,c.useDispatch)(Rt),n=(0,c.useSelect)((e=>e(Rt).isModalActive("edit-post/preferences")),[]),l=(0,c.useSelect)((t=>{const{getEditorSettings:n}=t(T.store),{getEditorMode:l,isFeatureActive:o}=t(Rt),r=l(),a=n().richEditingEnabled;return!o("reducedUI")&&e&&a&&"visual"===r}),[e]),o=(0,a.useMemo)((()=>[{name:"general",tabLabel:(0,_.__)("General"),content:(0,a.createElement)(a.Fragment,null,e&&(0,a.createElement)(ke,{title:(0,_.__)("Publishing"),description:(0,_.__)("Change options related to publishing.")},(0,a.createElement)(hn,{help:(0,_.__)("Review settings, such as visibility and tags."),label:(0,_.__)("Include pre-publish checklist")})),(0,a.createElement)(ke,{title:(0,_.__)("Appearance"),description:(0,_.__)("Customize options related to the block editor interface and editing flow.")},(0,a.createElement)(En,{featureName:"focusMode",help:(0,_.__)("Highlights the current block and fades other content."),label:(0,_.__)("Spotlight mode")}),(0,a.createElement)(En,{featureName:"showIconLabels",label:(0,_.__)("Show button text labels"),help:(0,_.__)("Show text instead of icons on buttons.")}),(0,a.createElement)(En,{featureName:"showListViewByDefault",help:(0,_.__)("Opens the block list view sidebar by default."),label:(0,_.__)("Always open list view")}),(0,a.createElement)(En,{featureName:"reducedUI",help:(0,_.__)("Compacts options and outlines in the toolbar."),label:(0,_.__)("Reduce the interface")}),(0,a.createElement)(En,{featureName:"themeStyles",help:(0,_.__)("Make the editor look like your theme."),label:(0,_.__)("Use theme styles")}),l&&(0,a.createElement)(En,{featureName:"showBlockBreadcrumbs",help:(0,_.__)("Shows block breadcrumbs at the bottom of the editor."),label:(0,_.__)("Display block breadcrumbs")})))},{name:"blocks",tabLabel:(0,_.__)("Blocks"),content:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(ke,{title:(0,_.__)("Block interactions"),description:(0,_.__)("Customize how you interact with blocks in the block library and editing canvas.")},(0,a.createElement)(En,{featureName:"mostUsedBlocks",help:(0,_.__)("Places the most frequent blocks in the block library."),label:(0,_.__)("Show most used blocks")}),(0,a.createElement)(En,{featureName:"keepCaretInsideBlock",help:(0,_.__)("Aids screen readers by stopping text caret from leaving blocks."),label:(0,_.__)("Contain text cursor inside block")})),(0,a.createElement)(ke,{title:(0,_.__)("Visible blocks"),description:(0,_.__)("Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.")},(0,a.createElement)(vn,null)))},{name:"panels",tabLabel:(0,_.__)("Panels"),content:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(ke,{title:(0,_.__)("Document settings"),description:(0,_.__)("Choose what displays in the panel.")},(0,a.createElement)(gn.Slot,null),(0,a.createElement)(T.PostTaxonomies,{taxonomyWrapper:(e,t)=>(0,a.createElement)(un,{label:(0,g.get)(t,["labels","menu_name"]),panelName:`taxonomy-panel-${t.slug}`})}),(0,a.createElement)(T.PostFeaturedImageCheck,null,(0,a.createElement)(un,{label:(0,_.__)("Featured image"),panelName:"featured-image"})),(0,a.createElement)(T.PostExcerptCheck,null,(0,a.createElement)(un,{label:(0,_.__)("Excerpt"),panelName:"post-excerpt"})),(0,a.createElement)(T.PostTypeSupportCheck,{supportKeys:["comments","trackbacks"]},(0,a.createElement)(un,{label:(0,_.__)("Discussion"),panelName:"discussion-panel"})),(0,a.createElement)(T.PageAttributesCheck,null,(0,a.createElement)(un,{label:(0,_.__)("Page attributes"),panelName:"page-attributes"}))),(0,a.createElement)(_n,{title:(0,_.__)("Additional"),description:(0,_.__)("Add extra areas to the editor.")}))}]),[e,l]);return n?(0,a.createElement)(be,{closeModal:t},(0,a.createElement)(Se,{sections:o})):null}class wn extends a.Component{constructor(){super(...arguments),this.state={historyId:null}}componentDidUpdate(e){const{postId:t,postStatus:n,postType:l,isSavingPost:o}=this.props,{historyId:r}=this.state;"trash"!==n||o?t===e.postId&&t===r||"auto-draft"===n||!t||this.setBrowserURL(t):this.setTrashURL(t,l)}setTrashURL(e,t){window.location.href=function(e,t){return(0,k.addQueryArgs)("edit.php",{trashed:1,post_type:t,ids:e})}(e,t)}setBrowserURL(e){window.history.replaceState({id:e},"Post "+e,function(e){return(0,k.addQueryArgs)("post.php",{post:e,action:"edit"})}(e)),this.setState((()=>({historyId:e})))}render(){return null}}var Sn=(0,c.withSelect)((e=>{const{getCurrentPost:t,isSavingPost:n}=e(T.store),l=t();let{id:o,status:r,type:a}=l;return["wp_template","wp_template_part"].includes(a)&&(o=l.wp_id),{postId:o,postStatus:r,postType:a,isSavingPost:n()}}))(wn);var kn=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,a.createElement)(y.Path,{d:"M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"}));var Pn=function(e){let{showTooltip:t,icon:n,href:l}=e;const{isActive:o,isRequestingSiteIcon:r,postType:s,siteIconUrl:i}=(0,c.useSelect)((e=>{const{getCurrentPostType:t}=e(T.store),{isFeatureActive:n}=e(Rt),{getEntityRecord:l,getPostType:o,isResolving:r}=e(Ce.store),a=l("root","__unstableBase",void 0)||{};return{isActive:n("fullscreenMode"),isRequestingSiteIcon:r("getEntityRecord",["root","__unstableBase",void 0]),postType:o(t()),siteIconUrl:a.site_icon_url}}),[]),u=(0,b.useReducedMotion)();if(!o||!s)return null;let d=(0,a.createElement)(h.Icon,{size:"36px",icon:kn});const m={expand:{scale:1.25,transition:{type:"tween",duration:"0.3"}}};i&&(d=(0,a.createElement)(h.__unstableMotion.img,{variants:!u&&m,alt:(0,_.__)("Site Icon"),className:"edit-post-fullscreen-mode-close_site-icon",src:i})),r&&(d=null),n&&(d=(0,a.createElement)(h.Icon,{size:"36px",icon:n}));const p=L()({"edit-post-fullscreen-mode-close":!0,"has-icon":i});return(0,a.createElement)(h.__unstableMotion.div,{whileHover:"expand"},(0,a.createElement)(h.Button,{className:p,href:null!=l?l:(0,k.addQueryArgs)("edit.php",{post_type:s.slug}),label:(0,g.get)(s,["labels","view_items"],(0,_.__)("Back")),showTooltip:t},d))};var Tn=(0,a.createElement)(y.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(y.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));var Cn=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));const xn=e=>{e.preventDefault()};var Bn=function(){const e=(0,a.useRef)(),{setIsInserterOpened:t,setIsListViewOpened:n}=(0,c.useDispatch)(Rt),{isInserterEnabled:l,isInserterOpened:o,isTextModeEnabled:r,showIconLabels:s,isListViewOpen:i,listViewShortcut:u}=(0,c.useSelect)((e=>{const{hasInserterItems:t,getBlockRootClientId:n,getBlockSelectionEnd:l}=e(E.store),{getEditorSettings:o}=e(T.store),{getEditorMode:r,isFeatureActive:a,isListViewOpened:s}=e(Rt),{getShortcutRepresentation:i}=e(zt.store);return{isInserterEnabled:"visual"===r()&&o().richEditingEnabled&&t(n(l())),isInserterOpened:e(Rt).isInserterOpened(),isTextModeEnabled:"text"===r(),showIconLabels:a("showIconLabels"),isListViewOpen:s(),listViewShortcut:i("core/edit-post/toggle-list-view")}}),[]),d=(0,b.useViewportMatch)("medium"),m=(0,b.useViewportMatch)("wide"),p=(0,_.__)("Document tools"),g=(0,a.useCallback)((()=>n(!i)),[n,i]),f=(0,a.createElement)(a.Fragment,null,(0,a.createElement)(h.ToolbarItem,{as:T.TableOfContents,hasOutlineItemsDisabled:r,repositionDropdown:s&&!m,showTooltip:!s,variant:s?"tertiary":void 0}),(0,a.createElement)(h.ToolbarItem,{as:h.Button,className:"edit-post-header-toolbar__list-view-toggle",icon:Tn,disabled:r,isPressed:i,label:(0,_.__)("List View"),onClick:g,shortcut:u,showTooltip:!s,variant:s?"tertiary":void 0})),v=(0,a.useCallback)((()=>{o?e.current.focus():t(!0)}),[o,t]),y=(0,_._x)("Toggle block inserter","Generic label for block inserter button"),w=o?(0,_.__)("Close"):(0,_.__)("Add");return(0,a.createElement)(E.NavigableToolbar,{className:"edit-post-header-toolbar","aria-label":p},(0,a.createElement)("div",{className:"edit-post-header-toolbar__left"},(0,a.createElement)(h.ToolbarItem,{ref:e,as:h.Button,className:"edit-post-header-toolbar__inserter-toggle",variant:"primary",isPressed:o,onMouseDown:xn,onClick:v,disabled:!l,icon:Cn,label:s?w:y,showTooltip:!s}),(m||!s)&&(0,a.createElement)(a.Fragment,null,d&&(0,a.createElement)(h.ToolbarItem,{as:E.ToolSelector,showTooltip:!s,variant:s?"tertiary":void 0,disabled:r}),(0,a.createElement)(h.ToolbarItem,{as:T.EditorHistoryUndo,showTooltip:!s,variant:s?"tertiary":void 0}),(0,a.createElement)(h.ToolbarItem,{as:T.EditorHistoryRedo,showTooltip:!s,variant:s?"tertiary":void 0}),f)))};const Mn=[{value:"visual",label:(0,_.__)("Visual editor")},{value:"text",label:(0,_.__)("Code editor")}];var In=function(){const{shortcut:e,isRichEditingEnabled:t,isCodeEditingEnabled:n,isEditingTemplate:l,mode:o}=(0,c.useSelect)((e=>({shortcut:e(zt.store).getShortcutRepresentation("core/edit-post/toggle-mode"),isRichEditingEnabled:e(T.store).getEditorSettings().richEditingEnabled,isCodeEditingEnabled:e(T.store).getEditorSettings().codeEditingEnabled,isEditingTemplate:e(Rt).isEditingTemplate(),mode:e(Rt).getEditorMode()})),[]),{switchEditorMode:r}=(0,c.useDispatch)(Rt);if(l)return null;if(!t||!n)return null;const s=Mn.map((t=>t.value!==o?{...t,shortcut:e}:t));return(0,a.createElement)(h.MenuGroup,{label:(0,_.__)("Editor")},(0,a.createElement)(h.MenuItemsChoice,{choices:s,value:o,onSelect:r}))};function Nn(){const{openModal:e}=(0,c.useDispatch)(Rt);return(0,a.createElement)(h.MenuItem,{onClick:()=>{e("edit-post/preferences")}},(0,_.__)("Preferences"))}var An=function(){return(0,b.useViewportMatch)("medium")?(0,a.createElement)(h.MenuGroup,{label:(0,_._x)("View","noun")},(0,a.createElement)(d.PreferenceToggleMenuItem,{scope:"core/edit-post",name:"fixedToolbar",label:(0,_.__)("Top toolbar"),info:(0,_.__)("Access all block and document tools in a single place"),messageActivated:(0,_.__)("Top toolbar activated"),messageDeactivated:(0,_.__)("Top toolbar deactivated")}),(0,a.createElement)(d.PreferenceToggleMenuItem,{scope:"core/edit-post",name:"focusMode",label:(0,_.__)("Spotlight mode"),info:(0,_.__)("Focus on one block at a time"),messageActivated:(0,_.__)("Spotlight mode activated"),messageDeactivated:(0,_.__)("Spotlight mode deactivated")}),(0,a.createElement)(d.PreferenceToggleMenuItem,{scope:"core/edit-post",name:"fullscreenMode",label:(0,_.__)("Fullscreen mode"),info:(0,_.__)("Work without distraction"),messageActivated:(0,_.__)("Fullscreen mode activated"),messageDeactivated:(0,_.__)("Fullscreen mode deactivated"),shortcut:x.displayShortcut.secondary("f")})):null};var Ln=e=>{let{showIconLabels:t}=e;const n=(0,b.useViewportMatch)("large");return(0,a.createElement)(_e,{toggleProps:{showTooltip:!t,...t&&{variant:"tertiary"}}},(e=>{let{onClose:l}=e;return(0,a.createElement)(a.Fragment,null,t&&!n&&(0,a.createElement)(ue.Slot,{className:t&&"show-icon-labels",scope:"core/edit-post"}),(0,a.createElement)(An,null),(0,a.createElement)(In,null),(0,a.createElement)(ae.Slot,{name:"core/edit-post/plugin-more-menu",label:(0,_.__)("Plugins"),as:h.MenuGroup,fillProps:{onClick:l}}),(0,a.createElement)(Gt.Slot,{fillProps:{onClose:l}}),(0,a.createElement)(h.MenuGroup,null,(0,a.createElement)(Nn,null)))}))};var On=(0,b.compose)((0,c.withSelect)((e=>({hasPublishAction:(0,g.get)(e(T.store).getCurrentPost(),["_links","wp:action-publish"],!1),isBeingScheduled:e(T.store).isEditedPostBeingScheduled(),isPending:e(T.store).isCurrentPostPending(),isPublished:e(T.store).isCurrentPostPublished(),isPublishSidebarEnabled:e(T.store).isPublishSidebarEnabled(),isPublishSidebarOpened:e(Rt).isPublishSidebarOpened(),isScheduled:e(T.store).isCurrentPostScheduled()}))),(0,c.withDispatch)((e=>{const{togglePublishSidebar:t}=e(Rt);return{togglePublishSidebar:t}})))((function(e){let{forceIsDirty:t,forceIsSaving:n,hasPublishAction:l,isBeingScheduled:o,isPending:r,isPublished:s,isPublishSidebarEnabled:i,isPublishSidebarOpened:c,isScheduled:u,togglePublishSidebar:d,setEntitiesSavedStatesCallback:m}=e;const p="toggle",g="button",h=(0,b.useViewportMatch)("medium","<");let E;return E=s||u&&o||r&&!l&&!h?g:h||i?p:g,(0,a.createElement)(T.PostPublishButton,{forceIsDirty:t,forceIsSaving:n,isOpen:c,isToggle:E===p,onToggle:d,setEntitiesSavedStatesCallback:m})}));function Dn(){const{hasActiveMetaboxes:e,isPostSaveable:t,isSaving:n,isViewable:l,deviceType:o}=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t}=e(T.store),{getPostType:n}=e(Ce.store),l=n(t("type"));return{hasActiveMetaboxes:e(Rt).hasMetaBoxes(),isSaving:e(Rt).isSavingMetaBoxes(),isPostSaveable:e(T.store).isEditedPostSaveable(),isViewable:(0,g.get)(l,["viewable"],!1),deviceType:e(Rt).__experimentalGetPreviewDeviceType()}}),[]),{__experimentalSetPreviewDeviceType:r}=(0,c.useDispatch)(Rt);return(0,a.createElement)(E.__experimentalPreviewOptions,{isEnabled:t,className:"edit-post-post-preview-dropdown",deviceType:o,setDeviceType:r,viewLabel:(0,_.__)("Preview")},l&&(0,a.createElement)(h.MenuGroup,null,(0,a.createElement)("div",{className:"edit-post-header-preview__grouping-external"},(0,a.createElement)(T.PostPreviewButton,{className:"edit-post-header-preview__button-external",role:"menuitem",forceIsAutosaveable:e,forcePreviewLink:n?null:void 0,textContent:(0,a.createElement)(a.Fragment,null,(0,_.__)("Preview in new tab"),(0,a.createElement)(h.Icon,{icon:w}))}))))}const Rn="__experimentalMainDashboardButton",{Fill:Fn,Slot:Vn}=(0,h.createSlotFill)(Rn),Un=Fn;Un.Slot=e=>{let{children:t}=e;const n=(0,h.__experimentalUseSlot)(Rn);return Boolean(n.fills&&n.fills.length)?(0,a.createElement)(Vn,{bubblesVirtually:!0}):t};var Gn=Un;var Hn=(0,a.createElement)(y.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(y.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));function zn(){const{clearSelectedBlock:e}=(0,c.useDispatch)(E.store),{setIsEditingTemplate:t}=(0,c.useDispatch)(Rt),{getEditorSettings:n}=(0,c.useSelect)(T.store),{updateEditorSettings:l,editPost:o}=(0,c.useDispatch)(T.store),{deleteEntityRecord:r}=(0,c.useDispatch)(Ce.store),{template:s}=(0,c.useSelect)((e=>{const{isEditingTemplate:t,getEditedPostTemplate:n}=e(Rt);return{template:t()?n():null}}),[]),[i,u]=(0,a.useState)(!1);if(!s||!s.wp_id)return null;let d=s.slug;null!=s&&s.title&&(d=s.title);const m=null==s?void 0:s.has_theme_file;return(0,a.createElement)(h.MenuGroup,{className:"edit-post-template-top-area__second-menu-group"},(0,a.createElement)(a.Fragment,null,(0,a.createElement)(h.MenuItem,{className:"edit-post-template-top-area__delete-template-button",isDestructive:!m,onClick:()=>{u(!0)},info:m?(0,_.__)("Use the template as supplied by the theme."):void 0},m?(0,_.__)("Clear customizations"):(0,_.__)("Delete template")),(0,a.createElement)(h.__experimentalConfirmDialog,{isOpen:i,onConfirm:()=>{e(),t(!1),u(!1),o({template:""});const a=n(),i=(0,g.pickBy)(a.availableTemplates,((e,t)=>t!==s.slug));l({...a,availableTemplates:i}),r("postType","wp_template",s.id,{throwOnError:!0})},onCancel:()=>{u(!1)}},(0,_.sprintf)((0,_.__)("Are you sure you want to delete the %s template? It may be used by other pages or posts."),d))))}function $n(){const[e,t]=(0,a.useState)(!1),{template:n}=(0,c.useSelect)((e=>{const{getEditedPostTemplate:t}=e(Rt);return{template:t()}}),[]),{editEntityRecord:l}=(0,c.useDispatch)(Ce.store),{getEditorSettings:o}=(0,c.useSelect)(T.store),{updateEditorSettings:r}=(0,c.useDispatch)(T.store);if(!n.is_custom||n.has_theme_file)return null;let s=(0,_.__)("Default");return null!=n&&n.title?s=n.title:n&&(s=n.slug),(0,a.createElement)("div",{className:"edit-site-template-details__group"},(0,a.createElement)(h.TextControl,{label:(0,_.__)("Title"),value:e?"":s,help:(0,_.__)('Give the template a title that indicates its purpose, e.g. "Full Width".'),onChange:a=>{if(!a&&!e)return void t(!0);t(!1);const s=o(),i=(0,g.mapValues)(s.availableTemplates,((e,t)=>t!==n.slug?e:a));r({...s,availableTemplates:i}),l("postType","wp_template",n.id,{title:a})},onBlur:()=>t(!1)}))}function Wn(){const{description:e,title:t}=(0,c.useSelect)((e=>{const{getEditedPostTemplate:t}=e(Rt);return{title:t().title,description:t().description}}),[]);return e?(0,a.createElement)("div",{className:"edit-site-template-details__group"},(0,a.createElement)(h.__experimentalHeading,{level:4,weight:600},t),(0,a.createElement)(h.__experimentalText,{className:"edit-post-template-details__description",size:"body",as:"p",style:{marginTop:"12px"}},e)):null}var qn=function(){const{template:e,isEditing:t,title:n}=(0,c.useSelect)((e=>{const{isEditingTemplate:t,getEditedPostTemplate:n}=e(Rt),{getEditedPostAttribute:l}=e(T.store),o=t();return{template:o?n():null,isEditing:o,title:l("title")?l("title"):(0,_.__)("Untitled")}}),[]),{clearSelectedBlock:l}=(0,c.useDispatch)(E.store),{setIsEditingTemplate:o}=(0,c.useDispatch)(Rt);if(!t||!e)return null;let r=(0,_.__)("Default");null!=e&&e.title?r=e.title:e&&(r=e.slug);const s=!!(e.custom||e.wp_id||e.description);return(0,a.createElement)("div",{className:"edit-post-template-top-area"},(0,a.createElement)(h.Button,{className:"edit-post-template-post-title",isLink:!0,showTooltip:!0,label:(0,_.sprintf)((0,_.__)("Edit %s"),n),onClick:()=>{l(),o(!1)}},n),s?(0,a.createElement)(h.Dropdown,{position:"bottom center",contentClassName:"edit-post-template-top-area__popover",renderToggle:e=>{let{onToggle:t}=e;return(0,a.createElement)(h.Button,{className:"edit-post-template-title",isLink:!0,icon:Hn,showTooltip:!0,onClick:t,label:(0,_.__)("Template Options")},r)},renderContent:()=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)($n,null),(0,a.createElement)(Wn,null),(0,a.createElement)(zn,null))}):(0,a.createElement)(h.__experimentalText,{className:"edit-post-template-title",size:"body",style:{lineHeight:"24px"}},r))};var jn=function(e){let{setEntitiesSavedStatesCallback:t}=e;const{hasActiveMetaboxes:n,isPublishSidebarOpened:l,isSaving:o,showIconLabels:r,hasReducedUI:s}=(0,c.useSelect)((e=>({hasActiveMetaboxes:e(Rt).hasMetaBoxes(),isPublishSidebarOpened:e(Rt).isPublishSidebarOpened(),isSaving:e(Rt).isSavingMetaBoxes(),showIconLabels:e(Rt).isFeatureActive("showIconLabels"),hasReducedUI:e(Rt).isFeatureActive("reducedUI")})),[]),i=(0,b.useViewportMatch)("large"),u=L()("edit-post-header",{"has-reduced-ui":s});return(0,a.createElement)("div",{className:u},(0,a.createElement)(Gn.Slot,null,(0,a.createElement)(Pn,{showTooltip:!0})),(0,a.createElement)("div",{className:"edit-post-header__toolbar"},(0,a.createElement)(Bn,null),(0,a.createElement)(qn,null)),(0,a.createElement)("div",{className:"edit-post-header__settings"},!l&&(0,a.createElement)(T.PostSavedState,{forceIsDirty:n,forceIsSaving:o,showIconLabels:r}),(0,a.createElement)(Dn,null),(0,a.createElement)(T.PostPreviewButton,{forceIsAutosaveable:n,forcePreviewLink:o?null:void 0}),(0,a.createElement)(On,{forceIsDirty:n,forceIsSaving:o,setEntitiesSavedStatesCallback:t}),(i||!r)&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(ue.Slot,{scope:"core/edit-post"}),(0,a.createElement)(Ln,{showIconLabels:r})),r&&!i&&(0,a.createElement)(Ln,{showIconLabels:r})))};var Kn=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.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"}));function Yn(){const{insertionPoint:e,showMostUsedBlocks:t}=(0,c.useSelect)((e=>{const{isFeatureActive:t,__experimentalGetInsertionPoint:n}=e(Rt);return{insertionPoint:n(),showMostUsedBlocks:t("mostUsedBlocks")}}),[]),{setIsInserterOpened:n}=(0,c.useDispatch)(Rt),l=(0,b.useViewportMatch)("medium","<"),o=l?"div":h.VisuallyHidden,[r,s]=(0,b.__experimentalUseDialog)({onClose:()=>n(!1),focusOnMount:null}),i=(0,a.useRef)();return(0,a.useEffect)((()=>{i.current.focusSearch()}),[]),(0,a.createElement)("div",p({ref:r},s,{className:"edit-post-editor__inserter-panel"}),(0,a.createElement)(o,{className:"edit-post-editor__inserter-panel-header"},(0,a.createElement)(h.Button,{icon:Kn,label:(0,_.__)("Close block inserter"),onClick:()=>n(!1)})),(0,a.createElement)("div",{className:"edit-post-editor__inserter-panel-content"},(0,a.createElement)(E.__experimentalLibrary,{showMostUsedBlocks:t,showInserterHelpPanel:!0,shouldFocusBlock:l,rootClientId:e.rootClientId,__experimentalInsertionIndex:e.insertionIndex,__experimentalFilterValue:e.filterValue,ref:i})))}function Xn(){const{setIsListViewOpened:e}=(0,c.useDispatch)(Rt),t=(0,b.useFocusOnMount)("firstElement"),n=(0,b.useFocusReturn)(),l=(0,b.useFocusReturn)();const o=`edit-post-editor__list-view-panel-label-${(0,b.useInstanceId)(Xn)}`;return(0,a.createElement)("div",{"aria-labelledby":o,className:"edit-post-editor__list-view-panel",onKeyDown:function(t){t.keyCode!==x.ESCAPE||t.defaultPrevented||(t.preventDefault(),e(!1))}},(0,a.createElement)("div",{className:"edit-post-editor__list-view-panel-header",ref:n},(0,a.createElement)("strong",{id:o},(0,_.__)("List View")),(0,a.createElement)(h.Button,{icon:V,label:(0,_.__)("Close List View Sidebar"),onClick:()=>e(!1)})),(0,a.createElement)("div",{className:"edit-post-editor__list-view-panel-content",ref:(0,b.useMergeRefs)([l,t])},(0,a.createElement)(E.__experimentalListView,null)))}var Qn=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.Path,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"}));var Zn=e=>{let{sidebarName:t}=e;const{openGeneralSidebar:n}=(0,c.useDispatch)(Rt),l=()=>n("edit-post/document"),{documentLabel:o,isTemplateMode:r}=(0,c.useSelect)((e=>({documentLabel:e(T.store).getPostTypeLabel()||(0,_._x)("Document","noun"),isTemplateMode:e(Rt).isEditingTemplate()})),[]),[s,i]="edit-post/document"===t?[(0,_.sprintf)((0,_.__)("%s (selected)"),o),"is-active"]:[o,""],[u,d]="edit-post/block"===t?[(0,_.__)("Block (selected)"),"is-active"]:[(0,_.__)("Block"),""],[m,p]="edit-post/document"===t?[(0,_.__)("Template (selected)"),"is-active"]:[(0,_.__)("Template"),""];return(0,a.createElement)("ul",null,!r&&(0,a.createElement)("li",null,(0,a.createElement)(h.Button,{onClick:l,className:`edit-post-sidebar__panel-tab ${i}`,"aria-label":s,"data-label":o},o)),r&&(0,a.createElement)("li",null,(0,a.createElement)(h.Button,{onClick:l,className:`edit-post-sidebar__panel-tab ${p}`,"aria-label":m,"data-label":(0,_.__)("Template")},(0,_.__)("Template"))),(0,a.createElement)("li",null,(0,a.createElement)(h.Button,{onClick:()=>n("edit-post/block"),className:`edit-post-sidebar__panel-tab ${d}`,"aria-label":u,"data-label":(0,_.__)("Block")},(0,_.__)("Block"))))};function Jn(e){let{isOpen:t,onClick:n}=e;const l=(0,T.usePostVisibilityLabel)();return(0,a.createElement)(h.Button,{className:"edit-post-post-visibility__toggle",variant:"tertiary","aria-expanded":t,"aria-label":(0,_.sprintf)((0,_.__)("Select visibility: %s"),l),onClick:n},l)}var el=function(){const[e,t]=(0,a.useState)(null),n=(0,a.useMemo)((()=>({anchor:e})),[e]);return(0,a.createElement)(T.PostVisibilityCheck,{render:e=>{let{canEdit:l}=e;return(0,a.createElement)(h.PanelRow,{ref:t,className:"edit-post-post-visibility"},(0,a.createElement)("span",null,(0,_.__)("Visibility")),!l&&(0,a.createElement)("span",null,(0,a.createElement)(T.PostVisibilityLabel,null)),l&&(0,a.createElement)(h.Dropdown,{position:"bottom left",contentClassName:"edit-post-post-visibility__dialog",popoverProps:n,focusOnMount:!0,renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,a.createElement)(Jn,{isOpen:t,onClick:n})},renderContent:e=>{let{onClose:t}=e;return(0,a.createElement)(T.PostVisibility,{onClose:t})}}))}})};function tl(){return(0,a.createElement)(T.PostTrashCheck,null,(0,a.createElement)(h.PanelRow,null,(0,a.createElement)(T.PostTrash,null)))}function nl(){const[e,t]=(0,a.useState)(null),n=(0,a.useMemo)((()=>({anchor:e})),[e]);return(0,a.createElement)(T.PostScheduleCheck,null,(0,a.createElement)(h.PanelRow,{className:"edit-post-post-schedule",ref:t},(0,a.createElement)("span",null,(0,_.__)("Publish")),(0,a.createElement)(h.Dropdown,{popoverProps:n,position:"bottom left",contentClassName:"edit-post-post-schedule__dialog",focusOnMount:!0,renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,a.createElement)(ll,{isOpen:t,onClick:n})},renderContent:e=>{let{onClose:t}=e;return(0,a.createElement)(T.PostSchedule,{onClose:t})}})))}function ll(e){let{isOpen:t,onClick:n}=e;const l=(0,T.usePostScheduleLabel)(),o=(0,T.usePostScheduleLabel)({full:!0});return(0,a.createElement)(h.Button,{className:"edit-post-post-schedule__toggle",variant:"tertiary",label:o,showTooltip:!0,"aria-expanded":t,"aria-label":(0,_.sprintf)((0,_.__)("Change date: %s"),l),onClick:n},l)}var ol=function(){return(0,a.createElement)(T.PostStickyCheck,null,(0,a.createElement)(h.PanelRow,null,(0,a.createElement)(T.PostSticky,null)))};var rl=function(){return(0,a.createElement)(T.PostAuthorCheck,null,(0,a.createElement)(h.PanelRow,{className:"edit-post-post-author"},(0,a.createElement)(T.PostAuthor,null)))};var al=function(){return(0,a.createElement)(T.PostSlugCheck,null,(0,a.createElement)(h.PanelRow,{className:"edit-post-post-slug"},(0,a.createElement)(T.PostSlug,null)))};var sl=function(){return(0,a.createElement)(T.PostFormatCheck,null,(0,a.createElement)(h.PanelRow,{className:"edit-post-post-format"},(0,a.createElement)(T.PostFormat,null)))};var il=function(){return(0,a.createElement)(T.PostPendingStatusCheck,null,(0,a.createElement)(h.PanelRow,null,(0,a.createElement)(T.PostPendingStatus,null)))};const{Fill:cl,Slot:ul}=(0,h.createSlotFill)("PluginPostStatusInfo"),dl=e=>{let{children:t,className:n}=e;return(0,a.createElement)(cl,null,(0,a.createElement)(h.PanelRow,{className:n},t))};dl.Slot=ul;var ml=dl;var pl=(0,a.createElement)(y.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(y.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18.5 5.5V8H20V5.5H22.5V4H20V1.5H18.5V4H16V5.5H18.5ZM13.9624 4H6C4.89543 4 4 4.89543 4 6V18C4 19.1046 4.89543 20 6 20H18C19.1046 20 20 19.1046 20 18V10.0391H18.5V18C18.5 18.2761 18.2761 18.5 18 18.5H10L10 10.4917L16.4589 10.5139L16.4641 9.01389L5.5 8.97618V6C5.5 5.72386 5.72386 5.5 6 5.5H13.9624V4ZM5.5 10.4762V18C5.5 18.2761 5.72386 18.5 6 18.5H8.5L8.5 10.4865L5.5 10.4762Z"}));const gl=(0,_.__)("Custom Template");function hl(e){let{onClose:t}=e;const n=(0,c.useSelect)((e=>e(T.store).getEditorSettings().defaultBlockTemplate),[]),{__unstableCreateTemplate:l,__unstableSwitchToTemplateMode:o}=(0,c.useDispatch)(Rt),[r,i]=(0,a.useState)(""),[u,d]=(0,a.useState)(!1),m=()=>{i(""),t()};return(0,a.createElement)(h.Modal,{title:(0,_.__)("Create custom template"),closeLabel:(0,_.__)("Close"),onRequestClose:m,className:"edit-post-post-template__create-modal"},(0,a.createElement)("form",{className:"edit-post-post-template__create-form",onSubmit:async e=>{if(e.preventDefault(),u)return;d(!0);const t=null!=n?n:(0,s.serialize)([(0,s.createBlock)("core/group",{tagName:"header",layout:{inherit:!0}},[(0,s.createBlock)("core/site-title"),(0,s.createBlock)("core/site-tagline")]),(0,s.createBlock)("core/separator"),(0,s.createBlock)("core/group",{tagName:"main"},[(0,s.createBlock)("core/group",{layout:{inherit:!0}},[(0,s.createBlock)("core/post-title")]),(0,s.createBlock)("core/post-content",{layout:{inherit:!0}})])]);await l({slug:(0,k.cleanForSlug)(r||gl),content:t,title:r||gl}),d(!1),m(),o(!0)}},(0,a.createElement)(h.Flex,{align:"flex-start",gap:8},(0,a.createElement)(h.FlexItem,null,(0,a.createElement)(h.TextControl,{label:(0,_.__)("Name"),value:r,onChange:i,placeholder:gl,disabled:u,help:(0,_.__)('Describe the template, e.g. "Post with sidebar". Custom templates can be applied to any post or page.')}))),(0,a.createElement)(h.Flex,{justify:"flex-end",expanded:!1},(0,a.createElement)(h.FlexItem,null,(0,a.createElement)(h.Button,{variant:"tertiary",onClick:m},(0,_.__)("Cancel"))),(0,a.createElement)(h.FlexItem,null,(0,a.createElement)(h.Button,{variant:"primary",type:"submit",isBusy:u,"aria-disabled":u},(0,_.__)("Create"))))))}function El(e){var t,n;let{onClose:l}=e;const{isPostsPage:o,availableTemplates:r,fetchedTemplates:s,selectedTemplateSlug:i,canCreate:u,canEdit:d}=(0,c.useSelect)((e=>{const{canUser:t,getEntityRecord:n,getEntityRecords:l}=e(Ce.store),o=e(T.store).getEditorSettings(),r=t("read","settings")?n("root","site"):void 0,a=e(T.store).getCurrentPostId()===(null==r?void 0:r.page_for_posts),s=t("create","templates");return{isPostsPage:a,availableTemplates:o.availableTemplates,fetchedTemplates:s?l("postType","wp_template",{post_type:e(T.store).getCurrentPostType(),per_page:-1}):void 0,selectedTemplateSlug:e(T.store).getEditedPostAttribute("template"),canCreate:s&&!a&&o.supportsTemplateMode,canEdit:s&&o.supportsTemplateMode&&!!e(Rt).getEditedPostTemplate()}}),[]),m=(0,a.useMemo)((()=>Object.entries({...r,...Object.fromEntries((null!=s?s:[]).map((e=>{let{slug:t,title:n}=e;return[t,n.rendered]})))}).map((e=>{let[t,n]=e;return{value:t,label:n}}))),[r,s]),p=null!==(t=m.find((e=>e.value===i)))&&void 0!==t?t:m.find((e=>!e.value)),{editPost:g}=(0,c.useDispatch)(T.store),{__unstableSwitchToTemplateMode:b}=(0,c.useDispatch)(Rt),[f,v]=(0,a.useState)(!1);return(0,a.createElement)("div",{className:"edit-post-post-template__form"},(0,a.createElement)(E.__experimentalInspectorPopoverHeader,{title:(0,_.__)("Template"),help:(0,_.__)("Templates define the way content is displayed when viewing your site."),actions:u?[{icon:pl,label:(0,_.__)("Add template"),onClick:()=>v(!0)}]:[],onClose:l}),o?(0,a.createElement)(h.Notice,{className:"edit-post-post-template__notice",status:"warning",isDismissible:!1},(0,_.__)("The posts page template cannot be changed.")):(0,a.createElement)(h.SelectControl,{hideLabelFromVision:!0,label:(0,_.__)("Template"),value:null!==(n=null==p?void 0:p.value)&&void 0!==n?n:"",options:m,onChange:e=>g({template:e||""})}),d&&(0,a.createElement)("p",null,(0,a.createElement)(h.Button,{variant:"link",onClick:()=>b()},(0,_.__)("Edit template"))),f&&(0,a.createElement)(hl,{onClose:()=>v(!1)}))}function _l(){const[e,t]=(0,a.useState)(null),n=(0,a.useMemo)((()=>({anchor:e})),[e]);return(0,c.useSelect)((e=>{var t;const n=e(T.store).getCurrentPostType(),l=e(Ce.store).getPostType(n);if(null==l||!l.viewable)return!1;const o=e(T.store).getEditorSettings();if(!!o.availableTemplates&&Object.keys(o.availableTemplates).length>0)return!0;if(!o.supportsTemplateMode)return!1;return null!==(t=e(Ce.store).canUser("create","templates"))&&void 0!==t&&t}),[])?(0,a.createElement)(h.PanelRow,{className:"edit-post-post-template",ref:t},(0,a.createElement)("span",null,(0,_.__)("Template")),(0,a.createElement)(h.Dropdown,{popoverProps:n,position:"bottom left",className:"edit-post-post-template__dropdown",contentClassName:"edit-post-post-template__dialog",focusOnMount:!0,renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,a.createElement)(bl,{isOpen:t,onClick:n})},renderContent:e=>{let{onClose:t}=e;return(0,a.createElement)(El,{onClose:t})}})):null}function bl(e){let{isOpen:t,onClick:n}=e;const l=(0,c.useSelect)((e=>{var t;const n=e(T.store).getEditedPostAttribute("template"),{supportsTemplateMode:l,availableTemplates:o}=e(T.store).getEditorSettings();if(!l&&o[n])return o[n];const r=e(Rt).getEditedPostTemplate();return null!==(t=null==r?void 0:r.title)&&void 0!==t?t:null==r?void 0:r.slug}),[]);return(0,a.createElement)(h.Button,{className:"edit-post-post-template__toggle",variant:"tertiary","aria-expanded":t,"aria-label":l?(0,_.sprintf)((0,_.__)("Select template: %s"),l):(0,_.__)("Select template"),onClick:n},null!=l?l:(0,_.__)("Default template"))}function fl(){const[e,t]=(0,a.useState)(null),n=(0,a.useMemo)((()=>({anchor:e})),[e]);return(0,a.createElement)(T.PostURLCheck,null,(0,a.createElement)(h.PanelRow,{className:"edit-post-post-url",ref:t},(0,a.createElement)("span",null,(0,_.__)("URL")),(0,a.createElement)(h.Dropdown,{popoverProps:n,position:"bottom left",className:"edit-post-post-url__dropdown",contentClassName:"edit-post-post-url__dialog",focusOnMount:!0,renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,a.createElement)(vl,{isOpen:t,onClick:n})},renderContent:e=>{let{onClose:t}=e;return(0,a.createElement)(T.PostURL,{onClose:t})}})))}function vl(e){let{isOpen:t,onClick:n}=e;const l=(0,T.usePostURLLabel)();return(0,a.createElement)(h.Button,{className:"edit-post-post-url__toggle",variant:"tertiary","aria-expanded":t,"aria-label":(0,_.sprintf)((0,_.__)("Change URL: %s"),l),onClick:n},l)}const yl="post-status";var wl=(0,b.compose)([(0,c.withSelect)((e=>{const{isEditorPanelRemoved:t,isEditorPanelOpened:n}=e(Rt);return{isRemoved:t(yl),isOpened:n(yl)}})),(0,b.ifCondition)((e=>{let{isRemoved:t}=e;return!t})),(0,c.withDispatch)((e=>({onTogglePanel(){return e(Rt).toggleEditorPanelOpened(yl)}})))])((function(e){let{isOpened:t,onTogglePanel:n}=e;return(0,a.createElement)(h.PanelBody,{className:"edit-post-post-status",title:(0,_.__)("Summary"),opened:t,onToggle:n},(0,a.createElement)(ml.Slot,null,(e=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)(el,null),(0,a.createElement)(nl,null),(0,a.createElement)(fl,null),(0,a.createElement)(_l,null),(0,a.createElement)(ol,null),(0,a.createElement)(il,null),(0,a.createElement)(sl,null),(0,a.createElement)(al,null),(0,a.createElement)(rl,null),e,(0,a.createElement)(tl,null)))))}));var Sl=function(){return(0,a.createElement)(T.PostLastRevisionCheck,null,(0,a.createElement)(h.PanelBody,{className:"edit-post-last-revision__panel"},(0,a.createElement)(T.PostLastRevision,null)))};var kl=(0,b.compose)((0,c.withSelect)(((e,t)=>{const n=(0,g.get)(t.taxonomy,["slug"]),l=n?`taxonomy-panel-${n}`:"";return{panelName:l,isEnabled:!!n&&e(Rt).isEditorPanelEnabled(l),isOpened:!!n&&e(Rt).isEditorPanelOpened(l)}})),(0,c.withDispatch)(((e,t)=>({onTogglePanel:()=>{e(Rt).toggleEditorPanelOpened(t.panelName)}}))))((function(e){let{isEnabled:t,taxonomy:n,isOpened:l,onTogglePanel:o,children:r}=e;if(!t)return null;const s=(0,g.get)(n,["labels","menu_name"]);return s?(0,a.createElement)(h.PanelBody,{title:s,opened:l,onToggle:o},r):null}));var Pl=function(){return(0,a.createElement)(T.PostTaxonomiesCheck,null,(0,a.createElement)(T.PostTaxonomies,{taxonomyWrapper:(e,t)=>(0,a.createElement)(kl,{taxonomy:t},e)}))};const Tl="featured-image";const Cl=(0,c.withSelect)((e=>{const{getEditedPostAttribute:t}=e(T.store),{getPostType:n}=e(Ce.store),{isEditorPanelEnabled:l,isEditorPanelOpened:o}=e(Rt);return{postType:n(t("type")),isEnabled:l(Tl),isOpened:o(Tl)}})),xl=(0,c.withDispatch)((e=>{const{toggleEditorPanelOpened:t}=e(Rt);return{onTogglePanel:function(){for(var e=arguments.length,n=new Array(e),l=0;l({isEnabled:e(Rt).isEditorPanelEnabled(Ml),isOpened:e(Rt).isEditorPanelOpened(Ml)}))),(0,c.withDispatch)((e=>({onTogglePanel(){return e(Rt).toggleEditorPanelOpened(Ml)}})))])((function(e){let{isEnabled:t,isOpened:n,onTogglePanel:l}=e;return t?(0,a.createElement)(T.PostExcerptCheck,null,(0,a.createElement)(h.PanelBody,{title:(0,_.__)("Excerpt"),opened:n,onToggle:l},(0,a.createElement)(T.PostExcerpt,null))):null}));const Nl="discussion-panel";var Al=(0,b.compose)([(0,c.withSelect)((e=>({isEnabled:e(Rt).isEditorPanelEnabled(Nl),isOpened:e(Rt).isEditorPanelOpened(Nl)}))),(0,c.withDispatch)((e=>({onTogglePanel(){return e(Rt).toggleEditorPanelOpened(Nl)}})))])((function(e){let{isEnabled:t,isOpened:n,onTogglePanel:l}=e;return t?(0,a.createElement)(T.PostTypeSupportCheck,{supportKeys:["comments","trackbacks"]},(0,a.createElement)(h.PanelBody,{title:(0,_.__)("Discussion"),opened:n,onToggle:l},(0,a.createElement)(T.PostTypeSupportCheck,{supportKeys:"comments"},(0,a.createElement)(h.PanelRow,null,(0,a.createElement)(T.PostComments,null))),(0,a.createElement)(T.PostTypeSupportCheck,{supportKeys:"trackbacks"},(0,a.createElement)(h.PanelRow,null,(0,a.createElement)(T.PostPingbacks,null))))):null}));const Ll="page-attributes";var Ol=function(){const{isEnabled:e,isOpened:t,postType:n}=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t}=e(T.store),{isEditorPanelEnabled:n,isEditorPanelOpened:l}=e(Rt),{getPostType:o}=e(Ce.store);return{isEnabled:n(Ll),isOpened:l(Ll),postType:o(t("type"))}}),[]),{toggleEditorPanelOpened:l}=(0,c.useDispatch)(Rt);return e&&n?(0,a.createElement)(T.PageAttributesCheck,null,(0,a.createElement)(h.PanelBody,{title:(0,g.get)(n,["labels","attributes"],(0,_.__)("Page attributes")),opened:t,onToggle:function(){for(var e=arguments.length,t=new Array(e),n=0;n(l.current=document.querySelector(".metabox-location-"+t),l.current&&n.current.appendChild(l.current),()=>{l.current&&document.querySelector("#metaboxes").appendChild(l.current)})),[t]);const o=(0,c.useSelect)((e=>e(Rt).isSavingMetaBoxes()),[]),r=L()("edit-post-meta-boxes-area",`is-${t}`,{"is-loading":o});return(0,a.createElement)("div",{className:r},o&&(0,a.createElement)(h.Spinner,null),(0,a.createElement)("div",{className:"edit-post-meta-boxes-area__container",ref:n}),(0,a.createElement)("div",{className:"edit-post-meta-boxes-area__clear"}))};class Rl extends a.Component{componentDidMount(){this.updateDOM()}componentDidUpdate(e){this.props.isVisible!==e.isVisible&&this.updateDOM()}updateDOM(){const{id:e,isVisible:t}=this.props,n=document.getElementById(e);n&&(t?n.classList.remove("is-hidden"):n.classList.add("is-hidden"))}render(){return null}}var Fl=(0,c.withSelect)(((e,t)=>{let{id:n}=t;return{isVisible:e(Rt).isEditorPanelEnabled(`meta-box-${n}`)}}))(Rl);function Vl(e){let{location:t}=e;const n=(0,c.useRegistry)(),{metaBoxes:l,areMetaBoxesInitialized:o,isEditorReady:r}=(0,c.useSelect)((e=>{const{__unstableIsEditorReady:n}=e(T.store),{getMetaBoxesPerLocation:l,areMetaBoxesInitialized:o}=e(Rt);return{metaBoxes:l(t),areMetaBoxesInitialized:o(),isEditorReady:n()}}),[t]);return(0,a.useEffect)((()=>{r&&!o&&n.dispatch(Rt).initializeMetaBoxes()}),[r,o]),o?(0,a.createElement)(a.Fragment,null,(0,g.map)(l,(e=>{let{id:t}=e;return(0,a.createElement)(Fl,{key:t,id:t})})),(0,a.createElement)(Dl,{location:t})):null}window.wp.warning;const{Fill:Ul,Slot:Gl}=(0,h.createSlotFill)("PluginDocumentSettingPanel"),Hl=(0,b.compose)((0,S.withPluginContext)(((e,t)=>(void 0===t.name&&"undefined"!=typeof process&&process.env,{panelName:`${e.name}/${t.name}`}))),(0,c.withSelect)(((e,t)=>{let{panelName:n}=t;return{opened:e(Rt).isEditorPanelOpened(n),isEnabled:e(Rt).isEditorPanelEnabled(n)}})),(0,c.withDispatch)(((e,t)=>{let{panelName:n}=t;return{onToggle(){return e(Rt).toggleEditorPanelOpened(n)}}})))((e=>{let{isEnabled:t,panelName:n,opened:l,onToggle:o,className:r,title:s,icon:i,children:c}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(gn,{label:s,panelName:n}),(0,a.createElement)(Ul,null,t&&(0,a.createElement)(h.PanelBody,{className:r,title:s,icon:i,opened:l,onToggle:o},c)))}));Hl.Slot=Gl;var zl=Hl;function $l(e){let{className:t,...n}=e;const{postTitle:l,shortcut:o,showIconLabels:r}=(0,c.useSelect)((e=>({postTitle:e(T.store).getEditedPostAttribute("title"),shortcut:e(zt.store).getShortcutRepresentation("core/edit-post/toggle-sidebar"),showIconLabels:e(Rt).isFeatureActive("showIconLabels")})),[]);return(0,a.createElement)(pe,p({panelClassName:t,className:"edit-post-sidebar",smallScreenTitle:l||(0,_.__)("(no title)"),scope:"core/edit-post",toggleShortcut:o,showIconLabels:r},n))}var Wl=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"}));var ql=function(){const e=(0,c.useSelect)((e=>{const{getEditedPostTemplate:t}=e(Rt);return t()}),[]);return e?(0,a.createElement)(h.PanelBody,null,(0,a.createElement)(h.Flex,{align:"flex-start",gap:"3"},(0,a.createElement)(h.FlexItem,null,(0,a.createElement)(fe,{icon:Wl})),(0,a.createElement)(h.FlexBlock,null,(0,a.createElement)("h2",{className:"edit-post-template-summary__title"},(null==e?void 0:e.title)||(null==e?void 0:e.slug)),(0,a.createElement)("p",null,null==e?void 0:e.description)))):null};const jl=a.Platform.select({web:!0,native:!1});var Kl=()=>{const{sidebarName:e,keyboardShortcut:t,isTemplateMode:n}=(0,c.useSelect)((e=>{let t=e(ee).getActiveComplementaryArea(Rt.name);["edit-post/document","edit-post/block"].includes(t)||(e(E.store).getBlockSelectionStart()&&(t="edit-post/block"),t="edit-post/document");return{sidebarName:t,keyboardShortcut:e(zt.store).getShortcutRepresentation("core/edit-post/toggle-sidebar"),isTemplateMode:e(Rt).isEditingTemplate()}}),[]);return(0,a.createElement)($l,{identifier:e,header:(0,a.createElement)(Zn,{sidebarName:e}),closeLabel:(0,_.__)("Close settings"),headerClassName:"edit-post-sidebar__panel-tabs",title:(0,_.__)("Settings"),toggleShortcut:t,icon:Qn,isActiveByDefault:jl},!n&&"edit-post/document"===e&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(wl,null),(0,a.createElement)(zl.Slot,null),(0,a.createElement)(Sl,null),(0,a.createElement)(Pl,null),(0,a.createElement)(Bl,null),(0,a.createElement)(Il,null),(0,a.createElement)(Al,null),(0,a.createElement)(Ol,null),(0,a.createElement)(Vl,{location:"side"})),n&&"edit-post/document"===e&&(0,a.createElement)(ql,null),"edit-post/block"===e&&(0,a.createElement)(E.BlockInspector,null))};function Yl(e){let{nonAnimatedSrc:t,animatedSrc:n}=e;return(0,a.createElement)("picture",{className:"edit-post-welcome-guide__image"},(0,a.createElement)("source",{srcSet:t,media:"(prefers-reduced-motion: reduce)"}),(0,a.createElement)("img",{src:n,width:"312",height:"240",alt:""}))}function Xl(){const{toggleFeature:e}=(0,c.useDispatch)(Rt);return(0,a.createElement)(h.Guide,{className:"edit-post-welcome-guide",contentLabel:(0,_.__)("Welcome to the block editor"),finishButtonText:(0,_.__)("Get started"),onFinish:()=>e("welcomeGuide"),pages:[{image:(0,a.createElement)(Yl,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.gif"}),content:(0,a.createElement)(a.Fragment,null,(0,a.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,_.__)("Welcome to the block editor")),(0,a.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,_.__)("In the WordPress editor, each paragraph, image, or video is presented as a distinct “block” of content.")))},{image:(0,a.createElement)(Yl,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-editor.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-editor.gif"}),content:(0,a.createElement)(a.Fragment,null,(0,a.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,_.__)("Make each block your own")),(0,a.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,_.__)("Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.")))},{image:(0,a.createElement)(Yl,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-library.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-library.gif"}),content:(0,a.createElement)(a.Fragment,null,(0,a.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,_.__)("Get to know the block library")),(0,a.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,a.createInterpolateElement)((0,_.__)("All of the blocks available to you live in the block library. You’ll find it wherever you see the icon."),{InserterIconImage:(0,a.createElement)("img",{alt:(0,_.__)("inserter"),src:"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A"})})))},{image:(0,a.createElement)(Yl,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.gif"}),content:(0,a.createElement)(a.Fragment,null,(0,a.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,_.__)("Learn how to use the block editor")),(0,a.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,_.__)("New to the block editor? Want to learn more about using it? "),(0,a.createElement)(h.ExternalLink,{href:(0,_.__)("https://wordpress.org/support/article/wordpress-editor/")},(0,_.__)("Here's a detailed guide."))))}]})}function Ql(){const{toggleFeature:e}=(0,c.useDispatch)(Rt);return(0,a.createElement)(h.Guide,{className:"edit-template-welcome-guide",contentLabel:(0,_.__)("Welcome to the template editor"),finishButtonText:(0,_.__)("Get started"),onFinish:()=>e("welcomeGuideTemplate"),pages:[{image:(0,a.createElement)(Yl,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-template-editor.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-template-editor.gif"}),content:(0,a.createElement)(a.Fragment,null,(0,a.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,_.__)("Welcome to the template editor")),(0,a.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,_.__)("Templates help define the layout of the site. You can customize all aspects of your posts and pages using blocks and patterns in this editor.")))}]})}function Zl(){const{isActive:e,isTemplateMode:t}=(0,c.useSelect)((e=>{const{isFeatureActive:t,isEditingTemplate:n}=e(Rt),l=n();return{isActive:t(l?"welcomeGuideTemplate":"welcomeGuide"),isTemplateMode:l}}),[]);return e?t?(0,a.createElement)(Ql,null):(0,a.createElement)(Xl,null):null}const{Fill:Jl,Slot:eo}=(0,h.createSlotFill)("PluginPostPublishPanel"),to=(0,b.compose)((0,S.withPluginContext)(((e,t)=>({icon:t.icon||e.icon}))))((e=>{let{children:t,className:n,title:l,initialOpen:o=!1,icon:r}=e;return(0,a.createElement)(Jl,null,(0,a.createElement)(h.PanelBody,{className:n,initialOpen:o||!l,title:l,icon:r},t))}));to.Slot=eo;var no=to;const{Fill:lo,Slot:oo}=(0,h.createSlotFill)("PluginPrePublishPanel"),ro=(0,b.compose)((0,S.withPluginContext)(((e,t)=>({icon:t.icon||e.icon}))))((e=>{let{children:t,className:n,title:l,initialOpen:o=!1,icon:r}=e;return(0,a.createElement)(lo,null,(0,a.createElement)(h.PanelBody,{className:n,initialOpen:o||!l,title:l,icon:r},t))}));ro.Slot=oo;var ao=ro;const{Fill:so,Slot:io}=(0,h.createSlotFill)("ActionsPanel");function co(e){let{setEntitiesSavedStatesCallback:t,closeEntitiesSavedStates:n,isEntitiesSavedStatesOpen:l}=e;const{closePublishSidebar:o,togglePublishSidebar:r}=(0,c.useDispatch)(Rt),{publishSidebarOpened:s,hasActiveMetaboxes:i,isSavingMetaBoxes:u,hasNonPostEntityChanges:d}=(0,c.useSelect)((e=>({publishSidebarOpened:e(Rt).isPublishSidebarOpened(),hasActiveMetaboxes:e(Rt).hasMetaBoxes(),isSavingMetaBoxes:e(Rt).isSavingMetaBoxes(),hasNonPostEntityChanges:e(T.store).hasNonPostEntityChanges()})),[]),m=(0,a.useCallback)((()=>t(!0)),[]);let p;return p=s?(0,a.createElement)(T.PostPublishPanel,{onClose:o,forceIsDirty:i,forceIsSaving:u,PrePublishExtension:ao.Slot,PostPublishExtension:no.Slot}):d?(0,a.createElement)("div",{className:"edit-post-layout__toggle-entities-saved-states-panel"},(0,a.createElement)(h.Button,{variant:"secondary",className:"edit-post-layout__toggle-entities-saved-states-panel-button",onClick:m,"aria-expanded":!1},(0,_.__)("Open save panel"))):(0,a.createElement)("div",{className:"edit-post-layout__toggle-publish-panel"},(0,a.createElement)(h.Button,{variant:"secondary",className:"edit-post-layout__toggle-publish-panel-button",onClick:r,"aria-expanded":!1},(0,_.__)("Open publish panel"))),(0,a.createElement)(a.Fragment,null,l&&(0,a.createElement)(T.EntitiesSavedStates,{close:n}),(0,a.createElement)(io,{bubblesVirtually:!0}),!l&&p)}function uo(){const{blockPatternsWithPostContentBlockType:e,postType:t}=(0,c.useSelect)((e=>{const{__experimentalGetPatternsByBlockTypes:t}=e(E.store),{getCurrentPostType:n}=e(T.store);return{blockPatternsWithPostContentBlockType:t("core/post-content"),postType:n()}}),[]);return(0,a.useMemo)((()=>e.filter((e=>"page"===t&&!e.postTypes||Array.isArray(e.postTypes)&&e.postTypes.includes(t)))),[t,e])}function mo(e){let{onChoosePattern:t}=e;const n=uo(),l=(0,b.useAsyncList)(n),{resetEditorBlocks:o}=(0,c.useDispatch)(T.store);return(0,a.createElement)(E.__experimentalBlockPatternsList,{blockPatterns:n,shownPatterns:l,onClickPattern:(e,n)=>{o(n),t()}})}const po="INITIAL",go="PATTERN",ho="CLOSED";function Eo(){const[e,t]=(0,a.useState)(po),n=uo().length>0,l=(0,c.useSelect)((t=>{if(!n||e!==po)return!1;const{getEditedPostContent:l,isEditedPostSaveable:o}=t(T.store),{isEditingTemplate:r,isFeatureActive:a}=t(Rt);return!o()&&""===l()&&!r()&&!a("welcomeGuide")}),[e,n]);return(0,a.useEffect)((()=>{l&&t(go)}),[l]),e===po||e===ho?null:(0,a.createElement)(h.Modal,{className:"edit-post-start-page-options__modal",title:(0,_.__)("Choose a pattern"),closeLabel:(0,_.__)("Cancel"),onRequestClose:()=>{t(ho)}},(0,a.createElement)("div",{className:"edit-post-start-page-options__modal-content"},e===go&&(0,a.createElement)(mo,{onChoosePattern:()=>{t(ho)}})))}const _o={header:(0,_.__)("Editor top bar"),body:(0,_.__)("Editor content"),sidebar:(0,_.__)("Editor settings"),actions:(0,_.__)("Editor publish"),footer:(0,_.__)("Editor footer")};var bo=function(e){let{styles:t}=e;const n=(0,b.useViewportMatch)("medium","<"),l=(0,b.useViewportMatch)("huge",">="),{openGeneralSidebar:o,closeGeneralSidebar:r,setIsInserterOpened:s}=(0,c.useDispatch)(Rt),{createErrorNotice:i}=(0,c.useDispatch)(P.store),{mode:u,isFullscreenActive:d,isRichEditingEnabled:m,sidebarIsOpened:p,hasActiveMetaboxes:g,hasFixedToolbar:f,previousShortcut:v,nextShortcut:y,hasBlockSelected:w,isInserterOpened:k,isListViewOpened:C,showIconLabels:x,hasReducedUI:B,showBlockBreadcrumbs:M,isTemplateMode:I,documentLabel:N}=(0,c.useSelect)((e=>{const{getEditorSettings:t,getPostTypeLabel:n}=e(T.store),l=t(),o=n();return{isTemplateMode:e(Rt).isEditingTemplate(),hasFixedToolbar:e(Rt).isFeatureActive("fixedToolbar"),sidebarIsOpened:!(!e(ee).getActiveComplementaryArea(Rt.name)&&!e(Rt).isPublishSidebarOpened()),isFullscreenActive:e(Rt).isFeatureActive("fullscreenMode"),isInserterOpened:e(Rt).isInserterOpened(),isListViewOpened:e(Rt).isListViewOpened(),mode:e(Rt).getEditorMode(),isRichEditingEnabled:l.richEditingEnabled,hasActiveMetaboxes:e(Rt).hasMetaBoxes(),previousShortcut:e(zt.store).getAllShortcutKeyCombinations("core/edit-post/previous-region"),nextShortcut:e(zt.store).getAllShortcutKeyCombinations("core/edit-post/next-region"),showIconLabels:e(Rt).isFeatureActive("showIconLabels"),hasReducedUI:e(Rt).isFeatureActive("reducedUI"),showBlockBreadcrumbs:e(Rt).isFeatureActive("showBlockBreadcrumbs"),documentLabel:o||(0,_._x)("Document","noun")}}),[]),A=L()("edit-post-layout","is-mode-"+u,{"is-sidebar-opened":p,"has-fixed-toolbar":f,"has-metaboxes":g,"show-icon-labels":x});(0,a.useEffect)((()=>{p&&!l&&s(!1)}),[p,l]),(0,a.useEffect)((()=>{k&&!l&&r()}),[k,l]);const[O,D]=(0,a.useState)(!1),R=(0,a.useCallback)((e=>{"function"==typeof O&&O(e),D(!1)}),[O]),F=C?(0,_.__)("List View"):(0,_.__)("Block Library");return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(ge,{isActive:d}),(0,a.createElement)(Sn,null),(0,a.createElement)(T.UnsavedChangesWarning,null),(0,a.createElement)(T.AutosaveMonitor,null),(0,a.createElement)(T.LocalAutosaveMonitor,null),(0,a.createElement)(Qt,null),(0,a.createElement)(T.EditorKeyboardShortcutsRegister,null),(0,a.createElement)(Kl,null),(0,a.createElement)(he,{className:A,labels:{..._o,secondarySidebar:F},header:(0,a.createElement)(jn,{setEntitiesSavedStatesCallback:D}),secondarySidebar:"visual"===u&&k?(0,a.createElement)(Yn,null):"visual"===u&&C?(0,a.createElement)(Xn,null):null,sidebar:(!n||p)&&(0,a.createElement)(a.Fragment,null,!n&&!p&&(0,a.createElement)("div",{className:"edit-post-layout__toggle-sidebar-panel"},(0,a.createElement)(h.Button,{variant:"secondary",className:"edit-post-layout__toggle-sidebar-panel-button",onClick:()=>o(w?"edit-post/block":"edit-post/document"),"aria-expanded":!1},w?(0,_.__)("Open block settings"):(0,_.__)("Open document settings"))),(0,a.createElement)(pe.Slot,{scope:"core/edit-post"})),notices:(0,a.createElement)(T.EditorSnackbars,null),content:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(T.EditorNotices,null),("text"===u||!m)&&(0,a.createElement)($t,null),m&&"visual"===u&&(0,a.createElement)(Xt,{styles:t}),!I&&(0,a.createElement)("div",{className:"edit-post-layout__metaboxes"},(0,a.createElement)(Vl,{location:"normal"}),(0,a.createElement)(Vl,{location:"advanced"})),n&&p&&(0,a.createElement)(h.ScrollLock,null),(0,a.createElement)(E.BlockStyles.Slot,{scope:"core/block-inspector"})),footer:!B&&M&&!n&&m&&"visual"===u&&(0,a.createElement)("div",{className:"edit-post-layout__footer"},(0,a.createElement)(E.BlockBreadcrumb,{rootLabelText:N})),actions:(0,a.createElement)(co,{closeEntitiesSavedStates:R,isEntitiesSavedStatesOpen:O,setEntitiesSavedStatesCallback:D}),shortcuts:{previous:v,next:y}}),(0,a.createElement)(yn,null),(0,a.createElement)(an,null),(0,a.createElement)(Zl,null),(0,a.createElement)(Eo,null),(0,a.createElement)(h.Popover.Slot,null),(0,a.createElement)(S.PluginArea,{onError:function(e){i((0,_.sprintf)((0,_.__)('The "%s" plugin has encountered an error and cannot be rendered.'),e))}}))};function fo(e){let{postId:t}=e;return(e=>{const{hasBlockSelection:t,isEditorSidebarOpened:n}=(0,c.useSelect)((e=>({hasBlockSelection:!!e(E.store).getBlockSelectionStart(),isEditorSidebarOpened:e(Dt).isEditorSidebarOpened()})),[e]),{openGeneralSidebar:l}=(0,c.useDispatch)(Dt);(0,a.useEffect)((()=>{n&&l(t?"edit-post/block":"edit-post/document")}),[t,n])})(t),(e=>{const{newPermalink:t}=(0,c.useSelect)((e=>({newPermalink:e(T.store).getCurrentPost().link})),[e]),n=(0,a.useRef)();(0,a.useEffect)((()=>{n.current=document.querySelector("#wp-admin-bar-preview a")||document.querySelector("#wp-admin-bar-view a")}),[e]),(0,a.useEffect)((()=>{t&&n.current&&n.current.setAttribute("href",t)}),[t])})(t),null}var vo=function(e){let{postId:t,postType:n,settings:l,initialEdits:o,onError:r,...i}=e;const{hasFixedToolbar:u,focusMode:m,hasReducedUI:E,hasInlineToolbar:_,hasThemeStyles:b,post:f,preferredStyleVariations:v,hiddenBlockTypes:y,blockTypes:w,keepCaretInsideBlock:S,isTemplateMode:k,template:P}=(0,c.useSelect)((e=>{var l,o;const{isFeatureActive:r,__experimentalGetPreviewDeviceType:a,isEditingTemplate:i,getEditedPostTemplate:c,getHiddenBlockTypes:u}=e(Rt),{getEntityRecord:m,getPostType:p,getEntityRecords:g,canUser:h}=e(Ce.store),{getEditorSettings:E}=e(T.store),{getBlockTypes:_}=e(s.store);let b;if(["wp_template","wp_template_part"].includes(n)){const e=g("postType",n,{wp_id:t});b=null==e?void 0:e[0]}else b=m("postType",n,t);const f=E().supportsTemplateMode,v=null!==(l=null===(o=p(n))||void 0===o?void 0:o.viewable)&&void 0!==l&&l,y=h("create","templates");return{hasFixedToolbar:r("fixedToolbar")||"Desktop"!==a(),focusMode:r("focusMode"),hasReducedUI:r("reducedUI"),hasInlineToolbar:r("inlineToolbar"),hasThemeStyles:r("themeStyles"),preferredStyleVariations:e(d.store).get("core/edit-post","preferredStyleVariations"),hiddenBlockTypes:u(),blockTypes:_(),keepCaretInsideBlock:r("keepCaretInsideBlock"),isTemplateMode:i(),template:f&&v&&y?c():null,post:b}}),[n,t]),{updatePreferredStyleVariations:C,setIsInserterOpened:x}=(0,c.useDispatch)(Rt),B=(0,a.useMemo)((()=>{const e={...l,__experimentalPreferredStyleVariations:{value:v,onChange:C},hasFixedToolbar:u,focusMode:m,hasReducedUI:E,hasInlineToolbar:_,__experimentalSetIsInserterOpened:x,keepCaretInsideBlock:S,defaultAllowedBlockTypes:l.allowedBlockTypes};if(y.length>0){const t=!0===l.allowedBlockTypes?(0,g.map)(w,"name"):l.allowedBlockTypes||[];e.allowedBlockTypes=(0,g.without)(t,...y)}return e}),[l,u,m,E,y,w,v,x,C,S]),M=(0,a.useMemo)((()=>{var e;const t=[],n=[];null===(e=l.styles)||void 0===e||e.forEach((e=>{e.__unstableType&&"theme"!==e.__unstableType?n.push(e):t.push(e)}));const o=[...l.defaultEditorStyles,...n];return b&&t.length?l.styles:o}),[l,b]);return f?(0,a.createElement)(a.StrictMode,null,(0,a.createElement)(zt.ShortcutProvider,null,(0,a.createElement)(h.SlotFillProvider,null,(0,a.createElement)(T.EditorProvider,p({settings:B,post:f,initialEdits:o,useSubRegistry:!1,__unstableTemplate:k?P:void 0},i),(0,a.createElement)(T.ErrorBoundary,{onError:r},(0,a.createElement)(fo,{postId:t}),(0,a.createElement)(bo,{styles:M})),(0,a.createElement)(T.PostLockedModal,null))))):null};var yo=e=>{let{allowedBlocks:t,icon:n,label:l,onClick:o,small:r,role:s}=e;return(0,a.createElement)(E.BlockSettingsMenuControls,null,(e=>{let{selectedBlocks:i,onClose:c}=e;return((e,t)=>{return!Array.isArray(t)||(n=t,0===e.filter((e=>!n.includes(e))).length);var n})(i,t)?(0,a.createElement)(h.MenuItem,{onClick:(0,b.compose)(o,c),icon:n,label:r?l:void 0,role:s},!r&&l):null}))},wo=(0,b.compose)((0,S.withPluginContext)(((e,t)=>{var n;return{as:null!==(n=t.as)&&void 0!==n?n:h.MenuItem,icon:t.icon||e.icon,name:"core/edit-post/plugin-more-menu"}})))(ae);function So(e){return(0,a.createElement)(ie,p({__unstableExplicitMenuItem:!0,scope:"core/edit-post"},e))}function ko(e,t,n,l,o){(0,a.unmountComponentAtNode)(n);const r=ko.bind(null,e,t,n,l,o);(0,a.render)((0,a.createElement)(vo,{settings:l,onError:r,postId:t,postType:e,initialEdits:o,recovery:!0}),n)}function Po(e,t,n,l,o){const r=document.getElementById(e),m=ko.bind(null,t,n,r,l,o);(0,c.dispatch)(d.store).setDefaults("core/edit-post",{editorMode:"visual",fixedToolbar:!1,fullscreenMode:!0,hiddenBlockTypes:[],inactivePanels:[],isPublishSidebarEnabled:!0,openPanels:["post-status"],preferredStyleVariations:{},showBlockBreadcrumbs:!0,showIconLabels:!1,showListViewByDefault:!1,themeStyles:!0,welcomeGuide:!0,welcomeGuideTemplate:!0}),(0,c.dispatch)(s.store).__experimentalReapplyBlockTypeFilters(),(0,c.select)(Rt).isFeatureActive("showListViewByDefault")&&(0,c.dispatch)(Rt).setIsListViewOpened(!0),(0,i.registerCoreBlocks)(),(0,u.addFilter)("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromInserter",((e,t)=>!(!(0,c.select)(Rt).isEditingTemplate()&&"core/template-part"===t.name)&&e));"Standards"!==("CSS1Compat"===document.compatMode?"Standards":"Quirks")&&console.warn("Your browser is using Quirks Mode. \nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening . Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.");-1!==window.navigator.userAgent.indexOf("iPhone")&&window.addEventListener("scroll",(e=>{const t=document.getElementsByClassName("interface-interface-skeleton__body")[0];e.target===document&&(window.scrollY>100&&(t.scrollTop=t.scrollTop+window.scrollY),document.getElementsByClassName("is-mode-visual")[0]&&window.scrollTo(0,0))})),window.addEventListener("dragover",(e=>e.preventDefault()),!1),window.addEventListener("drop",(e=>e.preventDefault()),!1),(0,a.render)((0,a.createElement)(vo,{settings:l,onError:m,postId:n,postType:t,initialEdits:o}),r)}}(),(window.wp=window.wp||{}).editPost=l}();
\ No newline at end of file
diff --git a/wp-includes/js/dist/edit-site.js b/wp-includes/js/dist/edit-site.js
index 43eb5b02c0..d36db8fc6e 100644
--- a/wp-includes/js/dist/edit-site.js
+++ b/wp-includes/js/dist/edit-site.js
@@ -6492,6 +6492,9 @@ function Header(_ref) {
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalPreviewOptions, {
deviceType: deviceType,
setDeviceType: setPreviewDeviceType
+ /* translators: button label text should, if possible, be under 16 characters. */
+ ,
+ viewLabel: (0,external_wp_i18n_namespaceObject.__)('View')
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
href: settings === null || settings === void 0 ? void 0 : settings.siteUrl,
target: "_blank",
diff --git a/wp-includes/js/dist/edit-site.min.js b/wp-includes/js/dist/edit-site.min.js
index 78d47d1418..f80b3ed6b7 100644
--- a/wp-includes/js/dist/edit-site.min.js
+++ b/wp-includes/js/dist/edit-site.min.js
@@ -9,4 +9,4 @@
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
-*/!function(){"use strict";var l={}.hasOwnProperty;function a(){for(var e=[],t=0;t2096103.424&&p!==m))return navigator.msSaveBlob?navigator.msSaveBlob(v(c),g):y(c);s=(c=v(c)).type||i}else if(/([\x80-\xff])/.test(c)){for(var h=0,f=new Uint8Array(c.length),E=f.length;h({type:"SET_DEFAULT_COMPLEMENTARY_AREA",scope:e,area:t}),T=(e,t)=>n=>{let{registry:l,dispatch:a}=n;if(!t)return;l.select(k.store).get(e,"isComplementaryAreaVisible")||l.dispatch(k.store).set(e,"isComplementaryAreaVisible",!0),a({type:"ENABLE_COMPLEMENTARY_AREA",scope:e,area:t})},N=e=>t=>{let{registry:n}=t;n.select(k.store).get(e,"isComplementaryAreaVisible")&&n.dispatch(k.store).set(e,"isComplementaryAreaVisible",!1)},I=(e,t)=>n=>{let{registry:l}=n;if(!t)return;const a=l.select(k.store).get(e,"pinnedItems");!0!==(null==a?void 0:a[t])&&l.dispatch(k.store).set(e,"pinnedItems",{...a,[t]:!0})},M=(e,t)=>n=>{let{registry:l}=n;if(!t)return;const a=l.select(k.store).get(e,"pinnedItems");l.dispatch(k.store).set(e,"pinnedItems",{...a,[t]:!1})};function P(e,t){return function(n){let{registry:l}=n;S()("dispatch( 'core/interface' ).toggleFeature",{since:"6.0",alternative:"dispatch( 'core/preferences' ).toggle"}),l.dispatch(k.store).toggle(e,t)}}function z(e,t,n){return function(l){let{registry:a}=l;S()("dispatch( 'core/interface' ).setFeatureValue",{since:"6.0",alternative:"dispatch( 'core/preferences' ).set"}),a.dispatch(k.store).set(e,t,!!n)}}function V(e,t){return function(n){let{registry:l}=n;S()("dispatch( 'core/interface' ).setFeatureDefaults",{since:"6.0",alternative:"dispatch( 'core/preferences' ).setDefaults"}),l.dispatch(k.store).setDefaults(e,t)}}const B=(0,c.createRegistrySelector)((e=>(t,n)=>{var l;const a=e(k.store).get(n,"isComplementaryAreaVisible");if(void 0!==a)return a?null==t||null===(l=t.complementaryAreas)||void 0===l?void 0:l[n]:null})),A=(0,c.createRegistrySelector)((e=>(t,n,l)=>{var a;const r=e(k.store).get(n,"pinnedItems");return null===(a=null==r?void 0:r[l])||void 0===a||a})),R=(0,c.createRegistrySelector)((e=>(t,n,l)=>(S()("select( 'core/interface' ).isFeatureActive( scope, featureName )",{since:"6.0",alternative:"select( 'core/preferences' ).get( scope, featureName )"}),!!e(k.store).get(n,l))));var L=(0,c.combineReducers)({complementaryAreas:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_DEFAULT_COMPLEMENTARY_AREA":{const{scope:n,area:l}=t;return e[n]?e:{...e,[n]:l}}case"ENABLE_COMPLEMENTARY_AREA":{const{scope:n,area:l}=t;return{...e,[n]:l}}}return e}});const O=(0,c.createReduxStore)("core/interface",{reducer:L,actions:e,selectors:t});(0,c.register)(O);var D=window.wp.plugins,G=(0,D.withPluginContext)(((e,t)=>({icon:t.icon||e.icon,identifier:t.identifier||`${e.name}/${t.name}`})));var F=G((function(e){let{as:t=_.Button,scope:n,identifier:l,icon:a,selectedIcon:r,name:i,...s}=e;const u=t,d=(0,c.useSelect)((e=>e(O).getActiveComplementaryArea(n)===l),[l]),{enableComplementaryArea:p,disableComplementaryArea:g}=(0,c.useDispatch)(O);return(0,o.createElement)(u,m({icon:r&&d?r:a,onClick:()=>{d?g(n):p(n,l)}},s))}));var H=e=>{let{smallScreenTitle:t,children:n,className:l,toggleButtonProps:a}=e;const r=(0,o.createElement)(F,m({icon:w},a));return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"components-panel__header interface-complementary-area-header__small"},t&&(0,o.createElement)("span",{className:"interface-complementary-area-header__small-title"},t),r),(0,o.createElement)("div",{className:g()("components-panel__header","interface-complementary-area-header",l),tabIndex:-1},n,r))};const $=()=>{};function U(e){let{name:t,as:n=_.Button,onClick:l,...a}=e;return(0,o.createElement)(_.Fill,{name:t},(e=>{let{onClick:t}=e;return(0,o.createElement)(n,m({onClick:l||t?function(){(l||$)(...arguments),(t||$)(...arguments)}:void 0},a))}))}U.Slot=function(e){let{name:t,as:n=_.ButtonGroup,fillProps:l={},bubblesVirtually:a,...r}=e;return(0,o.createElement)(_.Slot,{name:t,bubblesVirtually:a,fillProps:l},(e=>{if(!o.Children.toArray(e).length)return null;const t=[];o.Children.forEach(e,(e=>{let{props:{__unstableExplicitMenuItem:n,__unstableTarget:l}}=e;l&&n&&t.push(l)}));const l=o.Children.map(e,(e=>!e.props.__unstableExplicitMenuItem&&t.includes(e.props.__unstableTarget)?null:e));return(0,o.createElement)(n,r,l)}))};var j=U;const W=e=>{let{__unstableExplicitMenuItem:t,__unstableTarget:n,...l}=e;return(0,o.createElement)(_.MenuItem,l)};function Y(e){let{scope:t,target:n,__unstableExplicitMenuItem:l,...a}=e;return(0,o.createElement)(F,m({as:e=>(0,o.createElement)(j,m({__unstableExplicitMenuItem:l,__unstableTarget:`${t}/${n}`,as:W,name:`${t}/plugin-more-menu`},e)),role:"menuitemcheckbox",selectedIcon:E,name:n,scope:t},a))}function q(e){let{scope:t,...n}=e;return(0,o.createElement)(_.Fill,m({name:`PinnedItems/${t}`},n))}q.Slot=function(e){let{scope:t,className:n,...l}=e;return(0,o.createElement)(_.Slot,m({name:`PinnedItems/${t}`},l),(e=>(null==e?void 0:e.length)>0&&(0,o.createElement)("div",{className:g()(n,"interface-pinned-items")},e)))};var X=q;function K(e){let{scope:t,children:n,className:l}=e;return(0,o.createElement)(_.Fill,{name:`ComplementaryArea/${t}`},(0,o.createElement)("div",{className:l},n))}const Z=G((function(e){let{children:t,className:n,closeLabel:l=(0,h.__)("Close plugin"),identifier:a,header:r,headerClassName:i,icon:s,isPinnable:u=!0,panelClassName:d,scope:m,name:p,smallScreenTitle:f,title:w,toggleShortcut:x,isActiveByDefault:S,showIconLabels:k=!1}=e;const{isActive:C,isPinned:T,activeArea:N,isSmall:I,isLarge:M}=(0,c.useSelect)((e=>{const{getActiveComplementaryArea:t,isItemPinned:n}=e(O),l=t(m);return{isActive:l===a,isPinned:n(m,a),activeArea:l,isSmall:e(b.store).isViewportMatch("< medium"),isLarge:e(b.store).isViewportMatch("large")}}),[a,m]);!function(e,t,n,l,a){const r=(0,o.useRef)(!1),i=(0,o.useRef)(!1),{enableComplementaryArea:s,disableComplementaryArea:u}=(0,c.useDispatch)(O);(0,o.useEffect)((()=>{l&&a&&!r.current?(u(e),i.current=!0):i.current&&!a&&r.current?(i.current=!1,s(e,t)):i.current&&n&&n!==t&&(i.current=!1),a!==r.current&&(r.current=a)}),[l,a,e,t,n])}(m,a,N,C,I);const{enableComplementaryArea:P,disableComplementaryArea:z,pinItem:V,unpinItem:B}=(0,c.useDispatch)(O);return(0,o.useEffect)((()=>{S&&void 0===N&&!I&&P(m,a)}),[N,S,m,a,I]),(0,o.createElement)(o.Fragment,null,u&&(0,o.createElement)(X,{scope:m},T&&(0,o.createElement)(F,{scope:m,identifier:a,isPressed:C&&(!k||M),"aria-expanded":C,label:w,icon:k?E:s,showTooltip:!k,variant:k?"tertiary":void 0})),p&&u&&(0,o.createElement)(Y,{target:p,scope:m,icon:s},w),C&&(0,o.createElement)(K,{className:g()("interface-complementary-area",n),scope:m},(0,o.createElement)(H,{className:i,closeLabel:l,onClose:()=>z(m),smallScreenTitle:f,toggleButtonProps:{label:l,shortcut:x,scope:m,identifier:a}},r||(0,o.createElement)(o.Fragment,null,(0,o.createElement)("strong",null,w),u&&(0,o.createElement)(_.Button,{className:"interface-complementary-area__pin-unpin-item",icon:T?v:y,label:T?(0,h.__)("Unpin from toolbar"):(0,h.__)("Pin to toolbar"),onClick:()=>(T?B:V)(m,a),isPressed:T,"aria-expanded":T}))),(0,o.createElement)(_.Panel,{className:d},t)))}));Z.Slot=function(e){let{scope:t,...n}=e;return(0,o.createElement)(_.Slot,m({name:`ComplementaryArea/${t}`},n))};var Q=Z,J=window.wp.compose;var ee=(0,o.forwardRef)((function(e,t){let{footer:n,header:l,sidebar:a,secondarySidebar:r,notices:i,content:s,drawer:c,actions:u,labels:d,className:p,shortcuts:f}=e;const E=(0,_.__unstableUseNavigateRegions)(f);!function(e){(0,o.useEffect)((()=>{const t=document&&document.querySelector(`html:not(.${e})`);if(t)return t.classList.toggle(e),()=>{t.classList.toggle(e)}}),[e])}("interface-interface-skeleton__html-container");const v={...{drawer:(0,h.__)("Drawer"),header:(0,h.__)("Header"),body:(0,h.__)("Content"),secondarySidebar:(0,h.__)("Block Library"),sidebar:(0,h.__)("Settings"),actions:(0,h.__)("Publish"),footer:(0,h.__)("Footer")},...d};return(0,o.createElement)("div",m({},E,{ref:(0,J.useMergeRefs)([t,E.ref]),className:g()(p,"interface-interface-skeleton",E.className,!!n&&"has-footer")}),!!c&&(0,o.createElement)("div",{className:"interface-interface-skeleton__drawer",role:"region","aria-label":v.drawer,tabIndex:"-1"},c),(0,o.createElement)("div",{className:"interface-interface-skeleton__editor"},!!l&&(0,o.createElement)("div",{className:"interface-interface-skeleton__header",role:"region","aria-label":v.header,tabIndex:"-1"},l),(0,o.createElement)("div",{className:"interface-interface-skeleton__body"},!!r&&(0,o.createElement)("div",{className:"interface-interface-skeleton__secondary-sidebar",role:"region","aria-label":v.secondarySidebar,tabIndex:"-1"},r),!!i&&(0,o.createElement)("div",{className:"interface-interface-skeleton__notices"},i),(0,o.createElement)("div",{className:"interface-interface-skeleton__content",role:"region","aria-label":v.body,tabIndex:"-1"},s),!!a&&(0,o.createElement)("div",{className:"interface-interface-skeleton__sidebar",role:"region","aria-label":v.sidebar,tabIndex:"-1"},a),!!u&&(0,o.createElement)("div",{className:"interface-interface-skeleton__actions",role:"region","aria-label":v.actions,tabIndex:"-1"},u))),!!n&&(0,o.createElement)("div",{className:"interface-interface-skeleton__footer",role:"region","aria-label":v.footer,tabIndex:"-1"},n))}));var te=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));function ne(e){let{as:t=_.DropdownMenu,className:n,label:l=(0,h.__)("Options"),popoverProps:a,toggleProps:r,children:i}=e;return(0,o.createElement)(t,{className:g()("interface-more-menu-dropdown",n),icon:te,label:l,popoverProps:{position:"bottom left",...a,className:g()("interface-more-menu-dropdown__content",null==a?void 0:a.className)},toggleProps:{tooltipPosition:"bottom",...r}},(e=>i(e)))}function le(e){let{closeModal:t,children:n}=e;return(0,o.createElement)(_.Modal,{className:"interface-preferences-modal",title:(0,h.__)("Preferences"),closeLabel:(0,h.__)("Close"),onRequestClose:t},n)}var ae=function(e){let{icon:t,size:n=24,...l}=e;return(0,o.cloneElement)(t,{width:n,height:n,...l})};var re=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));var oe=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));const ie="preferences-menu";function se(e){let{sections:t}=e;const n=(0,J.useViewportMatch)("medium"),[l,a]=(0,o.useState)(ie),{tabs:r,sectionsContentMap:i}=(0,o.useMemo)((()=>{let e={tabs:[],sectionsContentMap:{}};return t.length&&(e=t.reduce(((e,t)=>{let{name:n,tabLabel:l,content:a}=t;return e.tabs.push({name:n,title:l}),e.sectionsContentMap[n]=a,e}),{tabs:[],sectionsContentMap:{}})),e}),[t]),s=(0,o.useCallback)((e=>i[e.name]||null),[i]);let c;return c=n?(0,o.createElement)(_.TabPanel,{className:"interface-preferences__tabs",tabs:r,initialTabName:l!==ie?l:void 0,onSelect:a,orientation:"vertical"},s):(0,o.createElement)(_.__experimentalNavigatorProvider,{initialPath:"/",className:"interface-preferences__provider"},(0,o.createElement)(_.__experimentalNavigatorScreen,{path:"/"},(0,o.createElement)(_.Card,{isBorderless:!0,size:"small"},(0,o.createElement)(_.CardBody,null,(0,o.createElement)(_.__experimentalItemGroup,null,r.map((e=>(0,o.createElement)(_.__experimentalNavigatorButton,{key:e.name,path:e.name,as:_.__experimentalItem,isAction:!0},(0,o.createElement)(_.__experimentalHStack,{justify:"space-between"},(0,o.createElement)(_.FlexItem,null,(0,o.createElement)(_.__experimentalTruncate,null,e.title)),(0,o.createElement)(_.FlexItem,null,(0,o.createElement)(ae,{icon:(0,h.isRTL)()?re:oe})))))))))),t.length&&t.map((e=>(0,o.createElement)(_.__experimentalNavigatorScreen,{key:`${e.name}-menu`,path:e.name},(0,o.createElement)(_.Card,{isBorderless:!0,size:"large"},(0,o.createElement)(_.CardHeader,{isBorderless:!1,justify:"left",size:"small",gap:"6"},(0,o.createElement)(_.__experimentalNavigatorBackButton,{icon:(0,h.isRTL)()?oe:re,"aria-label":(0,h.__)("Navigate to the previous view")}),(0,o.createElement)(_.__experimentalText,{size:"16"},e.tabLabel)),(0,o.createElement)(_.CardBody,null,e.content)))))),c}var ce=e=>{let{description:t,title:n,children:l}=e;return(0,o.createElement)("fieldset",{className:"interface-preferences-modal__section"},(0,o.createElement)("legend",{className:"interface-preferences-modal__section-legend"},(0,o.createElement)("h2",{className:"interface-preferences-modal__section-title"},n),t&&(0,o.createElement)("p",{className:"interface-preferences-modal__section-description"},t)),l)};var ue=function(e){let{help:t,label:n,isChecked:l,onChange:a,children:r}=e;return(0,o.createElement)("div",{className:"interface-preferences-modal__option"},(0,o.createElement)(_.ToggleControl,{__nextHasNoMarginBottom:!0,help:t,label:n,checked:l,onChange:a}),r)},de=window.wp.url,me=window.wp.hooks,pe=window.wp.mediaUtils;(0,me.addFilter)("editor.MediaUpload","core/edit-site/components/media-upload",(()=>pe.MediaUpload));var ge,_e=window.wp.blockEditor;!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(ge||(ge={}));var he=function(e){return e};var fe="beforeunload",Ee="popstate";function ve(e){e.preventDefault(),e.returnValue=""}function ye(){var e=[];return{get length(){return e.length},push:function(t){return e.push(t),function(){e=e.filter((function(e){return e!==t}))}},call:function(t){e.forEach((function(e){return e&&e(t)}))}}}function be(){return Math.random().toString(36).substr(2,8)}function we(e){var t=e.pathname,n=void 0===t?"/":t,l=e.search,a=void 0===l?"":l,r=e.hash,o=void 0===r?"":r;return a&&"?"!==a&&(n+="?"===a.charAt(0)?a:"?"+a),o&&"#"!==o&&(n+="#"===o.charAt(0)?o:"#"+o),n}function xe(e){var t={};if(e){var n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));var l=e.indexOf("?");l>=0&&(t.search=e.substr(l),e=e.substr(0,l)),e&&(t.pathname=e)}return t}const Se=function(e){void 0===e&&(e={});var t=e.window,n=void 0===t?document.defaultView:t,l=n.history;function a(){var e=n.location,t=e.pathname,a=e.search,r=e.hash,o=l.state||{};return[o.idx,he({pathname:t,search:a,hash:r,state:o.usr||null,key:o.key||"default"})]}var r=null;n.addEventListener(Ee,(function(){if(r)d.call(r),r=null;else{var e=ge.Pop,t=a(),n=t[0],l=t[1];if(d.length){if(null!=n){var o=s-n;o&&(r={action:e,location:l,retry:function(){E(-1*o)}},E(o))}}else f(e)}}));var o=ge.Pop,i=a(),s=i[0],c=i[1],u=ye(),d=ye();function p(e){return"string"==typeof e?e:we(e)}function g(e,t){return void 0===t&&(t=null),he(m({pathname:c.pathname,hash:"",search:""},"string"==typeof e?xe(e):e,{state:t,key:be()}))}function _(e,t){return[{usr:e.state,key:e.key,idx:t},p(e)]}function h(e,t,n){return!d.length||(d.call({action:e,location:t,retry:n}),!1)}function f(e){o=e;var t=a();s=t[0],c=t[1],u.call({action:o,location:c})}function E(e){l.go(e)}null==s&&(s=0,l.replaceState(m({},l.state,{idx:s}),""));var v={get action(){return o},get location(){return c},createHref:p,push:function e(t,a){var r=ge.Push,o=g(t,a);if(h(r,o,(function(){e(t,a)}))){var i=_(o,s+1),c=i[0],u=i[1];try{l.pushState(c,"",u)}catch(e){n.location.assign(u)}f(r)}},replace:function e(t,n){var a=ge.Replace,r=g(t,n);if(h(a,r,(function(){e(t,n)}))){var o=_(r,s),i=o[0],c=o[1];l.replaceState(i,"",c),f(a)}},go:E,back:function(){E(-1)},forward:function(){E(1)},listen:function(e){return u.push(e)},block:function(e){var t=d.push(e);return 1===d.length&&n.addEventListener(fe,ve),function(){t(),d.length||n.removeEventListener(fe,ve)}}};return v}(),ke=Se.push,Ce=Se.replace;Se.push=function(e,t){return ke.call(Se,(0,de.addQueryArgs)(window.location.href,e),t)},Se.replace=function(e,t){return Ce.call(Se,(0,de.addQueryArgs)(window.location.href,e),t)};var Te=Se;const Ne=(0,o.createContext)(),Ie=(0,o.createContext)();function Me(){return(0,o.useContext)(Ne)}function Pe(){return(0,o.useContext)(Ie)}function ze(e){const t=new URLSearchParams(e.search);return{...e,params:Object.fromEntries(t.entries())}}function Ve(e){let{children:t}=e;const[n,l]=(0,o.useState)((()=>ze(Te.location)));return(0,o.useEffect)((()=>Te.listen((e=>{let{location:t}=e;l(ze(t))}))),[]),(0,o.createElement)(Ie.Provider,{value:Te},(0,o.createElement)(Ne.Provider,{value:n},t(n)))}function Be(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const l=Pe();function a(a){a.preventDefault(),n?l.replace(e,t):l.push(e,t)}return{href:(0,de.addQueryArgs)(window.location.href,e),onClick:a}}function Ae(e){let{params:t={},state:n,replace:l=!1,children:a,...r}=e;const{href:i,onClick:s}=Be(t,n,l);return(0,o.createElement)("a",m({href:i,onClick:s},r),a)}function Re(e){let{attributes:t}=e;const{theme:n,slug:l}=t,{params:a}=Me(),r=(0,c.useSelect)((e=>e(u.store).getEntityRecord("postType","wp_template_part",`${n}//${l}`)),[n,l]),i=Be({postId:null==r?void 0:r.id,postType:null==r?void 0:r.type},{fromTemplateId:a.postId});return r?(0,o.createElement)(_e.BlockControls,{group:"other"},(0,o.createElement)(_.ToolbarButton,m({},i,{onClick:e=>{i.onClick(e)}}),(0,h.__)("Edit"))):null}const Le=(0,J.createHigherOrderComponent)((e=>t=>{const{attributes:n,name:l}=t,a="core/template-part"===l&&n.slug;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(e,t),a&&(0,o.createElement)(Re,{attributes:n}))}),"withEditBlockControls");(0,me.addFilter)("editor.BlockEdit","core/edit-site/template-part-edit-button",Le);const Oe="core/edit-site",De="uncategorized",Ge=["index","singular","archive","single","page","home","404","search","author","category","taxonomy","date","tag","attachment","single","front-page"],Fe=["page-home"],He=["post-","author-","single-","tag-"],$e=["page-"],Ue={singular:["single","page"],index:["archive","404","search","singular","home"],home:["front-page"]},je="root",We="templates-general",Ye=[{area:"header",menu:"template-parts-headers",title:(0,h.__)("headers")},{area:"footer",menu:"template-parts-footers",title:(0,h.__)("footers")},{area:"sidebar",menu:"template-parts-sidebars",title:(0,h.__)("sidebars")},{area:De,menu:"template-parts-general",title:(0,h.__)("general")}];var qe=(0,c.combineReducers)({deviceType:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Desktop",t=arguments.length>1?arguments[1]:void 0;return"SET_PREVIEW_DEVICE_TYPE"===t.type?t.deviceType:e},settings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"UPDATE_SETTINGS"===t.type?{...e,...t.settings}:e},editedPost:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_TEMPLATE":case"SET_PAGE":return{type:"wp_template",id:t.templateId,page:t.page};case"SET_TEMPLATE_PART":return{type:"wp_template_part",id:t.templatePartId}}return e},homeTemplateId:function(e,t){return"SET_HOME_TEMPLATE"===t.type?t.homeTemplateId:e},navigationPanel:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{menu:je,isOpen:!1},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_NAVIGATION_PANEL_ACTIVE_MENU":return{...e,menu:t.menu};case"OPEN_NAVIGATION_PANEL_TO_MENU":return{...e,isOpen:!0,menu:t.menu};case"SET_IS_NAVIGATION_PANEL_OPENED":return{...e,menu:t.isOpen?e.menu:je,isOpen:t.isOpen};case"SET_IS_LIST_VIEW_OPENED":return{...e,menu:e.isOpen&&t.isOpen?je:e.menu,isOpen:!t.isOpen&&e.isOpen};case"SET_IS_INSERTER_OPENED":return{...e,menu:e.isOpen&&t.value?je:e.menu,isOpen:!t.value&&e.isOpen}}return e},blockInserterPanel:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"OPEN_NAVIGATION_PANEL_TO_MENU":return!1;case"SET_IS_NAVIGATION_PANEL_OPENED":case"SET_IS_LIST_VIEW_OPENED":return!t.isOpen&&e;case"SET_IS_INSERTER_OPENED":return t.value}return e},listViewPanel:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"OPEN_NAVIGATION_PANEL_TO_MENU":return!1;case"SET_IS_NAVIGATION_PANEL_OPENED":return!t.isOpen&&e;case"SET_IS_INSERTER_OPENED":return!t.value&&e;case"SET_IS_LIST_VIEW_OPENED":return t.isOpen}return e}}),Xe=window.wp.apiFetch,Ke=n.n(Xe),Ze=window.wp.notices,Qe=window.wp.a11y;function Je(e){return!!e&&("custom"===(null==e?void 0:e.source)&&(null==e?void 0:e.has_theme_file))}function et(e){return function(t){let{registry:n}=t;S()("select( 'core/edit-site' ).toggleFeature( featureName )",{since:"6.0",alternative:"select( 'core/preferences').toggle( 'core/edit-site', featureName )"}),n.dispatch(k.store).toggle("core/edit-site",e)}}function tt(e){return{type:"SET_PREVIEW_DEVICE_TYPE",deviceType:e}}const nt=(e,t)=>async n=>{let{dispatch:l,registry:a}=n;if(!t){const n=await a.resolveSelect(u.store).getEntityRecord("postType","wp_template",e);t=null==n?void 0:n.slug}l({type:"SET_TEMPLATE",templateId:e,page:{context:{templateSlug:t}}})},lt=e=>async t=>{let{dispatch:n,registry:l}=t;const a=await l.dispatch(u.store).saveEntityRecord("postType","wp_template",e);e.content&&l.dispatch(u.store).editEntityRecord("postType","wp_template",a.id,{blocks:(0,i.parse)(e.content)},{undoIgnore:!0}),n({type:"SET_TEMPLATE",templateId:a.id,page:{context:{templateSlug:a.slug}}})},at=e=>async t=>{let{registry:n}=t;try{await n.dispatch(u.store).deleteEntityRecord("postType",e.type,e.id,{force:!0});const t=n.select(u.store).getLastEntityDeleteError("postType",e.type,e.id);if(t)throw t;n.dispatch(Ze.store).createSuccessNotice((0,h.sprintf)((0,h.__)('"%s" deleted.'),e.title.rendered),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,h.__)("An error occurred while deleting the template.");n.dispatch(Ze.store).createErrorNotice(t,{type:"snackbar"})}};function rt(e){return{type:"SET_TEMPLATE_PART",templatePartId:e}}function ot(e){return{type:"SET_HOME_TEMPLATE",homeTemplateId:e}}const it=e=>async t=>{var n;let{dispatch:l,registry:a}=t;if(!e.path&&null!==(n=e.context)&&void 0!==n&&n.postId){const t=await a.resolveSelect(u.store).getEntityRecord("postType",e.context.postType||"post",e.context.postId);e.path=(0,de.getPathAndQueryString)(null==t?void 0:t.link)}const r=await a.resolveSelect(u.store).__experimentalGetTemplateForLink(e.path);if(r)return l({type:"SET_PAGE",page:r.slug?{...e,context:{...e.context,templateSlug:r.slug}}:e,templateId:r.id}),r.id};function st(e){return{type:"SET_NAVIGATION_PANEL_ACTIVE_MENU",menu:e}}function ct(e){return{type:"OPEN_NAVIGATION_PANEL_TO_MENU",menu:e}}function ut(e){return{type:"SET_IS_NAVIGATION_PANEL_OPENED",isOpen:e}}function dt(e){return{type:"SET_IS_INSERTER_OPENED",value:e}}function mt(e){return{type:"UPDATE_SETTINGS",settings:e}}function pt(e){return{type:"SET_IS_LIST_VIEW_OPENED",isOpen:e}}const gt=function(e){let{allowUndo:t=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return async n=>{let{registry:l}=n;if(Je(e))try{var a;const n=l.select(u.store).getEntityConfig("postType",e.type);if(!n)return void l.dispatch(Ze.store).createErrorNotice((0,h.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const r=(0,de.addQueryArgs)(`${n.baseURL}/${e.id}`,{context:"edit",source:"theme"}),o=await Ke()({path:r});if(!o)return void l.dispatch(Ze.store).createErrorNotice((0,h.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const s=e=>{let{blocks:t=[]}=e;return(0,i.__unstableSerializeAndClean)(t)},c=l.select(u.store).getEditedEntityRecord("postType",e.type,e.id);l.dispatch(u.store).editEntityRecord("postType",e.type,e.id,{content:s,blocks:c.blocks,source:"custom"},{undoIgnore:!0});const d=(0,i.parse)(null==o||null===(a=o.content)||void 0===a?void 0:a.raw);if(l.dispatch(u.store).editEntityRecord("postType",e.type,o.id,{content:s,blocks:d,source:"theme"}),t){const t=()=>{l.dispatch(u.store).editEntityRecord("postType",e.type,c.id,{content:s,blocks:c.blocks,source:"custom"})};l.dispatch(Ze.store).createSuccessNotice((0,h.__)("Template reverted."),{type:"snackbar",actions:[{label:(0,h.__)("Undo"),onClick:t}]})}else l.dispatch(Ze.store).createSuccessNotice((0,h.__)("Template reverted."))}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,h.__)("Template revert failed. Please reload.");l.dispatch(Ze.store).createErrorNotice(t,{type:"snackbar"})}else l.dispatch(Ze.store).createErrorNotice((0,h.__)("This template is not revertable."),{type:"snackbar"})}},_t=e=>t=>{let{registry:n}=t;n.dispatch(O).enableComplementaryArea(Oe,e)},ht=()=>e=>{let{registry:t}=e;t.dispatch(O).disableComplementaryArea(Oe)},ft=e=>t=>{let{registry:n}=t;n.dispatch("core/preferences").set("core/edit-site","editorMode",e),"visual"!==e&&n.dispatch(_e.store).clearSelectedBlock(),"visual"===e?(0,Qe.speak)((0,h.__)("Visual editor selected"),"assertive"):"mosaic"===e&&(0,Qe.speak)((0,h.__)("Mosaic view selected"),"assertive")};var Et=window.lodash,vt={};function yt(e){return[e]}function bt(e,t,n){var l;if(e.length!==t.length)return!1;for(l=n;lt.includes(e)||wt(e,t,n))))}function xt(e){if(Ge.includes(e))return"templates";if(Fe.includes(e))return We;if(He.some((t=>e.startsWith(t))))return"templates-posts";return $e.some((t=>e.startsWith(t)))?"templates-pages":We}const St=(0,c.createRegistrySelector)((e=>(t,n)=>e(k.store).get("core/edit-site",n)));function kt(e,t){return S()("select( 'core/interface' ).isFeatureActive",{since:"6.0",alternative:"select( 'core/preferences' ).get"}),!!St(e,t)}function Ct(e){return e.deviceType}const Tt=(0,c.createRegistrySelector)((e=>()=>e(u.store).canUser("create","media"))),Nt=(0,c.createRegistrySelector)((e=>()=>"web"===o.Platform.OS?e(u.store).getEntityRecords("postType","wp_block",{per_page:-1}):[])),It=function(e,t){var n,l=t||yt;function a(e){var t,l,a,r,o,i=n,s=!0;for(t=0;t{const n={...e.settings,outlineMode:!0,focusMode:!!St(e,"focusMode"),hasFixedToolbar:!!St(e,"fixedToolbar"),keepCaretInsideBlock:!!St(e,"keepCaretInsideBlock"),showIconLabels:!!St(e,"showIconLabels"),__experimentalSetIsInserterOpened:t,__experimentalReusableBlocks:Nt(e),__experimentalPreferPatternsOnRoot:"wp_template"===zt(e)};return Tt(e)?(n.mediaUpload=t=>{let{onError:n,...l}=t;(0,pe.uploadMedia)({wpAllowedMimeTypes:e.settings.allowedMimeTypes,onError:e=>{let{message:t}=e;return n(t)},...l})},n):n}),(e=>[Tt(e),e.settings,St(e,"focusMode"),St(e,"fixedToolbar"),St(e,"keepCaretInsideBlock"),St(e,"showIconLabels"),Nt(e),zt(e)]));function Mt(e){return e.homeTemplateId}function Pt(e){return e.editedPost}function zt(e){return Pt(e).type}function Vt(e){return Pt(e).id}function Bt(e){return Pt(e).page}function At(e){return e.navigationPanel.menu}const Rt=(0,c.createRegistrySelector)((e=>t=>{const n=zt(t),l=Vt(t),a=l?e(u.store).getEntityRecord("postType",n,l):null;if(!a)return je;var r;if("wp_template_part"===n)return(null===(r=Ye.find((e=>e.area===(null==a?void 0:a.area))))||void 0===r?void 0:r.menu)||"template-parts";const o=e(u.store).getEntityRecords("postType","wp_template"),i=e(u.store).getEditedEntityRecord("root","site").show_on_front;return wt(a.slug,(0,Et.map)(o,"slug"),i)?"templates-unused":xt(a.slug)}));function Lt(e){return e.navigationPanel.isOpen}function Ot(e){return!!e.blockInserterPanel}function Dt(e){const{rootClientId:t,insertionIndex:n,filterValue:l}=e.blockInserterPanel;return{rootClientId:t,insertionIndex:n,filterValue:l}}function Gt(e){return e.listViewPanel}const Ft=(0,c.createRegistrySelector)((e=>t=>{var n;const l=zt(t),a=Vt(t),r=e(u.store).getEditedEntityRecord("postType",l,a),o=e(u.store).getEntityRecords("postType","wp_template_part",{per_page:-1}),s=o?o.reduce(((e,t)=>({...e,[t.id]:t})),{}):{};return(null!==(n=r.blocks)&&void 0!==n?n:[]).filter((e=>(0,i.isTemplatePart)(e))).map((e=>{const{attributes:{theme:t,slug:n}}=e;return{templatePart:s[`${t}//${n}`],block:e}})).filter((e=>{let{templatePart:t}=e;return!!t}))}));function Ht(e){return St(e,"editorMode")}const $t={reducer:qe,actions:a,selectors:r},Ut=(0,c.createReduxStore)(Oe,$t);(0,c.register)(Ut);var jt=window.wp.keyboardShortcuts;var Wt=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));var Yt=(0,o.createElement)(f.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(f.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));var qt=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"m12 20-4.5-3.6-.9 1.2L12 22l5.5-4.4-.9-1.2L12 20zm0-16 4.5 3.6.9-1.2L12 2 6.5 6.4l.9 1.2L12 4z"}));var Xt=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"})),Kt=window.wp.keycodes;const Zt=[{keyCombination:{modifier:"primary",character:"b"},description:(0,h.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,h.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,h.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,h.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,h.__)("Insert a link to a post or page")},{keyCombination:{modifier:"primary",character:"u"},description:(0,h.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,h.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,h.__)("Make the selected text inline code.")}];function Qt(e){let{keyCombination:t,forceAriaLabel:n}=e;const l=t.modifier?Kt.displayShortcutList[t.modifier](t.character):t.character,a=t.modifier?Kt.shortcutAriaLabel[t.modifier](t.character):t.character;return(0,o.createElement)("kbd",{className:"edit-site-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":n||a},(0,Et.castArray)(l).map(((e,t)=>"+"===e?(0,o.createElement)(o.Fragment,{key:t},e):(0,o.createElement)("kbd",{key:t,className:"edit-site-keyboard-shortcut-help-modal__shortcut-key"},e))))}function Jt(e){let{description:t,keyCombination:n,aliases:l=[],ariaLabel:a}=e;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"edit-site-keyboard-shortcut-help-modal__shortcut-description"},t),(0,o.createElement)("div",{className:"edit-site-keyboard-shortcut-help-modal__shortcut-term"},(0,o.createElement)(Qt,{keyCombination:n,forceAriaLabel:a}),l.map(((e,t)=>(0,o.createElement)(Qt,{keyCombination:e,forceAriaLabel:a,key:t})))))}function en(e){let{name:t}=e;const{keyCombination:n,description:l,aliases:a}=(0,c.useSelect)((e=>{const{getShortcutKeyCombination:n,getShortcutDescription:l,getShortcutAliases:a}=e(jt.store);return{keyCombination:n(t),aliases:a(t),description:l(t)}}),[t]);return n?(0,o.createElement)(Jt,{keyCombination:n,description:l,aliases:a}):null}const tn=e=>{let{shortcuts:t}=e;return(0,o.createElement)("ul",{className:"edit-site-keyboard-shortcut-help-modal__shortcut-list",role:"list"},t.map(((e,t)=>(0,o.createElement)("li",{className:"edit-site-keyboard-shortcut-help-modal__shortcut",key:t},"string"==typeof e?(0,o.createElement)(en,{name:e}):(0,o.createElement)(Jt,e)))))},nn=e=>{let{title:t,shortcuts:n,className:l}=e;return(0,o.createElement)("section",{className:g()("edit-site-keyboard-shortcut-help-modal__section",l)},!!t&&(0,o.createElement)("h2",{className:"edit-site-keyboard-shortcut-help-modal__section-title"},t),(0,o.createElement)(tn,{shortcuts:n}))},ln=e=>{let{title:t,categoryName:n,additionalShortcuts:l=[]}=e;const a=(0,c.useSelect)((e=>e(jt.store).getCategoryShortcuts(n)),[n]);return(0,o.createElement)(nn,{title:t,shortcuts:a.concat(l)})};function an(e){let{isModalActive:t,toggleModal:n}=e;return t?(0,o.createElement)(_.Modal,{className:"edit-site-keyboard-shortcut-help-modal",title:(0,h.__)("Keyboard shortcuts"),closeLabel:(0,h.__)("Close"),onRequestClose:n},(0,o.createElement)(nn,{className:"edit-site-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/edit-site/keyboard-shortcuts"]}),(0,o.createElement)(ln,{title:(0,h.__)("Global shortcuts"),categoryName:"global"}),(0,o.createElement)(ln,{title:(0,h.__)("Selection shortcuts"),categoryName:"selection"}),(0,o.createElement)(ln,{title:(0,h.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,h.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,h.__)("Forward-slash")}]}),(0,o.createElement)(nn,{title:(0,h.__)("Text formatting"),shortcuts:Zt})):null}function rn(e){const{featureName:t,...n}=e,l=(0,c.useSelect)((e=>!!e(k.store).get("core/edit-site",t)),[t]),{toggle:a}=(0,c.useDispatch)(k.store);return(0,o.createElement)(ue,m({onChange:()=>a("core/edit-site",t),isChecked:l},n))}function on(e){let{isModalActive:t,toggleModal:n}=e;const l=(0,o.useMemo)((()=>[{name:"general",tabLabel:(0,h.__)("General"),content:(0,o.createElement)(ce,{title:(0,h.__)("Appearance"),description:(0,h.__)("Customize options related to the block editor interface and editing flow.")},(0,o.createElement)(rn,{featureName:"focusMode",help:(0,h.__)("Highlights the current block and fades other content."),label:(0,h.__)("Spotlight mode")}),(0,o.createElement)(rn,{featureName:"showIconLabels",label:(0,h.__)("Show button text labels"),help:(0,h.__)("Show text instead of icons on buttons.")}),(0,o.createElement)(rn,{featureName:"showListViewByDefault",help:(0,h.__)("Opens the block list view sidebar by default."),label:(0,h.__)("Always open list view")}))},{name:"blocks",tabLabel:(0,h.__)("Blocks"),content:(0,o.createElement)(ce,{title:(0,h.__)("Block interactions"),description:(0,h.__)("Customize how you interact with blocks in the block library and editing canvas.")},(0,o.createElement)(rn,{featureName:"keepCaretInsideBlock",help:(0,h.__)("Aids screen readers by stopping text caret from leaving blocks."),label:(0,h.__)("Contain text cursor inside block")}))}]));return t?(0,o.createElement)(le,{closeModal:n},(0,o.createElement)(se,{sections:l})):null}const{Fill:sn,Slot:cn}=(0,_.createSlotFill)("EditSiteToolsMoreMenuGroup");sn.Slot=e=>{let{fillProps:t}=e;return(0,o.createElement)(cn,{fillProps:t},(e=>!(0,Et.isEmpty)(e)&&e))};var un=sn,dn=n(8981),mn=n.n(dn);var pn=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z"}));function gn(){const{createErrorNotice:e}=(0,c.useDispatch)(Ze.store);return(0,o.createElement)(_.MenuItem,{role:"menuitem",icon:pn,onClick:async function(){try{const e=await Ke()({path:"/wp-block-editor/v1/export",parse:!1,headers:{Accept:"application/zip"}}),t=await e.blob(),n=e.headers.get("content-disposition").match(/=(.+)\.zip/),l=n[1]?n[1]:"edit-site-export";mn()(t,l+".zip","application/zip")}catch(t){let n={};try{n=await t.json()}catch(e){}const l=n.message&&"unknown_error"!==n.code?n.message:(0,h.__)("An error occurred while creating the site export.");e(l,{type:"snackbar"})}},info:(0,h.__)("Download your theme with updated templates and styles.")},(0,h._x)("Export","site exporter menu item"))}function _n(){const{toggle:e}=(0,c.useDispatch)(k.store);return(0,o.createElement)(_.MenuItem,{onClick:()=>e("core/edit-site","welcomeGuide")},(0,h.__)("Welcome Guide"))}function hn(){const{createNotice:e}=(0,c.useDispatch)(Ze.store),t=(0,c.useSelect)((e=>()=>{const{getEditedPostId:t,getEditedPostType:n}=e(Ut),{getEditedEntityRecord:l}=e(u.store),a=l("postType",n(),t());if(a){if("function"==typeof a.content)return a.content(a);if(a.blocks)return(0,i.__unstableSerializeAndClean)(a.blocks);if(a.content)return a.content}return""}),[]);const n=(0,J.useCopyToClipboard)(t,(function(){e("info",(0,h.__)("All content copied."),{isDismissible:!0,type:"snackbar"})}));return(0,o.createElement)(_.MenuItem,{ref:n},(0,h.__)("Copy all blocks"))}const fn=[{value:"visual",label:(0,h.__)("Visual editor")},{value:"text",label:(0,h.__)("Code editor")}];var En=function(){const{shortcut:e,mode:t}=(0,c.useSelect)((e=>({shortcut:e(jt.store).getShortcutRepresentation("core/edit-site/toggle-mode"),isRichEditingEnabled:e(Ut).getSettings().richEditingEnabled,isCodeEditingEnabled:e(Ut).getSettings().codeEditingEnabled,mode:e(Ut).getEditorMode()})),[]),{switchEditorMode:n}=(0,c.useDispatch)(Ut),l=fn.map((n=>n.value!==t?{...n,shortcut:e}:n));return(0,o.createElement)(_.MenuGroup,{label:(0,h.__)("Editor")},(0,o.createElement)(_.MenuItemsChoice,{choices:l,value:t,onSelect:n}))};function vn(e){let{showIconLabels:t}=e;const[n,l]=(0,o.useReducer)((e=>!e),!1),[a,r]=(0,o.useReducer)((e=>!e),!1);return(0,jt.useShortcut)("core/edit-site/keyboard-shortcuts",l),(0,o.createElement)(o.Fragment,null,(0,o.createElement)(ne,{toggleProps:{showTooltip:!t,...t&&{variant:"tertiary"}}},(e=>{let{onClose:t}=e;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(_.MenuGroup,{label:(0,h._x)("View","noun")},(0,o.createElement)(k.PreferenceToggleMenuItem,{scope:"core/edit-site",name:"fixedToolbar",label:(0,h.__)("Top toolbar"),info:(0,h.__)("Access all block and document tools in a single place"),messageActivated:(0,h.__)("Top toolbar activated"),messageDeactivated:(0,h.__)("Top toolbar deactivated")}),(0,o.createElement)(k.PreferenceToggleMenuItem,{scope:"core/edit-site",name:"focusMode",label:(0,h.__)("Spotlight mode"),info:(0,h.__)("Focus on one block at a time"),messageActivated:(0,h.__)("Spotlight mode activated"),messageDeactivated:(0,h.__)("Spotlight mode deactivated")}),(0,o.createElement)(En,null),(0,o.createElement)(j.Slot,{name:"core/edit-site/plugin-more-menu",label:(0,h.__)("Plugins"),as:_.MenuGroup,fillProps:{onClick:t}})),(0,o.createElement)(_.MenuGroup,{label:(0,h.__)("Tools")},(0,o.createElement)(gn,null),(0,o.createElement)(_.MenuItem,{onClick:l,shortcut:Kt.displayShortcut.access("h")},(0,h.__)("Keyboard shortcuts")),(0,o.createElement)(_n,null),(0,o.createElement)(hn,null),(0,o.createElement)(_.MenuItem,{icon:Xt,role:"menuitem",href:(0,h.__)("https://wordpress.org/support/article/site-editor/"),target:"_blank",rel:"noopener noreferrer"},(0,h.__)("Help"),(0,o.createElement)(_.VisuallyHidden,{as:"span"},(0,h.__)("(opens in a new tab)"))),(0,o.createElement)(un.Slot,{fillProps:{onClose:t}})),(0,o.createElement)(_.MenuGroup,null,(0,o.createElement)(_.MenuItem,{onClick:r},(0,h.__)("Preferences"))))})),(0,o.createElement)(an,{isModalActive:n,toggleModal:l}),(0,o.createElement)(on,{isModalActive:a,toggleModal:r}))}function yn(e){let{openEntitiesSavedStates:t,isEntitiesSavedStatesOpen:n}=e;const{isDirty:l,isSaving:a}=(0,c.useSelect)((e=>{const{__experimentalGetDirtyEntityRecords:t,isSavingEntityRecord:n}=e(u.store),l=t();return{isDirty:l.length>0,isSaving:(0,Et.some)(l,(e=>n(e.kind,e.name,e.key)))}}),[]),r=!l||a;return(0,o.createElement)(_.Button,{variant:"primary",className:"edit-site-save-button__button","aria-disabled":r,"aria-expanded":n,isBusy:a,onClick:r?void 0:t},(0,h.__)("Save"))}var bn=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"}));var wn=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z"}));var xn=(0,o.forwardRef)((function(e,t){const n=(0,c.useSelect)((e=>e(u.store).hasUndo()),[]),{undo:l}=(0,c.useDispatch)(u.store);return(0,o.createElement)(_.Button,m({},e,{ref:t,icon:(0,h.isRTL)()?wn:bn,label:(0,h.__)("Undo"),shortcut:Kt.displayShortcut.primary("z"),"aria-disabled":!n,onClick:n?l:void 0}))}));var Sn=(0,o.forwardRef)((function(e,t){const n=(0,Kt.isAppleOS)()?Kt.displayShortcut.primaryShift("z"):Kt.displayShortcut.primary("y"),l=(0,c.useSelect)((e=>e(u.store).hasRedo()),[]),{redo:a}=(0,c.useDispatch)(u.store);return(0,o.createElement)(_.Button,m({},e,{ref:t,icon:(0,h.isRTL)()?bn:wn,label:(0,h.__)("Redo"),shortcut:n,"aria-disabled":!l,onClick:l?a:void 0}))}));var kn=(0,o.createElement)(f.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(f.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));function Cn(e){if(e){const t=(0,i.getBlockType)(e.name);return t?(0,i.__experimentalGetBlockLabel)(t,e.attributes):null}return null}function Tn(e){let{entityTitle:t,entityLabel:n,isLoaded:l,children:a,showIconLabels:r}=e;const{label:i}=function(){const{getBlock:e}=(0,c.useSelect)(_e.store),t=(0,c.useSelect)((e=>e(_e.store).__experimentalGetActiveBlockIdByBlockNames(["core/template-part"])),[]);return t?{label:Cn(e(t)),isActive:!0}:{}}(),[s,u]=(0,o.useState)(null),d=(0,o.useMemo)((()=>({anchor:s})),[s]);return l?t?(0,o.createElement)("div",{className:g()("edit-site-document-actions",{"has-secondary-label":!!i})},(0,o.createElement)("div",{ref:u,className:"edit-site-document-actions__title-wrapper"},(0,o.createElement)(_.__experimentalText,{size:"body",className:"edit-site-document-actions__title",as:"h1"},(0,o.createElement)(_.VisuallyHidden,{as:"span"},(0,h.sprintf)((0,h.__)("Editing %s: "),n)),t),(0,o.createElement)(_.__experimentalText,{size:"body",className:"edit-site-document-actions__secondary-item"},null!=i?i:""),a&&(0,o.createElement)(_.Dropdown,{popoverProps:d,position:"bottom center",renderToggle:e=>{let{isOpen:t,onToggle:l}=e;return(0,o.createElement)(_.Button,{className:"edit-site-document-actions__get-info",icon:kn,"aria-expanded":t,"aria-haspopup":"true",onClick:l,variant:r?"tertiary":void 0,label:(0,h.sprintf)((0,h.__)("Show %s details"),n)},r&&(0,h.__)("Details"))},contentClassName:"edit-site-document-actions__info-dropdown",renderContent:a}))):(0,o.createElement)("div",{className:"edit-site-document-actions"},(0,h.__)("Template not found")):(0,o.createElement)("div",{className:"edit-site-document-actions"},(0,h.__)("Loading…"))}function Nn(e){var t;let{onClose:n,templatePart:l,closeTemplateDetailsDropdown:a}=e;const{revertTemplate:r}=(0,c.useDispatch)(Ut),{params:i}=Me(),s=Be({postId:l.id,postType:l.type},{fromTemplateId:i.postId});return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(_.MenuGroup,null,(0,o.createElement)(_.MenuItem,m({},s,{onClick:function(e){s.onClick(e),n(),a()}}),(0,h.sprintf)((0,h.__)("Edit %s"),null===(t=l.title)||void 0===t?void 0:t.rendered))),Je(l)&&(0,o.createElement)(_.MenuGroup,null,(0,o.createElement)(_.MenuItem,{info:(0,h.__)("Use the template part as supplied by the theme."),onClick:function(){r(l),n(),a()}},(0,h.__)("Clear customizations"))))}function In(e){let{templatePart:t,clientId:n,closeTemplateDetailsDropdown:l}=e;const{selectBlock:a,toggleBlockHighlight:r}=(0,c.useDispatch)(_e.store),i=(0,c.useSelect)((e=>e(d.store).__experimentalGetDefaultTemplatePartAreas().find((e=>e.area===t.area))),[t.area]),s=()=>r(n,!0),u=()=>r(n,!1);return(0,o.createElement)("div",{role:"menuitem",className:"edit-site-template-details__template-areas-item"},(0,o.createElement)(_.MenuItem,{role:"button",icon:null==i?void 0:i.icon,iconPosition:"left",onClick:()=>{a(n)},onMouseOver:s,onMouseLeave:u,onFocus:s,onBlur:u},null==i?void 0:i.label),(0,o.createElement)(_.DropdownMenu,{icon:te,label:(0,h.__)("More options"),className:"edit-site-template-details__template-areas-item-more"},(e=>{let{onClose:n}=e;return(0,o.createElement)(Nn,{onClose:n,templatePart:t,closeTemplateDetailsDropdown:l})})))}function Mn(e){let{closeTemplateDetailsDropdown:t}=e;const n=(0,c.useSelect)((e=>e(Ut).getCurrentTemplateTemplateParts()),[]);return n.length?(0,o.createElement)(_.MenuGroup,{label:(0,h.__)("Areas"),className:"edit-site-template-details__group edit-site-template-details__template-areas"},n.map((e=>{let{templatePart:n,block:l}=e;return(0,o.createElement)(In,{key:n.slug,clientId:l.clientId,templatePart:n,closeTemplateDetailsDropdown:t})}))):null}function Pn(e){let{template:t}=e;const[n,l]=(0,o.useState)(!1),[a,r]=(0,u.useEntityProp)("postType",t.type,"title",t.id);return(0,o.createElement)(_.TextControl,{label:(0,h.__)("Title"),value:n?"":a,help:"wp_template_part"!==t.type?(0,h.__)('Give the template a title that indicates its purpose, e.g. "Full Width".'):null,onChange:e=>{e||n?(l(!1),r(e)):l(!0)},onBlur:()=>l(!1)})}function zn(e){let{id:t}=e;const[n,l]=(0,u.useEntityProp)("postType","wp_template_part","area",t),a=(0,c.useSelect)((e=>e(d.store).__experimentalGetDefaultTemplatePartAreas()),[]).map((e=>{let{label:t,area:n}=e;return{label:t,value:n}}));return(0,o.createElement)(_.SelectControl,{label:(0,h.__)("Area"),labelPosition:"top",options:a,value:n,onChange:l})}function Vn(e){let{template:t,onClose:n}=e;const{title:l,description:a}=(0,c.useSelect)((e=>e(d.store).__experimentalGetTemplateInfo(t)),[]),{revertTemplate:r}=(0,c.useDispatch)(Ut),i=Be({postType:t.type,postId:void 0}),s="wp_template_part"===t.type,u=(s||t.is_custom)&&!t.has_theme_file;if(!t)return null;return(0,o.createElement)("div",{className:"edit-site-template-details"},(0,o.createElement)(_.__experimentalVStack,{className:"edit-site-template-details__group",spacing:3},u?(0,o.createElement)(Pn,{template:t}):(0,o.createElement)(_.__experimentalText,{size:16,weight:600,className:"edit-site-template-details__title",as:"p"},l),a&&(0,o.createElement)(_.__experimentalText,{size:"body",className:"edit-site-template-details__description",as:"p"},a)),s&&(0,o.createElement)("div",{className:"edit-site-template-details__group"},(0,o.createElement)(zn,{id:t.id})),(0,o.createElement)(Mn,{closeTemplateDetailsDropdown:n}),Je(t)&&(0,o.createElement)(_.MenuGroup,{className:"edit-site-template-details__group edit-site-template-details__revert"},(0,o.createElement)(_.MenuItem,{className:"edit-site-template-details__revert-button",info:(0,h.__)("Use the template as supplied by the theme."),onClick:()=>{r(t),n()}},(0,h.__)("Clear customizations"))),(0,o.createElement)(_.Button,m({className:"edit-site-template-details__show-all-button"},i),"wp_template"===(null==t?void 0:t.type)?(0,h.__)("Browse all templates"):(0,h.__)("Browse all template parts")))}const Bn=e=>{e.preventDefault()};function An(e){var t;let{openEntitiesSavedStates:n,isEntitiesSavedStatesOpen:l,showIconLabels:a}=e;const r=(0,o.useRef)(),{deviceType:i,entityTitle:s,template:m,templateType:p,isInserterOpen:f,isListViewOpen:E,listViewShortcut:v,isLoaded:y,isVisualMode:b,settings:w,blockEditorMode:x}=(0,c.useSelect)((e=>{const{__experimentalGetPreviewDeviceType:t,getEditedPostType:n,getEditedPostId:l,isInserterOpened:a,isListViewOpened:r,getEditorMode:o,getSettings:i}=e(Ut),{getEditedEntityRecord:s}=e(u.store),{__experimentalGetTemplateInfo:c}=e(d.store),{getShortcutRepresentation:m}=e(jt.store),{__unstableGetEditorMode:p}=e(_e.store),g=n(),_=l(),h=s("postType",g,_),f=!!_;return{deviceType:t(),entityTitle:c(h).title,isLoaded:f,template:h,templateType:g,isInserterOpen:a(),isListViewOpen:r(),listViewShortcut:m("core/edit-site/toggle-list-view"),isVisualMode:"visual"===o(),settings:i(),blockEditorMode:p()}}),[]),{__experimentalSetPreviewDeviceType:S,setIsInserterOpened:k,setIsListViewOpened:C}=(0,c.useDispatch)(Ut),{__unstableSetEditorMode:T}=(0,c.useDispatch)(_e.store),N=(0,J.useViewportMatch)("medium"),I=(0,o.useCallback)((()=>{f?r.current.focus():k(!0)}),[f,k]),M=(0,o.useCallback)((()=>C(!E)),[C,E]),P="wp_template_part"===p,z=(0,h._x)("Toggle block inserter","Generic label for block inserter button"),V=f?(0,h.__)("Close"):(0,h.__)("Add"),B=(null===(t=window)||void 0===t?void 0:t.__experimentalEnableZoomedOutView)&&b,A="zoom-out"===x;return(0,o.createElement)("div",{className:"edit-site-header"},(0,o.createElement)(_e.NavigableToolbar,{className:"edit-site-header_start","aria-label":(0,h.__)("Document tools")},(0,o.createElement)("div",{className:"edit-site-header__toolbar"},(0,o.createElement)(_.ToolbarItem,{ref:r,as:_.Button,className:"edit-site-header-toolbar__inserter-toggle",variant:"primary",isPressed:f,onMouseDown:Bn,onClick:I,disabled:!b,icon:Wt,label:a?V:z,showTooltip:!a}),N&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)(_.ToolbarItem,{as:_e.ToolSelector,showTooltip:!a,variant:a?"tertiary":void 0,disabled:!b}),(0,o.createElement)(_.ToolbarItem,{as:xn,showTooltip:!a,variant:a?"tertiary":void 0}),(0,o.createElement)(_.ToolbarItem,{as:Sn,showTooltip:!a,variant:a?"tertiary":void 0}),(0,o.createElement)(_.ToolbarItem,{as:_.Button,className:"edit-site-header-toolbar__list-view-toggle",disabled:!b&&A,icon:Yt,isPressed:E,label:(0,h.__)("List View"),onClick:M,shortcut:v,showTooltip:!a,variant:a?"tertiary":void 0}),B&&(0,o.createElement)(_.ToolbarItem,{as:_.Button,className:"edit-site-header-toolbar__zoom-out-view-toggle",icon:qt,isPressed:A,label:(0,h.__)("Zoom-out View"),onClick:()=>{S("desktop"),C(!1),T(A?"edit":"zoom-out")}})))),(0,o.createElement)("div",{className:"edit-site-header_center"},(0,o.createElement)(Tn,{entityTitle:s,entityLabel:"wp_template_part"===p?"template part":"template",isLoaded:y,showIconLabels:a},(e=>{let{onClose:t}=e;return(0,o.createElement)(Vn,{template:m,onClose:t})}))),(0,o.createElement)("div",{className:"edit-site-header_end"},(0,o.createElement)("div",{className:"edit-site-header__actions"},!P&&(0,o.createElement)("div",{className:g()("edit-site-header__actions__preview-options",{"is-zoomed-out":A})},(0,o.createElement)(_e.__experimentalPreviewOptions,{deviceType:i,setDeviceType:S},(0,o.createElement)(_.MenuGroup,null,(0,o.createElement)(_.MenuItem,{href:null==w?void 0:w.siteUrl,target:"_blank",icon:Xt},(0,h.__)("View site"),(0,o.createElement)(_.VisuallyHidden,{as:"span"},(0,h.__)("(opens in a new tab)")))))),(0,o.createElement)(yn,{openEntitiesSavedStates:n,isEntitiesSavedStatesOpen:l}),(0,o.createElement)(X.Slot,{scope:"core/edit-site"}),(0,o.createElement)(vn,{showIconLabels:a}))))}var Rn=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"}));function Ln(e){let{className:t,identifier:n,title:l,icon:a,children:r,closeLabel:i,header:s,headerClassName:u,panelClassName:d}=e;const m=(0,c.useSelect)((e=>e(Ut).getSettings().showIconLabels),[]);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Q,{className:t,scope:"core/edit-site",identifier:n,title:l,icon:a,closeLabel:i,header:s,headerClassName:u,panelClassName:d,showIconLabels:m},r),(0,o.createElement)(Y,{scope:"core/edit-site",identifier:n,icon:a},l))}var On=(0,o.createElement)(f.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(f.Path,{d:"M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z"}));function Dn(e){let{className:t,...n}=e;return(0,o.createElement)(_.Icon,m({className:g()(t,"edit-site-global-styles-icon-with-current-color")},n))}function Gn(e){let{icon:t,children:n,...l}=e;return(0,o.createElement)(_.__experimentalItem,l,t&&(0,o.createElement)(_.__experimentalHStack,{justify:"flex-start"},(0,o.createElement)(Dn,{icon:t,size:24}),(0,o.createElement)(_.FlexItem,null,n)),!t&&n)}function Fn(e){return(0,o.createElement)(_.__experimentalNavigatorButton,m({as:Gn},e))}var Hn=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M6.9 7L3 17.8h1.7l1-2.8h4.1l1 2.8h1.7L8.6 7H6.9zm-.7 6.6l1.5-4.3 1.5 4.3h-3zM21.6 17c-.1.1-.2.2-.3.2-.1.1-.2.1-.4.1s-.3-.1-.4-.2c-.1-.1-.1-.3-.1-.6V12c0-.5 0-1-.1-1.4-.1-.4-.3-.7-.5-1-.2-.2-.5-.4-.9-.5-.4 0-.8-.1-1.3-.1s-1 .1-1.4.2c-.4.1-.7.3-1 .4-.2.2-.4.3-.6.5-.1.2-.2.4-.2.7 0 .3.1.5.2.8.2.2.4.3.8.3.3 0 .6-.1.8-.3.2-.2.3-.4.3-.7 0-.3-.1-.5-.2-.7-.2-.2-.4-.3-.6-.4.2-.2.4-.3.7-.4.3-.1.6-.1.8-.1.3 0 .6 0 .8.1.2.1.4.3.5.5.1.2.2.5.2.9v1.1c0 .3-.1.5-.3.6-.2.2-.5.3-.9.4-.3.1-.7.3-1.1.4-.4.1-.8.3-1.1.5-.3.2-.6.4-.8.7-.2.3-.3.7-.3 1.2 0 .6.2 1.1.5 1.4.3.4.9.5 1.6.5.5 0 1-.1 1.4-.3.4-.2.8-.6 1.1-1.1 0 .4.1.7.3 1 .2.3.6.4 1.2.4.4 0 .7-.1.9-.2.2-.1.5-.3.7-.4h-.3zm-3-.9c-.2.4-.5.7-.8.8-.3.2-.6.2-.8.2-.4 0-.6-.1-.9-.3-.2-.2-.3-.6-.3-1.1 0-.5.1-.9.3-1.2s.5-.5.8-.7c.3-.2.7-.3 1-.5.3-.1.6-.3.7-.6v3.4z"}));var $n=(0,o.createElement)(f.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(f.Path,{d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z"}));var Un=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"}));function jn(e,t){var n,l;const{size:a}=e;if(!a||"0"===a)return a;if(!0!==(null==t?void 0:t.fluid))return a;if(!1===(null==e?void 0:e.fluid))return a;const r=(0,_e.getComputedFluidTypographyValue)({minimumFontSize:null==e||null===(n=e.fluid)||void 0===n?void 0:n.min,maximumFontSize:null==e||null===(l=e.fluid)||void 0===l?void 0:l.max,fontSize:a});return r||a}const Wn="body",Yn=[{path:["color","palette"],valueKey:"color",cssVarInfix:"color",classes:[{classSuffix:"color",propertyName:"color"},{classSuffix:"background-color",propertyName:"background-color"},{classSuffix:"border-color",propertyName:"border-color"}]},{path:["color","gradients"],valueKey:"gradient",cssVarInfix:"gradient",classes:[{classSuffix:"gradient-background",propertyName:"background"}]},{path:["color","duotone"],cssVarInfix:"duotone",valueFunc:e=>{let{slug:t}=e;return`url( '#wp-duotone-${t}' )`},classes:[]},{path:["typography","fontSizes"],valueFunc:(e,t)=>{let{typography:n}=t;return jn(e,n)},valueKey:"size",cssVarInfix:"font-size",classes:[{classSuffix:"font-size",propertyName:"font-size"}]},{path:["typography","fontFamilies"],valueKey:"fontFamily",cssVarInfix:"font-family",classes:[{classSuffix:"font-family",propertyName:"font-family"}]},{path:["spacing","spacingSizes"],valueKey:"size",cssVarInfix:"spacing",valueFunc:e=>{let{size:t}=e;return t},classes:[]}],qn={"color.background":"color","color.text":"color","elements.link.color.text":"color","elements.button.color.text":"color","elements.button.backgroundColor":"background-color","elements.heading.color":"color","elements.heading.backgroundColor":"background-color","elements.heading.gradient":"gradient","color.gradient":"gradient","typography.fontSize":"font-size","typography.fontFamily":"font-family"};function Xn(e,t,n,l,a){const r=[(0,Et.get)(e,["blocks",t,...n]),(0,Et.get)(e,n)];for(const o of r)if(o){const r=["custom","theme","default"];for(const i of r){const r=o[i];if(r){const o=(0,Et.find)(r,(e=>e[l]===a));if(o){if("slug"===l)return o;return Xn(e,t,n,"slug",o.slug)[l]===o[l]?o:void 0}}}}}function Kn(e,t,n,l){if(!l)return l;const a=qn[n],r=(0,Et.find)(Yn,["cssVarInfix",a]);if(!r)return l;const{valueKey:o,path:i}=r,s=Xn(e,t,i,o,l);return s?`var:preset|${a}|${s.slug}`:l}function Zn(e,t,n){if(!n||"string"!=typeof n){var l,a;if(null===(l=n)||void 0===l||!l.ref||"string"!=typeof(null===(a=n)||void 0===a?void 0:a.ref))return n;{var r;const t=n.ref.split(".");if(!(n=(0,Et.get)(e,t))||null!==(r=n)&&void 0!==r&&r.ref)return n}}const o="var:",i="var(--wp--";let s;if(n.startsWith(o))s=n.slice(o.length).split("|");else{if(!n.startsWith(i)||!n.endsWith(")"))return n;s=n.slice(i.length,-")".length).split("--")}const[c,...u]=s;return"preset"===c?function(e,t,n,l){let[a,r]=l;const o=(0,Et.find)(Yn,["cssVarInfix",a]);if(!o)return n;const i=Xn(e.settings,t,o.path,"slug",r);if(i){const{valueKey:n}=o;return Zn(e,t,i[n])}return n}(e,t,n,u):"custom"===c?function(e,t,n,l){var a;const r=null!==(a=(0,Et.get)(e.settings,["blocks",t,"custom",...l]))&&void 0!==a?a:(0,Et.get)(e.settings,["custom",...l]);return r?Zn(e,t,r):n}(e,t,n,u):n}const Qn=(0,o.createContext)({user:{},base:{},merged:{},setUserConfig:()=>{}}),Jn={settings:{},styles:{}};function el(e,t){var n;let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"all";const{merged:a,base:r,user:s,setUserConfig:c}=(0,o.useContext)(Qn),u=t?`settings.blocks.${t}.${e}`:`settings.${e}`,d=t=>{c((n=>{const l=JSON.parse(JSON.stringify(n)),a=i.__EXPERIMENTAL_PATHS_WITH_MERGE[e]?u+".custom":u;return(0,Et.set)(l,a,t),l}))},m=t=>{const n=t?`settings.blocks.${t}.${e}`:`settings.${e}`,o=t=>{const l=(0,Et.get)(t,n);var a,r;return i.__EXPERIMENTAL_PATHS_WITH_MERGE[e]?null!==(a=null!==(r=null==l?void 0:l.custom)&&void 0!==r?r:null==l?void 0:l.theme)&&void 0!==a?a:null==l?void 0:l.default:l};let c;switch(l){case"all":c=o(a);break;case"user":c=o(s);break;case"base":c=o(r);break;default:throw"Unsupported source"}return c},p=null!==(n=m(t))&&void 0!==n?n:m();return[p,d]}function tl(e,t){var n;let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"all";const{merged:a,base:r,user:i,setUserConfig:s}=(0,o.useContext)(Qn),c=t?`styles.blocks.${t}.${e}`:`styles.${e}`,u=n=>{s((l=>{const r=JSON.parse(JSON.stringify(l));return(0,Et.set)(r,c,Kn(a.settings,t,e,n)),r}))};let d;switch(l){case"all":d=Zn(a,t,null!==(n=(0,Et.get)(i,c))&&void 0!==n?n:(0,Et.get)(r,c));break;case"user":d=Zn(a,t,(0,Et.get)(i,c));break;case"base":d=Zn(r,t,(0,Et.get)(r,c));break;default:throw"Unsupported source"}return[d,u]}const nl=["background","backgroundColor","color","linkColor","buttonColor","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","textDecoration","padding","contentSize","wideSize","blockGap"];function ll(e){var t,n,l,a,r,o,s,c;if(!e)return nl;const u=(0,i.getBlockType)(e);if(!u)return[];const d=[];return null==u||null===(t=u.supports)||void 0===t||null===(n=t.spacing)||void 0===n||!n.blockGap||!0===(null==u||null===(l=u.supports)||void 0===l||null===(a=l.spacing)||void 0===a?void 0:a.__experimentalSkipSerialization)||null!=u&&null!==(r=u.supports)&&void 0!==r&&null!==(o=r.spacing)&&void 0!==o&&null!==(s=o.__experimentalSkipSerialization)&&void 0!==s&&null!==(c=s.some)&&void 0!==c&&c.call(s,(e=>"blockGap"===e))||d.push("blockGap"),Object.keys(i.__EXPERIMENTAL_STYLE_PROPERTY).forEach((e=>{if(i.__EXPERIMENTAL_STYLE_PROPERTY[e].support)return i.__EXPERIMENTAL_STYLE_PROPERTY[e].requiresOptOut&&i.__EXPERIMENTAL_STYLE_PROPERTY[e].support[0]in u.supports&&!1!==(0,Et.get)(u.supports,i.__EXPERIMENTAL_STYLE_PROPERTY[e].support)||(0,Et.get)(u.supports,i.__EXPERIMENTAL_STYLE_PROPERTY[e].support,!1)?d.push(e):void 0})),d}function al(e){const[t]=el("color.palette.custom",e),[n]=el("color.palette.theme",e),[l]=el("color.palette.default",e),[a]=el("color.defaultPalette");return(0,o.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,h._x)("Theme","Indicates this palette comes from the theme."),colors:n}),a&&l&&l.length&&e.push({name:(0,h._x)("Default","Indicates this palette comes from WordPress."),colors:l}),t&&t.length&&e.push({name:(0,h._x)("Custom","Indicates this palette is created by the user."),colors:t}),e}),[t,n,l])}function rl(e){const[t]=el("color.gradients.custom",e),[n]=el("color.gradients.theme",e),[l]=el("color.gradients.default",e),[a]=el("color.defaultGradients");return(0,o.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,h._x)("Theme","Indicates this palette comes from the theme."),gradients:n}),a&&l&&l.length&&e.push({name:(0,h._x)("Default","Indicates this palette comes from WordPress."),gradients:l}),t&&t.length&&e.push({name:(0,h._x)("Custom","Indicates this palette is created by the user."),gradients:t}),e}),[t,n,l])}function ol(e){return[il(e),sl(e),cl(e),ul(e)].some(Boolean)}function il(e){const t=ll(e);return el("border.color",e)[0]&&t.includes("borderColor")}function sl(e){const t=ll(e);return el("border.radius",e)[0]&&t.includes("borderRadius")}function cl(e){const t=ll(e);return el("border.style",e)[0]&&t.includes("borderStyle")}function ul(e){const t=ll(e);return el("border.width",e)[0]&&t.includes("borderWidth")}function dl(e){return e?e.style||!e.color&&!e.width?e:{...e,style:"solid"}:e}function ml(e){let{name:t}=e;const[n]=tl("border",t,"user"),[l,a]=tl("border",t),r=al(t),i=il(t),s=cl(t),c=ul(t),u=sl(t),[d,m]=tl("border.radius",t),p=()=>{const e=null==n?void 0:n.radius;return"object"==typeof e?Object.entries(e).some(Boolean):!!e},g=(0,o.useCallback)((()=>a(void 0)),[a]),f=(0,o.useCallback)((e=>{const t=function(e){return e?(0,_.__experimentalHasSplitBorders)(e)?{top:dl(e.top),right:dl(e.right),bottom:dl(e.bottom),left:dl(e.left)}:dl(e):e}(e),n=(0,_.__experimentalHasSplitBorders)(t)?{color:null,style:null,width:null,...t}:{top:t,right:t,bottom:t,left:t};a({radius:null==l?void 0:l.radius,...n})}),[a]);return(0,o.createElement)(_.__experimentalToolsPanel,{label:(0,h.__)("Border"),resetAll:g},(c||i)&&(0,o.createElement)(_.__experimentalToolsPanelItem,{hasValue:()=>(0,_.__experimentalIsDefinedBorder)(n),label:(0,h.__)("Border"),onDeselect:()=>(()=>{if(p())return a({radius:n.radius});a(void 0)})(),isShownByDefault:!0},(0,o.createElement)(_.__experimentalBorderBoxControl,{colors:r,enableAlpha:!0,enableStyle:s,onChange:f,popoverOffset:40,popoverPlacement:"left-start",value:l,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0})),u&&(0,o.createElement)(_.__experimentalToolsPanelItem,{hasValue:p,label:(0,h.__)("Radius"),onDeselect:()=>m(void 0),isShownByDefault:!0},(0,o.createElement)(_e.__experimentalBorderRadiusControl,{values:d,onChange:e=>{m(e||void 0)}})))}function pl(e){const t=ll(e);return t.includes("color")||t.includes("backgroundColor")||t.includes("background")||t.includes("linkColor")}var gl=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"}));var _l=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"}));const hl=["horizontal","vertical"];function fl(e){const t=El(e),n=vl(e),l=yl(e),a=bl(e),r=wl(e);return t||n||l||a||r}function El(e){const t=ll(e),[n]=el("layout.contentSize",e);return n&&t.includes("contentSize")}function vl(e){const t=ll(e),[n]=el("layout.wideSize",e);return n&&t.includes("wideSize")}function yl(e){const t=ll(e),[n]=el("spacing.padding",e);return n&&t.includes("padding")}function bl(e){const t=ll(e),[n]=el("spacing.margin",e);return n&&t.includes("margin")}function wl(e){const t=ll(e),[n]=el("spacing.blockGap",e);return n&&t.includes("blockGap")}function xl(e,t){if(!t)return e;const n={};return t.forEach((t=>{"vertical"===t&&(n.top=e.top,n.bottom=e.bottom),"horizontal"===t&&(n.left=e.left,n.right=e.right),n[t]=e[t]})),n}function Sl(e){return e&&"string"==typeof e?{top:e,right:e,bottom:e,left:e}:e}function kl(e){let{name:t}=e;const n=El(t),l=vl(t),a=yl(t),r=bl(t),i=wl(t),s=function(){const[e]=el("spacing.spacingSizes");return e&&e.length>0}(),c=(0,_.__experimentalUseCustomUnits)({availableUnits:el("spacing.units",t)[0]||["%","px","em","rem","vw"]}),{contentSizeValue:u,setContentSizeValue:d,hasUserSetContentSizeValue:m,resetContentSizeValue:p}=function(e){const[t,n]=el("layout.contentSize",e),[l]=el("layout.contentSize",e,"user");return{contentSizeValue:t,setContentSizeValue:n,hasUserSetContentSizeValue:()=>!!l,resetContentSizeValue:()=>n("")}}(t),{wideSizeValue:f,setWideSizeValue:E,hasUserSetWideSizeValue:v,resetWideSizeValue:y}=function(e){const[t,n]=el("layout.wideSize",e),[l]=el("layout.wideSize",e,"user");return{wideSizeValue:t,setWideSizeValue:n,hasUserSetWideSizeValue:()=>!!l,resetWideSizeValue:()=>n("")}}(t),{paddingValues:b,paddingSides:w,isAxialPadding:x,setPaddingValues:S,resetPaddingValue:k,hasPaddingValue:C}=function(e){const[t,n]=tl("spacing.padding",e),l=Sl(t),a=(0,_e.__experimentalUseCustomSides)(e,"padding"),r=a&&a.some((e=>hl.includes(e))),o=e=>{const t=xl(e,a);n(t)},[i]=tl("spacing.padding",e,"user");return{paddingValues:l,paddingSides:a,isAxialPadding:r,setPaddingValues:o,resetPaddingValue:()=>o({}),hasPaddingValue:()=>!!i}}(t),{marginValues:T,marginSides:N,isAxialMargin:I,setMarginValues:M,resetMarginValue:P,hasMarginValue:z}=function(e){const[t,n]=tl("spacing.margin",e),l=Sl(t),a=(0,_e.__experimentalUseCustomSides)(e,"margin"),r=a&&a.some((e=>hl.includes(e))),o=e=>{const t=xl(e,a);n(t)};return{marginValues:l,marginSides:a,isAxialMargin:r,setMarginValues:o,resetMarginValue:()=>o({}),hasMarginValue:()=>!!l&&Object.keys(l).length}}(t),{gapValue:V,gapValues:B,gapSides:A,isAxialGap:R,setGapValue:L,setGapValues:O,resetGapValue:D,hasGapValue:G}=function(e){const[t,n]=tl("spacing.blockGap",e),l=(a=t)&&"string"==typeof a?{top:a}:a?{...a,right:null==a?void 0:a.left,bottom:null==a?void 0:a.top}:a;var a;const r=(0,_e.__experimentalUseCustomSides)(e,"blockGap"),o=r&&r.some((e=>hl.includes(e))),[i]=tl("spacing.blockGap",e,"user");return{gapValue:t,gapValues:l,gapSides:r,isAxialGap:o,setGapValue:n,setGapValues:e=>{e||n(null),!o&&null!=e&&e.hasOwnProperty("top")?n(e.top):n({top:null==e?void 0:e.top,left:null==e?void 0:e.left})},resetGapValue:()=>n(void 0),hasGapValue:()=>!!i}}(t);return(0,o.createElement)(_.__experimentalToolsPanel,{label:(0,h.__)("Dimensions"),resetAll:()=>{k(),P(),D(),p(),y()}},(n||l)&&(0,o.createElement)("span",{className:"span-columns"},(0,h.__)("Set the width of the main content area.")),n&&(0,o.createElement)(_.__experimentalToolsPanelItem,{className:"single-column",label:(0,h.__)("Content size"),hasValue:m,onDeselect:p,isShownByDefault:!0},(0,o.createElement)(_.__experimentalHStack,{alignment:"flex-end",justify:"flex-start"},(0,o.createElement)(_.__experimentalUnitControl,{label:(0,h.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:u||"",onChange:e=>{d(e)},units:c}),(0,o.createElement)(_.__experimentalView,null,(0,o.createElement)(ae,{icon:gl})))),l&&(0,o.createElement)(_.__experimentalToolsPanelItem,{className:"single-column",label:(0,h.__)("Wide size"),hasValue:v,onDeselect:y,isShownByDefault:!0},(0,o.createElement)(_.__experimentalHStack,{alignment:"flex-end",justify:"flex-start"},(0,o.createElement)(_.__experimentalUnitControl,{label:(0,h.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:f||"",onChange:e=>{E(e)},units:c}),(0,o.createElement)(_.__experimentalView,null,(0,o.createElement)(ae,{icon:_l})))),a&&(0,o.createElement)(_.__experimentalToolsPanelItem,{hasValue:C,label:(0,h.__)("Padding"),onDeselect:k,isShownByDefault:!0,className:g()({"tools-panel-item-spacing":s})},!s&&(0,o.createElement)(_.__experimentalBoxControl,{values:b,onChange:S,label:(0,h.__)("Padding"),sides:w,units:c,allowReset:!1,splitOnAxis:x}),s&&(0,o.createElement)(_e.__experimentalSpacingSizesControl,{values:b,onChange:S,label:(0,h.__)("Padding"),sides:w,units:c,allowReset:!1,splitOnAxis:x})),r&&(0,o.createElement)(_.__experimentalToolsPanelItem,{hasValue:z,label:(0,h.__)("Margin"),onDeselect:P,isShownByDefault:!0,className:g()({"tools-panel-item-spacing":s})},!s&&(0,o.createElement)(_.__experimentalBoxControl,{values:T,onChange:M,label:(0,h.__)("Margin"),sides:N,units:c,allowReset:!1,splitOnAxis:I}),s&&(0,o.createElement)(_e.__experimentalSpacingSizesControl,{values:T,onChange:M,label:(0,h.__)("Margin"),sides:N,units:c,allowReset:!1,splitOnAxis:I})),i&&(0,o.createElement)(_.__experimentalToolsPanelItem,{hasValue:G,label:(0,h.__)("Block spacing"),onDeselect:D,isShownByDefault:!0,className:g()({"tools-panel-item-spacing":s})},!s&&(R?(0,o.createElement)(_.__experimentalBoxControl,{label:(0,h.__)("Block spacing"),min:0,onChange:O,units:c,sides:A,values:B,allowReset:!1,splitOnAxis:R}):(0,o.createElement)(_.__experimentalUnitControl,{label:(0,h.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:L,units:c,value:V})),s&&(0,o.createElement)(_e.__experimentalSpacingSizesControl,{label:(0,h.__)("Block spacing"),min:0,onChange:O,sides:R?A:["top"],values:B,allowReset:!1,splitOnAxis:R})))}function Cl(e){const t=Tl(e),n=Nl(e),l=Il(e),a=ll(e);return t||n||l||a.includes("fontSize")}function Tl(e){const t=ll(e);return el("typography.lineHeight",e)[0]&&t.includes("lineHeight")}function Nl(e){const t=ll(e),n=el("typography.fontStyle",e)[0]&&t.includes("fontStyle"),l=el("typography.fontWeight",e)[0]&&t.includes("fontWeight");return n||l}function Il(e,t){if(!el("typography.letterSpacing",e)[0])return!1;if(!e&&"heading"===t)return!0;return ll(e).includes("letterSpacing")}function Ml(e){let{name:t,element:n}=e;const[l,a]=(0,o.useState)("heading"),r=ll(t);let i="";"heading"===n?i=`elements.${l}.`:n&&"text"!==n&&(i=`elements.${n}.`);const[s]=el("typography.fluid",t),[c]=el("typography.fontSizes",t),u=c.map((e=>(s&&(e.size=jn(e,{fluid:s})),e))),d=!el("typography.customFontSize",t)[0],[m]=el("typography.fontFamilies",t),p=el("typography.fontStyle",t)[0]&&r.includes("fontStyle"),g=el("typography.fontWeight",t)[0]&&r.includes("fontWeight"),f=Tl(t),E=Nl(t),v=Il(t,n),y=function(e,t){return!!el("typography.textTransform",e)[0]&&(!e&&"heading"===t||ll(e).includes("textTransform"))}(t,n);let b=r.includes("fontSize");"heading"===n&&"heading"===l&&(b=!1);const[w,x]=tl(i+"typography.fontFamily",t),[S,k]=tl(i+"typography.fontSize",t),[C,T]=tl(i+"typography.fontStyle",t),[N,I]=tl(i+"typography.fontWeight",t),[M,P]=tl(i+"typography.lineHeight",t),[z,V]=tl(i+"typography.letterSpacing",t),[B,A]=tl(i+"typography.textTransform",t),[R]=tl(i+"color.background",t),[L]=tl(i+"color.gradient",t),[O]=tl(i+"color.text",t),D="link"===n?{textDecoration:"underline"}:{};return(0,o.createElement)(_.PanelBody,{className:"edit-site-typography-panel",initialOpen:!0},(0,o.createElement)("div",{className:"edit-site-typography-panel__preview",style:{fontFamily:null!=w?w:"serif",background:null!=L?L:R,color:O,fontSize:S,fontStyle:C,fontWeight:N,letterSpacing:z,...D}},"Aa"),(0,o.createElement)(_.__experimentalGrid,{columns:2,rowGap:16,columnGap:8},"heading"===n&&(0,o.createElement)("div",{className:"edit-site-typography-panel__full-width-control"},(0,o.createElement)(_.__experimentalToggleGroupControl,{label:(0,h.__)("Select heading level"),hideLabelFromVision:!0,value:l,onChange:a,isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0},(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"heading",label:(0,h.__)("All")}),(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"h1",label:(0,h.__)("H1")}),(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"h2",label:(0,h.__)("H2")}),(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"h3",label:(0,h.__)("H3")}),(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"h4",label:(0,h.__)("H4")}),(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"h5",label:(0,h.__)("H5")}),(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"h6",label:(0,h.__)("H6")}))),r.includes("fontFamily")&&(0,o.createElement)("div",{className:"edit-site-typography-panel__full-width-control"},(0,o.createElement)(_e.__experimentalFontFamilyControl,{fontFamilies:m,value:w,onChange:x,size:"__unstable-large",__nextHasNoMarginBottom:!0})),b&&(0,o.createElement)("div",{className:"edit-site-typography-panel__full-width-control"},(0,o.createElement)(_.FontSizePicker,{value:S,onChange:k,fontSizes:u,disableCustomFontSizes:d,size:"__unstable-large",__nextHasNoMarginBottom:!0})),E&&(0,o.createElement)(_e.__experimentalFontAppearanceControl,{value:{fontStyle:C,fontWeight:N},onChange:e=>{let{fontStyle:t,fontWeight:n}=e;T(t),I(n)},hasFontStyles:p,hasFontWeights:g,size:"__unstable-large",__nextHasNoMarginBottom:!0}),f&&(0,o.createElement)(_e.LineHeightControl,{__nextHasNoMarginBottom:!0,__unstableInputWidth:"auto",value:M,onChange:P,size:"__unstable-large"}),v&&(0,o.createElement)(_e.__experimentalLetterSpacingControl,{value:z,onChange:V,size:"__unstable-large",__unstableInputWidth:"auto"}),y&&(0,o.createElement)("div",{className:"edit-site-typography-panel__full-width-control"},(0,o.createElement)(_e.__experimentalTextTransformControl,{value:B,onChange:A,showNone:!0,isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0}))))}var Pl=function(e){let{name:t,parentMenu:n=""}=e;const l=Cl(t),a=pl(t),r=ol(t),i=fl(t),s=r||i;return(0,o.createElement)(_.__experimentalItemGroup,null,l&&(0,o.createElement)(Fn,{icon:Hn,path:n+"/typography","aria-label":(0,h.__)("Typography styles")},(0,h.__)("Typography")),a&&(0,o.createElement)(Fn,{icon:$n,path:n+"/colors","aria-label":(0,h.__)("Colors styles")},(0,h.__)("Colors")),s&&(0,o.createElement)(Fn,{icon:Un,path:n+"/layout","aria-label":(0,h.__)("Layout styles")},(0,h.__)("Layout")))},zl=window.wp.styleEngine;const Vl={__experimentalBorder:"border",color:"color",spacing:"spacing",typography:"typography"};function Bl(e){var t;const n="var:";if(null!=e&&null!==(t=e.startsWith)&&void 0!==t&&t.call(e,n)){return`var(--wp--${e.slice(n.length).split("|").join("--")})`}return e}function Al(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,Et.reduce)(Yn,((n,l)=>{let{path:a,cssVarInfix:r,classes:o}=l;if(!o)return n;const i=(0,Et.get)(t,a,[]);return["default","theme","custom"].forEach((t=>{i[t]&&i[t].forEach((t=>{let{slug:l}=t;o.forEach((t=>{let{classSuffix:a,propertyName:o}=t;const i=`.has-${(0,Et.kebabCase)(l)}-${a}`,s=e.split(",").map((e=>`${e}${i}`)).join(","),c=`var(--wp--preset--${r}--${(0,Et.kebabCase)(l)})`;n+=`${s}{${o}: ${c} !important;}`}))}))})),n}),"")}function Rl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,l=[];return Object.keys(e).forEach((a=>{const r=t+(0,Et.kebabCase)(a.replace("/","-")),o=e[a];if(o instanceof Object){const e=r+n;l=[...l,...Rl(o,e,n)]}else l.push(`${r}: ${o}`)})),l}function Ll(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const a=Wn===t,r=(0,Et.reduce)(i.__EXPERIMENTAL_STYLE_PROPERTY,((t,l,r)=>{let{value:o,properties:i,useEngine:s,rootOnly:c}=l;if(c&&!a)return t;const u=o;if("elements"===u[0]||s)return t;const d=(0,Et.get)(e,u);if("--wp--style--root--padding"===r&&("string"==typeof d||!n))return t;if(i&&"string"!=typeof d)Object.entries(i).forEach((e=>{const[n,l]=e;if(!(0,Et.get)(d,[l],!1))return;const a=n.startsWith("--")?n:(0,Et.kebabCase)(n);t.push(`${a}: ${Bl((0,Et.get)(d,[l]))}`)}));else if((0,Et.get)(e,u,!1)){const n=r.startsWith("--")?r:(0,Et.kebabCase)(r);t.push(`${n}: ${Bl((0,Et.get)(e,u))}`)}return t}),[]),o=(0,zl.getCSSRules)(e);return o.forEach((e=>{var t;if(a&&n&&e.key.startsWith("padding"))return;const o=e.key.startsWith("--")?e.key:(0,Et.kebabCase)(e.key);let i=e.value;if("string"!=typeof i&&null!==(t=i)&&void 0!==t&&t.ref){var s;const e=i.ref.split(".");if(i=(0,Et.get)(l,e),!i||null!==(s=i)&&void 0!==s&&s.ref)return}var c;"font-size"===o&&(i=jn({size:i},null==l||null===(c=l.settings)||void 0===c?void 0:c.typography));r.push(`${o}: ${i}`)})),r}function Ol(e){var t,n,l,a,r;let{tree:o,style:i,selector:s,hasBlockGapSupport:c,hasFallbackGapSupport:u,fallbackGapValue:d}=e,m="",p=c?(0,_e.__experimentalGetGapCSSValue)(null==i||null===(t=i.spacing)||void 0===t?void 0:t.blockGap):"";if(u&&(s===Wn?p=p||"0.5em":!c&&d&&(p=d)),p&&null!=o&&null!==(n=o.settings)&&void 0!==n&&null!==(l=n.layout)&&void 0!==l&&l.definitions&&(Object.values(o.settings.layout.definitions).forEach((e=>{let{className:t,name:n,spacingStyles:l}=e;(c||"flex"===n)&&null!=l&&l.length&&l.forEach((e=>{const n=[];if(e.rules&&Object.entries(e.rules).forEach((e=>{let[t,l]=e;n.push(`${t}: ${l||p}`)})),n.length){let l="";l=c?s===Wn?`${s} .${t}${(null==e?void 0:e.selector)||""}`:`${s}.${t}${(null==e?void 0:e.selector)||""}`:s===Wn?`:where(.${t}${(null==e?void 0:e.selector)||""})`:`:where(${s}.${t}${(null==e?void 0:e.selector)||""})`,m+=`${l} { ${n.join("; ")}; }`}}))})),s===Wn&&c&&(m+=`${s} { --wp--style--block-gap: ${p}; }`)),s===Wn&&null!=o&&null!==(a=o.settings)&&void 0!==a&&null!==(r=a.layout)&&void 0!==r&&r.definitions){const e=["block","flex","grid"];Object.values(o.settings.layout.definitions).forEach((t=>{let{className:n,displayMode:l,baseStyles:a}=t;l&&e.includes(l)&&(m+=`${s} .${n} { display:${l}; }`),null!=a&&a.length&&a.forEach((e=>{const t=[];if(e.rules&&Object.entries(e.rules).forEach((e=>{let[n,l]=e;t.push(`${n}: ${l}`)})),t.length){const l=`${s} .${n}${(null==e?void 0:e.selector)||""}`;m+=`${l} { ${t.join("; ")}; }`}}))}))}return m}const Dl=(e,t)=>{var n,l;const a=[];if(null==e||!e.styles)return a;const r=e=>(0,Et.pickBy)(e,((e,t)=>["border","color","spacing","typography","filter","outline","shadow"].includes(t))),o=r(e.styles);return o&&a.push({styles:o,selector:Wn}),Object.entries(i.__EXPERIMENTAL_ELEMENTS).forEach((t=>{var n;let[l,r]=t;var o;null!==(n=e.styles)&&void 0!==n&&n.elements[l]&&a.push({styles:null===(o=e.styles)||void 0===o?void 0:o.elements[l],selector:r})})),Object.entries(null!==(n=null===(l=e.styles)||void 0===l?void 0:l.blocks)&&void 0!==n?n:{}).forEach((e=>{var n,l;let[o,s]=e;const c=r(s);c&&null!=t&&null!==(n=t[o])&&void 0!==n&&n.selector&&a.push({duotoneSelector:t[o].duotoneSelector,fallbackGapValue:t[o].fallbackGapValue,hasLayoutSupport:t[o].hasLayoutSupport,selector:t[o].selector,styles:c,featureSelectors:t[o].featureSelectors}),Object.entries(null!==(l=null==s?void 0:s.elements)&&void 0!==l?l:{}).forEach((e=>{let[n,l]=e;l&&null!=t&&t[o]&&null!==i.__EXPERIMENTAL_ELEMENTS&&void 0!==i.__EXPERIMENTAL_ELEMENTS&&i.__EXPERIMENTAL_ELEMENTS[n]&&a.push({styles:l,selector:t[o].selector.split(",").map((e=>i.__EXPERIMENTAL_ELEMENTS[n].split(",").map((t=>e+" "+t)))).join(",")})}))})),a},Gl=(e,t)=>{var n,l,a;const r=[];if(null==e||!e.settings)return r;const o=e=>{const t={};return Yn.forEach((n=>{let{path:l}=n;const a=(0,Et.get)(e,l,!1);!1!==a&&(0,Et.set)(t,l,a)})),t},i=o(e.settings),s=null===(n=e.settings)||void 0===n?void 0:n.custom;return(0,Et.isEmpty)(i)&&!s||r.push({presets:i,custom:s,selector:Wn}),Object.entries(null!==(l=null===(a=e.settings)||void 0===a?void 0:a.blocks)&&void 0!==l?l:{}).forEach((e=>{let[n,l]=e;const a=o(l),i=l.custom;(0,Et.isEmpty)(a)&&!i||r.push({presets:a,custom:i,selector:t[n].selector})})),r},Fl=(e,t)=>{const n=Gl(e,t);let l="";return n.forEach((t=>{let{presets:n,custom:a,selector:r}=t;const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return(0,Et.reduce)(Yn,((n,l)=>{let{path:a,valueKey:r,valueFunc:o,cssVarInfix:i}=l;const s=(0,Et.get)(e,a,[]);return["default","theme","custom"].forEach((e=>{s[e]&&s[e].forEach((e=>{r&&!o?n.push(`--wp--preset--${i}--${(0,Et.kebabCase)(e.slug)}: ${e[r]}`):o&&"function"==typeof o&&n.push(`--wp--preset--${i}--${(0,Et.kebabCase)(e.slug)}: ${o(e,t)}`)}))})),n}),[])}(n,null==e?void 0:e.settings),i=Rl(a,"--wp--custom--","--");i.length>0&&o.push(...i),o.length>0&&(l+=`${r}{${o.join(";")};}`)})),l};function Hl(e,t){return Gl(e,t).flatMap((e=>{let{presets:t}=e;return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Yn.filter((e=>"duotone"===e.path.at(-1))).flatMap((t=>{const n=(0,Et.get)(e,t.path,{});return["default","theme"].filter((e=>n[e])).flatMap((e=>n[e].map((e=>(0,o.createElement)(_e.__unstablePresetDuotoneFilter,{preset:e,key:e.slug})))))}))}(t)}))}function $l(){const{merged:e}=(0,o.useContext)(Qn),[t]=el("spacing.blockGap"),n=null!==t,l=!n,a=(0,c.useSelect)((e=>{const{getSettings:t}=e(_e.store);return!!t().disableLayoutStyles}));return(0,o.useMemo)((()=>{if(null==e||!e.styles||null==e||!e.settings)return[];const t=(e=>{const t={};return e.forEach((e=>{var n,l,a,r,o,i,s,c,u;const d=e.name,m=null!==(n=null==e||null===(l=e.supports)||void 0===l?void 0:l.__experimentalSelector)&&void 0!==n?n:".wp-block-"+d.replace("core/","").replace("/","-"),p=null!==(a=null==e||null===(r=e.supports)||void 0===r||null===(o=r.color)||void 0===o?void 0:o.__experimentalDuotone)&&void 0!==a?a:null,g=!(null==e||null===(i=e.supports)||void 0===i||!i.__experimentalLayout),_=null==e||null===(s=e.supports)||void 0===s||null===(c=s.spacing)||void 0===c||null===(u=c.blockGap)||void 0===u?void 0:u.__experimentalDefault,h={};Object.entries(Vl).forEach((t=>{var n,l;let[a,r]=t;const o=null==e||null===(n=e.supports)||void 0===n||null===(l=n[a])||void 0===l?void 0:l.__experimentalSelector;o&&(h[r]=function(e,t){const n=e.split(","),l=t.split(","),a=[];return n.forEach((e=>{l.forEach((t=>{a.push(`${e.trim()} ${t.trim()}`)}))})),a.join(", ")}(m,o))})),t[d]={duotoneSelector:p,fallbackGapValue:_,featureSelectors:Object.keys(h).length?h:void 0,hasLayoutSupport:g,name:d,selector:m}})),t})((0,i.getBlockTypes)()),r=Fl(e,t),o=function(e,t,n,l){var a,r;let o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const i=Dl(e,t),s=Gl(e,t),c=null==e||null===(a=e.settings)||void 0===a?void 0:a.useRootPaddingAwareAlignments,{contentSize:u,wideSize:d}=(null==e||null===(r=e.settings)||void 0===r?void 0:r.layout)||{};let m="body {margin: 0;";if(u&&(m+=` --wp--style--global--content-size: ${u};`),d&&(m+=` --wp--style--global--wide-size: ${d};`),c&&(m+='padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) }\n\t\t\t.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t.has-global-padding :where(.has-global-padding) { padding-right: 0; padding-left: 0; }\n\t\t\t.has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); }\n\t\t\t.has-global-padding :where(.has-global-padding) > .alignfull { margin-right: 0; margin-left: 0; }\n\t\t\t.has-global-padding > .alignfull:where(:not(.has-global-padding)) > :where([class*="wp-block-"]:not(.alignfull):not([class*="__"]),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t.has-global-padding :where(.has-global-padding) > .alignfull:where(:not(.has-global-padding)) > :where([class*="wp-block-"]:not(.alignfull):not([class*="__"]),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: 0; padding-left: 0;'),m+="}",i.forEach((t=>{let{selector:a,duotoneSelector:r,styles:i,fallbackGapValue:s,hasLayoutSupport:u,featureSelectors:d}=t;d&&Object.entries(d).forEach((e=>{let[t,n]=e;if(null!=i&&i[t]){const e=Ll({[t]:i[t]});delete i[t],e.length&&(m+=`${n}{${e.join(";")} }`)}}));const p={};if(null!=i&&i.filter&&(p.filter=i.filter,delete i.filter),r){const e=Ll(p);e.length>0&&(m+=`${r}{${e.join(";")};}`)}o||Wn!==a&&!u||(m+=Ol({tree:e,style:i,selector:a,hasBlockGapSupport:n,hasFallbackGapSupport:l,fallbackGapValue:s}));const g=Ll(i,a,c,e);null!=g&&g.length&&(m+=`${a}{${g.join(";")};}`);const _=Object.entries(i).filter((e=>{let[t]=e;return t.startsWith(":")}));null!=_&&_.length&&_.forEach((e=>{let[t,n]=e;const l=Ll(n);if(null==l||!l.length)return;const r=`${a.split(",").map((e=>e+t)).join(",")}{${l.join(";")};}`;m+=r}))})),m+=".wp-site-blocks > .alignleft { float: left; margin-right: 2em; }",m+=".wp-site-blocks > .alignright { float: right; margin-left: 2em; }",m+=".wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }",n){var p,g;const t=(0,_e.__experimentalGetGapCSSValue)(null==e||null===(p=e.styles)||void 0===p||null===(g=p.spacing)||void 0===g?void 0:g.blockGap)||"0.5em";m+=".wp-site-blocks > * { margin-block-start: 0; margin-block-end: 0; }",m+=`.wp-site-blocks > * + * { margin-block-start: ${t}; }`}return s.forEach((e=>{let{selector:t,presets:n}=e;Wn===t&&(t="");const l=Al(t,n);(0,Et.isEmpty)(l)||(m+=l)})),m}(e,t,n,l,a),s=Hl(e,t);return[[{css:r,isGlobalStyles:!0},{css:o,isGlobalStyles:!0}],e.settings,s]}),[n,l,e,a])}const Ul={start:{opacity:1,display:"block"},hover:{opacity:0,display:"none"}},jl={hover:{opacity:1,display:"block"},start:{opacity:0,display:"none"}};var Wl=e=>{let{label:t,isFocused:n}=e;const[l]=tl("typography.fontWeight"),[a="serif"]=tl("typography.fontFamily"),[r=a]=tl("elements.h1.typography.fontFamily"),[i=l]=tl("elements.h1.typography.fontWeight"),[s="black"]=tl("color.text"),[c=s]=tl("elements.h1.color.text"),[u="blue"]=tl("elements.link.color.text"),[d="white"]=tl("color.background"),[m]=tl("color.gradient"),[p]=$l(),g=(0,J.useReducedMotion)(),[h]=el("color.palette.core"),[f]=el("color.palette.theme"),[E]=el("color.palette.custom"),[v,y]=(0,o.useState)(!1),[b,{width:w}]=(0,J.useResizeObserver)(),x=w?w/248:1,S=(null!=f?f:[]).concat(null!=E?E:[]).concat(null!=h?h:[]),k=S.filter((e=>{let{color:t}=e;return t!==d&&t!==c})).slice(0,2),C=(0,o.useMemo)((()=>p?[...p,{css:"body{min-width: 0;padding: 0;border: none;}",isGlobalStyles:!0}]:p),[p]);return(0,o.createElement)(_e.__unstableIframe,{className:"edit-site-global-styles-preview__iframe",head:(0,o.createElement)(_e.__unstableEditorStyles,{styles:C}),style:{height:152*x,visibility:w?"visible":"hidden"},onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),tabIndex:-1},b,(0,o.createElement)(_.__unstableMotion.div,{style:{height:152*x,width:"100%",background:null!=m?m:d,cursor:"pointer"},initial:"start",animate:!v&&!n||g?"start":"hover"},(0,o.createElement)(_.__unstableMotion.div,{variants:Ul,style:{height:"100%",overflow:"hidden"}},(0,o.createElement)(_.__experimentalHStack,{spacing:10*x,justify:"center",style:{height:"100%",overflow:"hidden"}},(0,o.createElement)("div",{style:{fontFamily:r,fontSize:65*x,color:c,fontWeight:i}},"Aa"),(0,o.createElement)(_.__experimentalVStack,{spacing:4*x},k.map((e=>{let{slug:t,color:n}=e;return(0,o.createElement)("div",{key:t,style:{height:32*x,width:32*x,background:n,borderRadius:32*x/2}})}))))),(0,o.createElement)(_.__unstableMotion.div,{variants:jl,style:{height:"100%",overflow:"hidden"}},(0,o.createElement)(_.__experimentalVStack,{spacing:3*x,justify:"center",style:{height:"100%",overflow:"hidden",padding:10*x,boxSizing:"border-box"}},t&&(0,o.createElement)("div",{style:{fontSize:35*x,fontFamily:r,color:c,fontWeight:i,lineHeight:"1em"}},t),(0,o.createElement)(_.__experimentalHStack,{spacing:2*x,justify:"flex-start"},(0,o.createElement)("div",{style:{fontFamily:a,fontSize:24*x,color:s}},"Aa"),(0,o.createElement)("div",{style:{fontFamily:a,fontSize:24*x,color:u}},"Aa")),S&&(0,o.createElement)(_.__experimentalHStack,{spacing:0},S.slice(0,4).map(((e,t)=>{let{color:n}=e;return(0,o.createElement)("div",{key:t,style:{height:10*x,width:30*x,background:n,flexGrow:1}})})))))))};var Yl=function(){const{variations:e}=(0,c.useSelect)((e=>({variations:e(u.store).__experimentalGetCurrentThemeGlobalStylesVariations()})),[]);return(0,o.createElement)(_.Card,{size:"small"},(0,o.createElement)(_.CardBody,null,(0,o.createElement)(_.__experimentalVStack,{spacing:4},(0,o.createElement)(_.Card,null,(0,o.createElement)(_.CardMedia,null,(0,o.createElement)(Wl,null))),!(null==e||!e.length)&&(0,o.createElement)(_.__experimentalItemGroup,null,(0,o.createElement)(Fn,{path:"/variations","aria-label":(0,h.__)("Browse styles")},(0,o.createElement)(_.__experimentalHStack,{justify:"space-between"},(0,o.createElement)(_.FlexItem,null,(0,h.__)("Browse styles")),(0,o.createElement)(Dn,{icon:(0,h.isRTL)()?re:oe})))),(0,o.createElement)(Pl,null))),(0,o.createElement)(_.CardDivider,null),(0,o.createElement)(_.CardBody,null,(0,o.createElement)(_.__experimentalSpacer,{as:"p",paddingTop:2,paddingX:"13px",marginBottom:4},(0,h.__)("Customize the appearance of specific blocks for the whole site.")),(0,o.createElement)(_.__experimentalItemGroup,null,(0,o.createElement)(Fn,{path:"/blocks","aria-label":(0,h.__)("Blocks styles")},(0,o.createElement)(_.__experimentalHStack,{justify:"space-between"},(0,o.createElement)(_.FlexItem,null,(0,h.__)("Blocks")),(0,o.createElement)(Dn,{icon:(0,h.isRTL)()?re:oe}))))))};var ql=function(e){let{title:t,description:n}=e;return(0,o.createElement)(_.__experimentalVStack,{spacing:0},(0,o.createElement)(_.__experimentalView,null,(0,o.createElement)(_.__experimentalSpacer,{marginBottom:0,paddingX:4,paddingY:3},(0,o.createElement)(_.__experimentalHStack,{spacing:2},(0,o.createElement)(_.__experimentalNavigatorBackButton,{style:{minWidth:24,padding:0},icon:(0,h.isRTL)()?oe:re,isSmall:!0,"aria-label":(0,h.__)("Navigate to the previous view")}),(0,o.createElement)(_.__experimentalSpacer,null,(0,o.createElement)(_.__experimentalHeading,{level:5},t))))),n&&(0,o.createElement)("p",{className:"edit-site-global-styles-header__description"},n))};function Xl(e){let{block:t}=e;const n=Cl(t.name),l=pl(t.name),a=ol(t.name),r=fl(t.name);if(!(n||l||(a||r)))return null;const i=(0,h.sprintf)((0,h.__)("%s block styles"),t.title);return(0,o.createElement)(Fn,{path:"/blocks/"+t.name,"aria-label":i},(0,o.createElement)(_.__experimentalHStack,{justify:"flex-start"},(0,o.createElement)(_e.BlockIcon,{icon:t.icon}),(0,o.createElement)(_.FlexItem,null,t.title)))}var Kl=function(){const e=function(){const e=(0,c.useSelect)((e=>e(i.store).getBlockTypes()),[]),{core:t,noncore:n}=e.reduce(((e,t)=>{const{core:n,noncore:l}=e;return(t.name.startsWith("core/")?n:l).push(t),e}),{core:[],noncore:[]});return[...t,...n]}(),[t,n]=(0,o.useState)(""),l=(0,J.useDebounce)(Qe.speak,500),a=(0,c.useSelect)((e=>e(i.store).isMatchingSearchTerm),[]),r=(0,o.useMemo)((()=>t?e.filter((e=>a(e,t))):e),[t,e,a]),s=(0,o.useRef)();return(0,o.useEffect)((()=>{if(!t)return;const e=s.current.childElementCount,n=(0,h.sprintf)((0,h._n)("%d result found.","%d results found.",e),e);l(n,e)}),[t,l]),(0,o.createElement)(o.Fragment,null,(0,o.createElement)(ql,{title:(0,h.__)("Blocks"),description:(0,h.__)("Customize the appearance of specific blocks and for the whole site.")}),(0,o.createElement)(_.SearchControl,{className:"edit-site-block-types-search",onChange:n,value:t,label:(0,h.__)("Search for blocks"),placeholder:(0,h.__)("Search")}),(0,o.createElement)("div",{ref:s,className:"edit-site-block-types-item-list"},r.map((e=>(0,o.createElement)(Xl,{block:e,key:"menu-itemblock-"+e.name})))))};var Zl=function(e){let{name:t}=e;const n=(0,i.getBlockType)(t);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(ql,{title:n.title}),(0,o.createElement)(Pl,{parentMenu:"/blocks/"+t,name:t}))};var Ql=function(e){let{children:t}=e;return(0,o.createElement)(_.__experimentalHeading,{className:"edit-site-global-styles-subtitle",level:2},t)};function Jl(e){let{name:t,parentMenu:n,element:l,label:a}=e;const r=!t,i="text"!==l&&l?`elements.${l}.`:"",s="link"===l?{textDecoration:"underline"}:{},[c]=tl(i+"typography.fontFamily",t),[u]=tl(i+"typography.fontStyle",t),[d]=tl(i+"typography.fontWeight",t),[m]=tl(i+"typography.letterSpacing",t),[p]=tl(i+"color.background",t),[g]=tl(i+"color.gradient",t),[f]=tl(i+"color.text",t);if(!r)return null;const E=(0,h.sprintf)((0,h.__)("Typography %s styles"),a);return(0,o.createElement)(Fn,{path:n+"/typography/"+l,"aria-label":E},(0,o.createElement)(_.__experimentalHStack,{justify:"flex-start"},(0,o.createElement)(_.FlexItem,{className:"edit-site-global-styles-screen-typography__indicator",style:{fontFamily:null!=c?c:"serif",background:null!=g?g:p,color:f,fontStyle:u,fontWeight:d,letterSpacing:m,...s}},(0,h.__)("Aa")),(0,o.createElement)(_.FlexItem,null,a)))}var ea=function(e){let{name:t}=e;const n=void 0===t?"":"/blocks/"+t;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(ql,{title:(0,h.__)("Typography"),description:(0,h.__)("Manage the typography settings for different elements.")}),!t&&(0,o.createElement)("div",{className:"edit-site-global-styles-screen-typography"},(0,o.createElement)(_.__experimentalVStack,{spacing:3},(0,o.createElement)(Ql,null,(0,h.__)("Elements")),(0,o.createElement)(_.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,o.createElement)(Jl,{name:t,parentMenu:n,element:"text",label:(0,h.__)("Text")}),(0,o.createElement)(Jl,{name:t,parentMenu:n,element:"link",label:(0,h.__)("Links")}),(0,o.createElement)(Jl,{name:t,parentMenu:n,element:"heading",label:(0,h.__)("Headings")}),(0,o.createElement)(Jl,{name:t,parentMenu:n,element:"button",label:(0,h.__)("Buttons")})))),!!t&&(0,o.createElement)(Ml,{name:t,element:"text"}))};const ta={text:{description:(0,h.__)("Manage the fonts used on the site."),title:(0,h.__)("Text")},link:{description:(0,h.__)("Manage the fonts and typography used on the links."),title:(0,h.__)("Links")},heading:{description:(0,h.__)("Manage the fonts and typography used on headings."),title:(0,h.__)("Headings")},button:{description:(0,h.__)("Manage the fonts and typography used on buttons."),title:(0,h.__)("Buttons")}};var na=function(e){let{name:t,element:n}=e;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(ql,{title:ta[n].title,description:ta[n].description}),(0,o.createElement)(Ml,{name:t,element:n}))};var la=function(e){let{className:t,...n}=e;return(0,o.createElement)(_.Flex,m({className:g()("edit-site-global-styles__color-indicator-wrapper",t)},n))};const aa=[];var ra=function(e){let{name:t}=e;const[n]=el("color.palette.custom"),[l]=el("color.palette.theme"),[a]=el("color.palette.default"),[r]=el("color.defaultPalette",t),i=(0,o.useMemo)((()=>[...n||aa,...l||aa,...a&&r?a:aa]),[n,l,a,r]),s=t?"/blocks/"+t+"/colors/palette":"/colors/palette",c=i.length>0?(0,h.sprintf)((0,h._n)("%d color","%d colors",i.length),i.length):(0,h.__)("Add custom colors");return(0,o.createElement)(_.__experimentalVStack,{spacing:3},(0,o.createElement)(Ql,null,(0,h.__)("Palette")),(0,o.createElement)(_.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,o.createElement)(Fn,{path:s,"aria-label":(0,h.__)("Color palettes")},(0,o.createElement)(_.__experimentalHStack,{direction:0===i.length?"row-reverse":"row"},(0,o.createElement)(_.__experimentalZStack,{isLayered:!1,offset:-8},i.slice(0,5).map((e=>{let{color:t}=e;return(0,o.createElement)(la,{key:t},(0,o.createElement)(_.ColorIndicator,{colorValue:t}))}))),(0,o.createElement)(_.FlexItem,null,c)))))};function oa(e){let{name:t,parentMenu:n}=e;const l=ll(t),a=l.includes("backgroundColor")||l.includes("background"),[r]=tl("color.background",t),[i]=tl("color.gradient",t);return a?(0,o.createElement)(Fn,{path:n+"/colors/background","aria-label":(0,h.__)("Colors background styles")},(0,o.createElement)(_.__experimentalHStack,{justify:"flex-start"},(0,o.createElement)(la,{expanded:!1},(0,o.createElement)(_.ColorIndicator,{colorValue:null!=i?i:r,"data-testid":"background-color-indicator"})),(0,o.createElement)(_.FlexItem,{className:"edit-site-global-styles__color-label"},(0,h.__)("Background")))):null}function ia(e){let{name:t,parentMenu:n}=e;const l=ll(t).includes("color"),[a]=tl("color.text",t);return l?(0,o.createElement)(Fn,{path:n+"/colors/text","aria-label":(0,h.__)("Colors text styles")},(0,o.createElement)(_.__experimentalHStack,{justify:"flex-start"},(0,o.createElement)(la,{expanded:!1},(0,o.createElement)(_.ColorIndicator,{colorValue:a,"data-testid":"text-color-indicator"})),(0,o.createElement)(_.FlexItem,{className:"edit-site-global-styles__color-label"},(0,h.__)("Text")))):null}function sa(e){let{name:t,parentMenu:n}=e;const l=ll(t).includes("linkColor"),[a]=tl("elements.link.color.text",t),[r]=tl("elements.link.:hover.color.text",t);return l?(0,o.createElement)(Fn,{path:n+"/colors/link","aria-label":(0,h.__)("Colors link styles")},(0,o.createElement)(_.__experimentalHStack,{justify:"flex-start"},(0,o.createElement)(_.__experimentalZStack,{isLayered:!1,offset:-8},(0,o.createElement)(la,{expanded:!1},(0,o.createElement)(_.ColorIndicator,{colorValue:a})),(0,o.createElement)(la,{expanded:!1},(0,o.createElement)(_.ColorIndicator,{colorValue:r}))),(0,o.createElement)(_.FlexItem,{className:"edit-site-global-styles__color-label"},(0,h.__)("Links")))):null}function ca(e){let{name:t,parentMenu:n}=e;const l=ll(t).includes("color"),[a]=tl("elements.heading.color.text",t),[r]=tl("elements.heading.color.background",t);return l?(0,o.createElement)(Fn,{path:n+"/colors/heading","aria-label":(0,h.__)("Colors heading styles")},(0,o.createElement)(_.__experimentalHStack,{justify:"flex-start"},(0,o.createElement)(_.__experimentalZStack,{isLayered:!1,offset:-8},(0,o.createElement)(la,{expanded:!1},(0,o.createElement)(_.ColorIndicator,{colorValue:r})),(0,o.createElement)(la,{expanded:!1},(0,o.createElement)(_.ColorIndicator,{colorValue:a}))),(0,o.createElement)(_.FlexItem,null,(0,h.__)("Headings")))):null}function ua(e){let{name:t,parentMenu:n}=e;const l=ll(t).includes("buttonColor"),[a]=tl("elements.button.color.text",t),[r]=tl("elements.button.color.background",t);return l?(0,o.createElement)(Fn,{path:n+"/colors/button"},(0,o.createElement)(_.__experimentalHStack,{justify:"flex-start"},(0,o.createElement)(_.__experimentalZStack,{isLayered:!1,offset:-8},(0,o.createElement)(la,{expanded:!1},(0,o.createElement)(_.ColorIndicator,{colorValue:r})),(0,o.createElement)(la,{expanded:!1},(0,o.createElement)(_.ColorIndicator,{colorValue:a}))),(0,o.createElement)(_.FlexItem,{className:"edit-site-global-styles__color-label"},(0,h.__)("Buttons")))):null}var da=function(e){let{name:t}=e;const n=void 0===t?"":"/blocks/"+t;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(ql,{title:(0,h.__)("Colors"),description:(0,h.__)("Manage palettes and the default color of different global elements on the site.")}),(0,o.createElement)("div",{className:"edit-site-global-styles-screen-colors"},(0,o.createElement)(_.__experimentalVStack,{spacing:10},(0,o.createElement)(ra,{name:t}),(0,o.createElement)(_.__experimentalVStack,{spacing:3},(0,o.createElement)(Ql,null,(0,h.__)("Elements")),(0,o.createElement)(_.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,o.createElement)(oa,{name:t,parentMenu:n}),(0,o.createElement)(ia,{name:t,parentMenu:n}),(0,o.createElement)(sa,{name:t,parentMenu:n}),(0,o.createElement)(ca,{name:t,parentMenu:n}),(0,o.createElement)(ua,{name:t,parentMenu:n}))))))};function ma(e){let{name:t}=e;const[n,l]=el("color.palette.theme",t),[a]=el("color.palette.theme",t,"base"),[r,i]=el("color.palette.default",t),[s]=el("color.palette.default",t,"base"),[c,u]=el("color.palette.custom",t),[d]=el("color.defaultPalette",t);return(0,o.createElement)(_.__experimentalVStack,{className:"edit-site-global-styles-color-palette-panel",spacing:10},!!n&&!!n.length&&(0,o.createElement)(_.__experimentalPaletteEdit,{canReset:n!==a,canOnlyChangeValues:!0,colors:n,onChange:l,paletteLabel:(0,h.__)("Theme")}),!!r&&!!r.length&&!!d&&(0,o.createElement)(_.__experimentalPaletteEdit,{canReset:r!==s,canOnlyChangeValues:!0,colors:r,onChange:i,paletteLabel:(0,h.__)("Default")}),(0,o.createElement)(_.__experimentalPaletteEdit,{colors:c,onChange:u,paletteLabel:(0,h.__)("Custom"),emptyMessage:(0,h.__)("Custom colors are empty! Add some colors to create your own color palette."),slugPrefix:"custom-"}))}const pa=()=>{};function ga(e){let{name:t}=e;const[n,l]=el("color.gradients.theme",t),[a]=el("color.gradients.theme",t,"base"),[r,i]=el("color.gradients.default",t),[s]=el("color.gradients.default",t,"base"),[c,u]=el("color.gradients.custom",t),[d]=el("color.defaultGradients",t),[m]=el("color.duotone.custom")||[],[p]=el("color.duotone.default")||[],[g]=el("color.duotone.theme")||[],[f]=el("color.defaultDuotone"),E=[...m||[],...g||[],...p&&f?p:[]];return(0,o.createElement)(_.__experimentalVStack,{className:"edit-site-global-styles-gradient-palette-panel",spacing:10},!!n&&!!n.length&&(0,o.createElement)(_.__experimentalPaletteEdit,{canReset:n!==a,canOnlyChangeValues:!0,gradients:n,onChange:l,paletteLabel:(0,h.__)("Theme")}),!!r&&!!r.length&&!!d&&(0,o.createElement)(_.__experimentalPaletteEdit,{canReset:r!==s,canOnlyChangeValues:!0,gradients:r,onChange:i,paletteLabel:(0,h.__)("Default")}),(0,o.createElement)(_.__experimentalPaletteEdit,{gradients:c,onChange:u,paletteLabel:(0,h.__)("Custom"),emptyMessage:(0,h.__)("Custom gradients are empty! Add some gradients to create your own palette."),slugPrefix:"custom-"}),!!E&&!!E.length&&(0,o.createElement)("div",null,(0,o.createElement)(Ql,null,(0,h.__)("Duotone")),(0,o.createElement)(_.__experimentalSpacer,{margin:3}),(0,o.createElement)(_.DuotonePicker,{duotonePalette:E,disableCustomDuotone:!0,disableCustomColors:!0,clearable:!1,onChange:pa})))}var _a=function(e){let{name:t}=e;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(ql,{title:(0,h.__)("Palette"),description:(0,h.__)("Palettes are used to provide default color options for blocks and various design tools. Here you can edit the colors with their labels.")}),(0,o.createElement)(_.TabPanel,{tabs:[{name:"solid",title:"Solid",value:"solid"},{name:"gradient",title:"Gradient",value:"gradient"}]},(e=>(0,o.createElement)(o.Fragment,null,"solid"===e.value&&(0,o.createElement)(ma,{name:t}),"gradient"===e.value&&(0,o.createElement)(ga,{name:t})))))};var ha=function(e){let{name:t}=e;const n=ll(t),[l]=el("color.palette",t),[a]=el("color.gradients",t),[r]=el("color.custom",t),[i]=el("color.customGradient",t),s=al(t),c=rl(t),[u]=el("color.background",t),d=n.includes("backgroundColor")&&u&&(l.length>0||r),p=n.includes("background")&&(a.length>0||i),[g,_]=tl("color.background",t),[f]=tl("color.background",t,"user"),[E,v]=tl("color.gradient",t),[y]=tl("color.gradient",t,"user");if(!d&&!p)return null;let b={};d&&(b={colorValue:g,onColorChange:_},g&&(b.clearable=g===f));let w={};p&&(w={gradientValue:E,onGradientChange:v},E&&(w.clearable=E===y));const x={...b,...w};return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(ql,{title:(0,h.__)("Background"),description:(0,h.__)("Set a background color or gradient for the whole site.")}),(0,o.createElement)(_e.__experimentalColorGradientControl,m({className:"edit-site-screen-background-color__control",colors:s,gradients:c,disableCustomColors:!r,disableCustomGradients:!i,__experimentalHasMultipleOrigins:!0,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0},x)))};var fa=function(e){let{name:t}=e;const n=ll(t),[l]=el("color.palette",t),[a]=el("color.custom",t),[r]=el("color.text",t),i=al(t),s=n.includes("color")&&r&&(l.length>0||a),[c,u]=tl("color.text",t),[d]=tl("color.text",t,"user");return s?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(ql,{title:(0,h.__)("Text"),description:(0,h.__)("Set the default color used for text across the site.")}),(0,o.createElement)(_e.__experimentalColorGradientControl,{className:"edit-site-screen-text-color__control",colors:i,disableCustomColors:!a,__experimentalHasMultipleOrigins:!0,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:c,onColorChange:u,clearable:c===d})):null};var Ea=function(e){let{name:t}=e;const n=ll(t),[l]=el("color.palette",t),[a]=el("color.custom",t),r=al(t),[i]=el("color.link",t),s=n.includes("linkColor")&&i&&(l.length>0||a),c={default:{label:(0,h.__)("Default"),value:tl("elements.link.color.text",t)[0],handler:tl("elements.link.color.text",t)[1],userValue:tl("elements.link.color.text",t,"user")[0]},hover:{label:(0,h.__)("Hover"),value:tl("elements.link.:hover.color.text",t)[0],handler:tl("elements.link.:hover.color.text",t)[1],userValue:tl("elements.link.:hover.color.text",t,"user")[0]}};if(!s)return null;const u=Object.entries(c).map((e=>{let[t,n]=e;return{name:t,title:n.label,className:`color-text-${t}`}}));return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(ql,{title:(0,h.__)("Links"),description:(0,h.__)("Set the colors used for links across the site.")}),(0,o.createElement)(_.TabPanel,{tabs:u},(e=>{var t;const n=null!==(t=c[e.name])&&void 0!==t?t:null;return n?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(_e.__experimentalColorGradientControl,{className:"edit-site-screen-link-color__control",colors:r,disableCustomColors:!a,__experimentalHasMultipleOrigins:!0,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:n.value,onColorChange:n.handler,clearable:n.value===n.userValue})):null})))};var va=function(e){let{name:t}=e;const[n,l]=(0,o.useState)("heading"),a=ll(t),[r]=el("color.palette",t),[i]=el("color.gradients",t),[s]=el("color.custom",t),[c]=el("color.customGradient",t),[u]=el("color.text",t),[d]=el("color.background",t),p=al(t),g=rl(t),f=a.includes("color")&&u&&(r.length>0||s),E=a.includes("backgroundColor")&&d&&(r.length>0||s),v=a.includes("background")&&(i.length>0||c),[y,b]=tl("elements."+n+".color.text",t),[w]=tl("elements."+n+".color.text",t,"user"),[x,S]=tl("elements."+n+".color.background",t),[k]=tl("elements."+n+".color.background",t,"user"),[C,T]=tl("elements."+n+".color.gradient",t),[N]=tl("elements."+n+".color.gradient",t,"user");if(!f&&!E&&!v)return null;let I={};E&&(I={colorValue:x,onColorChange:S},x&&(I.clearable=x===k));let M={};v&&(M={gradientValue:C,onGradientChange:T},C&&(M.clearable=C===N));const P={...I,...M};return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(ql,{title:(0,h.__)("Headings"),description:(0,h.__)("Set the default color used for headings across the site.")}),(0,o.createElement)("div",{className:"edit-site-global-styles-screen-heading-color"},(0,o.createElement)("h4",null,(0,h.__)("Select heading level")),(0,o.createElement)(_.__experimentalToggleGroupControl,{label:(0,h.__)("Select heading level"),hideLabelFromVision:!0,value:n,onChange:l,isBlock:!0},(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"heading",label:(0,h.__)("All")}),(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"h1",label:(0,h.__)("H1")}),(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"h2",label:(0,h.__)("H2")}),(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"h3",label:(0,h.__)("H3")}),(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"h4",label:(0,h.__)("H4")}),(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"h5",label:(0,h.__)("H5")}),(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"h6",label:(0,h.__)("H6")}))),f&&(0,o.createElement)("div",{className:"edit-site-global-styles-screen-heading-color"},(0,o.createElement)("h4",null,"heading"===n?(0,h.__)("Text color for all heading levels"):(0,h.sprintf)((0,h.__)("Text color for %s"),n.toUpperCase())),(0,o.createElement)(_e.__experimentalColorGradientControl,{className:"edit-site-screen-heading-text-color__control",colors:p,disableCustomColors:!s,__experimentalHasMultipleOrigins:!0,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:y,onColorChange:b,clearable:y===w})),E&&(0,o.createElement)("div",{className:"edit-site-global-styles-screen-heading-color"},(0,o.createElement)("h4",null,"heading"===n?(0,h.__)("Background color for all heading levels"):(0,h.sprintf)((0,h.__)("Background color for %s"),n.toUpperCase())),(0,o.createElement)(_e.__experimentalColorGradientControl,m({className:"edit-site-screen-heading-background-color__control",colors:p,gradients:g,disableCustomColors:!s,disableCustomGradients:!c,__experimentalHasMultipleOrigins:!0,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0},P))))};var ya=function(e){let{name:t}=e;const n=ll(t),[l]=el("color.palette",t),[a]=el("color.custom",t),r=al(t),[i]=el("color.background",t),s=n.includes("buttonColor")&&i&&(l.length>0||a),[c,u]=tl("elements.button.color.text",t),[d]=tl("elements.button.color.text",t,"user"),[m,p]=tl("elements.button.color.background",t),[g]=tl("elements.button.color.background",t,"user");return s?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(ql,{title:(0,h.__)("Buttons"),description:(0,h.__)("Set the default colors used for buttons across the site.")}),(0,o.createElement)("h4",{className:"edit-site-global-styles-section-title"},(0,h.__)("Text color")),(0,o.createElement)(_e.__experimentalColorGradientControl,{className:"edit-site-screen-button-color__control",colors:r,disableCustomColors:!a,__experimentalHasMultipleOrigins:!0,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:c,onColorChange:u,clearable:c===d}),(0,o.createElement)("h4",{className:"edit-site-global-styles-section-title"},(0,h.__)("Background color")),(0,o.createElement)(_e.__experimentalColorGradientControl,{className:"edit-site-screen-button-color__control",colors:r,disableCustomColors:!a,__experimentalHasMultipleOrigins:!0,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:m,onColorChange:p,clearable:m===g})):null};var ba=function(e){let{name:t}=e;const n=ol(t),l=fl(t);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(ql,{title:(0,h.__)("Layout")}),l&&(0,o.createElement)(kl,{name:t}),n&&(0,o.createElement)(ml,{name:t}))};const wa=e=>e;function xa(e,t){if(Array.isArray(t))return t}function Sa(e,t){return(0,Et.mergeWith)({},e,t,xa)}const ka=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=(0,Et.pickBy)((0,Et.mapValues)(e,ka),wa);return(0,Et.isEmpty)(t)?void 0:t};function Ca(){const[e,t,n]=function(){const{globalStylesId:e,settings:t,styles:n}=(0,c.useSelect)((e=>{const t=e(u.store).__experimentalGetCurrentGlobalStylesId(),n=t?e(u.store).getEditedEntityRecord("root","globalStyles",t):void 0;return{globalStylesId:t,settings:null==n?void 0:n.settings,styles:null==n?void 0:n.styles}}),[]),{getEditedEntityRecord:l}=(0,c.useSelect)(u.store),{editEntityRecord:a}=(0,c.useDispatch)(u.store),r=(0,o.useMemo)((()=>({settings:null!=t?t:{},styles:null!=n?n:{}})),[t,n]),i=(0,o.useCallback)((t=>{var n,r;const o=l("root","globalStyles",e),i=t({styles:null!==(n=null==o?void 0:o.styles)&&void 0!==n?n:{},settings:null!==(r=null==o?void 0:o.settings)&&void 0!==r?r:{}});a("root","globalStyles",e,{styles:ka(i.styles)||{},settings:ka(i.settings)||{}})}),[e]);return[!!t||!!n,r,i]}(),[l,a]=function(){const e=(0,c.useSelect)((e=>e(u.store).__experimentalGetCurrentThemeBaseGlobalStyles()),[]);return[!!e,e]}(),r=(0,o.useMemo)((()=>a&&t?Sa(a,t):{}),[t,a]);return(0,o.useMemo)((()=>({isReady:e&&l,user:t,base:a,merged:r,setUserConfig:n})),[r,t,a,n,e,l])}function Ta(e){let{children:t}=e;const n=Ca();return n.isReady?(0,o.createElement)(Qn.Provider,{value:n},t):null}function Na(e){let{variation:t}=e;const[n,l]=(0,o.useState)(!1),{base:a,user:r,setUserConfig:i}=(0,o.useContext)(Qn),s=(0,o.useMemo)((()=>{var e,n;return{user:{settings:null!==(e=t.settings)&&void 0!==e?e:{},styles:null!==(n=t.styles)&&void 0!==n?n:{}},base:a,merged:Sa(a,t),setUserConfig:()=>{}}}),[t,a]),c=()=>{i((()=>({settings:t.settings,styles:t.styles})))},u=(0,o.useMemo)((()=>{return e=r,n=t,(0,Et.isEqual)(e.styles,n.styles)&&(0,Et.isEqual)(e.settings,n.settings);var e,n}),[r,t]);return(0,o.createElement)(Qn.Provider,{value:s},(0,o.createElement)("div",{className:g()("edit-site-global-styles-variations_item",{"is-active":u}),role:"button",onClick:c,onKeyDown:e=>{e.keyCode===Kt.ENTER&&(e.preventDefault(),c())},tabIndex:"0","aria-label":null==t?void 0:t.title,"aria-current":u,onFocus:()=>l(!0),onBlur:()=>l(!1)},(0,o.createElement)("div",{className:"edit-site-global-styles-variations_item-preview"},(0,o.createElement)(Wl,{label:null==t?void 0:t.title,isFocused:n}))))}var Ia=function(){const{variations:e}=(0,c.useSelect)((e=>({variations:e(u.store).__experimentalGetCurrentThemeGlobalStylesVariations()})),[]),t=(0,o.useMemo)((()=>[{title:(0,h.__)("Default"),settings:{},styles:{}},...e.map((e=>{var t,n;return{...e,settings:null!==(t=e.settings)&&void 0!==t?t:{},styles:null!==(n=e.styles)&&void 0!==n?n:{}}}))]),[e]);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(ql,{back:"/",title:(0,h.__)("Browse styles"),description:(0,h.__)("Choose a different style combination for the theme styles")}),(0,o.createElement)(_.Card,{size:"small",isBorderless:!0},(0,o.createElement)(_.CardBody,null,(0,o.createElement)(_.__experimentalGrid,{columns:2},null==t?void 0:t.map(((e,t)=>(0,o.createElement)(Na,{key:t,variation:e})))))))};function Ma(e){let{className:t,...n}=e;return(0,o.createElement)(_.__experimentalNavigatorScreen,m({className:["edit-site-global-styles-sidebar__navigator-screen",t].filter(Boolean).join(" ")},n))}function Pa(e){let{name:t}=e;const n=void 0===t?"":"/blocks/"+t;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Ma,{path:n+"/typography"},(0,o.createElement)(ea,{name:t})),(0,o.createElement)(Ma,{path:n+"/typography/text"},(0,o.createElement)(na,{name:t,element:"text"})),(0,o.createElement)(Ma,{path:n+"/typography/link"},(0,o.createElement)(na,{name:t,element:"link"})),(0,o.createElement)(Ma,{path:n+"/typography/heading"},(0,o.createElement)(na,{name:t,element:"heading"})),(0,o.createElement)(Ma,{path:n+"/typography/button"},(0,o.createElement)(na,{name:t,element:"button"})),(0,o.createElement)(Ma,{path:n+"/colors"},(0,o.createElement)(da,{name:t})),(0,o.createElement)(Ma,{path:n+"/colors/palette"},(0,o.createElement)(_a,{name:t})),(0,o.createElement)(Ma,{path:n+"/colors/background"},(0,o.createElement)(ha,{name:t})),(0,o.createElement)(Ma,{path:n+"/colors/text"},(0,o.createElement)(fa,{name:t})),(0,o.createElement)(Ma,{path:n+"/colors/link"},(0,o.createElement)(Ea,{name:t})),(0,o.createElement)(Ma,{path:n+"/colors/heading"},(0,o.createElement)(va,{name:t})),(0,o.createElement)(Ma,{path:n+"/colors/button"},(0,o.createElement)(ya,{name:t})),(0,o.createElement)(Ma,{path:n+"/layout"},(0,o.createElement)(ba,{name:t})))}var za=function(){const e=(0,i.getBlockTypes)();return(0,o.createElement)(_.__experimentalNavigatorProvider,{className:"edit-site-global-styles-sidebar__navigator-provider",initialPath:"/"},(0,o.createElement)(Ma,{path:"/"},(0,o.createElement)(Yl,null)),(0,o.createElement)(Ma,{path:"/variations"},(0,o.createElement)(Ia,null)),(0,o.createElement)(Ma,{path:"/blocks"},(0,o.createElement)(Kl,null)),e.map((e=>(0,o.createElement)(Ma,{key:"menu-block-"+e.name,path:"/blocks/"+e.name},(0,o.createElement)(Zl,{name:e.name})))),(0,o.createElement)(Pa,null),e.map((e=>(0,o.createElement)(Pa,{key:"screens-block-"+e.name,name:e.name}))))};function Va(){const[e,t]=(()=>{const{user:e,setUserConfig:t}=(0,o.useContext)(Qn);return[!!e&&!(0,Et.isEqual)(e,Jn),(0,o.useCallback)((()=>t((()=>Jn))),[t])]})(),{toggle:n}=(0,c.useDispatch)(k.store);return(0,o.createElement)(Ln,{className:"edit-site-global-styles-sidebar",identifier:"edit-site/global-styles",title:(0,h.__)("Styles"),icon:On,closeLabel:(0,h.__)("Close global styles sidebar"),panelClassName:"edit-site-global-styles-sidebar__panel",header:(0,o.createElement)(_.Flex,null,(0,o.createElement)(_.FlexBlock,null,(0,o.createElement)("strong",null,(0,h.__)("Styles"))),(0,o.createElement)(_.FlexItem,null,(0,o.createElement)(_.DropdownMenu,{icon:te,label:(0,h.__)("More Global Styles Actions"),controls:[{title:(0,h.__)("Reset to defaults"),onClick:t,isDisabled:!e},{title:(0,h.__)("Welcome Guide"),onClick:()=>n("core/edit-site","welcomeGuideStyles")}]})))},(0,o.createElement)(za,null))}const Ba="edit-site/template",Aa="edit-site/block-inspector";var Ra=e=>{let{sidebarName:t}=e;const{enableComplementaryArea:n}=(0,c.useDispatch)(O),[l,a]=t===Ba?[(0,h.__)("Template (selected)"),"is-active"]:[(0,h.__)("Template"),""],[r,i]=t===Aa?[(0,h.__)("Block (selected)"),"is-active"]:[(0,h.__)("Block"),""];return(0,o.createElement)("ul",null,(0,o.createElement)("li",null,(0,o.createElement)(_.Button,{onClick:()=>n(Oe,Ba),className:`edit-site-sidebar__panel-tab ${a}`,"aria-label":l,"data-label":(0,h.__)("Template")},(0,h.__)("Template"))),(0,o.createElement)("li",null,(0,o.createElement)(_.Button,{onClick:()=>n(Oe,Aa),className:`edit-site-sidebar__panel-tab ${i}`,"aria-label":r,"data-label":(0,h.__)("Block")},(0,h.__)("Block"))))};function La(e){let{template:t}=e;const{revertTemplate:n}=(0,c.useDispatch)(Ut);return Je(t)?(0,o.createElement)(_.DropdownMenu,{icon:te,label:(0,h.__)("Actions"),className:"edit-site-template-card__actions",toggleProps:{isSmall:!0}},(e=>{let{onClose:l}=e;return(0,o.createElement)(_.MenuGroup,null,(0,o.createElement)(_.MenuItem,{info:(0,h.__)("Use the template as supplied by the theme."),onClick:()=>{n(t),l()}},(0,h.__)("Clear customizations")))})):null}function Oa(e){let{area:t,clientId:n}=e;const{selectBlock:l,toggleBlockHighlight:a}=(0,c.useDispatch)(_e.store),r=(0,c.useSelect)((e=>e(d.store).__experimentalGetDefaultTemplatePartAreas().find((e=>e.area===t))),[t]),i=()=>a(n,!0),s=()=>a(n,!1);return(0,o.createElement)(_.Button,{className:"edit-site-template-card__template-areas-item",icon:null==r?void 0:r.icon,onMouseOver:i,onMouseLeave:s,onFocus:i,onBlur:s,onClick:()=>{l(n)}},null==r?void 0:r.label)}function Da(){const e=(0,c.useSelect)((e=>e(Ut).getCurrentTemplateTemplateParts()),[]);return e.length?(0,o.createElement)("section",{className:"edit-site-template-card__template-areas"},(0,o.createElement)(_.__experimentalHeading,{level:3,className:"edit-site-template-card__template-areas-title"},(0,h.__)("Areas")),(0,o.createElement)("ul",{className:"edit-site-template-card__template-areas-list"},e.map((e=>{let{templatePart:t,block:n}=e;return(0,o.createElement)("li",{key:t.slug},(0,o.createElement)(Oa,{area:t.area,clientId:n.clientId}))})))):null}function Ga(){const{info:{title:e,description:t,icon:n},template:l}=(0,c.useSelect)((e=>{const{getEditedPostType:t,getEditedPostId:n}=e(Ut),{getEditedEntityRecord:l}=e(u.store),{__experimentalGetTemplateInfo:a}=e(d.store),r=l("postType",t(),n());return{info:r?a(r):{},template:r}}),[]);return e||t?(0,o.createElement)("div",{className:"edit-site-template-card"},(0,o.createElement)(_.Icon,{className:"edit-site-template-card__icon",icon:n}),(0,o.createElement)("div",{className:"edit-site-template-card__content"},(0,o.createElement)("div",{className:"edit-site-template-card__header"},(0,o.createElement)("h2",{className:"edit-site-template-card__title"},e),(0,o.createElement)(La,{template:l})),(0,o.createElement)("div",{className:"edit-site-template-card__description"},t),(0,o.createElement)(Da,null))):null}const{Slot:Fa,Fill:Ha}=(0,_.createSlotFill)("EditSiteSidebarInspector"),$a=Ha;function Ua(){const{sidebar:e,isEditorSidebarOpened:t,hasBlockSelection:n,supportsGlobalStyles:l}=(0,c.useSelect)((e=>{const t=e(O).getActiveComplementaryArea(Oe),n=[Aa,Ba].includes(t),l=e(Ut).getSettings();return{sidebar:t,isEditorSidebarOpened:n,hasBlockSelection:!!e(_e.store).getBlockSelectionStart(),supportsGlobalStyles:!(null!=l&&l.supportsTemplatePartsMode)}}),[]),{enableComplementaryArea:a}=(0,c.useDispatch)(O);(0,o.useEffect)((()=>{t&&a(Oe,n?Aa:Ba)}),[n,t]);let r=e;t||(r=n?Aa:Ba);let i=o.Fragment;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Ln,{identifier:r,title:(0,h.__)("Settings"),icon:Rn,closeLabel:(0,h.__)("Close settings sidebar"),header:(0,o.createElement)(Ra,{sidebarName:r}),headerClassName:"edit-site-sidebar__panel-tabs"},r===Ba&&(0,o.createElement)(_.PanelBody,null,(0,o.createElement)(Ga,null)),r===Aa&&(0,o.createElement)(Fa,{bubblesVirtually:!0})),l&&(0,o.createElement)(Va,null),(0,o.createElement)(i,null))}var ja=window.wp.htmlEntities;var Wa=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"}));var Ya=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"}));const qa="__experimentalMainDashboardButton",{Fill:Xa,Slot:Ka}=(0,_.createSlotFill)(qa),Za=Xa;Za.Slot=e=>{let{children:t}=e;const n=(0,_.__experimentalUseSlot)(qa);return Boolean(n.fills&&n.fills.length)?(0,o.createElement)(Ka,{bubblesVirtually:!0}):t};var Qa=Za;const Ja="site-editor";function er(e){let{params:t,replace:n,...l}=e;const a=Be(t,n);return(0,o.createElement)(_.__experimentalNavigationItem,m({},a,l))}var tr=e=>{let{activeItem:t=Ja}=e;const{homeTemplate:n,isNavigationOpen:l,isTemplatePartsMode:a,siteTitle:r}=(0,c.useSelect)((e=>{const{getEntityRecord:t}=e(u.store),{getSettings:n,isNavigationOpened:l}=e(Ut),a=t("root","__unstableBase",void 0)||{},{supportsTemplatePartsMode:r,__unstableHomeTemplate:o}=n();return{siteTitle:a.name,homeTemplate:o,isNavigationOpen:l(),isTemplatePartsMode:!!r}}),[]),{setIsNavigationPanelOpened:i}=(0,c.useDispatch)(Ut);return(0,o.createElement)("div",{className:g()("edit-site-navigation-panel",{"is-open":l}),onKeyDown:e=>{e.keyCode!==Kt.ESCAPE||e.defaultPrevented||(e.preventDefault(),i(!1))}},(0,o.createElement)("div",{className:"edit-site-navigation-panel__inner"},(0,o.createElement)("div",{className:"edit-site-navigation-panel__site-title-container"},(0,o.createElement)("div",{className:"edit-site-navigation-panel__site-title"},(0,ja.decodeEntities)(r))),(0,o.createElement)("div",{className:"edit-site-navigation-panel__scroll-container"},(0,o.createElement)(_.__experimentalNavigation,{activeItem:t},(0,o.createElement)(Qa.Slot,null,(0,o.createElement)(_.__experimentalNavigationBackButton,{backButtonLabel:(0,h.__)("Dashboard"),className:"edit-site-navigation-panel__back-to-dashboard",href:"index.php"})),(0,o.createElement)(_.__experimentalNavigationMenu,null,(0,o.createElement)(_.__experimentalNavigationGroup,{title:(0,h.__)("Editor")},!a&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)(er,{icon:Wa,title:(0,h.__)("Site"),item:Ja,params:{postId:null==n?void 0:n.postId,postType:null==n?void 0:n.postType}}),(0,o.createElement)(er,{icon:Un,title:(0,h.__)("Templates"),item:"wp_template",params:{postId:void 0,postType:"wp_template"}})),(0,o.createElement)(er,{icon:Ya,title:(0,h.__)("Template Parts"),item:"wp_template_part",params:{postId:void 0,postType:"wp_template_part"}})))))))};var nr=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,o.createElement)(f.Path,{d:"M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"}));var lr=function(e){let{icon:t}=e;const{isNavigationOpen:n,isRequestingSiteIcon:l,siteIconUrl:a}=(0,c.useSelect)((e=>{const{getEntityRecord:t,isResolving:n}=e(u.store),l=t("root","__unstableBase",void 0)||{};return{isNavigationOpen:e(Ut).isNavigationOpened(),isRequestingSiteIcon:n("core","getEntityRecord",["root","__unstableBase",void 0]),siteIconUrl:l.site_icon_url}}),[]),{setIsNavigationPanelOpened:r}=(0,c.useDispatch)(Ut),i=(0,J.useReducedMotion)(),s=(0,o.useRef)();(0,o.useEffect)((()=>{n||s.current.focus()}),[n]);let d=(0,o.createElement)(_.Icon,{size:"36px",icon:nr});const m={expand:{scale:1.25,transition:{type:"tween",duration:"0.3"}}};a?d=(0,o.createElement)(_.__unstableMotion.img,{variants:!i&&m,alt:(0,h.__)("Site Icon"),className:"edit-site-navigation-toggle__site-icon",src:a}):l?d=null:t&&(d=(0,o.createElement)(_.Icon,{size:"36px",icon:t}));const p=g()({"edit-site-navigation-toggle__button":!0,"has-icon":a});return(0,o.createElement)(_.__unstableMotion.div,{className:"edit-site-navigation-toggle"+(n?" is-open":""),whileHover:"expand"},(0,o.createElement)(_.Button,{className:p,label:(0,h.__)("Toggle navigation"),ref:s,"aria-pressed":n,onClick:()=>r(!n),showTooltip:!0},d))};const{Fill:ar,Slot:rr}=(0,_.createSlotFill)("EditSiteNavigationPanelPreview"),{Fill:or,Slot:ir}=(0,_.createSlotFill)("EditSiteNavigationSidebar");function sr(e){let{isDefaultOpen:t=!1,activeTemplateType:n}=e;const l=(0,J.useViewportMatch)("medium"),{setIsNavigationPanelOpened:a}=(0,c.useDispatch)(Ut);return(0,o.useEffect)((function(){a(t&&l)}),[t,l,a]),(0,o.createElement)(or,null,(0,o.createElement)(lr,null),(0,o.createElement)(tr,{activeItem:n}),(0,o.createElement)(rr,null))}sr.Slot=ir;var cr=sr,ur=window.wp.reusableBlocks;function dr(e){let{clientId:t}=e;const{getBlocks:n}=(0,c.useSelect)(_e.store),{replaceBlocks:l}=(0,c.useDispatch)(_e.store);return(0,c.useSelect)((e=>e(_e.store).canRemoveBlock(t)),[t])?(0,o.createElement)(_e.BlockSettingsMenuControls,null,(e=>{let{onClose:a}=e;return(0,o.createElement)(_.MenuItem,{onClick:()=>{l(t,n(t)),a()}},(0,h.__)("Detach blocks from template part"))})):null}function mr(e){let{closeModal:t,onCreate:n}=e;const[l,a]=(0,o.useState)(""),[r,i]=(0,o.useState)(De),[s,u]=(0,o.useState)(!1),m=(0,J.useInstanceId)(mr),p=(0,c.useSelect)((e=>e(d.store).__experimentalGetDefaultTemplatePartAreas()),[]);return(0,o.createElement)(_.Modal,{title:(0,h.__)("Create a template part"),closeLabel:(0,h.__)("Close"),onRequestClose:t,overlayClassName:"edit-site-create-template-part-modal"},(0,o.createElement)("form",{onSubmit:async e=>{e.preventDefault(),l&&(u(!0),await n({title:l,area:r}))}},(0,o.createElement)(_.TextControl,{label:(0,h.__)("Name"),value:l,onChange:a,required:!0}),(0,o.createElement)(_.BaseControl,{label:(0,h.__)("Area"),id:`edit-site-create-template-part-modal__area-selection-${m}`,className:"edit-site-create-template-part-modal__area-base-control"},(0,o.createElement)(_.__experimentalRadioGroup,{label:(0,h.__)("Area"),className:"edit-site-create-template-part-modal__area-radio-group",id:`edit-site-create-template-part-modal__area-selection-${m}`,onChange:i,checked:r},p.map((e=>{let{icon:t,label:n,area:l,description:a}=e;return(0,o.createElement)(_.__experimentalRadio,{key:n,value:l,className:"edit-site-create-template-part-modal__area-radio"},(0,o.createElement)(_.Flex,{align:"start",justify:"start"},(0,o.createElement)(_.FlexItem,null,(0,o.createElement)(_.Icon,{icon:t})),(0,o.createElement)(_.FlexBlock,{className:"edit-site-create-template-part-modal__option-label"},n,(0,o.createElement)("div",null,a)),(0,o.createElement)(_.FlexItem,{className:"edit-site-create-template-part-modal__checkbox"},r===l&&(0,o.createElement)(_.Icon,{icon:E}))))})))),(0,o.createElement)(_.Flex,{className:"edit-site-create-template-part-modal__modal-actions",justify:"flex-end"},(0,o.createElement)(_.FlexItem,null,(0,o.createElement)(_.Button,{variant:"secondary",onClick:()=>{t()}},(0,h.__)("Cancel"))),(0,o.createElement)(_.FlexItem,null,(0,o.createElement)(_.Button,{variant:"primary",type:"submit",disabled:!l,isBusy:s},(0,h.__)("Create"))))))}function pr(e){let{clientIds:t,blocks:n}=e;const[l,a]=(0,o.useState)(!1),{replaceBlocks:r}=(0,c.useDispatch)(_e.store),{saveEntityRecord:s}=(0,c.useDispatch)(u.store),{createSuccessNotice:d}=(0,c.useDispatch)(Ze.store),{canCreate:m}=(0,c.useSelect)((e=>{const{supportsTemplatePartsMode:t}=e(Ut).getSettings();return{canCreate:!t}}),[]);if(!m)return null;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(_e.BlockSettingsMenuControls,null,(()=>(0,o.createElement)(_.MenuItem,{icon:Ya,onClick:()=>{a(!0)}},(0,h.__)("Create Template part")))),l&&(0,o.createElement)(mr,{closeModal:()=>{a(!1)},onCreate:async e=>{let{title:l,area:a}=e;const o=(0,Et.kebabCase)(l).replace(/[^\w-]+/g,"")||"wp-custom-part",c=await s("postType","wp_template_part",{slug:o,title:l,content:(0,i.serialize)(n),area:a});r(t,(0,i.createBlock)("core/template-part",{slug:c.slug,theme:c.theme})),d((0,h.__)("Template part created."),{type:"snackbar"})}}))}function gr(){var e;const{clientIds:t,blocks:n}=(0,c.useSelect)((e=>{const{getSelectedBlockClientIds:t,getBlocksByClientId:n}=e(_e.store),l=t();return{clientIds:l,blocks:n(l)}}),[]);return 1===n.length&&"core/template-part"===(null===(e=n[0])||void 0===e?void 0:e.name)?(0,o.createElement)(dr,{clientId:t[0]}):(0,o.createElement)(pr,{clientIds:t,blocks:n})}var _r=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"}));function hr(e){let{type:t,id:n,activePage:l,onActivePageChange:a}=e;const r=(0,c.useSelect)((e=>t&&n&&"URL"!==t&&e(u.store).getEntityRecord("postType",t,n)),[t,n]),i=(0,o.useMemo)((()=>{if(null==r||!r.link)return null;const e=(0,de.getPathAndQueryString)(r.link);return e===(null==l?void 0:l.path)?null:()=>a({type:t,slug:r.slug,path:e,context:{postType:r.type,postId:r.id}})}),[r,null==l?void 0:l.path,a]);return i&&(0,o.createElement)(_.Button,{icon:_r,label:(0,h.__)("Edit Page Template"),onClick:i})}function fr(e){let{onClick:t=(()=>{})}=e;const{shortcut:n,isBlockInspectorOpen:l}=(0,c.useSelect)((e=>({shortcut:e(jt.store).getShortcutRepresentation("core/edit-site/toggle-block-settings-sidebar"),isBlockInspectorOpen:e(O).getActiveComplementaryArea(Ut.name)===Aa})),[]),{enableComplementaryArea:a,disableComplementaryArea:r}=(0,c.useDispatch)(O),i=l?(0,h.__)("Hide more settings"):(0,h.__)("Show more settings");return(0,o.createElement)(_.MenuItem,{onClick:()=>{l?(r(Oe),(0,Qe.speak)((0,h.__)("Block settings closed"))):(a(Oe,Aa),(0,Qe.speak)((0,h.__)("Additional settings are now available in the Editor block settings sidebar"))),t()},shortcut:n},i)}var Er=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M20 10.8H6.7l4.1-4.5-1.1-1.1-5.8 6.3 5.8 5.8 1.1-1.1-4-3.9H20z"}));var vr=function(){var e;const t=Me(),n=Pe(),l="wp_template_part"===t.params.postType,a=null===(e=t.state)||void 0===e?void 0:e.fromTemplateId;return l&&a?(0,o.createElement)(_.Button,{className:"edit-site-visual-editor__back-button",icon:Er,onClick:()=>{n.back()}},(0,h.__)("Back")):null};function yr(e){let{direction:t,resizeWidthBy:n}=e;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("button",{className:`resizable-editor__drag-handle is-${t}`,"aria-label":(0,h.__)("Drag to resize"),"aria-describedby":`resizable-editor__resize-help-${t}`,onKeyDown:function(e){const{keyCode:l}=e;"left"===t&&l===Kt.LEFT||"right"===t&&l===Kt.RIGHT?n(20):("left"===t&&l===Kt.RIGHT||"right"===t&&l===Kt.LEFT)&&n(-20)}}),(0,o.createElement)(_.VisuallyHidden,{id:`resizable-editor__resize-help-${t}`},(0,h.__)("Use left and right arrow keys to resize the canvas.")))}const br="100%",wr="100%",xr={position:void 0,userSelect:void 0,cursor:void 0,width:void 0,height:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0};var Sr=function(e){let{enableResizing:t,settings:n,children:l,...a}=e;const{deviceType:r,isZoomOutMode:i}=(0,c.useSelect)((e=>({deviceType:e(Ut).__experimentalGetPreviewDeviceType(),isZoomOutMode:"zoom-out"===e(_e.store).__unstableGetEditorMode()})),[]),s=(0,_e.__experimentalUseResizeCanvas)(r),[u,d]=(0,o.useState)(br),[p,g]=(0,o.useState)(wr),h=(0,o.useRef)(),f=(0,_e.__unstableUseMouseMoveTypingReset)(),E=(0,J.useMergeRefs)([h,f]);(0,o.useEffect)((function(){if(!h.current||!t)return;const e=h.current;function n(){g(e.contentDocument.body.scrollHeight)}let l;function a(){var t;null===(t=l)||void 0===t||t.disconnect(),l=new e.contentWindow.ResizeObserver(n),l.observe(e.contentDocument.body),n()}return e.addEventListener("load",a),()=>{var t;null===(t=l)||void 0===t||t.disconnect(),e.removeEventListener("load",a)}}),[t,h.current]);const v=(0,o.useCallback)((e=>{h.current&&d(h.current.offsetWidth+e)}),[]);return(0,o.createElement)(_.ResizableBox,{size:{width:u,height:p},onResizeStop:(e,t,n)=>{d(n.style.width)},minWidth:300,maxWidth:"100%",maxHeight:"100%",enable:{right:t,left:t},showHandle:t,resizeRatio:2,handleComponent:{left:(0,o.createElement)(yr,{direction:"left",resizeWidthBy:v}),right:(0,o.createElement)(yr,{direction:"right",resizeWidthBy:v})},handleClasses:void 0,handleStyles:{left:xr,right:xr}},(0,o.createElement)(_e.__unstableIframe,m({isZoomedOut:i,style:t?{height:p}:s,head:(0,o.createElement)(o.Fragment,null,(0,o.createElement)(_e.__unstableEditorStyles,{styles:n.styles}),(0,o.createElement)("style",null,".is-root-container { display: flow-root; }"),t&&(0,o.createElement)("style",null,"html, body { height: -moz-fit-content !important; height: fit-content !important; min-height: 0 !important; }",".is-root-container { min-height: 0 !important; }")),assets:n.__unstableResolvedAssets,ref:E,name:"editor-canvas",className:"edit-site-visual-editor__editor-canvas"},a),n.svgFilters,l))};const kr={type:"default",alignments:[]};function Cr(e){var t,n;let{setIsInserterOpen:l}=e;const{storedSettings:a,templateType:r,templateId:i,page:s}=(0,c.useSelect)((e=>{const{getSettings:t,getEditedPostType:n,getEditedPostId:a,getPage:r}=e(Ut);return{storedSettings:t(l),templateType:n(),templateId:a(),page:r()}}),[l]),d=null!==(t=a.__experimentalAdditionalBlockPatterns)&&void 0!==t?t:a.__experimentalBlockPatterns,p=null!==(n=a.__experimentalAdditionalBlockPatternCategories)&&void 0!==n?n:a.__experimentalBlockPatternCategories,{restBlockPatterns:_,restBlockPatternCategories:h}=(0,c.useSelect)((e=>({restBlockPatterns:e(u.store).getBlockPatterns(),restBlockPatternCategories:e(u.store).getBlockPatternCategories()})),[]),f=(0,o.useMemo)((()=>[...d||[],..._||[]].filter(((e,t,n)=>t===n.findIndex((t=>e.name===t.name)))).filter((e=>{let{postTypes:t}=e;return!t||Array.isArray(t)&&t.includes(r)}))),[d,_,r]),E=(0,o.useMemo)((()=>[...p||[],...h||[]].filter(((e,t,n)=>t===n.findIndex((t=>e.name===t.name))))),[p,h]),v=(0,o.useMemo)((()=>{const{__experimentalAdditionalBlockPatterns:e,__experimentalAdditionalBlockPatternCategories:t,...n}=a;return{...n,__experimentalBlockPatterns:f,__experimentalBlockPatternCategories:E}}),[a,f,E]),[y,b,w]=(0,u.useEntityBlockEditor)("postType",r),{setPage:x}=(0,c.useDispatch)(Ut),{enableComplementaryArea:S}=(0,c.useDispatch)(O),k=((0,o.useCallback)((()=>{S("core/edit-site","edit-site/navigation-menu")}),[S]),(0,o.useRef)()),C=(0,J.useMergeRefs)([k,(0,_e.__unstableUseTypingObserver)()]),T=(0,J.useViewportMatch)("small","<"),{clearSelectedBlock:N}=(0,c.useDispatch)(_e.store),I="wp_template_part"===r,M=0!==y.length;let P=o.Fragment;return(0,o.createElement)(_e.BlockEditorProvider,{settings:v,value:y,onInput:b,onChange:w,useSubRegistry:!1},(0,o.createElement)(gr,null),(0,o.createElement)(_e.__experimentalLinkControl.ViewerFill,null,(0,o.useCallback)((e=>(0,o.createElement)(hr,m({},e,{activePage:s,onActivePageChange:x}))),[s])),(0,o.createElement)($a,null,(0,o.createElement)(_e.BlockInspector,null)),(0,o.createElement)(_e.BlockTools,{className:g()("edit-site-visual-editor",{"is-focus-mode":I}),__unstableContentRef:k,onClick:e=>{e.target===e.currentTarget&&N()}},(0,o.createElement)(_e.BlockEditorKeyboardShortcuts.Register,null),(0,o.createElement)(vr,null),(0,o.createElement)(Sr,{key:i,enableResizing:I&&!T,settings:v,contentRef:C},(0,o.createElement)(_e.BlockList,{className:"edit-site-block-editor__block-list wp-site-blocks",__experimentalLayout:kr,renderAppender:(!I||!M)&&void 0})),(0,o.createElement)(_e.__unstableBlockSettingsMenuFirstItem,null,(e=>{let{onClose:t}=e;return(0,o.createElement)(fr,{onClick:t})})),(0,o.createElement)(_e.__unstableBlockToolbarLastItem,null,(0,o.createElement)(_e.__unstableBlockNameContext.Consumer,null,(e=>"core/navigation"===e&&(0,o.createElement)(P,null))))),(0,o.createElement)(ur.ReusableBlocksMenuItems,null))}var Tr=n(773);function Nr(e){let{value:t,onChange:n,onInput:l}=e;const[a,r]=(0,o.useState)(t),[i,s]=(0,o.useState)(!1),c=(0,J.useInstanceId)(Nr),u=(0,o.useRef)();i||a===t||r(t);return(0,o.useEffect)((()=>()=>{u.current&&n(u.current)}),[]),(0,o.createElement)(o.Fragment,null,(0,o.createElement)(_.VisuallyHidden,{as:"label",htmlFor:`code-editor-text-area-${c}`},(0,h.__)("Type text or HTML")),(0,o.createElement)(Tr.Z,{autoComplete:"off",dir:"auto",value:a,onChange:e=>{const t=e.target.value;l(t),r(t),s(!0),u.current=t},onBlur:()=>{i&&(n(a),s(!1))},className:"edit-site-code-editor-text-area",id:`code-editor-text-area-${c}`,placeholder:(0,h.__)("Start writing with text or HTML")}))}function Ir(){const{templateType:e,shortcut:t}=(0,c.useSelect)((e=>{const{getEditedPostType:t}=e(Ut),{getShortcutRepresentation:n}=e(jt.store);return{templateType:t(),shortcut:n("core/edit-site/toggle-mode")}}),[]),[n,l]=(0,u.useEntityProp)("postType",e,"content"),[a,,r]=(0,u.useEntityBlockEditor)("postType",e);let s;s=n instanceof Function?n({blocks:a}):a?(0,i.__unstableSerializeAndClean)(a):n;const{switchEditorMode:d}=(0,c.useDispatch)(Ut);return(0,o.createElement)("div",{className:"edit-site-code-editor"},(0,o.createElement)("div",{className:"edit-site-code-editor__toolbar"},(0,o.createElement)("h2",null,(0,h.__)("Editing code")),(0,o.createElement)(_.Button,{variant:"tertiary",onClick:()=>d("visual"),shortcut:t},(0,h.__)("Exit code editor"))),(0,o.createElement)("div",{className:"edit-site-code-editor__body"},(0,o.createElement)(Nr,{value:s,onChange:e=>{r((0,i.parse)(e),{selection:void 0})},onInput:l})))}function Mr(e){let{openEntitiesSavedStates:t}=e;const{__experimentalGetDirtyEntityRecords:n,isSavingEntityRecord:l}=(0,c.useSelect)(u.store),{getEditorMode:a}=(0,c.useSelect)(Ut),r=(0,c.useSelect)((e=>e(Ut).isListViewOpened()),[]),o=(0,c.useSelect)((e=>e(O).getActiveComplementaryArea(Ut.name)===Aa),[]),{redo:i,undo:s}=(0,c.useDispatch)(u.store),{setIsListViewOpened:d,switchEditorMode:m}=(0,c.useDispatch)(Ut),{enableComplementaryArea:p,disableComplementaryArea:g}=(0,c.useDispatch)(O);return(0,jt.useShortcut)("core/edit-site/save",(e=>{e.preventDefault();const a=n(),r=!!a.length;!a.some((e=>l(e.kind,e.name,e.key)))&&r&&t()})),(0,jt.useShortcut)("core/edit-site/undo",(e=>{s(),e.preventDefault()})),(0,jt.useShortcut)("core/edit-site/redo",(e=>{i(),e.preventDefault()})),(0,jt.useShortcut)("core/edit-site/toggle-list-view",(()=>{d(!r)})),(0,jt.useShortcut)("core/edit-site/toggle-block-settings-sidebar",(e=>{e.preventDefault(),o?g(Oe):p(Oe,Aa)})),(0,jt.useShortcut)("core/edit-site/toggle-mode",(()=>{m("visual"===a()?"text":"visual")})),null}Mr.Register=function(){const{registerShortcut:e}=(0,c.useDispatch)(jt.store);return(0,o.useEffect)((()=>{e({name:"core/edit-site/save",category:"global",description:(0,h.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),e({name:"core/edit-site/undo",category:"global",description:(0,h.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/edit-site/redo",category:"global",description:(0,h.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"}}),e({name:"core/edit-site/toggle-list-view",category:"global",description:(0,h.__)("Open the block list view."),keyCombination:{modifier:"access",character:"o"}}),e({name:"core/edit-site/toggle-block-settings-sidebar",category:"global",description:(0,h.__)("Show or hide the block settings sidebar."),keyCombination:{modifier:"primaryShift",character:","}}),e({name:"core/edit-site/keyboard-shortcuts",category:"main",description:(0,h.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),e({name:"core/edit-site/next-region",category:"global",description:(0,h.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),e({name:"core/edit-site/previous-region",category:"global",description:(0,h.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"}]}),e({name:"core/edit-site/toggle-mode",category:"global",description:(0,h.__)("Switch between visual editor and code editor."),keyCombination:{modifier:"secondary",character:"m"}})}),[e]),null};var Pr=Mr;function zr(){const{setTemplate:e,setTemplatePart:t,setPage:n}=(0,c.useDispatch)(Ut),{params:{postId:l,postType:a}}=Me();return(0,o.useEffect)((()=>{"page"===a||"post"===a?n({context:{postType:a,postId:l}}):"wp_template"===a?e(l):"wp_template_part"===a&&t(l)}),[l,a]),null}var Vr=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.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"}));function Br(){const{setIsInserterOpened:e}=(0,c.useDispatch)(Ut),t=(0,c.useSelect)((e=>e(Ut).__experimentalGetInsertionPoint()),[]),n=(0,J.useViewportMatch)("medium","<"),l=n?"div":_.VisuallyHidden,[a,r]=(0,J.__experimentalUseDialog)({onClose:()=>e(!1),focusOnMount:null}),i=(0,o.useRef)();return(0,o.useEffect)((()=>{i.current.focusSearch()}),[]),(0,o.createElement)("div",m({ref:a},r,{className:"edit-site-editor__inserter-panel"}),(0,o.createElement)(l,{className:"edit-site-editor__inserter-panel-header"},(0,o.createElement)(_.Button,{icon:Vr,label:(0,h.__)("Close block inserter"),onClick:()=>e(!1)})),(0,o.createElement)("div",{className:"edit-site-editor__inserter-panel-content"},(0,o.createElement)(_e.__experimentalLibrary,{showInserterHelpPanel:!0,shouldFocusBlock:n,rootClientId:t.rootClientId,__experimentalInsertionIndex:t.insertionIndex,__experimentalFilterValue:t.filterValue,ref:i})))}function Ar(){const{setIsListViewOpened:e}=(0,c.useDispatch)(Ut),t=(0,J.useFocusOnMount)("firstElement"),n=(0,J.useFocusReturn)(),l=(0,J.useFocusReturn)();const a=`edit-site-editor__list-view-panel-label-${(0,J.useInstanceId)(Ar)}`;return(0,o.createElement)("div",{"aria-labelledby":a,className:"edit-site-editor__list-view-panel",onKeyDown:function(t){t.keyCode!==Kt.ESCAPE||t.defaultPrevented||e(!1)}},(0,o.createElement)("div",{className:"edit-site-editor__list-view-panel-header",ref:n},(0,o.createElement)("strong",{id:a},(0,h.__)("List View")),(0,o.createElement)(_.Button,{icon:w,label:(0,h.__)("Close List View Sidebar"),onClick:()=>e(!1)})),(0,o.createElement)("div",{className:"edit-site-editor__list-view-panel-content",ref:(0,J.useMergeRefs)([l,t])},(0,o.createElement)(_e.__experimentalListView,null)))}function Rr(e){let{text:t,children:n}=e;const l=(0,J.useCopyToClipboard)(t);return(0,o.createElement)(_.Button,{variant:"secondary",ref:l},n)}function Lr(e){let{message:t,error:n,reboot:l,dashboardLink:a}=e;const r=[];return l&&r.push((0,o.createElement)(_.Button,{key:"recovery",onClick:l,variant:"secondary"},(0,h.__)("Attempt Recovery"))),n&&r.push((0,o.createElement)(Rr,{key:"copy-error",text:n.stack},(0,h.__)("Copy Error"))),a&&r.push((0,o.createElement)(_.Button,{key:"back-to-dashboard",variant:"secondary",href:a},(0,h.__)("Back to dashboard"))),(0,o.createElement)(_e.Warning,{className:"editor-error-boundary",actions:r},t)}class Or extends o.Component{constructor(){super(...arguments),this.reboot=this.reboot.bind(this),this.state={error:null}}componentDidCatch(e){(0,me.doAction)("editor.ErrorBoundary.errorLogged",e)}static getDerivedStateFromError(e){return{error:e}}reboot(){this.props.onError()}render(){const{error:e}=this.state;return e?(0,o.createElement)(Lr,{message:(0,h.__)("The editor has encountered an unexpected error."),error:e,reboot:this.reboot}):this.props.children}}function Dr(e){let{nonAnimatedSrc:t,animatedSrc:n}=e;return(0,o.createElement)("picture",{className:"edit-site-welcome-guide__image"},(0,o.createElement)("source",{srcSet:t,media:"(prefers-reduced-motion: reduce)"}),(0,o.createElement)("img",{src:n,width:"312",height:"240",alt:""}))}function Gr(){const{toggle:e}=(0,c.useDispatch)(k.store);return(0,c.useSelect)((e=>!!e(k.store).get("core/edit-site","welcomeGuide")),[])?(0,o.createElement)(_.Guide,{className:"edit-site-welcome-guide",contentLabel:(0,h.__)("Welcome to the site editor"),finishButtonText:(0,h.__)("Get Started"),onFinish:()=>e("core/edit-site","welcomeGuide"),pages:[{image:(0,o.createElement)(Dr,{nonAnimatedSrc:"https://s.w.org/images/block-editor/edit-your-site.svg?1",animatedSrc:"https://s.w.org/images/block-editor/edit-your-site.gif?1"}),content:(0,o.createElement)(o.Fragment,null,(0,o.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,h.__)("Edit your site")),(0,o.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,h.__)("Design everything on your site — from the header right down to the footer — using blocks.")),(0,o.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,o.createInterpolateElement)((0,h.__)("Click to start designing your blocks, and choose your typography, layout, and colors."),{StylesIconImage:(0,o.createElement)("img",{alt:(0,h.__)("styles"),src:"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z' fill='%231E1E1E'/%3E%3C/svg%3E%0A"})})))}]}):null}function Fr(){const{toggle:e}=(0,c.useDispatch)(k.store),{isActive:t,isStylesOpen:n}=(0,c.useSelect)((e=>{const t=e(O).getActiveComplementaryArea(Ut.name);return{isActive:!!e(k.store).get("core/edit-site","welcomeGuideStyles"),isStylesOpen:"edit-site/global-styles"===t}}),[]);return t&&n?(0,o.createElement)(_.Guide,{className:"edit-site-welcome-guide",contentLabel:(0,h.__)("Welcome to styles"),finishButtonText:(0,h.__)("Get Started"),onFinish:()=>e("core/edit-site","welcomeGuideStyles"),pages:[{image:(0,o.createElement)(Dr,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-to-styles.svg?1",animatedSrc:"https://s.w.org/images/block-editor/welcome-to-styles.gif?1"}),content:(0,o.createElement)(o.Fragment,null,(0,o.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,h.__)("Welcome to Styles")),(0,o.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,h.__)("Tweak your site, or give it a whole new look! Get creative — how about a new color palette for your buttons, or choosing a new font? Take a look at what you can do here.")))},{image:(0,o.createElement)(Dr,{nonAnimatedSrc:"https://s.w.org/images/block-editor/set-the-design.svg?1",animatedSrc:"https://s.w.org/images/block-editor/set-the-design.gif?1"}),content:(0,o.createElement)(o.Fragment,null,(0,o.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,h.__)("Set the design")),(0,o.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,h.__)("You can customize your site as much as you like with different colors, typography, and layouts. Or if you prefer, just leave it up to your theme to handle! ")))},{image:(0,o.createElement)(Dr,{nonAnimatedSrc:"https://s.w.org/images/block-editor/personalize-blocks.svg?1",animatedSrc:"https://s.w.org/images/block-editor/personalize-blocks.gif?1"}),content:(0,o.createElement)(o.Fragment,null,(0,o.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,h.__)("Personalize blocks")),(0,o.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,h.__)("You can adjust your blocks to ensure a cohesive experience across your site — add your unique colors to a branded Button block, or adjust the Heading block to your preferred size.")))},{image:(0,o.createElement)(Dr,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.gif"}),content:(0,o.createElement)(o.Fragment,null,(0,o.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,h.__)("Learn more")),(0,o.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,h.__)("New to block themes and styling your site? "),(0,o.createElement)(_.ExternalLink,{href:(0,h.__)("https://wordpress.org/support/article/styles-overview/")},(0,h.__)("Here’s a detailed guide to learn how to make the most of it."))))}]}):null}function Hr(){return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Gr,null),(0,o.createElement)(Fr,null))}function $r(){return function(){const[e,t,n]=$l(),{getSettings:l}=(0,c.useSelect)(Ut),{updateSettings:a}=(0,c.useDispatch)(Ut);(0,o.useEffect)((()=>{if(!e||!t)return;const r=l(),o=(0,Et.filter)(r.styles,(e=>!e.isGlobalStyles));a({...r,styles:[...o,...e],svgFilters:n,__experimentalFeatures:t})}),[e,t])}(),null}function Ur(e){const t=Me(),n=(0,c.useSelect)((e=>{var t;return null===(t=e(u.store).getEntityRecord("root","site"))||void 0===t?void 0:t.title}),[]),l=(0,o.useRef)(!0);(0,o.useEffect)((()=>{l.current=!1}),[t]),(0,o.useEffect)((()=>{if(!l.current&&e&&n){const t=(0,h.sprintf)((0,h.__)("%1$s ‹ %2$s — WordPress"),(0,ja.decodeEntities)(e),(0,ja.decodeEntities)(n));document.title=t,(0,Qe.speak)((0,h.sprintf)((0,h.__)("Now displaying: %s"),document.title),"assertive")}}),[e,n,t])}const jr={header:(0,h.__)("Editor top bar"),body:(0,h.__)("Editor content"),sidebar:(0,h.__)("Editor settings"),actions:(0,h.__)("Editor publish"),footer:(0,h.__)("Editor footer"),drawer:(0,h.__)("Navigation Sidebar")};var Wr=function(e){let{onError:t}=e;const{isInserterOpen:n,isListViewOpen:l,sidebarIsOpened:a,settings:r,entityId:i,templateType:s,page:m,template:p,templateResolved:g,isNavigationOpen:f,previousShortcut:E,nextShortcut:v,editorMode:y,showIconLabels:b,blockEditorMode:w}=(0,c.useSelect)((e=>{const{isInserterOpened:t,isListViewOpened:n,getSettings:l,getEditedPostType:a,getEditedPostId:r,getPage:o,isNavigationOpened:i,getEditorMode:s}=e(Ut),{hasFinishedResolution:c,getEntityRecord:d}=e(u.store),{__unstableGetEditorMode:m}=e(_e.store),p=a(),g=r();return{isInserterOpen:t(),isListViewOpen:n(),sidebarIsOpened:!!e(O).getActiveComplementaryArea(Ut.name),settings:l(),templateType:p,page:o(),template:g?d("postType",p,g):null,templateResolved:!!g&&c("getEntityRecord",["postType",p,g]),entityId:g,isNavigationOpen:i(),previousShortcut:e(jt.store).getAllShortcutKeyCombinations("core/edit-site/previous-region"),nextShortcut:e(jt.store).getAllShortcutKeyCombinations("core/edit-site/next-region"),editorMode:s(),showIconLabels:e(k.store).get("core/edit-site","showIconLabels"),blockEditorMode:m()}}),[]),{setPage:x,setIsInserterOpened:S}=(0,c.useDispatch)(Ut),{enableComplementaryArea:C}=(0,c.useDispatch)(O),[T,N]=(0,o.useState)(!1),I=(0,o.useCallback)((()=>N(!0)),[]),M=(0,o.useCallback)((()=>{N(!1)}),[]),P=(0,o.useMemo)((()=>({...null==m?void 0:m.context,queryContext:[(null==m?void 0:m.context.queryContext)||{page:1},e=>x({...m,context:{...null==m?void 0:m.context,queryContext:{...null==m?void 0:m.context.queryContext,...e}}})]})),[null==m?void 0:m.context]);(0,o.useEffect)((()=>{f?document.body.classList.add("is-navigation-sidebar-open"):document.body.classList.remove("is-navigation-sidebar-open")}),[f]),(0,o.useEffect)((function(){"open"===new URLSearchParams(window.location.search).get("styles")&&C("core/edit-site","edit-site/global-styles")}),[C]);const z=(null==r?void 0:r.siteUrl)&&void 0!==s&&void 0!==i,V=l?(0,h.__)("List View"):(0,h.__)("Block Library");return Ur(z&&(0,h.__)("Editor (beta)")),(0,o.createElement)(o.Fragment,null,(0,o.createElement)(zr,null),z&&(0,o.createElement)(jt.ShortcutProvider,null,(0,o.createElement)(u.EntityProvider,{kind:"root",type:"site"},(0,o.createElement)(u.EntityProvider,{kind:"postType",type:s,id:i},(0,o.createElement)(Ta,null,(0,o.createElement)(_e.BlockContextProvider,{value:P},(0,o.createElement)($r,null),(0,o.createElement)(Or,{onError:t},(0,o.createElement)(Pr.Register,null),(0,o.createElement)(Ua,null),(0,o.createElement)(ee,{labels:{...jr,secondarySidebar:V},className:b&&"show-icon-labels",secondarySidebar:"visual"===y&&n?(0,o.createElement)(Br,null):"visual"===y&&l?(0,o.createElement)(Ar,null):null,sidebar:a&&(0,o.createElement)(Q.Slot,{scope:"core/edit-site"}),drawer:(0,o.createElement)(cr.Slot,null),header:(0,o.createElement)(An,{openEntitiesSavedStates:I,showIconLabels:b}),notices:(0,o.createElement)(d.EditorSnackbars,null),content:(0,o.createElement)(o.Fragment,null,(0,o.createElement)(d.EditorNotices,null),(0,o.createElement)(_e.BlockStyles.Slot,{scope:"core/block-inspector"}),"visual"===y&&p&&(0,o.createElement)(Cr,{setIsInserterOpen:S}),"text"===y&&p&&(0,o.createElement)(Ir,null),g&&!p&&(null==r?void 0:r.siteUrl)&&i&&(0,o.createElement)(_.Notice,{status:"warning",isDismissible:!1},(0,h.__)("You attempted to edit an item that doesn't exist. Perhaps it was deleted?")),(0,o.createElement)(Pr,{openEntitiesSavedStates:I})),actions:(0,o.createElement)(o.Fragment,null,T?(0,o.createElement)(d.EntitiesSavedStates,{close:M}):(0,o.createElement)("div",{className:"edit-site-editor__toggle-save-panel"},(0,o.createElement)(_.Button,{variant:"secondary",className:"edit-site-editor__toggle-save-panel-button",onClick:I,"aria-expanded":!1},(0,h.__)("Open save panel")))),footer:"zoom-out"!==w?(0,o.createElement)(_e.BlockBreadcrumb,{rootLabelText:(0,h.__)("Template")}):void 0,shortcuts:{previous:E,next:v}}),(0,o.createElement)(Hr,null),(0,o.createElement)(_.Popover.Slot,null))))))))};var Yr=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"}));var qr=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"}));var Xr=(0,o.createElement)(f.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(f.Path,{d:"M19 6.2h-5.9l-.6-1.1c-.3-.7-1-1.1-1.8-1.1H5c-1.1 0-2 .9-2 2v11.8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8.2c0-1.1-.9-2-2-2zm.5 11.6c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h5.8c.2 0 .4.1.4.3l1 2H19c.3 0 .5.2.5.5v9.5zM8 12.8h8v-1.5H8v1.5zm0 3h8v-1.5H8v1.5z"}));var Kr=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"}));var Zr=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M19 5H5c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm.5 12c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v10zm-11-7.6h-.7l-3.1 4.3h2.8V15h1v-1.3h.7v-.8h-.7V9.4zm-.9 3.5H6.3l1.2-1.7v1.7zm5.6-3.2c-.4-.2-.8-.4-1.2-.4-.5 0-.9.1-1.2.4-.4.2-.6.6-.8 1-.2.4-.3.9-.3 1.5s.1 1.1.3 1.6c.2.4.5.8.8 1 .4.2.8.4 1.2.4.5 0 .9-.1 1.2-.4.4-.2.6-.6.8-1 .2-.4.3-1 .3-1.6 0-.6-.1-1.1-.3-1.5-.1-.5-.4-.8-.8-1zm0 3.6c-.1.3-.3.5-.5.7-.2.1-.4.2-.7.2-.3 0-.5-.1-.7-.2-.2-.1-.4-.4-.5-.7-.1-.3-.2-.7-.2-1.2 0-.7.1-1.2.4-1.5.3-.3.6-.5 1-.5s.7.2 1 .5c.3.3.4.8.4 1.5-.1.5-.1.9-.2 1.2zm5-3.9h-.7l-3.1 4.3h2.8V15h1v-1.3h.7v-.8h-.7V9.4zm-1 3.5H16l1.2-1.7v1.7z"}));var Qr=(0,o.createElement)(f.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(f.Path,{d:"M4 4v1.5h16V4H4zm8 8.5h8V11h-8v1.5zM4 20h16v-1.5H4V20zm4-8c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2z"}));var Jr=(0,o.createElement)(f.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(f.Path,{d:"M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z",fillRule:"evenodd",clipRule:"evenodd"}));var eo=(0,o.createElement)(f.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(f.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"}));var to=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{fillRule:"evenodd",d:"M8.95 11.25H4v1.5h4.95v4.5H13V18c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2h-3c-1.1 0-2 .9-2 2v.75h-2.55v-7.5H13V9c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3c-1.1 0-2 .9-2 2v.75H8.95v4.5ZM14.5 15v3c0 .3.2.5.5.5h3c.3 0 .5-.2.5-.5v-3c0-.3-.2-.5-.5-.5h-3c-.3 0-.5.2-.5.5Zm0-6V6c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3c0 .3-.2.5-.5.5h-3c-.3 0-.5-.2-.5-.5Z",clipRule:"evenodd"}));var no=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M11.696 13.972c.356-.546.599-.958.728-1.235a1.79 1.79 0 00.203-.783c0-.264-.077-.47-.23-.618-.148-.153-.354-.23-.618-.23-.295 0-.569.07-.82.212a3.413 3.413 0 00-.738.571l-.147-1.188c.289-.234.59-.41.903-.526.313-.117.66-.175 1.041-.175.375 0 .695.08.959.24.264.153.46.362.59.626.135.265.203.556.203.876 0 .362-.08.734-.24 1.115-.154.381-.427.87-.82 1.466l-.756 1.152H14v1.106h-4l1.696-2.609z"}),(0,o.createElement)(f.Path,{d:"M19.5 7h-15v12a.5.5 0 00.5.5h14a.5.5 0 00.5-.5V7zM3 7V5a2 2 0 012-2h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V7z"}));var lo=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M20.1 11.2l-6.7-6.7c-.1-.1-.3-.2-.5-.2H5c-.4-.1-.8.3-.8.7v7.8c0 .2.1.4.2.5l6.7 6.7c.2.2.5.4.7.5s.6.2.9.2c.3 0 .6-.1.9-.2.3-.1.5-.3.8-.5l5.6-5.6c.4-.4.7-1 .7-1.6.1-.6-.2-1.2-.6-1.6zM19 13.4L13.4 19c-.1.1-.2.1-.3.2-.2.1-.4.1-.6 0-.1 0-.2-.1-.3-.2l-6.5-6.5V5.8h6.8l6.5 6.5c.2.2.2.4.2.6 0 .1 0 .3-.2.5zM9 8c-.6 0-1 .4-1 1s.4 1 1 1 1-.4 1-1-.4-1-1-1z"}));const ao=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"}));const ro=()=>(0,c.useSelect)((e=>e(u.store).getEntityRecords("postType","wp_template",{per_page:-1})),[]),oo=()=>(0,c.useSelect)((e=>e(d.store).__experimentalGetDefaultTemplateTypes()),[]),io=()=>{const e=(0,c.useSelect)((e=>e(u.store).getPostTypes({per_page:-1})),[]);return(0,o.useMemo)((()=>{const t=["attachment"];return null==e?void 0:e.filter((e=>{let{viewable:n,slug:l}=e;return n&&!t.includes(l)}))}),[e])};function so(e){const t=(0,o.useMemo)((()=>null==e?void 0:e.reduce(((e,t)=>{let{labels:n}=t;const l=n.singular_name.toLowerCase();return e[l]=(e[l]||0)+1,e}),{})));return(0,o.useCallback)((e=>{let{labels:n,slug:l}=e;const a=n.singular_name.toLowerCase();return t[a]>1&&a!==l}),[t])}function co(){const e=io(),t=(0,o.useMemo)((()=>null==e?void 0:e.filter((e=>e.has_archive))),[e]),n=ro(),l=so(t);return(0,o.useMemo)((()=>(null==t?void 0:t.filter((e=>!(n||[]).some((t=>t.slug==="archive-"+e.slug)))).map((e=>{var t;let n;return n=l(e)?(0,h.sprintf)((0,h.__)("Archive: %1$s (%2$s)"),e.labels.singular_name,e.slug):(0,h.sprintf)((0,h.__)("Archive: %s"),e.labels.singular_name),{slug:"archive-"+e.slug,description:(0,h.sprintf)((0,h.__)("Displays an archive with the latests posts of type: %s."),e.labels.singular_name),title:n,icon:null!==(t=e.icon)&&void 0!==t&&t.startsWith("dashicons-")?e.icon.slice(10):Xr,templatePrefix:"archive"}})))||[]),[t,n,l])}const uo=e=>{const t=(()=>{const e=(0,c.useSelect)((e=>e(u.store).getTaxonomies({per_page:-1})),[]);return(0,o.useMemo)((()=>null==e?void 0:e.filter((e=>{let{visibility:t}=e;return null==t?void 0:t.publicly_queryable}))),[e])})(),n=ro(),l=oo(),a=(0,o.useMemo)((()=>null==t?void 0:t.reduce(((e,t)=>{let{slug:n}=t,l=n;return["category","post_tag"].includes(n)||(l=`taxonomy-${l}`),"post_tag"===n&&(l="tag"),e[n]=l,e}),{})),[t]),r=null==t?void 0:t.reduce(((e,t)=>{let{labels:n}=t;const l=n.singular_name.toLowerCase();return e[l]=(e[l]||0)+1,e}),{}),i=ho("taxonomy",a),s=(n||[]).map((e=>{let{slug:t}=e;return t})),d=(t||[]).reduce(((t,n)=>{var o;const{slug:c,labels:u}=n,d=a[c],m=null==l?void 0:l.find((e=>{let{slug:t}=e;return t===d})),p=null==s?void 0:s.includes(d),g=((e,t)=>{if(["category","post_tag"].includes(t))return!1;const n=e.singular_name.toLowerCase();return r[n]>1&&n!==t})(u,c);let _=u.singular_name;g&&(_=(0,h.sprintf)((0,h.__)("%1$s (%2$s)"),u.singular_name,c));const f=m?{...m,templatePrefix:a[c]}:{slug:d,title:_,description:(0,h.sprintf)((0,h.__)("Displays taxonomy: %s."),u.singular_name),icon:to,templatePrefix:a[c]},E=null==i||null===(o=i[c])||void 0===o?void 0:o.hasEntities;return E&&(f.onClick=t=>{e({type:"taxonomy",slug:c,config:{queryArgs:e=>{let{search:t}=e;return{_fields:"id,name,slug,link",orderBy:t?"name":"count",exclude:i[c].existingEntitiesIds}},getSpecificTemplate:e=>{const t=`${a[c]}-${e.slug}`;return{title:t,slug:t,templatePrefix:a[c]}}},labels:u,hasGeneralTemplate:p,template:t})}),p&&!E||t.push(f),t}),[]);return(0,o.useMemo)((()=>d.reduce(((e,t)=>{const{slug:n}=t;let l="taxonomiesMenuItems";return["category","tag"].includes(n)&&(l="defaultTaxonomiesMenuItems"),e[l].push(t),e}),{defaultTaxonomiesMenuItems:[],taxonomiesMenuItems:[]})),[d])},mo={user:"author"},po={user:{who:"authors"}};const go=e=>{const t=ro();return(0,o.useMemo)((()=>Object.entries(e||{}).reduce(((e,n)=>{let[l,a]=n;const r=(t||[]).reduce(((e,t)=>{const n=`${a}-`;return t.slug.startsWith(n)&&e.push(t.slug.substring(n.length)),e}),[]);return r.length&&(e[l]=r),e}),{})),[e,t])},_o=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const l=go(t),a=(0,c.useSelect)((t=>Object.entries(l||{}).reduce(((l,a)=>{let[r,o]=a;const i=t(u.store).getEntityRecords(e,r,{_fields:"id",context:"view",slug:o,...n[r]});return null!=i&&i.length&&(l[r]=i),l}),{})),[l]);return a},ho=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const l=_o(e,t,n),a=(0,c.useSelect)((a=>Object.keys(t||{}).reduce(((t,r)=>{var o,i;const s=(null==l||null===(o=l[r])||void 0===o?void 0:o.map((e=>{let{id:t}=e;return t})))||[];return t[r]={hasEntities:!(null===(i=a(u.store).getEntityRecords(e,r,{per_page:1,_fields:"id",context:"view",exclude:s,...n[r]}))||void 0===i||!i.length),existingEntitiesIds:s},t}),{})),[t,l]);return a},fo=[];function Eo(e){let{suggestion:t,search:n,onSelect:l,entityForSuggestions:a,composite:r}=e;const i="edit-site-custom-template-modal__suggestions_list__list-item";return(0,o.createElement)(_.__unstableCompositeItem,m({role:"option",as:_.Button},r,{className:i,onClick:()=>l(a.config.getSpecificTemplate(t))}),(0,o.createElement)("span",{className:`${i}__title`},(0,o.createElement)(_.TextHighlight,{text:t.name,highlight:n})),t.link&&(0,o.createElement)("span",{className:`${i}__info`},t.link))}function vo(e,t){const{config:n}=e,l=(0,o.useMemo)((()=>({order:"asc",context:"view",search:t,per_page:t?20:10,...n.queryArgs(t)})),[t,n]),{records:a,hasResolved:r}=(0,u.useEntityRecords)(e.type,e.slug,l),[i,s]=(0,o.useState)(fo);return(0,o.useEffect)((()=>{if(!r)return;let e=fo;var t,l;null!=a&&a.length&&(e=a,n.recordNamePath&&(t=e,l=n.recordNamePath,e=(t||[]).map((e=>({...e,name:(0,ja.decodeEntities)((0,Et.get)(e,l))}))))),s(e)}),[a,r]),i}function yo(e){let{entityForSuggestions:t,onSelect:n}=e;const l=(0,_.__unstableUseCompositeState)({orientation:"vertical"}),[a,r,i]=function(){const[e,t]=(0,o.useState)(""),[n,l]=(0,o.useState)(""),a=(0,J.useDebounce)(l,250);return(0,o.useEffect)((()=>{n!==e&&a(e)}),[n,e]),[e,t,n]}(),s=vo(t,i),{labels:c}=t,[u,d]=(0,o.useState)(!1);return!u&&(null==s?void 0:s.length)>9&&d(!0),(0,o.createElement)(o.Fragment,null,u&&(0,o.createElement)(_.SearchControl,{onChange:r,value:a,label:c.search_items,placeholder:c.search_items}),!(null==s||!s.length)&&(0,o.createElement)(_.__unstableComposite,m({},l,{role:"listbox",className:"edit-site-custom-template-modal__suggestions_list","aria-label":(0,h.__)("Suggestions list")}),s.map((e=>(0,o.createElement)(Eo,{key:e.slug,suggestion:e,search:i,onSelect:n,entityForSuggestions:t,composite:l})))),i&&!(null!=s&&s.length)&&(0,o.createElement)("p",{className:"edit-site-custom-template-modal__no-results"},c.not_found))}var bo=function(e){let{onClose:t,onSelect:n,entityForSuggestions:l}=e;const[a,r]=(0,o.useState)(l.hasGeneralTemplate),i="edit-site-custom-template-modal";return(0,o.createElement)(_.Modal,{title:(0,h.sprintf)((0,h.__)("Add template: %s"),l.labels.singular_name),className:i,closeLabel:(0,h.__)("Close"),onRequestClose:t},!a&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("p",null,(0,h.__)("Select whether to create a single template for all items or a specific one.")),(0,o.createElement)(_.Flex,{className:`${i}__contents`,gap:"4",align:"initial"},(0,o.createElement)(_.FlexItem,{isBlock:!0,as:_.Button,onClick:()=>{const{slug:e,title:t,description:a,templatePrefix:r}=l.template;n({slug:e,title:t,description:a,templatePrefix:r})}},(0,o.createElement)(_.__experimentalText,{as:"span",weight:600},l.labels.all_items),(0,o.createElement)(_.__experimentalText,{as:"span"},(0,h.__)("For all items"))),(0,o.createElement)(_.FlexItem,{isBlock:!0,as:_.Button,onClick:()=>{r(!0)}},(0,o.createElement)(_.__experimentalText,{as:"span",weight:600},l.labels.singular_name),(0,o.createElement)(_.__experimentalText,{as:"span"},(0,h.__)("For a specific item"))))),a&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("p",null,(0,h.__)("This template will be used only for the specific item chosen.")),(0,o.createElement)(yo,{entityForSuggestions:l,onSelect:n})))};var wo=function(e){let{onClose:t,createTemplate:n}=e;const[l,a]=(0,o.useState)(""),r=(0,h.__)("Custom Template"),[i,s]=(0,o.useState)(!1);return(0,o.createElement)(_.Modal,{title:(0,h.__)("Create custom template"),closeLabel:(0,h.__)("Close"),onRequestClose:()=>{t()},overlayClassName:"edit-site-custom-generic-template__modal"},(0,o.createElement)("form",{onSubmit:async function(e){e.preventDefault(),i||(s(!0),n({slug:"wp-custom-template-"+(0,Et.kebabCase)(l||r),title:l||r},!1))}},(0,o.createElement)(_.Flex,{align:"flex-start",gap:8},(0,o.createElement)(_.FlexItem,null,(0,o.createElement)(_.TextControl,{label:(0,h.__)("Name"),value:l,onChange:a,placeholder:r,disabled:i,help:(0,h.__)('Describe the template, e.g. "Post with sidebar".')}))),(0,o.createElement)(_.Flex,{className:"edit-site-custom-generic-template__modal-actions",justify:"flex-end",expanded:!1},(0,o.createElement)(_.FlexItem,null,(0,o.createElement)(_.Button,{variant:"tertiary",onClick:()=>{t()}},(0,h.__)("Cancel"))),(0,o.createElement)(_.FlexItem,null,(0,o.createElement)(_.Button,{variant:"primary",type:"submit",isBusy:i,"aria-disabled":i},(0,h.__)("Create"))))))};const xo=["front-page","single","page","index","archive","author","category","date","tag","taxonomy","search","404"],So={"front-page":Wa,single:Yr,page:qr,archive:Xr,search:Kr,404:Zr,index:Qr,category:Jr,author:eo,taxonomy:to,date:no,tag:lo,attachment:ao};function ko(e){let{postType:t}=e;const[n,l]=(0,o.useState)(!1),[a,r]=(0,o.useState)(!1),[i,s]=(0,o.useState)({}),d=Pe(),{saveEntityRecord:m}=(0,c.useDispatch)(u.store),{createErrorNotice:p,createSuccessNotice:g}=(0,c.useDispatch)(Ze.store),{setTemplate:f}=(0,c.useDispatch)(Ut);async function E(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{const{title:n,description:l,slug:a,templatePrefix:r}=e;let o=e.content;if(!o){o=(await Ke()({path:(0,de.addQueryArgs)("/wp/v2/templates/lookup",{slug:a,is_custom:!t,template_prefix:r})})).content.raw}const i=await m("postType","wp_template",{description:l,slug:a.toString(),status:"publish",title:n,content:o,is_wp_suggestion:t},{throwOnError:!0});f(i.id,i.slug),d.push({postId:i.id,postType:i.type}),g((0,h.sprintf)((0,h.__)('"%s" successfully created.'),n),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,h.__)("An error occurred while creating the template.");p(t,{type:"snackbar"})}}const v=function(e,t){const n=ro(),l=oo(),a=(n||[]).map((e=>{let{slug:t}=e;return t})),r=(l||[]).filter((e=>xo.includes(e.slug)&&!a.includes(e.slug))),i=n=>{t(!0),e(n)},s=[...r],{defaultTaxonomiesMenuItems:c,taxonomiesMenuItems:u}=uo(i),{defaultPostTypesMenuItems:d,postTypesMenuItems:m}=(e=>{const t=io(),n=ro(),l=oo(),a=so(t),r=(0,o.useMemo)((()=>null==t?void 0:t.reduce(((e,t)=>{let{slug:n}=t,l=n;return"page"!==n&&(l=`single-${l}`),e[n]=l,e}),{})),[t]),i=ho("postType",r),s=(n||[]).map((e=>{let{slug:t}=e;return t})),c=(t||[]).reduce(((t,n)=>{var o;const{slug:c,labels:u,icon:d}=n,m=r[c],p=null==l?void 0:l.find((e=>{let{slug:t}=e;return t===m})),g=null==s?void 0:s.includes(m),_=a(n);let f=(0,h.sprintf)((0,h.__)("Single item: %s"),u.singular_name);_&&(f=(0,h.sprintf)((0,h.__)("Single item: %1$s (%2$s)"),u.singular_name,c));const E=p?{...p,templatePrefix:r[c]}:{slug:m,title:f,description:(0,h.sprintf)((0,h.__)("Displays a single item: %s."),u.singular_name),icon:null!=d&&d.startsWith("dashicons-")?d.slice(10):Yr,templatePrefix:r[c]},v=null==i||null===(o=i[c])||void 0===o?void 0:o.hasEntities;return v&&(E.onClick=t=>{e({type:"postType",slug:c,config:{recordNamePath:"title.rendered",queryArgs:e=>{let{search:t}=e;return{_fields:"id,title,slug,link",orderBy:t?"relevance":"modified",exclude:i[c].existingEntitiesIds}},getSpecificTemplate:e=>{const t=`${r[c]}-${e.slug}`;return{title:t,slug:t,templatePrefix:r[c]}}},labels:u,hasGeneralTemplate:g,template:t})}),g&&!v||t.push(E),t}),[]);return(0,o.useMemo)((()=>c.reduce(((e,t)=>{const{slug:n}=t;let l="postTypesMenuItems";return"page"===n&&(l="defaultPostTypesMenuItems"),e[l].push(t),e}),{defaultPostTypesMenuItems:[],postTypesMenuItems:[]})),[c])})(i),p=function(e){var t,n;const l=ro(),a=oo(),r=ho("root",mo,po);let o=null==a?void 0:a.find((e=>{let{slug:t}=e;return"author"===t}));o||(o={description:(0,h.__)("Displays latest posts written by a single author."),slug:"author",title:"Author"});const i=!(null==l||!l.find((e=>{let{slug:t}=e;return"author"===t})));if(null!==(t=r.user)&&void 0!==t&&t.hasEntities&&(o={...o,templatePrefix:"author"},o.onClick=t=>{e({type:"root",slug:"user",config:{queryArgs:e=>{let{search:t}=e;return{_fields:"id,name,slug,link",orderBy:t?"name":"registered_date",exclude:r.user.existingEntitiesIds,who:"authors"}},getSpecificTemplate:e=>{const t=`author-${e.slug}`;return{title:t,slug:t,templatePrefix:"author"}}},labels:{singular_name:(0,h.__)("Author"),search_items:(0,h.__)("Search Authors"),not_found:(0,h.__)("No authors found."),all_items:(0,h.__)("All Authors")},hasGeneralTemplate:i,template:t})}),!i||null!==(n=r.user)&&void 0!==n&&n.hasEntities)return o}(i);[...c,...d,p].forEach((e=>{if(!e)return;const t=s.findIndex((t=>t.slug===e.slug));t>-1?s[t]=e:s.push(e)})),null==s||s.sort(((e,t)=>xo.indexOf(e.slug)-xo.indexOf(t.slug)));return[...s,...co(),...m,...u]}(s,l);return v.length?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(_.DropdownMenu,{className:"edit-site-new-template-dropdown",icon:null,text:t.labels.add_new,label:t.labels.add_new_item,popoverProps:{noArrow:!1},toggleProps:{variant:"primary"}},(()=>(0,o.createElement)(_.NavigableMenu,{className:"edit-site-new-template-dropdown__popover"},(0,o.createElement)(_.MenuGroup,{label:t.labels.add_new_item},v.map((e=>{const{title:t,description:n,slug:l,onClick:a,icon:r}=e;return(0,o.createElement)(_.MenuItem,{icon:r||So[l]||Yr,iconPosition:"left",info:n,key:l,onClick:()=>a?a(e):E(e)},t)}))),(0,o.createElement)(_.MenuGroup,null,(0,o.createElement)(_.MenuItem,{icon:Un,iconPosition:"left",info:(0,h.__)("Custom templates can be applied to any post or page."),key:"custom-template",onClick:()=>r(!0)},(0,h.__)("Custom template")))))),n&&(0,o.createElement)(bo,{onClose:()=>l(!1),onSelect:E,entityForSuggestions:i}),a&&(0,o.createElement)(wo,{onClose:()=>r(!1),createTemplate:E})):null}function Co(e){let{postType:t}=e;const n=Pe(),[l,a]=(0,o.useState)(!1),{createErrorNotice:r}=(0,c.useDispatch)(Ze.store),{saveEntityRecord:i}=(0,c.useDispatch)(u.store);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(_.Button,{variant:"primary",onClick:()=>{a(!0)}},t.labels.add_new),l&&(0,o.createElement)(mr,{closeModal:()=>a(!1),onCreate:async function(e){let{title:t,area:l}=e;if(t)try{const e=(0,Et.kebabCase)(t).replace(/[^\w-]+/g,"")||"wp-custom-part",r=await i("postType","wp_template_part",{slug:e,title:t,content:"",area:l},{throwOnError:!0});a(!1),n.push({postId:r.id,postType:r.type})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,h.__)("An error occurred while creating the template part.");r(t,{type:"snackbar"}),a(!1)}else r((0,h.__)("Title is not defined."),{type:"snackbar"})}}))}function To(e){let{templateType:t="wp_template"}=e;const n=(0,c.useSelect)((e=>e(u.store).getPostType(t)),[t]);return n?"wp_template"===t?(0,o.createElement)(ko,{postType:n}):"wp_template_part"===t?(0,o.createElement)(Co,{postType:n}):null:null}function No(e){var t;let{templateType:n}=e;const{canCreate:l,postType:a}=(0,c.useSelect)((e=>{const{supportsTemplatePartsMode:t}=e(Ut).getSettings();return{postType:e(u.store).getPostType(n),canCreate:!t}}),[n]);return a?(0,o.createElement)("header",{className:"edit-site-list-header"},(0,o.createElement)(_.__experimentalHeading,{level:1,className:"edit-site-list-header__title"},null===(t=a.labels)||void 0===t?void 0:t.name),l&&(0,o.createElement)("div",{className:"edit-site-list-header__right"},(0,o.createElement)(To,{templateType:n}))):null}function Io(e){let{template:t,onClose:n}=e;const[l,a]=(0,o.useState)((()=>t.title.rendered)),[r,i]=(0,o.useState)(!1),{editEntityRecord:s,saveEditedEntityRecord:d}=(0,c.useDispatch)(u.store),{createSuccessNotice:m,createErrorNotice:p}=(0,c.useDispatch)(Ze.store);if(!t.is_custom)return null;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(_.MenuItem,{onClick:()=>{i(!0),a(t.title.rendered)}},(0,h.__)("Rename")),r&&(0,o.createElement)(_.Modal,{title:(0,h.__)("Rename"),closeLabel:(0,h.__)("Close"),onRequestClose:()=>{i(!1)},overlayClassName:"edit-site-list__rename-modal"},(0,o.createElement)("form",{onSubmit:async function(e){e.preventDefault();try{await s("postType",t.type,t.id,{title:l}),a(""),i(!1),n(),await d("postType",t.type,t.id,{throwOnError:!0}),m((0,h.__)("Entity renamed."),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,h.__)("An error occurred while renaming the entity.");p(t,{type:"snackbar"})}}},(0,o.createElement)(_.Flex,{align:"flex-start",gap:8},(0,o.createElement)(_.FlexItem,null,(0,o.createElement)(_.TextControl,{label:(0,h.__)("Name"),value:l,onChange:a,required:!0}))),(0,o.createElement)(_.Flex,{className:"edit-site-list__rename-modal-actions",justify:"flex-end",expanded:!1},(0,o.createElement)(_.FlexItem,null,(0,o.createElement)(_.Button,{variant:"tertiary",onClick:()=>{i(!1)}},(0,h.__)("Cancel"))),(0,o.createElement)(_.FlexItem,null,(0,o.createElement)(_.Button,{variant:"primary",type:"submit"},(0,h.__)("Save")))))))}function Mo(e){let{template:t}=e;const{removeTemplate:n,revertTemplate:l}=(0,c.useDispatch)(Ut),{saveEditedEntityRecord:a}=(0,c.useDispatch)(u.store),{createSuccessNotice:r,createErrorNotice:i}=(0,c.useDispatch)(Ze.store),s=function(e){return!!e&&"custom"===e.source&&!e.has_theme_file}(t),d=Je(t);if(!s&&!d)return null;return(0,o.createElement)(_.DropdownMenu,{icon:te,label:(0,h.__)("Actions"),className:"edit-site-list-table__actions"},(e=>{let{onClose:c}=e;return(0,o.createElement)(_.MenuGroup,null,s&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Io,{template:t,onClose:c}),(0,o.createElement)(_.MenuItem,{isDestructive:!0,isTertiary:!0,onClick:()=>{n(t),c()}},(0,h.__)("Delete"))),d&&(0,o.createElement)(_.MenuItem,{info:(0,h.__)("Use the template as supplied by the theme."),onClick:()=>{!async function(){try{await l(t,{allowUndo:!1}),await a("postType",t.type,t.id),r((0,h.__)("Entity reverted."),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,h.__)("An error occurred while reverting the entity.");i(t,{type:"snackbar"})}}(),c()}},(0,h.__)("Clear customizations")))}))}var Po=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M10.5 4v4h3V4H15v4h1.5a1 1 0 011 1v4l-3 4v2a1 1 0 01-1 1h-3a1 1 0 01-1-1v-2l-3-4V9a1 1 0 011-1H9V4h1.5zm.5 12.5v2h2v-2l3-4v-3H8v3l3 4z"}));var zo=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{fillRule:"evenodd",d:"M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",clipRule:"evenodd"}));var Vo=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M12 3.3c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8s-4-8.8-8.8-8.8zm6.5 5.5h-2.6C15.4 7.3 14.8 6 14 5c2 .6 3.6 2 4.5 3.8zm.7 3.2c0 .6-.1 1.2-.2 1.8h-2.9c.1-.6.1-1.2.1-1.8s-.1-1.2-.1-1.8H19c.2.6.2 1.2.2 1.8zM12 18.7c-1-.7-1.8-1.9-2.3-3.5h4.6c-.5 1.6-1.3 2.9-2.3 3.5zm-2.6-4.9c-.1-.6-.1-1.1-.1-1.8 0-.6.1-1.2.1-1.8h5.2c.1.6.1 1.1.1 1.8s-.1 1.2-.1 1.8H9.4zM4.8 12c0-.6.1-1.2.2-1.8h2.9c-.1.6-.1 1.2-.1 1.8 0 .6.1 1.2.1 1.8H5c-.2-.6-.2-1.2-.2-1.8zM12 5.3c1 .7 1.8 1.9 2.3 3.5H9.7c.5-1.6 1.3-2.9 2.3-3.5zM10 5c-.8 1-1.4 2.3-1.8 3.8H5.5C6.4 7 8 5.6 10 5zM5.5 15.3h2.6c.4 1.5 1 2.8 1.8 3.7-1.8-.6-3.5-2-4.4-3.7zM14 19c.8-1 1.4-2.2 1.8-3.7h2.6C17.6 17 16 18.4 14 19z"}));const Bo=["wp_template","wp_template_part"];function Ao(e){let{isCustomized:t,children:n}=e;return t?(0,o.createElement)(_.Tooltip,{text:(0,h.__)("This template has been customized")},n):n}function Ro(e){let{text:t,icon:n,imageUrl:l,isCustomized:a}=e;const[r,i]=(0,o.useState)(!1);return(0,o.createElement)(_.__experimentalHStack,{alignment:"left"},(0,o.createElement)(Ao,{isCustomized:a},l?(0,o.createElement)("div",{className:g()("edit-site-list-added-by__avatar",{"is-loaded":r})},(0,o.createElement)("img",{onLoad:()=>i(!0),alt:"",src:l})):(0,o.createElement)("div",{className:g()("edit-site-list-added-by__icon",{"is-customized":a})},(0,o.createElement)(_.Icon,{icon:n}))),(0,o.createElement)("span",null,t))}function Lo(e){var t;let{slug:n,isCustomized:l}=e;const a=(0,c.useSelect)((e=>e(u.store).getTheme(n)),[n]);return(0,o.createElement)(Ro,{icon:Un,text:(null==a||null===(t=a.name)||void 0===t?void 0:t.rendered)||n,isCustomized:l})}function Oo(e){let{slug:t,isCustomized:n}=e;const l=(0,c.useSelect)((e=>e(u.store).getPlugin(t)),[t]);return(0,o.createElement)(Ro,{icon:Po,text:(null==l?void 0:l.name)||t,isCustomized:n})}function Do(e){var t;let{id:n}=e;const l=(0,c.useSelect)((e=>e(u.store).getUser(n)),[n]);return(0,o.createElement)(Ro,{icon:zo,imageUrl:null==l||null===(t=l.avatar_urls)||void 0===t?void 0:t[48],text:null==l?void 0:l.nickname})}function Go(){const{name:e,logoURL:t}=(0,c.useSelect)((e=>{var t;const{getEntityRecord:n,getMedia:l}=e(u.store),a=n("root","__unstableBase");return{name:null==a?void 0:a.name,logoURL:null!=a&&a.site_logo?null===(t=l(a.site_logo))||void 0===t?void 0:t.source_url:void 0}}),[]);return(0,o.createElement)(Ro,{icon:Vo,imageUrl:t,text:e})}function Fo(e){let{templateType:t,template:n}=e;if(n){if(Bo.includes(t)){if(n.has_theme_file&&("theme"===n.origin||!n.origin&&["theme","custom"].includes(n.source)))return(0,o.createElement)(Lo,{slug:n.theme,isCustomized:"custom"===n.source});if(n.has_theme_file&&"plugin"===n.origin)return(0,o.createElement)(Oo,{slug:n.theme,isCustomized:"custom"===n.source});if(!n.has_theme_file&&"custom"===n.source&&!n.author)return(0,o.createElement)(Go,null)}return(0,o.createElement)(Do,{id:n.author})}}function Ho(e){let{templateType:t}=e;const{records:n,isResolving:l}=(0,u.useEntityRecords)("postType",t,{per_page:-1}),a=(0,c.useSelect)((e=>e(u.store).getPostType(t)),[t]);return!n||l?null:n.length?(0,o.createElement)("table",{className:"edit-site-list-table",role:"table"},(0,o.createElement)("thead",null,(0,o.createElement)("tr",{className:"edit-site-list-table-head",role:"row"},(0,o.createElement)("th",{className:"edit-site-list-table-column",role:"columnheader"},(0,h.__)("Template")),(0,o.createElement)("th",{className:"edit-site-list-table-column",role:"columnheader"},(0,h.__)("Added by")),(0,o.createElement)("th",{className:"edit-site-list-table-column",role:"columnheader"},(0,o.createElement)(_.VisuallyHidden,null,(0,h.__)("Actions"))))),(0,o.createElement)("tbody",null,n.map((e=>{var n;return(0,o.createElement)("tr",{key:e.id,className:"edit-site-list-table-row",role:"row"},(0,o.createElement)("td",{className:"edit-site-list-table-column",role:"cell"},(0,o.createElement)(_.__experimentalHeading,{level:4},(0,o.createElement)(Ae,{params:{postId:e.id,postType:e.type}},(0,ja.decodeEntities)((null===(n=e.title)||void 0===n?void 0:n.rendered)||e.slug))),e.description),(0,o.createElement)("td",{className:"edit-site-list-table-column",role:"cell"},(0,o.createElement)(Fo,{templateType:t,template:e})),(0,o.createElement)("td",{className:"edit-site-list-table-column",role:"cell"},(0,o.createElement)(Mo,{template:e})))})))):(0,o.createElement)("div",null,(0,h.sprintf)((0,h.__)("No %s found."),null==a||null===(r=a.labels)||void 0===r||null===(i=r.name)||void 0===i?void 0:i.toLowerCase()));var r,i}function $o(){var e,t;const{params:{postType:n}}=Me();!function(){const{registerShortcut:e}=(0,c.useDispatch)(jt.store);(0,o.useEffect)((()=>{e({name:"core/edit-site/next-region",category:"global",description:(0,h.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),e({name:"core/edit-site/previous-region",category:"global",description:(0,h.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"}]})}),[])}();const{previousShortcut:l,nextShortcut:a,isNavigationOpen:r}=(0,c.useSelect)((e=>({previousShortcut:e(jt.store).getAllShortcutKeyCombinations("core/edit-site/previous-region"),nextShortcut:e(jt.store).getAllShortcutKeyCombinations("core/edit-site/next-region"),isNavigationOpen:e(Ut).isNavigationOpened()})),[]),i=(0,c.useSelect)((e=>e(u.store).getPostType(n)),[n]);Ur(null==i||null===(e=i.labels)||void 0===e?void 0:e.name);const s=null==i||null===(t=i.labels)||void 0===t?void 0:t.items_list,m=i?{header:(0,h.sprintf)((0,h.__)("%s - Header"),s),body:(0,h.sprintf)((0,h.__)("%s - Content"),s)}:void 0;return(0,o.createElement)(ee,{className:g()("edit-site-list",{"is-navigation-open":r}),labels:{drawer:(0,h.__)("Navigation Sidebar"),...m},header:(0,o.createElement)(No,{templateType:n}),drawer:(0,o.createElement)(cr.Slot,null),notices:(0,o.createElement)(d.EditorSnackbars,null),content:(0,o.createElement)(Ho,{templateType:n}),shortcuts:{previous:l,next:a}})}function Uo(e){let{postId:t,postType:n}=e;return!(t||!n)}function jo(e){let{reboot:t}=e;const{createErrorNotice:n}=(0,c.useDispatch)(Ze.store);function l(e){n((0,h.sprintf)((0,h.__)('The "%s" plugin has encountered an error and cannot be rendered.'),e))}return(0,o.createElement)(_.SlotFillProvider,null,(0,o.createElement)(d.UnsavedChangesWarning,null),(0,o.createElement)(Ve,null,(e=>{let{params:n}=e;const a=Uo(n);return(0,o.createElement)(o.Fragment,null,a?(0,o.createElement)($o,null):(0,o.createElement)(Wr,{onError:t}),(0,o.createElement)(D.PluginArea,{onError:l}),(0,o.createElement)(cr,{isDefaultOpen:!!a,activeTemplateType:a?n.postType:void 0}))})))}function Wo(e){let{className:t,...n}=e;const l=(0,c.useSelect)((e=>e(Ut).getSettings().showIconLabels),[]);return(0,o.createElement)(Q,m({panelClassName:t,className:"edit-site-sidebar",scope:"core/edit-site",showIconLabels:l},n))}function Yo(e){return(0,o.createElement)(Y,m({__unstableExplicitMenuItem:!0,scope:"core/edit-site"},e))}var qo=(0,J.compose)((0,D.withPluginContext)(((e,t)=>{var n;return{as:null!==(n=t.as)&&void 0!==n?n:_.MenuItem,icon:t.icon||e.icon,name:"core/edit-site/plugin-more-menu"}})))(j);function Xo(e,t){if(!t.__unstableHomeTemplate)return void(0,o.render)((0,o.createElement)(Lr,{message:(0,h.__)("The editor is unable to find a block template for the homepage."),dashboardLink:"index.php"}),e);(0,me.addFilter)("blockEditor.__unstableCanInsertBlockType","removeClassicBlockFromInserter",((e,t)=>"core/freeform"!==t.name&&e)),(0,o.unmountComponentAtNode)(e);const n=Xo.bind(null,e,t);(0,c.dispatch)(k.store).setDefaults("core/edit-site",{editorMode:"visual",fixedToolbar:!1,focusMode:!1,keepCaretInsideBlock:!1,welcomeGuide:!0,welcomeGuideStyles:!0,showListViewByDefault:!1}),(0,c.select)(k.store).get("core/edit-site","showListViewByDefault")&&(0,c.dispatch)(Ut).setIsListViewOpened(!0),(0,c.dispatch)(O).setDefaultComplementaryArea("core/edit-site","edit-site/template"),(0,c.dispatch)(Ut).updateSettings(t),(0,c.dispatch)(d.store).updateEditorSettings({defaultTemplateTypes:t.defaultTemplateTypes,defaultTemplatePartAreas:t.defaultTemplatePartAreas});Uo((0,de.getQueryArgs)(window.location.href))&&(0,c.dispatch)(Ut).setIsNavigationPanelOpened((0,c.select)(b.store).isViewportMatch("medium"));window.addEventListener("dragover",(e=>e.preventDefault()),!1),window.addEventListener("drop",(e=>e.preventDefault()),!1),(0,o.render)((0,o.createElement)(jo,{reboot:n}),e)}function Ko(e,t){t.__experimentalFetchLinkSuggestions=(e,n)=>(0,u.__experimentalFetchLinkSuggestions)(e,n,t),t.__experimentalFetchRichUrlData=u.__experimentalFetchUrlData;const n=document.getElementById(e);(0,c.dispatch)(i.store).__experimentalReapplyBlockTypeFilters(),(0,s.registerCoreBlocks)(),Xo(n,t)}}(),(window.wp=window.wp||{}).editSite=l}();
\ No newline at end of file
+*/!function(){"use strict";var l={}.hasOwnProperty;function a(){for(var e=[],t=0;t2096103.424&&p!==m))return navigator.msSaveBlob?navigator.msSaveBlob(v(c),g):y(c);s=(c=v(c)).type||i}else if(/([\x80-\xff])/.test(c)){for(var h=0,f=new Uint8Array(c.length),E=f.length;h({type:"SET_DEFAULT_COMPLEMENTARY_AREA",scope:e,area:t}),T=(e,t)=>n=>{let{registry:l,dispatch:a}=n;if(!t)return;l.select(k.store).get(e,"isComplementaryAreaVisible")||l.dispatch(k.store).set(e,"isComplementaryAreaVisible",!0),a({type:"ENABLE_COMPLEMENTARY_AREA",scope:e,area:t})},N=e=>t=>{let{registry:n}=t;n.select(k.store).get(e,"isComplementaryAreaVisible")&&n.dispatch(k.store).set(e,"isComplementaryAreaVisible",!1)},I=(e,t)=>n=>{let{registry:l}=n;if(!t)return;const a=l.select(k.store).get(e,"pinnedItems");!0!==(null==a?void 0:a[t])&&l.dispatch(k.store).set(e,"pinnedItems",{...a,[t]:!0})},M=(e,t)=>n=>{let{registry:l}=n;if(!t)return;const a=l.select(k.store).get(e,"pinnedItems");l.dispatch(k.store).set(e,"pinnedItems",{...a,[t]:!1})};function P(e,t){return function(n){let{registry:l}=n;S()("dispatch( 'core/interface' ).toggleFeature",{since:"6.0",alternative:"dispatch( 'core/preferences' ).toggle"}),l.dispatch(k.store).toggle(e,t)}}function z(e,t,n){return function(l){let{registry:a}=l;S()("dispatch( 'core/interface' ).setFeatureValue",{since:"6.0",alternative:"dispatch( 'core/preferences' ).set"}),a.dispatch(k.store).set(e,t,!!n)}}function V(e,t){return function(n){let{registry:l}=n;S()("dispatch( 'core/interface' ).setFeatureDefaults",{since:"6.0",alternative:"dispatch( 'core/preferences' ).setDefaults"}),l.dispatch(k.store).setDefaults(e,t)}}const B=(0,c.createRegistrySelector)((e=>(t,n)=>{var l;const a=e(k.store).get(n,"isComplementaryAreaVisible");if(void 0!==a)return a?null==t||null===(l=t.complementaryAreas)||void 0===l?void 0:l[n]:null})),A=(0,c.createRegistrySelector)((e=>(t,n,l)=>{var a;const r=e(k.store).get(n,"pinnedItems");return null===(a=null==r?void 0:r[l])||void 0===a||a})),R=(0,c.createRegistrySelector)((e=>(t,n,l)=>(S()("select( 'core/interface' ).isFeatureActive( scope, featureName )",{since:"6.0",alternative:"select( 'core/preferences' ).get( scope, featureName )"}),!!e(k.store).get(n,l))));var L=(0,c.combineReducers)({complementaryAreas:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_DEFAULT_COMPLEMENTARY_AREA":{const{scope:n,area:l}=t;return e[n]?e:{...e,[n]:l}}case"ENABLE_COMPLEMENTARY_AREA":{const{scope:n,area:l}=t;return{...e,[n]:l}}}return e}});const O=(0,c.createReduxStore)("core/interface",{reducer:L,actions:e,selectors:t});(0,c.register)(O);var D=window.wp.plugins,G=(0,D.withPluginContext)(((e,t)=>({icon:t.icon||e.icon,identifier:t.identifier||`${e.name}/${t.name}`})));var F=G((function(e){let{as:t=_.Button,scope:n,identifier:l,icon:a,selectedIcon:r,name:i,...s}=e;const u=t,d=(0,c.useSelect)((e=>e(O).getActiveComplementaryArea(n)===l),[l]),{enableComplementaryArea:p,disableComplementaryArea:g}=(0,c.useDispatch)(O);return(0,o.createElement)(u,m({icon:r&&d?r:a,onClick:()=>{d?g(n):p(n,l)}},s))}));var H=e=>{let{smallScreenTitle:t,children:n,className:l,toggleButtonProps:a}=e;const r=(0,o.createElement)(F,m({icon:w},a));return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"components-panel__header interface-complementary-area-header__small"},t&&(0,o.createElement)("span",{className:"interface-complementary-area-header__small-title"},t),r),(0,o.createElement)("div",{className:g()("components-panel__header","interface-complementary-area-header",l),tabIndex:-1},n,r))};const $=()=>{};function U(e){let{name:t,as:n=_.Button,onClick:l,...a}=e;return(0,o.createElement)(_.Fill,{name:t},(e=>{let{onClick:t}=e;return(0,o.createElement)(n,m({onClick:l||t?function(){(l||$)(...arguments),(t||$)(...arguments)}:void 0},a))}))}U.Slot=function(e){let{name:t,as:n=_.ButtonGroup,fillProps:l={},bubblesVirtually:a,...r}=e;return(0,o.createElement)(_.Slot,{name:t,bubblesVirtually:a,fillProps:l},(e=>{if(!o.Children.toArray(e).length)return null;const t=[];o.Children.forEach(e,(e=>{let{props:{__unstableExplicitMenuItem:n,__unstableTarget:l}}=e;l&&n&&t.push(l)}));const l=o.Children.map(e,(e=>!e.props.__unstableExplicitMenuItem&&t.includes(e.props.__unstableTarget)?null:e));return(0,o.createElement)(n,r,l)}))};var j=U;const W=e=>{let{__unstableExplicitMenuItem:t,__unstableTarget:n,...l}=e;return(0,o.createElement)(_.MenuItem,l)};function Y(e){let{scope:t,target:n,__unstableExplicitMenuItem:l,...a}=e;return(0,o.createElement)(F,m({as:e=>(0,o.createElement)(j,m({__unstableExplicitMenuItem:l,__unstableTarget:`${t}/${n}`,as:W,name:`${t}/plugin-more-menu`},e)),role:"menuitemcheckbox",selectedIcon:E,name:n,scope:t},a))}function q(e){let{scope:t,...n}=e;return(0,o.createElement)(_.Fill,m({name:`PinnedItems/${t}`},n))}q.Slot=function(e){let{scope:t,className:n,...l}=e;return(0,o.createElement)(_.Slot,m({name:`PinnedItems/${t}`},l),(e=>(null==e?void 0:e.length)>0&&(0,o.createElement)("div",{className:g()(n,"interface-pinned-items")},e)))};var X=q;function K(e){let{scope:t,children:n,className:l}=e;return(0,o.createElement)(_.Fill,{name:`ComplementaryArea/${t}`},(0,o.createElement)("div",{className:l},n))}const Z=G((function(e){let{children:t,className:n,closeLabel:l=(0,h.__)("Close plugin"),identifier:a,header:r,headerClassName:i,icon:s,isPinnable:u=!0,panelClassName:d,scope:m,name:p,smallScreenTitle:f,title:w,toggleShortcut:x,isActiveByDefault:S,showIconLabels:k=!1}=e;const{isActive:C,isPinned:T,activeArea:N,isSmall:I,isLarge:M}=(0,c.useSelect)((e=>{const{getActiveComplementaryArea:t,isItemPinned:n}=e(O),l=t(m);return{isActive:l===a,isPinned:n(m,a),activeArea:l,isSmall:e(b.store).isViewportMatch("< medium"),isLarge:e(b.store).isViewportMatch("large")}}),[a,m]);!function(e,t,n,l,a){const r=(0,o.useRef)(!1),i=(0,o.useRef)(!1),{enableComplementaryArea:s,disableComplementaryArea:u}=(0,c.useDispatch)(O);(0,o.useEffect)((()=>{l&&a&&!r.current?(u(e),i.current=!0):i.current&&!a&&r.current?(i.current=!1,s(e,t)):i.current&&n&&n!==t&&(i.current=!1),a!==r.current&&(r.current=a)}),[l,a,e,t,n])}(m,a,N,C,I);const{enableComplementaryArea:P,disableComplementaryArea:z,pinItem:V,unpinItem:B}=(0,c.useDispatch)(O);return(0,o.useEffect)((()=>{S&&void 0===N&&!I&&P(m,a)}),[N,S,m,a,I]),(0,o.createElement)(o.Fragment,null,u&&(0,o.createElement)(X,{scope:m},T&&(0,o.createElement)(F,{scope:m,identifier:a,isPressed:C&&(!k||M),"aria-expanded":C,label:w,icon:k?E:s,showTooltip:!k,variant:k?"tertiary":void 0})),p&&u&&(0,o.createElement)(Y,{target:p,scope:m,icon:s},w),C&&(0,o.createElement)(K,{className:g()("interface-complementary-area",n),scope:m},(0,o.createElement)(H,{className:i,closeLabel:l,onClose:()=>z(m),smallScreenTitle:f,toggleButtonProps:{label:l,shortcut:x,scope:m,identifier:a}},r||(0,o.createElement)(o.Fragment,null,(0,o.createElement)("strong",null,w),u&&(0,o.createElement)(_.Button,{className:"interface-complementary-area__pin-unpin-item",icon:T?v:y,label:T?(0,h.__)("Unpin from toolbar"):(0,h.__)("Pin to toolbar"),onClick:()=>(T?B:V)(m,a),isPressed:T,"aria-expanded":T}))),(0,o.createElement)(_.Panel,{className:d},t)))}));Z.Slot=function(e){let{scope:t,...n}=e;return(0,o.createElement)(_.Slot,m({name:`ComplementaryArea/${t}`},n))};var Q=Z,J=window.wp.compose;var ee=(0,o.forwardRef)((function(e,t){let{footer:n,header:l,sidebar:a,secondarySidebar:r,notices:i,content:s,drawer:c,actions:u,labels:d,className:p,shortcuts:f}=e;const E=(0,_.__unstableUseNavigateRegions)(f);!function(e){(0,o.useEffect)((()=>{const t=document&&document.querySelector(`html:not(.${e})`);if(t)return t.classList.toggle(e),()=>{t.classList.toggle(e)}}),[e])}("interface-interface-skeleton__html-container");const v={...{drawer:(0,h.__)("Drawer"),header:(0,h.__)("Header"),body:(0,h.__)("Content"),secondarySidebar:(0,h.__)("Block Library"),sidebar:(0,h.__)("Settings"),actions:(0,h.__)("Publish"),footer:(0,h.__)("Footer")},...d};return(0,o.createElement)("div",m({},E,{ref:(0,J.useMergeRefs)([t,E.ref]),className:g()(p,"interface-interface-skeleton",E.className,!!n&&"has-footer")}),!!c&&(0,o.createElement)("div",{className:"interface-interface-skeleton__drawer",role:"region","aria-label":v.drawer,tabIndex:"-1"},c),(0,o.createElement)("div",{className:"interface-interface-skeleton__editor"},!!l&&(0,o.createElement)("div",{className:"interface-interface-skeleton__header",role:"region","aria-label":v.header,tabIndex:"-1"},l),(0,o.createElement)("div",{className:"interface-interface-skeleton__body"},!!r&&(0,o.createElement)("div",{className:"interface-interface-skeleton__secondary-sidebar",role:"region","aria-label":v.secondarySidebar,tabIndex:"-1"},r),!!i&&(0,o.createElement)("div",{className:"interface-interface-skeleton__notices"},i),(0,o.createElement)("div",{className:"interface-interface-skeleton__content",role:"region","aria-label":v.body,tabIndex:"-1"},s),!!a&&(0,o.createElement)("div",{className:"interface-interface-skeleton__sidebar",role:"region","aria-label":v.sidebar,tabIndex:"-1"},a),!!u&&(0,o.createElement)("div",{className:"interface-interface-skeleton__actions",role:"region","aria-label":v.actions,tabIndex:"-1"},u))),!!n&&(0,o.createElement)("div",{className:"interface-interface-skeleton__footer",role:"region","aria-label":v.footer,tabIndex:"-1"},n))}));var te=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));function ne(e){let{as:t=_.DropdownMenu,className:n,label:l=(0,h.__)("Options"),popoverProps:a,toggleProps:r,children:i}=e;return(0,o.createElement)(t,{className:g()("interface-more-menu-dropdown",n),icon:te,label:l,popoverProps:{position:"bottom left",...a,className:g()("interface-more-menu-dropdown__content",null==a?void 0:a.className)},toggleProps:{tooltipPosition:"bottom",...r}},(e=>i(e)))}function le(e){let{closeModal:t,children:n}=e;return(0,o.createElement)(_.Modal,{className:"interface-preferences-modal",title:(0,h.__)("Preferences"),closeLabel:(0,h.__)("Close"),onRequestClose:t},n)}var ae=function(e){let{icon:t,size:n=24,...l}=e;return(0,o.cloneElement)(t,{width:n,height:n,...l})};var re=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));var oe=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));const ie="preferences-menu";function se(e){let{sections:t}=e;const n=(0,J.useViewportMatch)("medium"),[l,a]=(0,o.useState)(ie),{tabs:r,sectionsContentMap:i}=(0,o.useMemo)((()=>{let e={tabs:[],sectionsContentMap:{}};return t.length&&(e=t.reduce(((e,t)=>{let{name:n,tabLabel:l,content:a}=t;return e.tabs.push({name:n,title:l}),e.sectionsContentMap[n]=a,e}),{tabs:[],sectionsContentMap:{}})),e}),[t]),s=(0,o.useCallback)((e=>i[e.name]||null),[i]);let c;return c=n?(0,o.createElement)(_.TabPanel,{className:"interface-preferences__tabs",tabs:r,initialTabName:l!==ie?l:void 0,onSelect:a,orientation:"vertical"},s):(0,o.createElement)(_.__experimentalNavigatorProvider,{initialPath:"/",className:"interface-preferences__provider"},(0,o.createElement)(_.__experimentalNavigatorScreen,{path:"/"},(0,o.createElement)(_.Card,{isBorderless:!0,size:"small"},(0,o.createElement)(_.CardBody,null,(0,o.createElement)(_.__experimentalItemGroup,null,r.map((e=>(0,o.createElement)(_.__experimentalNavigatorButton,{key:e.name,path:e.name,as:_.__experimentalItem,isAction:!0},(0,o.createElement)(_.__experimentalHStack,{justify:"space-between"},(0,o.createElement)(_.FlexItem,null,(0,o.createElement)(_.__experimentalTruncate,null,e.title)),(0,o.createElement)(_.FlexItem,null,(0,o.createElement)(ae,{icon:(0,h.isRTL)()?re:oe})))))))))),t.length&&t.map((e=>(0,o.createElement)(_.__experimentalNavigatorScreen,{key:`${e.name}-menu`,path:e.name},(0,o.createElement)(_.Card,{isBorderless:!0,size:"large"},(0,o.createElement)(_.CardHeader,{isBorderless:!1,justify:"left",size:"small",gap:"6"},(0,o.createElement)(_.__experimentalNavigatorBackButton,{icon:(0,h.isRTL)()?oe:re,"aria-label":(0,h.__)("Navigate to the previous view")}),(0,o.createElement)(_.__experimentalText,{size:"16"},e.tabLabel)),(0,o.createElement)(_.CardBody,null,e.content)))))),c}var ce=e=>{let{description:t,title:n,children:l}=e;return(0,o.createElement)("fieldset",{className:"interface-preferences-modal__section"},(0,o.createElement)("legend",{className:"interface-preferences-modal__section-legend"},(0,o.createElement)("h2",{className:"interface-preferences-modal__section-title"},n),t&&(0,o.createElement)("p",{className:"interface-preferences-modal__section-description"},t)),l)};var ue=function(e){let{help:t,label:n,isChecked:l,onChange:a,children:r}=e;return(0,o.createElement)("div",{className:"interface-preferences-modal__option"},(0,o.createElement)(_.ToggleControl,{__nextHasNoMarginBottom:!0,help:t,label:n,checked:l,onChange:a}),r)},de=window.wp.url,me=window.wp.hooks,pe=window.wp.mediaUtils;(0,me.addFilter)("editor.MediaUpload","core/edit-site/components/media-upload",(()=>pe.MediaUpload));var ge,_e=window.wp.blockEditor;!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(ge||(ge={}));var he=function(e){return e};var fe="beforeunload",Ee="popstate";function ve(e){e.preventDefault(),e.returnValue=""}function ye(){var e=[];return{get length(){return e.length},push:function(t){return e.push(t),function(){e=e.filter((function(e){return e!==t}))}},call:function(t){e.forEach((function(e){return e&&e(t)}))}}}function be(){return Math.random().toString(36).substr(2,8)}function we(e){var t=e.pathname,n=void 0===t?"/":t,l=e.search,a=void 0===l?"":l,r=e.hash,o=void 0===r?"":r;return a&&"?"!==a&&(n+="?"===a.charAt(0)?a:"?"+a),o&&"#"!==o&&(n+="#"===o.charAt(0)?o:"#"+o),n}function xe(e){var t={};if(e){var n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));var l=e.indexOf("?");l>=0&&(t.search=e.substr(l),e=e.substr(0,l)),e&&(t.pathname=e)}return t}const Se=function(e){void 0===e&&(e={});var t=e.window,n=void 0===t?document.defaultView:t,l=n.history;function a(){var e=n.location,t=e.pathname,a=e.search,r=e.hash,o=l.state||{};return[o.idx,he({pathname:t,search:a,hash:r,state:o.usr||null,key:o.key||"default"})]}var r=null;n.addEventListener(Ee,(function(){if(r)d.call(r),r=null;else{var e=ge.Pop,t=a(),n=t[0],l=t[1];if(d.length){if(null!=n){var o=s-n;o&&(r={action:e,location:l,retry:function(){E(-1*o)}},E(o))}}else f(e)}}));var o=ge.Pop,i=a(),s=i[0],c=i[1],u=ye(),d=ye();function p(e){return"string"==typeof e?e:we(e)}function g(e,t){return void 0===t&&(t=null),he(m({pathname:c.pathname,hash:"",search:""},"string"==typeof e?xe(e):e,{state:t,key:be()}))}function _(e,t){return[{usr:e.state,key:e.key,idx:t},p(e)]}function h(e,t,n){return!d.length||(d.call({action:e,location:t,retry:n}),!1)}function f(e){o=e;var t=a();s=t[0],c=t[1],u.call({action:o,location:c})}function E(e){l.go(e)}null==s&&(s=0,l.replaceState(m({},l.state,{idx:s}),""));var v={get action(){return o},get location(){return c},createHref:p,push:function e(t,a){var r=ge.Push,o=g(t,a);if(h(r,o,(function(){e(t,a)}))){var i=_(o,s+1),c=i[0],u=i[1];try{l.pushState(c,"",u)}catch(e){n.location.assign(u)}f(r)}},replace:function e(t,n){var a=ge.Replace,r=g(t,n);if(h(a,r,(function(){e(t,n)}))){var o=_(r,s),i=o[0],c=o[1];l.replaceState(i,"",c),f(a)}},go:E,back:function(){E(-1)},forward:function(){E(1)},listen:function(e){return u.push(e)},block:function(e){var t=d.push(e);return 1===d.length&&n.addEventListener(fe,ve),function(){t(),d.length||n.removeEventListener(fe,ve)}}};return v}(),ke=Se.push,Ce=Se.replace;Se.push=function(e,t){return ke.call(Se,(0,de.addQueryArgs)(window.location.href,e),t)},Se.replace=function(e,t){return Ce.call(Se,(0,de.addQueryArgs)(window.location.href,e),t)};var Te=Se;const Ne=(0,o.createContext)(),Ie=(0,o.createContext)();function Me(){return(0,o.useContext)(Ne)}function Pe(){return(0,o.useContext)(Ie)}function ze(e){const t=new URLSearchParams(e.search);return{...e,params:Object.fromEntries(t.entries())}}function Ve(e){let{children:t}=e;const[n,l]=(0,o.useState)((()=>ze(Te.location)));return(0,o.useEffect)((()=>Te.listen((e=>{let{location:t}=e;l(ze(t))}))),[]),(0,o.createElement)(Ie.Provider,{value:Te},(0,o.createElement)(Ne.Provider,{value:n},t(n)))}function Be(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const l=Pe();function a(a){a.preventDefault(),n?l.replace(e,t):l.push(e,t)}return{href:(0,de.addQueryArgs)(window.location.href,e),onClick:a}}function Ae(e){let{params:t={},state:n,replace:l=!1,children:a,...r}=e;const{href:i,onClick:s}=Be(t,n,l);return(0,o.createElement)("a",m({href:i,onClick:s},r),a)}function Re(e){let{attributes:t}=e;const{theme:n,slug:l}=t,{params:a}=Me(),r=(0,c.useSelect)((e=>e(u.store).getEntityRecord("postType","wp_template_part",`${n}//${l}`)),[n,l]),i=Be({postId:null==r?void 0:r.id,postType:null==r?void 0:r.type},{fromTemplateId:a.postId});return r?(0,o.createElement)(_e.BlockControls,{group:"other"},(0,o.createElement)(_.ToolbarButton,m({},i,{onClick:e=>{i.onClick(e)}}),(0,h.__)("Edit"))):null}const Le=(0,J.createHigherOrderComponent)((e=>t=>{const{attributes:n,name:l}=t,a="core/template-part"===l&&n.slug;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(e,t),a&&(0,o.createElement)(Re,{attributes:n}))}),"withEditBlockControls");(0,me.addFilter)("editor.BlockEdit","core/edit-site/template-part-edit-button",Le);const Oe="core/edit-site",De="uncategorized",Ge=["index","singular","archive","single","page","home","404","search","author","category","taxonomy","date","tag","attachment","single","front-page"],Fe=["page-home"],He=["post-","author-","single-","tag-"],$e=["page-"],Ue={singular:["single","page"],index:["archive","404","search","singular","home"],home:["front-page"]},je="root",We="templates-general",Ye=[{area:"header",menu:"template-parts-headers",title:(0,h.__)("headers")},{area:"footer",menu:"template-parts-footers",title:(0,h.__)("footers")},{area:"sidebar",menu:"template-parts-sidebars",title:(0,h.__)("sidebars")},{area:De,menu:"template-parts-general",title:(0,h.__)("general")}];var qe=(0,c.combineReducers)({deviceType:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Desktop",t=arguments.length>1?arguments[1]:void 0;return"SET_PREVIEW_DEVICE_TYPE"===t.type?t.deviceType:e},settings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"UPDATE_SETTINGS"===t.type?{...e,...t.settings}:e},editedPost:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_TEMPLATE":case"SET_PAGE":return{type:"wp_template",id:t.templateId,page:t.page};case"SET_TEMPLATE_PART":return{type:"wp_template_part",id:t.templatePartId}}return e},homeTemplateId:function(e,t){return"SET_HOME_TEMPLATE"===t.type?t.homeTemplateId:e},navigationPanel:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{menu:je,isOpen:!1},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_NAVIGATION_PANEL_ACTIVE_MENU":return{...e,menu:t.menu};case"OPEN_NAVIGATION_PANEL_TO_MENU":return{...e,isOpen:!0,menu:t.menu};case"SET_IS_NAVIGATION_PANEL_OPENED":return{...e,menu:t.isOpen?e.menu:je,isOpen:t.isOpen};case"SET_IS_LIST_VIEW_OPENED":return{...e,menu:e.isOpen&&t.isOpen?je:e.menu,isOpen:!t.isOpen&&e.isOpen};case"SET_IS_INSERTER_OPENED":return{...e,menu:e.isOpen&&t.value?je:e.menu,isOpen:!t.value&&e.isOpen}}return e},blockInserterPanel:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"OPEN_NAVIGATION_PANEL_TO_MENU":return!1;case"SET_IS_NAVIGATION_PANEL_OPENED":case"SET_IS_LIST_VIEW_OPENED":return!t.isOpen&&e;case"SET_IS_INSERTER_OPENED":return t.value}return e},listViewPanel:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"OPEN_NAVIGATION_PANEL_TO_MENU":return!1;case"SET_IS_NAVIGATION_PANEL_OPENED":return!t.isOpen&&e;case"SET_IS_INSERTER_OPENED":return!t.value&&e;case"SET_IS_LIST_VIEW_OPENED":return t.isOpen}return e}}),Xe=window.wp.apiFetch,Ke=n.n(Xe),Ze=window.wp.notices,Qe=window.wp.a11y;function Je(e){return!!e&&("custom"===(null==e?void 0:e.source)&&(null==e?void 0:e.has_theme_file))}function et(e){return function(t){let{registry:n}=t;S()("select( 'core/edit-site' ).toggleFeature( featureName )",{since:"6.0",alternative:"select( 'core/preferences').toggle( 'core/edit-site', featureName )"}),n.dispatch(k.store).toggle("core/edit-site",e)}}function tt(e){return{type:"SET_PREVIEW_DEVICE_TYPE",deviceType:e}}const nt=(e,t)=>async n=>{let{dispatch:l,registry:a}=n;if(!t){const n=await a.resolveSelect(u.store).getEntityRecord("postType","wp_template",e);t=null==n?void 0:n.slug}l({type:"SET_TEMPLATE",templateId:e,page:{context:{templateSlug:t}}})},lt=e=>async t=>{let{dispatch:n,registry:l}=t;const a=await l.dispatch(u.store).saveEntityRecord("postType","wp_template",e);e.content&&l.dispatch(u.store).editEntityRecord("postType","wp_template",a.id,{blocks:(0,i.parse)(e.content)},{undoIgnore:!0}),n({type:"SET_TEMPLATE",templateId:a.id,page:{context:{templateSlug:a.slug}}})},at=e=>async t=>{let{registry:n}=t;try{await n.dispatch(u.store).deleteEntityRecord("postType",e.type,e.id,{force:!0});const t=n.select(u.store).getLastEntityDeleteError("postType",e.type,e.id);if(t)throw t;n.dispatch(Ze.store).createSuccessNotice((0,h.sprintf)((0,h.__)('"%s" deleted.'),e.title.rendered),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,h.__)("An error occurred while deleting the template.");n.dispatch(Ze.store).createErrorNotice(t,{type:"snackbar"})}};function rt(e){return{type:"SET_TEMPLATE_PART",templatePartId:e}}function ot(e){return{type:"SET_HOME_TEMPLATE",homeTemplateId:e}}const it=e=>async t=>{var n;let{dispatch:l,registry:a}=t;if(!e.path&&null!==(n=e.context)&&void 0!==n&&n.postId){const t=await a.resolveSelect(u.store).getEntityRecord("postType",e.context.postType||"post",e.context.postId);e.path=(0,de.getPathAndQueryString)(null==t?void 0:t.link)}const r=await a.resolveSelect(u.store).__experimentalGetTemplateForLink(e.path);if(r)return l({type:"SET_PAGE",page:r.slug?{...e,context:{...e.context,templateSlug:r.slug}}:e,templateId:r.id}),r.id};function st(e){return{type:"SET_NAVIGATION_PANEL_ACTIVE_MENU",menu:e}}function ct(e){return{type:"OPEN_NAVIGATION_PANEL_TO_MENU",menu:e}}function ut(e){return{type:"SET_IS_NAVIGATION_PANEL_OPENED",isOpen:e}}function dt(e){return{type:"SET_IS_INSERTER_OPENED",value:e}}function mt(e){return{type:"UPDATE_SETTINGS",settings:e}}function pt(e){return{type:"SET_IS_LIST_VIEW_OPENED",isOpen:e}}const gt=function(e){let{allowUndo:t=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return async n=>{let{registry:l}=n;if(Je(e))try{var a;const n=l.select(u.store).getEntityConfig("postType",e.type);if(!n)return void l.dispatch(Ze.store).createErrorNotice((0,h.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const r=(0,de.addQueryArgs)(`${n.baseURL}/${e.id}`,{context:"edit",source:"theme"}),o=await Ke()({path:r});if(!o)return void l.dispatch(Ze.store).createErrorNotice((0,h.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const s=e=>{let{blocks:t=[]}=e;return(0,i.__unstableSerializeAndClean)(t)},c=l.select(u.store).getEditedEntityRecord("postType",e.type,e.id);l.dispatch(u.store).editEntityRecord("postType",e.type,e.id,{content:s,blocks:c.blocks,source:"custom"},{undoIgnore:!0});const d=(0,i.parse)(null==o||null===(a=o.content)||void 0===a?void 0:a.raw);if(l.dispatch(u.store).editEntityRecord("postType",e.type,o.id,{content:s,blocks:d,source:"theme"}),t){const t=()=>{l.dispatch(u.store).editEntityRecord("postType",e.type,c.id,{content:s,blocks:c.blocks,source:"custom"})};l.dispatch(Ze.store).createSuccessNotice((0,h.__)("Template reverted."),{type:"snackbar",actions:[{label:(0,h.__)("Undo"),onClick:t}]})}else l.dispatch(Ze.store).createSuccessNotice((0,h.__)("Template reverted."))}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,h.__)("Template revert failed. Please reload.");l.dispatch(Ze.store).createErrorNotice(t,{type:"snackbar"})}else l.dispatch(Ze.store).createErrorNotice((0,h.__)("This template is not revertable."),{type:"snackbar"})}},_t=e=>t=>{let{registry:n}=t;n.dispatch(O).enableComplementaryArea(Oe,e)},ht=()=>e=>{let{registry:t}=e;t.dispatch(O).disableComplementaryArea(Oe)},ft=e=>t=>{let{registry:n}=t;n.dispatch("core/preferences").set("core/edit-site","editorMode",e),"visual"!==e&&n.dispatch(_e.store).clearSelectedBlock(),"visual"===e?(0,Qe.speak)((0,h.__)("Visual editor selected"),"assertive"):"mosaic"===e&&(0,Qe.speak)((0,h.__)("Mosaic view selected"),"assertive")};var Et=window.lodash,vt={};function yt(e){return[e]}function bt(e,t,n){var l;if(e.length!==t.length)return!1;for(l=n;lt.includes(e)||wt(e,t,n))))}function xt(e){if(Ge.includes(e))return"templates";if(Fe.includes(e))return We;if(He.some((t=>e.startsWith(t))))return"templates-posts";return $e.some((t=>e.startsWith(t)))?"templates-pages":We}const St=(0,c.createRegistrySelector)((e=>(t,n)=>e(k.store).get("core/edit-site",n)));function kt(e,t){return S()("select( 'core/interface' ).isFeatureActive",{since:"6.0",alternative:"select( 'core/preferences' ).get"}),!!St(e,t)}function Ct(e){return e.deviceType}const Tt=(0,c.createRegistrySelector)((e=>()=>e(u.store).canUser("create","media"))),Nt=(0,c.createRegistrySelector)((e=>()=>"web"===o.Platform.OS?e(u.store).getEntityRecords("postType","wp_block",{per_page:-1}):[])),It=function(e,t){var n,l=t||yt;function a(e){var t,l,a,r,o,i=n,s=!0;for(t=0;t{const n={...e.settings,outlineMode:!0,focusMode:!!St(e,"focusMode"),hasFixedToolbar:!!St(e,"fixedToolbar"),keepCaretInsideBlock:!!St(e,"keepCaretInsideBlock"),showIconLabels:!!St(e,"showIconLabels"),__experimentalSetIsInserterOpened:t,__experimentalReusableBlocks:Nt(e),__experimentalPreferPatternsOnRoot:"wp_template"===zt(e)};return Tt(e)?(n.mediaUpload=t=>{let{onError:n,...l}=t;(0,pe.uploadMedia)({wpAllowedMimeTypes:e.settings.allowedMimeTypes,onError:e=>{let{message:t}=e;return n(t)},...l})},n):n}),(e=>[Tt(e),e.settings,St(e,"focusMode"),St(e,"fixedToolbar"),St(e,"keepCaretInsideBlock"),St(e,"showIconLabels"),Nt(e),zt(e)]));function Mt(e){return e.homeTemplateId}function Pt(e){return e.editedPost}function zt(e){return Pt(e).type}function Vt(e){return Pt(e).id}function Bt(e){return Pt(e).page}function At(e){return e.navigationPanel.menu}const Rt=(0,c.createRegistrySelector)((e=>t=>{const n=zt(t),l=Vt(t),a=l?e(u.store).getEntityRecord("postType",n,l):null;if(!a)return je;var r;if("wp_template_part"===n)return(null===(r=Ye.find((e=>e.area===(null==a?void 0:a.area))))||void 0===r?void 0:r.menu)||"template-parts";const o=e(u.store).getEntityRecords("postType","wp_template"),i=e(u.store).getEditedEntityRecord("root","site").show_on_front;return wt(a.slug,(0,Et.map)(o,"slug"),i)?"templates-unused":xt(a.slug)}));function Lt(e){return e.navigationPanel.isOpen}function Ot(e){return!!e.blockInserterPanel}function Dt(e){const{rootClientId:t,insertionIndex:n,filterValue:l}=e.blockInserterPanel;return{rootClientId:t,insertionIndex:n,filterValue:l}}function Gt(e){return e.listViewPanel}const Ft=(0,c.createRegistrySelector)((e=>t=>{var n;const l=zt(t),a=Vt(t),r=e(u.store).getEditedEntityRecord("postType",l,a),o=e(u.store).getEntityRecords("postType","wp_template_part",{per_page:-1}),s=o?o.reduce(((e,t)=>({...e,[t.id]:t})),{}):{};return(null!==(n=r.blocks)&&void 0!==n?n:[]).filter((e=>(0,i.isTemplatePart)(e))).map((e=>{const{attributes:{theme:t,slug:n}}=e;return{templatePart:s[`${t}//${n}`],block:e}})).filter((e=>{let{templatePart:t}=e;return!!t}))}));function Ht(e){return St(e,"editorMode")}const $t={reducer:qe,actions:a,selectors:r},Ut=(0,c.createReduxStore)(Oe,$t);(0,c.register)(Ut);var jt=window.wp.keyboardShortcuts;var Wt=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));var Yt=(0,o.createElement)(f.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(f.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));var qt=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"m12 20-4.5-3.6-.9 1.2L12 22l5.5-4.4-.9-1.2L12 20zm0-16 4.5 3.6.9-1.2L12 2 6.5 6.4l.9 1.2L12 4z"}));var Xt=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"})),Kt=window.wp.keycodes;const Zt=[{keyCombination:{modifier:"primary",character:"b"},description:(0,h.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,h.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,h.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,h.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,h.__)("Insert a link to a post or page")},{keyCombination:{modifier:"primary",character:"u"},description:(0,h.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,h.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,h.__)("Make the selected text inline code.")}];function Qt(e){let{keyCombination:t,forceAriaLabel:n}=e;const l=t.modifier?Kt.displayShortcutList[t.modifier](t.character):t.character,a=t.modifier?Kt.shortcutAriaLabel[t.modifier](t.character):t.character;return(0,o.createElement)("kbd",{className:"edit-site-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":n||a},(0,Et.castArray)(l).map(((e,t)=>"+"===e?(0,o.createElement)(o.Fragment,{key:t},e):(0,o.createElement)("kbd",{key:t,className:"edit-site-keyboard-shortcut-help-modal__shortcut-key"},e))))}function Jt(e){let{description:t,keyCombination:n,aliases:l=[],ariaLabel:a}=e;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"edit-site-keyboard-shortcut-help-modal__shortcut-description"},t),(0,o.createElement)("div",{className:"edit-site-keyboard-shortcut-help-modal__shortcut-term"},(0,o.createElement)(Qt,{keyCombination:n,forceAriaLabel:a}),l.map(((e,t)=>(0,o.createElement)(Qt,{keyCombination:e,forceAriaLabel:a,key:t})))))}function en(e){let{name:t}=e;const{keyCombination:n,description:l,aliases:a}=(0,c.useSelect)((e=>{const{getShortcutKeyCombination:n,getShortcutDescription:l,getShortcutAliases:a}=e(jt.store);return{keyCombination:n(t),aliases:a(t),description:l(t)}}),[t]);return n?(0,o.createElement)(Jt,{keyCombination:n,description:l,aliases:a}):null}const tn=e=>{let{shortcuts:t}=e;return(0,o.createElement)("ul",{className:"edit-site-keyboard-shortcut-help-modal__shortcut-list",role:"list"},t.map(((e,t)=>(0,o.createElement)("li",{className:"edit-site-keyboard-shortcut-help-modal__shortcut",key:t},"string"==typeof e?(0,o.createElement)(en,{name:e}):(0,o.createElement)(Jt,e)))))},nn=e=>{let{title:t,shortcuts:n,className:l}=e;return(0,o.createElement)("section",{className:g()("edit-site-keyboard-shortcut-help-modal__section",l)},!!t&&(0,o.createElement)("h2",{className:"edit-site-keyboard-shortcut-help-modal__section-title"},t),(0,o.createElement)(tn,{shortcuts:n}))},ln=e=>{let{title:t,categoryName:n,additionalShortcuts:l=[]}=e;const a=(0,c.useSelect)((e=>e(jt.store).getCategoryShortcuts(n)),[n]);return(0,o.createElement)(nn,{title:t,shortcuts:a.concat(l)})};function an(e){let{isModalActive:t,toggleModal:n}=e;return t?(0,o.createElement)(_.Modal,{className:"edit-site-keyboard-shortcut-help-modal",title:(0,h.__)("Keyboard shortcuts"),closeLabel:(0,h.__)("Close"),onRequestClose:n},(0,o.createElement)(nn,{className:"edit-site-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/edit-site/keyboard-shortcuts"]}),(0,o.createElement)(ln,{title:(0,h.__)("Global shortcuts"),categoryName:"global"}),(0,o.createElement)(ln,{title:(0,h.__)("Selection shortcuts"),categoryName:"selection"}),(0,o.createElement)(ln,{title:(0,h.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,h.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,h.__)("Forward-slash")}]}),(0,o.createElement)(nn,{title:(0,h.__)("Text formatting"),shortcuts:Zt})):null}function rn(e){const{featureName:t,...n}=e,l=(0,c.useSelect)((e=>!!e(k.store).get("core/edit-site",t)),[t]),{toggle:a}=(0,c.useDispatch)(k.store);return(0,o.createElement)(ue,m({onChange:()=>a("core/edit-site",t),isChecked:l},n))}function on(e){let{isModalActive:t,toggleModal:n}=e;const l=(0,o.useMemo)((()=>[{name:"general",tabLabel:(0,h.__)("General"),content:(0,o.createElement)(ce,{title:(0,h.__)("Appearance"),description:(0,h.__)("Customize options related to the block editor interface and editing flow.")},(0,o.createElement)(rn,{featureName:"focusMode",help:(0,h.__)("Highlights the current block and fades other content."),label:(0,h.__)("Spotlight mode")}),(0,o.createElement)(rn,{featureName:"showIconLabels",label:(0,h.__)("Show button text labels"),help:(0,h.__)("Show text instead of icons on buttons.")}),(0,o.createElement)(rn,{featureName:"showListViewByDefault",help:(0,h.__)("Opens the block list view sidebar by default."),label:(0,h.__)("Always open list view")}))},{name:"blocks",tabLabel:(0,h.__)("Blocks"),content:(0,o.createElement)(ce,{title:(0,h.__)("Block interactions"),description:(0,h.__)("Customize how you interact with blocks in the block library and editing canvas.")},(0,o.createElement)(rn,{featureName:"keepCaretInsideBlock",help:(0,h.__)("Aids screen readers by stopping text caret from leaving blocks."),label:(0,h.__)("Contain text cursor inside block")}))}]));return t?(0,o.createElement)(le,{closeModal:n},(0,o.createElement)(se,{sections:l})):null}const{Fill:sn,Slot:cn}=(0,_.createSlotFill)("EditSiteToolsMoreMenuGroup");sn.Slot=e=>{let{fillProps:t}=e;return(0,o.createElement)(cn,{fillProps:t},(e=>!(0,Et.isEmpty)(e)&&e))};var un=sn,dn=n(8981),mn=n.n(dn);var pn=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z"}));function gn(){const{createErrorNotice:e}=(0,c.useDispatch)(Ze.store);return(0,o.createElement)(_.MenuItem,{role:"menuitem",icon:pn,onClick:async function(){try{const e=await Ke()({path:"/wp-block-editor/v1/export",parse:!1,headers:{Accept:"application/zip"}}),t=await e.blob(),n=e.headers.get("content-disposition").match(/=(.+)\.zip/),l=n[1]?n[1]:"edit-site-export";mn()(t,l+".zip","application/zip")}catch(t){let n={};try{n=await t.json()}catch(e){}const l=n.message&&"unknown_error"!==n.code?n.message:(0,h.__)("An error occurred while creating the site export.");e(l,{type:"snackbar"})}},info:(0,h.__)("Download your theme with updated templates and styles.")},(0,h._x)("Export","site exporter menu item"))}function _n(){const{toggle:e}=(0,c.useDispatch)(k.store);return(0,o.createElement)(_.MenuItem,{onClick:()=>e("core/edit-site","welcomeGuide")},(0,h.__)("Welcome Guide"))}function hn(){const{createNotice:e}=(0,c.useDispatch)(Ze.store),t=(0,c.useSelect)((e=>()=>{const{getEditedPostId:t,getEditedPostType:n}=e(Ut),{getEditedEntityRecord:l}=e(u.store),a=l("postType",n(),t());if(a){if("function"==typeof a.content)return a.content(a);if(a.blocks)return(0,i.__unstableSerializeAndClean)(a.blocks);if(a.content)return a.content}return""}),[]);const n=(0,J.useCopyToClipboard)(t,(function(){e("info",(0,h.__)("All content copied."),{isDismissible:!0,type:"snackbar"})}));return(0,o.createElement)(_.MenuItem,{ref:n},(0,h.__)("Copy all blocks"))}const fn=[{value:"visual",label:(0,h.__)("Visual editor")},{value:"text",label:(0,h.__)("Code editor")}];var En=function(){const{shortcut:e,mode:t}=(0,c.useSelect)((e=>({shortcut:e(jt.store).getShortcutRepresentation("core/edit-site/toggle-mode"),isRichEditingEnabled:e(Ut).getSettings().richEditingEnabled,isCodeEditingEnabled:e(Ut).getSettings().codeEditingEnabled,mode:e(Ut).getEditorMode()})),[]),{switchEditorMode:n}=(0,c.useDispatch)(Ut),l=fn.map((n=>n.value!==t?{...n,shortcut:e}:n));return(0,o.createElement)(_.MenuGroup,{label:(0,h.__)("Editor")},(0,o.createElement)(_.MenuItemsChoice,{choices:l,value:t,onSelect:n}))};function vn(e){let{showIconLabels:t}=e;const[n,l]=(0,o.useReducer)((e=>!e),!1),[a,r]=(0,o.useReducer)((e=>!e),!1);return(0,jt.useShortcut)("core/edit-site/keyboard-shortcuts",l),(0,o.createElement)(o.Fragment,null,(0,o.createElement)(ne,{toggleProps:{showTooltip:!t,...t&&{variant:"tertiary"}}},(e=>{let{onClose:t}=e;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(_.MenuGroup,{label:(0,h._x)("View","noun")},(0,o.createElement)(k.PreferenceToggleMenuItem,{scope:"core/edit-site",name:"fixedToolbar",label:(0,h.__)("Top toolbar"),info:(0,h.__)("Access all block and document tools in a single place"),messageActivated:(0,h.__)("Top toolbar activated"),messageDeactivated:(0,h.__)("Top toolbar deactivated")}),(0,o.createElement)(k.PreferenceToggleMenuItem,{scope:"core/edit-site",name:"focusMode",label:(0,h.__)("Spotlight mode"),info:(0,h.__)("Focus on one block at a time"),messageActivated:(0,h.__)("Spotlight mode activated"),messageDeactivated:(0,h.__)("Spotlight mode deactivated")}),(0,o.createElement)(En,null),(0,o.createElement)(j.Slot,{name:"core/edit-site/plugin-more-menu",label:(0,h.__)("Plugins"),as:_.MenuGroup,fillProps:{onClick:t}})),(0,o.createElement)(_.MenuGroup,{label:(0,h.__)("Tools")},(0,o.createElement)(gn,null),(0,o.createElement)(_.MenuItem,{onClick:l,shortcut:Kt.displayShortcut.access("h")},(0,h.__)("Keyboard shortcuts")),(0,o.createElement)(_n,null),(0,o.createElement)(hn,null),(0,o.createElement)(_.MenuItem,{icon:Xt,role:"menuitem",href:(0,h.__)("https://wordpress.org/support/article/site-editor/"),target:"_blank",rel:"noopener noreferrer"},(0,h.__)("Help"),(0,o.createElement)(_.VisuallyHidden,{as:"span"},(0,h.__)("(opens in a new tab)"))),(0,o.createElement)(un.Slot,{fillProps:{onClose:t}})),(0,o.createElement)(_.MenuGroup,null,(0,o.createElement)(_.MenuItem,{onClick:r},(0,h.__)("Preferences"))))})),(0,o.createElement)(an,{isModalActive:n,toggleModal:l}),(0,o.createElement)(on,{isModalActive:a,toggleModal:r}))}function yn(e){let{openEntitiesSavedStates:t,isEntitiesSavedStatesOpen:n}=e;const{isDirty:l,isSaving:a}=(0,c.useSelect)((e=>{const{__experimentalGetDirtyEntityRecords:t,isSavingEntityRecord:n}=e(u.store),l=t();return{isDirty:l.length>0,isSaving:(0,Et.some)(l,(e=>n(e.kind,e.name,e.key)))}}),[]),r=!l||a;return(0,o.createElement)(_.Button,{variant:"primary",className:"edit-site-save-button__button","aria-disabled":r,"aria-expanded":n,isBusy:a,onClick:r?void 0:t},(0,h.__)("Save"))}var bn=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"}));var wn=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z"}));var xn=(0,o.forwardRef)((function(e,t){const n=(0,c.useSelect)((e=>e(u.store).hasUndo()),[]),{undo:l}=(0,c.useDispatch)(u.store);return(0,o.createElement)(_.Button,m({},e,{ref:t,icon:(0,h.isRTL)()?wn:bn,label:(0,h.__)("Undo"),shortcut:Kt.displayShortcut.primary("z"),"aria-disabled":!n,onClick:n?l:void 0}))}));var Sn=(0,o.forwardRef)((function(e,t){const n=(0,Kt.isAppleOS)()?Kt.displayShortcut.primaryShift("z"):Kt.displayShortcut.primary("y"),l=(0,c.useSelect)((e=>e(u.store).hasRedo()),[]),{redo:a}=(0,c.useDispatch)(u.store);return(0,o.createElement)(_.Button,m({},e,{ref:t,icon:(0,h.isRTL)()?bn:wn,label:(0,h.__)("Redo"),shortcut:n,"aria-disabled":!l,onClick:l?a:void 0}))}));var kn=(0,o.createElement)(f.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(f.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));function Cn(e){if(e){const t=(0,i.getBlockType)(e.name);return t?(0,i.__experimentalGetBlockLabel)(t,e.attributes):null}return null}function Tn(e){let{entityTitle:t,entityLabel:n,isLoaded:l,children:a,showIconLabels:r}=e;const{label:i}=function(){const{getBlock:e}=(0,c.useSelect)(_e.store),t=(0,c.useSelect)((e=>e(_e.store).__experimentalGetActiveBlockIdByBlockNames(["core/template-part"])),[]);return t?{label:Cn(e(t)),isActive:!0}:{}}(),[s,u]=(0,o.useState)(null),d=(0,o.useMemo)((()=>({anchor:s})),[s]);return l?t?(0,o.createElement)("div",{className:g()("edit-site-document-actions",{"has-secondary-label":!!i})},(0,o.createElement)("div",{ref:u,className:"edit-site-document-actions__title-wrapper"},(0,o.createElement)(_.__experimentalText,{size:"body",className:"edit-site-document-actions__title",as:"h1"},(0,o.createElement)(_.VisuallyHidden,{as:"span"},(0,h.sprintf)((0,h.__)("Editing %s: "),n)),t),(0,o.createElement)(_.__experimentalText,{size:"body",className:"edit-site-document-actions__secondary-item"},null!=i?i:""),a&&(0,o.createElement)(_.Dropdown,{popoverProps:d,position:"bottom center",renderToggle:e=>{let{isOpen:t,onToggle:l}=e;return(0,o.createElement)(_.Button,{className:"edit-site-document-actions__get-info",icon:kn,"aria-expanded":t,"aria-haspopup":"true",onClick:l,variant:r?"tertiary":void 0,label:(0,h.sprintf)((0,h.__)("Show %s details"),n)},r&&(0,h.__)("Details"))},contentClassName:"edit-site-document-actions__info-dropdown",renderContent:a}))):(0,o.createElement)("div",{className:"edit-site-document-actions"},(0,h.__)("Template not found")):(0,o.createElement)("div",{className:"edit-site-document-actions"},(0,h.__)("Loading…"))}function Nn(e){var t;let{onClose:n,templatePart:l,closeTemplateDetailsDropdown:a}=e;const{revertTemplate:r}=(0,c.useDispatch)(Ut),{params:i}=Me(),s=Be({postId:l.id,postType:l.type},{fromTemplateId:i.postId});return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(_.MenuGroup,null,(0,o.createElement)(_.MenuItem,m({},s,{onClick:function(e){s.onClick(e),n(),a()}}),(0,h.sprintf)((0,h.__)("Edit %s"),null===(t=l.title)||void 0===t?void 0:t.rendered))),Je(l)&&(0,o.createElement)(_.MenuGroup,null,(0,o.createElement)(_.MenuItem,{info:(0,h.__)("Use the template part as supplied by the theme."),onClick:function(){r(l),n(),a()}},(0,h.__)("Clear customizations"))))}function In(e){let{templatePart:t,clientId:n,closeTemplateDetailsDropdown:l}=e;const{selectBlock:a,toggleBlockHighlight:r}=(0,c.useDispatch)(_e.store),i=(0,c.useSelect)((e=>e(d.store).__experimentalGetDefaultTemplatePartAreas().find((e=>e.area===t.area))),[t.area]),s=()=>r(n,!0),u=()=>r(n,!1);return(0,o.createElement)("div",{role:"menuitem",className:"edit-site-template-details__template-areas-item"},(0,o.createElement)(_.MenuItem,{role:"button",icon:null==i?void 0:i.icon,iconPosition:"left",onClick:()=>{a(n)},onMouseOver:s,onMouseLeave:u,onFocus:s,onBlur:u},null==i?void 0:i.label),(0,o.createElement)(_.DropdownMenu,{icon:te,label:(0,h.__)("More options"),className:"edit-site-template-details__template-areas-item-more"},(e=>{let{onClose:n}=e;return(0,o.createElement)(Nn,{onClose:n,templatePart:t,closeTemplateDetailsDropdown:l})})))}function Mn(e){let{closeTemplateDetailsDropdown:t}=e;const n=(0,c.useSelect)((e=>e(Ut).getCurrentTemplateTemplateParts()),[]);return n.length?(0,o.createElement)(_.MenuGroup,{label:(0,h.__)("Areas"),className:"edit-site-template-details__group edit-site-template-details__template-areas"},n.map((e=>{let{templatePart:n,block:l}=e;return(0,o.createElement)(In,{key:n.slug,clientId:l.clientId,templatePart:n,closeTemplateDetailsDropdown:t})}))):null}function Pn(e){let{template:t}=e;const[n,l]=(0,o.useState)(!1),[a,r]=(0,u.useEntityProp)("postType",t.type,"title",t.id);return(0,o.createElement)(_.TextControl,{label:(0,h.__)("Title"),value:n?"":a,help:"wp_template_part"!==t.type?(0,h.__)('Give the template a title that indicates its purpose, e.g. "Full Width".'):null,onChange:e=>{e||n?(l(!1),r(e)):l(!0)},onBlur:()=>l(!1)})}function zn(e){let{id:t}=e;const[n,l]=(0,u.useEntityProp)("postType","wp_template_part","area",t),a=(0,c.useSelect)((e=>e(d.store).__experimentalGetDefaultTemplatePartAreas()),[]).map((e=>{let{label:t,area:n}=e;return{label:t,value:n}}));return(0,o.createElement)(_.SelectControl,{label:(0,h.__)("Area"),labelPosition:"top",options:a,value:n,onChange:l})}function Vn(e){let{template:t,onClose:n}=e;const{title:l,description:a}=(0,c.useSelect)((e=>e(d.store).__experimentalGetTemplateInfo(t)),[]),{revertTemplate:r}=(0,c.useDispatch)(Ut),i=Be({postType:t.type,postId:void 0}),s="wp_template_part"===t.type,u=(s||t.is_custom)&&!t.has_theme_file;if(!t)return null;return(0,o.createElement)("div",{className:"edit-site-template-details"},(0,o.createElement)(_.__experimentalVStack,{className:"edit-site-template-details__group",spacing:3},u?(0,o.createElement)(Pn,{template:t}):(0,o.createElement)(_.__experimentalText,{size:16,weight:600,className:"edit-site-template-details__title",as:"p"},l),a&&(0,o.createElement)(_.__experimentalText,{size:"body",className:"edit-site-template-details__description",as:"p"},a)),s&&(0,o.createElement)("div",{className:"edit-site-template-details__group"},(0,o.createElement)(zn,{id:t.id})),(0,o.createElement)(Mn,{closeTemplateDetailsDropdown:n}),Je(t)&&(0,o.createElement)(_.MenuGroup,{className:"edit-site-template-details__group edit-site-template-details__revert"},(0,o.createElement)(_.MenuItem,{className:"edit-site-template-details__revert-button",info:(0,h.__)("Use the template as supplied by the theme."),onClick:()=>{r(t),n()}},(0,h.__)("Clear customizations"))),(0,o.createElement)(_.Button,m({className:"edit-site-template-details__show-all-button"},i),"wp_template"===(null==t?void 0:t.type)?(0,h.__)("Browse all templates"):(0,h.__)("Browse all template parts")))}const Bn=e=>{e.preventDefault()};function An(e){var t;let{openEntitiesSavedStates:n,isEntitiesSavedStatesOpen:l,showIconLabels:a}=e;const r=(0,o.useRef)(),{deviceType:i,entityTitle:s,template:m,templateType:p,isInserterOpen:f,isListViewOpen:E,listViewShortcut:v,isLoaded:y,isVisualMode:b,settings:w,blockEditorMode:x}=(0,c.useSelect)((e=>{const{__experimentalGetPreviewDeviceType:t,getEditedPostType:n,getEditedPostId:l,isInserterOpened:a,isListViewOpened:r,getEditorMode:o,getSettings:i}=e(Ut),{getEditedEntityRecord:s}=e(u.store),{__experimentalGetTemplateInfo:c}=e(d.store),{getShortcutRepresentation:m}=e(jt.store),{__unstableGetEditorMode:p}=e(_e.store),g=n(),_=l(),h=s("postType",g,_),f=!!_;return{deviceType:t(),entityTitle:c(h).title,isLoaded:f,template:h,templateType:g,isInserterOpen:a(),isListViewOpen:r(),listViewShortcut:m("core/edit-site/toggle-list-view"),isVisualMode:"visual"===o(),settings:i(),blockEditorMode:p()}}),[]),{__experimentalSetPreviewDeviceType:S,setIsInserterOpened:k,setIsListViewOpened:C}=(0,c.useDispatch)(Ut),{__unstableSetEditorMode:T}=(0,c.useDispatch)(_e.store),N=(0,J.useViewportMatch)("medium"),I=(0,o.useCallback)((()=>{f?r.current.focus():k(!0)}),[f,k]),M=(0,o.useCallback)((()=>C(!E)),[C,E]),P="wp_template_part"===p,z=(0,h._x)("Toggle block inserter","Generic label for block inserter button"),V=f?(0,h.__)("Close"):(0,h.__)("Add"),B=(null===(t=window)||void 0===t?void 0:t.__experimentalEnableZoomedOutView)&&b,A="zoom-out"===x;return(0,o.createElement)("div",{className:"edit-site-header"},(0,o.createElement)(_e.NavigableToolbar,{className:"edit-site-header_start","aria-label":(0,h.__)("Document tools")},(0,o.createElement)("div",{className:"edit-site-header__toolbar"},(0,o.createElement)(_.ToolbarItem,{ref:r,as:_.Button,className:"edit-site-header-toolbar__inserter-toggle",variant:"primary",isPressed:f,onMouseDown:Bn,onClick:I,disabled:!b,icon:Wt,label:a?V:z,showTooltip:!a}),N&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)(_.ToolbarItem,{as:_e.ToolSelector,showTooltip:!a,variant:a?"tertiary":void 0,disabled:!b}),(0,o.createElement)(_.ToolbarItem,{as:xn,showTooltip:!a,variant:a?"tertiary":void 0}),(0,o.createElement)(_.ToolbarItem,{as:Sn,showTooltip:!a,variant:a?"tertiary":void 0}),(0,o.createElement)(_.ToolbarItem,{as:_.Button,className:"edit-site-header-toolbar__list-view-toggle",disabled:!b&&A,icon:Yt,isPressed:E,label:(0,h.__)("List View"),onClick:M,shortcut:v,showTooltip:!a,variant:a?"tertiary":void 0}),B&&(0,o.createElement)(_.ToolbarItem,{as:_.Button,className:"edit-site-header-toolbar__zoom-out-view-toggle",icon:qt,isPressed:A,label:(0,h.__)("Zoom-out View"),onClick:()=>{S("desktop"),C(!1),T(A?"edit":"zoom-out")}})))),(0,o.createElement)("div",{className:"edit-site-header_center"},(0,o.createElement)(Tn,{entityTitle:s,entityLabel:"wp_template_part"===p?"template part":"template",isLoaded:y,showIconLabels:a},(e=>{let{onClose:t}=e;return(0,o.createElement)(Vn,{template:m,onClose:t})}))),(0,o.createElement)("div",{className:"edit-site-header_end"},(0,o.createElement)("div",{className:"edit-site-header__actions"},!P&&(0,o.createElement)("div",{className:g()("edit-site-header__actions__preview-options",{"is-zoomed-out":A})},(0,o.createElement)(_e.__experimentalPreviewOptions,{deviceType:i,setDeviceType:S,viewLabel:(0,h.__)("View")},(0,o.createElement)(_.MenuGroup,null,(0,o.createElement)(_.MenuItem,{href:null==w?void 0:w.siteUrl,target:"_blank",icon:Xt},(0,h.__)("View site"),(0,o.createElement)(_.VisuallyHidden,{as:"span"},(0,h.__)("(opens in a new tab)")))))),(0,o.createElement)(yn,{openEntitiesSavedStates:n,isEntitiesSavedStatesOpen:l}),(0,o.createElement)(X.Slot,{scope:"core/edit-site"}),(0,o.createElement)(vn,{showIconLabels:a}))))}var Rn=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"}));function Ln(e){let{className:t,identifier:n,title:l,icon:a,children:r,closeLabel:i,header:s,headerClassName:u,panelClassName:d}=e;const m=(0,c.useSelect)((e=>e(Ut).getSettings().showIconLabels),[]);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Q,{className:t,scope:"core/edit-site",identifier:n,title:l,icon:a,closeLabel:i,header:s,headerClassName:u,panelClassName:d,showIconLabels:m},r),(0,o.createElement)(Y,{scope:"core/edit-site",identifier:n,icon:a},l))}var On=(0,o.createElement)(f.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(f.Path,{d:"M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z"}));function Dn(e){let{className:t,...n}=e;return(0,o.createElement)(_.Icon,m({className:g()(t,"edit-site-global-styles-icon-with-current-color")},n))}function Gn(e){let{icon:t,children:n,...l}=e;return(0,o.createElement)(_.__experimentalItem,l,t&&(0,o.createElement)(_.__experimentalHStack,{justify:"flex-start"},(0,o.createElement)(Dn,{icon:t,size:24}),(0,o.createElement)(_.FlexItem,null,n)),!t&&n)}function Fn(e){return(0,o.createElement)(_.__experimentalNavigatorButton,m({as:Gn},e))}var Hn=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M6.9 7L3 17.8h1.7l1-2.8h4.1l1 2.8h1.7L8.6 7H6.9zm-.7 6.6l1.5-4.3 1.5 4.3h-3zM21.6 17c-.1.1-.2.2-.3.2-.1.1-.2.1-.4.1s-.3-.1-.4-.2c-.1-.1-.1-.3-.1-.6V12c0-.5 0-1-.1-1.4-.1-.4-.3-.7-.5-1-.2-.2-.5-.4-.9-.5-.4 0-.8-.1-1.3-.1s-1 .1-1.4.2c-.4.1-.7.3-1 .4-.2.2-.4.3-.6.5-.1.2-.2.4-.2.7 0 .3.1.5.2.8.2.2.4.3.8.3.3 0 .6-.1.8-.3.2-.2.3-.4.3-.7 0-.3-.1-.5-.2-.7-.2-.2-.4-.3-.6-.4.2-.2.4-.3.7-.4.3-.1.6-.1.8-.1.3 0 .6 0 .8.1.2.1.4.3.5.5.1.2.2.5.2.9v1.1c0 .3-.1.5-.3.6-.2.2-.5.3-.9.4-.3.1-.7.3-1.1.4-.4.1-.8.3-1.1.5-.3.2-.6.4-.8.7-.2.3-.3.7-.3 1.2 0 .6.2 1.1.5 1.4.3.4.9.5 1.6.5.5 0 1-.1 1.4-.3.4-.2.8-.6 1.1-1.1 0 .4.1.7.3 1 .2.3.6.4 1.2.4.4 0 .7-.1.9-.2.2-.1.5-.3.7-.4h-.3zm-3-.9c-.2.4-.5.7-.8.8-.3.2-.6.2-.8.2-.4 0-.6-.1-.9-.3-.2-.2-.3-.6-.3-1.1 0-.5.1-.9.3-1.2s.5-.5.8-.7c.3-.2.7-.3 1-.5.3-.1.6-.3.7-.6v3.4z"}));var $n=(0,o.createElement)(f.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(f.Path,{d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z"}));var Un=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"}));function jn(e,t){var n,l;const{size:a}=e;if(!a||"0"===a)return a;if(!0!==(null==t?void 0:t.fluid))return a;if(!1===(null==e?void 0:e.fluid))return a;const r=(0,_e.getComputedFluidTypographyValue)({minimumFontSize:null==e||null===(n=e.fluid)||void 0===n?void 0:n.min,maximumFontSize:null==e||null===(l=e.fluid)||void 0===l?void 0:l.max,fontSize:a});return r||a}const Wn="body",Yn=[{path:["color","palette"],valueKey:"color",cssVarInfix:"color",classes:[{classSuffix:"color",propertyName:"color"},{classSuffix:"background-color",propertyName:"background-color"},{classSuffix:"border-color",propertyName:"border-color"}]},{path:["color","gradients"],valueKey:"gradient",cssVarInfix:"gradient",classes:[{classSuffix:"gradient-background",propertyName:"background"}]},{path:["color","duotone"],cssVarInfix:"duotone",valueFunc:e=>{let{slug:t}=e;return`url( '#wp-duotone-${t}' )`},classes:[]},{path:["typography","fontSizes"],valueFunc:(e,t)=>{let{typography:n}=t;return jn(e,n)},valueKey:"size",cssVarInfix:"font-size",classes:[{classSuffix:"font-size",propertyName:"font-size"}]},{path:["typography","fontFamilies"],valueKey:"fontFamily",cssVarInfix:"font-family",classes:[{classSuffix:"font-family",propertyName:"font-family"}]},{path:["spacing","spacingSizes"],valueKey:"size",cssVarInfix:"spacing",valueFunc:e=>{let{size:t}=e;return t},classes:[]}],qn={"color.background":"color","color.text":"color","elements.link.color.text":"color","elements.button.color.text":"color","elements.button.backgroundColor":"background-color","elements.heading.color":"color","elements.heading.backgroundColor":"background-color","elements.heading.gradient":"gradient","color.gradient":"gradient","typography.fontSize":"font-size","typography.fontFamily":"font-family"};function Xn(e,t,n,l,a){const r=[(0,Et.get)(e,["blocks",t,...n]),(0,Et.get)(e,n)];for(const o of r)if(o){const r=["custom","theme","default"];for(const i of r){const r=o[i];if(r){const o=(0,Et.find)(r,(e=>e[l]===a));if(o){if("slug"===l)return o;return Xn(e,t,n,"slug",o.slug)[l]===o[l]?o:void 0}}}}}function Kn(e,t,n,l){if(!l)return l;const a=qn[n],r=(0,Et.find)(Yn,["cssVarInfix",a]);if(!r)return l;const{valueKey:o,path:i}=r,s=Xn(e,t,i,o,l);return s?`var:preset|${a}|${s.slug}`:l}function Zn(e,t,n){if(!n||"string"!=typeof n){var l,a;if(null===(l=n)||void 0===l||!l.ref||"string"!=typeof(null===(a=n)||void 0===a?void 0:a.ref))return n;{var r;const t=n.ref.split(".");if(!(n=(0,Et.get)(e,t))||null!==(r=n)&&void 0!==r&&r.ref)return n}}const o="var:",i="var(--wp--";let s;if(n.startsWith(o))s=n.slice(o.length).split("|");else{if(!n.startsWith(i)||!n.endsWith(")"))return n;s=n.slice(i.length,-")".length).split("--")}const[c,...u]=s;return"preset"===c?function(e,t,n,l){let[a,r]=l;const o=(0,Et.find)(Yn,["cssVarInfix",a]);if(!o)return n;const i=Xn(e.settings,t,o.path,"slug",r);if(i){const{valueKey:n}=o;return Zn(e,t,i[n])}return n}(e,t,n,u):"custom"===c?function(e,t,n,l){var a;const r=null!==(a=(0,Et.get)(e.settings,["blocks",t,"custom",...l]))&&void 0!==a?a:(0,Et.get)(e.settings,["custom",...l]);return r?Zn(e,t,r):n}(e,t,n,u):n}const Qn=(0,o.createContext)({user:{},base:{},merged:{},setUserConfig:()=>{}}),Jn={settings:{},styles:{}};function el(e,t){var n;let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"all";const{merged:a,base:r,user:s,setUserConfig:c}=(0,o.useContext)(Qn),u=t?`settings.blocks.${t}.${e}`:`settings.${e}`,d=t=>{c((n=>{const l=JSON.parse(JSON.stringify(n)),a=i.__EXPERIMENTAL_PATHS_WITH_MERGE[e]?u+".custom":u;return(0,Et.set)(l,a,t),l}))},m=t=>{const n=t?`settings.blocks.${t}.${e}`:`settings.${e}`,o=t=>{const l=(0,Et.get)(t,n);var a,r;return i.__EXPERIMENTAL_PATHS_WITH_MERGE[e]?null!==(a=null!==(r=null==l?void 0:l.custom)&&void 0!==r?r:null==l?void 0:l.theme)&&void 0!==a?a:null==l?void 0:l.default:l};let c;switch(l){case"all":c=o(a);break;case"user":c=o(s);break;case"base":c=o(r);break;default:throw"Unsupported source"}return c},p=null!==(n=m(t))&&void 0!==n?n:m();return[p,d]}function tl(e,t){var n;let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"all";const{merged:a,base:r,user:i,setUserConfig:s}=(0,o.useContext)(Qn),c=t?`styles.blocks.${t}.${e}`:`styles.${e}`,u=n=>{s((l=>{const r=JSON.parse(JSON.stringify(l));return(0,Et.set)(r,c,Kn(a.settings,t,e,n)),r}))};let d;switch(l){case"all":d=Zn(a,t,null!==(n=(0,Et.get)(i,c))&&void 0!==n?n:(0,Et.get)(r,c));break;case"user":d=Zn(a,t,(0,Et.get)(i,c));break;case"base":d=Zn(r,t,(0,Et.get)(r,c));break;default:throw"Unsupported source"}return[d,u]}const nl=["background","backgroundColor","color","linkColor","buttonColor","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","textDecoration","padding","contentSize","wideSize","blockGap"];function ll(e){var t,n,l,a,r,o,s,c;if(!e)return nl;const u=(0,i.getBlockType)(e);if(!u)return[];const d=[];return null==u||null===(t=u.supports)||void 0===t||null===(n=t.spacing)||void 0===n||!n.blockGap||!0===(null==u||null===(l=u.supports)||void 0===l||null===(a=l.spacing)||void 0===a?void 0:a.__experimentalSkipSerialization)||null!=u&&null!==(r=u.supports)&&void 0!==r&&null!==(o=r.spacing)&&void 0!==o&&null!==(s=o.__experimentalSkipSerialization)&&void 0!==s&&null!==(c=s.some)&&void 0!==c&&c.call(s,(e=>"blockGap"===e))||d.push("blockGap"),Object.keys(i.__EXPERIMENTAL_STYLE_PROPERTY).forEach((e=>{if(i.__EXPERIMENTAL_STYLE_PROPERTY[e].support)return i.__EXPERIMENTAL_STYLE_PROPERTY[e].requiresOptOut&&i.__EXPERIMENTAL_STYLE_PROPERTY[e].support[0]in u.supports&&!1!==(0,Et.get)(u.supports,i.__EXPERIMENTAL_STYLE_PROPERTY[e].support)||(0,Et.get)(u.supports,i.__EXPERIMENTAL_STYLE_PROPERTY[e].support,!1)?d.push(e):void 0})),d}function al(e){const[t]=el("color.palette.custom",e),[n]=el("color.palette.theme",e),[l]=el("color.palette.default",e),[a]=el("color.defaultPalette");return(0,o.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,h._x)("Theme","Indicates this palette comes from the theme."),colors:n}),a&&l&&l.length&&e.push({name:(0,h._x)("Default","Indicates this palette comes from WordPress."),colors:l}),t&&t.length&&e.push({name:(0,h._x)("Custom","Indicates this palette is created by the user."),colors:t}),e}),[t,n,l])}function rl(e){const[t]=el("color.gradients.custom",e),[n]=el("color.gradients.theme",e),[l]=el("color.gradients.default",e),[a]=el("color.defaultGradients");return(0,o.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,h._x)("Theme","Indicates this palette comes from the theme."),gradients:n}),a&&l&&l.length&&e.push({name:(0,h._x)("Default","Indicates this palette comes from WordPress."),gradients:l}),t&&t.length&&e.push({name:(0,h._x)("Custom","Indicates this palette is created by the user."),gradients:t}),e}),[t,n,l])}function ol(e){return[il(e),sl(e),cl(e),ul(e)].some(Boolean)}function il(e){const t=ll(e);return el("border.color",e)[0]&&t.includes("borderColor")}function sl(e){const t=ll(e);return el("border.radius",e)[0]&&t.includes("borderRadius")}function cl(e){const t=ll(e);return el("border.style",e)[0]&&t.includes("borderStyle")}function ul(e){const t=ll(e);return el("border.width",e)[0]&&t.includes("borderWidth")}function dl(e){return e?e.style||!e.color&&!e.width?e:{...e,style:"solid"}:e}function ml(e){let{name:t}=e;const[n]=tl("border",t,"user"),[l,a]=tl("border",t),r=al(t),i=il(t),s=cl(t),c=ul(t),u=sl(t),[d,m]=tl("border.radius",t),p=()=>{const e=null==n?void 0:n.radius;return"object"==typeof e?Object.entries(e).some(Boolean):!!e},g=(0,o.useCallback)((()=>a(void 0)),[a]),f=(0,o.useCallback)((e=>{const t=function(e){return e?(0,_.__experimentalHasSplitBorders)(e)?{top:dl(e.top),right:dl(e.right),bottom:dl(e.bottom),left:dl(e.left)}:dl(e):e}(e),n=(0,_.__experimentalHasSplitBorders)(t)?{color:null,style:null,width:null,...t}:{top:t,right:t,bottom:t,left:t};a({radius:null==l?void 0:l.radius,...n})}),[a]);return(0,o.createElement)(_.__experimentalToolsPanel,{label:(0,h.__)("Border"),resetAll:g},(c||i)&&(0,o.createElement)(_.__experimentalToolsPanelItem,{hasValue:()=>(0,_.__experimentalIsDefinedBorder)(n),label:(0,h.__)("Border"),onDeselect:()=>(()=>{if(p())return a({radius:n.radius});a(void 0)})(),isShownByDefault:!0},(0,o.createElement)(_.__experimentalBorderBoxControl,{colors:r,enableAlpha:!0,enableStyle:s,onChange:f,popoverOffset:40,popoverPlacement:"left-start",value:l,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0})),u&&(0,o.createElement)(_.__experimentalToolsPanelItem,{hasValue:p,label:(0,h.__)("Radius"),onDeselect:()=>m(void 0),isShownByDefault:!0},(0,o.createElement)(_e.__experimentalBorderRadiusControl,{values:d,onChange:e=>{m(e||void 0)}})))}function pl(e){const t=ll(e);return t.includes("color")||t.includes("backgroundColor")||t.includes("background")||t.includes("linkColor")}var gl=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"}));var _l=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"}));const hl=["horizontal","vertical"];function fl(e){const t=El(e),n=vl(e),l=yl(e),a=bl(e),r=wl(e);return t||n||l||a||r}function El(e){const t=ll(e),[n]=el("layout.contentSize",e);return n&&t.includes("contentSize")}function vl(e){const t=ll(e),[n]=el("layout.wideSize",e);return n&&t.includes("wideSize")}function yl(e){const t=ll(e),[n]=el("spacing.padding",e);return n&&t.includes("padding")}function bl(e){const t=ll(e),[n]=el("spacing.margin",e);return n&&t.includes("margin")}function wl(e){const t=ll(e),[n]=el("spacing.blockGap",e);return n&&t.includes("blockGap")}function xl(e,t){if(!t)return e;const n={};return t.forEach((t=>{"vertical"===t&&(n.top=e.top,n.bottom=e.bottom),"horizontal"===t&&(n.left=e.left,n.right=e.right),n[t]=e[t]})),n}function Sl(e){return e&&"string"==typeof e?{top:e,right:e,bottom:e,left:e}:e}function kl(e){let{name:t}=e;const n=El(t),l=vl(t),a=yl(t),r=bl(t),i=wl(t),s=function(){const[e]=el("spacing.spacingSizes");return e&&e.length>0}(),c=(0,_.__experimentalUseCustomUnits)({availableUnits:el("spacing.units",t)[0]||["%","px","em","rem","vw"]}),{contentSizeValue:u,setContentSizeValue:d,hasUserSetContentSizeValue:m,resetContentSizeValue:p}=function(e){const[t,n]=el("layout.contentSize",e),[l]=el("layout.contentSize",e,"user");return{contentSizeValue:t,setContentSizeValue:n,hasUserSetContentSizeValue:()=>!!l,resetContentSizeValue:()=>n("")}}(t),{wideSizeValue:f,setWideSizeValue:E,hasUserSetWideSizeValue:v,resetWideSizeValue:y}=function(e){const[t,n]=el("layout.wideSize",e),[l]=el("layout.wideSize",e,"user");return{wideSizeValue:t,setWideSizeValue:n,hasUserSetWideSizeValue:()=>!!l,resetWideSizeValue:()=>n("")}}(t),{paddingValues:b,paddingSides:w,isAxialPadding:x,setPaddingValues:S,resetPaddingValue:k,hasPaddingValue:C}=function(e){const[t,n]=tl("spacing.padding",e),l=Sl(t),a=(0,_e.__experimentalUseCustomSides)(e,"padding"),r=a&&a.some((e=>hl.includes(e))),o=e=>{const t=xl(e,a);n(t)},[i]=tl("spacing.padding",e,"user");return{paddingValues:l,paddingSides:a,isAxialPadding:r,setPaddingValues:o,resetPaddingValue:()=>o({}),hasPaddingValue:()=>!!i}}(t),{marginValues:T,marginSides:N,isAxialMargin:I,setMarginValues:M,resetMarginValue:P,hasMarginValue:z}=function(e){const[t,n]=tl("spacing.margin",e),l=Sl(t),a=(0,_e.__experimentalUseCustomSides)(e,"margin"),r=a&&a.some((e=>hl.includes(e))),o=e=>{const t=xl(e,a);n(t)};return{marginValues:l,marginSides:a,isAxialMargin:r,setMarginValues:o,resetMarginValue:()=>o({}),hasMarginValue:()=>!!l&&Object.keys(l).length}}(t),{gapValue:V,gapValues:B,gapSides:A,isAxialGap:R,setGapValue:L,setGapValues:O,resetGapValue:D,hasGapValue:G}=function(e){const[t,n]=tl("spacing.blockGap",e),l=(a=t)&&"string"==typeof a?{top:a}:a?{...a,right:null==a?void 0:a.left,bottom:null==a?void 0:a.top}:a;var a;const r=(0,_e.__experimentalUseCustomSides)(e,"blockGap"),o=r&&r.some((e=>hl.includes(e))),[i]=tl("spacing.blockGap",e,"user");return{gapValue:t,gapValues:l,gapSides:r,isAxialGap:o,setGapValue:n,setGapValues:e=>{e||n(null),!o&&null!=e&&e.hasOwnProperty("top")?n(e.top):n({top:null==e?void 0:e.top,left:null==e?void 0:e.left})},resetGapValue:()=>n(void 0),hasGapValue:()=>!!i}}(t);return(0,o.createElement)(_.__experimentalToolsPanel,{label:(0,h.__)("Dimensions"),resetAll:()=>{k(),P(),D(),p(),y()}},(n||l)&&(0,o.createElement)("span",{className:"span-columns"},(0,h.__)("Set the width of the main content area.")),n&&(0,o.createElement)(_.__experimentalToolsPanelItem,{className:"single-column",label:(0,h.__)("Content size"),hasValue:m,onDeselect:p,isShownByDefault:!0},(0,o.createElement)(_.__experimentalHStack,{alignment:"flex-end",justify:"flex-start"},(0,o.createElement)(_.__experimentalUnitControl,{label:(0,h.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:u||"",onChange:e=>{d(e)},units:c}),(0,o.createElement)(_.__experimentalView,null,(0,o.createElement)(ae,{icon:gl})))),l&&(0,o.createElement)(_.__experimentalToolsPanelItem,{className:"single-column",label:(0,h.__)("Wide size"),hasValue:v,onDeselect:y,isShownByDefault:!0},(0,o.createElement)(_.__experimentalHStack,{alignment:"flex-end",justify:"flex-start"},(0,o.createElement)(_.__experimentalUnitControl,{label:(0,h.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:f||"",onChange:e=>{E(e)},units:c}),(0,o.createElement)(_.__experimentalView,null,(0,o.createElement)(ae,{icon:_l})))),a&&(0,o.createElement)(_.__experimentalToolsPanelItem,{hasValue:C,label:(0,h.__)("Padding"),onDeselect:k,isShownByDefault:!0,className:g()({"tools-panel-item-spacing":s})},!s&&(0,o.createElement)(_.__experimentalBoxControl,{values:b,onChange:S,label:(0,h.__)("Padding"),sides:w,units:c,allowReset:!1,splitOnAxis:x}),s&&(0,o.createElement)(_e.__experimentalSpacingSizesControl,{values:b,onChange:S,label:(0,h.__)("Padding"),sides:w,units:c,allowReset:!1,splitOnAxis:x})),r&&(0,o.createElement)(_.__experimentalToolsPanelItem,{hasValue:z,label:(0,h.__)("Margin"),onDeselect:P,isShownByDefault:!0,className:g()({"tools-panel-item-spacing":s})},!s&&(0,o.createElement)(_.__experimentalBoxControl,{values:T,onChange:M,label:(0,h.__)("Margin"),sides:N,units:c,allowReset:!1,splitOnAxis:I}),s&&(0,o.createElement)(_e.__experimentalSpacingSizesControl,{values:T,onChange:M,label:(0,h.__)("Margin"),sides:N,units:c,allowReset:!1,splitOnAxis:I})),i&&(0,o.createElement)(_.__experimentalToolsPanelItem,{hasValue:G,label:(0,h.__)("Block spacing"),onDeselect:D,isShownByDefault:!0,className:g()({"tools-panel-item-spacing":s})},!s&&(R?(0,o.createElement)(_.__experimentalBoxControl,{label:(0,h.__)("Block spacing"),min:0,onChange:O,units:c,sides:A,values:B,allowReset:!1,splitOnAxis:R}):(0,o.createElement)(_.__experimentalUnitControl,{label:(0,h.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:L,units:c,value:V})),s&&(0,o.createElement)(_e.__experimentalSpacingSizesControl,{label:(0,h.__)("Block spacing"),min:0,onChange:O,sides:R?A:["top"],values:B,allowReset:!1,splitOnAxis:R})))}function Cl(e){const t=Tl(e),n=Nl(e),l=Il(e),a=ll(e);return t||n||l||a.includes("fontSize")}function Tl(e){const t=ll(e);return el("typography.lineHeight",e)[0]&&t.includes("lineHeight")}function Nl(e){const t=ll(e),n=el("typography.fontStyle",e)[0]&&t.includes("fontStyle"),l=el("typography.fontWeight",e)[0]&&t.includes("fontWeight");return n||l}function Il(e,t){if(!el("typography.letterSpacing",e)[0])return!1;if(!e&&"heading"===t)return!0;return ll(e).includes("letterSpacing")}function Ml(e){let{name:t,element:n}=e;const[l,a]=(0,o.useState)("heading"),r=ll(t);let i="";"heading"===n?i=`elements.${l}.`:n&&"text"!==n&&(i=`elements.${n}.`);const[s]=el("typography.fluid",t),[c]=el("typography.fontSizes",t),u=c.map((e=>(s&&(e.size=jn(e,{fluid:s})),e))),d=!el("typography.customFontSize",t)[0],[m]=el("typography.fontFamilies",t),p=el("typography.fontStyle",t)[0]&&r.includes("fontStyle"),g=el("typography.fontWeight",t)[0]&&r.includes("fontWeight"),f=Tl(t),E=Nl(t),v=Il(t,n),y=function(e,t){return!!el("typography.textTransform",e)[0]&&(!e&&"heading"===t||ll(e).includes("textTransform"))}(t,n);let b=r.includes("fontSize");"heading"===n&&"heading"===l&&(b=!1);const[w,x]=tl(i+"typography.fontFamily",t),[S,k]=tl(i+"typography.fontSize",t),[C,T]=tl(i+"typography.fontStyle",t),[N,I]=tl(i+"typography.fontWeight",t),[M,P]=tl(i+"typography.lineHeight",t),[z,V]=tl(i+"typography.letterSpacing",t),[B,A]=tl(i+"typography.textTransform",t),[R]=tl(i+"color.background",t),[L]=tl(i+"color.gradient",t),[O]=tl(i+"color.text",t),D="link"===n?{textDecoration:"underline"}:{};return(0,o.createElement)(_.PanelBody,{className:"edit-site-typography-panel",initialOpen:!0},(0,o.createElement)("div",{className:"edit-site-typography-panel__preview",style:{fontFamily:null!=w?w:"serif",background:null!=L?L:R,color:O,fontSize:S,fontStyle:C,fontWeight:N,letterSpacing:z,...D}},"Aa"),(0,o.createElement)(_.__experimentalGrid,{columns:2,rowGap:16,columnGap:8},"heading"===n&&(0,o.createElement)("div",{className:"edit-site-typography-panel__full-width-control"},(0,o.createElement)(_.__experimentalToggleGroupControl,{label:(0,h.__)("Select heading level"),hideLabelFromVision:!0,value:l,onChange:a,isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0},(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"heading",label:(0,h.__)("All")}),(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"h1",label:(0,h.__)("H1")}),(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"h2",label:(0,h.__)("H2")}),(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"h3",label:(0,h.__)("H3")}),(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"h4",label:(0,h.__)("H4")}),(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"h5",label:(0,h.__)("H5")}),(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"h6",label:(0,h.__)("H6")}))),r.includes("fontFamily")&&(0,o.createElement)("div",{className:"edit-site-typography-panel__full-width-control"},(0,o.createElement)(_e.__experimentalFontFamilyControl,{fontFamilies:m,value:w,onChange:x,size:"__unstable-large",__nextHasNoMarginBottom:!0})),b&&(0,o.createElement)("div",{className:"edit-site-typography-panel__full-width-control"},(0,o.createElement)(_.FontSizePicker,{value:S,onChange:k,fontSizes:u,disableCustomFontSizes:d,size:"__unstable-large",__nextHasNoMarginBottom:!0})),E&&(0,o.createElement)(_e.__experimentalFontAppearanceControl,{value:{fontStyle:C,fontWeight:N},onChange:e=>{let{fontStyle:t,fontWeight:n}=e;T(t),I(n)},hasFontStyles:p,hasFontWeights:g,size:"__unstable-large",__nextHasNoMarginBottom:!0}),f&&(0,o.createElement)(_e.LineHeightControl,{__nextHasNoMarginBottom:!0,__unstableInputWidth:"auto",value:M,onChange:P,size:"__unstable-large"}),v&&(0,o.createElement)(_e.__experimentalLetterSpacingControl,{value:z,onChange:V,size:"__unstable-large",__unstableInputWidth:"auto"}),y&&(0,o.createElement)("div",{className:"edit-site-typography-panel__full-width-control"},(0,o.createElement)(_e.__experimentalTextTransformControl,{value:B,onChange:A,showNone:!0,isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0}))))}var Pl=function(e){let{name:t,parentMenu:n=""}=e;const l=Cl(t),a=pl(t),r=ol(t),i=fl(t),s=r||i;return(0,o.createElement)(_.__experimentalItemGroup,null,l&&(0,o.createElement)(Fn,{icon:Hn,path:n+"/typography","aria-label":(0,h.__)("Typography styles")},(0,h.__)("Typography")),a&&(0,o.createElement)(Fn,{icon:$n,path:n+"/colors","aria-label":(0,h.__)("Colors styles")},(0,h.__)("Colors")),s&&(0,o.createElement)(Fn,{icon:Un,path:n+"/layout","aria-label":(0,h.__)("Layout styles")},(0,h.__)("Layout")))},zl=window.wp.styleEngine;const Vl={__experimentalBorder:"border",color:"color",spacing:"spacing",typography:"typography"};function Bl(e){var t;const n="var:";if(null!=e&&null!==(t=e.startsWith)&&void 0!==t&&t.call(e,n)){return`var(--wp--${e.slice(n.length).split("|").join("--")})`}return e}function Al(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,Et.reduce)(Yn,((n,l)=>{let{path:a,cssVarInfix:r,classes:o}=l;if(!o)return n;const i=(0,Et.get)(t,a,[]);return["default","theme","custom"].forEach((t=>{i[t]&&i[t].forEach((t=>{let{slug:l}=t;o.forEach((t=>{let{classSuffix:a,propertyName:o}=t;const i=`.has-${(0,Et.kebabCase)(l)}-${a}`,s=e.split(",").map((e=>`${e}${i}`)).join(","),c=`var(--wp--preset--${r}--${(0,Et.kebabCase)(l)})`;n+=`${s}{${o}: ${c} !important;}`}))}))})),n}),"")}function Rl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,l=[];return Object.keys(e).forEach((a=>{const r=t+(0,Et.kebabCase)(a.replace("/","-")),o=e[a];if(o instanceof Object){const e=r+n;l=[...l,...Rl(o,e,n)]}else l.push(`${r}: ${o}`)})),l}function Ll(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const a=Wn===t,r=(0,Et.reduce)(i.__EXPERIMENTAL_STYLE_PROPERTY,((t,l,r)=>{let{value:o,properties:i,useEngine:s,rootOnly:c}=l;if(c&&!a)return t;const u=o;if("elements"===u[0]||s)return t;const d=(0,Et.get)(e,u);if("--wp--style--root--padding"===r&&("string"==typeof d||!n))return t;if(i&&"string"!=typeof d)Object.entries(i).forEach((e=>{const[n,l]=e;if(!(0,Et.get)(d,[l],!1))return;const a=n.startsWith("--")?n:(0,Et.kebabCase)(n);t.push(`${a}: ${Bl((0,Et.get)(d,[l]))}`)}));else if((0,Et.get)(e,u,!1)){const n=r.startsWith("--")?r:(0,Et.kebabCase)(r);t.push(`${n}: ${Bl((0,Et.get)(e,u))}`)}return t}),[]),o=(0,zl.getCSSRules)(e);return o.forEach((e=>{var t;if(a&&n&&e.key.startsWith("padding"))return;const o=e.key.startsWith("--")?e.key:(0,Et.kebabCase)(e.key);let i=e.value;if("string"!=typeof i&&null!==(t=i)&&void 0!==t&&t.ref){var s;const e=i.ref.split(".");if(i=(0,Et.get)(l,e),!i||null!==(s=i)&&void 0!==s&&s.ref)return}var c;"font-size"===o&&(i=jn({size:i},null==l||null===(c=l.settings)||void 0===c?void 0:c.typography));r.push(`${o}: ${i}`)})),r}function Ol(e){var t,n,l,a,r;let{tree:o,style:i,selector:s,hasBlockGapSupport:c,hasFallbackGapSupport:u,fallbackGapValue:d}=e,m="",p=c?(0,_e.__experimentalGetGapCSSValue)(null==i||null===(t=i.spacing)||void 0===t?void 0:t.blockGap):"";if(u&&(s===Wn?p=p||"0.5em":!c&&d&&(p=d)),p&&null!=o&&null!==(n=o.settings)&&void 0!==n&&null!==(l=n.layout)&&void 0!==l&&l.definitions&&(Object.values(o.settings.layout.definitions).forEach((e=>{let{className:t,name:n,spacingStyles:l}=e;(c||"flex"===n)&&null!=l&&l.length&&l.forEach((e=>{const n=[];if(e.rules&&Object.entries(e.rules).forEach((e=>{let[t,l]=e;n.push(`${t}: ${l||p}`)})),n.length){let l="";l=c?s===Wn?`${s} .${t}${(null==e?void 0:e.selector)||""}`:`${s}.${t}${(null==e?void 0:e.selector)||""}`:s===Wn?`:where(.${t}${(null==e?void 0:e.selector)||""})`:`:where(${s}.${t}${(null==e?void 0:e.selector)||""})`,m+=`${l} { ${n.join("; ")}; }`}}))})),s===Wn&&c&&(m+=`${s} { --wp--style--block-gap: ${p}; }`)),s===Wn&&null!=o&&null!==(a=o.settings)&&void 0!==a&&null!==(r=a.layout)&&void 0!==r&&r.definitions){const e=["block","flex","grid"];Object.values(o.settings.layout.definitions).forEach((t=>{let{className:n,displayMode:l,baseStyles:a}=t;l&&e.includes(l)&&(m+=`${s} .${n} { display:${l}; }`),null!=a&&a.length&&a.forEach((e=>{const t=[];if(e.rules&&Object.entries(e.rules).forEach((e=>{let[n,l]=e;t.push(`${n}: ${l}`)})),t.length){const l=`${s} .${n}${(null==e?void 0:e.selector)||""}`;m+=`${l} { ${t.join("; ")}; }`}}))}))}return m}const Dl=(e,t)=>{var n,l;const a=[];if(null==e||!e.styles)return a;const r=e=>(0,Et.pickBy)(e,((e,t)=>["border","color","spacing","typography","filter","outline","shadow"].includes(t))),o=r(e.styles);return o&&a.push({styles:o,selector:Wn}),Object.entries(i.__EXPERIMENTAL_ELEMENTS).forEach((t=>{var n;let[l,r]=t;var o;null!==(n=e.styles)&&void 0!==n&&n.elements[l]&&a.push({styles:null===(o=e.styles)||void 0===o?void 0:o.elements[l],selector:r})})),Object.entries(null!==(n=null===(l=e.styles)||void 0===l?void 0:l.blocks)&&void 0!==n?n:{}).forEach((e=>{var n,l;let[o,s]=e;const c=r(s);c&&null!=t&&null!==(n=t[o])&&void 0!==n&&n.selector&&a.push({duotoneSelector:t[o].duotoneSelector,fallbackGapValue:t[o].fallbackGapValue,hasLayoutSupport:t[o].hasLayoutSupport,selector:t[o].selector,styles:c,featureSelectors:t[o].featureSelectors}),Object.entries(null!==(l=null==s?void 0:s.elements)&&void 0!==l?l:{}).forEach((e=>{let[n,l]=e;l&&null!=t&&t[o]&&null!==i.__EXPERIMENTAL_ELEMENTS&&void 0!==i.__EXPERIMENTAL_ELEMENTS&&i.__EXPERIMENTAL_ELEMENTS[n]&&a.push({styles:l,selector:t[o].selector.split(",").map((e=>i.__EXPERIMENTAL_ELEMENTS[n].split(",").map((t=>e+" "+t)))).join(",")})}))})),a},Gl=(e,t)=>{var n,l,a;const r=[];if(null==e||!e.settings)return r;const o=e=>{const t={};return Yn.forEach((n=>{let{path:l}=n;const a=(0,Et.get)(e,l,!1);!1!==a&&(0,Et.set)(t,l,a)})),t},i=o(e.settings),s=null===(n=e.settings)||void 0===n?void 0:n.custom;return(0,Et.isEmpty)(i)&&!s||r.push({presets:i,custom:s,selector:Wn}),Object.entries(null!==(l=null===(a=e.settings)||void 0===a?void 0:a.blocks)&&void 0!==l?l:{}).forEach((e=>{let[n,l]=e;const a=o(l),i=l.custom;(0,Et.isEmpty)(a)&&!i||r.push({presets:a,custom:i,selector:t[n].selector})})),r},Fl=(e,t)=>{const n=Gl(e,t);let l="";return n.forEach((t=>{let{presets:n,custom:a,selector:r}=t;const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return(0,Et.reduce)(Yn,((n,l)=>{let{path:a,valueKey:r,valueFunc:o,cssVarInfix:i}=l;const s=(0,Et.get)(e,a,[]);return["default","theme","custom"].forEach((e=>{s[e]&&s[e].forEach((e=>{r&&!o?n.push(`--wp--preset--${i}--${(0,Et.kebabCase)(e.slug)}: ${e[r]}`):o&&"function"==typeof o&&n.push(`--wp--preset--${i}--${(0,Et.kebabCase)(e.slug)}: ${o(e,t)}`)}))})),n}),[])}(n,null==e?void 0:e.settings),i=Rl(a,"--wp--custom--","--");i.length>0&&o.push(...i),o.length>0&&(l+=`${r}{${o.join(";")};}`)})),l};function Hl(e,t){return Gl(e,t).flatMap((e=>{let{presets:t}=e;return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Yn.filter((e=>"duotone"===e.path.at(-1))).flatMap((t=>{const n=(0,Et.get)(e,t.path,{});return["default","theme"].filter((e=>n[e])).flatMap((e=>n[e].map((e=>(0,o.createElement)(_e.__unstablePresetDuotoneFilter,{preset:e,key:e.slug})))))}))}(t)}))}function $l(){const{merged:e}=(0,o.useContext)(Qn),[t]=el("spacing.blockGap"),n=null!==t,l=!n,a=(0,c.useSelect)((e=>{const{getSettings:t}=e(_e.store);return!!t().disableLayoutStyles}));return(0,o.useMemo)((()=>{if(null==e||!e.styles||null==e||!e.settings)return[];const t=(e=>{const t={};return e.forEach((e=>{var n,l,a,r,o,i,s,c,u;const d=e.name,m=null!==(n=null==e||null===(l=e.supports)||void 0===l?void 0:l.__experimentalSelector)&&void 0!==n?n:".wp-block-"+d.replace("core/","").replace("/","-"),p=null!==(a=null==e||null===(r=e.supports)||void 0===r||null===(o=r.color)||void 0===o?void 0:o.__experimentalDuotone)&&void 0!==a?a:null,g=!(null==e||null===(i=e.supports)||void 0===i||!i.__experimentalLayout),_=null==e||null===(s=e.supports)||void 0===s||null===(c=s.spacing)||void 0===c||null===(u=c.blockGap)||void 0===u?void 0:u.__experimentalDefault,h={};Object.entries(Vl).forEach((t=>{var n,l;let[a,r]=t;const o=null==e||null===(n=e.supports)||void 0===n||null===(l=n[a])||void 0===l?void 0:l.__experimentalSelector;o&&(h[r]=function(e,t){const n=e.split(","),l=t.split(","),a=[];return n.forEach((e=>{l.forEach((t=>{a.push(`${e.trim()} ${t.trim()}`)}))})),a.join(", ")}(m,o))})),t[d]={duotoneSelector:p,fallbackGapValue:_,featureSelectors:Object.keys(h).length?h:void 0,hasLayoutSupport:g,name:d,selector:m}})),t})((0,i.getBlockTypes)()),r=Fl(e,t),o=function(e,t,n,l){var a,r;let o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const i=Dl(e,t),s=Gl(e,t),c=null==e||null===(a=e.settings)||void 0===a?void 0:a.useRootPaddingAwareAlignments,{contentSize:u,wideSize:d}=(null==e||null===(r=e.settings)||void 0===r?void 0:r.layout)||{};let m="body {margin: 0;";if(u&&(m+=` --wp--style--global--content-size: ${u};`),d&&(m+=` --wp--style--global--wide-size: ${d};`),c&&(m+='padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) }\n\t\t\t.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t.has-global-padding :where(.has-global-padding) { padding-right: 0; padding-left: 0; }\n\t\t\t.has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); }\n\t\t\t.has-global-padding :where(.has-global-padding) > .alignfull { margin-right: 0; margin-left: 0; }\n\t\t\t.has-global-padding > .alignfull:where(:not(.has-global-padding)) > :where([class*="wp-block-"]:not(.alignfull):not([class*="__"]),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t.has-global-padding :where(.has-global-padding) > .alignfull:where(:not(.has-global-padding)) > :where([class*="wp-block-"]:not(.alignfull):not([class*="__"]),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: 0; padding-left: 0;'),m+="}",i.forEach((t=>{let{selector:a,duotoneSelector:r,styles:i,fallbackGapValue:s,hasLayoutSupport:u,featureSelectors:d}=t;d&&Object.entries(d).forEach((e=>{let[t,n]=e;if(null!=i&&i[t]){const e=Ll({[t]:i[t]});delete i[t],e.length&&(m+=`${n}{${e.join(";")} }`)}}));const p={};if(null!=i&&i.filter&&(p.filter=i.filter,delete i.filter),r){const e=Ll(p);e.length>0&&(m+=`${r}{${e.join(";")};}`)}o||Wn!==a&&!u||(m+=Ol({tree:e,style:i,selector:a,hasBlockGapSupport:n,hasFallbackGapSupport:l,fallbackGapValue:s}));const g=Ll(i,a,c,e);null!=g&&g.length&&(m+=`${a}{${g.join(";")};}`);const _=Object.entries(i).filter((e=>{let[t]=e;return t.startsWith(":")}));null!=_&&_.length&&_.forEach((e=>{let[t,n]=e;const l=Ll(n);if(null==l||!l.length)return;const r=`${a.split(",").map((e=>e+t)).join(",")}{${l.join(";")};}`;m+=r}))})),m+=".wp-site-blocks > .alignleft { float: left; margin-right: 2em; }",m+=".wp-site-blocks > .alignright { float: right; margin-left: 2em; }",m+=".wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }",n){var p,g;const t=(0,_e.__experimentalGetGapCSSValue)(null==e||null===(p=e.styles)||void 0===p||null===(g=p.spacing)||void 0===g?void 0:g.blockGap)||"0.5em";m+=".wp-site-blocks > * { margin-block-start: 0; margin-block-end: 0; }",m+=`.wp-site-blocks > * + * { margin-block-start: ${t}; }`}return s.forEach((e=>{let{selector:t,presets:n}=e;Wn===t&&(t="");const l=Al(t,n);(0,Et.isEmpty)(l)||(m+=l)})),m}(e,t,n,l,a),s=Hl(e,t);return[[{css:r,isGlobalStyles:!0},{css:o,isGlobalStyles:!0}],e.settings,s]}),[n,l,e,a])}const Ul={start:{opacity:1,display:"block"},hover:{opacity:0,display:"none"}},jl={hover:{opacity:1,display:"block"},start:{opacity:0,display:"none"}};var Wl=e=>{let{label:t,isFocused:n}=e;const[l]=tl("typography.fontWeight"),[a="serif"]=tl("typography.fontFamily"),[r=a]=tl("elements.h1.typography.fontFamily"),[i=l]=tl("elements.h1.typography.fontWeight"),[s="black"]=tl("color.text"),[c=s]=tl("elements.h1.color.text"),[u="blue"]=tl("elements.link.color.text"),[d="white"]=tl("color.background"),[m]=tl("color.gradient"),[p]=$l(),g=(0,J.useReducedMotion)(),[h]=el("color.palette.core"),[f]=el("color.palette.theme"),[E]=el("color.palette.custom"),[v,y]=(0,o.useState)(!1),[b,{width:w}]=(0,J.useResizeObserver)(),x=w?w/248:1,S=(null!=f?f:[]).concat(null!=E?E:[]).concat(null!=h?h:[]),k=S.filter((e=>{let{color:t}=e;return t!==d&&t!==c})).slice(0,2),C=(0,o.useMemo)((()=>p?[...p,{css:"body{min-width: 0;padding: 0;border: none;}",isGlobalStyles:!0}]:p),[p]);return(0,o.createElement)(_e.__unstableIframe,{className:"edit-site-global-styles-preview__iframe",head:(0,o.createElement)(_e.__unstableEditorStyles,{styles:C}),style:{height:152*x,visibility:w?"visible":"hidden"},onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),tabIndex:-1},b,(0,o.createElement)(_.__unstableMotion.div,{style:{height:152*x,width:"100%",background:null!=m?m:d,cursor:"pointer"},initial:"start",animate:!v&&!n||g?"start":"hover"},(0,o.createElement)(_.__unstableMotion.div,{variants:Ul,style:{height:"100%",overflow:"hidden"}},(0,o.createElement)(_.__experimentalHStack,{spacing:10*x,justify:"center",style:{height:"100%",overflow:"hidden"}},(0,o.createElement)("div",{style:{fontFamily:r,fontSize:65*x,color:c,fontWeight:i}},"Aa"),(0,o.createElement)(_.__experimentalVStack,{spacing:4*x},k.map((e=>{let{slug:t,color:n}=e;return(0,o.createElement)("div",{key:t,style:{height:32*x,width:32*x,background:n,borderRadius:32*x/2}})}))))),(0,o.createElement)(_.__unstableMotion.div,{variants:jl,style:{height:"100%",overflow:"hidden"}},(0,o.createElement)(_.__experimentalVStack,{spacing:3*x,justify:"center",style:{height:"100%",overflow:"hidden",padding:10*x,boxSizing:"border-box"}},t&&(0,o.createElement)("div",{style:{fontSize:35*x,fontFamily:r,color:c,fontWeight:i,lineHeight:"1em"}},t),(0,o.createElement)(_.__experimentalHStack,{spacing:2*x,justify:"flex-start"},(0,o.createElement)("div",{style:{fontFamily:a,fontSize:24*x,color:s}},"Aa"),(0,o.createElement)("div",{style:{fontFamily:a,fontSize:24*x,color:u}},"Aa")),S&&(0,o.createElement)(_.__experimentalHStack,{spacing:0},S.slice(0,4).map(((e,t)=>{let{color:n}=e;return(0,o.createElement)("div",{key:t,style:{height:10*x,width:30*x,background:n,flexGrow:1}})})))))))};var Yl=function(){const{variations:e}=(0,c.useSelect)((e=>({variations:e(u.store).__experimentalGetCurrentThemeGlobalStylesVariations()})),[]);return(0,o.createElement)(_.Card,{size:"small"},(0,o.createElement)(_.CardBody,null,(0,o.createElement)(_.__experimentalVStack,{spacing:4},(0,o.createElement)(_.Card,null,(0,o.createElement)(_.CardMedia,null,(0,o.createElement)(Wl,null))),!(null==e||!e.length)&&(0,o.createElement)(_.__experimentalItemGroup,null,(0,o.createElement)(Fn,{path:"/variations","aria-label":(0,h.__)("Browse styles")},(0,o.createElement)(_.__experimentalHStack,{justify:"space-between"},(0,o.createElement)(_.FlexItem,null,(0,h.__)("Browse styles")),(0,o.createElement)(Dn,{icon:(0,h.isRTL)()?re:oe})))),(0,o.createElement)(Pl,null))),(0,o.createElement)(_.CardDivider,null),(0,o.createElement)(_.CardBody,null,(0,o.createElement)(_.__experimentalSpacer,{as:"p",paddingTop:2,paddingX:"13px",marginBottom:4},(0,h.__)("Customize the appearance of specific blocks for the whole site.")),(0,o.createElement)(_.__experimentalItemGroup,null,(0,o.createElement)(Fn,{path:"/blocks","aria-label":(0,h.__)("Blocks styles")},(0,o.createElement)(_.__experimentalHStack,{justify:"space-between"},(0,o.createElement)(_.FlexItem,null,(0,h.__)("Blocks")),(0,o.createElement)(Dn,{icon:(0,h.isRTL)()?re:oe}))))))};var ql=function(e){let{title:t,description:n}=e;return(0,o.createElement)(_.__experimentalVStack,{spacing:0},(0,o.createElement)(_.__experimentalView,null,(0,o.createElement)(_.__experimentalSpacer,{marginBottom:0,paddingX:4,paddingY:3},(0,o.createElement)(_.__experimentalHStack,{spacing:2},(0,o.createElement)(_.__experimentalNavigatorBackButton,{style:{minWidth:24,padding:0},icon:(0,h.isRTL)()?oe:re,isSmall:!0,"aria-label":(0,h.__)("Navigate to the previous view")}),(0,o.createElement)(_.__experimentalSpacer,null,(0,o.createElement)(_.__experimentalHeading,{level:5},t))))),n&&(0,o.createElement)("p",{className:"edit-site-global-styles-header__description"},n))};function Xl(e){let{block:t}=e;const n=Cl(t.name),l=pl(t.name),a=ol(t.name),r=fl(t.name);if(!(n||l||(a||r)))return null;const i=(0,h.sprintf)((0,h.__)("%s block styles"),t.title);return(0,o.createElement)(Fn,{path:"/blocks/"+t.name,"aria-label":i},(0,o.createElement)(_.__experimentalHStack,{justify:"flex-start"},(0,o.createElement)(_e.BlockIcon,{icon:t.icon}),(0,o.createElement)(_.FlexItem,null,t.title)))}var Kl=function(){const e=function(){const e=(0,c.useSelect)((e=>e(i.store).getBlockTypes()),[]),{core:t,noncore:n}=e.reduce(((e,t)=>{const{core:n,noncore:l}=e;return(t.name.startsWith("core/")?n:l).push(t),e}),{core:[],noncore:[]});return[...t,...n]}(),[t,n]=(0,o.useState)(""),l=(0,J.useDebounce)(Qe.speak,500),a=(0,c.useSelect)((e=>e(i.store).isMatchingSearchTerm),[]),r=(0,o.useMemo)((()=>t?e.filter((e=>a(e,t))):e),[t,e,a]),s=(0,o.useRef)();return(0,o.useEffect)((()=>{if(!t)return;const e=s.current.childElementCount,n=(0,h.sprintf)((0,h._n)("%d result found.","%d results found.",e),e);l(n,e)}),[t,l]),(0,o.createElement)(o.Fragment,null,(0,o.createElement)(ql,{title:(0,h.__)("Blocks"),description:(0,h.__)("Customize the appearance of specific blocks and for the whole site.")}),(0,o.createElement)(_.SearchControl,{className:"edit-site-block-types-search",onChange:n,value:t,label:(0,h.__)("Search for blocks"),placeholder:(0,h.__)("Search")}),(0,o.createElement)("div",{ref:s,className:"edit-site-block-types-item-list"},r.map((e=>(0,o.createElement)(Xl,{block:e,key:"menu-itemblock-"+e.name})))))};var Zl=function(e){let{name:t}=e;const n=(0,i.getBlockType)(t);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(ql,{title:n.title}),(0,o.createElement)(Pl,{parentMenu:"/blocks/"+t,name:t}))};var Ql=function(e){let{children:t}=e;return(0,o.createElement)(_.__experimentalHeading,{className:"edit-site-global-styles-subtitle",level:2},t)};function Jl(e){let{name:t,parentMenu:n,element:l,label:a}=e;const r=!t,i="text"!==l&&l?`elements.${l}.`:"",s="link"===l?{textDecoration:"underline"}:{},[c]=tl(i+"typography.fontFamily",t),[u]=tl(i+"typography.fontStyle",t),[d]=tl(i+"typography.fontWeight",t),[m]=tl(i+"typography.letterSpacing",t),[p]=tl(i+"color.background",t),[g]=tl(i+"color.gradient",t),[f]=tl(i+"color.text",t);if(!r)return null;const E=(0,h.sprintf)((0,h.__)("Typography %s styles"),a);return(0,o.createElement)(Fn,{path:n+"/typography/"+l,"aria-label":E},(0,o.createElement)(_.__experimentalHStack,{justify:"flex-start"},(0,o.createElement)(_.FlexItem,{className:"edit-site-global-styles-screen-typography__indicator",style:{fontFamily:null!=c?c:"serif",background:null!=g?g:p,color:f,fontStyle:u,fontWeight:d,letterSpacing:m,...s}},(0,h.__)("Aa")),(0,o.createElement)(_.FlexItem,null,a)))}var ea=function(e){let{name:t}=e;const n=void 0===t?"":"/blocks/"+t;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(ql,{title:(0,h.__)("Typography"),description:(0,h.__)("Manage the typography settings for different elements.")}),!t&&(0,o.createElement)("div",{className:"edit-site-global-styles-screen-typography"},(0,o.createElement)(_.__experimentalVStack,{spacing:3},(0,o.createElement)(Ql,null,(0,h.__)("Elements")),(0,o.createElement)(_.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,o.createElement)(Jl,{name:t,parentMenu:n,element:"text",label:(0,h.__)("Text")}),(0,o.createElement)(Jl,{name:t,parentMenu:n,element:"link",label:(0,h.__)("Links")}),(0,o.createElement)(Jl,{name:t,parentMenu:n,element:"heading",label:(0,h.__)("Headings")}),(0,o.createElement)(Jl,{name:t,parentMenu:n,element:"button",label:(0,h.__)("Buttons")})))),!!t&&(0,o.createElement)(Ml,{name:t,element:"text"}))};const ta={text:{description:(0,h.__)("Manage the fonts used on the site."),title:(0,h.__)("Text")},link:{description:(0,h.__)("Manage the fonts and typography used on the links."),title:(0,h.__)("Links")},heading:{description:(0,h.__)("Manage the fonts and typography used on headings."),title:(0,h.__)("Headings")},button:{description:(0,h.__)("Manage the fonts and typography used on buttons."),title:(0,h.__)("Buttons")}};var na=function(e){let{name:t,element:n}=e;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(ql,{title:ta[n].title,description:ta[n].description}),(0,o.createElement)(Ml,{name:t,element:n}))};var la=function(e){let{className:t,...n}=e;return(0,o.createElement)(_.Flex,m({className:g()("edit-site-global-styles__color-indicator-wrapper",t)},n))};const aa=[];var ra=function(e){let{name:t}=e;const[n]=el("color.palette.custom"),[l]=el("color.palette.theme"),[a]=el("color.palette.default"),[r]=el("color.defaultPalette",t),i=(0,o.useMemo)((()=>[...n||aa,...l||aa,...a&&r?a:aa]),[n,l,a,r]),s=t?"/blocks/"+t+"/colors/palette":"/colors/palette",c=i.length>0?(0,h.sprintf)((0,h._n)("%d color","%d colors",i.length),i.length):(0,h.__)("Add custom colors");return(0,o.createElement)(_.__experimentalVStack,{spacing:3},(0,o.createElement)(Ql,null,(0,h.__)("Palette")),(0,o.createElement)(_.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,o.createElement)(Fn,{path:s,"aria-label":(0,h.__)("Color palettes")},(0,o.createElement)(_.__experimentalHStack,{direction:0===i.length?"row-reverse":"row"},(0,o.createElement)(_.__experimentalZStack,{isLayered:!1,offset:-8},i.slice(0,5).map((e=>{let{color:t}=e;return(0,o.createElement)(la,{key:t},(0,o.createElement)(_.ColorIndicator,{colorValue:t}))}))),(0,o.createElement)(_.FlexItem,null,c)))))};function oa(e){let{name:t,parentMenu:n}=e;const l=ll(t),a=l.includes("backgroundColor")||l.includes("background"),[r]=tl("color.background",t),[i]=tl("color.gradient",t);return a?(0,o.createElement)(Fn,{path:n+"/colors/background","aria-label":(0,h.__)("Colors background styles")},(0,o.createElement)(_.__experimentalHStack,{justify:"flex-start"},(0,o.createElement)(la,{expanded:!1},(0,o.createElement)(_.ColorIndicator,{colorValue:null!=i?i:r,"data-testid":"background-color-indicator"})),(0,o.createElement)(_.FlexItem,{className:"edit-site-global-styles__color-label"},(0,h.__)("Background")))):null}function ia(e){let{name:t,parentMenu:n}=e;const l=ll(t).includes("color"),[a]=tl("color.text",t);return l?(0,o.createElement)(Fn,{path:n+"/colors/text","aria-label":(0,h.__)("Colors text styles")},(0,o.createElement)(_.__experimentalHStack,{justify:"flex-start"},(0,o.createElement)(la,{expanded:!1},(0,o.createElement)(_.ColorIndicator,{colorValue:a,"data-testid":"text-color-indicator"})),(0,o.createElement)(_.FlexItem,{className:"edit-site-global-styles__color-label"},(0,h.__)("Text")))):null}function sa(e){let{name:t,parentMenu:n}=e;const l=ll(t).includes("linkColor"),[a]=tl("elements.link.color.text",t),[r]=tl("elements.link.:hover.color.text",t);return l?(0,o.createElement)(Fn,{path:n+"/colors/link","aria-label":(0,h.__)("Colors link styles")},(0,o.createElement)(_.__experimentalHStack,{justify:"flex-start"},(0,o.createElement)(_.__experimentalZStack,{isLayered:!1,offset:-8},(0,o.createElement)(la,{expanded:!1},(0,o.createElement)(_.ColorIndicator,{colorValue:a})),(0,o.createElement)(la,{expanded:!1},(0,o.createElement)(_.ColorIndicator,{colorValue:r}))),(0,o.createElement)(_.FlexItem,{className:"edit-site-global-styles__color-label"},(0,h.__)("Links")))):null}function ca(e){let{name:t,parentMenu:n}=e;const l=ll(t).includes("color"),[a]=tl("elements.heading.color.text",t),[r]=tl("elements.heading.color.background",t);return l?(0,o.createElement)(Fn,{path:n+"/colors/heading","aria-label":(0,h.__)("Colors heading styles")},(0,o.createElement)(_.__experimentalHStack,{justify:"flex-start"},(0,o.createElement)(_.__experimentalZStack,{isLayered:!1,offset:-8},(0,o.createElement)(la,{expanded:!1},(0,o.createElement)(_.ColorIndicator,{colorValue:r})),(0,o.createElement)(la,{expanded:!1},(0,o.createElement)(_.ColorIndicator,{colorValue:a}))),(0,o.createElement)(_.FlexItem,null,(0,h.__)("Headings")))):null}function ua(e){let{name:t,parentMenu:n}=e;const l=ll(t).includes("buttonColor"),[a]=tl("elements.button.color.text",t),[r]=tl("elements.button.color.background",t);return l?(0,o.createElement)(Fn,{path:n+"/colors/button"},(0,o.createElement)(_.__experimentalHStack,{justify:"flex-start"},(0,o.createElement)(_.__experimentalZStack,{isLayered:!1,offset:-8},(0,o.createElement)(la,{expanded:!1},(0,o.createElement)(_.ColorIndicator,{colorValue:r})),(0,o.createElement)(la,{expanded:!1},(0,o.createElement)(_.ColorIndicator,{colorValue:a}))),(0,o.createElement)(_.FlexItem,{className:"edit-site-global-styles__color-label"},(0,h.__)("Buttons")))):null}var da=function(e){let{name:t}=e;const n=void 0===t?"":"/blocks/"+t;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(ql,{title:(0,h.__)("Colors"),description:(0,h.__)("Manage palettes and the default color of different global elements on the site.")}),(0,o.createElement)("div",{className:"edit-site-global-styles-screen-colors"},(0,o.createElement)(_.__experimentalVStack,{spacing:10},(0,o.createElement)(ra,{name:t}),(0,o.createElement)(_.__experimentalVStack,{spacing:3},(0,o.createElement)(Ql,null,(0,h.__)("Elements")),(0,o.createElement)(_.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,o.createElement)(oa,{name:t,parentMenu:n}),(0,o.createElement)(ia,{name:t,parentMenu:n}),(0,o.createElement)(sa,{name:t,parentMenu:n}),(0,o.createElement)(ca,{name:t,parentMenu:n}),(0,o.createElement)(ua,{name:t,parentMenu:n}))))))};function ma(e){let{name:t}=e;const[n,l]=el("color.palette.theme",t),[a]=el("color.palette.theme",t,"base"),[r,i]=el("color.palette.default",t),[s]=el("color.palette.default",t,"base"),[c,u]=el("color.palette.custom",t),[d]=el("color.defaultPalette",t);return(0,o.createElement)(_.__experimentalVStack,{className:"edit-site-global-styles-color-palette-panel",spacing:10},!!n&&!!n.length&&(0,o.createElement)(_.__experimentalPaletteEdit,{canReset:n!==a,canOnlyChangeValues:!0,colors:n,onChange:l,paletteLabel:(0,h.__)("Theme")}),!!r&&!!r.length&&!!d&&(0,o.createElement)(_.__experimentalPaletteEdit,{canReset:r!==s,canOnlyChangeValues:!0,colors:r,onChange:i,paletteLabel:(0,h.__)("Default")}),(0,o.createElement)(_.__experimentalPaletteEdit,{colors:c,onChange:u,paletteLabel:(0,h.__)("Custom"),emptyMessage:(0,h.__)("Custom colors are empty! Add some colors to create your own color palette."),slugPrefix:"custom-"}))}const pa=()=>{};function ga(e){let{name:t}=e;const[n,l]=el("color.gradients.theme",t),[a]=el("color.gradients.theme",t,"base"),[r,i]=el("color.gradients.default",t),[s]=el("color.gradients.default",t,"base"),[c,u]=el("color.gradients.custom",t),[d]=el("color.defaultGradients",t),[m]=el("color.duotone.custom")||[],[p]=el("color.duotone.default")||[],[g]=el("color.duotone.theme")||[],[f]=el("color.defaultDuotone"),E=[...m||[],...g||[],...p&&f?p:[]];return(0,o.createElement)(_.__experimentalVStack,{className:"edit-site-global-styles-gradient-palette-panel",spacing:10},!!n&&!!n.length&&(0,o.createElement)(_.__experimentalPaletteEdit,{canReset:n!==a,canOnlyChangeValues:!0,gradients:n,onChange:l,paletteLabel:(0,h.__)("Theme")}),!!r&&!!r.length&&!!d&&(0,o.createElement)(_.__experimentalPaletteEdit,{canReset:r!==s,canOnlyChangeValues:!0,gradients:r,onChange:i,paletteLabel:(0,h.__)("Default")}),(0,o.createElement)(_.__experimentalPaletteEdit,{gradients:c,onChange:u,paletteLabel:(0,h.__)("Custom"),emptyMessage:(0,h.__)("Custom gradients are empty! Add some gradients to create your own palette."),slugPrefix:"custom-"}),!!E&&!!E.length&&(0,o.createElement)("div",null,(0,o.createElement)(Ql,null,(0,h.__)("Duotone")),(0,o.createElement)(_.__experimentalSpacer,{margin:3}),(0,o.createElement)(_.DuotonePicker,{duotonePalette:E,disableCustomDuotone:!0,disableCustomColors:!0,clearable:!1,onChange:pa})))}var _a=function(e){let{name:t}=e;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(ql,{title:(0,h.__)("Palette"),description:(0,h.__)("Palettes are used to provide default color options for blocks and various design tools. Here you can edit the colors with their labels.")}),(0,o.createElement)(_.TabPanel,{tabs:[{name:"solid",title:"Solid",value:"solid"},{name:"gradient",title:"Gradient",value:"gradient"}]},(e=>(0,o.createElement)(o.Fragment,null,"solid"===e.value&&(0,o.createElement)(ma,{name:t}),"gradient"===e.value&&(0,o.createElement)(ga,{name:t})))))};var ha=function(e){let{name:t}=e;const n=ll(t),[l]=el("color.palette",t),[a]=el("color.gradients",t),[r]=el("color.custom",t),[i]=el("color.customGradient",t),s=al(t),c=rl(t),[u]=el("color.background",t),d=n.includes("backgroundColor")&&u&&(l.length>0||r),p=n.includes("background")&&(a.length>0||i),[g,_]=tl("color.background",t),[f]=tl("color.background",t,"user"),[E,v]=tl("color.gradient",t),[y]=tl("color.gradient",t,"user");if(!d&&!p)return null;let b={};d&&(b={colorValue:g,onColorChange:_},g&&(b.clearable=g===f));let w={};p&&(w={gradientValue:E,onGradientChange:v},E&&(w.clearable=E===y));const x={...b,...w};return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(ql,{title:(0,h.__)("Background"),description:(0,h.__)("Set a background color or gradient for the whole site.")}),(0,o.createElement)(_e.__experimentalColorGradientControl,m({className:"edit-site-screen-background-color__control",colors:s,gradients:c,disableCustomColors:!r,disableCustomGradients:!i,__experimentalHasMultipleOrigins:!0,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0},x)))};var fa=function(e){let{name:t}=e;const n=ll(t),[l]=el("color.palette",t),[a]=el("color.custom",t),[r]=el("color.text",t),i=al(t),s=n.includes("color")&&r&&(l.length>0||a),[c,u]=tl("color.text",t),[d]=tl("color.text",t,"user");return s?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(ql,{title:(0,h.__)("Text"),description:(0,h.__)("Set the default color used for text across the site.")}),(0,o.createElement)(_e.__experimentalColorGradientControl,{className:"edit-site-screen-text-color__control",colors:i,disableCustomColors:!a,__experimentalHasMultipleOrigins:!0,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:c,onColorChange:u,clearable:c===d})):null};var Ea=function(e){let{name:t}=e;const n=ll(t),[l]=el("color.palette",t),[a]=el("color.custom",t),r=al(t),[i]=el("color.link",t),s=n.includes("linkColor")&&i&&(l.length>0||a),c={default:{label:(0,h.__)("Default"),value:tl("elements.link.color.text",t)[0],handler:tl("elements.link.color.text",t)[1],userValue:tl("elements.link.color.text",t,"user")[0]},hover:{label:(0,h.__)("Hover"),value:tl("elements.link.:hover.color.text",t)[0],handler:tl("elements.link.:hover.color.text",t)[1],userValue:tl("elements.link.:hover.color.text",t,"user")[0]}};if(!s)return null;const u=Object.entries(c).map((e=>{let[t,n]=e;return{name:t,title:n.label,className:`color-text-${t}`}}));return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(ql,{title:(0,h.__)("Links"),description:(0,h.__)("Set the colors used for links across the site.")}),(0,o.createElement)(_.TabPanel,{tabs:u},(e=>{var t;const n=null!==(t=c[e.name])&&void 0!==t?t:null;return n?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(_e.__experimentalColorGradientControl,{className:"edit-site-screen-link-color__control",colors:r,disableCustomColors:!a,__experimentalHasMultipleOrigins:!0,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:n.value,onColorChange:n.handler,clearable:n.value===n.userValue})):null})))};var va=function(e){let{name:t}=e;const[n,l]=(0,o.useState)("heading"),a=ll(t),[r]=el("color.palette",t),[i]=el("color.gradients",t),[s]=el("color.custom",t),[c]=el("color.customGradient",t),[u]=el("color.text",t),[d]=el("color.background",t),p=al(t),g=rl(t),f=a.includes("color")&&u&&(r.length>0||s),E=a.includes("backgroundColor")&&d&&(r.length>0||s),v=a.includes("background")&&(i.length>0||c),[y,b]=tl("elements."+n+".color.text",t),[w]=tl("elements."+n+".color.text",t,"user"),[x,S]=tl("elements."+n+".color.background",t),[k]=tl("elements."+n+".color.background",t,"user"),[C,T]=tl("elements."+n+".color.gradient",t),[N]=tl("elements."+n+".color.gradient",t,"user");if(!f&&!E&&!v)return null;let I={};E&&(I={colorValue:x,onColorChange:S},x&&(I.clearable=x===k));let M={};v&&(M={gradientValue:C,onGradientChange:T},C&&(M.clearable=C===N));const P={...I,...M};return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(ql,{title:(0,h.__)("Headings"),description:(0,h.__)("Set the default color used for headings across the site.")}),(0,o.createElement)("div",{className:"edit-site-global-styles-screen-heading-color"},(0,o.createElement)("h4",null,(0,h.__)("Select heading level")),(0,o.createElement)(_.__experimentalToggleGroupControl,{label:(0,h.__)("Select heading level"),hideLabelFromVision:!0,value:n,onChange:l,isBlock:!0},(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"heading",label:(0,h.__)("All")}),(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"h1",label:(0,h.__)("H1")}),(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"h2",label:(0,h.__)("H2")}),(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"h3",label:(0,h.__)("H3")}),(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"h4",label:(0,h.__)("H4")}),(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"h5",label:(0,h.__)("H5")}),(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"h6",label:(0,h.__)("H6")}))),f&&(0,o.createElement)("div",{className:"edit-site-global-styles-screen-heading-color"},(0,o.createElement)("h4",null,"heading"===n?(0,h.__)("Text color for all heading levels"):(0,h.sprintf)((0,h.__)("Text color for %s"),n.toUpperCase())),(0,o.createElement)(_e.__experimentalColorGradientControl,{className:"edit-site-screen-heading-text-color__control",colors:p,disableCustomColors:!s,__experimentalHasMultipleOrigins:!0,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:y,onColorChange:b,clearable:y===w})),E&&(0,o.createElement)("div",{className:"edit-site-global-styles-screen-heading-color"},(0,o.createElement)("h4",null,"heading"===n?(0,h.__)("Background color for all heading levels"):(0,h.sprintf)((0,h.__)("Background color for %s"),n.toUpperCase())),(0,o.createElement)(_e.__experimentalColorGradientControl,m({className:"edit-site-screen-heading-background-color__control",colors:p,gradients:g,disableCustomColors:!s,disableCustomGradients:!c,__experimentalHasMultipleOrigins:!0,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0},P))))};var ya=function(e){let{name:t}=e;const n=ll(t),[l]=el("color.palette",t),[a]=el("color.custom",t),r=al(t),[i]=el("color.background",t),s=n.includes("buttonColor")&&i&&(l.length>0||a),[c,u]=tl("elements.button.color.text",t),[d]=tl("elements.button.color.text",t,"user"),[m,p]=tl("elements.button.color.background",t),[g]=tl("elements.button.color.background",t,"user");return s?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(ql,{title:(0,h.__)("Buttons"),description:(0,h.__)("Set the default colors used for buttons across the site.")}),(0,o.createElement)("h4",{className:"edit-site-global-styles-section-title"},(0,h.__)("Text color")),(0,o.createElement)(_e.__experimentalColorGradientControl,{className:"edit-site-screen-button-color__control",colors:r,disableCustomColors:!a,__experimentalHasMultipleOrigins:!0,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:c,onColorChange:u,clearable:c===d}),(0,o.createElement)("h4",{className:"edit-site-global-styles-section-title"},(0,h.__)("Background color")),(0,o.createElement)(_e.__experimentalColorGradientControl,{className:"edit-site-screen-button-color__control",colors:r,disableCustomColors:!a,__experimentalHasMultipleOrigins:!0,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:m,onColorChange:p,clearable:m===g})):null};var ba=function(e){let{name:t}=e;const n=ol(t),l=fl(t);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(ql,{title:(0,h.__)("Layout")}),l&&(0,o.createElement)(kl,{name:t}),n&&(0,o.createElement)(ml,{name:t}))};const wa=e=>e;function xa(e,t){if(Array.isArray(t))return t}function Sa(e,t){return(0,Et.mergeWith)({},e,t,xa)}const ka=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=(0,Et.pickBy)((0,Et.mapValues)(e,ka),wa);return(0,Et.isEmpty)(t)?void 0:t};function Ca(){const[e,t,n]=function(){const{globalStylesId:e,settings:t,styles:n}=(0,c.useSelect)((e=>{const t=e(u.store).__experimentalGetCurrentGlobalStylesId(),n=t?e(u.store).getEditedEntityRecord("root","globalStyles",t):void 0;return{globalStylesId:t,settings:null==n?void 0:n.settings,styles:null==n?void 0:n.styles}}),[]),{getEditedEntityRecord:l}=(0,c.useSelect)(u.store),{editEntityRecord:a}=(0,c.useDispatch)(u.store),r=(0,o.useMemo)((()=>({settings:null!=t?t:{},styles:null!=n?n:{}})),[t,n]),i=(0,o.useCallback)((t=>{var n,r;const o=l("root","globalStyles",e),i=t({styles:null!==(n=null==o?void 0:o.styles)&&void 0!==n?n:{},settings:null!==(r=null==o?void 0:o.settings)&&void 0!==r?r:{}});a("root","globalStyles",e,{styles:ka(i.styles)||{},settings:ka(i.settings)||{}})}),[e]);return[!!t||!!n,r,i]}(),[l,a]=function(){const e=(0,c.useSelect)((e=>e(u.store).__experimentalGetCurrentThemeBaseGlobalStyles()),[]);return[!!e,e]}(),r=(0,o.useMemo)((()=>a&&t?Sa(a,t):{}),[t,a]);return(0,o.useMemo)((()=>({isReady:e&&l,user:t,base:a,merged:r,setUserConfig:n})),[r,t,a,n,e,l])}function Ta(e){let{children:t}=e;const n=Ca();return n.isReady?(0,o.createElement)(Qn.Provider,{value:n},t):null}function Na(e){let{variation:t}=e;const[n,l]=(0,o.useState)(!1),{base:a,user:r,setUserConfig:i}=(0,o.useContext)(Qn),s=(0,o.useMemo)((()=>{var e,n;return{user:{settings:null!==(e=t.settings)&&void 0!==e?e:{},styles:null!==(n=t.styles)&&void 0!==n?n:{}},base:a,merged:Sa(a,t),setUserConfig:()=>{}}}),[t,a]),c=()=>{i((()=>({settings:t.settings,styles:t.styles})))},u=(0,o.useMemo)((()=>{return e=r,n=t,(0,Et.isEqual)(e.styles,n.styles)&&(0,Et.isEqual)(e.settings,n.settings);var e,n}),[r,t]);return(0,o.createElement)(Qn.Provider,{value:s},(0,o.createElement)("div",{className:g()("edit-site-global-styles-variations_item",{"is-active":u}),role:"button",onClick:c,onKeyDown:e=>{e.keyCode===Kt.ENTER&&(e.preventDefault(),c())},tabIndex:"0","aria-label":null==t?void 0:t.title,"aria-current":u,onFocus:()=>l(!0),onBlur:()=>l(!1)},(0,o.createElement)("div",{className:"edit-site-global-styles-variations_item-preview"},(0,o.createElement)(Wl,{label:null==t?void 0:t.title,isFocused:n}))))}var Ia=function(){const{variations:e}=(0,c.useSelect)((e=>({variations:e(u.store).__experimentalGetCurrentThemeGlobalStylesVariations()})),[]),t=(0,o.useMemo)((()=>[{title:(0,h.__)("Default"),settings:{},styles:{}},...e.map((e=>{var t,n;return{...e,settings:null!==(t=e.settings)&&void 0!==t?t:{},styles:null!==(n=e.styles)&&void 0!==n?n:{}}}))]),[e]);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(ql,{back:"/",title:(0,h.__)("Browse styles"),description:(0,h.__)("Choose a different style combination for the theme styles")}),(0,o.createElement)(_.Card,{size:"small",isBorderless:!0},(0,o.createElement)(_.CardBody,null,(0,o.createElement)(_.__experimentalGrid,{columns:2},null==t?void 0:t.map(((e,t)=>(0,o.createElement)(Na,{key:t,variation:e})))))))};function Ma(e){let{className:t,...n}=e;return(0,o.createElement)(_.__experimentalNavigatorScreen,m({className:["edit-site-global-styles-sidebar__navigator-screen",t].filter(Boolean).join(" ")},n))}function Pa(e){let{name:t}=e;const n=void 0===t?"":"/blocks/"+t;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Ma,{path:n+"/typography"},(0,o.createElement)(ea,{name:t})),(0,o.createElement)(Ma,{path:n+"/typography/text"},(0,o.createElement)(na,{name:t,element:"text"})),(0,o.createElement)(Ma,{path:n+"/typography/link"},(0,o.createElement)(na,{name:t,element:"link"})),(0,o.createElement)(Ma,{path:n+"/typography/heading"},(0,o.createElement)(na,{name:t,element:"heading"})),(0,o.createElement)(Ma,{path:n+"/typography/button"},(0,o.createElement)(na,{name:t,element:"button"})),(0,o.createElement)(Ma,{path:n+"/colors"},(0,o.createElement)(da,{name:t})),(0,o.createElement)(Ma,{path:n+"/colors/palette"},(0,o.createElement)(_a,{name:t})),(0,o.createElement)(Ma,{path:n+"/colors/background"},(0,o.createElement)(ha,{name:t})),(0,o.createElement)(Ma,{path:n+"/colors/text"},(0,o.createElement)(fa,{name:t})),(0,o.createElement)(Ma,{path:n+"/colors/link"},(0,o.createElement)(Ea,{name:t})),(0,o.createElement)(Ma,{path:n+"/colors/heading"},(0,o.createElement)(va,{name:t})),(0,o.createElement)(Ma,{path:n+"/colors/button"},(0,o.createElement)(ya,{name:t})),(0,o.createElement)(Ma,{path:n+"/layout"},(0,o.createElement)(ba,{name:t})))}var za=function(){const e=(0,i.getBlockTypes)();return(0,o.createElement)(_.__experimentalNavigatorProvider,{className:"edit-site-global-styles-sidebar__navigator-provider",initialPath:"/"},(0,o.createElement)(Ma,{path:"/"},(0,o.createElement)(Yl,null)),(0,o.createElement)(Ma,{path:"/variations"},(0,o.createElement)(Ia,null)),(0,o.createElement)(Ma,{path:"/blocks"},(0,o.createElement)(Kl,null)),e.map((e=>(0,o.createElement)(Ma,{key:"menu-block-"+e.name,path:"/blocks/"+e.name},(0,o.createElement)(Zl,{name:e.name})))),(0,o.createElement)(Pa,null),e.map((e=>(0,o.createElement)(Pa,{key:"screens-block-"+e.name,name:e.name}))))};function Va(){const[e,t]=(()=>{const{user:e,setUserConfig:t}=(0,o.useContext)(Qn);return[!!e&&!(0,Et.isEqual)(e,Jn),(0,o.useCallback)((()=>t((()=>Jn))),[t])]})(),{toggle:n}=(0,c.useDispatch)(k.store);return(0,o.createElement)(Ln,{className:"edit-site-global-styles-sidebar",identifier:"edit-site/global-styles",title:(0,h.__)("Styles"),icon:On,closeLabel:(0,h.__)("Close global styles sidebar"),panelClassName:"edit-site-global-styles-sidebar__panel",header:(0,o.createElement)(_.Flex,null,(0,o.createElement)(_.FlexBlock,null,(0,o.createElement)("strong",null,(0,h.__)("Styles"))),(0,o.createElement)(_.FlexItem,null,(0,o.createElement)(_.DropdownMenu,{icon:te,label:(0,h.__)("More Global Styles Actions"),controls:[{title:(0,h.__)("Reset to defaults"),onClick:t,isDisabled:!e},{title:(0,h.__)("Welcome Guide"),onClick:()=>n("core/edit-site","welcomeGuideStyles")}]})))},(0,o.createElement)(za,null))}const Ba="edit-site/template",Aa="edit-site/block-inspector";var Ra=e=>{let{sidebarName:t}=e;const{enableComplementaryArea:n}=(0,c.useDispatch)(O),[l,a]=t===Ba?[(0,h.__)("Template (selected)"),"is-active"]:[(0,h.__)("Template"),""],[r,i]=t===Aa?[(0,h.__)("Block (selected)"),"is-active"]:[(0,h.__)("Block"),""];return(0,o.createElement)("ul",null,(0,o.createElement)("li",null,(0,o.createElement)(_.Button,{onClick:()=>n(Oe,Ba),className:`edit-site-sidebar__panel-tab ${a}`,"aria-label":l,"data-label":(0,h.__)("Template")},(0,h.__)("Template"))),(0,o.createElement)("li",null,(0,o.createElement)(_.Button,{onClick:()=>n(Oe,Aa),className:`edit-site-sidebar__panel-tab ${i}`,"aria-label":r,"data-label":(0,h.__)("Block")},(0,h.__)("Block"))))};function La(e){let{template:t}=e;const{revertTemplate:n}=(0,c.useDispatch)(Ut);return Je(t)?(0,o.createElement)(_.DropdownMenu,{icon:te,label:(0,h.__)("Actions"),className:"edit-site-template-card__actions",toggleProps:{isSmall:!0}},(e=>{let{onClose:l}=e;return(0,o.createElement)(_.MenuGroup,null,(0,o.createElement)(_.MenuItem,{info:(0,h.__)("Use the template as supplied by the theme."),onClick:()=>{n(t),l()}},(0,h.__)("Clear customizations")))})):null}function Oa(e){let{area:t,clientId:n}=e;const{selectBlock:l,toggleBlockHighlight:a}=(0,c.useDispatch)(_e.store),r=(0,c.useSelect)((e=>e(d.store).__experimentalGetDefaultTemplatePartAreas().find((e=>e.area===t))),[t]),i=()=>a(n,!0),s=()=>a(n,!1);return(0,o.createElement)(_.Button,{className:"edit-site-template-card__template-areas-item",icon:null==r?void 0:r.icon,onMouseOver:i,onMouseLeave:s,onFocus:i,onBlur:s,onClick:()=>{l(n)}},null==r?void 0:r.label)}function Da(){const e=(0,c.useSelect)((e=>e(Ut).getCurrentTemplateTemplateParts()),[]);return e.length?(0,o.createElement)("section",{className:"edit-site-template-card__template-areas"},(0,o.createElement)(_.__experimentalHeading,{level:3,className:"edit-site-template-card__template-areas-title"},(0,h.__)("Areas")),(0,o.createElement)("ul",{className:"edit-site-template-card__template-areas-list"},e.map((e=>{let{templatePart:t,block:n}=e;return(0,o.createElement)("li",{key:t.slug},(0,o.createElement)(Oa,{area:t.area,clientId:n.clientId}))})))):null}function Ga(){const{info:{title:e,description:t,icon:n},template:l}=(0,c.useSelect)((e=>{const{getEditedPostType:t,getEditedPostId:n}=e(Ut),{getEditedEntityRecord:l}=e(u.store),{__experimentalGetTemplateInfo:a}=e(d.store),r=l("postType",t(),n());return{info:r?a(r):{},template:r}}),[]);return e||t?(0,o.createElement)("div",{className:"edit-site-template-card"},(0,o.createElement)(_.Icon,{className:"edit-site-template-card__icon",icon:n}),(0,o.createElement)("div",{className:"edit-site-template-card__content"},(0,o.createElement)("div",{className:"edit-site-template-card__header"},(0,o.createElement)("h2",{className:"edit-site-template-card__title"},e),(0,o.createElement)(La,{template:l})),(0,o.createElement)("div",{className:"edit-site-template-card__description"},t),(0,o.createElement)(Da,null))):null}const{Slot:Fa,Fill:Ha}=(0,_.createSlotFill)("EditSiteSidebarInspector"),$a=Ha;function Ua(){const{sidebar:e,isEditorSidebarOpened:t,hasBlockSelection:n,supportsGlobalStyles:l}=(0,c.useSelect)((e=>{const t=e(O).getActiveComplementaryArea(Oe),n=[Aa,Ba].includes(t),l=e(Ut).getSettings();return{sidebar:t,isEditorSidebarOpened:n,hasBlockSelection:!!e(_e.store).getBlockSelectionStart(),supportsGlobalStyles:!(null!=l&&l.supportsTemplatePartsMode)}}),[]),{enableComplementaryArea:a}=(0,c.useDispatch)(O);(0,o.useEffect)((()=>{t&&a(Oe,n?Aa:Ba)}),[n,t]);let r=e;t||(r=n?Aa:Ba);let i=o.Fragment;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Ln,{identifier:r,title:(0,h.__)("Settings"),icon:Rn,closeLabel:(0,h.__)("Close settings sidebar"),header:(0,o.createElement)(Ra,{sidebarName:r}),headerClassName:"edit-site-sidebar__panel-tabs"},r===Ba&&(0,o.createElement)(_.PanelBody,null,(0,o.createElement)(Ga,null)),r===Aa&&(0,o.createElement)(Fa,{bubblesVirtually:!0})),l&&(0,o.createElement)(Va,null),(0,o.createElement)(i,null))}var ja=window.wp.htmlEntities;var Wa=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"}));var Ya=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"}));const qa="__experimentalMainDashboardButton",{Fill:Xa,Slot:Ka}=(0,_.createSlotFill)(qa),Za=Xa;Za.Slot=e=>{let{children:t}=e;const n=(0,_.__experimentalUseSlot)(qa);return Boolean(n.fills&&n.fills.length)?(0,o.createElement)(Ka,{bubblesVirtually:!0}):t};var Qa=Za;const Ja="site-editor";function er(e){let{params:t,replace:n,...l}=e;const a=Be(t,n);return(0,o.createElement)(_.__experimentalNavigationItem,m({},a,l))}var tr=e=>{let{activeItem:t=Ja}=e;const{homeTemplate:n,isNavigationOpen:l,isTemplatePartsMode:a,siteTitle:r}=(0,c.useSelect)((e=>{const{getEntityRecord:t}=e(u.store),{getSettings:n,isNavigationOpened:l}=e(Ut),a=t("root","__unstableBase",void 0)||{},{supportsTemplatePartsMode:r,__unstableHomeTemplate:o}=n();return{siteTitle:a.name,homeTemplate:o,isNavigationOpen:l(),isTemplatePartsMode:!!r}}),[]),{setIsNavigationPanelOpened:i}=(0,c.useDispatch)(Ut);return(0,o.createElement)("div",{className:g()("edit-site-navigation-panel",{"is-open":l}),onKeyDown:e=>{e.keyCode!==Kt.ESCAPE||e.defaultPrevented||(e.preventDefault(),i(!1))}},(0,o.createElement)("div",{className:"edit-site-navigation-panel__inner"},(0,o.createElement)("div",{className:"edit-site-navigation-panel__site-title-container"},(0,o.createElement)("div",{className:"edit-site-navigation-panel__site-title"},(0,ja.decodeEntities)(r))),(0,o.createElement)("div",{className:"edit-site-navigation-panel__scroll-container"},(0,o.createElement)(_.__experimentalNavigation,{activeItem:t},(0,o.createElement)(Qa.Slot,null,(0,o.createElement)(_.__experimentalNavigationBackButton,{backButtonLabel:(0,h.__)("Dashboard"),className:"edit-site-navigation-panel__back-to-dashboard",href:"index.php"})),(0,o.createElement)(_.__experimentalNavigationMenu,null,(0,o.createElement)(_.__experimentalNavigationGroup,{title:(0,h.__)("Editor")},!a&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)(er,{icon:Wa,title:(0,h.__)("Site"),item:Ja,params:{postId:null==n?void 0:n.postId,postType:null==n?void 0:n.postType}}),(0,o.createElement)(er,{icon:Un,title:(0,h.__)("Templates"),item:"wp_template",params:{postId:void 0,postType:"wp_template"}})),(0,o.createElement)(er,{icon:Ya,title:(0,h.__)("Template Parts"),item:"wp_template_part",params:{postId:void 0,postType:"wp_template_part"}})))))))};var nr=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,o.createElement)(f.Path,{d:"M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"}));var lr=function(e){let{icon:t}=e;const{isNavigationOpen:n,isRequestingSiteIcon:l,siteIconUrl:a}=(0,c.useSelect)((e=>{const{getEntityRecord:t,isResolving:n}=e(u.store),l=t("root","__unstableBase",void 0)||{};return{isNavigationOpen:e(Ut).isNavigationOpened(),isRequestingSiteIcon:n("core","getEntityRecord",["root","__unstableBase",void 0]),siteIconUrl:l.site_icon_url}}),[]),{setIsNavigationPanelOpened:r}=(0,c.useDispatch)(Ut),i=(0,J.useReducedMotion)(),s=(0,o.useRef)();(0,o.useEffect)((()=>{n||s.current.focus()}),[n]);let d=(0,o.createElement)(_.Icon,{size:"36px",icon:nr});const m={expand:{scale:1.25,transition:{type:"tween",duration:"0.3"}}};a?d=(0,o.createElement)(_.__unstableMotion.img,{variants:!i&&m,alt:(0,h.__)("Site Icon"),className:"edit-site-navigation-toggle__site-icon",src:a}):l?d=null:t&&(d=(0,o.createElement)(_.Icon,{size:"36px",icon:t}));const p=g()({"edit-site-navigation-toggle__button":!0,"has-icon":a});return(0,o.createElement)(_.__unstableMotion.div,{className:"edit-site-navigation-toggle"+(n?" is-open":""),whileHover:"expand"},(0,o.createElement)(_.Button,{className:p,label:(0,h.__)("Toggle navigation"),ref:s,"aria-pressed":n,onClick:()=>r(!n),showTooltip:!0},d))};const{Fill:ar,Slot:rr}=(0,_.createSlotFill)("EditSiteNavigationPanelPreview"),{Fill:or,Slot:ir}=(0,_.createSlotFill)("EditSiteNavigationSidebar");function sr(e){let{isDefaultOpen:t=!1,activeTemplateType:n}=e;const l=(0,J.useViewportMatch)("medium"),{setIsNavigationPanelOpened:a}=(0,c.useDispatch)(Ut);return(0,o.useEffect)((function(){a(t&&l)}),[t,l,a]),(0,o.createElement)(or,null,(0,o.createElement)(lr,null),(0,o.createElement)(tr,{activeItem:n}),(0,o.createElement)(rr,null))}sr.Slot=ir;var cr=sr,ur=window.wp.reusableBlocks;function dr(e){let{clientId:t}=e;const{getBlocks:n}=(0,c.useSelect)(_e.store),{replaceBlocks:l}=(0,c.useDispatch)(_e.store);return(0,c.useSelect)((e=>e(_e.store).canRemoveBlock(t)),[t])?(0,o.createElement)(_e.BlockSettingsMenuControls,null,(e=>{let{onClose:a}=e;return(0,o.createElement)(_.MenuItem,{onClick:()=>{l(t,n(t)),a()}},(0,h.__)("Detach blocks from template part"))})):null}function mr(e){let{closeModal:t,onCreate:n}=e;const[l,a]=(0,o.useState)(""),[r,i]=(0,o.useState)(De),[s,u]=(0,o.useState)(!1),m=(0,J.useInstanceId)(mr),p=(0,c.useSelect)((e=>e(d.store).__experimentalGetDefaultTemplatePartAreas()),[]);return(0,o.createElement)(_.Modal,{title:(0,h.__)("Create a template part"),closeLabel:(0,h.__)("Close"),onRequestClose:t,overlayClassName:"edit-site-create-template-part-modal"},(0,o.createElement)("form",{onSubmit:async e=>{e.preventDefault(),l&&(u(!0),await n({title:l,area:r}))}},(0,o.createElement)(_.TextControl,{label:(0,h.__)("Name"),value:l,onChange:a,required:!0}),(0,o.createElement)(_.BaseControl,{label:(0,h.__)("Area"),id:`edit-site-create-template-part-modal__area-selection-${m}`,className:"edit-site-create-template-part-modal__area-base-control"},(0,o.createElement)(_.__experimentalRadioGroup,{label:(0,h.__)("Area"),className:"edit-site-create-template-part-modal__area-radio-group",id:`edit-site-create-template-part-modal__area-selection-${m}`,onChange:i,checked:r},p.map((e=>{let{icon:t,label:n,area:l,description:a}=e;return(0,o.createElement)(_.__experimentalRadio,{key:n,value:l,className:"edit-site-create-template-part-modal__area-radio"},(0,o.createElement)(_.Flex,{align:"start",justify:"start"},(0,o.createElement)(_.FlexItem,null,(0,o.createElement)(_.Icon,{icon:t})),(0,o.createElement)(_.FlexBlock,{className:"edit-site-create-template-part-modal__option-label"},n,(0,o.createElement)("div",null,a)),(0,o.createElement)(_.FlexItem,{className:"edit-site-create-template-part-modal__checkbox"},r===l&&(0,o.createElement)(_.Icon,{icon:E}))))})))),(0,o.createElement)(_.Flex,{className:"edit-site-create-template-part-modal__modal-actions",justify:"flex-end"},(0,o.createElement)(_.FlexItem,null,(0,o.createElement)(_.Button,{variant:"secondary",onClick:()=>{t()}},(0,h.__)("Cancel"))),(0,o.createElement)(_.FlexItem,null,(0,o.createElement)(_.Button,{variant:"primary",type:"submit",disabled:!l,isBusy:s},(0,h.__)("Create"))))))}function pr(e){let{clientIds:t,blocks:n}=e;const[l,a]=(0,o.useState)(!1),{replaceBlocks:r}=(0,c.useDispatch)(_e.store),{saveEntityRecord:s}=(0,c.useDispatch)(u.store),{createSuccessNotice:d}=(0,c.useDispatch)(Ze.store),{canCreate:m}=(0,c.useSelect)((e=>{const{supportsTemplatePartsMode:t}=e(Ut).getSettings();return{canCreate:!t}}),[]);if(!m)return null;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(_e.BlockSettingsMenuControls,null,(()=>(0,o.createElement)(_.MenuItem,{icon:Ya,onClick:()=>{a(!0)}},(0,h.__)("Create Template part")))),l&&(0,o.createElement)(mr,{closeModal:()=>{a(!1)},onCreate:async e=>{let{title:l,area:a}=e;const o=(0,Et.kebabCase)(l).replace(/[^\w-]+/g,"")||"wp-custom-part",c=await s("postType","wp_template_part",{slug:o,title:l,content:(0,i.serialize)(n),area:a});r(t,(0,i.createBlock)("core/template-part",{slug:c.slug,theme:c.theme})),d((0,h.__)("Template part created."),{type:"snackbar"})}}))}function gr(){var e;const{clientIds:t,blocks:n}=(0,c.useSelect)((e=>{const{getSelectedBlockClientIds:t,getBlocksByClientId:n}=e(_e.store),l=t();return{clientIds:l,blocks:n(l)}}),[]);return 1===n.length&&"core/template-part"===(null===(e=n[0])||void 0===e?void 0:e.name)?(0,o.createElement)(dr,{clientId:t[0]}):(0,o.createElement)(pr,{clientIds:t,blocks:n})}var _r=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"}));function hr(e){let{type:t,id:n,activePage:l,onActivePageChange:a}=e;const r=(0,c.useSelect)((e=>t&&n&&"URL"!==t&&e(u.store).getEntityRecord("postType",t,n)),[t,n]),i=(0,o.useMemo)((()=>{if(null==r||!r.link)return null;const e=(0,de.getPathAndQueryString)(r.link);return e===(null==l?void 0:l.path)?null:()=>a({type:t,slug:r.slug,path:e,context:{postType:r.type,postId:r.id}})}),[r,null==l?void 0:l.path,a]);return i&&(0,o.createElement)(_.Button,{icon:_r,label:(0,h.__)("Edit Page Template"),onClick:i})}function fr(e){let{onClick:t=(()=>{})}=e;const{shortcut:n,isBlockInspectorOpen:l}=(0,c.useSelect)((e=>({shortcut:e(jt.store).getShortcutRepresentation("core/edit-site/toggle-block-settings-sidebar"),isBlockInspectorOpen:e(O).getActiveComplementaryArea(Ut.name)===Aa})),[]),{enableComplementaryArea:a,disableComplementaryArea:r}=(0,c.useDispatch)(O),i=l?(0,h.__)("Hide more settings"):(0,h.__)("Show more settings");return(0,o.createElement)(_.MenuItem,{onClick:()=>{l?(r(Oe),(0,Qe.speak)((0,h.__)("Block settings closed"))):(a(Oe,Aa),(0,Qe.speak)((0,h.__)("Additional settings are now available in the Editor block settings sidebar"))),t()},shortcut:n},i)}var Er=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M20 10.8H6.7l4.1-4.5-1.1-1.1-5.8 6.3 5.8 5.8 1.1-1.1-4-3.9H20z"}));var vr=function(){var e;const t=Me(),n=Pe(),l="wp_template_part"===t.params.postType,a=null===(e=t.state)||void 0===e?void 0:e.fromTemplateId;return l&&a?(0,o.createElement)(_.Button,{className:"edit-site-visual-editor__back-button",icon:Er,onClick:()=>{n.back()}},(0,h.__)("Back")):null};function yr(e){let{direction:t,resizeWidthBy:n}=e;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("button",{className:`resizable-editor__drag-handle is-${t}`,"aria-label":(0,h.__)("Drag to resize"),"aria-describedby":`resizable-editor__resize-help-${t}`,onKeyDown:function(e){const{keyCode:l}=e;"left"===t&&l===Kt.LEFT||"right"===t&&l===Kt.RIGHT?n(20):("left"===t&&l===Kt.RIGHT||"right"===t&&l===Kt.LEFT)&&n(-20)}}),(0,o.createElement)(_.VisuallyHidden,{id:`resizable-editor__resize-help-${t}`},(0,h.__)("Use left and right arrow keys to resize the canvas.")))}const br="100%",wr="100%",xr={position:void 0,userSelect:void 0,cursor:void 0,width:void 0,height:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0};var Sr=function(e){let{enableResizing:t,settings:n,children:l,...a}=e;const{deviceType:r,isZoomOutMode:i}=(0,c.useSelect)((e=>({deviceType:e(Ut).__experimentalGetPreviewDeviceType(),isZoomOutMode:"zoom-out"===e(_e.store).__unstableGetEditorMode()})),[]),s=(0,_e.__experimentalUseResizeCanvas)(r),[u,d]=(0,o.useState)(br),[p,g]=(0,o.useState)(wr),h=(0,o.useRef)(),f=(0,_e.__unstableUseMouseMoveTypingReset)(),E=(0,J.useMergeRefs)([h,f]);(0,o.useEffect)((function(){if(!h.current||!t)return;const e=h.current;function n(){g(e.contentDocument.body.scrollHeight)}let l;function a(){var t;null===(t=l)||void 0===t||t.disconnect(),l=new e.contentWindow.ResizeObserver(n),l.observe(e.contentDocument.body),n()}return e.addEventListener("load",a),()=>{var t;null===(t=l)||void 0===t||t.disconnect(),e.removeEventListener("load",a)}}),[t,h.current]);const v=(0,o.useCallback)((e=>{h.current&&d(h.current.offsetWidth+e)}),[]);return(0,o.createElement)(_.ResizableBox,{size:{width:u,height:p},onResizeStop:(e,t,n)=>{d(n.style.width)},minWidth:300,maxWidth:"100%",maxHeight:"100%",enable:{right:t,left:t},showHandle:t,resizeRatio:2,handleComponent:{left:(0,o.createElement)(yr,{direction:"left",resizeWidthBy:v}),right:(0,o.createElement)(yr,{direction:"right",resizeWidthBy:v})},handleClasses:void 0,handleStyles:{left:xr,right:xr}},(0,o.createElement)(_e.__unstableIframe,m({isZoomedOut:i,style:t?{height:p}:s,head:(0,o.createElement)(o.Fragment,null,(0,o.createElement)(_e.__unstableEditorStyles,{styles:n.styles}),(0,o.createElement)("style",null,".is-root-container { display: flow-root; }"),t&&(0,o.createElement)("style",null,"html, body { height: -moz-fit-content !important; height: fit-content !important; min-height: 0 !important; }",".is-root-container { min-height: 0 !important; }")),assets:n.__unstableResolvedAssets,ref:E,name:"editor-canvas",className:"edit-site-visual-editor__editor-canvas"},a),n.svgFilters,l))};const kr={type:"default",alignments:[]};function Cr(e){var t,n;let{setIsInserterOpen:l}=e;const{storedSettings:a,templateType:r,templateId:i,page:s}=(0,c.useSelect)((e=>{const{getSettings:t,getEditedPostType:n,getEditedPostId:a,getPage:r}=e(Ut);return{storedSettings:t(l),templateType:n(),templateId:a(),page:r()}}),[l]),d=null!==(t=a.__experimentalAdditionalBlockPatterns)&&void 0!==t?t:a.__experimentalBlockPatterns,p=null!==(n=a.__experimentalAdditionalBlockPatternCategories)&&void 0!==n?n:a.__experimentalBlockPatternCategories,{restBlockPatterns:_,restBlockPatternCategories:h}=(0,c.useSelect)((e=>({restBlockPatterns:e(u.store).getBlockPatterns(),restBlockPatternCategories:e(u.store).getBlockPatternCategories()})),[]),f=(0,o.useMemo)((()=>[...d||[],..._||[]].filter(((e,t,n)=>t===n.findIndex((t=>e.name===t.name)))).filter((e=>{let{postTypes:t}=e;return!t||Array.isArray(t)&&t.includes(r)}))),[d,_,r]),E=(0,o.useMemo)((()=>[...p||[],...h||[]].filter(((e,t,n)=>t===n.findIndex((t=>e.name===t.name))))),[p,h]),v=(0,o.useMemo)((()=>{const{__experimentalAdditionalBlockPatterns:e,__experimentalAdditionalBlockPatternCategories:t,...n}=a;return{...n,__experimentalBlockPatterns:f,__experimentalBlockPatternCategories:E}}),[a,f,E]),[y,b,w]=(0,u.useEntityBlockEditor)("postType",r),{setPage:x}=(0,c.useDispatch)(Ut),{enableComplementaryArea:S}=(0,c.useDispatch)(O),k=((0,o.useCallback)((()=>{S("core/edit-site","edit-site/navigation-menu")}),[S]),(0,o.useRef)()),C=(0,J.useMergeRefs)([k,(0,_e.__unstableUseTypingObserver)()]),T=(0,J.useViewportMatch)("small","<"),{clearSelectedBlock:N}=(0,c.useDispatch)(_e.store),I="wp_template_part"===r,M=0!==y.length;let P=o.Fragment;return(0,o.createElement)(_e.BlockEditorProvider,{settings:v,value:y,onInput:b,onChange:w,useSubRegistry:!1},(0,o.createElement)(gr,null),(0,o.createElement)(_e.__experimentalLinkControl.ViewerFill,null,(0,o.useCallback)((e=>(0,o.createElement)(hr,m({},e,{activePage:s,onActivePageChange:x}))),[s])),(0,o.createElement)($a,null,(0,o.createElement)(_e.BlockInspector,null)),(0,o.createElement)(_e.BlockTools,{className:g()("edit-site-visual-editor",{"is-focus-mode":I}),__unstableContentRef:k,onClick:e=>{e.target===e.currentTarget&&N()}},(0,o.createElement)(_e.BlockEditorKeyboardShortcuts.Register,null),(0,o.createElement)(vr,null),(0,o.createElement)(Sr,{key:i,enableResizing:I&&!T,settings:v,contentRef:C},(0,o.createElement)(_e.BlockList,{className:"edit-site-block-editor__block-list wp-site-blocks",__experimentalLayout:kr,renderAppender:(!I||!M)&&void 0})),(0,o.createElement)(_e.__unstableBlockSettingsMenuFirstItem,null,(e=>{let{onClose:t}=e;return(0,o.createElement)(fr,{onClick:t})})),(0,o.createElement)(_e.__unstableBlockToolbarLastItem,null,(0,o.createElement)(_e.__unstableBlockNameContext.Consumer,null,(e=>"core/navigation"===e&&(0,o.createElement)(P,null))))),(0,o.createElement)(ur.ReusableBlocksMenuItems,null))}var Tr=n(773);function Nr(e){let{value:t,onChange:n,onInput:l}=e;const[a,r]=(0,o.useState)(t),[i,s]=(0,o.useState)(!1),c=(0,J.useInstanceId)(Nr),u=(0,o.useRef)();i||a===t||r(t);return(0,o.useEffect)((()=>()=>{u.current&&n(u.current)}),[]),(0,o.createElement)(o.Fragment,null,(0,o.createElement)(_.VisuallyHidden,{as:"label",htmlFor:`code-editor-text-area-${c}`},(0,h.__)("Type text or HTML")),(0,o.createElement)(Tr.Z,{autoComplete:"off",dir:"auto",value:a,onChange:e=>{const t=e.target.value;l(t),r(t),s(!0),u.current=t},onBlur:()=>{i&&(n(a),s(!1))},className:"edit-site-code-editor-text-area",id:`code-editor-text-area-${c}`,placeholder:(0,h.__)("Start writing with text or HTML")}))}function Ir(){const{templateType:e,shortcut:t}=(0,c.useSelect)((e=>{const{getEditedPostType:t}=e(Ut),{getShortcutRepresentation:n}=e(jt.store);return{templateType:t(),shortcut:n("core/edit-site/toggle-mode")}}),[]),[n,l]=(0,u.useEntityProp)("postType",e,"content"),[a,,r]=(0,u.useEntityBlockEditor)("postType",e);let s;s=n instanceof Function?n({blocks:a}):a?(0,i.__unstableSerializeAndClean)(a):n;const{switchEditorMode:d}=(0,c.useDispatch)(Ut);return(0,o.createElement)("div",{className:"edit-site-code-editor"},(0,o.createElement)("div",{className:"edit-site-code-editor__toolbar"},(0,o.createElement)("h2",null,(0,h.__)("Editing code")),(0,o.createElement)(_.Button,{variant:"tertiary",onClick:()=>d("visual"),shortcut:t},(0,h.__)("Exit code editor"))),(0,o.createElement)("div",{className:"edit-site-code-editor__body"},(0,o.createElement)(Nr,{value:s,onChange:e=>{r((0,i.parse)(e),{selection:void 0})},onInput:l})))}function Mr(e){let{openEntitiesSavedStates:t}=e;const{__experimentalGetDirtyEntityRecords:n,isSavingEntityRecord:l}=(0,c.useSelect)(u.store),{getEditorMode:a}=(0,c.useSelect)(Ut),r=(0,c.useSelect)((e=>e(Ut).isListViewOpened()),[]),o=(0,c.useSelect)((e=>e(O).getActiveComplementaryArea(Ut.name)===Aa),[]),{redo:i,undo:s}=(0,c.useDispatch)(u.store),{setIsListViewOpened:d,switchEditorMode:m}=(0,c.useDispatch)(Ut),{enableComplementaryArea:p,disableComplementaryArea:g}=(0,c.useDispatch)(O);return(0,jt.useShortcut)("core/edit-site/save",(e=>{e.preventDefault();const a=n(),r=!!a.length;!a.some((e=>l(e.kind,e.name,e.key)))&&r&&t()})),(0,jt.useShortcut)("core/edit-site/undo",(e=>{s(),e.preventDefault()})),(0,jt.useShortcut)("core/edit-site/redo",(e=>{i(),e.preventDefault()})),(0,jt.useShortcut)("core/edit-site/toggle-list-view",(()=>{d(!r)})),(0,jt.useShortcut)("core/edit-site/toggle-block-settings-sidebar",(e=>{e.preventDefault(),o?g(Oe):p(Oe,Aa)})),(0,jt.useShortcut)("core/edit-site/toggle-mode",(()=>{m("visual"===a()?"text":"visual")})),null}Mr.Register=function(){const{registerShortcut:e}=(0,c.useDispatch)(jt.store);return(0,o.useEffect)((()=>{e({name:"core/edit-site/save",category:"global",description:(0,h.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),e({name:"core/edit-site/undo",category:"global",description:(0,h.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/edit-site/redo",category:"global",description:(0,h.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"}}),e({name:"core/edit-site/toggle-list-view",category:"global",description:(0,h.__)("Open the block list view."),keyCombination:{modifier:"access",character:"o"}}),e({name:"core/edit-site/toggle-block-settings-sidebar",category:"global",description:(0,h.__)("Show or hide the block settings sidebar."),keyCombination:{modifier:"primaryShift",character:","}}),e({name:"core/edit-site/keyboard-shortcuts",category:"main",description:(0,h.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),e({name:"core/edit-site/next-region",category:"global",description:(0,h.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),e({name:"core/edit-site/previous-region",category:"global",description:(0,h.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"}]}),e({name:"core/edit-site/toggle-mode",category:"global",description:(0,h.__)("Switch between visual editor and code editor."),keyCombination:{modifier:"secondary",character:"m"}})}),[e]),null};var Pr=Mr;function zr(){const{setTemplate:e,setTemplatePart:t,setPage:n}=(0,c.useDispatch)(Ut),{params:{postId:l,postType:a}}=Me();return(0,o.useEffect)((()=>{"page"===a||"post"===a?n({context:{postType:a,postId:l}}):"wp_template"===a?e(l):"wp_template_part"===a&&t(l)}),[l,a]),null}var Vr=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.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"}));function Br(){const{setIsInserterOpened:e}=(0,c.useDispatch)(Ut),t=(0,c.useSelect)((e=>e(Ut).__experimentalGetInsertionPoint()),[]),n=(0,J.useViewportMatch)("medium","<"),l=n?"div":_.VisuallyHidden,[a,r]=(0,J.__experimentalUseDialog)({onClose:()=>e(!1),focusOnMount:null}),i=(0,o.useRef)();return(0,o.useEffect)((()=>{i.current.focusSearch()}),[]),(0,o.createElement)("div",m({ref:a},r,{className:"edit-site-editor__inserter-panel"}),(0,o.createElement)(l,{className:"edit-site-editor__inserter-panel-header"},(0,o.createElement)(_.Button,{icon:Vr,label:(0,h.__)("Close block inserter"),onClick:()=>e(!1)})),(0,o.createElement)("div",{className:"edit-site-editor__inserter-panel-content"},(0,o.createElement)(_e.__experimentalLibrary,{showInserterHelpPanel:!0,shouldFocusBlock:n,rootClientId:t.rootClientId,__experimentalInsertionIndex:t.insertionIndex,__experimentalFilterValue:t.filterValue,ref:i})))}function Ar(){const{setIsListViewOpened:e}=(0,c.useDispatch)(Ut),t=(0,J.useFocusOnMount)("firstElement"),n=(0,J.useFocusReturn)(),l=(0,J.useFocusReturn)();const a=`edit-site-editor__list-view-panel-label-${(0,J.useInstanceId)(Ar)}`;return(0,o.createElement)("div",{"aria-labelledby":a,className:"edit-site-editor__list-view-panel",onKeyDown:function(t){t.keyCode!==Kt.ESCAPE||t.defaultPrevented||e(!1)}},(0,o.createElement)("div",{className:"edit-site-editor__list-view-panel-header",ref:n},(0,o.createElement)("strong",{id:a},(0,h.__)("List View")),(0,o.createElement)(_.Button,{icon:w,label:(0,h.__)("Close List View Sidebar"),onClick:()=>e(!1)})),(0,o.createElement)("div",{className:"edit-site-editor__list-view-panel-content",ref:(0,J.useMergeRefs)([l,t])},(0,o.createElement)(_e.__experimentalListView,null)))}function Rr(e){let{text:t,children:n}=e;const l=(0,J.useCopyToClipboard)(t);return(0,o.createElement)(_.Button,{variant:"secondary",ref:l},n)}function Lr(e){let{message:t,error:n,reboot:l,dashboardLink:a}=e;const r=[];return l&&r.push((0,o.createElement)(_.Button,{key:"recovery",onClick:l,variant:"secondary"},(0,h.__)("Attempt Recovery"))),n&&r.push((0,o.createElement)(Rr,{key:"copy-error",text:n.stack},(0,h.__)("Copy Error"))),a&&r.push((0,o.createElement)(_.Button,{key:"back-to-dashboard",variant:"secondary",href:a},(0,h.__)("Back to dashboard"))),(0,o.createElement)(_e.Warning,{className:"editor-error-boundary",actions:r},t)}class Or extends o.Component{constructor(){super(...arguments),this.reboot=this.reboot.bind(this),this.state={error:null}}componentDidCatch(e){(0,me.doAction)("editor.ErrorBoundary.errorLogged",e)}static getDerivedStateFromError(e){return{error:e}}reboot(){this.props.onError()}render(){const{error:e}=this.state;return e?(0,o.createElement)(Lr,{message:(0,h.__)("The editor has encountered an unexpected error."),error:e,reboot:this.reboot}):this.props.children}}function Dr(e){let{nonAnimatedSrc:t,animatedSrc:n}=e;return(0,o.createElement)("picture",{className:"edit-site-welcome-guide__image"},(0,o.createElement)("source",{srcSet:t,media:"(prefers-reduced-motion: reduce)"}),(0,o.createElement)("img",{src:n,width:"312",height:"240",alt:""}))}function Gr(){const{toggle:e}=(0,c.useDispatch)(k.store);return(0,c.useSelect)((e=>!!e(k.store).get("core/edit-site","welcomeGuide")),[])?(0,o.createElement)(_.Guide,{className:"edit-site-welcome-guide",contentLabel:(0,h.__)("Welcome to the site editor"),finishButtonText:(0,h.__)("Get Started"),onFinish:()=>e("core/edit-site","welcomeGuide"),pages:[{image:(0,o.createElement)(Dr,{nonAnimatedSrc:"https://s.w.org/images/block-editor/edit-your-site.svg?1",animatedSrc:"https://s.w.org/images/block-editor/edit-your-site.gif?1"}),content:(0,o.createElement)(o.Fragment,null,(0,o.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,h.__)("Edit your site")),(0,o.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,h.__)("Design everything on your site — from the header right down to the footer — using blocks.")),(0,o.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,o.createInterpolateElement)((0,h.__)("Click to start designing your blocks, and choose your typography, layout, and colors."),{StylesIconImage:(0,o.createElement)("img",{alt:(0,h.__)("styles"),src:"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z' fill='%231E1E1E'/%3E%3C/svg%3E%0A"})})))}]}):null}function Fr(){const{toggle:e}=(0,c.useDispatch)(k.store),{isActive:t,isStylesOpen:n}=(0,c.useSelect)((e=>{const t=e(O).getActiveComplementaryArea(Ut.name);return{isActive:!!e(k.store).get("core/edit-site","welcomeGuideStyles"),isStylesOpen:"edit-site/global-styles"===t}}),[]);return t&&n?(0,o.createElement)(_.Guide,{className:"edit-site-welcome-guide",contentLabel:(0,h.__)("Welcome to styles"),finishButtonText:(0,h.__)("Get Started"),onFinish:()=>e("core/edit-site","welcomeGuideStyles"),pages:[{image:(0,o.createElement)(Dr,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-to-styles.svg?1",animatedSrc:"https://s.w.org/images/block-editor/welcome-to-styles.gif?1"}),content:(0,o.createElement)(o.Fragment,null,(0,o.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,h.__)("Welcome to Styles")),(0,o.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,h.__)("Tweak your site, or give it a whole new look! Get creative — how about a new color palette for your buttons, or choosing a new font? Take a look at what you can do here.")))},{image:(0,o.createElement)(Dr,{nonAnimatedSrc:"https://s.w.org/images/block-editor/set-the-design.svg?1",animatedSrc:"https://s.w.org/images/block-editor/set-the-design.gif?1"}),content:(0,o.createElement)(o.Fragment,null,(0,o.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,h.__)("Set the design")),(0,o.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,h.__)("You can customize your site as much as you like with different colors, typography, and layouts. Or if you prefer, just leave it up to your theme to handle! ")))},{image:(0,o.createElement)(Dr,{nonAnimatedSrc:"https://s.w.org/images/block-editor/personalize-blocks.svg?1",animatedSrc:"https://s.w.org/images/block-editor/personalize-blocks.gif?1"}),content:(0,o.createElement)(o.Fragment,null,(0,o.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,h.__)("Personalize blocks")),(0,o.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,h.__)("You can adjust your blocks to ensure a cohesive experience across your site — add your unique colors to a branded Button block, or adjust the Heading block to your preferred size.")))},{image:(0,o.createElement)(Dr,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.gif"}),content:(0,o.createElement)(o.Fragment,null,(0,o.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,h.__)("Learn more")),(0,o.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,h.__)("New to block themes and styling your site? "),(0,o.createElement)(_.ExternalLink,{href:(0,h.__)("https://wordpress.org/support/article/styles-overview/")},(0,h.__)("Here’s a detailed guide to learn how to make the most of it."))))}]}):null}function Hr(){return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Gr,null),(0,o.createElement)(Fr,null))}function $r(){return function(){const[e,t,n]=$l(),{getSettings:l}=(0,c.useSelect)(Ut),{updateSettings:a}=(0,c.useDispatch)(Ut);(0,o.useEffect)((()=>{if(!e||!t)return;const r=l(),o=(0,Et.filter)(r.styles,(e=>!e.isGlobalStyles));a({...r,styles:[...o,...e],svgFilters:n,__experimentalFeatures:t})}),[e,t])}(),null}function Ur(e){const t=Me(),n=(0,c.useSelect)((e=>{var t;return null===(t=e(u.store).getEntityRecord("root","site"))||void 0===t?void 0:t.title}),[]),l=(0,o.useRef)(!0);(0,o.useEffect)((()=>{l.current=!1}),[t]),(0,o.useEffect)((()=>{if(!l.current&&e&&n){const t=(0,h.sprintf)((0,h.__)("%1$s ‹ %2$s — WordPress"),(0,ja.decodeEntities)(e),(0,ja.decodeEntities)(n));document.title=t,(0,Qe.speak)((0,h.sprintf)((0,h.__)("Now displaying: %s"),document.title),"assertive")}}),[e,n,t])}const jr={header:(0,h.__)("Editor top bar"),body:(0,h.__)("Editor content"),sidebar:(0,h.__)("Editor settings"),actions:(0,h.__)("Editor publish"),footer:(0,h.__)("Editor footer"),drawer:(0,h.__)("Navigation Sidebar")};var Wr=function(e){let{onError:t}=e;const{isInserterOpen:n,isListViewOpen:l,sidebarIsOpened:a,settings:r,entityId:i,templateType:s,page:m,template:p,templateResolved:g,isNavigationOpen:f,previousShortcut:E,nextShortcut:v,editorMode:y,showIconLabels:b,blockEditorMode:w}=(0,c.useSelect)((e=>{const{isInserterOpened:t,isListViewOpened:n,getSettings:l,getEditedPostType:a,getEditedPostId:r,getPage:o,isNavigationOpened:i,getEditorMode:s}=e(Ut),{hasFinishedResolution:c,getEntityRecord:d}=e(u.store),{__unstableGetEditorMode:m}=e(_e.store),p=a(),g=r();return{isInserterOpen:t(),isListViewOpen:n(),sidebarIsOpened:!!e(O).getActiveComplementaryArea(Ut.name),settings:l(),templateType:p,page:o(),template:g?d("postType",p,g):null,templateResolved:!!g&&c("getEntityRecord",["postType",p,g]),entityId:g,isNavigationOpen:i(),previousShortcut:e(jt.store).getAllShortcutKeyCombinations("core/edit-site/previous-region"),nextShortcut:e(jt.store).getAllShortcutKeyCombinations("core/edit-site/next-region"),editorMode:s(),showIconLabels:e(k.store).get("core/edit-site","showIconLabels"),blockEditorMode:m()}}),[]),{setPage:x,setIsInserterOpened:S}=(0,c.useDispatch)(Ut),{enableComplementaryArea:C}=(0,c.useDispatch)(O),[T,N]=(0,o.useState)(!1),I=(0,o.useCallback)((()=>N(!0)),[]),M=(0,o.useCallback)((()=>{N(!1)}),[]),P=(0,o.useMemo)((()=>({...null==m?void 0:m.context,queryContext:[(null==m?void 0:m.context.queryContext)||{page:1},e=>x({...m,context:{...null==m?void 0:m.context,queryContext:{...null==m?void 0:m.context.queryContext,...e}}})]})),[null==m?void 0:m.context]);(0,o.useEffect)((()=>{f?document.body.classList.add("is-navigation-sidebar-open"):document.body.classList.remove("is-navigation-sidebar-open")}),[f]),(0,o.useEffect)((function(){"open"===new URLSearchParams(window.location.search).get("styles")&&C("core/edit-site","edit-site/global-styles")}),[C]);const z=(null==r?void 0:r.siteUrl)&&void 0!==s&&void 0!==i,V=l?(0,h.__)("List View"):(0,h.__)("Block Library");return Ur(z&&(0,h.__)("Editor (beta)")),(0,o.createElement)(o.Fragment,null,(0,o.createElement)(zr,null),z&&(0,o.createElement)(jt.ShortcutProvider,null,(0,o.createElement)(u.EntityProvider,{kind:"root",type:"site"},(0,o.createElement)(u.EntityProvider,{kind:"postType",type:s,id:i},(0,o.createElement)(Ta,null,(0,o.createElement)(_e.BlockContextProvider,{value:P},(0,o.createElement)($r,null),(0,o.createElement)(Or,{onError:t},(0,o.createElement)(Pr.Register,null),(0,o.createElement)(Ua,null),(0,o.createElement)(ee,{labels:{...jr,secondarySidebar:V},className:b&&"show-icon-labels",secondarySidebar:"visual"===y&&n?(0,o.createElement)(Br,null):"visual"===y&&l?(0,o.createElement)(Ar,null):null,sidebar:a&&(0,o.createElement)(Q.Slot,{scope:"core/edit-site"}),drawer:(0,o.createElement)(cr.Slot,null),header:(0,o.createElement)(An,{openEntitiesSavedStates:I,showIconLabels:b}),notices:(0,o.createElement)(d.EditorSnackbars,null),content:(0,o.createElement)(o.Fragment,null,(0,o.createElement)(d.EditorNotices,null),(0,o.createElement)(_e.BlockStyles.Slot,{scope:"core/block-inspector"}),"visual"===y&&p&&(0,o.createElement)(Cr,{setIsInserterOpen:S}),"text"===y&&p&&(0,o.createElement)(Ir,null),g&&!p&&(null==r?void 0:r.siteUrl)&&i&&(0,o.createElement)(_.Notice,{status:"warning",isDismissible:!1},(0,h.__)("You attempted to edit an item that doesn't exist. Perhaps it was deleted?")),(0,o.createElement)(Pr,{openEntitiesSavedStates:I})),actions:(0,o.createElement)(o.Fragment,null,T?(0,o.createElement)(d.EntitiesSavedStates,{close:M}):(0,o.createElement)("div",{className:"edit-site-editor__toggle-save-panel"},(0,o.createElement)(_.Button,{variant:"secondary",className:"edit-site-editor__toggle-save-panel-button",onClick:I,"aria-expanded":!1},(0,h.__)("Open save panel")))),footer:"zoom-out"!==w?(0,o.createElement)(_e.BlockBreadcrumb,{rootLabelText:(0,h.__)("Template")}):void 0,shortcuts:{previous:E,next:v}}),(0,o.createElement)(Hr,null),(0,o.createElement)(_.Popover.Slot,null))))))))};var Yr=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"}));var qr=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"}));var Xr=(0,o.createElement)(f.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(f.Path,{d:"M19 6.2h-5.9l-.6-1.1c-.3-.7-1-1.1-1.8-1.1H5c-1.1 0-2 .9-2 2v11.8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8.2c0-1.1-.9-2-2-2zm.5 11.6c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h5.8c.2 0 .4.1.4.3l1 2H19c.3 0 .5.2.5.5v9.5zM8 12.8h8v-1.5H8v1.5zm0 3h8v-1.5H8v1.5z"}));var Kr=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"}));var Zr=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M19 5H5c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm.5 12c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v10zm-11-7.6h-.7l-3.1 4.3h2.8V15h1v-1.3h.7v-.8h-.7V9.4zm-.9 3.5H6.3l1.2-1.7v1.7zm5.6-3.2c-.4-.2-.8-.4-1.2-.4-.5 0-.9.1-1.2.4-.4.2-.6.6-.8 1-.2.4-.3.9-.3 1.5s.1 1.1.3 1.6c.2.4.5.8.8 1 .4.2.8.4 1.2.4.5 0 .9-.1 1.2-.4.4-.2.6-.6.8-1 .2-.4.3-1 .3-1.6 0-.6-.1-1.1-.3-1.5-.1-.5-.4-.8-.8-1zm0 3.6c-.1.3-.3.5-.5.7-.2.1-.4.2-.7.2-.3 0-.5-.1-.7-.2-.2-.1-.4-.4-.5-.7-.1-.3-.2-.7-.2-1.2 0-.7.1-1.2.4-1.5.3-.3.6-.5 1-.5s.7.2 1 .5c.3.3.4.8.4 1.5-.1.5-.1.9-.2 1.2zm5-3.9h-.7l-3.1 4.3h2.8V15h1v-1.3h.7v-.8h-.7V9.4zm-1 3.5H16l1.2-1.7v1.7z"}));var Qr=(0,o.createElement)(f.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(f.Path,{d:"M4 4v1.5h16V4H4zm8 8.5h8V11h-8v1.5zM4 20h16v-1.5H4V20zm4-8c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2z"}));var Jr=(0,o.createElement)(f.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(f.Path,{d:"M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z",fillRule:"evenodd",clipRule:"evenodd"}));var eo=(0,o.createElement)(f.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(f.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"}));var to=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{fillRule:"evenodd",d:"M8.95 11.25H4v1.5h4.95v4.5H13V18c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2h-3c-1.1 0-2 .9-2 2v.75h-2.55v-7.5H13V9c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3c-1.1 0-2 .9-2 2v.75H8.95v4.5ZM14.5 15v3c0 .3.2.5.5.5h3c.3 0 .5-.2.5-.5v-3c0-.3-.2-.5-.5-.5h-3c-.3 0-.5.2-.5.5Zm0-6V6c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3c0 .3-.2.5-.5.5h-3c-.3 0-.5-.2-.5-.5Z",clipRule:"evenodd"}));var no=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M11.696 13.972c.356-.546.599-.958.728-1.235a1.79 1.79 0 00.203-.783c0-.264-.077-.47-.23-.618-.148-.153-.354-.23-.618-.23-.295 0-.569.07-.82.212a3.413 3.413 0 00-.738.571l-.147-1.188c.289-.234.59-.41.903-.526.313-.117.66-.175 1.041-.175.375 0 .695.08.959.24.264.153.46.362.59.626.135.265.203.556.203.876 0 .362-.08.734-.24 1.115-.154.381-.427.87-.82 1.466l-.756 1.152H14v1.106h-4l1.696-2.609z"}),(0,o.createElement)(f.Path,{d:"M19.5 7h-15v12a.5.5 0 00.5.5h14a.5.5 0 00.5-.5V7zM3 7V5a2 2 0 012-2h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V7z"}));var lo=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M20.1 11.2l-6.7-6.7c-.1-.1-.3-.2-.5-.2H5c-.4-.1-.8.3-.8.7v7.8c0 .2.1.4.2.5l6.7 6.7c.2.2.5.4.7.5s.6.2.9.2c.3 0 .6-.1.9-.2.3-.1.5-.3.8-.5l5.6-5.6c.4-.4.7-1 .7-1.6.1-.6-.2-1.2-.6-1.6zM19 13.4L13.4 19c-.1.1-.2.1-.3.2-.2.1-.4.1-.6 0-.1 0-.2-.1-.3-.2l-6.5-6.5V5.8h6.8l6.5 6.5c.2.2.2.4.2.6 0 .1 0 .3-.2.5zM9 8c-.6 0-1 .4-1 1s.4 1 1 1 1-.4 1-1-.4-1-1-1z"}));const ao=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"}));const ro=()=>(0,c.useSelect)((e=>e(u.store).getEntityRecords("postType","wp_template",{per_page:-1})),[]),oo=()=>(0,c.useSelect)((e=>e(d.store).__experimentalGetDefaultTemplateTypes()),[]),io=()=>{const e=(0,c.useSelect)((e=>e(u.store).getPostTypes({per_page:-1})),[]);return(0,o.useMemo)((()=>{const t=["attachment"];return null==e?void 0:e.filter((e=>{let{viewable:n,slug:l}=e;return n&&!t.includes(l)}))}),[e])};function so(e){const t=(0,o.useMemo)((()=>null==e?void 0:e.reduce(((e,t)=>{let{labels:n}=t;const l=n.singular_name.toLowerCase();return e[l]=(e[l]||0)+1,e}),{})));return(0,o.useCallback)((e=>{let{labels:n,slug:l}=e;const a=n.singular_name.toLowerCase();return t[a]>1&&a!==l}),[t])}function co(){const e=io(),t=(0,o.useMemo)((()=>null==e?void 0:e.filter((e=>e.has_archive))),[e]),n=ro(),l=so(t);return(0,o.useMemo)((()=>(null==t?void 0:t.filter((e=>!(n||[]).some((t=>t.slug==="archive-"+e.slug)))).map((e=>{var t;let n;return n=l(e)?(0,h.sprintf)((0,h.__)("Archive: %1$s (%2$s)"),e.labels.singular_name,e.slug):(0,h.sprintf)((0,h.__)("Archive: %s"),e.labels.singular_name),{slug:"archive-"+e.slug,description:(0,h.sprintf)((0,h.__)("Displays an archive with the latests posts of type: %s."),e.labels.singular_name),title:n,icon:null!==(t=e.icon)&&void 0!==t&&t.startsWith("dashicons-")?e.icon.slice(10):Xr,templatePrefix:"archive"}})))||[]),[t,n,l])}const uo=e=>{const t=(()=>{const e=(0,c.useSelect)((e=>e(u.store).getTaxonomies({per_page:-1})),[]);return(0,o.useMemo)((()=>null==e?void 0:e.filter((e=>{let{visibility:t}=e;return null==t?void 0:t.publicly_queryable}))),[e])})(),n=ro(),l=oo(),a=(0,o.useMemo)((()=>null==t?void 0:t.reduce(((e,t)=>{let{slug:n}=t,l=n;return["category","post_tag"].includes(n)||(l=`taxonomy-${l}`),"post_tag"===n&&(l="tag"),e[n]=l,e}),{})),[t]),r=null==t?void 0:t.reduce(((e,t)=>{let{labels:n}=t;const l=n.singular_name.toLowerCase();return e[l]=(e[l]||0)+1,e}),{}),i=ho("taxonomy",a),s=(n||[]).map((e=>{let{slug:t}=e;return t})),d=(t||[]).reduce(((t,n)=>{var o;const{slug:c,labels:u}=n,d=a[c],m=null==l?void 0:l.find((e=>{let{slug:t}=e;return t===d})),p=null==s?void 0:s.includes(d),g=((e,t)=>{if(["category","post_tag"].includes(t))return!1;const n=e.singular_name.toLowerCase();return r[n]>1&&n!==t})(u,c);let _=u.singular_name;g&&(_=(0,h.sprintf)((0,h.__)("%1$s (%2$s)"),u.singular_name,c));const f=m?{...m,templatePrefix:a[c]}:{slug:d,title:_,description:(0,h.sprintf)((0,h.__)("Displays taxonomy: %s."),u.singular_name),icon:to,templatePrefix:a[c]},E=null==i||null===(o=i[c])||void 0===o?void 0:o.hasEntities;return E&&(f.onClick=t=>{e({type:"taxonomy",slug:c,config:{queryArgs:e=>{let{search:t}=e;return{_fields:"id,name,slug,link",orderBy:t?"name":"count",exclude:i[c].existingEntitiesIds}},getSpecificTemplate:e=>{const t=`${a[c]}-${e.slug}`;return{title:t,slug:t,templatePrefix:a[c]}}},labels:u,hasGeneralTemplate:p,template:t})}),p&&!E||t.push(f),t}),[]);return(0,o.useMemo)((()=>d.reduce(((e,t)=>{const{slug:n}=t;let l="taxonomiesMenuItems";return["category","tag"].includes(n)&&(l="defaultTaxonomiesMenuItems"),e[l].push(t),e}),{defaultTaxonomiesMenuItems:[],taxonomiesMenuItems:[]})),[d])},mo={user:"author"},po={user:{who:"authors"}};const go=e=>{const t=ro();return(0,o.useMemo)((()=>Object.entries(e||{}).reduce(((e,n)=>{let[l,a]=n;const r=(t||[]).reduce(((e,t)=>{const n=`${a}-`;return t.slug.startsWith(n)&&e.push(t.slug.substring(n.length)),e}),[]);return r.length&&(e[l]=r),e}),{})),[e,t])},_o=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const l=go(t),a=(0,c.useSelect)((t=>Object.entries(l||{}).reduce(((l,a)=>{let[r,o]=a;const i=t(u.store).getEntityRecords(e,r,{_fields:"id",context:"view",slug:o,...n[r]});return null!=i&&i.length&&(l[r]=i),l}),{})),[l]);return a},ho=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const l=_o(e,t,n),a=(0,c.useSelect)((a=>Object.keys(t||{}).reduce(((t,r)=>{var o,i;const s=(null==l||null===(o=l[r])||void 0===o?void 0:o.map((e=>{let{id:t}=e;return t})))||[];return t[r]={hasEntities:!(null===(i=a(u.store).getEntityRecords(e,r,{per_page:1,_fields:"id",context:"view",exclude:s,...n[r]}))||void 0===i||!i.length),existingEntitiesIds:s},t}),{})),[t,l]);return a},fo=[];function Eo(e){let{suggestion:t,search:n,onSelect:l,entityForSuggestions:a,composite:r}=e;const i="edit-site-custom-template-modal__suggestions_list__list-item";return(0,o.createElement)(_.__unstableCompositeItem,m({role:"option",as:_.Button},r,{className:i,onClick:()=>l(a.config.getSpecificTemplate(t))}),(0,o.createElement)("span",{className:`${i}__title`},(0,o.createElement)(_.TextHighlight,{text:t.name,highlight:n})),t.link&&(0,o.createElement)("span",{className:`${i}__info`},t.link))}function vo(e,t){const{config:n}=e,l=(0,o.useMemo)((()=>({order:"asc",context:"view",search:t,per_page:t?20:10,...n.queryArgs(t)})),[t,n]),{records:a,hasResolved:r}=(0,u.useEntityRecords)(e.type,e.slug,l),[i,s]=(0,o.useState)(fo);return(0,o.useEffect)((()=>{if(!r)return;let e=fo;var t,l;null!=a&&a.length&&(e=a,n.recordNamePath&&(t=e,l=n.recordNamePath,e=(t||[]).map((e=>({...e,name:(0,ja.decodeEntities)((0,Et.get)(e,l))}))))),s(e)}),[a,r]),i}function yo(e){let{entityForSuggestions:t,onSelect:n}=e;const l=(0,_.__unstableUseCompositeState)({orientation:"vertical"}),[a,r,i]=function(){const[e,t]=(0,o.useState)(""),[n,l]=(0,o.useState)(""),a=(0,J.useDebounce)(l,250);return(0,o.useEffect)((()=>{n!==e&&a(e)}),[n,e]),[e,t,n]}(),s=vo(t,i),{labels:c}=t,[u,d]=(0,o.useState)(!1);return!u&&(null==s?void 0:s.length)>9&&d(!0),(0,o.createElement)(o.Fragment,null,u&&(0,o.createElement)(_.SearchControl,{onChange:r,value:a,label:c.search_items,placeholder:c.search_items}),!(null==s||!s.length)&&(0,o.createElement)(_.__unstableComposite,m({},l,{role:"listbox",className:"edit-site-custom-template-modal__suggestions_list","aria-label":(0,h.__)("Suggestions list")}),s.map((e=>(0,o.createElement)(Eo,{key:e.slug,suggestion:e,search:i,onSelect:n,entityForSuggestions:t,composite:l})))),i&&!(null!=s&&s.length)&&(0,o.createElement)("p",{className:"edit-site-custom-template-modal__no-results"},c.not_found))}var bo=function(e){let{onClose:t,onSelect:n,entityForSuggestions:l}=e;const[a,r]=(0,o.useState)(l.hasGeneralTemplate),i="edit-site-custom-template-modal";return(0,o.createElement)(_.Modal,{title:(0,h.sprintf)((0,h.__)("Add template: %s"),l.labels.singular_name),className:i,closeLabel:(0,h.__)("Close"),onRequestClose:t},!a&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("p",null,(0,h.__)("Select whether to create a single template for all items or a specific one.")),(0,o.createElement)(_.Flex,{className:`${i}__contents`,gap:"4",align:"initial"},(0,o.createElement)(_.FlexItem,{isBlock:!0,as:_.Button,onClick:()=>{const{slug:e,title:t,description:a,templatePrefix:r}=l.template;n({slug:e,title:t,description:a,templatePrefix:r})}},(0,o.createElement)(_.__experimentalText,{as:"span",weight:600},l.labels.all_items),(0,o.createElement)(_.__experimentalText,{as:"span"},(0,h.__)("For all items"))),(0,o.createElement)(_.FlexItem,{isBlock:!0,as:_.Button,onClick:()=>{r(!0)}},(0,o.createElement)(_.__experimentalText,{as:"span",weight:600},l.labels.singular_name),(0,o.createElement)(_.__experimentalText,{as:"span"},(0,h.__)("For a specific item"))))),a&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("p",null,(0,h.__)("This template will be used only for the specific item chosen.")),(0,o.createElement)(yo,{entityForSuggestions:l,onSelect:n})))};var wo=function(e){let{onClose:t,createTemplate:n}=e;const[l,a]=(0,o.useState)(""),r=(0,h.__)("Custom Template"),[i,s]=(0,o.useState)(!1);return(0,o.createElement)(_.Modal,{title:(0,h.__)("Create custom template"),closeLabel:(0,h.__)("Close"),onRequestClose:()=>{t()},overlayClassName:"edit-site-custom-generic-template__modal"},(0,o.createElement)("form",{onSubmit:async function(e){e.preventDefault(),i||(s(!0),n({slug:"wp-custom-template-"+(0,Et.kebabCase)(l||r),title:l||r},!1))}},(0,o.createElement)(_.Flex,{align:"flex-start",gap:8},(0,o.createElement)(_.FlexItem,null,(0,o.createElement)(_.TextControl,{label:(0,h.__)("Name"),value:l,onChange:a,placeholder:r,disabled:i,help:(0,h.__)('Describe the template, e.g. "Post with sidebar".')}))),(0,o.createElement)(_.Flex,{className:"edit-site-custom-generic-template__modal-actions",justify:"flex-end",expanded:!1},(0,o.createElement)(_.FlexItem,null,(0,o.createElement)(_.Button,{variant:"tertiary",onClick:()=>{t()}},(0,h.__)("Cancel"))),(0,o.createElement)(_.FlexItem,null,(0,o.createElement)(_.Button,{variant:"primary",type:"submit",isBusy:i,"aria-disabled":i},(0,h.__)("Create"))))))};const xo=["front-page","single","page","index","archive","author","category","date","tag","taxonomy","search","404"],So={"front-page":Wa,single:Yr,page:qr,archive:Xr,search:Kr,404:Zr,index:Qr,category:Jr,author:eo,taxonomy:to,date:no,tag:lo,attachment:ao};function ko(e){let{postType:t}=e;const[n,l]=(0,o.useState)(!1),[a,r]=(0,o.useState)(!1),[i,s]=(0,o.useState)({}),d=Pe(),{saveEntityRecord:m}=(0,c.useDispatch)(u.store),{createErrorNotice:p,createSuccessNotice:g}=(0,c.useDispatch)(Ze.store),{setTemplate:f}=(0,c.useDispatch)(Ut);async function E(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{const{title:n,description:l,slug:a,templatePrefix:r}=e;let o=e.content;if(!o){o=(await Ke()({path:(0,de.addQueryArgs)("/wp/v2/templates/lookup",{slug:a,is_custom:!t,template_prefix:r})})).content.raw}const i=await m("postType","wp_template",{description:l,slug:a.toString(),status:"publish",title:n,content:o,is_wp_suggestion:t},{throwOnError:!0});f(i.id,i.slug),d.push({postId:i.id,postType:i.type}),g((0,h.sprintf)((0,h.__)('"%s" successfully created.'),n),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,h.__)("An error occurred while creating the template.");p(t,{type:"snackbar"})}}const v=function(e,t){const n=ro(),l=oo(),a=(n||[]).map((e=>{let{slug:t}=e;return t})),r=(l||[]).filter((e=>xo.includes(e.slug)&&!a.includes(e.slug))),i=n=>{t(!0),e(n)},s=[...r],{defaultTaxonomiesMenuItems:c,taxonomiesMenuItems:u}=uo(i),{defaultPostTypesMenuItems:d,postTypesMenuItems:m}=(e=>{const t=io(),n=ro(),l=oo(),a=so(t),r=(0,o.useMemo)((()=>null==t?void 0:t.reduce(((e,t)=>{let{slug:n}=t,l=n;return"page"!==n&&(l=`single-${l}`),e[n]=l,e}),{})),[t]),i=ho("postType",r),s=(n||[]).map((e=>{let{slug:t}=e;return t})),c=(t||[]).reduce(((t,n)=>{var o;const{slug:c,labels:u,icon:d}=n,m=r[c],p=null==l?void 0:l.find((e=>{let{slug:t}=e;return t===m})),g=null==s?void 0:s.includes(m),_=a(n);let f=(0,h.sprintf)((0,h.__)("Single item: %s"),u.singular_name);_&&(f=(0,h.sprintf)((0,h.__)("Single item: %1$s (%2$s)"),u.singular_name,c));const E=p?{...p,templatePrefix:r[c]}:{slug:m,title:f,description:(0,h.sprintf)((0,h.__)("Displays a single item: %s."),u.singular_name),icon:null!=d&&d.startsWith("dashicons-")?d.slice(10):Yr,templatePrefix:r[c]},v=null==i||null===(o=i[c])||void 0===o?void 0:o.hasEntities;return v&&(E.onClick=t=>{e({type:"postType",slug:c,config:{recordNamePath:"title.rendered",queryArgs:e=>{let{search:t}=e;return{_fields:"id,title,slug,link",orderBy:t?"relevance":"modified",exclude:i[c].existingEntitiesIds}},getSpecificTemplate:e=>{const t=`${r[c]}-${e.slug}`;return{title:t,slug:t,templatePrefix:r[c]}}},labels:u,hasGeneralTemplate:g,template:t})}),g&&!v||t.push(E),t}),[]);return(0,o.useMemo)((()=>c.reduce(((e,t)=>{const{slug:n}=t;let l="postTypesMenuItems";return"page"===n&&(l="defaultPostTypesMenuItems"),e[l].push(t),e}),{defaultPostTypesMenuItems:[],postTypesMenuItems:[]})),[c])})(i),p=function(e){var t,n;const l=ro(),a=oo(),r=ho("root",mo,po);let o=null==a?void 0:a.find((e=>{let{slug:t}=e;return"author"===t}));o||(o={description:(0,h.__)("Displays latest posts written by a single author."),slug:"author",title:"Author"});const i=!(null==l||!l.find((e=>{let{slug:t}=e;return"author"===t})));if(null!==(t=r.user)&&void 0!==t&&t.hasEntities&&(o={...o,templatePrefix:"author"},o.onClick=t=>{e({type:"root",slug:"user",config:{queryArgs:e=>{let{search:t}=e;return{_fields:"id,name,slug,link",orderBy:t?"name":"registered_date",exclude:r.user.existingEntitiesIds,who:"authors"}},getSpecificTemplate:e=>{const t=`author-${e.slug}`;return{title:t,slug:t,templatePrefix:"author"}}},labels:{singular_name:(0,h.__)("Author"),search_items:(0,h.__)("Search Authors"),not_found:(0,h.__)("No authors found."),all_items:(0,h.__)("All Authors")},hasGeneralTemplate:i,template:t})}),!i||null!==(n=r.user)&&void 0!==n&&n.hasEntities)return o}(i);[...c,...d,p].forEach((e=>{if(!e)return;const t=s.findIndex((t=>t.slug===e.slug));t>-1?s[t]=e:s.push(e)})),null==s||s.sort(((e,t)=>xo.indexOf(e.slug)-xo.indexOf(t.slug)));return[...s,...co(),...m,...u]}(s,l);return v.length?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(_.DropdownMenu,{className:"edit-site-new-template-dropdown",icon:null,text:t.labels.add_new,label:t.labels.add_new_item,popoverProps:{noArrow:!1},toggleProps:{variant:"primary"}},(()=>(0,o.createElement)(_.NavigableMenu,{className:"edit-site-new-template-dropdown__popover"},(0,o.createElement)(_.MenuGroup,{label:t.labels.add_new_item},v.map((e=>{const{title:t,description:n,slug:l,onClick:a,icon:r}=e;return(0,o.createElement)(_.MenuItem,{icon:r||So[l]||Yr,iconPosition:"left",info:n,key:l,onClick:()=>a?a(e):E(e)},t)}))),(0,o.createElement)(_.MenuGroup,null,(0,o.createElement)(_.MenuItem,{icon:Un,iconPosition:"left",info:(0,h.__)("Custom templates can be applied to any post or page."),key:"custom-template",onClick:()=>r(!0)},(0,h.__)("Custom template")))))),n&&(0,o.createElement)(bo,{onClose:()=>l(!1),onSelect:E,entityForSuggestions:i}),a&&(0,o.createElement)(wo,{onClose:()=>r(!1),createTemplate:E})):null}function Co(e){let{postType:t}=e;const n=Pe(),[l,a]=(0,o.useState)(!1),{createErrorNotice:r}=(0,c.useDispatch)(Ze.store),{saveEntityRecord:i}=(0,c.useDispatch)(u.store);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(_.Button,{variant:"primary",onClick:()=>{a(!0)}},t.labels.add_new),l&&(0,o.createElement)(mr,{closeModal:()=>a(!1),onCreate:async function(e){let{title:t,area:l}=e;if(t)try{const e=(0,Et.kebabCase)(t).replace(/[^\w-]+/g,"")||"wp-custom-part",r=await i("postType","wp_template_part",{slug:e,title:t,content:"",area:l},{throwOnError:!0});a(!1),n.push({postId:r.id,postType:r.type})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,h.__)("An error occurred while creating the template part.");r(t,{type:"snackbar"}),a(!1)}else r((0,h.__)("Title is not defined."),{type:"snackbar"})}}))}function To(e){let{templateType:t="wp_template"}=e;const n=(0,c.useSelect)((e=>e(u.store).getPostType(t)),[t]);return n?"wp_template"===t?(0,o.createElement)(ko,{postType:n}):"wp_template_part"===t?(0,o.createElement)(Co,{postType:n}):null:null}function No(e){var t;let{templateType:n}=e;const{canCreate:l,postType:a}=(0,c.useSelect)((e=>{const{supportsTemplatePartsMode:t}=e(Ut).getSettings();return{postType:e(u.store).getPostType(n),canCreate:!t}}),[n]);return a?(0,o.createElement)("header",{className:"edit-site-list-header"},(0,o.createElement)(_.__experimentalHeading,{level:1,className:"edit-site-list-header__title"},null===(t=a.labels)||void 0===t?void 0:t.name),l&&(0,o.createElement)("div",{className:"edit-site-list-header__right"},(0,o.createElement)(To,{templateType:n}))):null}function Io(e){let{template:t,onClose:n}=e;const[l,a]=(0,o.useState)((()=>t.title.rendered)),[r,i]=(0,o.useState)(!1),{editEntityRecord:s,saveEditedEntityRecord:d}=(0,c.useDispatch)(u.store),{createSuccessNotice:m,createErrorNotice:p}=(0,c.useDispatch)(Ze.store);if(!t.is_custom)return null;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(_.MenuItem,{onClick:()=>{i(!0),a(t.title.rendered)}},(0,h.__)("Rename")),r&&(0,o.createElement)(_.Modal,{title:(0,h.__)("Rename"),closeLabel:(0,h.__)("Close"),onRequestClose:()=>{i(!1)},overlayClassName:"edit-site-list__rename-modal"},(0,o.createElement)("form",{onSubmit:async function(e){e.preventDefault();try{await s("postType",t.type,t.id,{title:l}),a(""),i(!1),n(),await d("postType",t.type,t.id,{throwOnError:!0}),m((0,h.__)("Entity renamed."),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,h.__)("An error occurred while renaming the entity.");p(t,{type:"snackbar"})}}},(0,o.createElement)(_.Flex,{align:"flex-start",gap:8},(0,o.createElement)(_.FlexItem,null,(0,o.createElement)(_.TextControl,{label:(0,h.__)("Name"),value:l,onChange:a,required:!0}))),(0,o.createElement)(_.Flex,{className:"edit-site-list__rename-modal-actions",justify:"flex-end",expanded:!1},(0,o.createElement)(_.FlexItem,null,(0,o.createElement)(_.Button,{variant:"tertiary",onClick:()=>{i(!1)}},(0,h.__)("Cancel"))),(0,o.createElement)(_.FlexItem,null,(0,o.createElement)(_.Button,{variant:"primary",type:"submit"},(0,h.__)("Save")))))))}function Mo(e){let{template:t}=e;const{removeTemplate:n,revertTemplate:l}=(0,c.useDispatch)(Ut),{saveEditedEntityRecord:a}=(0,c.useDispatch)(u.store),{createSuccessNotice:r,createErrorNotice:i}=(0,c.useDispatch)(Ze.store),s=function(e){return!!e&&"custom"===e.source&&!e.has_theme_file}(t),d=Je(t);if(!s&&!d)return null;return(0,o.createElement)(_.DropdownMenu,{icon:te,label:(0,h.__)("Actions"),className:"edit-site-list-table__actions"},(e=>{let{onClose:c}=e;return(0,o.createElement)(_.MenuGroup,null,s&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Io,{template:t,onClose:c}),(0,o.createElement)(_.MenuItem,{isDestructive:!0,isTertiary:!0,onClick:()=>{n(t),c()}},(0,h.__)("Delete"))),d&&(0,o.createElement)(_.MenuItem,{info:(0,h.__)("Use the template as supplied by the theme."),onClick:()=>{!async function(){try{await l(t,{allowUndo:!1}),await a("postType",t.type,t.id),r((0,h.__)("Entity reverted."),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,h.__)("An error occurred while reverting the entity.");i(t,{type:"snackbar"})}}(),c()}},(0,h.__)("Clear customizations")))}))}var Po=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M10.5 4v4h3V4H15v4h1.5a1 1 0 011 1v4l-3 4v2a1 1 0 01-1 1h-3a1 1 0 01-1-1v-2l-3-4V9a1 1 0 011-1H9V4h1.5zm.5 12.5v2h2v-2l3-4v-3H8v3l3 4z"}));var zo=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{fillRule:"evenodd",d:"M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",clipRule:"evenodd"}));var Vo=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M12 3.3c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8s-4-8.8-8.8-8.8zm6.5 5.5h-2.6C15.4 7.3 14.8 6 14 5c2 .6 3.6 2 4.5 3.8zm.7 3.2c0 .6-.1 1.2-.2 1.8h-2.9c.1-.6.1-1.2.1-1.8s-.1-1.2-.1-1.8H19c.2.6.2 1.2.2 1.8zM12 18.7c-1-.7-1.8-1.9-2.3-3.5h4.6c-.5 1.6-1.3 2.9-2.3 3.5zm-2.6-4.9c-.1-.6-.1-1.1-.1-1.8 0-.6.1-1.2.1-1.8h5.2c.1.6.1 1.1.1 1.8s-.1 1.2-.1 1.8H9.4zM4.8 12c0-.6.1-1.2.2-1.8h2.9c-.1.6-.1 1.2-.1 1.8 0 .6.1 1.2.1 1.8H5c-.2-.6-.2-1.2-.2-1.8zM12 5.3c1 .7 1.8 1.9 2.3 3.5H9.7c.5-1.6 1.3-2.9 2.3-3.5zM10 5c-.8 1-1.4 2.3-1.8 3.8H5.5C6.4 7 8 5.6 10 5zM5.5 15.3h2.6c.4 1.5 1 2.8 1.8 3.7-1.8-.6-3.5-2-4.4-3.7zM14 19c.8-1 1.4-2.2 1.8-3.7h2.6C17.6 17 16 18.4 14 19z"}));const Bo=["wp_template","wp_template_part"];function Ao(e){let{isCustomized:t,children:n}=e;return t?(0,o.createElement)(_.Tooltip,{text:(0,h.__)("This template has been customized")},n):n}function Ro(e){let{text:t,icon:n,imageUrl:l,isCustomized:a}=e;const[r,i]=(0,o.useState)(!1);return(0,o.createElement)(_.__experimentalHStack,{alignment:"left"},(0,o.createElement)(Ao,{isCustomized:a},l?(0,o.createElement)("div",{className:g()("edit-site-list-added-by__avatar",{"is-loaded":r})},(0,o.createElement)("img",{onLoad:()=>i(!0),alt:"",src:l})):(0,o.createElement)("div",{className:g()("edit-site-list-added-by__icon",{"is-customized":a})},(0,o.createElement)(_.Icon,{icon:n}))),(0,o.createElement)("span",null,t))}function Lo(e){var t;let{slug:n,isCustomized:l}=e;const a=(0,c.useSelect)((e=>e(u.store).getTheme(n)),[n]);return(0,o.createElement)(Ro,{icon:Un,text:(null==a||null===(t=a.name)||void 0===t?void 0:t.rendered)||n,isCustomized:l})}function Oo(e){let{slug:t,isCustomized:n}=e;const l=(0,c.useSelect)((e=>e(u.store).getPlugin(t)),[t]);return(0,o.createElement)(Ro,{icon:Po,text:(null==l?void 0:l.name)||t,isCustomized:n})}function Do(e){var t;let{id:n}=e;const l=(0,c.useSelect)((e=>e(u.store).getUser(n)),[n]);return(0,o.createElement)(Ro,{icon:zo,imageUrl:null==l||null===(t=l.avatar_urls)||void 0===t?void 0:t[48],text:null==l?void 0:l.nickname})}function Go(){const{name:e,logoURL:t}=(0,c.useSelect)((e=>{var t;const{getEntityRecord:n,getMedia:l}=e(u.store),a=n("root","__unstableBase");return{name:null==a?void 0:a.name,logoURL:null!=a&&a.site_logo?null===(t=l(a.site_logo))||void 0===t?void 0:t.source_url:void 0}}),[]);return(0,o.createElement)(Ro,{icon:Vo,imageUrl:t,text:e})}function Fo(e){let{templateType:t,template:n}=e;if(n){if(Bo.includes(t)){if(n.has_theme_file&&("theme"===n.origin||!n.origin&&["theme","custom"].includes(n.source)))return(0,o.createElement)(Lo,{slug:n.theme,isCustomized:"custom"===n.source});if(n.has_theme_file&&"plugin"===n.origin)return(0,o.createElement)(Oo,{slug:n.theme,isCustomized:"custom"===n.source});if(!n.has_theme_file&&"custom"===n.source&&!n.author)return(0,o.createElement)(Go,null)}return(0,o.createElement)(Do,{id:n.author})}}function Ho(e){let{templateType:t}=e;const{records:n,isResolving:l}=(0,u.useEntityRecords)("postType",t,{per_page:-1}),a=(0,c.useSelect)((e=>e(u.store).getPostType(t)),[t]);return!n||l?null:n.length?(0,o.createElement)("table",{className:"edit-site-list-table",role:"table"},(0,o.createElement)("thead",null,(0,o.createElement)("tr",{className:"edit-site-list-table-head",role:"row"},(0,o.createElement)("th",{className:"edit-site-list-table-column",role:"columnheader"},(0,h.__)("Template")),(0,o.createElement)("th",{className:"edit-site-list-table-column",role:"columnheader"},(0,h.__)("Added by")),(0,o.createElement)("th",{className:"edit-site-list-table-column",role:"columnheader"},(0,o.createElement)(_.VisuallyHidden,null,(0,h.__)("Actions"))))),(0,o.createElement)("tbody",null,n.map((e=>{var n;return(0,o.createElement)("tr",{key:e.id,className:"edit-site-list-table-row",role:"row"},(0,o.createElement)("td",{className:"edit-site-list-table-column",role:"cell"},(0,o.createElement)(_.__experimentalHeading,{level:4},(0,o.createElement)(Ae,{params:{postId:e.id,postType:e.type}},(0,ja.decodeEntities)((null===(n=e.title)||void 0===n?void 0:n.rendered)||e.slug))),e.description),(0,o.createElement)("td",{className:"edit-site-list-table-column",role:"cell"},(0,o.createElement)(Fo,{templateType:t,template:e})),(0,o.createElement)("td",{className:"edit-site-list-table-column",role:"cell"},(0,o.createElement)(Mo,{template:e})))})))):(0,o.createElement)("div",null,(0,h.sprintf)((0,h.__)("No %s found."),null==a||null===(r=a.labels)||void 0===r||null===(i=r.name)||void 0===i?void 0:i.toLowerCase()));var r,i}function $o(){var e,t;const{params:{postType:n}}=Me();!function(){const{registerShortcut:e}=(0,c.useDispatch)(jt.store);(0,o.useEffect)((()=>{e({name:"core/edit-site/next-region",category:"global",description:(0,h.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),e({name:"core/edit-site/previous-region",category:"global",description:(0,h.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"}]})}),[])}();const{previousShortcut:l,nextShortcut:a,isNavigationOpen:r}=(0,c.useSelect)((e=>({previousShortcut:e(jt.store).getAllShortcutKeyCombinations("core/edit-site/previous-region"),nextShortcut:e(jt.store).getAllShortcutKeyCombinations("core/edit-site/next-region"),isNavigationOpen:e(Ut).isNavigationOpened()})),[]),i=(0,c.useSelect)((e=>e(u.store).getPostType(n)),[n]);Ur(null==i||null===(e=i.labels)||void 0===e?void 0:e.name);const s=null==i||null===(t=i.labels)||void 0===t?void 0:t.items_list,m=i?{header:(0,h.sprintf)((0,h.__)("%s - Header"),s),body:(0,h.sprintf)((0,h.__)("%s - Content"),s)}:void 0;return(0,o.createElement)(ee,{className:g()("edit-site-list",{"is-navigation-open":r}),labels:{drawer:(0,h.__)("Navigation Sidebar"),...m},header:(0,o.createElement)(No,{templateType:n}),drawer:(0,o.createElement)(cr.Slot,null),notices:(0,o.createElement)(d.EditorSnackbars,null),content:(0,o.createElement)(Ho,{templateType:n}),shortcuts:{previous:l,next:a}})}function Uo(e){let{postId:t,postType:n}=e;return!(t||!n)}function jo(e){let{reboot:t}=e;const{createErrorNotice:n}=(0,c.useDispatch)(Ze.store);function l(e){n((0,h.sprintf)((0,h.__)('The "%s" plugin has encountered an error and cannot be rendered.'),e))}return(0,o.createElement)(_.SlotFillProvider,null,(0,o.createElement)(d.UnsavedChangesWarning,null),(0,o.createElement)(Ve,null,(e=>{let{params:n}=e;const a=Uo(n);return(0,o.createElement)(o.Fragment,null,a?(0,o.createElement)($o,null):(0,o.createElement)(Wr,{onError:t}),(0,o.createElement)(D.PluginArea,{onError:l}),(0,o.createElement)(cr,{isDefaultOpen:!!a,activeTemplateType:a?n.postType:void 0}))})))}function Wo(e){let{className:t,...n}=e;const l=(0,c.useSelect)((e=>e(Ut).getSettings().showIconLabels),[]);return(0,o.createElement)(Q,m({panelClassName:t,className:"edit-site-sidebar",scope:"core/edit-site",showIconLabels:l},n))}function Yo(e){return(0,o.createElement)(Y,m({__unstableExplicitMenuItem:!0,scope:"core/edit-site"},e))}var qo=(0,J.compose)((0,D.withPluginContext)(((e,t)=>{var n;return{as:null!==(n=t.as)&&void 0!==n?n:_.MenuItem,icon:t.icon||e.icon,name:"core/edit-site/plugin-more-menu"}})))(j);function Xo(e,t){if(!t.__unstableHomeTemplate)return void(0,o.render)((0,o.createElement)(Lr,{message:(0,h.__)("The editor is unable to find a block template for the homepage."),dashboardLink:"index.php"}),e);(0,me.addFilter)("blockEditor.__unstableCanInsertBlockType","removeClassicBlockFromInserter",((e,t)=>"core/freeform"!==t.name&&e)),(0,o.unmountComponentAtNode)(e);const n=Xo.bind(null,e,t);(0,c.dispatch)(k.store).setDefaults("core/edit-site",{editorMode:"visual",fixedToolbar:!1,focusMode:!1,keepCaretInsideBlock:!1,welcomeGuide:!0,welcomeGuideStyles:!0,showListViewByDefault:!1}),(0,c.select)(k.store).get("core/edit-site","showListViewByDefault")&&(0,c.dispatch)(Ut).setIsListViewOpened(!0),(0,c.dispatch)(O).setDefaultComplementaryArea("core/edit-site","edit-site/template"),(0,c.dispatch)(Ut).updateSettings(t),(0,c.dispatch)(d.store).updateEditorSettings({defaultTemplateTypes:t.defaultTemplateTypes,defaultTemplatePartAreas:t.defaultTemplatePartAreas});Uo((0,de.getQueryArgs)(window.location.href))&&(0,c.dispatch)(Ut).setIsNavigationPanelOpened((0,c.select)(b.store).isViewportMatch("medium"));window.addEventListener("dragover",(e=>e.preventDefault()),!1),window.addEventListener("drop",(e=>e.preventDefault()),!1),(0,o.render)((0,o.createElement)(jo,{reboot:n}),e)}function Ko(e,t){t.__experimentalFetchLinkSuggestions=(e,n)=>(0,u.__experimentalFetchLinkSuggestions)(e,n,t),t.__experimentalFetchRichUrlData=u.__experimentalFetchUrlData;const n=document.getElementById(e);(0,c.dispatch)(i.store).__experimentalReapplyBlockTypeFilters(),(0,s.registerCoreBlocks)(),Xo(n,t)}}(),(window.wp=window.wp||{}).editSite=l}();
\ No newline at end of file
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 1a1a3a2c91..e3dc686648 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
-$wp_version = '6.2-alpha-54690';
+$wp_version = '6.2-alpha-54693';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.