Al-HUWAITI Shell
Al-huwaiti


Server : Apache
System : Linux 122.228.205.92.host.secureserver.net 5.14.0-362.18.1.el9_3.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jan 29 07:05:48 EST 2024 x86_64
User : ondostategov ( 1002)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /home/ondostategov/public_html/wp-includes/js/dist/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/ondostategov/public_html/wp-includes/js/dist/editor.min.js
/*! This file is auto-generated */
(()=>{var e={66:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===s}(e)}(e)};var s="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?l((s=e,Array.isArray(s)?[]:{}),e,t):e;var s}function o(e,t,s){return e.concat(t).map((function(e){return n(e,s)}))}function r(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function i(e,t){try{return t in e}catch(e){return!1}}function a(e,t,s){var o={};return s.isMergeableObject(e)&&r(e).forEach((function(t){o[t]=n(e[t],s)})),r(t).forEach((function(r){(function(e,t){return i(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,r)||(i(e,r)&&s.isMergeableObject(t[r])?o[r]=function(e,t){if(!t.customMerge)return l;var s=t.customMerge(e);return"function"==typeof s?s:l}(r,s)(e[r],t[r],s):o[r]=n(t[r],s))})),o}function l(e,s,r){(r=r||{}).arrayMerge=r.arrayMerge||o,r.isMergeableObject=r.isMergeableObject||t,r.cloneUnlessOtherwiseSpecified=n;var i=Array.isArray(s);return i===Array.isArray(e)?i?r.arrayMerge(e,s,r):a(e,s,r):n(s,r)}l.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,s){return l(e,s,t)}),{})};var c=l;e.exports=c},461:(e,t,s)=>{var n=s(6109);e.exports=function(e){var t=n(e,"line-height"),s=parseFloat(t,10);if(t===s+""){var o=e.style.lineHeight;e.style.lineHeight=t+"em",t=n(e,"line-height"),s=parseFloat(t,10),o?e.style.lineHeight=o:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(s*=4,s/=3):-1!==t.indexOf("mm")?(s*=96,s/=25.4):-1!==t.indexOf("cm")?(s*=96,s/=2.54):-1!==t.indexOf("in")?s*=96:-1!==t.indexOf("pc")&&(s*=16),s=Math.round(s),"normal"===t){var r=e.nodeName,i=document.createElement(r);i.innerHTML=" ","TEXTAREA"===r.toUpperCase()&&i.setAttribute("rows","1");var a=n(e,"font-size");i.style.fontSize=a,i.style.padding="0px",i.style.border="0px";var l=document.body;l.appendChild(i),s=i.offsetHeight,l.removeChild(i)}return s}},628:(e,t,s)=>{"use strict";var n=s(4067);function o(){}function r(){}r.resetWarningCache=o,e.exports=function(){function e(e,t,s,o,r,i){if(i!==n){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var s={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:r,resetWarningCache:o};return s.PropTypes=s,s}},1609:e=>{"use strict";e.exports=window.React},4067:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4132:(e,t,s)=>{"use strict";var n=s(4462);t.A=n.TextareaAutosize},4306:function(e,t){var s,n,o;
/*!
	autosize 4.0.4
	license: MIT
	http://www.jacklmoore.com/autosize
*/n=[e,t],s=function(e,t){"use strict";var s,n,o="function"==typeof Map?new Map:(s=[],n=[],{has:function(e){return s.indexOf(e)>-1},get:function(e){return n[s.indexOf(e)]},set:function(e,t){-1===s.indexOf(e)&&(s.push(e),n.push(t))},delete:function(e){var t=s.indexOf(e);t>-1&&(s.splice(t,1),n.splice(t,1))}}),r=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){r=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function i(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!o.has(e)){var t=null,s=null,n=null,i=function(){e.clientWidth!==s&&p()},a=function(t){window.removeEventListener("resize",i,!1),e.removeEventListener("input",p,!1),e.removeEventListener("keyup",p,!1),e.removeEventListener("autosize:destroy",a,!1),e.removeEventListener("autosize:update",p,!1),Object.keys(t).forEach((function(s){e.style[s]=t[s]})),o.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",a,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",p,!1),window.addEventListener("resize",i,!1),e.addEventListener("input",p,!1),e.addEventListener("autosize:update",p,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",o.set(e,{destroy:a,update:p}),l()}function l(){var s=window.getComputedStyle(e,null);"vertical"===s.resize?e.style.resize="none":"both"===s.resize&&(e.style.resize="horizontal"),t="content-box"===s.boxSizing?-(parseFloat(s.paddingTop)+parseFloat(s.paddingBottom)):parseFloat(s.borderTopWidth)+parseFloat(s.borderBottomWidth),isNaN(t)&&(t=0),p()}function c(t){var s=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=s,e.style.overflowY=t}function d(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}function u(){if(0!==e.scrollHeight){var n=d(e),o=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",s=e.clientWidth,n.forEach((function(e){e.node.scrollTop=e.scrollTop})),o&&(document.documentElement.scrollTop=o)}}function p(){u();var t=Math.round(parseFloat(e.style.height)),s=window.getComputedStyle(e,null),o="content-box"===s.boxSizing?Math.round(parseFloat(s.height)):e.offsetHeight;if(o<t?"hidden"===s.overflowY&&(c("scroll"),u(),o="content-box"===s.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==s.overflowY&&(c("hidden"),u(),o="content-box"===s.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),n!==o){n=o;var i=r("autosize:resized");try{e.dispatchEvent(i)}catch(e){}}}}function a(e){var t=o.get(e);t&&t.destroy()}function l(e){var t=o.get(e);t&&t.update()}var c=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((c=function(e){return e}).destroy=function(e){return e},c.update=function(e){return e}):((c=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return i(e,t)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e},c.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],l),e}),t.default=c,e.exports=t.default},void 0===(o="function"==typeof s?s.apply(t,n):s)||(e.exports=o)},4462:function(e,t,s){"use strict";var n,o=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])},function(e,t){function s(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(s.prototype=t.prototype,new s)}),r=this&&this.__assign||Object.assign||function(e){for(var t,s=1,n=arguments.length;s<n;s++)for(var o in t=arguments[s])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i=this&&this.__rest||function(e,t){var s={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(s[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&(s[n[o]]=e[n[o]])}return s};t.__esModule=!0;var a=s(1609),l=s(5826),c=s(4306),d=s(461),u="autosize:resized",p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:d(t.textarea)})},t.onChange=function(e){var s=t.props.onChange;t.currentValue=e.currentTarget.value,s&&s(e)},t}return o(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,s=t.maxRows,n=t.async;"number"==typeof s&&this.updateLineHeight(),"number"==typeof s||n?setTimeout((function(){return e.textarea&&c(e.textarea)})):this.textarea&&c(this.textarea),this.textarea&&this.textarea.addEventListener(u,this.onResize)},t.prototype.componentWillUnmount=function(){this.textarea&&(this.textarea.removeEventListener(u,this.onResize),c.destroy(this.textarea))},t.prototype.render=function(){var e=this,t=this.props,s=(t.onResize,t.maxRows),n=(t.onChange,t.style),o=(t.innerRef,t.children),l=i(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,d=s&&c?c*s:null;return a.createElement("textarea",r({},l,{onChange:this.onChange,style:d?r({},n,{maxHeight:d}):n,ref:function(t){e.textarea=t,"function"==typeof e.props.innerRef?e.props.innerRef(t):e.props.innerRef&&(e.props.innerRef.current=t)}}),o)},t.prototype.componentDidUpdate=function(){this.textarea&&c.update(this.textarea)},t.defaultProps={rows:1,async:!1},t.propTypes={rows:l.number,maxRows:l.number,onResize:l.func,innerRef:l.any,async:l.bool},t}(a.Component);t.TextareaAutosize=a.forwardRef((function(e,t){return a.createElement(p,r({},e,{innerRef:t}))}))},5215:e=>{"use strict";e.exports=function e(t,s){if(t===s)return!0;if(t&&s&&"object"==typeof t&&"object"==typeof s){if(t.constructor!==s.constructor)return!1;var n,o,r;if(Array.isArray(t)){if((n=t.length)!=s.length)return!1;for(o=n;0!=o--;)if(!e(t[o],s[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===s.source&&t.flags===s.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===s.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===s.toString();if((n=(r=Object.keys(t)).length)!==Object.keys(s).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(s,r[o]))return!1;for(o=n;0!=o--;){var i=r[o];if(!e(t[i],s[i]))return!1}return!0}return t!=t&&s!=s}},5826:(e,t,s)=>{e.exports=s(628)()},6109:e=>{e.exports=function(e,t,s){return((s=window.getComputedStyle)?s(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},9681:e=>{var t={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},s=Object.keys(t).join("|"),n=new RegExp(s,"g"),o=new RegExp(s,"");function r(e){return t[e]}var i=function(e){return e.replace(n,r)};e.exports=i,e.exports.has=function(e){return!!e.match(o)},e.exports.remove=i}},t={};function s(n){var o=t[n];if(void 0!==o)return o.exports;var r=t[n]={exports:{}};return e[n].call(r.exports,r,r.exports,s),r.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";s.r(n),s.d(n,{AlignmentToolbar:()=>Yh,Autocomplete:()=>Zh,AutosaveMonitor:()=>Oc,BlockAlignmentToolbar:()=>qh,BlockControls:()=>Kh,BlockEdit:()=>Qh,BlockEditorKeyboardShortcuts:()=>Xh,BlockFormatControls:()=>Jh,BlockIcon:()=>eg,BlockInspector:()=>tg,BlockList:()=>sg,BlockMover:()=>ng,BlockNavigationDropdown:()=>og,BlockSelectionClearer:()=>rg,BlockSettingsMenu:()=>ig,BlockTitle:()=>ag,BlockToolbar:()=>lg,CharacterCount:()=>Oh,ColorPalette:()=>cg,ContrastChecker:()=>dg,CopyHandler:()=>ug,DefaultBlockAppender:()=>pg,DocumentBar:()=>Gc,DocumentOutline:()=>ed,DocumentOutlineCheck:()=>td,EditorHistoryRedo:()=>rd,EditorHistoryUndo:()=>id,EditorKeyboardShortcuts:()=>kl,EditorKeyboardShortcutsRegister:()=>sd,EditorNotices:()=>ld,EditorProvider:()=>Al,EditorSnackbars:()=>dd,EntitiesSavedStates:()=>yd,ErrorBoundary:()=>kd,FontSizePicker:()=>mg,InnerBlocks:()=>gg,Inserter:()=>hg,InspectorAdvancedControls:()=>_g,InspectorControls:()=>fg,LocalAutosaveMonitor:()=>Ed,MediaPlaceholder:()=>Sg,MediaUpload:()=>kg,MediaUploadCheck:()=>Cg,MultiSelectScrollIntoView:()=>Pg,NavigableToolbar:()=>jg,ObserveTyping:()=>Eg,PageAttributesCheck:()=>Td,PageAttributesOrder:()=>Nd,PageAttributesPanel:()=>Wd,PageAttributesParent:()=>zd,PageTemplate:()=>nu,PanelColorSettings:()=>bg,PlainText:()=>yg,PluginBlockSettingsMenuItem:()=>_u,PluginDocumentSettingPanel:()=>gu,PluginMoreMenuItem:()=>fu,PluginPostPublishPanel:()=>vu,PluginPostStatusInfo:()=>Cu,PluginPrePublishPanel:()=>Tu,PluginPreviewMenuItem:()=>Bu,PluginSidebar:()=>Iu,PluginSidebarMoreMenuItem:()=>Nu,PostAuthor:()=>Wu,PostAuthorCheck:()=>Zu,PostAuthorPanel:()=>qu,PostComments:()=>Qu,PostDiscussionPanel:()=>sp,PostExcerpt:()=>np,PostExcerptCheck:()=>op,PostExcerptPanel:()=>up,PostFeaturedImage:()=>wp,PostFeaturedImageCheck:()=>gp,PostFeaturedImagePanel:()=>kp,PostFormat:()=>jp,PostFormatCheck:()=>Cp,PostLastRevision:()=>Ip,PostLastRevisionCheck:()=>Ep,PostLastRevisionPanel:()=>Np,PostLockedModal:()=>Rp,PostPendingStatus:()=>Ap,PostPendingStatusCheck:()=>Dp,PostPingbacks:()=>Xu,PostPreviewButton:()=>Mp,PostPublishButton:()=>Vp,PostPublishButtonLabel:()=>Lp,PostPublishPanel:()=>Ym,PostSavedState:()=>nh,PostSchedule:()=>am,PostScheduleCheck:()=>oh,PostScheduleLabel:()=>cm,PostSchedulePanel:()=>ih,PostSticky:()=>Xm,PostStickyCheck:()=>Qm,PostSwitchToDraftButton:()=>ah,PostSyncStatus:()=>lh,PostTaxonomies:()=>dh,PostTaxonomiesCheck:()=>uh,PostTaxonomiesFlatTermSelector:()=>wm,PostTaxonomiesHierarchicalTermSelector:()=>Dm,PostTaxonomiesPanel:()=>mh,PostTemplatePanel:()=>Vu,PostTextEditor:()=>gh,PostTitle:()=>vh,PostTitleRaw:()=>wh,PostTrash:()=>kh,PostTrashCheck:()=>Sh,PostTypeSupportCheck:()=>Bd,PostURL:()=>Ch,PostURLCheck:()=>Ph,PostURLLabel:()=>jh,PostURLPanel:()=>Th,PostVisibility:()=>zp,PostVisibilityCheck:()=>Nh,PostVisibilityLabel:()=>Gp,RichText:()=>Wh,RichTextShortcut:()=>xg,RichTextToolbarButton:()=>vg,ServerSideRender:()=>zh(),SkipToSelectedBlock:()=>Tg,TableOfContents:()=>Vh,TextEditorGlobalKeyboardShortcuts:()=>$g,ThemeSupportCheck:()=>hp,TimeToRead:()=>Lh,URLInput:()=>Bg,URLInputButton:()=>Ig,URLPopover:()=>Ng,UnsavedChangesWarning:()=>Uh,VisualEditorGlobalKeyboardShortcuts:()=>Gg,Warning:()=>Rg,WordCount:()=>Ah,WritingFlow:()=>Dg,__unstableRichTextInputEvent:()=>wg,cleanForSlug:()=>Wg,createCustomColorsHOC:()=>Ag,getColorClassName:()=>Mg,getColorObjectByAttributeValues:()=>Lg,getColorObjectByColorValue:()=>Og,getFontSize:()=>Fg,getFontSizeClass:()=>Vg,getTemplatePartIcon:()=>H,mediaUpload:()=>yi,privateApis:()=>Xy,registerEntityAction:()=>Jy,registerEntityField:()=>tx,store:()=>vc,storeConfig:()=>xc,transformStyles:()=>g.transformStyles,unregisterEntityAction:()=>ex,unregisterEntityField:()=>sx,useEntitiesSavedStatesIsDirty:()=>fd,usePostScheduleLabel:()=>dm,usePostURLLabel:()=>Eh,usePostVisibilityLabel:()=>$p,userAutocompleter:()=>Sc,withColorContext:()=>Ug,withColors:()=>Hg,withFontSizes:()=>zg});var e={};s.r(e),s.d(e,{__experimentalGetDefaultTemplatePartAreas:()=>ls,__experimentalGetDefaultTemplateType:()=>cs,__experimentalGetDefaultTemplateTypes:()=>as,__experimentalGetTemplateInfo:()=>ds,__unstableIsEditorReady:()=>et,canInsertBlockType:()=>ns,canUserUseUnfilteredHTML:()=>$e,didPostSaveRequestFail:()=>Ee,didPostSaveRequestSucceed:()=>je,getActivePostLock:()=>Ge,getAdjacentBlockClientId:()=>Et,getAutosaveAttribute:()=>me,getBlock:()=>mt,getBlockAttributes:()=>pt,getBlockCount:()=>yt,getBlockHierarchyRootClientId:()=>jt,getBlockIndex:()=>Ht,getBlockInsertionPoint:()=>Xt,getBlockListSettings:()=>is,getBlockMode:()=>qt,getBlockName:()=>dt,getBlockOrder:()=>Ut,getBlockRootClientId:()=>Pt,getBlockSelectionEnd:()=>vt,getBlockSelectionStart:()=>xt,getBlocks:()=>ht,getBlocksByClientId:()=>bt,getClientIdsOfDescendants:()=>gt,getClientIdsWithDescendants:()=>_t,getCurrentPost:()=>ne,getCurrentPostAttribute:()=>de,getCurrentPostId:()=>re,getCurrentPostLastRevisionId:()=>le,getCurrentPostRevisionsCount:()=>ae,getCurrentPostType:()=>oe,getCurrentTemplateId:()=>ie,getDeviceType:()=>nt,getEditedPostAttribute:()=>pe,getEditedPostContent:()=>Re,getEditedPostPreviewLink:()=>Ie,getEditedPostSlug:()=>Le,getEditedPostVisibility:()=>he,getEditorBlocks:()=>Ze,getEditorMode:()=>it,getEditorSelection:()=>Je,getEditorSelectionEnd:()=>Xe,getEditorSelectionStart:()=>Qe,getEditorSettings:()=>tt,getFirstMultiSelectedBlockClientId:()=>Dt,getGlobalBlockCount:()=>ft,getInserterItems:()=>os,getLastMultiSelectedBlockClientId:()=>At,getMultiSelectedBlockClientIds:()=>Nt,getMultiSelectedBlocks:()=>Rt,getMultiSelectedBlocksEndClientId:()=>Vt,getMultiSelectedBlocksStartClientId:()=>Ft,getNextBlockClientId:()=>Bt,getPermalink:()=>Me,getPermalinkParts:()=>Oe,getPostEdits:()=>ce,getPostLockUser:()=>ze,getPostTypeLabel:()=>us,getPreviousBlockClientId:()=>Tt,getRenderingMode:()=>st,getSelectedBlock:()=>Ct,getSelectedBlockClientId:()=>kt,getSelectedBlockCount:()=>wt,getSelectedBlocksInitialCaretPosition:()=>It,getStateBeforeOptimisticTransaction:()=>at,getSuggestedPostFormat:()=>Ne,getTemplate:()=>ts,getTemplateLock:()=>ss,hasChangedContent:()=>J,hasEditorRedo:()=>Q,hasEditorUndo:()=>K,hasInserterItems:()=>rs,hasMultiSelection:()=>Wt,hasNonPostEntityChanges:()=>te,hasSelectedBlock:()=>St,hasSelectedInnerBlock:()=>Gt,inSomeHistory:()=>lt,isAncestorMultiSelected:()=>Ot,isAutosavingPost:()=>Te,isBlockInsertionPointVisible:()=>Jt,isBlockMultiSelected:()=>Lt,isBlockSelected:()=>zt,isBlockValid:()=>ut,isBlockWithinSelection:()=>$t,isCaretWithinFormattedText:()=>Qt,isCleanNewPost:()=>se,isCurrentPostPending:()=>ge,isCurrentPostPublished:()=>_e,isCurrentPostScheduled:()=>fe,isDeletingPost:()=>ke,isEditedPostAutosaveable:()=>ve,isEditedPostBeingScheduled:()=>we,isEditedPostDateFloating:()=>Se,isEditedPostDirty:()=>ee,isEditedPostEmpty:()=>xe,isEditedPostNew:()=>X,isEditedPostPublishable:()=>be,isEditedPostSaveable:()=>ye,isEditorPanelEnabled:()=>qe,isEditorPanelOpened:()=>Ke,isEditorPanelRemoved:()=>Ye,isFirstMultiSelectedBlock:()=>Mt,isInserterOpened:()=>rt,isListViewOpened:()=>ot,isMultiSelecting:()=>Zt,isPermalinkEditable:()=>Ae,isPostAutosavingLocked:()=>Ue,isPostLockTakeover:()=>He,isPostLocked:()=>Fe,isPostSavingLocked:()=>Ve,isPreviewingPost:()=>Be,isPublishSidebarEnabled:()=>We,isPublishSidebarOpened:()=>ps,isPublishingPost:()=>De,isSavingNonPostEntityChanges:()=>Pe,isSavingPost:()=>Ce,isSelectionEnabled:()=>Yt,isTyping:()=>Kt,isValidTemplate:()=>es});var t={};s.r(t),s.d(t,{__experimentalTearDownEditor:()=>vs,__unstableSaveForPreview:()=>Is,autosave:()=>Bs,clearSelectedBlock:()=>hn,closePublishSidebar:()=>sn,createUndoLevel:()=>Ds,disablePublishSidebar:()=>Ls,editPost:()=>Ps,enablePublishSidebar:()=>Ms,enterFormattedText:()=>Rn,exitFormattedText:()=>Dn,hideInsertionPoint:()=>kn,insertBlock:()=>vn,insertBlocks:()=>wn,insertDefaultBlock:()=>An,lockPostAutosaving:()=>Vs,lockPostSaving:()=>Os,mergeBlocks:()=>jn,moveBlockToPosition:()=>xn,moveBlocksDown:()=>bn,moveBlocksUp:()=>yn,multiSelect:()=>mn,openPublishSidebar:()=>tn,receiveBlocks:()=>an,redo:()=>Ns,refreshPost:()=>Es,removeBlock:()=>Tn,removeBlocks:()=>En,removeEditorPanel:()=>Ys,replaceBlock:()=>fn,replaceBlocks:()=>_n,resetBlocks:()=>rn,resetEditorBlocks:()=>Hs,resetPost:()=>ws,savePost:()=>js,selectBlock:()=>dn,setDeviceType:()=>$s,setEditedPost:()=>Cs,setIsInserterOpened:()=>qs,setIsListViewOpened:()=>Ks,setRenderingMode:()=>Gs,setTemplateValidity:()=>Cn,setupEditor:()=>xs,setupEditorState:()=>ks,showInsertionPoint:()=>Sn,startMultiSelect:()=>un,startTyping:()=>In,stopMultiSelect:()=>pn,stopTyping:()=>Nn,switchEditorMode:()=>en,synchronizeTemplate:()=>Pn,toggleBlockMode:()=>Bn,toggleDistractionFree:()=>Qs,toggleEditorPanelEnabled:()=>Ws,toggleEditorPanelOpened:()=>Zs,togglePublishSidebar:()=>nn,toggleSelection:()=>gn,toggleSpotlightMode:()=>Xs,toggleTopToolbar:()=>Js,trashPost:()=>Ts,undo:()=>Rs,unlockPostAutosaving:()=>Us,unlockPostSaving:()=>Fs,updateBlock:()=>ln,updateBlockAttributes:()=>cn,updateBlockListSettings:()=>Mn,updateEditorSettings:()=>zs,updatePost:()=>Ss,updatePostLock:()=>As});var o={};s.r(o),s.d(o,{closeModal:()=>xa,disableComplementaryArea:()=>ma,enableComplementaryArea:()=>pa,openModal:()=>ya,pinItem:()=>ha,setDefaultComplementaryArea:()=>ua,setFeatureDefaults:()=>ba,setFeatureValue:()=>fa,toggleFeature:()=>_a,unpinItem:()=>ga});var r={};s.r(r),s.d(r,{getActiveComplementaryArea:()=>va,isComplementaryAreaLoading:()=>wa,isFeatureActive:()=>ka,isItemPinned:()=>Sa,isModalActive:()=>Ca});var i={};s.r(i),s.d(i,{ActionItem:()=>Na,ComplementaryArea:()=>Va,ComplementaryAreaMoreMenuItem:()=>Da,FullscreenMode:()=>Ua,InterfaceSkeleton:()=>Wa,PinnedItems:()=>Ma,store:()=>ja});var a={};s.r(a),s.d(a,{createTemplate:()=>Zl,hideBlockTypes:()=>ql,registerEntityAction:()=>Vl,registerEntityField:()=>Hl,registerPostTypeSchema:()=>$l,removeTemplates:()=>Xl,revertTemplate:()=>Ql,saveDirtyEntities:()=>Kl,setCanvasMinHeight:()=>ec,setCurrentTemplateId:()=>Wl,setDefaultRenderingMode:()=>Jl,setIsReady:()=>Gl,showBlockTypes:()=>Yl,unregisterEntityAction:()=>Ul,unregisterEntityField:()=>zl});var l={};s.r(l),s.d(l,{getCanvasMinHeight:()=>yc,getDefaultRenderingMode:()=>bc,getEntityActions:()=>hc,getEntityFields:()=>_c,getInserter:()=>lc,getInserterSidebarToggleRef:()=>dc,getListViewToggleRef:()=>cc,getPostBlocksByName:()=>fc,getPostIcon:()=>pc,hasPostMetaChanges:()=>mc,isEntityReady:()=>gc});const c=window.ReactJSXRuntime,d=window.wp.data,u=window.wp.coreData,p=window.wp.element,m=window.wp.compose,h=window.wp.hooks,g=window.wp.blockEditor,_={...g.SETTINGS_DEFAULTS,richEditingEnabled:!0,codeEditingEnabled:!0,fontLibraryEnabled:!0,enableCustomFields:void 0,defaultRenderingMode:"post-only"};var f=(0,d.combineReducers)({actions:function(e={},t){switch(t.type){case"REGISTER_ENTITY_ACTION":return{...e,[t.kind]:{...e[t.kind],[t.name]:[...(e[t.kind]?.[t.name]??[]).filter((e=>e.id!==t.config.id)),t.config]}};case"UNREGISTER_ENTITY_ACTION":return{...e,[t.kind]:{...e[t.kind],[t.name]:(e[t.kind]?.[t.name]??[]).filter((e=>e.id!==t.actionId))}}}return e},fields:function(e={},t){switch(t.type){case"REGISTER_ENTITY_FIELD":return{...e,[t.kind]:{...e[t.kind],[t.name]:[...(e[t.kind]?.[t.name]??[]).filter((e=>e.id!==t.config.id)),t.config]}};case"UNREGISTER_ENTITY_FIELD":return{...e,[t.kind]:{...e[t.kind],[t.name]:(e[t.kind]?.[t.name]??[]).filter((e=>e.id!==t.fieldId))}}}return e},isReady:function(e={},t){return"SET_IS_READY"===t.type?{...e,[t.kind]:{...e[t.kind],[t.name]:!0}}:e}});function b(e){return e&&"object"==typeof e&&"raw"in e?e.raw:e}var y=(0,d.combineReducers)({postId:function(e=null,t){return"SET_EDITED_POST"===t.type?t.postId:e},postType:function(e=null,t){return"SET_EDITED_POST"===t.type?t.postType:e},templateId:function(e=null,t){return"SET_CURRENT_TEMPLATE_ID"===t.type?t.id:e},saving:function(e={},t){switch(t.type){case"REQUEST_POST_UPDATE_START":case"REQUEST_POST_UPDATE_FINISH":return{pending:"REQUEST_POST_UPDATE_START"===t.type,options:t.options||{}}}return e},deleting:function(e={},t){switch(t.type){case"REQUEST_POST_DELETE_START":case"REQUEST_POST_DELETE_FINISH":return{pending:"REQUEST_POST_DELETE_START"===t.type}}return e},postLock:function(e={isLocked:!1},t){return"UPDATE_POST_LOCK"===t.type?t.lock:e},template:function(e={isValid:!0},t){return"SET_TEMPLATE_VALIDITY"===t.type?{...e,isValid:t.isValid}:e},postSavingLock:function(e={},t){switch(t.type){case"LOCK_POST_SAVING":return{...e,[t.lockName]:!0};case"UNLOCK_POST_SAVING":{const{[t.lockName]:s,...n}=e;return n}}return e},editorSettings:function(e=_,t){return"UPDATE_EDITOR_SETTINGS"===t.type?{...e,...t.settings}:e},postAutosavingLock:function(e={},t){switch(t.type){case"LOCK_POST_AUTOSAVING":return{...e,[t.lockName]:!0};case"UNLOCK_POST_AUTOSAVING":{const{[t.lockName]:s,...n}=e;return n}}return e},renderingMode:function(e="post-only",t){return"SET_RENDERING_MODE"===t.type?t.mode:e},deviceType:function(e="Desktop",t){return"SET_DEVICE_TYPE"===t.type?t.deviceType:e},removedPanels:function(e=[],t){if("REMOVE_PANEL"===t.type)if(!e.includes(t.panelName))return[...e,t.panelName];return e},blockInserterPanel:function(e=!1,t){switch(t.type){case"SET_IS_LIST_VIEW_OPENED":return!t.isOpen&&e;case"SET_IS_INSERTER_OPENED":return t.value}return e},inserterSidebarToggleRef:function(e={current:null}){return e},listViewPanel:function(e=!1,t){switch(t.type){case"SET_IS_INSERTER_OPENED":return!t.value&&e;case"SET_IS_LIST_VIEW_OPENED":return t.isOpen}return e},listViewToggleRef:function(e={current:null}){return e},publishSidebarActive:function(e=!1,t){switch(t.type){case"OPEN_PUBLISH_SIDEBAR":return!0;case"CLOSE_PUBLISH_SIDEBAR":return!1;case"TOGGLE_PUBLISH_SIDEBAR":return!e}return e},canvasMinHeight:function(e=0,t){return"SET_CANVAS_MIN_HEIGHT"===t.type?t.minHeight:e},dataviews:f});const x=window.wp.blocks,v=window.wp.date,w=window.wp.url,S=window.wp.deprecated;var k=s.n(S);const C=window.wp.preferences,P=new Set(["meta"]),j=/%(?:postname|pagename)%/,E=6e4,T=["title","excerpt","content"],B="wp_template",I="wp_template_part",N="wp_block",R="wp_navigation",D="custom",A=["wp_template","wp_template_part"],M=[...A,"wp_block","wp_navigation"],L=window.wp.primitives;var O=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.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"})}),F=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.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"})}),V=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.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"})}),U=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.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"})});function H(e){return"header"===e?O:"footer"===e?F:"sidebar"===e?V:U}const z=window.wp.privateApis,{lock:G,unlock:$}=(0,z.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/editor");var W=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.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"})});const Z={},Y=e=>{if(!e)return Z;const{templateTypes:t,templateAreas:s,template:n}=e,{description:o,slug:r,title:i,area:a}=n,{title:l,description:c}=Object.values(t).find((e=>e.slug===r))??Z,d="string"==typeof i?i:i?.rendered,u="string"==typeof o?o:o?.raw,p=s?.map((e=>({...e,icon:H(e.icon)}))),m=p?.find((e=>a===e.area))?.icon||W;return{title:d&&d!==r?d:l||r,description:u||c,icon:m}},q={},K=(0,d.createRegistrySelector)((e=>()=>e(u.store).hasUndo())),Q=(0,d.createRegistrySelector)((e=>()=>e(u.store).hasRedo()));function X(e){return"auto-draft"===ne(e).status}function J(e){return"content"in ce(e)}const ee=(0,d.createRegistrySelector)((e=>t=>{const s=oe(t),n=re(t);return e(u.store).hasEditsForEntityRecord("postType",s,n)})),te=(0,d.createRegistrySelector)((e=>t=>{const s=e(u.store).__experimentalGetDirtyEntityRecords(),{type:n,id:o}=ne(t);return s.some((e=>"postType"!==e.kind||e.name!==n||e.key!==o))}));function se(e){return!ee(e)&&X(e)}const ne=(0,d.createRegistrySelector)((e=>t=>{const s=re(t),n=oe(t),o=e(u.store).getRawEntityRecord("postType",n,s);return o||q}));function oe(e){return e.postType}function re(e){return e.postId}function ie(e){return e.templateId}function ae(e){return ne(e)._links?.["version-history"]?.[0]?.count??0}function le(e){return ne(e)._links?.["predecessor-version"]?.[0]?.id??null}const ce=(0,d.createRegistrySelector)((e=>t=>{const s=oe(t),n=re(t);return e(u.store).getEntityRecordEdits("postType",s,n)||q}));function de(e,t){switch(t){case"type":return oe(e);case"id":return re(e);default:const s=ne(e);if(!s.hasOwnProperty(t))break;return b(s[t])}}const ue=(0,d.createSelector)(((e,t)=>{const s=ce(e);return s.hasOwnProperty(t)?{...de(e,t),...s[t]}:de(e,t)}),((e,t)=>[de(e,t),ce(e)[t]]));function pe(e,t){if("content"===t)return Re(e);const s=ce(e);return s.hasOwnProperty(t)?P.has(t)?ue(e,t):s[t]:de(e,t)}const me=(0,d.createRegistrySelector)((e=>(t,s)=>{if(!T.includes(s)&&"preview_link"!==s)return;const n=oe(t);if("wp_template"===n)return!1;const o=re(t),r=e(u.store).getCurrentUser()?.id,i=e(u.store).getAutosave(n,o,r);return i?b(i[s]):void 0}));function he(e){if("private"===pe(e,"status"))return"private";return pe(e,"password")?"password":"public"}function ge(e){return"pending"===ne(e).status}function _e(e,t){const s=t||ne(e);return-1!==["publish","private"].indexOf(s.status)||"future"===s.status&&!(0,v.isInTheFuture)(new Date(Number((0,v.getDate)(s.date))-E))}function fe(e){return"future"===ne(e).status&&!_e(e)}function be(e){const t=ne(e);return ee(e)||-1===["publish","private","future"].indexOf(t.status)}function ye(e){return!Ce(e)&&(!!pe(e,"title")||!!pe(e,"excerpt")||!xe(e)||"native"===p.Platform.OS)}const xe=(0,d.createRegistrySelector)((e=>t=>{const s=re(t),n=oe(t),o=e(u.store).getEditedEntityRecord("postType",n,s);if("function"!=typeof o.content)return!o.content;const r=pe(t,"blocks");if(0===r.length)return!0;if(r.length>1)return!1;const i=r[0].name;return(i===(0,x.getDefaultBlockName)()||i===(0,x.getFreeformContentHandlerName)())&&!Re(t)})),ve=(0,d.createRegistrySelector)((e=>t=>{if(!ye(t))return!1;if(Ue(t))return!1;const s=oe(t),n=e(u.store).getPostType(s);if("wp_template"===s||!n?.supports?.autosave)return!1;const o=re(t),r=e(u.store).hasFetchedAutosaves(s,o),i=e(u.store).getCurrentUser()?.id,a=e(u.store).getAutosave(s,o,i);return!!r&&(!a||(!!J(t)||["title","excerpt","meta"].some((e=>b(a[e])!==pe(t,e)))))}));function we(e){const t=pe(e,"date"),s=new Date(Number((0,v.getDate)(t))-E);return(0,v.isInTheFuture)(s)}function Se(e){const t=pe(e,"date"),s=pe(e,"modified"),n=ne(e).status;return("draft"===n||"auto-draft"===n||"pending"===n)&&(t===s||null===t)}function ke(e){return!!e.deleting.pending}function Ce(e){return!!e.saving.pending}const Pe=(0,d.createRegistrySelector)((e=>t=>{const s=e(u.store).__experimentalGetEntitiesBeingSaved(),{type:n,id:o}=ne(t);return s.some((e=>"postType"!==e.kind||e.name!==n||e.key!==o))})),je=(0,d.createRegistrySelector)((e=>t=>{const s=oe(t),n=re(t);return!e(u.store).getLastEntitySaveError("postType",s,n)})),Ee=(0,d.createRegistrySelector)((e=>t=>{const s=oe(t),n=re(t);return!!e(u.store).getLastEntitySaveError("postType",s,n)}));function Te(e){return Ce(e)&&Boolean(e.saving.options?.isAutosave)}function Be(e){return Ce(e)&&Boolean(e.saving.options?.isPreview)}function Ie(e){if(e.saving.pending||Ce(e))return;let t=me(e,"preview_link");t&&"draft"!==ne(e).status||(t=pe(e,"link"),t&&(t=(0,w.addQueryArgs)(t,{preview:!0})));const s=pe(e,"featured_media");return t&&s?(0,w.addQueryArgs)(t,{_thumbnail_id:s}):t}const Ne=(0,d.createRegistrySelector)((e=>()=>{const t=e(g.store).getBlocks();if(t.length>2)return null;let s;if(1===t.length&&(s=t[0].name,"core/embed"===s)){const e=t[0].attributes?.providerNameSlug;["youtube","vimeo"].includes(e)?s="core/video":["spotify","soundcloud"].includes(e)&&(s="core/audio")}switch(2===t.length&&"core/paragraph"===t[1].name&&(s=t[0].name),s){case"core/image":return"image";case"core/quote":case"core/pullquote":return"quote";case"core/gallery":return"gallery";case"core/video":return"video";case"core/audio":return"audio";default:return null}})),Re=(0,d.createRegistrySelector)((e=>t=>{const s=re(t),n=oe(t),o=e(u.store).getEditedEntityRecord("postType",n,s);if(o){if("function"==typeof o.content)return o.content(o);if(o.blocks)return(0,x.__unstableSerializeAndClean)(o.blocks);if(o.content)return o.content}return""}));function De(e){return Ce(e)&&!_e(e)&&"publish"===pe(e,"status")}function Ae(e){const t=pe(e,"permalink_template");return j.test(t)}function Me(e){const t=Oe(e);if(!t)return null;const{prefix:s,postName:n,suffix:o}=t;return Ae(e)?s+n+o:s}function Le(e){return pe(e,"slug")||(0,w.cleanForSlug)(pe(e,"title"))||re(e)}function Oe(e){const t=pe(e,"permalink_template");if(!t)return null;const s=pe(e,"slug")||pe(e,"generated_slug"),[n,o]=t.split(j);return{prefix:n,postName:s,suffix:o}}function Fe(e){return e.postLock.isLocked}function Ve(e){return Object.keys(e.postSavingLock).length>0}function Ue(e){return Object.keys(e.postAutosavingLock).length>0}function He(e){return e.postLock.isTakeover}function ze(e){return e.postLock.user}function Ge(e){return e.postLock.activePostLock}function $e(e){return Boolean(ne(e)._links?.hasOwnProperty("wp:action-unfiltered-html"))}const We=(0,d.createRegistrySelector)((e=>()=>!!e(C.store).get("core","isPublishSidebarEnabled"))),Ze=(0,d.createSelector)((e=>pe(e,"blocks")||(0,x.parse)(Re(e))),(e=>[pe(e,"blocks"),Re(e)]));function Ye(e,t){return e.removedPanels.includes(t)}const qe=(0,d.createRegistrySelector)((e=>(t,s)=>{const n=e(C.store).get("core","inactivePanels");return!Ye(t,s)&&!n?.includes(s)})),Ke=(0,d.createRegistrySelector)((e=>(t,s)=>{const n=e(C.store).get("core","openPanels");return!!n?.includes(s)}));function Qe(e){return k()("select('core/editor').getEditorSelectionStart",{since:"5.8",alternative:"select('core/editor').getEditorSelection"}),pe(e,"selection")?.selectionStart}function Xe(e){return k()("select('core/editor').getEditorSelectionStart",{since:"5.8",alternative:"select('core/editor').getEditorSelection"}),pe(e,"selection")?.selectionEnd}function Je(e){return pe(e,"selection")}function et(e){return!!e.postId}function tt(e){return e.editorSettings}function st(e){return e.renderingMode}const nt=(0,d.createRegistrySelector)((e=>t=>$(e(g.store)).isZoomOut()?"Desktop":t.deviceType));function ot(e){return e.listViewPanel}function rt(e){return!!e.blockInserterPanel}const it=(0,d.createRegistrySelector)((e=>()=>e(C.store).get("core","editorMode")??"visual"));function at(){return k()("select('core/editor').getStateBeforeOptimisticTransaction",{since:"5.7",hint:"No state history is kept on this store anymore"}),null}function lt(){return k()("select('core/editor').inSomeHistory",{since:"5.7",hint:"No state history is kept on this store anymore"}),!1}function ct(e){return(0,d.createRegistrySelector)((t=>(s,...n)=>(k()("`wp.data.select( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.select( 'core/block-editor' )."+e+"`",version:"6.2"}),t(g.store)[e](...n))))}const dt=ct("getBlockName"),ut=ct("isBlockValid"),pt=ct("getBlockAttributes"),mt=ct("getBlock"),ht=ct("getBlocks"),gt=ct("getClientIdsOfDescendants"),_t=ct("getClientIdsWithDescendants"),ft=ct("getGlobalBlockCount"),bt=ct("getBlocksByClientId"),yt=ct("getBlockCount"),xt=ct("getBlockSelectionStart"),vt=ct("getBlockSelectionEnd"),wt=ct("getSelectedBlockCount"),St=ct("hasSelectedBlock"),kt=ct("getSelectedBlockClientId"),Ct=ct("getSelectedBlock"),Pt=ct("getBlockRootClientId"),jt=ct("getBlockHierarchyRootClientId"),Et=ct("getAdjacentBlockClientId"),Tt=ct("getPreviousBlockClientId"),Bt=ct("getNextBlockClientId"),It=ct("getSelectedBlocksInitialCaretPosition"),Nt=ct("getMultiSelectedBlockClientIds"),Rt=ct("getMultiSelectedBlocks"),Dt=ct("getFirstMultiSelectedBlockClientId"),At=ct("getLastMultiSelectedBlockClientId"),Mt=ct("isFirstMultiSelectedBlock"),Lt=ct("isBlockMultiSelected"),Ot=ct("isAncestorMultiSelected"),Ft=ct("getMultiSelectedBlocksStartClientId"),Vt=ct("getMultiSelectedBlocksEndClientId"),Ut=ct("getBlockOrder"),Ht=ct("getBlockIndex"),zt=ct("isBlockSelected"),Gt=ct("hasSelectedInnerBlock"),$t=ct("isBlockWithinSelection"),Wt=ct("hasMultiSelection"),Zt=ct("isMultiSelecting"),Yt=ct("isSelectionEnabled"),qt=ct("getBlockMode"),Kt=ct("isTyping"),Qt=ct("isCaretWithinFormattedText"),Xt=ct("getBlockInsertionPoint"),Jt=ct("isBlockInsertionPointVisible"),es=ct("isValidTemplate"),ts=ct("getTemplate"),ss=ct("getTemplateLock"),ns=ct("canInsertBlockType"),os=ct("getInserterItems"),rs=ct("hasInserterItems"),is=ct("getBlockListSettings"),as=(0,d.createRegistrySelector)((e=>()=>(k()("select('core/editor').__experimentalGetDefaultTemplateTypes",{since:"6.8",alternative:"select('core/core-data').getCurrentTheme()?.default_template_types"}),e(u.store).getCurrentTheme()?.default_template_types))),ls=(0,d.createRegistrySelector)((e=>(0,d.createSelector)((()=>{k()("select('core/editor').__experimentalGetDefaultTemplatePartAreas",{since:"6.8",alternative:"select('core/core-data').getCurrentTheme()?.default_template_part_areas"});return(e(u.store).getCurrentTheme()?.default_template_part_areas||[]).map((e=>({...e,icon:H(e.icon)})))})))),cs=(0,d.createRegistrySelector)((e=>(0,d.createSelector)(((t,s)=>{k()("select('core/editor').__experimentalGetDefaultTemplateType",{since:"6.8"});const n=e(u.store).getCurrentTheme()?.default_template_types;return n?Object.values(n).find((e=>e.slug===s))??q:q})))),ds=(0,d.createRegistrySelector)((e=>(0,d.createSelector)(((t,s)=>{if(k()("select('core/editor').__experimentalGetTemplateInfo",{since:"6.8"}),!s)return q;const n=e(u.store).getCurrentTheme(),o=n?.default_template_types||[];return Y({template:s,templateAreas:n?.default_template_part_areas||[],templateTypes:o})})))),us=(0,d.createRegistrySelector)((e=>t=>{const s=oe(t),n=e(u.store).getPostType(s);return n?.labels?.singular_name}));function ps(e){return e.publishSidebarActive}const ms=window.wp.a11y,hs=window.wp.apiFetch;var gs=s.n(hs);const _s=window.wp.notices,fs=window.wp.i18n;function bs(e,t){return`wp-autosave-block-editor-post-${t?"auto-draft":e}`}function ys(e,t){window.sessionStorage.removeItem(bs(e,t))}const xs=(e,t,s)=>({dispatch:n})=>{n.setEditedPost(e.type,e.id);if("auto-draft"===e.status&&s){let o;o="content"in t?t.content:e.content.raw;let r=(0,x.parse)(o);r=(0,x.synchronizeBlocksWithTemplate)(r,s),n.resetEditorBlocks(r,{__unstableShouldCreateUndoLevel:!1})}t&&Object.values(t).some((([t,s])=>s!==(e[t]?.raw??e[t])))&&n.editPost(t)};function vs(){return k()("wp.data.dispatch( 'core/editor' ).__experimentalTearDownEditor",{since:"6.5"}),{type:"DO_NOTHING"}}function ws(){return k()("wp.data.dispatch( 'core/editor' ).resetPost",{since:"6.0",version:"6.3",alternative:"Initialize the editor with the setupEditorState action"}),{type:"DO_NOTHING"}}function Ss(){return k()("wp.data.dispatch( 'core/editor' ).updatePost",{since:"5.7",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function ks(e){return k()("wp.data.dispatch( 'core/editor' ).setupEditorState",{since:"6.5",alternative:"wp.data.dispatch( 'core/editor' ).setEditedPost"}),Cs(e.type,e.id)}function Cs(e,t){return{type:"SET_EDITED_POST",postType:e,postId:t}}const Ps=(e,t)=>({select:s,registry:n})=>{const{id:o,type:r}=s.getCurrentPost();n.dispatch(u.store).editEntityRecord("postType",r,o,e,t)},js=(e={})=>async({select:t,dispatch:s,registry:n})=>{if(!t.isEditedPostSaveable())return;const o=t.getEditedPostContent();e.isAutosave||s.editPost({content:o},{undoIgnore:!0});const r=t.getCurrentPost();let i={id:r.id,...n.select(u.store).getEntityRecordNonTransientEdits("postType",r.type,r.id),content:o};s({type:"REQUEST_POST_UPDATE_START",options:e});let a=!1;try{i=await(0,h.applyFiltersAsync)("editor.preSavePost",i,e)}catch(e){a=e}if(!a)try{await n.dispatch(u.store).saveEntityRecord("postType",r.type,i,e)}catch(e){a=e.message&&"unknown_error"!==e.code?e.message:(0,fs.__)("An error occurred while updating.")}if(a||(a=n.select(u.store).getLastEntitySaveError("postType",r.type,r.id)),!a)try{await(0,h.applyFilters)("editor.__unstableSavePost",Promise.resolve(),e)}catch(e){a=e}if(!a)try{await(0,h.doActionAsync)("editor.savePost",{id:r.id},e)}catch(e){a=e}if(s({type:"REQUEST_POST_UPDATE_FINISH",options:e}),a){const e=function(e){const{post:t,edits:s,error:n}=e;if(n&&"rest_autosave_no_changes"===n.code)return[];const o=-1!==["publish","private","future"].indexOf(t.status);if("offline_error"===n.code){const e={publish:(0,fs.__)("Publishing failed because you were offline."),private:(0,fs.__)("Publishing failed because you were offline."),future:(0,fs.__)("Scheduling failed because you were offline."),default:(0,fs.__)("Updating failed because you were offline.")};return[!o&&s.status in e?e[s.status]:e.default,{id:"editor-save"}]}const r={publish:(0,fs.__)("Publishing failed."),private:(0,fs.__)("Publishing failed."),future:(0,fs.__)("Scheduling failed."),default:(0,fs.__)("Updating failed.")};let i=!o&&s.status in r?r[s.status]:r.default;return n.message&&!/<\/?[^>]*>/.test(n.message)&&(i=[i,n.message].join(" ")),[i,{id:"editor-save"}]}({post:r,edits:i,error:a});e.length&&n.dispatch(_s.store).createErrorNotice(...e)}else{const s=t.getCurrentPost(),o=function(e){const{previousPost:t,post:s,postType:n}=e;if(e.options?.isAutosave)return[];const o=["publish","private","future"],r=o.includes(t.status),i=o.includes(s.status),a="trash"===s.status&&"trash"!==t.status;let l,c,d=n?.viewable??!1;a?(l=n.labels.item_trashed,d=!1):r||i?r&&!i?(l=n.labels.item_reverted_to_draft,d=!1):l=!r&&i?{publish:n.labels.item_published,private:n.labels.item_published_privately,future:n.labels.item_scheduled}[s.status]:n.labels.item_updated:(l=(0,fs.__)("Draft saved."),c=!0);const u=[];return d&&u.push({label:c?(0,fs.__)("View Preview"):n.labels.view_item,url:s.link,openInNewTab:!0}),[l,{id:"editor-save",type:"snackbar",actions:u}]}({previousPost:r,post:s,postType:await n.resolveSelect(u.store).getPostType(s.type),options:e});o.length&&n.dispatch(_s.store).createSuccessNotice(...o),e.isAutosave||n.dispatch(g.store).__unstableMarkLastChangeAsPersistent()}};function Es(){return k()("wp.data.dispatch( 'core/editor' ).refreshPost",{since:"6.0",version:"6.3",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}const Ts=()=>async({select:e,dispatch:t,registry:s})=>{const n=e.getCurrentPostType(),o=await s.resolveSelect(u.store).getPostType(n),{rest_base:r,rest_namespace:i="wp/v2"}=o;t({type:"REQUEST_POST_DELETE_START"});try{const s=e.getCurrentPost();await gs()({path:`/${i}/${r}/${s.id}`,method:"DELETE"}),await t.savePost()}catch(e){s.dispatch(_s.store).createErrorNotice(...(a={error:e},[a.error.message&&"unknown_error"!==a.error.code?a.error.message:(0,fs.__)("Trashing failed"),{id:"editor-trash-fail"}]))}var a;t({type:"REQUEST_POST_DELETE_FINISH"})},Bs=({local:e=!1,...t}={})=>async({select:s,dispatch:n})=>{const o=s.getCurrentPost();if("wp_template"!==o.type)if(e){const e=s.isEditedPostNew(),t=s.getEditedPostAttribute("title"),n=s.getEditedPostAttribute("content"),r=s.getEditedPostAttribute("excerpt");!function(e,t,s,n,o){window.sessionStorage.setItem(bs(e,t),JSON.stringify({post_title:s,content:n,excerpt:o}))}(o.id,e,t,n,r)}else await n.savePost({isAutosave:!0,...t})},Is=({forceIsAutosaveable:e}={})=>async({select:t,dispatch:s})=>{if((e||t.isEditedPostAutosaveable())&&!t.isPostLocked()){["draft","auto-draft"].includes(t.getEditedPostAttribute("status"))?await s.savePost({isPreview:!0}):await s.autosave({isPreview:!0})}return t.getEditedPostPreviewLink()},Ns=()=>({registry:e})=>{e.dispatch(u.store).redo()},Rs=()=>({registry:e})=>{e.dispatch(u.store).undo()};function Ds(){return k()("wp.data.dispatch( 'core/editor' ).createUndoLevel",{since:"6.0",version:"6.3",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function As(e){return{type:"UPDATE_POST_LOCK",lock:e}}const Ms=()=>({registry:e})=>{e.dispatch(C.store).set("core","isPublishSidebarEnabled",!0)},Ls=()=>({registry:e})=>{e.dispatch(C.store).set("core","isPublishSidebarEnabled",!1)};function Os(e){return{type:"LOCK_POST_SAVING",lockName:e}}function Fs(e){return{type:"UNLOCK_POST_SAVING",lockName:e}}function Vs(e){return{type:"LOCK_POST_AUTOSAVING",lockName:e}}function Us(e){return{type:"UNLOCK_POST_AUTOSAVING",lockName:e}}const Hs=(e,t={})=>({select:s,dispatch:n,registry:o})=>{const{__unstableShouldCreateUndoLevel:r,selection:i}=t,a={blocks:e,selection:i};if(!1!==r){const{id:e,type:t}=s.getCurrentPost();if(o.select(u.store).getEditedEntityRecord("postType",t,e).blocks===a.blocks)return void o.dispatch(u.store).__unstableCreateUndoLevel("postType",t,e);a.content=({blocks:e=[]})=>(0,x.__unstableSerializeAndClean)(e)}n.editPost(a)};function zs(e){return{type:"UPDATE_EDITOR_SETTINGS",settings:e}}const Gs=e=>({dispatch:t,registry:s,select:n})=>{n.__unstableIsEditorReady()&&(s.dispatch(g.store).clearSelectedBlock(),t.editPost({selection:void 0},{undoIgnore:!0})),t({type:"SET_RENDERING_MODE",mode:e})};function $s(e){return{type:"SET_DEVICE_TYPE",deviceType:e}}const Ws=e=>({registry:t})=>{const s=t.select(C.store).get("core","inactivePanels")??[];let n;n=!!s?.includes(e)?s.filter((t=>t!==e)):[...s,e],t.dispatch(C.store).set("core","inactivePanels",n)},Zs=e=>({registry:t})=>{const s=t.select(C.store).get("core","openPanels")??[];let n;n=!!s?.includes(e)?s.filter((t=>t!==e)):[...s,e],t.dispatch(C.store).set("core","openPanels",n)};function Ys(e){return{type:"REMOVE_PANEL",panelName:e}}const qs=e=>({dispatch:t,registry:s})=>{"object"==typeof e&&e.hasOwnProperty("rootClientId")&&e.hasOwnProperty("insertionIndex")&&$(s.dispatch(g.store)).setInsertionPoint({rootClientId:e.rootClientId,index:e.insertionIndex}),t({type:"SET_IS_INSERTER_OPENED",value:e})};function Ks(e){return{type:"SET_IS_LIST_VIEW_OPENED",isOpen:e}}const Qs=({createNotice:e=!0}={})=>({dispatch:t,registry:s})=>{const n=s.select(C.store).get("core","distractionFree");n&&s.dispatch(C.store).set("core","fixedToolbar",!1),n||s.batch((()=>{s.dispatch(C.store).set("core","fixedToolbar",!0),t.setIsInserterOpened(!1),t.setIsListViewOpened(!1),$(s.dispatch(g.store)).resetZoomLevel()})),s.batch((()=>{s.dispatch(C.store).set("core","distractionFree",!n),e&&s.dispatch(_s.store).createInfoNotice(n?(0,fs.__)("Distraction free mode deactivated."):(0,fs.__)("Distraction free mode activated."),{id:"core/editor/distraction-free-mode/notice",type:"snackbar",actions:[{label:(0,fs.__)("Undo"),onClick:()=>{s.batch((()=>{s.dispatch(C.store).set("core","fixedToolbar",n),s.dispatch(C.store).toggle("core","distractionFree")}))}}]})}))},Xs=()=>({registry:e})=>{e.dispatch(C.store).toggle("core","focusMode");const t=e.select(C.store).get("core","focusMode");e.dispatch(_s.store).createInfoNotice(t?(0,fs.__)("Spotlight mode activated."):(0,fs.__)("Spotlight mode deactivated."),{id:"core/editor/toggle-spotlight-mode/notice",type:"snackbar",actions:[{label:(0,fs.__)("Undo"),onClick:()=>{e.dispatch(C.store).toggle("core","focusMode")}}]})},Js=()=>({registry:e})=>{e.dispatch(C.store).toggle("core","fixedToolbar");const t=e.select(C.store).get("core","fixedToolbar");e.dispatch(_s.store).createInfoNotice(t?(0,fs.__)("Top toolbar activated."):(0,fs.__)("Top toolbar deactivated."),{id:"core/editor/toggle-top-toolbar/notice",type:"snackbar",actions:[{label:(0,fs.__)("Undo"),onClick:()=>{e.dispatch(C.store).toggle("core","fixedToolbar")}}]})},en=e=>({dispatch:t,registry:s})=>{if(s.dispatch(C.store).set("core","editorMode",e),"visual"!==e&&(s.dispatch(g.store).clearSelectedBlock(),$(s.dispatch(g.store)).resetZoomLevel()),"visual"===e)(0,ms.speak)((0,fs.__)("Visual editor selected"),"assertive");else if("text"===e){s.select(C.store).get("core","distractionFree")&&t.toggleDistractionFree(),(0,ms.speak)((0,fs.__)("Code editor selected"),"assertive")}};function tn(){return{type:"OPEN_PUBLISH_SIDEBAR"}}function sn(){return{type:"CLOSE_PUBLISH_SIDEBAR"}}function nn(){return{type:"TOGGLE_PUBLISH_SIDEBAR"}}const on=e=>(...t)=>({registry:s})=>{k()("`wp.data.dispatch( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.dispatch( 'core/block-editor' )."+e+"`",version:"6.2"}),s.dispatch(g.store)[e](...t)},rn=on("resetBlocks"),an=on("receiveBlocks"),ln=on("updateBlock"),cn=on("updateBlockAttributes"),dn=on("selectBlock"),un=on("startMultiSelect"),pn=on("stopMultiSelect"),mn=on("multiSelect"),hn=on("clearSelectedBlock"),gn=on("toggleSelection"),_n=on("replaceBlocks"),fn=on("replaceBlock"),bn=on("moveBlocksDown"),yn=on("moveBlocksUp"),xn=on("moveBlockToPosition"),vn=on("insertBlock"),wn=on("insertBlocks"),Sn=on("showInsertionPoint"),kn=on("hideInsertionPoint"),Cn=on("setTemplateValidity"),Pn=on("synchronizeTemplate"),jn=on("mergeBlocks"),En=on("removeBlocks"),Tn=on("removeBlock"),Bn=on("toggleBlockMode"),In=on("startTyping"),Nn=on("stopTyping"),Rn=on("enterFormattedText"),Dn=on("exitFormattedText"),An=on("insertDefaultBlock"),Mn=on("updateBlockListSettings"),Ln=window.wp.htmlEntities;function On(e){return!!e&&(e.source===D&&(Boolean(e?.plugin)||e?.has_theme_file))}var Fn=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})});var Vn={id:"view-post",label:(0,fs._x)("View","verb"),isPrimary:!0,icon:Fn,isEligible:e=>"trash"!==e.status,callback(e,{onActionPerformed:t}){const s=e[0];window.open(s?.link,"_blank"),t&&t(e)}};var Un={id:"view-post-revisions",context:"list",label(e){const t=e[0]._links?.["version-history"]?.[0]?.count??0;return(0,fs.sprintf)((0,fs.__)("View revisions (%d)"),t)},isEligible(e){if("trash"===e.status)return!1;return!!(e?._links?.["predecessor-version"]?.[0]?.id??null)&&(e?._links?.["version-history"]?.[0]?.count??0)>1},callback(e,{onActionPerformed:t}){const s=e[0],n=(0,w.addQueryArgs)("revision.php",{revision:s?._links?.["predecessor-version"]?.[0]?.id});document.location.href=n,t&&t(e)}};const Hn=window.wp.components;var zn=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z"})});var Gn=function(){return Gn=Object.assign||function(e){for(var t,s=1,n=arguments.length;s<n;s++)for(var o in t=arguments[s])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Gn.apply(this,arguments)};Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;function $n(e){return e.toLowerCase()}var Wn=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],Zn=/[^A-Z0-9]+/gi;function Yn(e,t,s){return t instanceof RegExp?e.replace(t,s):t.reduce((function(e,t){return e.replace(t,s)}),e)}function qn(e,t){return void 0===t&&(t={}),function(e,t){void 0===t&&(t={});for(var s=t.splitRegexp,n=void 0===s?Wn:s,o=t.stripRegexp,r=void 0===o?Zn:o,i=t.transform,a=void 0===i?$n:i,l=t.delimiter,c=void 0===l?" ":l,d=Yn(Yn(e,n,"$1\0$2"),r,"\0"),u=0,p=d.length;"\0"===d.charAt(u);)u++;for(;"\0"===d.charAt(p-1);)p--;return d.slice(u,p).split("\0").map(a).join(c)}(e,Gn({delimiter:"."},t))}function Kn(e,t){return void 0===t&&(t={}),qn(e,Gn({delimiter:"-"},t))}function Qn(e,t){return`fields-create-template-part-modal__area-option-${e}-${t}`}function Xn(e,t){return`fields-create-template-part-modal__area-option-description-${e}-${t}`}function Jn({modalTitle:e,...t}){const s=(0,d.useSelect)((e=>e(u.store).getPostType("wp_template_part")?.labels?.add_new_item),[]);return(0,c.jsx)(Hn.Modal,{title:e||s,onRequestClose:t.closeModal,overlayClassName:"fields-create-template-part-modal",focusOnMount:"firstContentElement",size:"medium",children:(0,c.jsx)(to,{...t})})}const eo=e=>"header"===e?O:"footer"===e?F:"sidebar"===e?V:U;function to({defaultArea:e="uncategorized",blocks:t=[],confirmLabel:s=(0,fs.__)("Add"),closeModal:n,onCreate:o,onError:r,defaultTitle:i=""}){const{createErrorNotice:a}=(0,d.useDispatch)(_s.store),{saveEntityRecord:l}=(0,d.useDispatch)(u.store),h=(0,d.useSelect)((e=>e(u.store).getEntityRecords("postType","wp_template_part",{per_page:-1})),[])??[],[g,_]=(0,p.useState)(i),[f,b]=(0,p.useState)(e),[y,v]=(0,p.useState)(!1),w=(0,m.useInstanceId)(Jn),S=(0,d.useSelect)((e=>e(u.store).getCurrentTheme()?.default_template_part_areas),[]);async function k(){if(g&&!y)try{v(!0);const e=((e,t)=>{const s=e.toLowerCase(),n=t.map((e=>e.title.rendered.toLowerCase()));if(!n.includes(s))return e;let o=2;for(;n.includes(`${s} ${o}`);)o++;return`${e} ${o}`})(g,h),s=(e=>Kn(e).replace(/[^\w-]+/g,"")||"wp-custom-part")(e),n=await l("postType","wp_template_part",{slug:s,title:e,content:(0,x.serialize)(t),area:f},{throwOnError:!0});await o(n)}catch(e){const t=e instanceof Error&&"code"in e&&e.message&&"unknown_error"!==e.code?e.message:(0,fs.__)("An error occurred while creating the template part.");a(t,{type:"snackbar"}),r?.()}finally{v(!1)}}return(0,c.jsx)("form",{onSubmit:async e=>{e.preventDefault(),await k()},children:(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"4",children:[(0,c.jsx)(Hn.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,fs.__)("Name"),value:g,onChange:_,required:!0}),(0,c.jsxs)("fieldset",{className:"fields-create-template-part-modal__area-fieldset",children:[(0,c.jsx)(Hn.BaseControl.VisualLabel,{as:"legend",children:(0,fs.__)("Area")}),(0,c.jsx)("div",{className:"fields-create-template-part-modal__area-radio-group",children:(S??[]).map((e=>{const t=eo(e.icon);return(0,c.jsxs)("div",{className:"fields-create-template-part-modal__area-radio-wrapper",children:[(0,c.jsx)("input",{type:"radio",id:Qn(e.area,w),name:`fields-create-template-part-modal__area-${w}`,value:e.area,checked:f===e.area,onChange:()=>{b(e.area)},"aria-describedby":Xn(e.area,w)}),(0,c.jsx)(Hn.Icon,{icon:t,className:"fields-create-template-part-modal__area-radio-icon"}),(0,c.jsx)("label",{htmlFor:Qn(e.area,w),className:"fields-create-template-part-modal__area-radio-label",children:e.label}),(0,c.jsx)(Hn.Icon,{icon:zn,className:"fields-create-template-part-modal__area-radio-checkmark"}),(0,c.jsx)("p",{className:"fields-create-template-part-modal__area-radio-description",id:Xn(e.area,w),children:e.description})]},e.area)}))})]}),(0,c.jsxs)(Hn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{n()},children:(0,fs.__)("Cancel")}),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit","aria-disabled":!g||y,isBusy:y,children:s})]})]})})}function so(e){return"wp_template"===e.type||"wp_template_part"===e.type}function no(e,t=(0,fs.__)("(no title)")){let s="";return"string"==typeof e.title?s=(0,Ln.decodeEntities)(e.title):e.title&&"rendered"in e.title?s=(0,Ln.decodeEntities)(e.title.rendered):e.title&&"raw"in e.title&&(s=(0,Ln.decodeEntities)(e.title.raw)),s||t}function oo(e){return!!e&&([e.source,e.source].includes("custom")&&!Boolean("wp_template"===e.type&&e?.plugin)&&!e.has_theme_file)}const ro={id:"duplicate-template-part",label:(0,fs._x)("Duplicate","action label"),isEligible:e=>"wp_template_part"===e.type,modalHeader:(0,fs._x)("Duplicate template part","action label"),modalFocusOnMount:"firstContentElement",RenderModal:({items:e,closeModal:t})=>{const[s]=e,n=(0,p.useMemo)((()=>s.blocks??(0,x.parse)("string"==typeof s.content?s.content:s.content.raw,{__unstableSkipMigrationLogs:!0})),[s.content,s.blocks]),{createSuccessNotice:o}=(0,d.useDispatch)(_s.store);return(0,c.jsx)(to,{blocks:n,defaultArea:s.area,defaultTitle:(0,fs.sprintf)((0,fs._x)("%s (Copy)","template part"),no(s)),onCreate:function(e){o((0,fs.sprintf)((0,fs._x)('"%s" duplicated.',"template part"),no(e)),{type:"snackbar",id:"edit-site-patterns-success"}),t?.()},onError:t,confirmLabel:(0,fs._x)("Duplicate","action label"),closeModal:t??(()=>{})})}};var io=ro;const ao=window.wp.patterns,{lock:lo,unlock:co}=(0,z.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/fields"),{CreatePatternModalContents:uo,useDuplicatePatternProps:po}=co(ao.privateApis),mo={id:"duplicate-pattern",label:(0,fs._x)("Duplicate","action label"),isEligible:e=>"wp_template_part"!==e.type,modalHeader:(0,fs._x)("Duplicate pattern","action label"),modalFocusOnMount:"firstContentElement",RenderModal:({items:e,closeModal:t})=>{const[s]=e,n=po({pattern:s,onSuccess:()=>t?.()});return(0,c.jsx)(uo,{onClose:t,confirmLabel:(0,fs._x)("Duplicate","action label"),...n})}};var ho=mo;const{PATTERN_TYPES:go}=co(ao.privateApis),_o={id:"rename-post",label:(0,fs.__)("Rename"),modalFocusOnMount:"firstContentElement",isEligible:e=>"trash"!==e.status&&(["wp_template","wp_template_part",...Object.values(go)].includes(e.type)?function(e){return"wp_template"===e.type}(e)?oo(e)&&e.is_custom&&e.permissions?.update:function(e){return"wp_template_part"===e.type}(e)?"custom"===e.source&&!e?.has_theme_file&&e.permissions?.update:e.type===go.user&&e.permissions?.update:e.permissions?.update),RenderModal:({items:e,closeModal:t,onActionPerformed:s})=>{const[n]=e,[o,r]=(0,p.useState)((()=>no(n,""))),{editEntityRecord:i,saveEditedEntityRecord:a}=(0,d.useDispatch)(u.store),{createSuccessNotice:l,createErrorNotice:m}=(0,d.useDispatch)(_s.store);return(0,c.jsx)("form",{onSubmit:async function(c){c.preventDefault();try{await i("postType",n.type,n.id,{title:o}),r(""),t?.(),await a("postType",n.type,n.id,{throwOnError:!0}),l((0,fs.__)("Name updated"),{type:"snackbar"}),s?.(e)}catch(e){const t=e,s=t.message&&"unknown_error"!==t.code?t.message:(0,fs.__)("An error occurred while updating the name");m(s,{type:"snackbar"})}},children:(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"5",children:[(0,c.jsx)(Hn.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,fs.__)("Name"),value:o,onChange:r,required:!0}),(0,c.jsxs)(Hn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},children:(0,fs.__)("Cancel")}),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",children:(0,fs.__)("Save")})]})]})})}};var fo=_o;const bo={id:"order-pages",label:(0,fs.__)("Order"),isEligible:({status:e})=>"trash"!==e,modalFocusOnMount:"firstContentElement",RenderModal:function({items:e,closeModal:t,onActionPerformed:s}){const[n,o]=(0,p.useState)(e[0]),{editEntityRecord:r,saveEditedEntityRecord:i}=(0,d.useDispatch)(u.store),{createSuccessNotice:a,createErrorNotice:l}=(0,d.useDispatch)(_s.store),m=function(e){return"number"==typeof e.menu_order&&Number.isInteger(e.menu_order)&&e.menu_order>0}(n);return(0,c.jsx)("form",{onSubmit:async function(o){if(o.preventDefault(),m)try{await r("postType",n.type,n.id,{menu_order:n.menu_order}),t?.(),await i("postType",n.type,n.id,{throwOnError:!0}),a((0,fs.__)("Order updated."),{type:"snackbar"}),s?.(e)}catch(e){const t=e,s=t.message&&"unknown_error"!==t.code?t.message:(0,fs.__)("An error occurred while updating the order");l(s,{type:"snackbar"})}},children:(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"5",children:[(0,c.jsx)("div",{children:(0,fs.__)("Determines the order of pages. Pages with the same order value are sorted alphabetically. Negative order values are supported.")}),(0,c.jsx)(Hn.__experimentalInputControl,{__next40pxDefaultSize:!0,label:(0,fs.__)("Order"),type:"number",value:"number"==typeof n.menu_order&&Number.isInteger(n.menu_order)?String(n.menu_order):"",onChange:e=>{const t=parseInt(e,10);o({...n,menu_order:isNaN(t)?void 0:t})}}),(0,c.jsxs)(Hn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},children:(0,fs.__)("Cancel")}),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",accessibleWhenDisabled:!0,disabled:!m,children:(0,fs.__)("Save")})]})]})})}};var yo=bo;"stream"in Blob.prototype||Object.defineProperty(Blob.prototype,"stream",{value(){return new Response(this).body}}),"setBigUint64"in DataView.prototype||Object.defineProperty(DataView.prototype,"setBigUint64",{value(e,t,s){const n=Number(0xffffffffn&t),o=Number(t>>32n);this.setUint32(e+(s?0:4),n,s),this.setUint32(e+(s?4:0),o,s)}});var xo=e=>new DataView(new ArrayBuffer(e)),vo=e=>new Uint8Array(e.buffer||e),wo=e=>(new TextEncoder).encode(String(e)),So=e=>Math.min(4294967295,Number(e)),ko=e=>Math.min(65535,Number(e));function Co(e,t,s){void 0===t||t instanceof Date||(t=new Date(t));const n=void 0!==e;if(s||(s=n?436:509),e instanceof File)return{isFile:n,t:t||new Date(e.lastModified),bytes:e.stream(),mode:s};if(e instanceof Response)return{isFile:n,t:t||new Date(e.headers.get("Last-Modified")||Date.now()),bytes:e.body,mode:s};if(void 0===t)t=new Date;else if(isNaN(t))throw new Error("Invalid modification date.");if(!n)return{isFile:n,t,mode:s};if("string"==typeof e)return{isFile:n,t,bytes:wo(e),mode:s};if(e instanceof Blob)return{isFile:n,t,bytes:e.stream(),mode:s};if(e instanceof Uint8Array||e instanceof ReadableStream)return{isFile:n,t,bytes:e,mode:s};if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))return{isFile:n,t,bytes:vo(e),mode:s};if(Symbol.asyncIterator in e)return{isFile:n,t,bytes:Po(e[Symbol.asyncIterator]()),mode:s};throw new TypeError("Unsupported input format.")}function Po(e,t=e){return new ReadableStream({async pull(t){let s=0;for(;t.desiredSize>s;){const n=await e.next();if(!n.value){t.close();break}{const e=jo(n.value);t.enqueue(e),s+=e.byteLength}}},cancel(e){t.throw?.(e)}})}function jo(e){return"string"==typeof e?wo(e):e instanceof Uint8Array?e:vo(e)}function Eo(e,t,s){let[n,o]=function(e){return e?e instanceof Uint8Array?[e,1]:ArrayBuffer.isView(e)||e instanceof ArrayBuffer?[vo(e),1]:[wo(e),0]:[void 0,0]}(t);if(e instanceof File)return{i:Bo(n||wo(e.name)),o:BigInt(e.size),u:o};if(e instanceof Response){const t=e.headers.get("content-disposition"),r=t&&t.match(/;\s*filename\*?\s*=\s*(?:UTF-\d+''|)["']?([^;"'\r\n]*)["']?(?:;|$)/i),i=r&&r[1]||e.url&&new URL(e.url).pathname.split("/").findLast(Boolean),a=i&&decodeURIComponent(i),l=s||+e.headers.get("content-length");return{i:Bo(n||wo(a)),o:BigInt(l),u:o}}return n=Bo(n,void 0!==e||void 0!==s),"string"==typeof e?{i:n,o:BigInt(wo(e).length),u:o}:e instanceof Blob?{i:n,o:BigInt(e.size),u:o}:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?{i:n,o:BigInt(e.byteLength),u:o}:{i:n,o:To(e,s),u:o}}function To(e,t){return t>-1?BigInt(t):e?void 0:0n}function Bo(e,t=1){if(!e||e.every((e=>47===e)))throw new Error("The file must have a name.");if(t)for(;47===e[e.length-1];)e=e.subarray(0,-1);else 47!==e[e.length-1]&&(e=new Uint8Array([...e,47]));return e}var Io=new Uint32Array(256);for(let e=0;e<256;++e){let t=e;for(let e=0;e<8;++e)t=t>>>1^(1&t&&3988292384);Io[e]=t}function No(e,t=0){t=~t;for(var s=0,n=e.length;s<n;s++)t=t>>>8^Io[255&t^e[s]];return~t>>>0}function Ro(e,t,s=0){const n=e.getSeconds()>>1|e.getMinutes()<<5|e.getHours()<<11,o=e.getDate()|e.getMonth()+1<<5|e.getFullYear()-1980<<9;t.setUint16(s,n,1),t.setUint16(s+2,o,1)}function Do({i:e,u:t},s){return 8*(!t||(s??function(e){try{Ao.decode(e)}catch{return 0}return 1}(e)))}var Ao=new TextDecoder("utf8",{fatal:1});function Mo(e,t=0){const s=xo(30);return s.setUint32(0,1347093252),s.setUint32(4,754976768|t),Ro(e.t,s,10),s.setUint16(26,e.i.length,1),vo(s)}async function*Lo(e){let{bytes:t}=e;if("then"in t&&(t=await t),t instanceof Uint8Array)yield t,e.l=No(t,0),e.o=BigInt(t.length);else{e.o=0n;const s=t.getReader();for(;;){const{value:t,done:n}=await s.read();if(n)break;e.l=No(t,e.l),e.o+=BigInt(t.length),yield t}}}function Oo(e,t){const s=xo(16+(t?8:0));return s.setUint32(0,1347094280),s.setUint32(4,e.isFile?e.l:0,1),t?(s.setBigUint64(8,e.o,1),s.setBigUint64(16,e.o,1)):(s.setUint32(8,So(e.o),1),s.setUint32(12,So(e.o),1)),vo(s)}function Fo(e,t,s=0,n=0){const o=xo(46);return o.setUint32(0,1347092738),o.setUint32(4,755182848),o.setUint16(8,2048|s),Ro(e.t,o,12),o.setUint32(16,e.isFile?e.l:0,1),o.setUint32(20,So(e.o),1),o.setUint32(24,So(e.o),1),o.setUint16(28,e.i.length,1),o.setUint16(30,n,1),o.setUint16(40,e.mode|(e.isFile?32768:16384),1),o.setUint32(42,So(t),1),vo(o)}function Vo(e,t,s){const n=xo(s);return n.setUint16(0,1,1),n.setUint16(2,s-4,1),16&s&&(n.setBigUint64(4,e.o,1),n.setBigUint64(12,e.o,1)),n.setBigUint64(s-8,t,1),vo(n)}function Uo(e){return e instanceof File||e instanceof Response?[[e],[e]]:[[e.input,e.name,e.size],[e.input,e.lastModified,e.mode]]}function Ho(e,t={}){const s={"Content-Type":"application/zip","Content-Disposition":"attachment"};return("bigint"==typeof t.length||Number.isInteger(t.length))&&t.length>0&&(s["Content-Length"]=String(t.length)),t.metadata&&(s["Content-Length"]=String((e=>function(e){let t=BigInt(22),s=0n,n=0;for(const o of e){if(!o.i)throw new Error("Every file must have a non-empty name.");if(void 0===o.o)throw new Error(`Missing size for file "${(new TextDecoder).decode(o.i)}".`);const e=o.o>=0xffffffffn,r=s>=0xffffffffn;s+=BigInt(46+o.i.length+(e&&8))+o.o,t+=BigInt(o.i.length+46+(12*r|28*e)),n||(n=e)}return(n||s>=0xffffffffn)&&(t+=BigInt(76)),t+s}(function*(e){for(const t of e)yield Eo(...Uo(t)[0])}(e)))(t.metadata))),new Response(zo(e,t),{headers:s})}function zo(e,t={}){const s=function(e){const t=e[Symbol.iterator in e?Symbol.iterator:Symbol.asyncIterator]();return{async next(){const e=await t.next();if(e.done)return e;const[s,n]=Uo(e.value);return{done:0,value:Object.assign(Co(...n),Eo(...s))}},throw:t.throw?.bind(t),[Symbol.asyncIterator](){return this}}}(e);return Po(async function*(e,t){const s=[];let n=0n,o=0n,r=0;for await(const i of e){const e=Do(i,t.buffersAreUTF8);yield Mo(i,e),yield new Uint8Array(i.i),i.isFile&&(yield*Lo(i));const a=i.o>=0xffffffffn,l=12*(n>=0xffffffffn)|28*a;yield Oo(i,a),s.push(Fo(i,n,e,l)),s.push(i.i),l&&s.push(Vo(i,n,l)),a&&(n+=8n),o++,n+=BigInt(46+i.i.length)+i.o,r||(r=a)}let i=0n;for(const e of s)yield e,i+=BigInt(e.length);if(r||n>=0xffffffffn){const e=xo(76);e.setUint32(0,1347094022),e.setBigUint64(4,BigInt(44),1),e.setUint32(12,755182848),e.setBigUint64(24,o,1),e.setBigUint64(32,o,1),e.setBigUint64(40,i,1),e.setBigUint64(48,n,1),e.setUint32(56,1347094023),e.setBigUint64(64,n+i,1),e.setUint32(72,1,1),yield vo(e)}const a=xo(22);a.setUint32(0,1347093766),a.setUint16(8,ko(o),1),a.setUint16(10,ko(o),1),a.setUint32(12,So(i),1),a.setUint32(16,So(n),1),yield vo(a)}(s,t),s)}const Go=window.wp.blob;var $o=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.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 Wo(e){return JSON.stringify({__file:e.type,title:no(e),content:"string"==typeof e.content?e.content:e.content?.raw,syncStatus:e.wp_pattern_sync_status},null,2)}var Zo={id:"export-pattern",label:(0,fs.__)("Export as JSON"),icon:$o,supportsBulk:!0,isEligible:e=>"wp_block"===e.type,callback:async e=>{if(1===e.length)return(0,Go.downloadBlob)(`${Kn(no(e[0])||e[0].slug)}.json`,Wo(e[0]),"application/json");const t={},s=e.map((e=>{const s=Kn(no(e)||e.slug);return t[s]=(t[s]||0)+1,{name:s+(t[s]>1?"-"+(t[s]-1):"")+".json",lastModified:new Date,input:Wo(e)}}));return(0,Go.downloadBlob)((0,fs.__)("patterns-export")+".zip",await Ho(s).blob(),"application/zip")}},Yo=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M5.5 12h1.75l-2.5 3-2.5-3H4a8 8 0 113.134 6.35l.907-1.194A6.5 6.5 0 105.5 12zm9.53 1.97l-2.28-2.28V8.5a.75.75 0 00-1.5 0V12a.747.747 0 00.218.529l1.282-.84-1.28.842 2.5 2.5a.75.75 0 101.06-1.061z"})});var qo={id:"restore",label:(0,fs.__)("Restore"),isPrimary:!0,icon:Yo,supportsBulk:!0,isEligible:e=>!so(e)&&"wp_block"!==e.type&&"trash"===e.status&&e.permissions?.update,async callback(e,{registry:t,onActionPerformed:s}){const{createSuccessNotice:n,createErrorNotice:o}=t.dispatch(_s.store),{editEntityRecord:r,saveEditedEntityRecord:i}=t.dispatch(u.store);await Promise.allSettled(e.map((e=>r("postType",e.type,e.id,{status:"draft"}))));const a=await Promise.allSettled(e.map((e=>i("postType",e.type,e.id,{throwOnError:!0}))));if(a.every((({status:e})=>"fulfilled"===e))){let t;t=1===e.length?(0,fs.sprintf)((0,fs.__)('"%s" has been restored.'),no(e[0])):"page"===e[0].type?(0,fs.sprintf)((0,fs.__)("%d pages have been restored."),e.length):(0,fs.sprintf)((0,fs.__)("%d posts have been restored."),e.length),n(t,{type:"snackbar",id:"restore-post-action"}),s&&s(e)}else{let e;if(1===a.length){const t=a[0];e=t.reason?.message?t.reason.message:(0,fs.__)("An error occurred while restoring the post.")}else{const t=new Set,s=a.filter((({status:e})=>"rejected"===e));for(const e of s){const s=e;s.reason?.message&&t.add(s.reason.message)}e=0===t.size?(0,fs.__)("An error occurred while restoring the posts."):1===t.size?(0,fs.sprintf)((0,fs.__)("An error occurred while restoring the posts: %s"),[...t][0]):(0,fs.sprintf)((0,fs.__)("Some errors occurred while restoring the posts: %s"),[...t].join(","))}o(e,{type:"snackbar"})}}};const Ko=async(e,{allowUndo:t=!0}={})=>{const s="edit-site-template-reverted";var n;if((0,d.dispatch)(_s.store).removeNotice(s),(n=e)&&"custom"===n.source&&(Boolean(n?.plugin)||n?.has_theme_file))try{const n=(0,d.select)(u.store).getEntityConfig("postType",e.type);if(!n)return void(0,d.dispatch)(_s.store).createErrorNotice((0,fs.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const o=(0,w.addQueryArgs)(`${n.baseURL}/${e.id}`,{context:"edit",source:e.origin}),r=await gs()({path:o});if(!r)return void(0,d.dispatch)(_s.store).createErrorNotice((0,fs.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const i=({blocks:e=[]})=>(0,x.__unstableSerializeAndClean)(e),a=(0,d.select)(u.store).getEditedEntityRecord("postType",e.type,e.id);(0,d.dispatch)(u.store).editEntityRecord("postType",e.type,e.id,{content:i,blocks:a.blocks,source:"custom"},{undoIgnore:!0});const l=(0,x.parse)(r?.content?.raw);if((0,d.dispatch)(u.store).editEntityRecord("postType",e.type,r.id,{content:i,blocks:l,source:"theme"}),t){const t=()=>{(0,d.dispatch)(u.store).editEntityRecord("postType",e.type,a.id,{content:i,blocks:a.blocks,source:"custom"})};(0,d.dispatch)(_s.store).createSuccessNotice((0,fs.__)("Template reset."),{type:"snackbar",id:s,actions:[{label:(0,fs.__)("Undo"),onClick:t}]})}}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,fs.__)("Template revert failed. Please reload.");(0,d.dispatch)(_s.store).createErrorNotice(t,{type:"snackbar"})}else(0,d.dispatch)(_s.store).createErrorNotice((0,fs.__)("This template is not revertable."),{type:"snackbar"})},Qo={id:"reset-post",label:(0,fs.__)("Reset"),isEligible:e=>so(e)&&"custom"===e?.source&&(Boolean("wp_template"===e.type&&e?.plugin)||e?.has_theme_file),icon:Yo,supportsBulk:!0,hideModalHeader:!0,modalFocusOnMount:"firstContentElement",RenderModal:({items:e,closeModal:t,onActionPerformed:s})=>{const[n,o]=(0,p.useState)(!1),{saveEditedEntityRecord:r}=(0,d.useDispatch)(u.store),{createSuccessNotice:i,createErrorNotice:a}=(0,d.useDispatch)(_s.store);return(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"5",children:[(0,c.jsx)(Hn.__experimentalText,{children:(0,fs.__)("Reset to default and clear all customizations?")}),(0,c.jsxs)(Hn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,disabled:n,accessibleWhenDisabled:!0,children:(0,fs.__)("Cancel")}),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:async()=>{o(!0),await(async()=>{try{for(const t of e)await Ko(t,{allowUndo:!1}),await r("postType",t.type,t.id);i(e.length>1?(0,fs.sprintf)((0,fs.__)("%d items reset."),e.length):(0,fs.sprintf)((0,fs.__)('"%s" reset.'),no(e[0])),{type:"snackbar",id:"revert-template-action"})}catch(t){let s;s="wp_template"===e[0].type?1===e.length?(0,fs.__)("An error occurred while reverting the template."):(0,fs.__)("An error occurred while reverting the templates."):1===e.length?(0,fs.__)("An error occurred while reverting the template part."):(0,fs.__)("An error occurred while reverting the template parts.");const n=t,o=n.message&&"unknown_error"!==n.code?n.message:s;a(o,{type:"snackbar"})}})(),s?.(e),o(!1),t?.()},isBusy:n,disabled:n,accessibleWhenDisabled:!0,children:(0,fs.__)("Reset")})]})]})}};var Xo=Qo,Jo=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z"})});function er(e){const t=new Set;if(1===e.length){const s=e[0];s.reason?.message&&t.add(s.reason.message)}else{const s=e.filter((({status:e})=>"rejected"===e));for(const e of s){const s=e;s.reason?.message&&t.add(s.reason.message)}}return t}const{PATTERN_TYPES:tr}=co(ao.privateApis),sr={id:"delete-post",label:(0,fs.__)("Delete"),isPrimary:!0,icon:Jo,isEligible:e=>so(e)?oo(e):e.type===tr.user,supportsBulk:!0,hideModalHeader:!0,modalFocusOnMount:"firstContentElement",RenderModal:({items:e,closeModal:t,onActionPerformed:s})=>{const[n,o]=(0,p.useState)(!1),r=e.every((e=>so(e)&&e?.has_theme_file));return(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"5",children:[(0,c.jsx)(Hn.__experimentalText,{children:e.length>1?(0,fs.sprintf)((0,fs._n)("Delete %d item?","Delete %d items?",e.length),e.length):(0,fs.sprintf)((0,fs._x)('Delete "%s"?',"template part"),no(e[0]))}),(0,c.jsxs)(Hn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Hn.Button,{variant:"tertiary",onClick:t,disabled:n,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,fs.__)("Cancel")}),(0,c.jsx)(Hn.Button,{variant:"primary",onClick:async()=>{o(!0);const n={success:{messages:{getMessage:e=>r?(0,fs.sprintf)((0,fs.__)('"%s" reset.'),(0,Ln.decodeEntities)(no(e))):(0,fs.sprintf)((0,fs._x)('"%s" deleted.',"template part"),(0,Ln.decodeEntities)(no(e))),getBatchMessage:()=>r?(0,fs.__)("Items reset."):(0,fs.__)("Items deleted.")}},error:{messages:{getMessage:e=>1===e.size?[...e][0]:r?(0,fs.__)("An error occurred while reverting the item."):(0,fs.__)("An error occurred while deleting the item."),getBatchMessage:e=>0===e.size?r?(0,fs.__)("An error occurred while reverting the items."):(0,fs.__)("An error occurred while deleting the items."):1===e.size?r?(0,fs.sprintf)((0,fs.__)("An error occurred while reverting the items: %s"),[...e][0]):(0,fs.sprintf)((0,fs.__)("An error occurred while deleting the items: %s"),[...e][0]):r?(0,fs.sprintf)((0,fs.__)("Some errors occurred while reverting the items: %s"),[...e].join(",")):(0,fs.sprintf)((0,fs.__)("Some errors occurred while deleting the items: %s"),[...e].join(","))}}};await(async(e,t,s)=>{const{createSuccessNotice:n,createErrorNotice:o}=(0,d.dispatch)(_s.store),{deleteEntityRecord:r}=(0,d.dispatch)(u.store),i=await Promise.allSettled(e.map((e=>r("postType",e.type,e.id,{force:!0},{throwOnError:!0}))));if(i.every((({status:e})=>"fulfilled"===e))){let o;o=1===i.length?t.success.messages.getMessage(e[0]):t.success.messages.getBatchMessage(e),n(o,{type:t.success.type??"snackbar",id:t.success.id}),s.onActionPerformed?.(e)}else{const e=er(i);let n="";n=1===i.length?t.error.messages.getMessage(e):t.error.messages.getBatchMessage(e),o(n,{type:t.error.type??"snackbar",id:t.error.id}),s.onActionError?.()}})(e,n,{onActionPerformed:s}),o(!1),t?.()},isBusy:n,disabled:n,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,fs.__)("Delete")})]})]})}};var nr=sr;const or={id:"move-to-trash",label:(0,fs.__)("Trash"),isPrimary:!0,icon:Jo,isEligible:e=>!so(e)&&"wp_block"!==e.type&&(!!e.status&&!["auto-draft","trash"].includes(e.status)&&e.permissions?.delete),supportsBulk:!0,hideModalHeader:!0,modalFocusOnMount:"firstContentElement",RenderModal:({items:e,closeModal:t,onActionPerformed:s})=>{const[n,o]=(0,p.useState)(!1),{createSuccessNotice:r,createErrorNotice:i}=(0,d.useDispatch)(_s.store),{deleteEntityRecord:a}=(0,d.useDispatch)(u.store);return(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"5",children:[(0,c.jsx)(Hn.__experimentalText,{children:1===e.length?(0,fs.sprintf)((0,fs.__)('Are you sure you want to move "%s" to the trash?'),no(e[0])):(0,fs.sprintf)((0,fs._n)("Are you sure you want to move %d item to the trash ?","Are you sure you want to move %d items to the trash ?",e.length),e.length)}),(0,c.jsxs)(Hn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,disabled:n,accessibleWhenDisabled:!0,children:(0,fs.__)("Cancel")}),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:async()=>{o(!0);const n=await Promise.allSettled(e.map((e=>a("postType",e.type,e.id.toString(),{},{throwOnError:!0}))));if(n.every((({status:e})=>"fulfilled"===e))){let t;t=1===n.length?(0,fs.sprintf)((0,fs.__)('"%s" moved to the trash.'),no(e[0])):(0,fs.sprintf)((0,fs._n)("%d item moved to the trash.","%d items moved to the trash.",e.length),e.length),r(t,{type:"snackbar",id:"move-to-trash-action"})}else{let e;if(1===n.length){const t=n[0];e=t.reason?.message?t.reason.message:(0,fs.__)("An error occurred while moving the item to the trash.")}else{const t=new Set,s=n.filter((({status:e})=>"rejected"===e));for(const e of s){const s=e;s.reason?.message&&t.add(s.reason.message)}e=0===t.size?(0,fs.__)("An error occurred while moving the items to the trash."):1===t.size?(0,fs.sprintf)((0,fs.__)("An error occurred while moving the item to the trash: %s"),[...t][0]):(0,fs.sprintf)((0,fs.__)("Some errors occurred while moving the items to the trash: %s"),[...t].join(","))}i(e,{type:"snackbar"})}s&&s(e),o(!1),t?.()},isBusy:n,disabled:n,accessibleWhenDisabled:!0,children:(0,fs._x)("Trash","verb")})]})]})}};var rr=or;const ir={id:"permanently-delete",label:(0,fs.__)("Permanently delete"),supportsBulk:!0,icon:Jo,isEligible(e){if(so(e)||"wp_block"===e.type)return!1;const{status:t,permissions:s}=e;return"trash"===t&&s?.delete},hideModalHeader:!0,modalFocusOnMount:"firstContentElement",RenderModal:({items:e,closeModal:t,onActionPerformed:s})=>{const[n,o]=(0,p.useState)(!1),{createSuccessNotice:r,createErrorNotice:i}=(0,d.useDispatch)(_s.store),{deleteEntityRecord:a}=(0,d.useDispatch)(u.store);return(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"5",children:[(0,c.jsx)(Hn.__experimentalText,{children:e.length>1?(0,fs.sprintf)((0,fs._n)("Are you sure you want to permanently delete %d item?","Are you sure you want to permanently delete %d items?",e.length),e.length):(0,fs.sprintf)((0,fs.__)('Are you sure you want to permanently delete "%s"?'),(0,Ln.decodeEntities)(no(e[0])))}),(0,c.jsxs)(Hn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Hn.Button,{variant:"tertiary",onClick:t,disabled:n,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,fs.__)("Cancel")}),(0,c.jsx)(Hn.Button,{variant:"primary",onClick:async()=>{o(!0);const n=await Promise.allSettled(e.map((e=>a("postType",e.type,e.id,{force:!0},{throwOnError:!0}))));if(n.every((({status:e})=>"fulfilled"===e))){let t;t=1===n.length?(0,fs.sprintf)((0,fs.__)('"%s" permanently deleted.'),no(e[0])):(0,fs.__)("The items were permanently deleted."),r(t,{type:"snackbar",id:"permanently-delete-post-action"}),s?.(e)}else{let e;if(1===n.length){const t=n[0];e=t.reason?.message?t.reason.message:(0,fs.__)("An error occurred while permanently deleting the item.")}else{const t=new Set,s=n.filter((({status:e})=>"rejected"===e));for(const e of s){const s=e;s.reason?.message&&t.add(s.reason.message)}e=0===t.size?(0,fs.__)("An error occurred while permanently deleting the items."):1===t.size?(0,fs.sprintf)((0,fs.__)("An error occurred while permanently deleting the items: %s"),[...t][0]):(0,fs.sprintf)((0,fs.__)("Some errors occurred while permanently deleting the items: %s"),[...t].join(","))}i(e,{type:"snackbar"})}o(!1),t?.()},isBusy:n,disabled:n,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,fs.__)("Delete permanently")})]})]})}};var ar=ir;const lr=window.wp.mediaUtils;var cr=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M5 11.25h14v1.5H5z"})});const dr={id:"featured_media",type:"media",label:(0,fs.__)("Featured Image"),Edit:({data:e,field:t,onChange:s})=>{const{id:n}=t,o=t.getValue({item:e}),r=(0,d.useSelect)((e=>{const{getEntityRecord:t}=e(u.store);return t("postType","attachment",o)}),[o]),i=(0,p.useCallback)((e=>s({[n]:e})),[n,s]),a=r?.source_url,l=r?.title?.rendered,m=(0,p.useRef)(null);return(0,c.jsx)("fieldset",{className:"fields-controls__featured-image",children:(0,c.jsx)("div",{className:"fields-controls__featured-image-container",children:(0,c.jsx)(lr.MediaUpload,{onSelect:e=>{i(e.id)},allowedTypes:["image"],render:({open:e})=>(0,c.jsx)("div",{ref:m,role:"button",tabIndex:-1,onClick:()=>{e()},onKeyDown:e,children:(0,c.jsxs)(Hn.__experimentalGrid,{rowGap:0,columnGap:8,templateColumns:"24px 1fr 24px",children:[a&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("img",{className:"fields-controls__featured-image-image",alt:"",width:24,height:24,src:a}),(0,c.jsx)("span",{className:"fields-controls__featured-image-title",children:l})]}),!a&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("span",{className:"fields-controls__featured-image-placeholder",style:{width:"24px",height:"24px"}}),(0,c.jsx)("span",{className:"fields-controls__featured-image-title",children:(0,fs.__)("Choose an image…")})]}),a&&(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(Hn.Button,{size:"small",className:"fields-controls__featured-image-remove-button",icon:cr,onClick:e=>{e.stopPropagation(),i(0)}})})]})})})})})},render:({item:e,config:t})=>{const s=e?._embedded?.["wp:featuredmedia"]?.[0],n=s?.source_url;return n?(0,c.jsx)("img",{className:"fields-controls__featured-image-image",src:n,alt:"",srcSet:s?.media_details?.sizes?Object.values(s.media_details.sizes).map((e=>`${e.source_url} ${e.width}w`)).join(", "):void 0,sizes:t?.sizes||"100vw"}):(0,c.jsx)("span",{className:"fields-controls__featured-image-placeholder"})},enableSorting:!1,filterBy:!1};var ur=dr;function pr(e){var t,s,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(s=pr(e[t]))&&(n&&(n+=" "),n+=s)}else for(s in e)e[s]&&(n&&(n+=" "),n+=s);return n}const mr=function(){for(var e,t,s=0,n="",o=arguments.length;s<o;s++)(e=arguments[s])&&(t=pr(e))&&(n&&(n+=" "),n+=t);return n};var hr=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.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 gr=function({item:e}){const t=e?._embedded?.author?.[0]?.name,s=e?._embedded?.author?.[0]?.avatar_urls?.[48],[n,o]=(0,p.useState)(!1);return(0,c.jsxs)(Hn.__experimentalHStack,{alignment:"left",spacing:0,children:[!!s&&(0,c.jsx)("div",{className:mr("page-templates-author-field__avatar",{"is-loaded":n}),children:(0,c.jsx)("img",{onLoad:()=>o(!0),alt:(0,fs.__)("Author avatar"),src:s})}),!s&&(0,c.jsx)("div",{className:"page-templates-author-field__icon",children:(0,c.jsx)(Hn.Icon,{icon:hr})}),(0,c.jsx)("span",{className:"page-templates-author-field__name",children:t})]})};const _r={label:(0,fs.__)("Author"),id:"author",type:"integer",getElements:async()=>(await(0,d.resolveSelect)(u.store).getEntityRecords("root","user",{per_page:-1})??[]).map((({id:e,name:t})=>({value:e,label:t}))),render:gr,sort:(e,t,s)=>{const n=e._embedded?.author?.[0]?.name||"",o=t._embedded?.author?.[0]?.name||"";return"asc"===s?n.localeCompare(o):o.localeCompare(n)},filterBy:{operators:["isAny","isNone"]}};var fr=_r,br=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 0 4-4H8a4 4 0 0 0 4 4Z"})}),yr=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm9 1V8h-1.5v3.5h-2V13H13Z"})}),xr=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 1-4-4h4V8a4 4 0 0 1 0 8Z"})}),vr=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5A6.5 6.5 0 0 1 6.93 7.931l9.139 9.138A6.473 6.473 0 0 1 12 18.5Zm5.123-2.498a6.5 6.5 0 0 0-9.124-9.124l9.124 9.124ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Z"})}),wr=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm11.53-1.47-1.06-1.06L11 12.94l-1.47-1.47-1.06 1.06L11 15.06l4.53-4.53Z"})});var Sr=[{value:"draft",label:(0,fs.__)("Draft"),icon:br,description:(0,fs.__)("Not ready to publish.")},{value:"future",label:(0,fs.__)("Scheduled"),icon:yr,description:(0,fs.__)("Publish automatically on a chosen date.")},{value:"pending",label:(0,fs.__)("Pending Review"),icon:xr,description:(0,fs.__)("Waiting for review before publishing.")},{value:"private",label:(0,fs.__)("Private"),icon:vr,description:(0,fs.__)("Only visible to site admins and editors.")},{value:"publish",label:(0,fs.__)("Published"),icon:wr,description:(0,fs.__)("Visible to everyone.")},{value:"trash",label:(0,fs.__)("Trash"),icon:Jo}];var kr=function({item:e}){const t=Sr.find((({value:t})=>t===e.status)),s=t?.label||e.status,n=t?.icon;return(0,c.jsxs)(Hn.__experimentalHStack,{alignment:"left",spacing:0,children:[n&&(0,c.jsx)("div",{className:"edit-site-post-list__status-icon",children:(0,c.jsx)(Hn.Icon,{icon:n})}),(0,c.jsx)("span",{children:s})]})};var Cr={label:(0,fs.__)("Status"),id:"status",type:"text",elements:Sr,render:kr,Edit:"radio",enableSorting:!1,filterBy:{operators:["isAny"]}};const Pr=e=>(0,v.dateI18n)((0,v.getSettings)().formats.datetimeAbbreviated,(0,v.getDate)(e));var jr=({item:e})=>{if(["draft","private"].includes(e.status??""))return(0,p.createInterpolateElement)((0,fs.sprintf)((0,fs.__)("<span>Modified: <time>%s</time></span>"),Pr(e.date??null)),{span:(0,c.jsx)("span",{}),time:(0,c.jsx)("time",{})});if("future"===e.status)return(0,p.createInterpolateElement)((0,fs.sprintf)((0,fs.__)("<span>Scheduled: <time>%s</time></span>"),Pr(e.date??null)),{span:(0,c.jsx)("span",{}),time:(0,c.jsx)("time",{})});if("publish"===e.status)return(0,p.createInterpolateElement)((0,fs.sprintf)((0,fs.__)("<span>Published: <time>%s</time></span>"),Pr(e.date??null)),{span:(0,c.jsx)("span",{}),time:(0,c.jsx)("time",{})});const t=(0,v.getDate)(e.modified??null)>(0,v.getDate)(e.date??null)?e.modified:e.date;return"pending"===e.status?(0,p.createInterpolateElement)((0,fs.sprintf)((0,fs.__)("<span>Modified: <time>%s</time></span>"),Pr(t??null)),{span:(0,c.jsx)("span",{}),time:(0,c.jsx)("time",{})}):(0,c.jsx)("time",{children:Pr(e.date??null)})};var Er={id:"date",type:"datetime",label:(0,fs.__)("Date"),render:jr,filterBy:!1},Tr=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.625 5.5h9.75c.069 0 .125.056.125.125v9.75a.125.125 0 0 1-.125.125h-9.75a.125.125 0 0 1-.125-.125v-9.75c0-.069.056-.125.125-.125ZM4 5.625C4 4.728 4.728 4 5.625 4h9.75C16.273 4 17 4.728 17 5.625v9.75c0 .898-.727 1.625-1.625 1.625h-9.75A1.625 1.625 0 0 1 4 15.375v-9.75Zm14.5 11.656v-9H20v9C20 18.8 18.77 20 17.251 20H6.25v-1.5h11.001c.69 0 1.249-.528 1.249-1.219Z"})});const Br=e=>"object"!=typeof e?"":e.slug||(0,w.cleanForSlug)(no(e))||e.id.toString(),Ir=({field:e,onChange:t,data:s})=>{const{id:n}=e,o=e.getValue({item:s})||Br(s),r=s.permalink_template||"",i=/%(?:postname|pagename)%/,[a,l]=r.split(i),u=a,h=l,g=i.test(r),_=(0,p.useRef)(o),f=o||_.current,b=g?`${u}${f}${h}`:(0,w.safeDecodeURIComponent)(s.link||"");(0,p.useEffect)((()=>{o&&void 0===_.current&&(_.current=o)}),[o]);const y=(0,p.useCallback)((e=>t({[n]:e})),[n,t]),{createNotice:x}=(0,d.useDispatch)(_s.store),v=(0,m.useCopyToClipboard)(b,(()=>{x("info",(0,fs.__)("Copied Permalink to clipboard."),{isDismissible:!0,type:"snackbar"})})),S="editor-post-url__slug-description-"+(0,m.useInstanceId)(Ir);return(0,c.jsxs)("fieldset",{className:"fields-controls__slug",children:[g&&(0,c.jsxs)(Hn.__experimentalVStack,{children:[(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"0px",children:[(0,c.jsx)("span",{children:(0,fs.__)("Customize the last part of the Permalink.")}),(0,c.jsx)(Hn.ExternalLink,{href:"https://wordpress.org/documentation/article/page-post-settings-sidebar/#permalink",children:(0,fs.__)("Learn more")})]}),(0,c.jsx)(Hn.__experimentalInputControl,{__next40pxDefaultSize:!0,prefix:(0,c.jsx)(Hn.__experimentalInputControlPrefixWrapper,{children:"/"}),suffix:(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,icon:Tr,ref:v,label:(0,fs.__)("Copy")}),label:(0,fs.__)("Link"),hideLabelFromVision:!0,value:o,autoComplete:"off",spellCheck:"false",type:"text",className:"fields-controls__slug-input",onChange:e=>{y(e)},onBlur:()=>{""===o&&y(_.current)},"aria-describedby":S}),(0,c.jsxs)("div",{className:"fields-controls__slug-help",children:[(0,c.jsx)("span",{className:"fields-controls__slug-help-visual-label",children:(0,fs.__)("Permalink:")}),(0,c.jsxs)(Hn.ExternalLink,{className:"fields-controls__slug-help-link",href:b,children:[(0,c.jsx)("span",{className:"fields-controls__slug-help-prefix",children:u}),(0,c.jsx)("span",{className:"fields-controls__slug-help-slug",children:f}),(0,c.jsx)("span",{className:"fields-controls__slug-help-suffix",children:h})]})]})]}),!g&&(0,c.jsx)(Hn.ExternalLink,{className:"fields-controls__slug-help",href:b,children:b})]})};var Nr=Ir;var Rr=({item:e})=>{const t=Br(e),s=(0,p.useRef)(t);(0,p.useEffect)((()=>{t&&void 0===s.current&&(s.current=t)}),[t]);return`${t||s.current}`};var Dr={id:"slug",type:"text",label:(0,fs.__)("Slug"),Edit:Nr,render:Rr,filterBy:!1},Ar=s(9681),Mr=s.n(Ar);function Lr(e){return"object"==typeof e.title&&"rendered"in e.title&&e.title.rendered?(0,Ln.decodeEntities)(e.title.rendered):`#${e?.id} (${(0,fs.__)("no title")})`}const Or=(e,t)=>{const s=Mr()(e||"").toLowerCase(),n=Mr()(t||"").toLowerCase();return s===n?0:s.startsWith(n)?s.length:1/0};function Fr({data:e,onChangeControl:t}){const[s,n]=(0,p.useState)(null),o=e.parent,r=e.id,i=e.type,{parentPostTitle:a,pageItems:l,isHierarchical:h}=(0,d.useSelect)((e=>{const{getEntityRecord:t,getEntityRecords:n,getPostType:a}=e(u.store),l=a(i),c=l?.hierarchical&&l.viewable,d=o?t("postType",i,o):null,p={per_page:100,exclude:r,parent_exclude:r,orderby:"menu_order",order:"asc",_fields:"id,title,parent",...null!==s&&{search:s}};return{isHierarchical:c,parentPostTitle:d?Lr(d):"",pageItems:c?n("postType",i,p):null}}),[s,o,r,i]),g=(0,p.useMemo)((()=>{const e=(t,n=0)=>{const o=t.map((t=>[{value:t.id,label:"— ".repeat(n)+(0,Ln.decodeEntities)(t.name),rawName:t.name},...e(t.children||[],n+1)])).sort((([e],[t])=>Or(e.rawName,s??"")>=Or(t.rawName,s??"")?1:-1));return o.flat()};if(!l)return[];let t=l.map((e=>({id:e.id,parent:e.parent??null,name:Lr(e)})));s||(t=function(e){const t=e.map((e=>({children:[],...e})));if(t.some((({parent:e})=>null==e)))return t;const s=t.reduce(((e,t)=>{const{parent:s}=t;return e[s]||(e[s]=[]),e[s].push(t),e}),{}),n=e=>e.map((e=>{const t=s[e.id];return{...e,children:t&&t.length?n(t):[]}}));return n(s[0]||[])}(t));const n=e(t),r=n.find((e=>e.value===o));return o&&a&&!r&&n.unshift({value:o,label:a,rawName:""}),n.map((e=>({...e,value:e.value.toString()})))}),[l,s,a,o]);if(!h)return null;return(0,c.jsx)(Hn.ComboboxControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,fs.__)("Parent"),help:(0,fs.__)("Choose a parent page."),value:o?.toString(),options:g,onFilterValueChange:(0,m.debounce)((e=>{n(e)}),300),onChange:e=>{if(e)return t(parseInt(e,10)??0);t(0)},hideLabelFromVision:!0})}var Vr={id:"parent",type:"text",label:(0,fs.__)("Parent"),Edit:({data:e,field:t,onChange:s})=>{const{id:n}=t,o=(0,d.useSelect)((e=>e(u.store).getEntityRecord("root","__unstableBase")?.home),[]),r=(0,p.useCallback)((e=>s({[n]:e})),[n,s]);return(0,c.jsx)("fieldset",{className:"fields-controls__parent",children:(0,c.jsxs)("div",{children:[(0,p.createInterpolateElement)((0,fs.sprintf)((0,fs.__)('Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %1$s<wbr />/services<wbr />/pricing.'),(0,w.filterURLForDisplay)(o).replace(/([/.])/g,"<wbr />$1")),{wbr:(0,c.jsx)("wbr",{})}),(0,c.jsx)("p",{children:(0,p.createInterpolateElement)((0,fs.__)("They also show up as sub-items in the default navigation menu. <a>Learn more.</a>"),{a:(0,c.jsx)(Hn.ExternalLink,{href:(0,fs.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#page-attributes"),children:void 0})})}),(0,c.jsx)(Fr,{data:e,onChangeControl:r})]})})},render:({item:e})=>{const t=(0,d.useSelect)((t=>{const{getEntityRecord:s}=t(u.store);return e?.parent?s("postType",e.type,e.parent):null}),[e.parent,e.type]);return t?(0,c.jsx)(c.Fragment,{children:Lr(t)}):(0,c.jsx)(c.Fragment,{children:(0,fs.__)("None")})},enableSorting:!0,filterBy:!1};var Ur={id:"comment_status",label:(0,fs.__)("Comments"),type:"text",Edit:"radio",enableSorting:!1,enableHiding:!1,filterBy:!1,elements:[{value:"open",label:(0,fs.__)("Open"),description:(0,fs.__)("Visitors can add new comments and replies.")},{value:"closed",label:(0,fs.__)("Closed"),description:(0,fs.__)("Visitors cannot add new comments or replies. Existing comments remain visible.")}]};var Hr={id:"ping_status",label:(0,fs.__)("Trackbacks & Pingbacks"),type:"text",Edit:function({data:e,onChange:t}){const s=e?.ping_status??"open";return(0,c.jsx)(Hn.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,fs.__)("Enable pingbacks & trackbacks"),checked:"open"===s,onChange:s=>{t({...e,ping_status:s?"open":"closed"})},help:(0,c.jsx)(Hn.ExternalLink,{href:(0,fs.__)("https://wordpress.org/documentation/article/trackbacks-and-pingbacks/"),children:(0,fs.__)("Learn more about pingbacks & trackbacks")})})},enableSorting:!1,enableHiding:!1,filterBy:!1,elements:[{value:"open",label:(0,fs.__)("Allow"),description:(0,fs.__)("Allow link notifications from other blogs (pingbacks and trackbacks) on new articles.")},{value:"closed",label:(0,fs.__)("Don't allow"),description:(0,fs.__)("Don't allow link notifications from other blogs (pingbacks and trackbacks) on new articles.")}]};var zr={id:"discussion",label:(0,fs.__)("Discussion"),type:"text",render:({item:e})=>{const t="open"===e.comment_status,s="open"===e.ping_status;return t&&s?(0,fs.__)("Open"):t&&!s?(0,fs.__)("Comments only"):!t&&s?(0,fs.__)("Pings only"):(0,fs.__)("Closed")},filterBy:!1};const Gr=[],$r={id:"template",type:"text",label:(0,fs.__)("Template"),Edit:({data:e,field:t,onChange:s})=>{const{id:n}=t,o=e.type,r="number"==typeof e.id?e.id:parseInt(e.id,10),i=e.slug,{canSwitchTemplate:a,templates:l}=(0,d.useSelect)((e=>{const t=e(u.store).getEntityRecords("postType","wp_template",{per_page:-1,post_type:o})??Gr,{getHomePage:s,getPostsPageId:n}=co(e(u.store)),i=n()===+r,a="page"===o&&s()?.postId===+r;return{templates:t,canSwitchTemplate:!i&&!a}}),[r,o]),h=(0,p.useMemo)((()=>a?l.filter((t=>t.is_custom&&t.slug!==e.template&&!!t.content.raw)).map((e=>({name:e.slug,blocks:(0,x.parse)(e.content.raw),title:(0,Ln.decodeEntities)(e.title.rendered),id:e.id}))):[]),[a,e.template,l]),_=(0,m.useAsyncList)(h),f=t.getValue({item:e}),b=l.find((e=>e.slug===f)),y=(0,d.useSelect)((e=>{if(b)return b;let t;if(t=i?"page"===o?`${o}-${i}`:`single-${o}-${i}`:"page"===o?"page":`single-${o}`,o){const s=e(u.store).getDefaultTemplateId({slug:t});return e(u.store).getEntityRecord("postType","wp_template",s)}}),[b,o,i]),[v,w]=(0,p.useState)(!1),S=(0,p.useCallback)((e=>s({[n]:e})),[n,s]);return(0,c.jsxs)("fieldset",{className:"fields-controls__template",children:[(0,c.jsx)(Hn.Dropdown,{popoverProps:{placement:"bottom-start"},renderToggle:({onToggle:e})=>(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",size:"compact",onClick:e,children:y?no(y):""}),renderContent:({onToggle:e})=>(0,c.jsxs)(Hn.MenuGroup,{children:[(0,c.jsx)(Hn.MenuItem,{onClick:()=>{w(!0),e()},children:(0,fs.__)("Change template")}),""!==f&&(0,c.jsx)(Hn.MenuItem,{onClick:()=>{S(""),e()},children:(0,fs.__)("Use default template")})]})}),v&&(0,c.jsx)(Hn.Modal,{title:(0,fs.__)("Choose a template"),onRequestClose:()=>w(!1),overlayClassName:"fields-controls__template-modal",isFullScreen:!0,children:(0,c.jsx)("div",{className:"fields-controls__template-content",children:(0,c.jsx)(g.__experimentalBlockPatternsList,{label:(0,fs.__)("Templates"),blockPatterns:h,shownPatterns:_,onClickPattern:e=>{S(e.name),w(!1)}})})})]})},enableSorting:!1,filterBy:!1};var Wr=$r;var Zr=function({data:e,onChange:t,field:s}){const[n,o]=(0,p.useState)(!!s.getValue({item:e}));return(0,c.jsxs)(Hn.__experimentalVStack,{as:"fieldset",spacing:4,className:"fields-controls__password",children:[(0,c.jsx)(Hn.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,fs.__)("Password protected"),help:(0,fs.__)("Only visible to those who know the password"),checked:n,onChange:e=>{o(e),e||t({password:""})}}),n&&(0,c.jsx)("div",{className:"fields-controls__password-input",children:(0,c.jsx)(Hn.TextControl,{label:(0,fs.__)("Password"),onChange:e=>t({password:e}),value:s.getValue({item:e})||"",placeholder:(0,fs.__)("Use a secure password"),type:"text",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,maxLength:255})})]})};var Yr={id:"password",type:"text",label:(0,fs.__)("Password"),Edit:Zr,enableSorting:!1,enableHiding:!1,isVisible:e=>"private"!==e.status,filterBy:!1};function qr({item:e,className:t,children:s}){const n=no(e);return(0,c.jsxs)(Hn.__experimentalHStack,{className:mr("fields-field__title",t),alignment:"center",justify:"flex-start",children:[(0,c.jsx)("span",{children:n||(0,fs.__)("(no title)")}),s]})}function Kr({item:e}){return(0,c.jsx)(qr,{item:e})}const{Badge:Qr}=co(Hn.privateApis);var Xr={type:"text",id:"title",label:(0,fs.__)("Title"),placeholder:(0,fs.__)("No title"),getValue:({item:e})=>no(e),render:function({item:e}){const{frontPageId:t,postsPageId:s}=(0,d.useSelect)((e=>{const{getEntityRecord:t}=e(u.store),s=t("root","site");return{frontPageId:s?.page_on_front,postsPageId:s?.page_for_posts}}),[]);return(0,c.jsx)(qr,{item:e,className:"fields-field__page-title",children:[t,s].includes(e.id)&&(0,c.jsx)(Qr,{children:e.id===t?(0,fs.__)("Homepage"):(0,fs.__)("Posts Page")})})},enableHiding:!1,enableGlobalSearch:!0,filterBy:!1};var Jr={type:"text",label:(0,fs.__)("Template"),placeholder:(0,fs.__)("No title"),id:"title",getValue:({item:e})=>no(e),render:Kr,enableHiding:!1,enableGlobalSearch:!0,filterBy:!1},ei=(0,p.forwardRef)((({icon:e,size:t=24,...s},n)=>(0,p.cloneElement)(e,{width:t,height:t,...s,ref:n}))),ti=(0,c.jsx)(L.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M15 11h-.2V9c0-1.5-1.2-2.8-2.8-2.8S9.2 7.5 9.2 9v2H9c-.6 0-1 .4-1 1v4c0 .6.4 1 1 1h6c.6 0 1-.4 1-1v-4c0-.6-.4-1-1-1zm-1.8 0h-2.5V9c0-.7.6-1.2 1.2-1.2s1.2.6 1.2 1.2v2z"})});const{PATTERN_TYPES:si}=co(ao.privateApis);var ni={type:"text",id:"title",label:(0,fs.__)("Title"),placeholder:(0,fs.__)("No title"),getValue:({item:e})=>no(e),render:function({item:e}){return(0,c.jsx)(qr,{item:e,className:"fields-field__pattern-title",children:e.type===si.theme&&(0,c.jsx)(Hn.Tooltip,{placement:"top",text:(0,fs.__)("This pattern cannot be edited."),children:(0,c.jsx)(ei,{icon:ti,size:24})})})},enableHiding:!1,enableGlobalSearch:!0,filterBy:!1};var oi={type:"text",id:"title",label:(0,fs.__)("Title"),placeholder:(0,fs.__)("No title"),getValue:({item:e})=>no(e),render:Kr,enableHiding:!0,enableGlobalSearch:!0,filterBy:!1};var ri=(0,m.createHigherOrderComponent)((e=>({useSubRegistry:t=!0,...s})=>{const n=(0,d.useRegistry)(),[o]=(0,p.useState)((()=>new WeakMap)),r=function(e,t,s){if(!s)return t;let n=e.get(t);return n||(n=(0,d.createRegistry)({"core/block-editor":g.storeConfig},t),n.registerStore("core/editor",xc),e.set(t,n)),n}(o,n,t);return r===n?(0,c.jsx)(e,{registry:n,...s}):(0,c.jsx)(d.RegistryProvider,{value:r,children:(0,c.jsx)(e,{registry:r,...s})})}),"withRegistryProvider");const ii=(e,t)=>`<a ${ai(e)}>${t}</a>`,ai=e=>`href="${e}" target="_blank" rel="noreferrer noopener"`,li=e=>{const{title:t,foreign_landing_url:s,creator:n,creator_url:o,license:r,license_version:i,license_url:a}=e,l=((e,t)=>{let s=e.trim();return"pdm"!==e&&(s=e.toUpperCase().replace("SAMPLING","Sampling")),t&&(s+=` ${t}`),["pdm","cc0"].includes(e)||(s=`CC ${s}`),s})(r,i),c=(0,Ln.decodeEntities)(n);let d;return d=c?t?(0,fs.sprintf)((0,fs._x)('"%1$s" by %2$s/ %3$s',"caption"),ii(s,(0,Ln.decodeEntities)(t)),o?ii(o,c):c,a?ii(`${a}?ref=openverse`,l):l):(0,fs.sprintf)((0,fs._x)("<a %1$s>Work</a> by %2$s/ %3$s","caption"),ai(s),o?ii(o,c):c,a?ii(`${a}?ref=openverse`,l):l):t?(0,fs.sprintf)((0,fs._x)('"%1$s"/ %2$s',"caption"),ii(s,(0,Ln.decodeEntities)(t)),a?ii(`${a}?ref=openverse`,l):l):(0,fs.sprintf)((0,fs._x)("<a %1$s>Work</a>/ %2$s","caption"),ai(s),a?ii(`${a}?ref=openverse`,l):l),d.replace(/\s{2}/g," ")},ci=async(e={})=>(await(0,d.resolveSelect)(u.store).getEntityRecords("postType","attachment",{...e,orderBy:e?.search?"relevance":"date"})).map((e=>({...e,alt:e.alt_text,url:e.source_url,previewUrl:e.media_details?.sizes?.medium?.source_url,caption:e.caption?.raw})));var di=[{name:"images",labels:{name:(0,fs.__)("Images"),search_items:(0,fs.__)("Search images")},mediaType:"image",fetch:async(e={})=>ci({...e,media_type:"image"})},{name:"videos",labels:{name:(0,fs.__)("Videos"),search_items:(0,fs.__)("Search videos")},mediaType:"video",fetch:async(e={})=>ci({...e,media_type:"video"})},{name:"audio",labels:{name:(0,fs.__)("Audio"),search_items:(0,fs.__)("Search audio")},mediaType:"audio",fetch:async(e={})=>ci({...e,media_type:"audio"})},{name:"openverse",labels:{name:(0,fs.__)("Openverse"),search_items:(0,fs.__)("Search Openverse")},mediaType:"image",async fetch(e={}){const t={...e,mature:!1,excluded_source:"flickr,inaturalist,wikimedia",license:"pdm,cc0"},s={per_page:"page_size",search:"q"},n=new URL("https://api.openverse.org/v1/images/");Object.entries(t).forEach((([e,t])=>{const o=s[e]||e;n.searchParams.set(o,t)}));const o=await window.fetch(n,{headers:{"User-Agent":"WordPress/inserter-media-fetch"}});return(await o.json()).results.map((e=>({...e,title:e.title?.toLowerCase().startsWith("file:")?e.title.slice(5):e.title,sourceId:e.id,id:void 0,caption:li(e),previewUrl:e.thumbnail})))},getReportUrl:({sourceId:e})=>`https://wordpress.org/openverse/image/${e}/report/`,isExternalResource:!0}];const ui={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let pi;const mi=new Uint8Array(16);function hi(){if(!pi&&(pi="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!pi))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return pi(mi)}const gi=[];for(let e=0;e<256;++e)gi.push((e+256).toString(16).slice(1));function _i(e,t=0){return gi[e[t+0]]+gi[e[t+1]]+gi[e[t+2]]+gi[e[t+3]]+"-"+gi[e[t+4]]+gi[e[t+5]]+"-"+gi[e[t+6]]+gi[e[t+7]]+"-"+gi[e[t+8]]+gi[e[t+9]]+"-"+gi[e[t+10]]+gi[e[t+11]]+gi[e[t+12]]+gi[e[t+13]]+gi[e[t+14]]+gi[e[t+15]]}const fi=function(e,t,s){if(ui.randomUUID&&!t&&!e)return ui.randomUUID();const n=(e=e||{}).random||(e.rng||hi)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){s=s||0;for(let e=0;e<16;++e)t[s+e]=n[e];return t}return _i(n)},bi=()=>{};function yi({additionalData:e={},allowedTypes:t,filesList:s,maxUploadFileSize:n,onError:o=bi,onFileChange:r,onSuccess:i,multiple:a=!0}){const{receiveEntityRecords:l}=(0,d.dispatch)(u.store),{getCurrentPost:c,getEditorSettings:p}=(0,d.select)(vc),{lockPostAutosaving:m,unlockPostAutosaving:h,lockPostSaving:g,unlockPostSaving:_}=(0,d.dispatch)(vc),f=p().allowedMimeTypes,b=`image-upload-${fi()}`;let y=!1;n=n||p().maxUploadFileSize;const x=c(),v="number"==typeof x?.id?x.id:x?.wp_id,w=v?{post:v}:{},S=()=>{_(b),h(b),y=!1};(0,lr.uploadMedia)({allowedTypes:t,filesList:s,onFileChange:e=>{y?S():(g(b),m(b),y=!0),r?.(e);const t=e.filter((e=>e?.id));if(t?.length){l("postType","attachment",t,void 0,!0)}},onSuccess:i,additionalData:{...w,...e},maxUploadFileSize:n,onError:({message:e})=>{S(),o(e)},wpAllowedMimeTypes:f,multiple:a})}const{sideloadMedia:xi}=$(lr.privateApis);var vi=xi,wi=s(66),Si=s.n(wi);
/*!
 * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
 *
 * Copyright (c) 2014-2017, Jon Schlinkert.
 * Released under the MIT License.
 */
function ki(e){return"[object Object]"===Object.prototype.toString.call(e)}function Ci(e){var t,s;return!1!==ki(e)&&(void 0===(t=e.constructor)||!1!==ki(s=t.prototype)&&!1!==s.hasOwnProperty("isPrototypeOf"))}const{GlobalStylesContext:Pi,cleanEmptyObject:ji}=$(g.privateApis);function Ei(e,t){return Si()(e,t,{isMergeableObject:Ci,customMerge:e=>{if("backgroundImage"===e)return(e,t)=>t}})}function Ti(){const[e,t,s]=function(){const{globalStylesId:e,isReady:t,settings:s,styles:n,_links:o}=(0,d.useSelect)((e=>{const{getEntityRecord:t,getEditedEntityRecord:s,hasFinishedResolution:n,canUser:o}=e(u.store),r=e(u.store).__experimentalGetCurrentGlobalStylesId();let i;const a=r?o("update",{kind:"root",name:"globalStyles",id:r}):null;r&&"boolean"==typeof a&&(i=a?s("root","globalStyles",r):t("root","globalStyles",r,{context:"view"}));let l=!1;return n("__experimentalGetCurrentGlobalStylesId")&&(l=!r||(a?n("getEditedEntityRecord",["root","globalStyles",r]):n("getEntityRecord",["root","globalStyles",r,{context:"view"}]))),{globalStylesId:r,isReady:l,settings:i?.settings,styles:i?.styles,_links:i?._links}}),[]),{getEditedEntityRecord:r}=(0,d.useSelect)(u.store),{editEntityRecord:i}=(0,d.useDispatch)(u.store);return[t,(0,p.useMemo)((()=>({settings:s??{},styles:n??{},_links:o??{}})),[s,n,o]),(0,p.useCallback)(((t,s={})=>{const n=r("root","globalStyles",e),o="function"==typeof t?t({styles:n?.styles??{},settings:n?.settings??{},_links:n?._links??{}}):t;i("root","globalStyles",e,{styles:ji(o.styles)||{},settings:ji(o.settings)||{},_links:ji(o._links)||{}},s)}),[e,i,r])]}(),[n,o]=function(){const e=(0,d.useSelect)((e=>e(u.store).__experimentalGetCurrentThemeBaseGlobalStyles()),[]);return[!!e,e]}(),r=(0,p.useMemo)((()=>o&&t?Ei(o,t):{}),[t,o]);return(0,p.useMemo)((()=>({isReady:e&&n,user:t,base:o,merged:r,setUserConfig:s})),[r,t,o,s,e,n])}const Bi={};function Ii(e){const{RECEIVE_INTERMEDIATE_RESULTS:t}=$(u.privateApis),{getEntityRecords:s}=e(u.store);return s("postType","wp_block",{per_page:-1,[t]:!0})}const Ni=["__experimentalBlockBindingsSupportedAttributes","__experimentalBlockDirectory","__experimentalDiscussionSettings","__experimentalFeatures","__experimentalGlobalStylesBaseStyles","alignWide","blockInspectorTabs","maxUploadFileSize","allowedMimeTypes","bodyPlaceholder","canLockBlocks","canUpdateBlockBindings","capabilities","clearBlockSelection","codeEditingEnabled","colors","disableCustomColors","disableCustomFontSizes","disableCustomSpacingSizes","disableCustomGradients","disableLayoutStyles","enableCustomLineHeight","enableCustomSpacing","enableCustomUnits","enableOpenverseMediaCategory","fontSizes","gradients","generateAnchors","onNavigateToEntityRecord","imageDefaultSize","imageDimensions","imageEditing","imageSizes","isPreviewMode","isRTL","locale","maxWidth","postContentAttributes","postsPerPage","readOnly","styles","titlePlaceholder","supportsLayout","widgetTypesToHideFromLegacyWidgetBlock","__unstableHasCustomAppender","__unstableResolvedAssets","__unstableIsBlockBasedTheme"],{globalStylesDataKey:Ri,globalStylesLinksDataKey:Di,selectBlockPatternsKey:Ai,reusableBlocksSelectKey:Mi,sectionRootClientIdKey:Li,mediaEditKey:Oi}=$(g.privateApis);var Fi=function(e,t,s,n){const o=(0,m.useViewportMatch)("medium"),{allowRightClickOverrides:r,blockTypes:i,focusMode:a,hasFixedToolbar:l,isDistractionFree:c,keepCaretInsideBlock:h,hasUploadPermissions:_,hiddenBlockTypes:f,canUseUnfilteredHTML:b,userCanCreatePages:y,pageOnFront:v,pageForPosts:w,userPatternCategories:S,restBlockPatternCategories:k,sectionRootClientId:P}=(0,d.useSelect)((e=>{const{canUser:r,getRawEntityRecord:i,getEntityRecord:a,getUserPatternCategories:l,getBlockPatternCategories:c}=e(u.store),{get:d}=e(C.store),{getBlockTypes:p}=e(x.store),{getBlocksByName:m,getBlockAttributes:h}=e(g.store),_=r("read",{kind:"root",name:"site"})?a("root","site"):void 0;return{allowRightClickOverrides:d("core","allowRightClickOverrides"),blockTypes:p(),canUseUnfilteredHTML:i("postType",t,s)?._links?.hasOwnProperty("wp:action-unfiltered-html"),focusMode:d("core","focusMode"),hasFixedToolbar:d("core","fixedToolbar")||!o,hiddenBlockTypes:d("core","hiddenBlockTypes"),isDistractionFree:d("core","distractionFree"),keepCaretInsideBlock:d("core","keepCaretInsideBlock"),hasUploadPermissions:r("create",{kind:"postType",name:"attachment"})??!0,userCanCreatePages:r("create",{kind:"postType",name:"page"}),pageOnFront:_?.page_on_front,pageForPosts:_?.page_for_posts,userPatternCategories:l(),restBlockPatternCategories:c(),sectionRootClientId:"template-locked"===n?m("core/post-content")?.[0]??"":m("core/group").find((e=>"main"===h(e)?.tagName))??""}}),[t,s,o,n]),{merged:j}=Ti(),E=j.styles??Bi,T=j._links??Bi,B=e.__experimentalAdditionalBlockPatterns??e.__experimentalBlockPatterns,I=e.__experimentalAdditionalBlockPatternCategories??e.__experimentalBlockPatternCategories,N=(0,p.useMemo)((()=>[...B||[]].filter((({postTypes:e})=>!e||Array.isArray(e)&&e.includes(t)))),[B,t]),R=(0,p.useMemo)((()=>[...I||[],...k||[]].filter(((e,t,s)=>t===s.findIndex((t=>e.name===t.name))))),[I,k]),{undo:D,setIsInserterOpened:A}=(0,d.useDispatch)(vc),{editMediaEntity:M}=$((0,d.useDispatch)(u.store)),{saveEntityRecord:L}=(0,d.useDispatch)(u.store),O=(0,p.useCallback)((e=>y?L("postType","page",e):Promise.reject({message:(0,fs.__)("You do not have permission to create Pages.")})),[L,y]),F=(0,p.useMemo)((()=>{if(f&&f.length>0){return(!0===e.allowedBlockTypes?i.map((({name:e})=>e)):e.allowedBlockTypes||[]).filter((e=>!f.includes(e)))}return e.allowedBlockTypes}),[e.allowedBlockTypes,f,i]),V=!1===e.focusMode;return(0,p.useMemo)((()=>{const s={...Object.fromEntries(Object.entries(e).filter((([e])=>Ni.includes(e)))),[Ri]:E,[Di]:T,allowedBlockTypes:F,allowRightClickOverrides:r,focusMode:a&&!V,hasFixedToolbar:l,isDistractionFree:c,keepCaretInsideBlock:h,[Oi]:_?M:void 0,mediaUpload:_?yi:void 0,mediaSideload:_?vi:void 0,__experimentalBlockPatterns:N,[Ai]:e=>{const{hasFinishedResolution:s,getBlockPatternsForPostType:n}=$(e(u.store)),o=n(t);return s("getBlockPatterns")?o:void 0},[Mi]:Ii,__experimentalBlockPatternCategories:R,__experimentalUserPatternCategories:S,__experimentalFetchLinkSuggestions:(t,s)=>(0,u.__experimentalFetchLinkSuggestions)(t,s,e),inserterMediaCategories:di,__experimentalFetchRichUrlData:u.__experimentalFetchUrlData,__experimentalCanUserUseUnfilteredHTML:b,__experimentalUndo:D,outlineMode:!c&&"wp_template"===t,__experimentalCreatePageEntity:O,__experimentalUserCanCreatePages:y,pageOnFront:v,pageForPosts:w,__experimentalPreferPatternsOnRoot:"wp_template"===t,templateLock:"wp_navigation"===t?"insert":e.templateLock,template:"wp_navigation"===t?[["core/navigation",{},[]]]:e.template,__experimentalSetIsInserterOpened:A,[Li]:P,editorTool:"post-only"===n&&"wp_template"!==t?"edit":void 0};return s}),[F,r,a,V,l,c,h,e,_,S,N,R,b,D,O,y,v,w,t,A,P,E,T,n,M])};const Vi=["core/post-title","core/post-featured-image","core/post-content"];function Ui(){const e=(0,p.useMemo)((()=>[...(0,h.applyFilters)("editor.postContentBlockTypes",Vi)]),[]),t=(0,d.useSelect)((t=>{const{getPostBlocksByName:s}=$(t(vc));return s(e)}),[e]);return t}function Hi(){const e=Ui(),{templateParts:t}=(0,d.useSelect)((e=>{const{getBlocksByName:t}=e(g.store);return{templateParts:t("core/template-part")}}),[]),s=(0,d.useSelect)((e=>{const{getBlockOrder:s}=e(g.store);return t.flatMap((e=>s(e)))}),[t]),n=(0,d.useRegistry)();return(0,p.useEffect)((()=>{const{setBlockEditingMode:e,unsetBlockEditingMode:t}=n.dispatch(g.store);return e("","disabled"),()=>{t("")}}),[n]),(0,p.useEffect)((()=>{const{setBlockEditingMode:t,unsetBlockEditingMode:s}=n.dispatch(g.store);return n.batch((()=>{for(const s of e)t(s,"contentOnly")})),()=>{n.batch((()=>{for(const t of e)s(t)}))}}),[e,n]),(0,p.useEffect)((()=>{const{setBlockEditingMode:e,unsetBlockEditingMode:s}=n.dispatch(g.store);return n.batch((()=>{for(const s of t)e(s,"contentOnly")})),()=>{n.batch((()=>{for(const e of t)s(e)}))}}),[t,n]),(0,p.useEffect)((()=>{const{setBlockEditingMode:e,unsetBlockEditingMode:t}=n.dispatch(g.store);return n.batch((()=>{for(const t of s)e(t,"disabled")})),()=>{n.batch((()=>{for(const e of s)t(e)}))}}),[s,n]),null}function zi(){const e=(0,d.useSelect)((e=>e(g.store).getBlockOrder()?.[0]),[]),{setBlockEditingMode:t,unsetBlockEditingMode:s}=(0,d.useDispatch)(g.store);(0,p.useEffect)((()=>{if(e)return t(e,"contentOnly"),()=>{s(e)}}),[e,s,t])}const Gi=["wp_block","wp_template","wp_template_part"];var $i=(0,c.jsxs)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,c.jsx)(L.Path,{d:"m16 15.5h-8v-1.5h8zm-7.5-2.5h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm-9-3h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2z"}),(0,c.jsx)(L.Path,{d:"m18.5 6.5h-13a.5.5 0 0 0 -.5.5v9.5a.5.5 0 0 0 .5.5h13a.5.5 0 0 0 .5-.5v-9.5a.5.5 0 0 0 -.5-.5zm-13-1.5h13a2 2 0 0 1 2 2v9.5a2 2 0 0 1 -2 2h-13a2 2 0 0 1 -2-2v-9.5a2 2 0 0 1 2-2z"})]}),Wi=(0,c.jsx)(L.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(L.Path,{d:"M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"})}),Zi=(0,c.jsx)(L.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(L.Path,{d:"M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z"})}),Yi=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM8.5 18.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h2.5v13zm10-.5c0 .3-.2.5-.5.5h-8v-13h8c.3 0 .5.2.5.5v12z"})}),qi=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z"})}),Ki=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})}),Qi=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})}),Xi=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z"})}),Ji=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.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-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 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"})}),ea=(0,c.jsxs)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,c.jsx)(L.Path,{d:"M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"}),(0,c.jsx)(L.Path,{d:"M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z"})]}),ta=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z"})}),sa=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M12 4V2.2L9 4.8l3 2.5V5.5c3.6 0 6.5 2.9 6.5 6.5 0 2.9-1.9 5.3-4.5 6.2v.2l-.1-.2c-.4.1-.7.2-1.1.2l.2 1.5c.3 0 .6-.1 1-.2 3.5-.9 6-4 6-7.7 0-4.4-3.6-8-8-8zm-7.9 7l1.5.2c.1-1.2.5-2.3 1.2-3.2l-1.1-.9C4.8 8.2 4.3 9.6 4.1 11zm1.5 1.8l-1.5.2c.1.7.3 1.4.5 2 .3.7.6 1.3 1 1.8l1.2-.8c-.3-.5-.6-1-.8-1.5s-.4-1.1-.4-1.7zm1.5 5.5c1.1.9 2.4 1.4 3.8 1.6l.2-1.5c-1.1-.1-2.2-.5-3.1-1.2l-.9 1.1z"})});const na=window.wp.commands;var oa=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.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"})}),ra=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.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"})});const ia=window.wp.viewport,aa=window.wp.plugins;var la=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.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"})});function ca(e){return["core/edit-post","core/edit-site"].includes(e)?(k()(`${e} interface scope`,{alternative:"core interface scope",hint:"core/edit-post and core/edit-site are merging.",version:"6.6"}),"core"):e}function da(e,t){return"core"===e&&"edit-site/template"===t?(k()("edit-site/template sidebar",{alternative:"edit-post/document",version:"6.6"}),"edit-post/document"):"core"===e&&"edit-site/block-inspector"===t?(k()("edit-site/block-inspector sidebar",{alternative:"edit-post/block",version:"6.6"}),"edit-post/block"):t}const ua=(e,t)=>({type:"SET_DEFAULT_COMPLEMENTARY_AREA",scope:e=ca(e),area:t=da(e,t)}),pa=(e,t)=>({registry:s,dispatch:n})=>{if(!t)return;e=ca(e),t=da(e,t);s.select(C.store).get(e,"isComplementaryAreaVisible")||s.dispatch(C.store).set(e,"isComplementaryAreaVisible",!0),n({type:"ENABLE_COMPLEMENTARY_AREA",scope:e,area:t})},ma=e=>({registry:t})=>{e=ca(e);t.select(C.store).get(e,"isComplementaryAreaVisible")&&t.dispatch(C.store).set(e,"isComplementaryAreaVisible",!1)},ha=(e,t)=>({registry:s})=>{if(!t)return;e=ca(e),t=da(e,t);const n=s.select(C.store).get(e,"pinnedItems");!0!==n?.[t]&&s.dispatch(C.store).set(e,"pinnedItems",{...n,[t]:!0})},ga=(e,t)=>({registry:s})=>{if(!t)return;e=ca(e),t=da(e,t);const n=s.select(C.store).get(e,"pinnedItems");s.dispatch(C.store).set(e,"pinnedItems",{...n,[t]:!1})};function _a(e,t){return function({registry:s}){k()("dispatch( 'core/interface' ).toggleFeature",{since:"6.0",alternative:"dispatch( 'core/preferences' ).toggle"}),s.dispatch(C.store).toggle(e,t)}}function fa(e,t,s){return function({registry:n}){k()("dispatch( 'core/interface' ).setFeatureValue",{since:"6.0",alternative:"dispatch( 'core/preferences' ).set"}),n.dispatch(C.store).set(e,t,!!s)}}function ba(e,t){return function({registry:s}){k()("dispatch( 'core/interface' ).setFeatureDefaults",{since:"6.0",alternative:"dispatch( 'core/preferences' ).setDefaults"}),s.dispatch(C.store).setDefaults(e,t)}}function ya(e){return{type:"OPEN_MODAL",name:e}}function xa(){return{type:"CLOSE_MODAL"}}const va=(0,d.createRegistrySelector)((e=>(t,s)=>{s=ca(s);const n=e(C.store).get(s,"isComplementaryAreaVisible");if(void 0!==n)return!1===n?null:t?.complementaryAreas?.[s]})),wa=(0,d.createRegistrySelector)((e=>(t,s)=>{s=ca(s);const n=e(C.store).get(s,"isComplementaryAreaVisible"),o=t?.complementaryAreas?.[s];return n&&void 0===o})),Sa=(0,d.createRegistrySelector)((e=>(t,s,n)=>{n=da(s=ca(s),n);const o=e(C.store).get(s,"pinnedItems");return o?.[n]??!0})),ka=(0,d.createRegistrySelector)((e=>(t,s,n)=>(k()("select( 'core/interface' ).isFeatureActive( scope, featureName )",{since:"6.0",alternative:"select( 'core/preferences' ).get( scope, featureName )"}),!!e(C.store).get(s,n))));function Ca(e,t){return e.activeModal===t}var Pa=(0,d.combineReducers)({complementaryAreas:function(e={},t){switch(t.type){case"SET_DEFAULT_COMPLEMENTARY_AREA":{const{scope:s,area:n}=t;return e[s]?e:{...e,[s]:n}}case"ENABLE_COMPLEMENTARY_AREA":{const{scope:s,area:n}=t;return{...e,[s]:n}}}return e},activeModal:function(e=null,t){switch(t.type){case"OPEN_MODAL":return t.name;case"CLOSE_MODAL":return null}return e}});const ja=(0,d.createReduxStore)("core/interface",{reducer:Pa,actions:o,selectors:r});function Ea({as:e=Hn.Button,scope:t,identifier:s,icon:n,selectedIcon:o,name:r,shortcut:i,...a}){const l=e,u=(0,aa.usePluginContext)(),p=n||u.icon,m=s||`${u.name}/${r}`,h=(0,d.useSelect)((e=>e(ja).getActiveComplementaryArea(t)===m),[m,t]),{enableComplementaryArea:g,disableComplementaryArea:_}=(0,d.useDispatch)(ja);return(0,c.jsx)(l,{icon:o&&h?o:p,"aria-controls":m.replace("/",":"),"aria-checked":(f=a.role,["checkbox","option","radio","switch","menuitemcheckbox","menuitemradio","treeitem"].includes(f)?h:void 0),onClick:()=>{h?_(t):g(t,m)},shortcut:i,...a});var f}(0,d.register)(ja);var Ta=({children:e,className:t,toggleButtonProps:s})=>{const n=(0,c.jsx)(Ea,{icon:la,...s});return(0,c.jsxs)("div",{className:mr("components-panel__header","interface-complementary-area-header",t),tabIndex:-1,children:[e,n]})};const Ba=()=>{};function Ia({name:e,as:t=Hn.Button,onClick:s,...n}){return(0,c.jsx)(Hn.Fill,{name:e,children:({onClick:e})=>(0,c.jsx)(t,{onClick:s||e?(...t)=>{(s||Ba)(...t),(e||Ba)(...t)}:void 0,...n})})}Ia.Slot=function({name:e,as:t=Hn.MenuGroup,fillProps:s={},bubblesVirtually:n,...o}){return(0,c.jsx)(Hn.Slot,{name:e,bubblesVirtually:n,fillProps:s,children:e=>{if(!p.Children.toArray(e).length)return null;const s=[];p.Children.forEach(e,(({props:{__unstableExplicitMenuItem:e,__unstableTarget:t}})=>{t&&e&&s.push(t)}));const n=p.Children.map(e,(e=>!e.props.__unstableExplicitMenuItem&&s.includes(e.props.__unstableTarget)?null:e));return(0,c.jsx)(t,{...o,children:n})}})};var Na=Ia;const Ra=({__unstableExplicitMenuItem:e,__unstableTarget:t,...s})=>(0,c.jsx)(Hn.MenuItem,{...s});function Da({scope:e,target:t,__unstableExplicitMenuItem:s,...n}){return(0,c.jsx)(Ea,{as:n=>(0,c.jsx)(Na,{__unstableExplicitMenuItem:s,__unstableTarget:`${e}/${t}`,as:Ra,name:`${e}/plugin-more-menu`,...n}),role:"menuitemcheckbox",selectedIcon:zn,name:t,scope:e,...n})}function Aa({scope:e,...t}){return(0,c.jsx)(Hn.Fill,{name:`PinnedItems/${e}`,...t})}Aa.Slot=function({scope:e,className:t,...s}){return(0,c.jsx)(Hn.Slot,{name:`PinnedItems/${e}`,...s,children:e=>e?.length>0&&(0,c.jsx)("div",{className:mr(t,"interface-pinned-items"),children:e})})};var Ma=Aa;const La={open:{width:280},closed:{width:0},mobileOpen:{width:"100vw"}};function Oa({activeArea:e,isActive:t,scope:s,children:n,className:o,id:r}){const i=(0,m.useReducedMotion)(),a=(0,m.useViewportMatch)("medium","<"),l=(0,m.usePrevious)(e),d=(0,m.usePrevious)(t),[,u]=(0,p.useState)({});(0,p.useEffect)((()=>{u({})}),[t]);const h={type:"tween",duration:i||a||l&&e&&e!==l?0:.3,ease:[.6,0,.4,1]};return(0,c.jsx)(Hn.Fill,{name:`ComplementaryArea/${s}`,children:(0,c.jsx)(Hn.__unstableAnimatePresence,{initial:!1,children:(d||t)&&(0,c.jsx)(Hn.__unstableMotion.div,{variants:La,initial:"closed",animate:a?"mobileOpen":"open",exit:"closed",transition:h,className:"interface-complementary-area__fill",children:(0,c.jsx)("div",{id:r,className:o,style:{width:a?"100vw":280},children:n})})})})}function Fa({children:e,className:t,closeLabel:s=(0,fs.__)("Close plugin"),identifier:n,header:o,headerClassName:r,icon:i,isPinnable:a=!0,panelClassName:l,scope:u,name:h,title:g,toggleShortcut:_,isActiveByDefault:f}){const b=(0,aa.usePluginContext)(),y=i||b.icon,x=n||`${b.name}/${h}`,[v,w]=(0,p.useState)(!1),{isLoading:S,isActive:k,isPinned:P,activeArea:j,isSmall:E,isLarge:T,showIconLabels:B}=(0,d.useSelect)((e=>{const{getActiveComplementaryArea:t,isComplementaryAreaLoading:s,isItemPinned:n}=e(ja),{get:o}=e(C.store),r=t(u);return{isLoading:s(u),isActive:r===x,isPinned:n(u,x),activeArea:r,isSmall:e(ia.store).isViewportMatch("< medium"),isLarge:e(ia.store).isViewportMatch("large"),showIconLabels:o("core","showIconLabels")}}),[x,u]),I=(0,m.useViewportMatch)("medium","<");!function(e,t,s,n,o){const r=(0,p.useRef)(!1),i=(0,p.useRef)(!1),{enableComplementaryArea:a,disableComplementaryArea:l}=(0,d.useDispatch)(ja);(0,p.useEffect)((()=>{n&&o&&!r.current?(l(e),i.current=!0):i.current&&!o&&r.current?(i.current=!1,a(e,t)):i.current&&s&&s!==t&&(i.current=!1),o!==r.current&&(r.current=o)}),[n,o,e,t,s,l,a])}(u,x,j,k,E);const{enableComplementaryArea:N,disableComplementaryArea:R,pinItem:D,unpinItem:A}=(0,d.useDispatch)(ja);if((0,p.useEffect)((()=>{f&&void 0===j&&!E?N(u,x):void 0===j&&E&&R(u,x),w(!0)}),[j,f,u,x,E,N,R]),v)return(0,c.jsxs)(c.Fragment,{children:[a&&(0,c.jsx)(Ma,{scope:u,children:P&&(0,c.jsx)(Ea,{scope:u,identifier:x,isPressed:k&&(!B||T),"aria-expanded":k,"aria-disabled":S,label:g,icon:B?zn:y,showTooltip:!B,variant:B?"tertiary":void 0,size:"compact",shortcut:_})}),h&&a&&(0,c.jsx)(Da,{target:h,scope:u,icon:y,identifier:x,children:g}),(0,c.jsxs)(Oa,{activeArea:j,isActive:k,className:mr("interface-complementary-area",t),scope:u,id:x.replace("/",":"),children:[(0,c.jsx)(Ta,{className:r,closeLabel:s,onClose:()=>R(u),toggleButtonProps:{label:s,size:"compact",shortcut:_,scope:u,identifier:x},children:o||(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("h2",{className:"interface-complementary-area-header__title",children:g}),a&&!I&&(0,c.jsx)(Hn.Button,{className:"interface-complementary-area__pin-unpin-item",icon:P?oa:ra,label:P?(0,fs.__)("Unpin from toolbar"):(0,fs.__)("Pin to toolbar"),onClick:()=>(P?A:D)(u,x),isPressed:P,"aria-expanded":P,size:"compact"})]})}),(0,c.jsx)(Hn.Panel,{className:l,children:e})]})]})}Fa.Slot=function({scope:e,...t}){return(0,c.jsx)(Hn.Slot,{name:`ComplementaryArea/${e}`,...t})};var Va=Fa;var Ua=({isActive:e})=>((0,p.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,p.useEffect)((()=>(e?document.body.classList.add("is-fullscreen-mode"):document.body.classList.remove("is-fullscreen-mode"),()=>{e&&document.body.classList.remove("is-fullscreen-mode")})),[e]),null);const Ha=(0,p.forwardRef)((({children:e,className:t,ariaLabel:s,as:n="div",...o},r)=>(0,c.jsx)(n,{ref:r,className:mr("admin-ui-navigable-region",t),"aria-label":s,role:"region",tabIndex:"-1",...o,children:e})));Ha.displayName="NavigableRegion";var za=Ha;const Ga={type:"tween",duration:.25,ease:[.6,0,.4,1]};const $a={hidden:{opacity:1,marginTop:-60},visible:{opacity:1,marginTop:0},distractionFreeHover:{opacity:1,marginTop:0,transition:{...Ga,delay:.2,delayChildren:.2}},distractionFreeHidden:{opacity:0,marginTop:-60},distractionFreeDisabled:{opacity:0,marginTop:0,transition:{...Ga,delay:.8,delayChildren:.8}}};var Wa=(0,p.forwardRef)((function({isDistractionFree:e,footer:t,header:s,editorNotices:n,sidebar:o,secondarySidebar:r,content:i,actions:a,labels:l,className:d},u){const[h,g]=(0,m.useResizeObserver)(),_=(0,m.useViewportMatch)("medium","<"),f={type:"tween",duration:(0,m.useReducedMotion)()?0:.25,ease:[.6,0,.4,1]};!function(e){(0,p.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 b={...{header:(0,fs._x)("Header","header landmark area"),body:(0,fs.__)("Content"),secondarySidebar:(0,fs.__)("Block Library"),sidebar:(0,fs._x)("Settings","settings landmark area"),actions:(0,fs.__)("Publish"),footer:(0,fs.__)("Footer")},...l};return(0,c.jsxs)("div",{ref:u,className:mr(d,"interface-interface-skeleton",!!t&&"has-footer"),children:[(0,c.jsxs)("div",{className:"interface-interface-skeleton__editor",children:[(0,c.jsx)(Hn.__unstableAnimatePresence,{initial:!1,children:!!s&&(0,c.jsx)(za,{as:Hn.__unstableMotion.div,className:"interface-interface-skeleton__header","aria-label":b.header,initial:e&&!_?"distractionFreeHidden":"hidden",whileHover:e&&!_?"distractionFreeHover":"visible",animate:e&&!_?"distractionFreeDisabled":"visible",exit:e&&!_?"distractionFreeHidden":"hidden",variants:$a,transition:f,children:s})}),e&&(0,c.jsx)("div",{className:"interface-interface-skeleton__header",children:n}),(0,c.jsxs)("div",{className:"interface-interface-skeleton__body",children:[(0,c.jsx)(Hn.__unstableAnimatePresence,{initial:!1,children:!!r&&(0,c.jsx)(za,{className:"interface-interface-skeleton__secondary-sidebar",ariaLabel:b.secondarySidebar,as:Hn.__unstableMotion.div,initial:"closed",animate:"open",exit:"closed",variants:{open:{width:g.width},closed:{width:0}},transition:f,children:(0,c.jsxs)(Hn.__unstableMotion.div,{style:{position:"absolute",width:_?"100vw":"fit-content",height:"100%",left:0},variants:{open:{x:0},closed:{x:"-100%"}},transition:f,children:[h,r]})})}),(0,c.jsx)(za,{className:"interface-interface-skeleton__content",ariaLabel:b.body,children:i}),!!o&&(0,c.jsx)(za,{className:"interface-interface-skeleton__sidebar",ariaLabel:b.sidebar,children:o}),!!a&&(0,c.jsx)(za,{className:"interface-interface-skeleton__actions",ariaLabel:b.actions,children:a})]})]}),!!t&&(0,c.jsx)(za,{className:"interface-interface-skeleton__footer",ariaLabel:b.footer,children:t})]})}));const{RenamePatternModal:Za}=$(ao.privateApis),Ya="editor/pattern-rename";function qa(){const{record:e,postType:t}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(vc),{getEditedEntityRecord:n}=e(u.store),o=t();return{record:n("postType",o,s()),postType:o}}),[]),{closeModal:s}=(0,d.useDispatch)(ja);return(0,d.useSelect)((e=>e(ja).isModalActive(Ya)))&&t===N?(0,c.jsx)(Za,{onClose:s,pattern:e}):null}const{DuplicatePatternModal:Ka}=$(ao.privateApis),Qa="editor/pattern-duplicate";function Xa(){const{record:e,postType:t}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(vc),{getEditedEntityRecord:n}=e(u.store),o=t();return{record:n("postType",o,s()),postType:o}}),[]),{closeModal:s}=(0,d.useDispatch)(ja);return(0,d.useSelect)((e=>e(ja).isModalActive(Qa)))&&t===N?(0,c.jsx)(Ka,{onClose:s,onSuccess:()=>s(),pattern:e}):null}const{BlockRemovalWarningModal:Ja}=$(g.privateApis),el=["core/post-content","core/post-template","core/query"],tl=[{postTypes:["wp_template","wp_template_part"],callback(e){if(e.filter((({name:e})=>el.includes(e))).length)return(0,fs._n)("Deleting this block will stop your post or page content from displaying on this template. It is not recommended.","Some of the deleted blocks will stop your post or page content from displaying on this template. It is not recommended.",e.length)}},{postTypes:["wp_block"],callback(e){if(e.filter((({attributes:e})=>e?.metadata?.bindings&&Object.values(e.metadata.bindings).some((e=>"core/pattern-overrides"===e.source)))).length)return(0,fs._n)("The deleted block allows instance overrides. Removing it may result in content not displaying where this pattern is used. Are you sure you want to proceed?","Some of the deleted blocks allow instance overrides. Removing them may result in content not displaying where this pattern is used. Are you sure you want to proceed?",e.length)}}];function sl(){const e=(0,d.useSelect)((e=>e(vc).getCurrentPostType()),[]),t=(0,p.useMemo)((()=>tl.filter((t=>t.postTypes.includes(e)))),[e]);return Ja&&t?(0,c.jsx)(Ja,{rules:t}):null}function nl({blockPatterns:e,onChoosePattern:t}){const{editEntityRecord:s}=(0,d.useDispatch)(u.store),{postType:n,postId:o}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(vc);return{postType:t(),postId:s()}}),[]);return(0,c.jsx)(g.__experimentalBlockPatternsList,{blockPatterns:e,onClickPattern:(e,r)=>{s("postType",n,o,{blocks:r,content:({blocks:e=[]})=>(0,x.__unstableSerializeAndClean)(e)}),t()}})}function ol({onClose:e}){const[t,s]=(0,p.useState)(!0),{set:n}=(0,d.useDispatch)(C.store),o=function(){const{blockPatternsWithPostContentBlockType:e,postType:t}=(0,d.useSelect)((e=>{const{getPatternsByBlockTypes:t,getBlocksByName:s}=e(g.store),{getCurrentPostType:n,getRenderingMode:o}=e(vc);return{blockPatternsWithPostContentBlockType:t("core/post-content","post-only"===o()?"":s("core/post-content")?.[0]),postType:n()}}),[]);return(0,p.useMemo)((()=>e?.length?e.filter((e=>"page"===t&&!e.postTypes||Array.isArray(e.postTypes)&&e.postTypes.includes(t))):[]),[t,e])}();if(!(o.length>0))return null;function r(){e(),n("core","enableChoosePatternModal",t)}return(0,c.jsxs)(Hn.Modal,{className:"editor-start-page-options__modal",title:(0,fs.__)("Choose a pattern"),isFullScreen:!0,onRequestClose:r,children:[(0,c.jsx)("div",{className:"editor-start-page-options__modal-content",children:(0,c.jsx)(nl,{blockPatterns:o,onChoosePattern:r})}),(0,c.jsx)(Hn.Flex,{className:"editor-start-page-options__modal__actions",justify:"flex-start",expanded:!1,children:(0,c.jsx)(Hn.FlexItem,{children:(0,c.jsx)(Hn.CheckboxControl,{__nextHasNoMarginBottom:!0,checked:t,label:(0,fs.__)("Always show starter patterns for new pages"),onChange:e=>{s(e)}})})})]})}function rl(){const[e,t]=(0,p.useState)(!1),{isEditedPostDirty:s,isEditedPostEmpty:n}=(0,d.useSelect)(vc),{isModalActive:o}=(0,d.useSelect)(ja),{enabled:r,postId:i}=(0,d.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:s}=e(vc),n=e(C.store).get("core","enableChoosePatternModal");return{postId:t(),enabled:n&&B!==s()}}),[]);return(0,p.useEffect)((()=>{const e=!s()&&n(),i=o("editor/preferences");r&&e&&!i&&t(!0)}),[r,i,s,n,o]),e?(0,c.jsx)(ol,{onClose:()=>t(!1)}):null}const il=window.wp.keyboardShortcuts,al=[{keyCombination:{modifier:"primary",character:"b"},description:(0,fs.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,fs.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,fs.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,fs.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,fs.__)("Insert a link to a post or page.")},{keyCombination:{modifier:"primary",character:"u"},description:(0,fs.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,fs.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,fs.__)("Make the selected text inline code.")},{keyCombination:{modifier:"access",character:"0"},aliases:[{modifier:"access",character:"7"}],description:(0,fs.__)("Convert the current heading to a paragraph.")},{keyCombination:{modifier:"access",character:"1-6"},description:(0,fs.__)("Convert the current paragraph or heading to a heading of level 1 to 6.")},{keyCombination:{modifier:"primaryShift",character:"SPACE"},description:(0,fs.__)("Add non breaking space.")}],ll=window.wp.keycodes;function cl({keyCombination:e,forceAriaLabel:t}){const s=e.modifier?ll.displayShortcutList[e.modifier](e.character):e.character,n=e.modifier?ll.shortcutAriaLabel[e.modifier](e.character):e.character;return(0,c.jsx)("kbd",{className:"editor-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":t||n,children:(Array.isArray(s)?s:[s]).map(((e,t)=>"+"===e?(0,c.jsx)(p.Fragment,{children:e},t):(0,c.jsx)("kbd",{className:"editor-keyboard-shortcut-help-modal__shortcut-key",children:e},t)))})}var dl=function({description:e,keyCombination:t,aliases:s=[],ariaLabel:n}){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"editor-keyboard-shortcut-help-modal__shortcut-description",children:e}),(0,c.jsxs)("div",{className:"editor-keyboard-shortcut-help-modal__shortcut-term",children:[(0,c.jsx)(cl,{keyCombination:t,forceAriaLabel:n}),s.map(((e,t)=>(0,c.jsx)(cl,{keyCombination:e,forceAriaLabel:n},t)))]})]})};var ul=function({name:e}){const{keyCombination:t,description:s,aliases:n}=(0,d.useSelect)((t=>{const{getShortcutKeyCombination:s,getShortcutDescription:n,getShortcutAliases:o}=t(il.store);return{keyCombination:s(e),aliases:o(e),description:n(e)}}),[e]);return t?(0,c.jsx)(dl,{keyCombination:t,description:s,aliases:n}):null};const pl="editor/keyboard-shortcut-help",ml=({shortcuts:e})=>(0,c.jsx)("ul",{className:"editor-keyboard-shortcut-help-modal__shortcut-list",role:"list",children:e.map(((e,t)=>(0,c.jsx)("li",{className:"editor-keyboard-shortcut-help-modal__shortcut",children:"string"==typeof e?(0,c.jsx)(ul,{name:e}):(0,c.jsx)(dl,{...e})},t)))}),hl=({title:e,shortcuts:t,className:s})=>(0,c.jsxs)("section",{className:mr("editor-keyboard-shortcut-help-modal__section",s),children:[!!e&&(0,c.jsx)("h2",{className:"editor-keyboard-shortcut-help-modal__section-title",children:e}),(0,c.jsx)(ml,{shortcuts:t})]}),gl=({title:e,categoryName:t,additionalShortcuts:s=[]})=>{const n=(0,d.useSelect)((e=>e(il.store).getCategoryShortcuts(t)),[t]);return(0,c.jsx)(hl,{title:e,shortcuts:n.concat(s)})};var _l=function(){const e=(0,d.useSelect)((e=>e(ja).isModalActive(pl)),[]),{openModal:t,closeModal:s}=(0,d.useDispatch)(ja),n=()=>{e?s():t(pl)};return(0,il.useShortcut)("core/editor/keyboard-shortcuts",n),e?(0,c.jsxs)(Hn.Modal,{className:"editor-keyboard-shortcut-help-modal",title:(0,fs.__)("Keyboard shortcuts"),closeButtonLabel:(0,fs.__)("Close"),onRequestClose:n,children:[(0,c.jsx)(hl,{className:"editor-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/editor/keyboard-shortcuts"]}),(0,c.jsx)(gl,{title:(0,fs.__)("Global shortcuts"),categoryName:"global"}),(0,c.jsx)(gl,{title:(0,fs.__)("Selection shortcuts"),categoryName:"selection"}),(0,c.jsx)(gl,{title:(0,fs.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,fs.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,fs.__)("Forward-slash")}]}),(0,c.jsx)(hl,{title:(0,fs.__)("Text formatting"),shortcuts:al}),(0,c.jsx)(gl,{title:(0,fs.__)("List View shortcuts"),categoryName:"list-view"})]}):null};function fl({clientId:e,onClose:t}){const s=Ui(),{entity:n,onNavigateToEntityRecord:o,canEditTemplates:r}=(0,d.useSelect)((t=>{const{getBlockParentsByBlockName:n,getSettings:o,getBlockAttributes:r,getBlockParents:i}=t(g.store),{getCurrentTemplateId:a,getRenderingMode:l}=t(vc),c=n(e,"core/block",!0)[0];let d;if(c?d=t(u.store).getEntityRecord("postType","wp_block",r(c).ref):"template-locked"!==l()||i(e).some((e=>s.includes(e)))||(d=t(u.store).getEntityRecord("postType","wp_template",a())),!d)return{};return{canEditTemplates:t(u.store).canUser("create",{kind:"postType",name:"wp_template"}),entity:d,onNavigateToEntityRecord:o().onNavigateToEntityRecord}}),[e,s]);if(!n)return(0,c.jsx)(bl,{clientId:e,onClose:t});const i="wp_block"===n.type;let a=i?(0,fs.__)("Edit the pattern to move, delete, or make further changes to this block."):(0,fs.__)("Edit the template to move, delete, or make further changes to this block.");return r||(a=(0,fs.__)("Only users with permissions to edit the template can move or delete this block")),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(g.__unstableBlockSettingsMenuFirstItem,{children:(0,c.jsx)(Hn.MenuItem,{onClick:()=>{o({postId:n.id,postType:n.type})},disabled:!r,children:i?(0,fs.__)("Edit pattern"):(0,fs.__)("Edit template")})}),(0,c.jsx)(Hn.__experimentalText,{variant:"muted",as:"p",className:"editor-content-only-settings-menu__description",children:a})]})}function bl({clientId:e,onClose:t}){const{contentLockingParent:s}=(0,d.useSelect)((t=>{const{getContentLockingParent:s}=$(t(g.store));return{contentLockingParent:s(e)}}),[e]),n=(0,g.useBlockDisplayInformation)(s),o=(0,d.useDispatch)(g.store);if(!n?.title)return null;const{modifyContentLockBlock:r}=$(o);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(g.__unstableBlockSettingsMenuFirstItem,{children:(0,c.jsx)(Hn.MenuItem,{onClick:()=>{r(s),t()},children:(0,fs._x)("Unlock","Unlock content locked blocks")})}),(0,c.jsx)(Hn.__experimentalText,{variant:"muted",as:"p",className:"editor-content-only-settings-menu__description",children:(0,fs.__)("Temporarily unlock the parent block to edit, delete or make further changes to this block.")})]})}function yl(){return(0,c.jsx)(g.BlockSettingsMenuControls,{children:({selectedClientIds:e,onClose:t})=>1===e.length&&(0,c.jsx)(fl,{clientId:e[0],onClose:t})})}function xl(e){const{slug:t,patterns:s}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(vc),{getEntityRecord:n,getBlockPatterns:o}=e(u.store),r=s();return{slug:n("postType",t(),r).slug,patterns:o()}}),[]),n=(0,d.useSelect)((e=>e(u.store).getCurrentTheme().stylesheet));return(0,p.useMemo)((()=>[{name:"fallback",blocks:(0,x.parse)(e),title:(0,fs.__)("Fallback content")},...s.filter((e=>Array.isArray(e.templateTypes)&&e.templateTypes.some((e=>t.startsWith(e))))).map((e=>({...e,blocks:(0,x.parse)(e.content).map((e=>function(e){return e.innerBlocks.find((e=>"core/template-part"===e.name))&&(e.innerBlocks=e.innerBlocks.map((e=>("core/template-part"===e.name&&void 0===e.attributes.theme&&(e.attributes.theme=n),e)))),"core/template-part"===e.name&&void 0===e.attributes.theme&&(e.attributes.theme=n),e}(e)))})))]),[e,t,s])}function vl({fallbackContent:e,onChoosePattern:t,postType:s}){const[,,n]=(0,u.useEntityBlockEditor)("postType",s),o=xl(e);return(0,c.jsx)(g.__experimentalBlockPatternsList,{blockPatterns:o,onClickPattern:(e,s)=>{n(s,{selection:void 0}),t()}})}function wl({slug:e,isCustom:t,onClose:s,postType:n}){const o=function(e,t=!1){return(0,d.useSelect)((s=>{const{getEntityRecord:n,getDefaultTemplateId:o}=s(u.store),r=o({slug:e,is_custom:t,ignore_empty:!0});return r?n("postType",B,r)?.content?.raw:void 0}),[e,t])}(e,t);return o?(0,c.jsxs)(Hn.Modal,{className:"editor-start-template-options__modal",title:(0,fs.__)("Choose a pattern"),closeLabel:(0,fs.__)("Cancel"),focusOnMount:"firstElement",onRequestClose:s,isFullScreen:!0,children:[(0,c.jsx)("div",{className:"editor-start-template-options__modal-content",children:(0,c.jsx)(vl,{fallbackContent:o,slug:e,isCustom:t,postType:n,onChoosePattern:()=>{s()}})}),(0,c.jsx)(Hn.Flex,{className:"editor-start-template-options__modal__actions",justify:"flex-end",expanded:!1,children:(0,c.jsx)(Hn.FlexItem,{children:(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:s,children:(0,fs.__)("Skip")})})})]}):null}function Sl(){const[e,t]=(0,p.useState)(!1),{shouldOpenModal:s,slug:n,isCustom:o,postType:r,postId:i}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(vc),n=t(),o=s(),{getEditedEntityRecord:r,hasEditsForEntityRecord:i}=e(u.store),a=r("postType",n,o);return{shouldOpenModal:!i("postType",n,o)&&""===a.content&&B===n,slug:a.slug,isCustom:a.is_custom,postType:n,postId:o}}),[]);return(0,p.useEffect)((()=>{t(!1)}),[r,i]),!s||e?null:(0,c.jsx)(wl,{slug:n,isCustom:o,postType:r,onClose:()=>t(!0)})}function kl(){const e=(0,d.useSelect)((e=>{const{richEditingEnabled:t,codeEditingEnabled:s}=e(vc).getEditorSettings();return!t||!s}),[]),{getBlockSelectionStart:t}=(0,d.useSelect)(g.store),{getActiveComplementaryArea:s}=(0,d.useSelect)(ja),{enableComplementaryArea:n,disableComplementaryArea:o}=(0,d.useDispatch)(ja),{redo:r,undo:i,savePost:a,setIsListViewOpened:l,switchEditorMode:c,toggleDistractionFree:u}=(0,d.useDispatch)(vc),{isEditedPostDirty:p,isPostSavingLocked:m,isListViewOpened:h,getEditorMode:_}=(0,d.useSelect)(vc);return(0,il.useShortcut)("core/editor/toggle-mode",(()=>{c("visual"===_()?"text":"visual")}),{isDisabled:e}),(0,il.useShortcut)("core/editor/toggle-distraction-free",(()=>{u()})),(0,il.useShortcut)("core/editor/undo",(e=>{i(),e.preventDefault()})),(0,il.useShortcut)("core/editor/redo",(e=>{r(),e.preventDefault()})),(0,il.useShortcut)("core/editor/save",(e=>{e.preventDefault(),m()||p()&&a()})),(0,il.useShortcut)("core/editor/toggle-list-view",(e=>{h()||(e.preventDefault(),l(!0))})),(0,il.useShortcut)("core/editor/toggle-sidebar",(e=>{e.preventDefault();if(["edit-post/document","edit-post/block"].includes(s("core")))o("core");else{const e=t()?"edit-post/block":"edit-post/document";n("core",e)}})),null}function Cl({clientId:e,onClose:t}){const{getBlocks:s}=(0,d.useSelect)(g.store),{replaceBlocks:n}=(0,d.useDispatch)(g.store);return(0,d.useSelect)((t=>t(g.store).canRemoveBlock(e)),[e])?(0,c.jsx)(Hn.MenuItem,{onClick:()=>{n(e,s(e)),t()},children:(0,fs.__)("Detach")}):null}function Pl({clientIds:e,blocks:t}){const[s,n]=(0,p.useState)(!1),{replaceBlocks:o}=(0,d.useDispatch)(g.store),{createSuccessNotice:r}=(0,d.useDispatch)(_s.store),{isBlockBasedTheme:i,canCreate:a}=(0,d.useSelect)((e=>({isBlockBasedTheme:e(u.store).getCurrentTheme()?.is_block_theme,canCreate:e(g.store).canInsertBlockType("core/template-part")})),[]);if(!i||!a)return null;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.MenuItem,{icon:U,onClick:()=>{n(!0)},"aria-expanded":s,"aria-haspopup":"dialog",children:(0,fs.__)("Create template part")}),s&&(0,c.jsx)(Jn,{closeModal:()=>{n(!1)},blocks:t,onCreate:async t=>{o(e,(0,x.createBlock)("core/template-part",{slug:t.slug,theme:t.theme})),r((0,fs.__)("Template part created."),{type:"snackbar"})}})]})}function jl(){return(0,c.jsx)(g.BlockSettingsMenuControls,{children:({selectedClientIds:e,onClose:t})=>(0,c.jsx)(El,{clientIds:e,onClose:t})})}function El({clientIds:e,onClose:t}){const{blocks:s}=(0,d.useSelect)((t=>{const{getBlocksByClientId:s}=t(g.store);return{blocks:s(e)}}),[e]);return 1===s.length&&"core/template-part"===s[0]?.name?(0,c.jsx)(Cl,{clientId:e[0],onClose:t}):(0,c.jsx)(Pl,{clientIds:e,blocks:s})}const{ExperimentalBlockEditorProvider:Tl}=$(g.privateApis),{PatternsMenuItems:Bl}=$(ao.privateApis),Il=()=>{},Nl=["wp_block","wp_navigation","wp_template_part"];const Rl=ri((({post:e,settings:t,recovery:s,initialEdits:n,children:o,BlockEditorProviderComponent:r=Tl,__unstableTemplate:i})=>{const a=!!i,{editorSettings:l,selection:m,isReady:_,mode:f,defaultMode:b,postTypeEntities:y}=(0,d.useSelect)((t=>{const{getEditorSettings:s,getEditorSelection:n,getRenderingMode:o,__unstableIsEditorReady:r,getDefaultRenderingMode:i}=$(t(vc)),{getEntitiesConfig:l}=t(u.store),c=o(),d=i(e.type),p="template-locked"===d?a:void 0!==d,m=void 0!==d;return{editorSettings:s(),isReady:r(),mode:m?c:void 0,defaultMode:p?d:void 0,selection:n(),postTypeEntities:"wp_template"===e.type?l("postType"):null}}),[e.type,a]),v=a&&"post-only"!==f,w=v?i:e,S=(0,p.useMemo)((()=>{const t={};if("wp_template"===e.type){if("page"===e.slug)t.postType="page";else if("single"===e.slug)t.postType="post";else if("single"===e.slug.split("-")[0]){const s=y?.map((e=>e.name))||[],n=e.slug.match(`^single-(${s.join("|")})(?:-.+)?$`);n&&(t.postType=n[1])}}else Nl.includes(w.type)&&!v||(t.postId=e.id,t.postType=e.type);return{...t,templateSlug:"wp_template"===w.type?w.slug:void 0}}),[v,e.id,e.type,e.slug,w.type,w.slug,y]),{id:k,type:P}=w,j=Fi(l,P,k,f),[E,T,R]=function(e,t,s){const n="template-locked"===s?"template":"post",[o,r,i]=(0,u.useEntityBlockEditor)("postType",e.type,{id:e.id}),[a,l,c]=(0,u.useEntityBlockEditor)("postType",t?.type,{id:t?.id}),d=(0,p.useMemo)((()=>{if("wp_navigation"===e.type)return[(0,x.createBlock)("core/navigation",{ref:e.id,templateLock:!1})]}),[e.type,e.id]),m=(0,p.useMemo)((()=>d||("template"===n?a:o)),[d,n,a,o]);return t&&"template-locked"===s||"wp_navigation"===e.type?[m,Il,Il]:[m,"post"===n?r:l,"post"===n?i:c]}(e,i,f),{updatePostLock:D,setupEditor:A,updateEditorSettings:M,setCurrentTemplateId:L,setEditedPost:O,setRenderingMode:F}=$((0,d.useDispatch)(vc)),{createWarningNotice:V}=(0,d.useDispatch)(_s.store);return(0,p.useLayoutEffect)((()=>{s||(D(t.postLock),A(e,n,t.template),t.autosave&&V((0,fs.__)("There is an autosave of this post that is more recent than the version below."),{id:"autosave-exists",actions:[{label:(0,fs.__)("View the autosave"),url:t.autosave.editLink}]}))}),[]),(0,p.useEffect)((()=>{O(e.type,e.id)}),[e.type,e.id,O]),(0,p.useEffect)((()=>{M(t)}),[t,M]),(0,p.useEffect)((()=>{L(i?.id)}),[i?.id,L]),(0,p.useEffect)((()=>{b&&F(b)}),[b,F]),function(e,t){(0,p.useEffect)((()=>((0,h.addFilter)("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromInserter",((s,n)=>!(!Gi.includes(e)&&"core/template-part"===n.name&&"post-only"===t)&&s)),(0,h.addFilter)("blockEditor.__unstableCanInsertBlockType","removePostContentFromInserter",((t,s,n,{getBlockParentsByBlockName:o})=>Gi.includes(e)||"core/post-content"!==s.name?t:o(n,"core/query").length>0)),()=>{(0,h.removeFilter)("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromInserter"),(0,h.removeFilter)("blockEditor.__unstableCanInsertBlockType","removePostContentFromInserter")})),[e,t])}(e.type,f),(0,na.useCommandLoader)({name:"core/editor/edit-ui",hook:function(){const{editorMode:e,isListViewOpen:t,showBlockBreadcrumbs:s,isDistractionFree:n,isFocusMode:o,isPreviewMode:r,isViewable:i,isCodeEditingEnabled:a,isRichEditingEnabled:l,isPublishSidebarEnabled:c}=(0,d.useSelect)((e=>{const{get:t}=e(C.store),{isListViewOpened:s,getCurrentPostType:n,getEditorSettings:o}=e(vc),{getSettings:r}=e(g.store),{getPostType:i}=e(u.store);return{editorMode:t("core","editorMode")??"visual",isListViewOpen:s(),showBlockBreadcrumbs:t("core","showBlockBreadcrumbs"),isDistractionFree:t("core","distractionFree"),isFocusMode:t("core","focusMode"),isPreviewMode:r().isPreviewMode,isViewable:i(n())?.viewable??!1,isCodeEditingEnabled:o().codeEditingEnabled,isRichEditingEnabled:o().richEditingEnabled,isPublishSidebarEnabled:e(vc).isPublishSidebarEnabled()}}),[]),{getActiveComplementaryArea:p}=(0,d.useSelect)(ja),{toggle:m}=(0,d.useDispatch)(C.store),{createInfoNotice:h}=(0,d.useDispatch)(_s.store),{__unstableSaveForPreview:_,setIsListViewOpened:f,switchEditorMode:b,toggleDistractionFree:y,toggleSpotlightMode:x,toggleTopToolbar:v}=(0,d.useDispatch)(vc),{openModal:w,enableComplementaryArea:S,disableComplementaryArea:k}=(0,d.useDispatch)(ja),{getCurrentPostId:P}=(0,d.useSelect)(vc),j=a&&l;if(r)return{commands:[],isLoading:!1};const E=[];return E.push({name:"core/open-shortcut-help",label:(0,fs.__)("Keyboard shortcuts"),icon:$i,callback:({close:e})=>{e(),w("editor/keyboard-shortcut-help")}}),E.push({name:"core/toggle-distraction-free",label:n?(0,fs.__)("Exit Distraction free"):(0,fs.__)("Enter Distraction free"),callback:({close:e})=>{y(),e()}}),E.push({name:"core/open-preferences",label:(0,fs.__)("Editor preferences"),callback:({close:e})=>{e(),w("editor/preferences")}}),E.push({name:"core/toggle-spotlight-mode",label:o?(0,fs.__)("Exit Spotlight mode"):(0,fs.__)("Enter Spotlight mode"),callback:({close:e})=>{x(),e()}}),E.push({name:"core/toggle-list-view",label:t?(0,fs.__)("Close List View"):(0,fs.__)("Open List View"),icon:Wi,callback:({close:e})=>{f(!t),e(),h(t?(0,fs.__)("List View off."):(0,fs.__)("List View on."),{id:"core/editor/toggle-list-view/notice",type:"snackbar"})}}),E.push({name:"core/toggle-top-toolbar",label:(0,fs.__)("Top toolbar"),callback:({close:e})=>{v(),e()}}),j&&E.push({name:"core/toggle-code-editor",label:"visual"===e?(0,fs.__)("Open code editor"):(0,fs.__)("Exit code editor"),icon:Zi,callback:({close:t})=>{b("visual"===e?"text":"visual"),t()}}),E.push({name:"core/toggle-breadcrumbs",label:s?(0,fs.__)("Hide block breadcrumbs"):(0,fs.__)("Show block breadcrumbs"),callback:({close:e})=>{m("core","showBlockBreadcrumbs"),e(),h(s?(0,fs.__)("Breadcrumbs hidden."):(0,fs.__)("Breadcrumbs visible."),{id:"core/editor/toggle-breadcrumbs/notice",type:"snackbar"})}}),E.push({name:"core/open-settings-sidebar",label:(0,fs.__)("Show or hide the Settings panel"),icon:(0,fs.isRTL)()?Yi:qi,callback:({close:e})=>{const t=p("core");e(),"edit-post/document"===t?k("core"):S("core","edit-post/document")}}),E.push({name:"core/open-block-inspector",label:(0,fs.__)("Show or hide the Block settings panel"),icon:Ki,callback:({close:e})=>{const t=p("core");e(),"edit-post/block"===t?k("core"):S("core","edit-post/block")}}),E.push({name:"core/toggle-publish-sidebar",label:c?(0,fs.__)("Disable pre-publish checks"):(0,fs.__)("Enable pre-publish checks"),icon:Qi,callback:({close:e})=>{e(),m("core","isPublishSidebarEnabled"),h(c?(0,fs.__)("Pre-publish checks disabled."):(0,fs.__)("Pre-publish checks enabled."),{id:"core/editor/publish-sidebar/notice",type:"snackbar"})}}),i&&E.push({name:"core/preview-link",label:(0,fs.__)("Preview in a new tab"),icon:Fn,callback:async({close:e})=>{e();const t=P(),s=await _();window.open(s,`wp-preview-${t}`)}}),{commands:E,isLoading:!1}}}),(0,na.useCommandLoader)({name:"core/editor/contextual-commands",hook:function(){const{postType:e}=(0,d.useSelect)((e=>{const{getCurrentPostType:t}=e(vc);return{postType:t()}}),[]),{openModal:t}=(0,d.useDispatch)(ja),s=[];return e===N&&(s.push({name:"core/rename-pattern",label:(0,fs.__)("Rename pattern"),icon:Xi,callback:({close:e})=>{t(Ya),e()}}),s.push({name:"core/duplicate-pattern",label:(0,fs.__)("Duplicate pattern"),icon:Ji,callback:({close:e})=>{t(Qa),e()}})),{isLoading:!1,commands:s}},context:"entity-edit"}),(0,na.useCommandLoader)({name:"core/editor/page-content-focus",hook:function(){const{onNavigateToEntityRecord:e,goBack:t,templateId:s,isPreviewMode:n}=(0,d.useSelect)((e=>{const{getRenderingMode:t,getEditorSettings:s,getCurrentTemplateId:n}=$(e(vc)),o=s();return{isTemplateHidden:"post-only"===t(),onNavigateToEntityRecord:o.onNavigateToEntityRecord,getEditorSettings:s,goBack:o.onNavigateToPreviousEntityRecord,templateId:n(),isPreviewMode:o.isPreviewMode}}),[]),{editedRecord:o,hasResolved:r}=(0,u.useEntityRecord)("postType","wp_template",s);if(n)return{isLoading:!1,commands:[]};const i=[];return s&&r&&i.push({name:"core/switch-to-template-focus",label:(0,fs.sprintf)((0,fs.__)("Edit template: %s"),(0,Ln.decodeEntities)(o.title)),icon:W,callback:({close:t})=>{e({postId:s,postType:"wp_template"}),t()}}),t&&i.push({name:"core/switch-to-previous-entity",label:(0,fs.__)("Go back"),icon:ea,callback:({close:e})=>{t(),e()}}),{isLoading:!1,commands:i}},context:"entity-edit"}),(0,na.useCommandLoader)({name:"core/edit-site/manipulate-document",hook:function(){const{postType:e,postId:t}=(0,d.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:s}=e(vc);return{postType:s(),postId:t()}}),[]),{editedRecord:s,hasResolved:n}=(0,u.useEntityRecord)("postType",e,t),{revertTemplate:o}=$((0,d.useDispatch)(vc));if(!n||![I,B].includes(e))return{isLoading:!0,commands:[]};const r=[];if(On(s)){const e=s.type===B?(0,fs.sprintf)((0,fs.__)("Reset template: %s"),(0,Ln.decodeEntities)(s.title)):(0,fs.sprintf)((0,fs.__)("Reset template part: %s"),(0,Ln.decodeEntities)(s.title));r.push({name:"core/reset-template",label:e,icon:(0,fs.isRTL)()?ta:sa,callback:({close:e})=>{o(s),e()}})}return{isLoading:!n,commands:r}}}),_&&f?(0,c.jsx)(u.EntityProvider,{kind:"root",type:"site",children:(0,c.jsx)(u.EntityProvider,{kind:"postType",type:e.type,id:e.id,children:(0,c.jsx)(g.BlockContextProvider,{value:S,children:(0,c.jsxs)(r,{value:E,onChange:R,onInput:T,selection:m,settings:j,useSubRegistry:!1,children:[o,!t.isPreviewMode&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Bl,{}),(0,c.jsx)(jl,{}),(0,c.jsx)(yl,{}),"template-locked"===f&&(0,c.jsx)(Hi,{}),"wp_navigation"===P&&(0,c.jsx)(zi,{}),(0,c.jsx)(kl,{}),(0,c.jsx)(_l,{}),(0,c.jsx)(sl,{}),(0,c.jsx)(rl,{}),(0,c.jsx)(Sl,{}),(0,c.jsx)(qa,{}),(0,c.jsx)(Xa,{})]})]})})})}):null}));function Dl(e){return(0,c.jsx)(Rl,{...e,BlockEditorProviderComponent:g.BlockEditorProvider,children:e.children})}var Al=Dl;const{useGlobalStyle:Ml}=$(g.privateApis);function Ll({template:e,post:t}){const[s="white"]=Ml("color.background"),[n]=(0,u.useEntityBlockEditor)("postType",t.type,{id:t.id}),[o]=(0,u.useEntityBlockEditor)("postType",e?.type,{id:e?.id}),r=e&&o?o:n,i=!r?.length;return(0,c.jsxs)("div",{className:"editor-fields-content-preview",style:{backgroundColor:s},children:[i&&(0,c.jsx)("span",{className:"editor-fields-content-preview__empty",children:(0,fs.__)("Empty content")}),!i&&(0,c.jsx)(g.BlockPreview.Async,{children:(0,c.jsx)(g.BlockPreview,{blocks:r})})]})}const Ol={type:"media",id:"content-preview",label:(0,fs.__)("Content preview"),render:function({item:e}){const{settings:t,template:s}=(0,d.useSelect)((t=>{const{canUser:s,getPostType:n,getTemplateId:o,getEntityRecord:r}=$(t(u.store)),i=s("read",{kind:"postType",name:"wp_template"}),a=t(vc).getEditorSettings(),l=a.supportsTemplateMode,c=n(e.type)?.viewable??!1,d=l&&c&&i?o(e.type,e.id):null;return{settings:a,template:d?r("postType","wp_template",d):void 0}}),[e.type,e.id]);return(0,c.jsx)(Dl,{post:e,settings:t,__unstableTemplate:s,children:(0,c.jsx)(Ll,{template:s,post:e})})},enableSorting:!1};var Fl=Ol;function Vl(e,t,s){return{type:"REGISTER_ENTITY_ACTION",kind:e,name:t,config:s}}function Ul(e,t,s){return{type:"UNREGISTER_ENTITY_ACTION",kind:e,name:t,actionId:s}}function Hl(e,t,s){return{type:"REGISTER_ENTITY_FIELD",kind:e,name:t,config:s}}function zl(e,t,s){return{type:"UNREGISTER_ENTITY_FIELD",kind:e,name:t,fieldId:s}}function Gl(e,t){return{type:"SET_IS_READY",kind:e,name:t}}const $l=e=>async({registry:t})=>{if($(t.select(vc)).isEntityReady("postType",e))return;$(t.dispatch(vc)).setIsReady("postType",e);const s=await t.resolveSelect(u.store).getPostType(e),n=await t.resolveSelect(u.store).canUser("create",{kind:"postType",name:e}),o=await t.resolveSelect(u.store).getCurrentTheme(),r=[s.viewable?Vn:void 0,s.supports?.revisions?Un:void 0,void 0,"wp_template_part"===s.slug&&n&&o?.is_block_theme?io:void 0,n&&"wp_block"===s.slug?ho:void 0,s.supports?.title?fo:void 0,s.supports?.["page-attributes"]?yo:void 0,"wp_block"===s.slug?Zo:void 0,qo,Xo,nr,rr,ar].filter(Boolean),i=[s.supports?.thumbnail&&o?.theme_supports?.["post-thumbnails"]&&ur,s.supports?.author&&fr,Cr,Er,Dr,s.supports?.["page-attributes"]&&Vr,s.supports?.comments&&Ur,s.supports?.trackbacks&&Hr,(s.supports?.comments||s.supports?.trackbacks)&&zr,Wr,Yr,s.supports?.editor&&s.viewable&&Fl].filter(Boolean);if(s.supports?.title){let t;t="page"===e?Xr:"wp_template"===e?Jr:"wp_block"===e?ni:oi,i.push(t)}t.batch((()=>{r.forEach((s=>{$(t.dispatch(vc)).registerEntityAction("postType",e,s)})),i.forEach((s=>{$(t.dispatch(vc)).registerEntityField("postType",e,s)}))})),(0,h.doAction)("core.registerPostTypeSchema",e)};function Wl(e){return{type:"SET_CURRENT_TEMPLATE_ID",id:e}}const Zl=e=>async({select:t,dispatch:s,registry:n})=>{const o=await n.dispatch(u.store).saveEntityRecord("postType","wp_template",e);return n.dispatch(u.store).editEntityRecord("postType",t.getCurrentPostType(),t.getCurrentPostId(),{template:o.slug}),n.dispatch(_s.store).createSuccessNotice((0,fs.__)("Custom template created. You're in template mode now."),{type:"snackbar",actions:[{label:(0,fs.__)("Go back"),onClick:()=>s.setRenderingMode(t.getEditorSettings().defaultRenderingMode)}]}),o},Yl=e=>({registry:t})=>{const s=(t.select(C.store).get("core","hiddenBlockTypes")??[]).filter((t=>!(Array.isArray(e)?e:[e]).includes(t)));t.dispatch(C.store).set("core","hiddenBlockTypes",s)},ql=e=>({registry:t})=>{const s=t.select(C.store).get("core","hiddenBlockTypes")??[],n=new Set([...s,...Array.isArray(e)?e:[e]]);t.dispatch(C.store).set("core","hiddenBlockTypes",[...n])},Kl=({onSave:e,dirtyEntityRecords:t=[],entitiesToSkip:s=[],close:n}={})=>({registry:o})=>{const r=[{kind:"postType",name:"wp_navigation"}],i="site-editor-save-success",a=o.select(u.store).getEntityRecord("root","__unstableBase")?.home;o.dispatch(_s.store).removeNotice(i);const l=t.filter((({kind:e,name:t,key:n,property:o})=>!s.some((s=>s.kind===e&&s.name===t&&s.key===n&&s.property===o))));n?.(l);const c=[],d=[];l.forEach((({kind:e,name:t,key:s,property:n})=>{"root"===e&&"site"===t?c.push(n):(r.some((s=>s.kind===e&&s.name===t))&&o.dispatch(u.store).editEntityRecord(e,t,s,{status:"publish"}),d.push(o.dispatch(u.store).saveEditedEntityRecord(e,t,s)))})),c.length&&d.push(o.dispatch(u.store).__experimentalSaveSpecifiedEntityEdits("root","site",void 0,c)),o.dispatch(g.store).__unstableMarkLastChangeAsPersistent(),Promise.all(d).then((t=>e?e(t):t)).then((e=>{e.some((e=>void 0===e))?o.dispatch(_s.store).createErrorNotice((0,fs.__)("Saving failed.")):o.dispatch(_s.store).createSuccessNotice((0,fs.__)("Site updated."),{type:"snackbar",id:i,actions:[{label:(0,fs.__)("View site"),url:a,openInNewTab:!0}]})})).catch((e=>o.dispatch(_s.store).createErrorNotice(`${(0,fs.__)("Saving failed.")} ${e}`)))},Ql=(e,{allowUndo:t=!0}={})=>async({registry:s})=>{const n="edit-site-template-reverted";if(s.dispatch(_s.store).removeNotice(n),On(e))try{const o=s.select(u.store).getEntityConfig("postType",e.type);if(!o)return void s.dispatch(_s.store).createErrorNotice((0,fs.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const r=(0,w.addQueryArgs)(`${o.baseURL}/${e.id}`,{context:"edit",source:e.origin}),i=await gs()({path:r});if(!i)return void s.dispatch(_s.store).createErrorNotice((0,fs.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const a=({blocks:e=[]})=>(0,x.__unstableSerializeAndClean)(e),l=s.select(u.store).getEditedEntityRecord("postType",e.type,e.id);s.dispatch(u.store).editEntityRecord("postType",e.type,e.id,{content:a,blocks:l.blocks,source:"custom"},{undoIgnore:!0});const c=(0,x.parse)(i?.content?.raw);if(s.dispatch(u.store).editEntityRecord("postType",e.type,i.id,{content:a,blocks:c,source:"theme"}),t){const t=()=>{s.dispatch(u.store).editEntityRecord("postType",e.type,l.id,{content:a,blocks:l.blocks,source:"custom"})};s.dispatch(_s.store).createSuccessNotice((0,fs.__)("Template reset."),{type:"snackbar",id:n,actions:[{label:(0,fs.__)("Undo"),onClick:t}]})}}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,fs.__)("Template revert failed. Please reload.");s.dispatch(_s.store).createErrorNotice(t,{type:"snackbar"})}else s.dispatch(_s.store).createErrorNotice((0,fs.__)("This template is not revertable."),{type:"snackbar"})},Xl=e=>async({registry:t})=>{const s=e.every((e=>e?.has_theme_file)),n=await Promise.allSettled(e.map((e=>t.dispatch(u.store).deleteEntityRecord("postType",e.type,e.id,{force:!0},{throwOnError:!0}))));if(n.every((({status:e})=>"fulfilled"===e))){let n;if(1===e.length){let t;"string"==typeof e[0].title?t=e[0].title:"string"==typeof e[0].title?.rendered?t=e[0].title?.rendered:"string"==typeof e[0].title?.raw&&(t=e[0].title?.raw),n=s?(0,fs.sprintf)((0,fs.__)('"%s" reset.'),(0,Ln.decodeEntities)(t)):(0,fs.sprintf)((0,fs._x)('"%s" deleted.',"template part"),(0,Ln.decodeEntities)(t))}else n=s?(0,fs.__)("Items reset."):(0,fs.__)("Items deleted.");t.dispatch(_s.store).createSuccessNotice(n,{type:"snackbar",id:"editor-template-deleted-success"})}else{let e;if(1===n.length)e=n[0].reason?.message?n[0].reason.message:s?(0,fs.__)("An error occurred while reverting the item."):(0,fs.__)("An error occurred while deleting the item.");else{const t=new Set,o=n.filter((({status:e})=>"rejected"===e));for(const e of o)e.reason?.message&&t.add(e.reason.message);e=0===t.size?(0,fs.__)("An error occurred while deleting the items."):1===t.size?s?(0,fs.sprintf)((0,fs.__)("An error occurred while reverting the items: %s"),[...t][0]):(0,fs.sprintf)((0,fs.__)("An error occurred while deleting the items: %s"),[...t][0]):s?(0,fs.sprintf)((0,fs.__)("Some errors occurred while reverting the items: %s"),[...t].join(",")):(0,fs.sprintf)((0,fs.__)("Some errors occurred while deleting the items: %s"),[...t].join(","))}t.dispatch(_s.store).createErrorNotice(e,{type:"snackbar"})}},Jl=e=>({select:t,registry:s})=>{const n=t.getCurrentPostType(),o=s.select(u.store).getCurrentTheme()?.stylesheet,r=s.select(C.store).get("core","renderingModes")?.[o]??{};if(r[n]===e)return;const i={[o]:{...r,[n]:e}};s.dispatch(C.store).set("core","renderingModes",i)};function ec(e){return{type:"SET_CANVAS_MIN_HEIGHT",minHeight:e}}var tc=s(5215),sc=s.n(tc),nc=(0,c.jsx)(L.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(L.Path,{d:"M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z"})}),oc=(0,c.jsx)(L.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(L.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 rc=[];const ic={rootClientId:void 0,insertionIndex:void 0,filterValue:void 0},ac=["post-only","template-locked"],lc=(0,d.createRegistrySelector)((e=>(0,d.createSelector)((t=>{if("object"==typeof t.blockInserterPanel)return t.blockInserterPanel;if("template-locked"===st(t)){const[t]=e(g.store).getBlocksByName("core/post-content");if(t)return{rootClientId:t,insertionIndex:void 0,filterValue:void 0}}return ic}),(t=>{const[s]=e(g.store).getBlocksByName("core/post-content");return[t.blockInserterPanel,st(t),s]}))));function cc(e){return e.listViewToggleRef}function dc(e){return e.inserterSidebarToggleRef}const uc={wp_block:Ji,wp_navigation:nc,page:ea,post:oc},pc=(0,d.createRegistrySelector)((e=>(t,s,n)=>{{if("wp_template_part"===s||"wp_template"===s){const t=(e(u.store).getCurrentTheme()?.default_template_part_areas||[]).find((e=>n.area===e.area));return t?.icon?H(t.icon):W}if(uc[s])return uc[s];const t=e(u.store).getPostType(s);return"string"==typeof t?.icon&&t.icon.startsWith("dashicons-")?t.icon.slice(10):ea}})),mc=(0,d.createRegistrySelector)((e=>(t,s,n)=>{const{type:o,id:r}=ne(t),i=e(u.store).getEntityRecordNonTransientEdits("postType",s||o,n||r);if(!i?.meta)return!1;const a=e(u.store).getEntityRecord("postType",s||o,n||r)?.meta;return!sc()({...a,footnotes:void 0},{...i.meta,footnotes:void 0})}));function hc(e,...t){return function(e,t,s){return e.actions[t]?.[s]??rc}(e.dataviews,...t)}function gc(e,...t){return function(e,t,s){return e.isReady[t]?.[s]}(e.dataviews,...t)}function _c(e,...t){return function(e,t,s){return e.fields[t]?.[s]??rc}(e.dataviews,...t)}const fc=(0,d.createRegistrySelector)((e=>(0,d.createSelector)(((t,s)=>{s=Array.isArray(s)?s:[s];const{getBlocksByName:n,getBlockParents:o,getBlockName:r}=e(g.store);return n(s).filter((e=>o(e).every((e=>{const t=r(e);return"core/query"!==t&&!s.includes(t)}))))}),(()=>[e(g.store).getBlocks()])))),bc=(0,d.createRegistrySelector)((e=>(t,s)=>{const{getPostType:n,getCurrentTheme:o,hasFinishedResolution:r}=e(u.store),i=o(),a=n(s);if(!r("getPostType",[s])||!r("getCurrentTheme"))return;const l=i?.stylesheet,c=e(C.store).get("core","renderingModes")?.[l]?.[s],d=Array.isArray(a?.supports?.editor)?a.supports.editor.find((e=>"default-mode"in e))?.["default-mode"]:void 0,p=c||d;return ac.includes(p)?p:"post-only"}));function yc(e){return e.canvasMinHeight}const xc={reducer:y,selectors:e,actions:t},vc=(0,d.createReduxStore)("core/editor",{...xc});(0,d.register)(vc),$(vc).registerPrivateActions(a),$(vc).registerPrivateSelectors(l);function wc(e){const t=e.avatar_urls&&e.avatar_urls[24]?(0,c.jsx)("img",{className:"editor-autocompleters__user-avatar",alt:"",src:e.avatar_urls[24]}):(0,c.jsx)("span",{className:"editor-autocompleters__no-avatar"});return(0,c.jsxs)(c.Fragment,{children:[t,(0,c.jsx)("span",{className:"editor-autocompleters__user-name",children:e.name}),(0,c.jsx)("span",{className:"editor-autocompleters__user-slug",children:e.slug})]})}(0,h.addFilter)("blocks.registerBlockType","core/editor/custom-sources-backwards-compatibility/shim-attribute-source",(function(e){const t=Object.fromEntries(Object.entries(e.attributes??{}).filter((([,{source:e}])=>"meta"===e)).map((([e,{meta:t}])=>[e,t])));return Object.entries(t).length&&(e.edit=(e=>(0,m.createHigherOrderComponent)((t=>({attributes:s,setAttributes:n,...o})=>{const r=(0,d.useSelect)((e=>e(vc).getCurrentPostType()),[]),[i,a]=(0,u.useEntityProp)("postType",r,"meta"),l=(0,p.useMemo)((()=>({...s,...Object.fromEntries(Object.entries(e).map((([e,t])=>[e,i[t]])))})),[s,i]);return(0,c.jsx)(t,{attributes:l,setAttributes:t=>{const s=Object.fromEntries(Object.entries(t??{}).filter((([t])=>t in e)).map((([t,s])=>[e[t],s])));Object.entries(s).length&&a(s),n(t)},...o})}),"withMetaAttributeSource"))(t)(e.edit)),e}));var Sc={name:"users",className:"editor-autocompleters__user",triggerPrefix:"@",useItems(e){const t=(0,d.useSelect)((t=>{const{getUsers:s}=t(u.store);return s({context:"view",search:encodeURIComponent(e)})}),[e]);return[(0,p.useMemo)((()=>t?t.map((e=>({key:`user-${e.slug}`,value:e,label:wc(e)}))):[]),[t])]},getOptionCompletion:e=>`@${e.slug}`};(0,h.addFilter)("editor.Autocomplete.completers","editor/autocompleters/set-default-completers",(function(e=[]){return e.push({...Sc}),e})),(0,h.addFilter)("editor.MediaUpload","core/editor/components/media-upload",(()=>lr.MediaUpload));const{PatternOverridesControls:kc,ResetOverridesControl:Cc,PatternOverridesBlockControls:Pc,PATTERN_TYPES:jc,PARTIAL_SYNCING_SUPPORTED_BLOCKS:Ec,PATTERN_SYNC_TYPES:Tc}=$(ao.privateApis),Bc=(0,m.createHigherOrderComponent)((e=>t=>{const s=!!Ec[t.name];return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(e,{...t},"edit"),t.isSelected&&s&&(0,c.jsx)(Ic,{...t}),s&&(0,c.jsx)(Pc,{})]})}),"withPatternOverrideControls");function Ic(e){const t=(0,g.useBlockEditingMode)(),{hasPatternOverridesSource:s,isEditingSyncedPattern:n}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getEditedPostAttribute:s}=e(vc);return{hasPatternOverridesSource:!!(0,x.getBlockBindingsSource)("core/pattern-overrides"),isEditingSyncedPattern:t()===jc.user&&s("meta")?.wp_pattern_sync_status!==Tc.unsynced&&s("wp_pattern_sync_status")!==Tc.unsynced}}),[]),o=e.attributes.metadata?.bindings,r=!!o&&Object.values(o).some((e=>"core/pattern-overrides"===e.source)),i=n&&"default"===t,a=!n&&!!e.attributes.metadata?.name&&"disabled"!==t&&r;return s?(0,c.jsxs)(c.Fragment,{children:[i&&(0,c.jsx)(kc,{...e}),a&&(0,c.jsx)(Cc,{...e})]}):null}(0,h.addFilter)("editor.BlockEdit","core/editor/with-pattern-override-controls",Bc);const Nc=["core/navigation-link","core/navigation-submenu"];function Rc({attributes:e}){const{kind:t,id:s,type:n}=e,o=(0,g.useBlockEditingMode)(),r=(0,d.useSelect)((e=>e(g.store).getSettings().onNavigateToEntityRecord),[]),i=(0,p.useCallback)((()=>{"post-type"===t&&"page"===n&&s&&r&&r({postId:s,postType:n})}),[t,s,n,r]);return"post-type"===t&&"page"===n&&s&&r&&"contentOnly"===o?(0,c.jsx)(g.__unstableBlockToolbarLastItem,{children:(0,c.jsx)(Hn.ToolbarGroup,{children:(0,c.jsx)(Hn.ToolbarButton,{name:"view",title:(0,fs.__)("View"),onClick:i,children:(0,fs.__)("View")})})}):null}const Dc=(0,m.createHigherOrderComponent)((e=>t=>{const s=Nc.includes(t.name);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(e,{...t},"edit"),t.isSelected&&s&&(0,c.jsx)(Rc,{...t})]})}),"withNavigationViewButton");(0,h.addFilter)("editor.BlockEdit","core/editor/with-navigation-view-button",Dc);function Ac({clientId:e}){const{selectBlock:t,flashBlock:s}=(0,d.useDispatch)(g.store),{enableComplementaryArea:n}=(0,d.useDispatch)(ja),{hasNavigationBlocks:o,firstNavigationBlockId:r,isNavigationEditable:i}=(0,d.useSelect)((t=>{const{getClientIdsOfDescendants:s,getBlockName:n,getBlockEditingMode:o}=t(g.store),r=s(e).filter((e=>"core/navigation"===n(e))),i=r.length>0,a=i?r[0]:null;return{hasNavigationBlocks:i,firstNavigationBlockId:a,isNavigationEditable:"disabled"!==o(a)}}),[e]),a=(0,p.useCallback)((()=>{r&&(t(r),s(r,500),n("core","edit-post/block"))}),[r,t,s,n]);return o&&i?(0,c.jsx)(g.__unstableBlockToolbarLastItem,{children:(0,c.jsx)(Hn.ToolbarGroup,{children:(0,c.jsx)(Hn.ToolbarButton,{label:(0,fs.__)("Edit navigation"),onClick:a,children:(0,fs.__)("Edit navigation")})})}):null}const Mc=(0,m.createHigherOrderComponent)((e=>t=>{const s="core/template-part"===t.name;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(e,{...t},"edit"),t.isSelected&&s&&(0,c.jsx)(Ac,{clientId:t.clientId})]})}),"withTemplatePartNavigationEditButton");(0,h.addFilter)("editor.BlockEdit","core/editor/with-template-part-navigation-edit-button",Mc);class Lc extends p.Component{constructor(e){super(e),this.needsAutosave=!(!e.isDirty||!e.isAutosaveable)}componentDidMount(){this.props.disableIntervalChecks||this.setAutosaveTimer()}componentDidUpdate(e){this.props.disableIntervalChecks?this.props.editsReference!==e.editsReference&&this.props.autosave():(this.props.interval!==e.interval&&(clearTimeout(this.timerId),this.setAutosaveTimer()),this.props.isDirty&&(!this.props.isAutosaving||e.isAutosaving)?this.props.editsReference!==e.editsReference&&(this.needsAutosave=!0):this.needsAutosave=!1)}componentWillUnmount(){clearTimeout(this.timerId)}setAutosaveTimer(e=1e3*this.props.interval){this.timerId=setTimeout((()=>{this.autosaveTimerHandler()}),e)}autosaveTimerHandler(){this.props.isAutosaveable?(this.needsAutosave&&(this.needsAutosave=!1,this.props.autosave()),this.setAutosaveTimer()):this.setAutosaveTimer(1e3)}render(){return null}}var Oc=(0,m.compose)([(0,d.withSelect)(((e,t)=>{const{getReferenceByDistinctEdits:s}=e(u.store),{isEditedPostDirty:n,isEditedPostAutosaveable:o,isAutosavingPost:r,getEditorSettings:i}=e(vc),{interval:a=i().autosaveInterval}=t;return{editsReference:s(),isDirty:n(),isAutosaveable:o(),isAutosaving:r(),interval:a}})),(0,d.withDispatch)(((e,t)=>({autosave(){const{autosave:s=e(vc).autosave}=t;s()}})))])(Lc),Fc=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})}),Vc=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"})});const Uc=window.wp.dom;function Hc(e){const{isFrontPage:t,isPostsPage:s}=(0,d.useSelect)((t=>{const{canUser:s,getEditedEntityRecord:n}=t(u.store),o=s("read",{kind:"root",name:"site"})?n("root","site"):void 0,r=parseInt(e,10);return{isFrontPage:o?.page_on_front===r,isPostsPage:o?.page_for_posts===r}}));return t?(0,fs.__)("Homepage"):!!s&&(0,fs.__)("Posts Page")}const zc=Hn.__unstableMotion.create(Hn.Button);function Gc(e){const{postId:t,postType:s,postTypeLabel:n,documentTitle:o,isNotFound:r,templateTitle:i,onNavigateToPreviousEntityRecord:a,isTemplatePreview:l}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s,getEditorSettings:n,getRenderingMode:o}=e(vc),{getEditedEntityRecord:r,getPostType:i,getCurrentTheme:a,isResolving:l}=e(u.store),c=t(),d=s(),p=r("postType",c,d),{default_template_types:m=[]}=a()??{},h=Y({templateTypes:m,template:p}),g=i(c)?.labels?.singular_name;return{postId:d,postType:c,postTypeLabel:g,documentTitle:p.title,isNotFound:!p&&!l("getEditedEntityRecord","postType",c,d),templateTitle:h.title,onNavigateToPreviousEntityRecord:n().onNavigateToPreviousEntityRecord,isTemplatePreview:"template-locked"===o()}}),[]),{open:h}=(0,d.useDispatch)(na.store),_=(0,m.useReducedMotion)(),f=A.includes(s),b=!!a,y=f?i:o,x=e.title||y,v=e.icon,w=Hc(t),S=(0,p.useRef)(!1);return(0,p.useEffect)((()=>{S.current=!0}),[]),(0,c.jsxs)("div",{className:mr("editor-document-bar",{"has-back-button":b}),children:[(0,c.jsx)(Hn.__unstableAnimatePresence,{children:b&&(0,c.jsx)(zc,{className:"editor-document-bar__back",icon:(0,fs.isRTL)()?Fc:Vc,onClick:e=>{e.stopPropagation(),a()},size:"compact",initial:!!S.current&&{opacity:0,transform:"translateX(15%)"},animate:{opacity:1,transform:"translateX(0%)"},exit:{opacity:0,transform:"translateX(15%)"},transition:_?{duration:0}:void 0,children:(0,fs.__)("Back")})}),!f&&l&&!b&&(0,c.jsx)(g.BlockIcon,{icon:W,className:"editor-document-bar__icon-layout"}),r?(0,c.jsx)(Hn.__experimentalText,{children:(0,fs.__)("Document not found")}):(0,c.jsxs)(Hn.Button,{className:"editor-document-bar__command",onClick:()=>h(),size:"compact",children:[(0,c.jsxs)(Hn.__unstableMotion.div,{className:"editor-document-bar__title",initial:!!S.current&&{opacity:0,transform:b?"translateX(15%)":"translateX(-15%)"},animate:{opacity:1,transform:"translateX(0%)"},transition:_?{duration:0}:void 0,children:[v&&(0,c.jsx)(g.BlockIcon,{icon:v}),(0,c.jsxs)(Hn.__experimentalText,{size:"body",as:"h1",children:[(0,c.jsx)("span",{className:"editor-document-bar__post-title",children:x?(0,Uc.__unstableStripHTML)(x):(0,fs.__)("No title")}),w&&(0,c.jsx)("span",{className:"editor-document-bar__post-type-label",children:`· ${w}`}),n&&!e.title&&!w&&(0,c.jsx)("span",{className:"editor-document-bar__post-type-label",children:`· ${(0,Ln.decodeEntities)(n)}`})]})]},b),(0,c.jsx)("span",{className:"editor-document-bar__shortcut",children:ll.displayShortcut.primary("k")})]})]})}const $c=window.wp.richText;var Wc=({children:e,isValid:t,isDisabled:s,level:n,href:o,onSelect:r})=>(0,c.jsx)("li",{className:mr("document-outline__item",`is-${n.toLowerCase()}`,{"is-invalid":!t,"is-disabled":s}),children:(0,c.jsxs)("a",{href:o,className:"document-outline__button","aria-disabled":s,onClick:function(e){s?e.preventDefault():r()},children:[(0,c.jsx)("span",{className:"document-outline__emdash","aria-hidden":"true"}),(0,c.jsx)("strong",{className:"document-outline__level",children:n}),(0,c.jsx)("span",{className:"document-outline__item-content",children:e})]})});const Zc=(0,c.jsx)("em",{children:(0,fs.__)("(Empty heading)")}),Yc=[(0,c.jsx)("br",{},"incorrect-break"),(0,c.jsx)("em",{children:(0,fs.__)("(Incorrect heading level)")},"incorrect-message")],qc=[(0,c.jsx)("br",{},"incorrect-break-h1"),(0,c.jsx)("em",{children:(0,fs.__)("(Your theme may already use a H1 for the post title)")},"incorrect-message-h1")],Kc=[(0,c.jsx)("br",{},"incorrect-break-multiple-h1"),(0,c.jsx)("em",{children:(0,fs.__)("(Multiple H1 headings are not recommended)")},"incorrect-message-multiple-h1")];function Qc(){return(0,c.jsxs)(Hn.SVG,{width:"138",height:"148",viewBox:"0 0 138 148",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,c.jsx)(Hn.Rect,{width:"138",height:"148",rx:"4",fill:"#F0F6FC"}),(0,c.jsx)(Hn.Line,{x1:"44",y1:"28",x2:"24",y2:"28",stroke:"#DDDDDD"}),(0,c.jsx)(Hn.Rect,{x:"48",y:"16",width:"27",height:"23",rx:"4",fill:"#DDDDDD"}),(0,c.jsx)(Hn.Path,{d:"M54.7585 32V23.2727H56.6037V26.8736H60.3494V23.2727H62.1903V32H60.3494V28.3949H56.6037V32H54.7585ZM67.4574 23.2727V32H65.6122V25.0241H65.5611L63.5625 26.277V24.6406L65.723 23.2727H67.4574Z",fill:"black"}),(0,c.jsx)(Hn.Line,{x1:"55",y1:"59",x2:"24",y2:"59",stroke:"#DDDDDD"}),(0,c.jsx)(Hn.Rect,{x:"59",y:"47",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),(0,c.jsx)(Hn.Path,{d:"M65.7585 63V54.2727H67.6037V57.8736H71.3494V54.2727H73.1903V63H71.3494V59.3949H67.6037V63H65.7585ZM74.6605 63V61.6705L77.767 58.794C78.0313 58.5384 78.2528 58.3082 78.4318 58.1037C78.6136 57.8991 78.7514 57.6989 78.8452 57.5028C78.9389 57.304 78.9858 57.0895 78.9858 56.8594C78.9858 56.6037 78.9276 56.3835 78.8111 56.1989C78.6946 56.0114 78.5355 55.8679 78.3338 55.7685C78.1321 55.6662 77.9034 55.6151 77.6477 55.6151C77.3807 55.6151 77.1477 55.669 76.9489 55.777C76.75 55.8849 76.5966 56.0398 76.4886 56.2415C76.3807 56.4432 76.3267 56.6832 76.3267 56.9616H74.5753C74.5753 56.3906 74.7045 55.8949 74.9631 55.4744C75.2216 55.054 75.5838 54.7287 76.0497 54.4986C76.5156 54.2685 77.0526 54.1534 77.6605 54.1534C78.2855 54.1534 78.8295 54.2642 79.2926 54.4858C79.7585 54.7045 80.1207 55.0085 80.3793 55.3977C80.6378 55.7869 80.767 56.233 80.767 56.7358C80.767 57.0653 80.7017 57.3906 80.571 57.7116C80.4432 58.0327 80.2145 58.3892 79.8849 58.7812C79.5554 59.1705 79.0909 59.6378 78.4915 60.1832L77.2173 61.4318V61.4915H80.8821V63H74.6605Z",fill:"black"}),(0,c.jsx)(Hn.Line,{x1:"80",y1:"90",x2:"24",y2:"90",stroke:"#DDDDDD"}),(0,c.jsx)(Hn.Rect,{x:"84",y:"78",width:"30",height:"23",rx:"4",fill:"#F0B849"}),(0,c.jsx)(Hn.Path,{d:"M90.7585 94V85.2727H92.6037V88.8736H96.3494V85.2727H98.1903V94H96.3494V90.3949H92.6037V94H90.7585ZM99.5284 92.4659V91.0128L103.172 85.2727H104.425V87.2841H103.683L101.386 90.919V90.9872H106.564V92.4659H99.5284ZM103.717 94V92.0227L103.751 91.3793V85.2727H105.482V94H103.717Z",fill:"black"}),(0,c.jsx)(Hn.Line,{x1:"66",y1:"121",x2:"24",y2:"121",stroke:"#DDDDDD"}),(0,c.jsx)(Hn.Rect,{x:"70",y:"109",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),(0,c.jsx)(Hn.Path,{d:"M76.7585 125V116.273H78.6037V119.874H82.3494V116.273H84.1903V125H82.3494V121.395H78.6037V125H76.7585ZM88.8864 125.119C88.25 125.119 87.6832 125.01 87.1861 124.791C86.6918 124.57 86.3011 124.266 86.0142 123.879C85.7301 123.49 85.5838 123.041 85.5753 122.533H87.4332C87.4446 122.746 87.5142 122.933 87.642 123.095C87.7727 123.254 87.946 123.378 88.1619 123.466C88.3778 123.554 88.6207 123.598 88.8906 123.598C89.1719 123.598 89.4205 123.548 89.6364 123.449C89.8523 123.349 90.0213 123.212 90.1435 123.036C90.2656 122.859 90.3267 122.656 90.3267 122.426C90.3267 122.193 90.2614 121.987 90.1307 121.808C90.0028 121.626 89.8182 121.484 89.5767 121.382C89.3381 121.28 89.054 121.229 88.7244 121.229H87.9105V119.874H88.7244C89.0028 119.874 89.2486 119.825 89.4616 119.729C89.6776 119.632 89.8452 119.499 89.9645 119.328C90.0838 119.155 90.1435 118.953 90.1435 118.723C90.1435 118.504 90.0909 118.312 89.9858 118.148C89.8835 117.98 89.7386 117.849 89.5511 117.756C89.3665 117.662 89.1506 117.615 88.9034 117.615C88.6534 117.615 88.4247 117.661 88.2173 117.751C88.0099 117.839 87.8438 117.966 87.7188 118.131C87.5938 118.295 87.527 118.489 87.5185 118.71H85.75C85.7585 118.207 85.902 117.764 86.1804 117.381C86.4588 116.997 86.8338 116.697 87.3054 116.482C87.7798 116.263 88.3153 116.153 88.9119 116.153C89.5142 116.153 90.0412 116.263 90.4929 116.482C90.9446 116.7 91.2955 116.996 91.5455 117.368C91.7983 117.737 91.9233 118.152 91.9205 118.612C91.9233 119.101 91.7713 119.509 91.4645 119.835C91.1605 120.162 90.7642 120.369 90.2756 120.457V120.526C90.9176 120.608 91.4063 120.831 91.7415 121.195C92.0795 121.555 92.2472 122.007 92.2443 122.55C92.2472 123.047 92.1037 123.489 91.8139 123.875C91.527 124.261 91.1307 124.565 90.625 124.787C90.1193 125.009 89.5398 125.119 88.8864 125.119Z",fill:"black"})]})}const Xc=(e=[])=>e.filter((e=>"core/heading"===e.name)).map((e=>({...e,level:e.attributes.level,isEmpty:Jc(e)}))),Jc=e=>!e.attributes.content||0===e.attributes.content.trim().length;function ed({onSelect:e,hasOutlineItemsDisabled:t}){const{selectBlock:s}=(0,d.useDispatch)(g.store),{title:n,isTitleSupported:o}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(vc),{getPostType:s}=e(u.store),n=s(t("type"));return{title:t("title"),isTitleSupported:n?.supports?.title??!1}})),r=(0,d.useSelect)((e=>{const{getClientIdsWithDescendants:t,getBlock:s}=e(g.store);return t().map((e=>s(e)))})),i=(0,d.useSelect)((e=>{if("post-only"===e(vc).getRenderingMode())return;const{getBlocksByName:t,getClientIdsOfDescendants:s}=e(g.store),[n]=t("core/post-content");return n?s(n):void 0}),[]),a=(0,p.useRef)(1),l=(0,p.useMemo)((()=>Xc(r)),[r]);if(l.length<1)return(0,c.jsxs)("div",{className:"editor-document-outline has-no-headings",children:[(0,c.jsx)(Qc,{}),(0,c.jsx)("p",{children:(0,fs.__)("Navigate the structure of your document and address issues like empty or incorrect heading levels.")})]});const m=document.querySelector(".editor-post-title__input"),h=o&&n&&m,_=l.reduce(((e,t)=>({...e,[t.level]:(e[t.level]||0)+1})),{})[1]>1;return(0,c.jsx)("div",{className:"document-outline",children:(0,c.jsxs)("ul",{children:[h&&(0,c.jsx)(Wc,{level:(0,fs.__)("Title"),isValid:!0,onSelect:e,href:`#${m.id}`,isDisabled:t,children:n}),l.map((n=>{const o=n.level>a.current+1,r=!(n.isEmpty||o||!n.level||1===n.level&&(_||h));return a.current=n.level,(0,c.jsxs)(Wc,{level:`H${n.level}`,isValid:r,isDisabled:t||(l=n.clientId,!(!Array.isArray(i)||i.includes(l))),href:`#block-${n.clientId}`,onSelect:()=>{s(n.clientId),e?.()},children:[n.isEmpty?Zc:(0,$c.getTextContent)((0,$c.create)({html:n.attributes.content})),o&&Yc,1===n.level&&_&&Kc,h&&1===n.level&&!_&&qc]},n.clientId);var l}))]})})}function td({children:e}){const t=(0,d.useSelect)((e=>{const{getGlobalBlockCount:t}=e(g.store);return t("core/heading")>0}));return t?e:null}var sd=function(){const{registerShortcut:e}=(0,d.useDispatch)(il.store);return(0,p.useEffect)((()=>{e({name:"core/editor/toggle-mode",category:"global",description:(0,fs.__)("Switch between visual editor and code editor."),keyCombination:{modifier:"secondary",character:"m"}}),e({name:"core/editor/save",category:"global",description:(0,fs.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),e({name:"core/editor/undo",category:"global",description:(0,fs.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/editor/redo",category:"global",description:(0,fs.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"},aliases:(0,ll.isAppleOS)()?[]:[{modifier:"primary",character:"y"}]}),e({name:"core/editor/toggle-list-view",category:"global",description:(0,fs.__)("Show or hide the List View."),keyCombination:{modifier:"access",character:"o"}}),e({name:"core/editor/toggle-distraction-free",category:"global",description:(0,fs.__)("Enter or exit distraction free mode."),keyCombination:{modifier:"primaryShift",character:"\\"}}),e({name:"core/editor/toggle-sidebar",category:"global",description:(0,fs.__)("Show or hide the Settings panel."),keyCombination:{modifier:"primaryShift",character:","}}),e({name:"core/editor/keyboard-shortcuts",category:"main",description:(0,fs.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),e({name:"core/editor/next-region",category:"global",description:(0,fs.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),e({name:"core/editor/previous-region",category:"global",description:(0,fs.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"},{modifier:"ctrlShift",character:"~"}]})}),[e]),(0,c.jsx)(g.BlockEditorKeyboardShortcuts.Register,{})},nd=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.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"})}),od=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.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 rd=(0,p.forwardRef)((function(e,t){const s=(0,ll.isAppleOS)()?ll.displayShortcut.primaryShift("z"):ll.displayShortcut.primary("y"),n=(0,d.useSelect)((e=>e(vc).hasEditorRedo()),[]),{redo:o}=(0,d.useDispatch)(vc);return(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,...e,ref:t,icon:(0,fs.isRTL)()?od:nd,label:(0,fs.__)("Redo"),shortcut:s,"aria-disabled":!n,onClick:n?o:void 0,className:"editor-history__redo"})}));var id=(0,p.forwardRef)((function(e,t){const s=(0,d.useSelect)((e=>e(vc).hasEditorUndo()),[]),{undo:n}=(0,d.useDispatch)(vc);return(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,...e,ref:t,icon:(0,fs.isRTL)()?nd:od,label:(0,fs.__)("Undo"),shortcut:ll.displayShortcut.primary("z"),"aria-disabled":!s,onClick:s?n:void 0,className:"editor-history__undo"})}));function ad(){const[e,t]=(0,p.useState)(!1),s=(0,d.useSelect)((e=>e(g.store).isValidTemplate()),[]),{setTemplateValidity:n,synchronizeTemplate:o}=(0,d.useDispatch)(g.store);return s?null:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.Notice,{className:"editor-template-validation-notice",isDismissible:!1,status:"warning",actions:[{label:(0,fs.__)("Keep it as is"),onClick:()=>n(!0)},{label:(0,fs.__)("Reset the template"),onClick:()=>t(!0)}],children:(0,fs.__)("The content of your post doesn’t match the template assigned to your post type.")}),(0,c.jsx)(Hn.__experimentalConfirmDialog,{isOpen:e,confirmButtonText:(0,fs.__)("Reset"),onConfirm:()=>{t(!1),o()},onCancel:()=>t(!1),size:"medium",children:(0,fs.__)("Resetting the template may result in loss of content, do you want to continue?")})]})}var ld=function(){const{notices:e}=(0,d.useSelect)((e=>({notices:e(_s.store).getNotices()})),[]),{removeNotice:t}=(0,d.useDispatch)(_s.store),s=e.filter((({isDismissible:e,type:t})=>e&&"default"===t)),n=e.filter((({isDismissible:e,type:t})=>!e&&"default"===t));return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.NoticeList,{notices:n,className:"components-editor-notices__pinned"}),(0,c.jsx)(Hn.NoticeList,{notices:s,className:"components-editor-notices__dismissible",onRemove:t,children:(0,c.jsx)(ad,{})})]})};const cd=-3;function dd(){const e=(0,d.useSelect)((e=>e(_s.store).getNotices()),[]),{removeNotice:t}=(0,d.useDispatch)(_s.store),s=e.filter((({type:e})=>"snackbar"===e)).slice(cd);return(0,c.jsx)(Hn.SnackbarList,{notices:s,className:"components-editor-notices__snackbar",onRemove:t})}function ud({record:e,checked:t,onChange:s}){const{name:n,kind:o,title:r,key:i}=e,{entityRecordTitle:a,hasPostMetaChanges:l}=(0,d.useSelect)((e=>{if("postType"!==o||"wp_template"!==n)return{entityRecordTitle:r,hasPostMetaChanges:$(e(vc)).hasPostMetaChanges(n,i)};const t=e(u.store).getEditedEntityRecord(o,n,i),{default_template_types:s=[]}=e(u.store).getCurrentTheme()??{};return{entityRecordTitle:Y({template:t,templateTypes:s}).title,hasPostMetaChanges:$(e(vc)).hasPostMetaChanges(n,i)}}),[n,o,r,i]);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.PanelRow,{children:(0,c.jsx)(Hn.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,Ln.decodeEntities)(a)||(0,fs.__)("Untitled"),checked:t,onChange:s,className:"entities-saved-states__change-control"})}),l&&(0,c.jsx)("ul",{className:"entities-saved-states__changes",children:(0,c.jsx)("li",{children:(0,fs.__)("Post Meta.")})})]})}const{getGlobalStylesChanges:pd,GlobalStylesContext:md}=$(g.privateApis);function hd({record:e}){const{user:t}=(0,p.useContext)(md),s=(0,d.useSelect)((t=>t(u.store).getEntityRecord(e.kind,e.name,e.key)),[e.kind,e.name,e.key]),n=pd(t,s,{maxResults:10});return n.length?(0,c.jsx)("ul",{className:"entities-saved-states__changes",children:n.map((e=>(0,c.jsx)("li",{children:e},e)))}):null}function gd({record:e,count:t}){if("globalStyles"===e?.name)return null;const s=function(e,t){switch(e){case"site":return 1===t?(0,fs.__)("This change will affect your whole site."):(0,fs.__)("These changes will affect your whole site.");case"wp_template":return(0,fs.__)("This change will affect other parts of your site that use this template.");case"page":case"post":return(0,fs.__)("The following has been modified.")}}(e?.name,t);return s?(0,c.jsx)(Hn.PanelRow,{children:s}):null}function _d({list:e,unselectedEntities:t,setUnselectedEntities:s}){const n=e.length,o=e[0];let r=(0,d.useSelect)((e=>e(u.store).getEntityConfig(o.kind,o.name)),[o.kind,o.name]).label;return"wp_template_part"===o?.name&&(r=1===n?(0,fs.__)("Template Part"):(0,fs.__)("Template Parts")),(0,c.jsxs)(Hn.PanelBody,{title:r,initialOpen:!0,className:"entities-saved-states__panel-body",children:[(0,c.jsx)(gd,{record:o,count:n}),e.map((e=>(0,c.jsx)(ud,{record:e,checked:!t.some((t=>t.kind===e.kind&&t.name===e.name&&t.key===e.key&&t.property===e.property)),onChange:t=>s(e,t)},e.key||e.property))),"globalStyles"===o?.name&&(0,c.jsx)(hd,{record:o})]})}const fd=()=>{const{editedEntities:e,siteEdits:t,siteEntityConfig:s}=(0,d.useSelect)((e=>{const{__experimentalGetDirtyEntityRecords:t,getEntityRecordEdits:s,getEntityConfig:n}=e(u.store);return{editedEntities:t(),siteEdits:s("root","site"),siteEntityConfig:n("root","site")}}),[]),n=(0,p.useMemo)((()=>{const n=e.filter((e=>!("root"===e.kind&&"site"===e.name))),o=s?.meta?.labels??{},r=[];for(const e in t)r.push({kind:"root",name:"site",title:o[e]||e,property:e});return[...n,...r]}),[e,t,s]),[o,r]=(0,p.useState)([]);return{dirtyEntityRecords:n,isDirty:n.length-o.length>0,setUnselectedEntities:({kind:e,name:t,key:s,property:n},i)=>{r(i?o.filter((o=>o.kind!==e||o.name!==t||o.key!==s||o.property!==n)):[...o,{kind:e,name:t,key:s,property:n}])},unselectedEntities:o}};function bd(e){return e}function yd({close:e,renderDialog:t,variant:s}){const n=fd();return(0,c.jsx)(xd,{close:e,renderDialog:t,variant:s,...n})}function xd({additionalPrompt:e,close:t,onSave:s=bd,saveEnabled:n,saveLabel:o=(0,fs.__)("Save"),renderDialog:r,dirtyEntityRecords:i,isDirty:a,setUnselectedEntities:l,unselectedEntities:u,variant:h="default"}){const g=(0,p.useRef)(),{saveDirtyEntities:_}=$((0,d.useDispatch)(vc)),f=i.reduce(((e,t)=>{const{name:s}=t;return e[s]||(e[s]=[]),e[s].push(t),e}),{}),{site:b,wp_template:y,wp_template_part:x,...v}=f,w=[b,y,x,...Object.values(v)].filter(Array.isArray),S=n??a,k=(0,p.useCallback)((()=>t()),[t]),[C,P]=(0,m.__experimentalUseDialog)({onClose:()=>k()}),j=(0,m.useInstanceId)(xd,"entities-saved-states__panel-label"),E=(0,m.useInstanceId)(xd,"entities-saved-states__panel-description"),T=i.length?(0,fs.__)("Select the items you want to save."):void 0,B="inline"===h,I=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.FlexItem,{isBlock:!B,as:Hn.Button,variant:B?"tertiary":"secondary",size:B?void 0:"compact",onClick:k,children:(0,fs.__)("Cancel")}),(0,c.jsx)(Hn.FlexItem,{isBlock:!B,as:Hn.Button,ref:g,variant:"primary",size:B?void 0:"compact",disabled:!S,accessibleWhenDisabled:!0,onClick:()=>_({onSave:s,dirtyEntityRecords:i,entitiesToSkip:u,close:t}),className:"editor-entities-saved-states__save-button",children:o})]});return(0,c.jsxs)("div",{ref:r?C:void 0,...r&&P,className:mr("entities-saved-states__panel",{"is-inline":B}),role:r?"dialog":void 0,"aria-labelledby":r?j:void 0,"aria-describedby":r?E:void 0,children:[!B&&(0,c.jsx)(Hn.Flex,{className:"entities-saved-states__panel-header",gap:2,children:I}),(0,c.jsxs)("div",{className:"entities-saved-states__text-prompt",children:[(0,c.jsx)("div",{className:"entities-saved-states__text-prompt--header-wrapper",children:(0,c.jsx)("strong",{id:r?j:void 0,className:"entities-saved-states__text-prompt--header",children:(0,fs.__)("Are you ready to save?")})}),(0,c.jsxs)("div",{id:r?E:void 0,children:[e,(0,c.jsx)("p",{className:"entities-saved-states__text-prompt--changes-count",children:a?(0,p.createInterpolateElement)((0,fs.sprintf)((0,fs._n)("There is <strong>%d site change</strong> waiting to be saved.","There are <strong>%d site changes</strong> waiting to be saved.",i.length),i.length),{strong:(0,c.jsx)("strong",{})}):T})]})]}),w.map((e=>(0,c.jsx)(_d,{list:e,unselectedEntities:u,setUnselectedEntities:l},e[0].name))),B&&(0,c.jsx)(Hn.Flex,{direction:"row",justify:"flex-end",className:"entities-saved-states__panel-footer",children:I})]})}function vd(){try{return(0,d.select)(vc).getEditedPostContent()}catch(e){}}function wd({text:e,children:t,variant:s="secondary"}){const n=(0,m.useCopyToClipboard)(e);return(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:s,ref:n,children:t})}class Sd extends p.Component{constructor(){super(...arguments),this.state={error:null}}componentDidCatch(e){(0,h.doAction)("editor.ErrorBoundary.errorLogged",e)}static getDerivedStateFromError(e){return{error:e}}render(){const{error:e}=this.state,{canCopyContent:t=!1}=this.props;return e?(0,c.jsxs)(Hn.__experimentalHStack,{className:"editor-error-boundary",alignment:"baseline",spacing:4,justify:"space-between",expanded:!1,wrap:!0,children:[(0,c.jsx)(Hn.__experimentalText,{as:"p",children:(0,fs.__)("The editor has encountered an unexpected error.")}),(0,c.jsxs)(Hn.__experimentalHStack,{expanded:!1,children:[t&&(0,c.jsx)(wd,{text:vd,children:(0,fs.__)("Copy contents")}),(0,c.jsx)(wd,{variant:"primary",text:e?.stack,children:(0,fs.__)("Copy error")})]})]}):this.props.children}}var kd=Sd;const Cd=window.requestIdleCallback?window.requestIdleCallback:window.requestAnimationFrame;let Pd;function jd(){const{postId:e,isEditedPostNew:t,hasRemoteAutosave:s}=(0,d.useSelect)((e=>({postId:e(vc).getCurrentPostId(),isEditedPostNew:e(vc).isEditedPostNew(),hasRemoteAutosave:!!e(vc).getEditorSettings().autosave})),[]),{getEditedPostAttribute:n}=(0,d.useSelect)(vc),{createWarningNotice:o,removeNotice:r}=(0,d.useDispatch)(_s.store),{editPost:i,resetEditorBlocks:a}=(0,d.useDispatch)(vc);(0,p.useEffect)((()=>{let l=function(e,t){return window.sessionStorage.getItem(bs(e,t))}(e,t);if(!l)return;try{l=JSON.parse(l)}catch{return}const{post_title:c,content:d,excerpt:u}=l,p={title:c,content:d,excerpt:u};if(!Object.keys(p).some((e=>p[e]!==n(e))))return void ys(e,t);if(s)return;const m="wpEditorAutosaveRestore";o((0,fs.__)("The backup of this post in your browser is different from the version below."),{id:m,actions:[{label:(0,fs.__)("Restore the backup"),onClick(){const{content:e,...t}=p;i(t),a((0,x.parse)(p.content)),r(m)}}]})}),[t,e])}var Ed=(0,m.ifCondition)((()=>{if(void 0!==Pd)return Pd;try{window.sessionStorage.setItem("__wpEditorTestSessionStorage",""),window.sessionStorage.removeItem("__wpEditorTestSessionStorage"),Pd=!0}catch{Pd=!1}return Pd}))((function(){const{autosave:e}=(0,d.useDispatch)(vc),t=(0,p.useCallback)((()=>{Cd((()=>e({local:!0})))}),[]);jd(),function(){const{postId:e,isEditedPostNew:t,isDirty:s,isAutosaving:n,didError:o}=(0,d.useSelect)((e=>({postId:e(vc).getCurrentPostId(),isEditedPostNew:e(vc).isEditedPostNew(),isDirty:e(vc).isEditedPostDirty(),isAutosaving:e(vc).isAutosavingPost(),didError:e(vc).didPostSaveRequestFail()})),[]),r=(0,p.useRef)(s),i=(0,p.useRef)(n);(0,p.useEffect)((()=>{!o&&(i.current&&!n||r.current&&!s)&&ys(e,t),r.current=s,i.current=n}),[s,n,o]);const a=(0,m.usePrevious)(t),l=(0,m.usePrevious)(e);(0,p.useEffect)((()=>{l===e&&a&&!t&&ys(e,!0)}),[t,e])}();const s=(0,d.useSelect)((e=>e(vc).getEditorSettings().localAutosaveInterval),[]);return(0,c.jsx)(Oc,{interval:s,autosave:t})}));var Td=function({children:e}){const t=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(vc),{getPostType:s}=e(u.store),n=s(t("type"));return!!n?.supports?.["page-attributes"]}),[]);return t?e:null};var Bd=function({children:e,supportKeys:t}){const s=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(vc),{getPostType:s}=e(u.store);return s(t("type"))}),[]);let n=!!s;return s&&(n=(Array.isArray(t)?t:[t]).some((e=>function(e={},t){if(void 0!==e[t])return!!e[t];const[s,n]=t.split("."),[o]=Array.isArray(e[s])?e[s]:[];return Array.isArray(o)?o.includes(n):!!o?.[n]}(s.supports,e)))),n?e:null};function Id(){const e=(0,d.useSelect)((e=>e(vc).getEditedPostAttribute("menu_order")??0),[]),{editPost:t}=(0,d.useDispatch)(vc),[s,n]=(0,p.useState)(null),o=s??e;return(0,c.jsx)(Hn.Flex,{children:(0,c.jsx)(Hn.FlexBlock,{children:(0,c.jsx)(Hn.__experimentalNumberControl,{__next40pxDefaultSize:!0,label:(0,fs.__)("Order"),help:(0,fs.__)("Set the page order."),value:o,onChange:e=>{n(e);const s=Number(e);Number.isInteger(s)&&""!==e.trim?.()&&t({menu_order:s})},hideLabelFromVision:!0,onBlur:()=>{n(null)}})})})}function Nd(){return(0,c.jsx)(Bd,{supportKeys:"page-attributes",children:(0,c.jsx)(Id,{})})}var Rd=(0,p.forwardRef)((({className:e,label:t,children:s},n)=>(0,c.jsxs)(Hn.__experimentalHStack,{className:mr("editor-post-panel__row",e),ref:n,children:[t&&(0,c.jsx)("div",{className:"editor-post-panel__row-label",children:t}),(0,c.jsx)("div",{className:"editor-post-panel__row-control",children:s})]})));function Dd(e){const t=e.map((e=>({children:[],parent:void 0,...e})));if(t.some((({parent:e})=>void 0===e)))return t;const s=t.reduce(((e,t)=>{const{parent:s}=t;return e[s]||(e[s]=[]),e[s].push(t),e}),{}),n=e=>e.map((e=>{const t=s[e.id];return{...e,children:t&&t.length?n(t):[]}}));return n(s[0]||[])}const Ad=e=>(0,Ln.decodeEntities)(e),Md=e=>({...e,name:Ad(e.name)}),Ld=e=>(e??[]).map(Md);function Od(e){return e?.title?.rendered?(0,Ln.decodeEntities)(e.title.rendered):`#${e.id} (${(0,fs.__)("no title")})`}const Fd=(e,t)=>{const s=Mr()(e||"").toLowerCase(),n=Mr()(t||"").toLowerCase();return s===n?0:s.startsWith(n)?s.length:1/0};function Vd(){const{editPost:e}=(0,d.useDispatch)(vc),[t,s]=(0,p.useState)(!1),{isHierarchical:n,parentPostId:o,parentPostTitle:r,pageItems:i,isLoading:a}=(0,d.useSelect)((e=>{const{getPostType:s,getEntityRecords:n,getEntityRecord:o,isResolving:r}=e(u.store),{getCurrentPostId:i,getEditedPostAttribute:a}=e(vc),l=a("type"),c=a("parent"),d=s(l),p=i(),m=d?.hierarchical??!1,h={per_page:100,exclude:p,parent_exclude:p,orderby:"menu_order",order:"asc",_fields:"id,title,parent"};t&&(h.search=t);const g=c?o("postType",l,c):null;return{isHierarchical:m,parentPostId:c,parentPostTitle:g?Od(g):"",pageItems:m?n("postType",l,h):null,isLoading:!!m&&r("getEntityRecords",["postType",l,h])}}),[t]),l=(0,p.useMemo)((()=>{const e=(s,n=0)=>{const o=s.map((t=>[{value:t.id,label:"— ".repeat(n)+(0,Ln.decodeEntities)(t.name),rawName:t.name},...e(t.children||[],n+1)])).sort((([e],[s])=>Fd(e.rawName,t)>=Fd(s.rawName,t)?1:-1));return o.flat()};if(!i)return[];let s=i.map((e=>({id:e.id,parent:e.parent,name:Od(e)})));t||(s=Dd(s));const n=e(s),a=n.find((e=>e.value===o));return r&&!a&&n.unshift({value:o,label:r}),n}),[i,t,r,o]);if(!n)return null;return(0,c.jsx)(Hn.ComboboxControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,className:"editor-page-attributes__parent",label:(0,fs.__)("Parent"),help:(0,fs.__)("Choose a parent page."),value:o,options:l,onFilterValueChange:(0,m.debounce)((e=>{s(e)}),300),onChange:t=>{e({parent:t})},hideLabelFromVision:!0,isLoading:a})}function Ud({isOpen:e,onClick:t}){const s=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(vc),s=t("parent");if(!s)return null;const{getEntityRecord:n}=e(u.store);return n("postType",t("type"),s)}),[]),n=(0,p.useMemo)((()=>s?Od(s):(0,fs.__)("None")),[s]);return(0,c.jsx)(Hn.Button,{size:"compact",className:"editor-post-parent__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.sprintf)((0,fs.__)("Change parent: %s"),n),onClick:t,children:n})}function Hd(){const e=(0,d.useSelect)((e=>e(u.store).getEntityRecord("root","__unstableBase")?.home),[]),[t,s]=(0,p.useState)(null),n=(0,p.useMemo)((()=>({anchor:t,placement:"left-start",offset:36,shift:!0})),[t]);return(0,c.jsx)(Rd,{label:(0,fs.__)("Parent"),ref:s,children:(0,c.jsx)(Hn.Dropdown,{popoverProps:n,className:"editor-post-parent__panel-dropdown",contentClassName:"editor-post-parent__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,c.jsx)(Ud,{isOpen:e,onClick:t}),renderContent:({onClose:t})=>(0,c.jsxs)("div",{className:"editor-post-parent",children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Parent"),onClose:t}),(0,c.jsxs)("div",{children:[(0,p.createInterpolateElement)((0,fs.sprintf)((0,fs.__)('Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %s<wbr />/services<wbr />/pricing.'),(0,w.filterURLForDisplay)(e).replace(/([/.])/g,"<wbr />$1")),{wbr:(0,c.jsx)("wbr",{})}),(0,c.jsx)("p",{children:(0,p.createInterpolateElement)((0,fs.__)("They also show up as sub-items in the default navigation menu. <a>Learn more.</a>"),{a:(0,c.jsx)(Hn.ExternalLink,{href:(0,fs.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#page-attributes")})})})]}),(0,c.jsx)(Vd,{})]})})})}var zd=Vd;const Gd="page-attributes";function $d(){const{isEnabled:e,postType:t}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,isEditorPanelEnabled:s}=e(vc),{getPostType:n}=e(u.store);return{isEnabled:s(Gd),postType:n(t("type"))}}),[]);return e&&t?(0,c.jsx)(Hd,{}):null}function Wd(){return(0,c.jsx)(Td,{children:(0,c.jsx)($d,{})})}var Zd=(0,c.jsx)(L.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(L.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 Yd=(0,fs.__)("Custom Template");function qd({onClose:e}){const{defaultBlockTemplate:t,onNavigateToEntityRecord:s}=(0,d.useSelect)((e=>{const{getEditorSettings:t,getCurrentTemplateId:s}=e(vc);return{defaultBlockTemplate:t().defaultBlockTemplate,onNavigateToEntityRecord:t().onNavigateToEntityRecord,getTemplateId:s}})),{createTemplate:n}=$((0,d.useDispatch)(vc)),[o,r]=(0,p.useState)(""),[i,a]=(0,p.useState)(!1),l=()=>{r(""),e()};return(0,c.jsx)(Hn.Modal,{title:(0,fs.__)("Create custom template"),onRequestClose:l,focusOnMount:"firstContentElement",size:"small",overlayClassName:"editor-post-template__create-template-modal",children:(0,c.jsx)("form",{className:"editor-post-template__create-form",onSubmit:async e=>{if(e.preventDefault(),i)return;a(!0);const r=t??(0,x.serialize)([(0,x.createBlock)("core/group",{tagName:"header",layout:{inherit:!0}},[(0,x.createBlock)("core/site-title"),(0,x.createBlock)("core/site-tagline")]),(0,x.createBlock)("core/separator"),(0,x.createBlock)("core/group",{tagName:"main"},[(0,x.createBlock)("core/group",{layout:{inherit:!0}},[(0,x.createBlock)("core/post-title")]),(0,x.createBlock)("core/post-content",{layout:{inherit:!0}})])]),c=await n({slug:Kn(o||Yd)||"wp-custom-template",content:r,title:o||Yd});a(!1),s({postId:c.id,postType:"wp_template"}),l()},children:(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"3",children:[(0,c.jsx)(Hn.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,fs.__)("Name"),value:o,onChange:r,placeholder:Yd,disabled:i,help:(0,fs.__)('Describe the template, e.g. "Post with sidebar". A custom template can be manually applied to any post or page.')}),(0,c.jsxs)(Hn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:l,children:(0,fs.__)("Cancel")}),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",isBusy:i,"aria-disabled":i,children:(0,fs.__)("Create")})]})]})})})}function Kd(){return(0,d.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:s}=e(vc);return{postId:t(),postType:s()}}),[])}function Qd(){const{postType:e,postId:t}=Kd();return(0,d.useSelect)((s=>{const{canUser:n,getEntityRecord:o,getEntityRecords:r}=s(u.store),i=n("read",{kind:"root",name:"site"})?o("root","site"):void 0,a=+t===i?.page_for_posts,l="page"===e&&+t===i?.page_on_front,c=l?r("postType","wp_template",{per_page:-1}):[],d=l&&!!c?.some((({slug:e})=>"front-page"===e));return!a&&!d}),[t,e])}function Xd(e){return(0,d.useSelect)((t=>t(u.store).getEntityRecords("postType","wp_template",{per_page:-1,post_type:e})),[e])}function Jd(e){const t=eu(),s=Qd(),n=Xd(e);return(0,p.useMemo)((()=>s&&n?.filter((e=>e.is_custom&&e.slug!==t&&!!e.content.raw))),[n,t,s])}function eu(){const{postType:e,postId:t}=Kd(),s=Xd(e),n=(0,d.useSelect)((s=>{const n=s(u.store).getEditedEntityRecord("postType",e,t);return n?.template}),[e,t]);if(n)return s?.find((e=>e.slug===n))?.slug}function tu({isOpen:e,onClick:t}){const s=(0,d.useSelect)((e=>{const t=e(vc).getEditedPostAttribute("template"),{supportsTemplateMode:s,availableTemplates:n}=e(vc).getEditorSettings();if(!s&&n[t])return n[t];const o=e(u.store).canUser("create",{kind:"postType",name:"wp_template"})&&e(vc).getCurrentTemplateId();return o?.title||o?.slug||n?.[t]}),[]);return(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.__)("Template options"),onClick:t,children:s??(0,fs.__)("Default template")})}function su({onClose:e}){const t=Qd(),{availableTemplates:s,fetchedTemplates:n,selectedTemplateSlug:o,canCreate:r,canEdit:i,currentTemplateId:a,onNavigateToEntityRecord:l,getEditorSettings:m}=(0,d.useSelect)((e=>{const{canUser:s,getEntityRecords:n}=e(u.store),o=e(vc).getEditorSettings(),r=s("create",{kind:"postType",name:"wp_template"}),i=e(vc).getCurrentTemplateId();return{availableTemplates:o.availableTemplates,fetchedTemplates:r?n("postType","wp_template",{post_type:e(vc).getCurrentPostType(),per_page:-1}):void 0,selectedTemplateSlug:e(vc).getEditedPostAttribute("template"),canCreate:t&&r&&o.supportsTemplateMode,canEdit:t&&r&&o.supportsTemplateMode&&!!i,currentTemplateId:i,onNavigateToEntityRecord:o.onNavigateToEntityRecord,getEditorSettings:e(vc).getEditorSettings}}),[t]),h=(0,p.useMemo)((()=>Object.entries({...s,...Object.fromEntries((n??[]).map((({slug:e,title:t})=>[e,t.rendered])))}).map((([e,t])=>({value:e,label:t})))),[s,n]),_=h.find((e=>e.value===o))??h.find((e=>!e.value)),{editPost:f}=(0,d.useDispatch)(vc),{createSuccessNotice:b}=(0,d.useDispatch)(_s.store),[y,x]=(0,p.useState)(!1);return(0,c.jsxs)("div",{className:"editor-post-template__classic-theme-dropdown",children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Template"),help:(0,fs.__)("Templates define the way content is displayed when viewing your site."),actions:r?[{icon:Zd,label:(0,fs.__)("Add template"),onClick:()=>x(!0)}]:[],onClose:e}),t?(0,c.jsx)(Hn.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:!0,label:(0,fs.__)("Template"),value:_?.value??"",options:h,onChange:e=>f({template:e||""})}):(0,c.jsx)(Hn.Notice,{status:"warning",isDismissible:!1,children:(0,fs.__)("The posts page template cannot be changed.")}),i&&l&&(0,c.jsx)("p",{children:(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>{l({postId:a,postType:"wp_template"}),e(),b((0,fs.__)("Editing template. Changes made here affect all posts and pages that use the template."),{type:"snackbar",actions:[{label:(0,fs.__)("Go back"),onClick:()=>m().onNavigateToPreviousEntityRecord()}]})},children:(0,fs.__)("Edit template")})}),y&&(0,c.jsx)(qd,{onClose:()=>x(!1)})]})}var nu=function(){const[e,t]=(0,p.useState)(null),s=(0,p.useMemo)((()=>({anchor:e,className:"editor-post-template__dropdown",placement:"left-start",offset:36,shift:!0})),[e]);return(0,c.jsx)(Rd,{label:(0,fs.__)("Template"),ref:t,children:(0,c.jsx)(Hn.Dropdown,{popoverProps:s,focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,c.jsx)(tu,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,c.jsx)(su,{onClose:e})})})};const ou=window.wp.warning;var ru=s.n(ou);const{PreferenceBaseOption:iu}=$(C.privateApis);function au(e){const{toggleEditorPanelEnabled:t}=(0,d.useDispatch)(vc),{isChecked:s,isRemoved:n}=(0,d.useSelect)((t=>{const{isEditorPanelEnabled:s,isEditorPanelRemoved:n}=t(vc);return{isChecked:s(e.panelName),isRemoved:n(e.panelName)}}),[e.panelName]);return n?null:(0,c.jsx)(iu,{isChecked:s,onChange:()=>t(e.panelName),...e})}const{Fill:lu,Slot:cu}=(0,Hn.createSlotFill)("EnablePluginDocumentSettingPanelOption"),du=({label:e,panelName:t})=>(0,c.jsx)(lu,{children:(0,c.jsx)(au,{label:e,panelName:t})});du.Slot=cu;var uu=du;const{Fill:pu,Slot:mu}=(0,Hn.createSlotFill)("PluginDocumentSettingPanel"),hu=({name:e,className:t,title:s,icon:n,children:o})=>{const{name:r}=(0,aa.usePluginContext)(),i=`${r}/${e}`,{opened:a,isEnabled:l}=(0,d.useSelect)((e=>{const{isEditorPanelOpened:t,isEditorPanelEnabled:s}=e(vc);return{opened:t(i),isEnabled:s(i)}}),[i]),{toggleEditorPanelOpened:u}=(0,d.useDispatch)(vc);return void 0===e&&ru()("PluginDocumentSettingPanel requires a name property."),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(uu,{label:s,panelName:i}),(0,c.jsx)(pu,{children:l&&(0,c.jsx)(Hn.PanelBody,{className:t,title:s,icon:n,opened:a,onToggle:()=>u(i),children:o})})]})};hu.Slot=mu;var gu=hu;var _u=({allowedBlocks:e,icon:t,label:s,onClick:n,small:o,role:r})=>(0,c.jsx)(g.BlockSettingsMenuControls,{children:({selectedBlocks:i,onClose:a})=>((e,t)=>{return!Array.isArray(t)||(s=t,0===e.filter((e=>!s.includes(e))).length);var s})(i,e)?(0,c.jsx)(Hn.MenuItem,{onClick:(0,m.compose)(n,a),icon:t,label:o?s:void 0,role:r,children:!o&&s}):null});function fu(e){const t=(0,aa.usePluginContext)();return(0,c.jsx)(Na,{name:"core/plugin-more-menu",as:e.as??Hn.MenuItem,icon:e.icon||t.icon,...e})}const{Fill:bu,Slot:yu}=(0,Hn.createSlotFill)("PluginPostPublishPanel"),xu=({children:e,className:t,title:s,initialOpen:n=!1,icon:o})=>{const{icon:r}=(0,aa.usePluginContext)();return(0,c.jsx)(bu,{children:(0,c.jsx)(Hn.PanelBody,{className:t,initialOpen:n||!s,title:s,icon:o??r,children:e})})};xu.Slot=yu;var vu=xu;const{Fill:wu,Slot:Su}=(0,Hn.createSlotFill)("PluginPostStatusInfo"),ku=({children:e,className:t})=>(0,c.jsx)(wu,{children:(0,c.jsx)(Hn.PanelRow,{className:t,children:e})});ku.Slot=Su;var Cu=ku;const{Fill:Pu,Slot:ju}=(0,Hn.createSlotFill)("PluginPrePublishPanel"),Eu=({children:e,className:t,title:s,initialOpen:n=!1,icon:o})=>{const{icon:r}=(0,aa.usePluginContext)();return(0,c.jsx)(Pu,{children:(0,c.jsx)(Hn.PanelBody,{className:t,initialOpen:n||!s,title:s,icon:o??r,children:e})})};Eu.Slot=ju;var Tu=Eu;function Bu(e){const t=(0,aa.usePluginContext)();return(0,c.jsx)(Na,{name:"core/plugin-preview-menu",as:e.as??Hn.MenuItem,icon:e.icon||t.icon,...e})}function Iu({className:e,...t}){return(0,c.jsx)(Va,{panelClassName:e,className:"editor-sidebar",scope:"core",...t})}function Nu(e){return(0,c.jsx)(Da,{__unstableExplicitMenuItem:!0,scope:"core",...e})}function Ru(e=""){return e=(e=Mr()(e)).trim().toLowerCase()}function Du(e,t){const s=Ru(t),n=Ru(e.title);let o=0;if(s===n)o+=30;else if(n.startsWith(s))o+=20;else{s.split(" ").every((e=>n.includes(e)))&&(o+=10)}return o}function Au({onClick:e}){const[t,s]=(0,p.useState)(!1),{postType:n,postId:o}=Kd(),r=Jd(n),{editEntityRecord:i}=(0,d.useDispatch)(u.store);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.MenuItem,{disabled:!r?.length,accessibleWhenDisabled:!0,onClick:()=>s(!0),children:(0,fs.__)("Change template")}),t&&(0,c.jsx)(Hn.Modal,{title:(0,fs.__)("Choose a template"),onRequestClose:()=>s(!1),overlayClassName:"editor-post-template__swap-template-modal",isFullScreen:!0,children:(0,c.jsx)("div",{className:"editor-post-template__swap-template-modal-content",children:(0,c.jsx)(Mu,{postType:n,onSelect:async t=>{i("postType",n,o,{template:t.name},{undoIgnore:!0}),s(!1),e()}})})})]})}function Mu({postType:e,onSelect:t}){const[s,n]=(0,p.useState)(""),o=Jd(e),r=(0,p.useMemo)((()=>o.map((e=>({name:e.slug,blocks:(0,x.parse)(e.content.raw),title:(0,Ln.decodeEntities)(e.title.rendered),id:e.id})))),[o]),i=(0,p.useMemo)((()=>function(e=[],t=""){if(!t)return e;const s=e.map((e=>[e,Du(e,t)])).filter((([,e])=>e>0));return s.sort((([,e],[,t])=>t-e)),s.map((([e])=>e))}(r,s)),[r,s]);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.SearchControl,{__nextHasNoMarginBottom:!0,onChange:n,value:s,label:(0,fs.__)("Search"),placeholder:(0,fs.__)("Search"),className:"editor-post-template__swap-template-search"}),(0,c.jsx)(g.__experimentalBlockPatternsList,{label:(0,fs.__)("Templates"),blockPatterns:i,onClickPattern:t})]})}function Lu({onClick:e}){const t=eu(),s=Qd(),{postType:n,postId:o}=Kd(),{editEntityRecord:r}=(0,d.useDispatch)(u.store);return t&&s?(0,c.jsx)(Hn.MenuItem,{onClick:()=>{r("postType",n,o,{template:""},{undoIgnore:!0}),e()},children:(0,fs.__)("Use default template")}):null}function Ou(){const{canCreateTemplates:e}=(0,d.useSelect)((e=>{const{canUser:t}=e(u.store);return{canCreateTemplates:t("create",{kind:"postType",name:"wp_template"})}}),[]),[t,s]=(0,p.useState)(!1),n=Qd();return e&&n?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.MenuItem,{onClick:()=>{s(!0)},children:(0,fs.__)("Create new template")}),t&&(0,c.jsx)(qd,{onClose:()=>{s(!1)}})]}):null}function Fu({id:e}){const{isTemplateHidden:t,onNavigateToEntityRecord:s,getEditorSettings:n,hasGoBack:o}=(0,d.useSelect)((e=>{const{getRenderingMode:t,getEditorSettings:s}=$(e(vc)),n=s();return{isTemplateHidden:"post-only"===t(),onNavigateToEntityRecord:n.onNavigateToEntityRecord,getEditorSettings:s,hasGoBack:n.hasOwnProperty("onNavigateToPreviousEntityRecord")}}),[]),{get:r}=(0,d.useSelect)(C.store),{editedRecord:i,hasResolved:a}=(0,u.useEntityRecord)("postType","wp_template",e),{createSuccessNotice:l}=(0,d.useDispatch)(_s.store),{setRenderingMode:m,setDefaultRenderingMode:h}=$((0,d.useDispatch)(vc)),g=(0,d.useSelect)((e=>!!e(u.store).canUser("create",{kind:"postType",name:"wp_template"})),[]),[_,f]=(0,p.useState)(null),b=(0,p.useMemo)((()=>({anchor:_,className:"editor-post-template__dropdown",placement:"left-start",offset:36,shift:!0})),[_]);if(!a)return null;const y=o?[{label:(0,fs.__)("Go back"),onClick:()=>n().onNavigateToPreviousEntityRecord()}]:void 0;return(0,c.jsx)(Rd,{label:(0,fs.__)("Template"),ref:f,children:(0,c.jsx)(Hn.DropdownMenu,{popoverProps:b,focusOnMount:!0,toggleProps:{size:"compact",variant:"tertiary",tooltipPosition:"middle left"},label:(0,fs.__)("Template options"),text:(0,Ln.decodeEntities)(i.title),icon:null,children:({onClose:e})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(Hn.MenuGroup,{children:[g&&(0,c.jsx)(Hn.MenuItem,{onClick:()=>{s({postId:i.id,postType:"wp_template"}),e(),r("core/edit-site","welcomeGuideTemplate")||l((0,fs.__)("Editing template. Changes made here affect all posts and pages that use the template."),{type:"snackbar",actions:y})},children:(0,fs.__)("Edit template")}),(0,c.jsx)(Au,{onClick:e}),(0,c.jsx)(Lu,{onClick:e}),g&&(0,c.jsx)(Ou,{})]}),(0,c.jsx)(Hn.MenuGroup,{children:(0,c.jsx)(Hn.MenuItem,{icon:t?void 0:zn,isSelected:!t,role:"menuitemcheckbox",onClick:()=>{const e=t?"template-locked":"post-only";m(e),h(e)},children:(0,fs.__)("Show template")})})]})})})}function Vu(){const{templateId:e,isBlockTheme:t}=(0,d.useSelect)((e=>{const{getCurrentTemplateId:t,getEditorSettings:s}=e(vc);return{templateId:t(),isBlockTheme:s().__unstableIsBlockBasedTheme}}),[]),s=(0,d.useSelect)((e=>{const t=e(vc).getCurrentPostType(),s=e(u.store).getPostType(t);if(!s?.viewable)return!1;const n=e(vc).getEditorSettings();if(!!n.availableTemplates&&Object.keys(n.availableTemplates).length>0)return!0;if(!n.supportsTemplateMode)return!1;return e(u.store).canUser("create",{kind:"postType",name:"wp_template"})??!1}),[]),n=(0,d.useSelect)((e=>!!s&&e(u.store).canUser("read",{kind:"postType",name:"wp_template"})),[s]);return t&&n||!s?t&&e?(0,c.jsx)(Fu,{id:e}):null:(0,c.jsx)(nu,{})}const Uu={_fields:"id,name",context:"view"},Hu={who:"authors",per_page:100,...Uu};function zu(e){const{authorId:t,authors:s,postAuthor:n,isLoading:o}=(0,d.useSelect)((t=>{const{getUser:s,getUsers:n,isResolving:o}=t(u.store),{getEditedPostAttribute:r}=t(vc),i=r("author"),a={...Hu};return e&&(a.search=e,a.search_columns=["name"]),{authorId:i,authors:n(a),postAuthor:s(i,Uu),isLoading:o("getUsers",[a])}}),[e]);return{authorId:t,authorOptions:(0,p.useMemo)((()=>{const e=(s??[]).map((e=>({value:e.id,label:(0,Ln.decodeEntities)(e.name)}))),t=e.findIndex((({value:e})=>n?.id===e));let o=[];return t<0&&n?o=[{value:n.id,label:(0,Ln.decodeEntities)(n.name)}]:t<0&&!n&&(o=[{value:0,label:(0,fs.__)("(No author)")}]),[...o,...e]}),[s,n]),postAuthor:n,isLoading:o}}function Gu(){const[e,t]=(0,p.useState)(),{editPost:s}=(0,d.useDispatch)(vc),{authorId:n,authorOptions:o,isLoading:r}=zu(e);return(0,c.jsx)(Hn.ComboboxControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,fs.__)("Author"),options:o,value:n,onFilterValueChange:(0,m.debounce)(t,300),onChange:e=>{e&&s({author:e})},allowReset:!1,hideLabelFromVision:!0,isLoading:r})}function $u(){const{editPost:e}=(0,d.useDispatch)(vc),{authorId:t,authorOptions:s}=zu();return(0,c.jsx)(Hn.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"post-author-selector",label:(0,fs.__)("Author"),options:s,onChange:t=>{const s=Number(t);e({author:s})},value:t,hideLabelFromVision:!0})}var Wu=function(){return(0,d.useSelect)((e=>{const t=e(u.store).getUsers(Hu);return t?.length>=25}),[])?(0,c.jsx)(Gu,{}):(0,c.jsx)($u,{})};function Zu({children:e}){const{hasAssignAuthorAction:t}=(0,d.useSelect)((e=>{const t=e(vc).getCurrentPost();return{hasAssignAuthorAction:!!t?._links?.["wp:action-assign-author"]}}),[]);return t?(0,c.jsx)(Bd,{supportKeys:"author",children:e}):null}function Yu({isOpen:e,onClick:t}){const{postAuthor:s}=(0,d.useSelect)((e=>{const t=e(vc).getEditedPostAttribute("author");return{postAuthor:e(u.store).getUser(t,Uu)}}),[]),n=(0,Ln.decodeEntities)(s?.name)||(0,fs.__)("(No author)");return(0,c.jsx)(Hn.Button,{size:"compact",className:"editor-post-author__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.sprintf)((0,fs.__)("Change author: %s"),n),onClick:t,children:n})}var qu=function(){const[e,t]=(0,p.useState)(null),s=(0,p.useMemo)((()=>({anchor:e,placement:"left-start",offset:36,shift:!0})),[e]);return(0,c.jsx)(Zu,{children:(0,c.jsx)(Rd,{label:(0,fs.__)("Author"),ref:t,children:(0,c.jsx)(Hn.Dropdown,{popoverProps:s,contentClassName:"editor-post-author__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,c.jsx)(Yu,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,c.jsxs)("div",{className:"editor-post-author",children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Author"),onClose:e}),(0,c.jsx)(Wu,{onClose:e})]})})})})};const Ku=[{label:(0,fs._x)("Open",'Adjective: e.g. "Comments are open"'),value:"open",description:(0,fs.__)("Visitors can add new comments and replies.")},{label:(0,fs.__)("Closed"),value:"closed",description:[(0,fs.__)("Visitors cannot add new comments or replies."),(0,fs.__)("Existing comments remain visible.")].join(" ")}];var Qu=function(){const e=(0,d.useSelect)((e=>e(vc).getEditedPostAttribute("comment_status")??"open"),[]),{editPost:t}=(0,d.useDispatch)(vc);return(0,c.jsx)("form",{children:(0,c.jsx)(Hn.__experimentalVStack,{spacing:4,children:(0,c.jsx)(Hn.RadioControl,{className:"editor-change-status__options",hideLabelFromVision:!0,label:(0,fs.__)("Comment status"),options:Ku,onChange:e=>t({comment_status:e}),selected:e})})})};var Xu=function(){const e=(0,d.useSelect)((e=>e(vc).getEditedPostAttribute("ping_status")??"open"),[]),{editPost:t}=(0,d.useDispatch)(vc);return(0,c.jsx)(Hn.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,fs.__)("Enable pingbacks & trackbacks"),checked:"open"===e,onChange:()=>t({ping_status:"open"===e?"closed":"open"}),help:(0,c.jsx)(Hn.ExternalLink,{href:(0,fs.__)("https://wordpress.org/documentation/article/trackbacks-and-pingbacks/"),children:(0,fs.__)("Learn more about pingbacks & trackbacks")})})};const Ju="discussion-panel";function ep({onClose:e}){return(0,c.jsxs)("div",{className:"editor-post-discussion",children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Discussion"),onClose:e}),(0,c.jsxs)(Hn.__experimentalVStack,{spacing:4,children:[(0,c.jsx)(Bd,{supportKeys:"comments",children:(0,c.jsx)(Qu,{})}),(0,c.jsx)(Bd,{supportKeys:"trackbacks",children:(0,c.jsx)(Xu,{})})]})]})}function tp({isOpen:e,onClick:t}){const{commentStatus:s,pingStatus:n,commentsSupported:o,trackbacksSupported:r}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(vc),{getPostType:s}=e(u.store),n=s(t("type"));return{commentStatus:t("comment_status")??"open",pingStatus:t("ping_status")??"open",commentsSupported:!!n.supports.comments,trackbacksSupported:!!n.supports.trackbacks}}),[]);let i;return i="open"===s?"open"===n?(0,fs._x)("Open",'Adjective: e.g. "Comments are open"'):r?(0,fs.__)("Comments only"):(0,fs._x)("Open",'Adjective: e.g. "Comments are open"'):"open"===n?o?(0,fs.__)("Pings only"):(0,fs.__)("Pings enabled"):(0,fs.__)("Closed"),(0,c.jsx)(Hn.Button,{size:"compact",className:"editor-post-discussion__panel-toggle",variant:"tertiary","aria-label":(0,fs.__)("Change discussion options"),"aria-expanded":e,onClick:t,children:i})}function sp(){const{isEnabled:e}=(0,d.useSelect)((e=>{const{isEditorPanelEnabled:t}=e(vc);return{isEnabled:t(Ju)}}),[]),[t,s]=(0,p.useState)(null),n=(0,p.useMemo)((()=>({anchor:t,placement:"left-start",offset:36,shift:!0})),[t]);return e?(0,c.jsx)(Bd,{supportKeys:["comments","trackbacks"],children:(0,c.jsx)(Rd,{label:(0,fs.__)("Discussion"),ref:s,children:(0,c.jsx)(Hn.Dropdown,{popoverProps:n,className:"editor-post-discussion__panel-dropdown",contentClassName:"editor-post-discussion__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,c.jsx)(tp,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,c.jsx)(ep,{onClose:e})})})}):null}function np({hideLabelFromVision:e=!1,updateOnBlur:t=!1}){const{excerpt:s,shouldUseDescriptionLabel:n,usedAttribute:o}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getEditedPostAttribute:s}=e(vc),n=t(),o=["wp_template","wp_template_part"].includes(n)?"description":"excerpt";return{excerpt:s(o),shouldUseDescriptionLabel:["wp_template","wp_template_part","wp_block"].includes(n),usedAttribute:o}}),[]),{editPost:r}=(0,d.useDispatch)(vc),[i,a]=(0,p.useState)((0,Ln.decodeEntities)(s)),l=e=>{r({[o]:e})},u=n?(0,fs.__)("Write a description (optional)"):(0,fs.__)("Write an excerpt (optional)");return(0,c.jsx)("div",{className:"editor-post-excerpt",children:(0,c.jsx)(Hn.TextareaControl,{__nextHasNoMarginBottom:!0,label:u,hideLabelFromVision:e,className:"editor-post-excerpt__textarea",onChange:t?a:l,onBlur:t?()=>l(i):void 0,value:t?i:s,help:n?(0,fs.__)("Write a description"):(0,c.jsx)(Hn.ExternalLink,{href:(0,fs.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#excerpt"),children:(0,fs.__)("Learn more about manual excerpts")})})})}var op=function({children:e}){return(0,c.jsx)(Bd,{supportKeys:"excerpt",children:e})};const{Fill:rp,Slot:ip}=(0,Hn.createSlotFill)("PluginPostExcerpt"),ap=({children:e,className:t})=>(0,c.jsx)(rp,{children:(0,c.jsx)(Hn.PanelRow,{className:t,children:e})});ap.Slot=ip;var lp=ap;const cp="post-excerpt";function dp(){const{isOpened:e,isEnabled:t,postType:s}=(0,d.useSelect)((e=>{const{isEditorPanelOpened:t,isEditorPanelEnabled:s,getCurrentPostType:n}=e(vc);return{isOpened:t(cp),isEnabled:s(cp),postType:n()}}),[]),{toggleEditorPanelOpened:n}=(0,d.useDispatch)(vc);if(!t)return null;const o=["wp_template","wp_template_part","wp_block"].includes(s);return(0,c.jsx)(Hn.PanelBody,{title:o?(0,fs.__)("Description"):(0,fs.__)("Excerpt"),opened:e,onToggle:()=>n(cp),children:(0,c.jsx)(lp.Slot,{children:e=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(np,{}),e]})})})}function up(){return(0,c.jsx)(op,{children:(0,c.jsx)(dp,{})})}function pp(){return(0,c.jsx)(op,{children:(0,c.jsx)(mp,{})})}function mp(){const{shouldRender:e,excerpt:t,shouldBeUsedAsDescription:s,allowEditing:n}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s,getEditedPostAttribute:n,isEditorPanelEnabled:o}=e(vc),r=t(),i=["wp_template","wp_template_part"].includes(r),a="wp_block"===r,l=i||a,c=n(i?"description":"excerpt"),d=i&&e(u.store).getEntityRecord("postType",r,s()),p=o(cp)||l;return{excerpt:c,shouldRender:p,shouldBeUsedAsDescription:l,allowEditing:p&&(!l||a||d&&d.source===D&&!d.has_theme_file&&d.is_custom)}}),[]),[o,r]=(0,p.useState)(null),i=s?(0,fs.__)("Description"):(0,fs.__)("Excerpt"),a=(0,p.useMemo)((()=>({anchor:o,"aria-label":i,headerTitle:i,placement:"left-start",offset:36,shift:!0})),[o,i]);if(!e)return!1;const l=!!t&&(0,c.jsx)(Hn.__experimentalText,{align:"left",numberOfLines:4,truncate:n,children:(0,Ln.decodeEntities)(t)});if(!n)return l;const m=s?(0,fs.__)("Add a description…"):(0,fs.__)("Add an excerpt…"),h=s?(0,fs.__)("Edit description"):(0,fs.__)("Edit excerpt");return(0,c.jsxs)(Hn.__experimentalVStack,{children:[l,(0,c.jsx)(Hn.Dropdown,{className:"editor-post-excerpt__dropdown",contentClassName:"editor-post-excerpt__dropdown__content",popoverProps:a,focusOnMount:!0,ref:r,renderToggle:({onToggle:e})=>(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,onClick:e,variant:"link",children:l?h:m}),renderContent:({onClose:e})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:i,onClose:e}),(0,c.jsx)(Hn.__experimentalVStack,{spacing:4,children:(0,c.jsx)(lp.Slot,{children:e=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(np,{hideLabelFromVision:!0,updateOnBlur:!0}),e]})})})]})})]})}function hp({children:e,supportKeys:t}){const{postType:s,themeSupports:n}=(0,d.useSelect)((e=>({postType:e(vc).getEditedPostAttribute("type"),themeSupports:e(u.store).getThemeSupports()})),[]);return(Array.isArray(t)?t:[t]).some((e=>{const t=n?.[e]??!1;return"post-thumbnails"===e&&Array.isArray(t)?t.includes(s):t}))?e:null}var gp=function({children:e}){return(0,c.jsx)(hp,{supportKeys:"post-thumbnails",children:(0,c.jsx)(Bd,{supportKeys:"thumbnail",children:e})})};const _p=["image"],fp=(0,fs.__)("Featured image"),bp=(0,fs.__)("Add a featured image"),yp=(0,c.jsx)("p",{children:(0,fs.__)("To edit the featured image, you need permission to upload media.")});const xp=(0,d.withSelect)((e=>{const{getEntityRecord:t,getPostType:s,hasFinishedResolution:n}=e(u.store),{getCurrentPostId:o,getEditedPostAttribute:r}=e(vc),i=r("featured_media");return{media:i?t("postType","attachment",i,{context:"view"}):null,currentPostId:o(),postType:s(r("type")),featuredImageId:i,isRequestingFeaturedImageMedia:!!i&&!n("getEntityRecord",["postType","attachment",i,{context:"view"}])}})),vp=(0,d.withDispatch)(((e,{noticeOperations:t},{select:s})=>{const{editPost:n}=e(vc);return{onUpdateImage(e){n({featured_media:e.id})},onDropImage(e){s(g.store).getSettings().mediaUpload({allowedTypes:["image"],filesList:e,onFileChange([e]){n({featured_media:e.id})},onError(e){t.removeAllNotices(),t.createErrorNotice(e)},multiple:!1})},onRemoveImage(){n({featured_media:0})}}}));var wp=(0,m.compose)(Hn.withNotices,xp,vp,(0,Hn.withFilters)("editor.PostFeaturedImage"))((function({currentPostId:e,featuredImageId:t,onUpdateImage:s,onRemoveImage:n,media:o,postType:r,noticeUI:i,noticeOperations:a,isRequestingFeaturedImageMedia:l}){const u=(0,p.useRef)(!1),[m,_]=(0,p.useState)(!1),{getSettings:f}=(0,d.useSelect)(g.store),{mediaSourceUrl:b}=function(e,t){if(!e)return{};const s=(0,h.applyFilters)("editor.PostFeaturedImage.imageSize","large",e.id,t);if(s in(e?.media_details?.sizes??{}))return{mediaWidth:e.media_details.sizes[s].width,mediaHeight:e.media_details.sizes[s].height,mediaSourceUrl:e.media_details.sizes[s].source_url};const n=(0,h.applyFilters)("editor.PostFeaturedImage.imageSize","thumbnail",e.id,t);return n in(e?.media_details?.sizes??{})?{mediaWidth:e.media_details.sizes[n].width,mediaHeight:e.media_details.sizes[n].height,mediaSourceUrl:e.media_details.sizes[n].source_url}:{mediaWidth:e.media_details.width,mediaHeight:e.media_details.height,mediaSourceUrl:e.source_url}}(o,e);function y(e){f().mediaUpload({allowedTypes:_p,filesList:e,onFileChange([e]){(0,Go.isBlobURL)(e?.url)?_(!0):(e&&s(e),_(!1))},onError(e){a.removeAllNotices(),a.createErrorNotice(e)},multiple:!1})}function x(e){return e.alt_text?(0,fs.sprintf)((0,fs.__)("Current image: %s"),e.alt_text):(0,fs.sprintf)((0,fs.__)("The current image has no alternative text. The file name is: %s"),e.media_details.sizes?.full?.file||e.slug)}function v(e){u.current&&e&&(e.focus(),u.current=!1)}const w=!l&&!!t&&!o;return(0,c.jsxs)(gp,{children:[i,(0,c.jsxs)("div",{className:"editor-post-featured-image",children:[o&&(0,c.jsx)("div",{id:`editor-post-featured-image-${t}-describedby`,className:"hidden",children:x(o)}),(0,c.jsx)(g.MediaUploadCheck,{fallback:yp,children:(0,c.jsx)(g.MediaUpload,{title:r?.labels?.featured_image||fp,onSelect:s,unstableFeaturedImageFlow:!0,allowedTypes:_p,modalClass:"editor-post-featured-image__media-modal",render:({open:e})=>(0,c.jsxs)("div",{className:"editor-post-featured-image__container",children:[w?(0,c.jsx)(Hn.Notice,{status:"warning",isDismissible:!1,children:(0,fs.__)("Could not retrieve the featured image data.")}):(0,c.jsxs)(Hn.Button,{__next40pxDefaultSize:!0,ref:v,className:t?"editor-post-featured-image__preview":"editor-post-featured-image__toggle",onClick:e,"aria-label":t?(0,fs.__)("Edit or replace the featured image"):null,"aria-describedby":t?`editor-post-featured-image-${t}-describedby`:null,"aria-haspopup":"dialog",disabled:m,accessibleWhenDisabled:!0,children:[!!t&&o&&(0,c.jsx)("img",{className:"editor-post-featured-image__preview-image",src:b,alt:x(o)}),(m||l)&&(0,c.jsx)(Hn.Spinner,{}),!t&&!m&&(r?.labels?.set_featured_image||bp)]}),!!t&&(0,c.jsxs)(Hn.__experimentalHStack,{className:mr("editor-post-featured-image__actions",{"editor-post-featured-image__actions-missing-image":w,"editor-post-featured-image__actions-is-requesting-image":l}),children:[(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,className:"editor-post-featured-image__action",onClick:e,"aria-haspopup":"dialog",variant:w?"secondary":void 0,children:(0,fs.__)("Replace")}),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,className:"editor-post-featured-image__action",onClick:()=>{n(),u.current=!0},variant:w?"secondary":void 0,isDestructive:w,children:(0,fs.__)("Remove")})]}),(0,c.jsx)(Hn.DropZone,{onFilesDrop:y})]}),value:t})})]})]})}));const Sp="featured-image";function kp({withPanelBody:e=!0}){const{postType:t,isEnabled:s,isOpened:n}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,isEditorPanelEnabled:s,isEditorPanelOpened:n}=e(vc),{getPostType:o}=e(u.store);return{postType:o(t("type")),isEnabled:s(Sp),isOpened:n(Sp)}}),[]),{toggleEditorPanelOpened:o}=(0,d.useDispatch)(vc);return s?e?(0,c.jsx)(gp,{children:(0,c.jsx)(Hn.PanelBody,{title:t?.labels?.featured_image??(0,fs.__)("Featured image"),opened:n,onToggle:()=>o(Sp),children:(0,c.jsx)(wp,{})})}):(0,c.jsx)(gp,{children:(0,c.jsx)(wp,{})}):null}function Cp({children:e}){return(0,d.useSelect)((e=>e(vc).getEditorSettings().disablePostFormats),[])?null:(0,c.jsx)(Bd,{supportKeys:"post-formats",children:e})}const Pp=[{id:"aside",caption:(0,fs.__)("Aside")},{id:"audio",caption:(0,fs.__)("Audio")},{id:"chat",caption:(0,fs.__)("Chat")},{id:"gallery",caption:(0,fs.__)("Gallery")},{id:"image",caption:(0,fs.__)("Image")},{id:"link",caption:(0,fs.__)("Link")},{id:"quote",caption:(0,fs.__)("Quote")},{id:"standard",caption:(0,fs.__)("Standard")},{id:"status",caption:(0,fs.__)("Status")},{id:"video",caption:(0,fs.__)("Video")}].sort(((e,t)=>{const s=e.caption.toUpperCase(),n=t.caption.toUpperCase();return s<n?-1:s>n?1:0}));function jp(){const e=`post-format-selector-${(0,m.useInstanceId)(jp)}`,{postFormat:t,suggestedFormat:s,supportedFormats:n}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,getSuggestedPostFormat:s}=e(vc),n=t("format"),o=e(u.store).getThemeSupports();return{postFormat:n??"standard",suggestedFormat:s(),supportedFormats:o.formats}}),[]),o=Pp.filter((e=>n?.includes(e.id)||t===e.id)),r=o.find((e=>e.id===s)),{editPost:i}=(0,d.useDispatch)(vc),a=e=>i({format:e});return(0,c.jsx)(Cp,{children:(0,c.jsxs)("div",{className:"editor-post-format",children:[(0,c.jsx)(Hn.RadioControl,{className:"editor-post-format__options",label:(0,fs.__)("Post Format"),selected:t,onChange:e=>a(e),id:e,options:o.map((e=>({label:e.caption,value:e.id}))),hideLabelFromVision:!0}),r&&r.id!==t&&(0,c.jsx)("p",{className:"editor-post-format__suggestion",children:(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>a(r.id),children:(0,fs.sprintf)((0,fs.__)("Apply suggested format: %s"),r.caption)})})]})})}var Ep=function({children:e}){const{lastRevisionId:t,revisionsCount:s}=(0,d.useSelect)((e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:s}=e(vc);return{lastRevisionId:t(),revisionsCount:s()}}),[]);return!t||s<2?null:(0,c.jsx)(Bd,{supportKeys:"revisions",children:e})};function Tp(){return(0,d.useSelect)((e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:s}=e(vc);return{lastRevisionId:t(),revisionsCount:s()}}),[])}function Bp(){const{lastRevisionId:e,revisionsCount:t}=Tp();return(0,c.jsx)(Ep,{children:(0,c.jsx)(Rd,{label:(0,fs.__)("Revisions"),children:(0,c.jsx)(Hn.Button,{href:(0,w.addQueryArgs)("revision.php",{revision:e}),className:"editor-private-post-last-revision__button",text:t,variant:"tertiary",size:"compact"})})})}var Ip=function(){const{lastRevisionId:e,revisionsCount:t}=Tp();return(0,c.jsx)(Ep,{children:(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,href:(0,w.addQueryArgs)("revision.php",{revision:e}),className:"editor-post-last-revision__title",icon:Yo,iconPosition:"right",text:(0,fs.sprintf)((0,fs.__)("Revisions (%s)"),t)})})};var Np=function(){return(0,c.jsx)(Ep,{children:(0,c.jsx)(Hn.PanelBody,{className:"editor-post-last-revision__panel",children:(0,c.jsx)(Ip,{})})})};var Rp=function e(){const t="core/editor/post-locked-modal-"+(0,m.useInstanceId)(e),{autosave:s,updatePostLock:n}=(0,d.useDispatch)(vc),{isLocked:o,isTakeover:r,user:i,postId:a,postLockUtils:l,activePostLock:g,postType:_,previewLink:f}=(0,d.useSelect)((e=>{const{isPostLocked:t,isPostLockTakeover:s,getPostLockUser:n,getCurrentPostId:o,getActivePostLock:r,getEditedPostAttribute:i,getEditedPostPreviewLink:a,getEditorSettings:l}=e(vc),{getPostType:c}=e(u.store);return{isLocked:t(),isTakeover:s(),user:n(),postId:o(),postLockUtils:l().postLockUtils,activePostLock:r(),postType:c(i("type")),previewLink:a()}}),[]);if((0,p.useEffect)((()=>{function e(){if(o||!g)return;const e=new window.FormData;if(e.append("action","wp-remove-post-lock"),e.append("_wpnonce",l.unlockNonce),e.append("post_ID",a),e.append("active_post_lock",g),window.navigator.sendBeacon)window.navigator.sendBeacon(l.ajaxUrl,e);else{const t=new window.XMLHttpRequest;t.open("POST",l.ajaxUrl,!1),t.send(e)}}return(0,h.addAction)("heartbeat.send",t,(function(e){o||(e["wp-refresh-post-lock"]={lock:g,post_id:a})})),(0,h.addAction)("heartbeat.tick",t,(function(e){if(!e["wp-refresh-post-lock"])return;const t=e["wp-refresh-post-lock"];t.lock_error?(s(),n({isLocked:!0,isTakeover:!0,user:{name:t.lock_error.name,avatar:t.lock_error.avatar_src_2x}})):t.new_lock&&n({isLocked:!1,activePostLock:t.new_lock})})),window.addEventListener("beforeunload",e),()=>{(0,h.removeAction)("heartbeat.send",t),(0,h.removeAction)("heartbeat.tick",t),window.removeEventListener("beforeunload",e)}}),[]),!o)return null;const b=i.name,y=i.avatar,x=(0,w.addQueryArgs)("post.php",{"get-post-lock":"1",lockKey:!0,post:a,action:"edit",_wpnonce:l.nonce}),v=(0,w.addQueryArgs)("edit.php",{post_type:_?.slug}),S=(0,fs.__)("Exit editor");return(0,c.jsx)(Hn.Modal,{title:r?(0,fs.__)("Someone else has taken over this post"):(0,fs.__)("This post is already being edited"),focusOnMount:!0,shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1,isDismissible:!1,className:"editor-post-locked-modal",size:"medium",children:(0,c.jsxs)(Hn.__experimentalHStack,{alignment:"top",spacing:6,children:[!!y&&(0,c.jsx)("img",{src:y,alt:(0,fs.__)("Avatar"),className:"editor-post-locked-modal__avatar",width:64,height:64}),(0,c.jsxs)("div",{children:[!!r&&(0,c.jsx)("p",{children:(0,p.createInterpolateElement)(b?(0,fs.sprintf)((0,fs.__)("<strong>%s</strong> now has editing control of this post (<PreviewLink />). Don’t worry, your changes up to this moment have been saved."),b):(0,fs.__)("Another user now has editing control of this post (<PreviewLink />). Don’t worry, your changes up to this moment have been saved."),{strong:(0,c.jsx)("strong",{}),PreviewLink:(0,c.jsx)(Hn.ExternalLink,{href:f,children:(0,fs.__)("preview")})})}),!r&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("p",{children:(0,p.createInterpolateElement)(b?(0,fs.sprintf)((0,fs.__)("<strong>%s</strong> is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over."),b):(0,fs.__)("Another user is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over."),{strong:(0,c.jsx)("strong",{}),PreviewLink:(0,c.jsx)(Hn.ExternalLink,{href:f,children:(0,fs.__)("preview")})})}),(0,c.jsx)("p",{children:(0,fs.__)("If you take over, the other user will lose editing control to the post, but their changes will be saved.")})]}),(0,c.jsxs)(Hn.__experimentalHStack,{className:"editor-post-locked-modal__buttons",justify:"flex-end",children:[!r&&(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",href:x,children:(0,fs.__)("Take over")}),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"primary",href:v,children:S})]})]})]})})};var Dp=function({children:e}){const{hasPublishAction:t,isPublished:s}=(0,d.useSelect)((e=>{const{isCurrentPostPublished:t,getCurrentPost:s}=e(vc);return{hasPublishAction:s()._links?.["wp:action-publish"]??!1,isPublished:t()}}),[]);return s||!t?null:e};var Ap=function(){const e=(0,d.useSelect)((e=>e(vc).getEditedPostAttribute("status")),[]),{editPost:t}=(0,d.useDispatch)(vc);return(0,c.jsx)(Dp,{children:(0,c.jsx)(Hn.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,fs.__)("Pending review"),checked:"pending"===e,onChange:()=>{t({status:"pending"===e?"draft":"pending"})}})})};function Mp({className:e,textContent:t,forceIsAutosaveable:s,role:n,onPreview:o}){const{postId:r,currentPostLink:i,previewLink:a,isSaveable:l,isViewable:m}=(0,d.useSelect)((e=>{const t=e(vc),s=e(u.store).getPostType(t.getCurrentPostType("type")),n=s?.viewable??!1;return n?{postId:t.getCurrentPostId(),currentPostLink:t.getCurrentPostAttribute("link"),previewLink:t.getEditedPostPreviewLink(),isSaveable:t.isEditedPostSaveable(),isViewable:n}:{isViewable:n}}),[]),{__unstableSaveForPreview:g}=(0,d.useDispatch)(vc);if(!m)return null;const _=`wp-preview-${r}`,f=a||i;return(0,c.jsx)(Hn.Button,{variant:e?void 0:"tertiary",className:e||"editor-post-preview",href:f,target:_,accessibleWhenDisabled:!0,disabled:!l,onClick:async e=>{e.preventDefault();const t=window.open("",_);t.focus(),function(e){let t=(0,p.renderToString)((0,c.jsxs)("div",{className:"editor-post-preview-button__interstitial-message",children:[(0,c.jsxs)(Hn.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 96 96",children:[(0,c.jsx)(Hn.Path,{className:"outer",d:"M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36",fill:"none"}),(0,c.jsx)(Hn.Path,{className:"inner",d:"M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z",fill:"none"})]}),(0,c.jsx)("p",{children:(0,fs.__)("Generating preview…")})]}));t+='\n\t\t<style>\n\t\t\tbody {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\theight: 100vh;\n\t\t\t\twidth: 100vw;\n\t\t\t}\n\t\t\t@-webkit-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-moz-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-o-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg {\n\t\t\t\twidth: 192px;\n\t\t\t\theight: 192px;\n\t\t\t\tstroke: #555d66;\n\t\t\t\tstroke-width: 0.75;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg .outer,\n\t\t\t.editor-post-preview-button__interstitial-message svg .inner {\n\t\t\t\tstroke-dasharray: 280;\n\t\t\t\tstroke-dashoffset: 280;\n\t\t\t\t-webkit-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-moz-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-o-animation: paint 1.5s ease infinite alternate;\n\t\t\t\tanimation: paint 1.5s ease infinite alternate;\n\t\t\t}\n\t\t\tp {\n\t\t\t\ttext-align: center;\n\t\t\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;\n\t\t\t}\n\t\t</style>\n\t',t=(0,h.applyFilters)("editor.PostPreview.interstitialMarkup",t),e.write(t),e.title=(0,fs.__)("Generating preview…"),e.close()}(t.document);const n=await g({forceIsAutosaveable:s});t.location=n,o?.()},role:n,size:"compact",children:t||(0,c.jsxs)(c.Fragment,{children:[(0,fs._x)("Preview","imperative verb"),(0,c.jsx)(Hn.VisuallyHidden,{as:"span",children:(0,fs.__)("(opens in a new tab)")})]})})}function Lp(){const e=(0,m.useViewportMatch)("medium","<"),{isPublished:t,isBeingScheduled:s,isSaving:n,isPublishing:o,hasPublishAction:r,isAutosaving:i,hasNonPostEntityChanges:a,postStatusHasChanged:l,postStatus:c}=(0,d.useSelect)((e=>{const{isCurrentPostPublished:t,isEditedPostBeingScheduled:s,isSavingPost:n,isPublishingPost:o,getCurrentPost:r,getCurrentPostType:i,isAutosavingPost:a,getPostEdits:l,getEditedPostAttribute:c}=e(vc);return{isPublished:t(),isBeingScheduled:s(),isSaving:n(),isPublishing:o(),hasPublishAction:r()._links?.["wp:action-publish"]??!1,postType:i(),isAutosaving:a(),hasNonPostEntityChanges:e(vc).hasNonPostEntityChanges(),postStatusHasChanged:!!l()?.status,postStatus:c("status")}}),[]);return o?(0,fs.__)("Publishing…"):(t||s)&&n&&!i?(0,fs.__)("Saving…"):r?a||t||l&&!["future","publish"].includes(c)||!l&&"future"===c?(0,fs.__)("Save"):s?(0,fs.__)("Schedule"):(0,fs.__)("Publish"):e?(0,fs.__)("Publish"):(0,fs.__)("Submit for Review")}const Op=()=>{};class Fp extends p.Component{constructor(e){super(e),this.createOnClick=this.createOnClick.bind(this),this.closeEntitiesSavedStates=this.closeEntitiesSavedStates.bind(this),this.state={entitiesSavedStatesCallback:!1}}createOnClick(e){return(...t)=>{const{hasNonPostEntityChanges:s,setEntitiesSavedStatesCallback:n}=this.props;return s&&n?(this.setState({entitiesSavedStatesCallback:()=>e(...t)}),n((()=>this.closeEntitiesSavedStates)),Op):e(...t)}}closeEntitiesSavedStates(e){const{postType:t,postId:s}=this.props,{entitiesSavedStatesCallback:n}=this.state;this.setState({entitiesSavedStatesCallback:!1},(()=>{e&&e.some((e=>"postType"===e.kind&&e.name===t&&e.key===s))&&n()}))}render(){const{forceIsDirty:e,hasPublishAction:t,isBeingScheduled:s,isOpen:n,isPostSavingLocked:o,isPublishable:r,isPublished:i,isSaveable:a,isSaving:l,isAutoSaving:d,isToggle:u,savePostStatus:p,onSubmit:m=Op,onToggle:h,visibility:g,hasNonPostEntityChanges:_,isSavingNonPostEntityChanges:f,postStatus:b,postStatusHasChanged:y}=this.props,x=(l||!a||o||!r&&!e)&&(!_||f),v=(i||l||!a||!r&&!e)&&(!_||f);let w="publish";y?w=b:t?"private"===g?w="private":s&&(w="future"):w="pending";const S={"aria-disabled":x,className:"editor-post-publish-button",isBusy:!d&&l,variant:"primary",onClick:this.createOnClick((()=>{x||(m(),p(w))})),"aria-haspopup":_?"dialog":void 0},k={"aria-disabled":v,"aria-expanded":n,className:"editor-post-publish-panel__toggle",isBusy:l&&i,variant:"primary",size:"compact",onClick:this.createOnClick((()=>{v||h()})),"aria-haspopup":_?"dialog":void 0},C=u?k:S;return(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(Hn.Button,{...C,className:`${C.className} editor-post-publish-button__button`,size:"compact",children:(0,c.jsx)(Lp,{})})})}}var Vp=(0,m.compose)([(0,d.withSelect)((e=>{const{isSavingPost:t,isAutosavingPost:s,isEditedPostBeingScheduled:n,getEditedPostVisibility:o,isCurrentPostPublished:r,isEditedPostSaveable:i,isEditedPostPublishable:a,isPostSavingLocked:l,getCurrentPost:c,getCurrentPostType:d,getCurrentPostId:u,hasNonPostEntityChanges:p,isSavingNonPostEntityChanges:m,getEditedPostAttribute:h,getPostEdits:g}=e(vc);return{isSaving:t(),isAutoSaving:s(),isBeingScheduled:n(),visibility:o(),isSaveable:i(),isPostSavingLocked:l(),isPublishable:a(),isPublished:r(),hasPublishAction:c()._links?.["wp:action-publish"]??!1,postType:d(),postId:u(),postStatus:h("status"),postStatusHasChanged:g()?.status,hasNonPostEntityChanges:p(),isSavingNonPostEntityChanges:m()}})),(0,d.withDispatch)((e=>{const{editPost:t,savePost:s}=e(vc);return{savePostStatus:e=>{t({status:e},{undoIgnore:!0}),s()}}}))])(Fp),Up=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,c.jsx)(L.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"})});const Hp=[{label:(0,fs.__)("Public"),value:"public",description:(0,fs.__)("Visible to everyone.")},{label:(0,fs.__)("Private"),value:"private",description:(0,fs.__)("Only visible to site admins and editors.")},{label:(0,fs.__)("Password protected"),value:"password",description:(0,fs.__)("Only visible to those who know the password.")}];function zp({onClose:e}){const t=(0,m.useInstanceId)(zp),{status:s,visibility:n,password:o}=(0,d.useSelect)((e=>({status:e(vc).getEditedPostAttribute("status"),visibility:e(vc).getEditedPostVisibility(),password:e(vc).getEditedPostAttribute("password")}))),{editPost:r}=(0,d.useDispatch)(vc),[i,a]=(0,p.useState)(!!o);return(0,c.jsxs)("div",{className:"editor-post-visibility",children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Visibility"),help:(0,fs.__)("Control how this post is viewed."),onClose:e}),(0,c.jsxs)(Hn.__experimentalVStack,{spacing:4,children:[(0,c.jsx)(Hn.RadioControl,{label:(0,fs.__)("Visibility"),hideLabelFromVision:!0,options:Hp,selected:i?"password":n,onChange:function(e){r({public:{status:"private"===n?"draft":s,password:""},private:{status:"private",password:""},password:{status:"private"===n?"draft":s,password:o||""}}[e]),a("password"===e)}}),i&&(0,c.jsx)(Hn.TextControl,{label:(0,fs.__)("Password"),onChange:e=>{r({password:e})},value:o,placeholder:(0,fs.__)("Use a secure password"),type:"text",id:`editor-post-visibility__password-input-${t}`,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,maxLength:255})]})]})}function Gp(){return $p()}function $p(){const e=(0,d.useSelect)((e=>e(vc).getEditedPostVisibility()),[]);return Hp.find((t=>t.value===e))?.label}function Wp(e){const t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):"number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?new Date(e):new Date(NaN)}function Zp(e){const t=Wp(e);return t.setDate(1),t.setHours(0,0,0,0),t}function Yp(e){const t=Wp(e),s=t.getMonth();return t.setFullYear(t.getFullYear(),s+1,0),t.setHours(23,59,59,999),t}Math.pow(10,8);const qp=6e4,Kp=36e5;function Qp(e,t){const s=t?.additionalDigits??2,n=function(e){const t={},s=e.split(Xp.dateTimeDelimiter);let n;if(s.length>2)return t;/:/.test(s[0])?n=s[0]:(t.date=s[0],n=s[1],Xp.timeZoneDelimiter.test(t.date)&&(t.date=e.split(Xp.timeZoneDelimiter)[0],n=e.substr(t.date.length,e.length)));if(n){const e=Xp.timezone.exec(n);e?(t.time=n.replace(e[1],""),t.timezone=e[1]):t.time=n}return t}(e);let o;if(n.date){const e=function(e,t){const s=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(s);if(!n)return{year:NaN,restDateString:""};const o=n[1]?parseInt(n[1]):null,r=n[2]?parseInt(n[2]):null;return{year:null===r?o:100*r,restDateString:e.slice((n[1]||n[2]).length)}}(n.date,s);o=function(e,t){if(null===t)return new Date(NaN);const s=e.match(Jp);if(!s)return new Date(NaN);const n=!!s[4],o=sm(s[1]),r=sm(s[2])-1,i=sm(s[3]),a=sm(s[4]),l=sm(s[5])-1;if(n)return function(e,t,s){return t>=1&&t<=53&&s>=0&&s<=6}(0,a,l)?function(e,t,s){const n=new Date(0);n.setUTCFullYear(e,0,4);const o=n.getUTCDay()||7,r=7*(t-1)+s+1-o;return n.setUTCDate(n.getUTCDate()+r),n}(t,a,l):new Date(NaN);{const e=new Date(0);return function(e,t,s){return t>=0&&t<=11&&s>=1&&s<=(om[t]||(rm(e)?29:28))}(t,r,i)&&function(e,t){return t>=1&&t<=(rm(e)?366:365)}(t,o)?(e.setUTCFullYear(t,r,Math.max(o,i)),e):new Date(NaN)}}(e.restDateString,e.year)}if(!o||isNaN(o.getTime()))return new Date(NaN);const r=o.getTime();let i,a=0;if(n.time&&(a=function(e){const t=e.match(em);if(!t)return NaN;const s=nm(t[1]),n=nm(t[2]),o=nm(t[3]);if(!function(e,t,s){if(24===e)return 0===t&&0===s;return s>=0&&s<60&&t>=0&&t<60&&e>=0&&e<25}(s,n,o))return NaN;return s*Kp+n*qp+1e3*o}(n.time),isNaN(a)))return new Date(NaN);if(!n.timezone){const e=new Date(r+a),t=new Date(0);return t.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),t.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),t}return i=function(e){if("Z"===e)return 0;const t=e.match(tm);if(!t)return 0;const s="+"===t[1]?-1:1,n=parseInt(t[2]),o=t[3]&&parseInt(t[3])||0;if(!function(e,t){return t>=0&&t<=59}(0,o))return NaN;return s*(n*Kp+o*qp)}(n.timezone),isNaN(i)?new Date(NaN):new Date(r+a+i)}const Xp={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Jp=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,em=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,tm=/^([+-])(\d{2})(?::?(\d{2}))?$/;function sm(e){return e?parseInt(e):1}function nm(e){return e&&parseFloat(e.replace(",","."))||0}const om=[31,null,31,30,31,30,31,31,30,31,30,31];function rm(e){return e%400==0||e%4==0&&e%100!=0}const{PrivatePublishDateTimePicker:im}=$(g.privateApis);function am(e){return(0,c.jsx)(lm,{...e,showPopoverHeaderActions:!0,isCompact:!1})}function lm({onClose:e,showPopoverHeaderActions:t,isCompact:s}){const{postDate:n,postType:o}=(0,d.useSelect)((e=>({postDate:e(vc).getEditedPostAttribute("date"),postType:e(vc).getCurrentPostType()})),[]),{editPost:r}=(0,d.useDispatch)(vc),[i,a]=(0,p.useState)(Zp(new Date(n))),l=(0,d.useSelect)((e=>e(u.store).getEntityRecords("postType",o,{status:"publish,future",after:Zp(i).toISOString(),before:Yp(i).toISOString(),exclude:[e(vc).getCurrentPostId()],per_page:100,_fields:"id,date"})),[i,o]),m=(0,p.useMemo)((()=>(l||[]).map((({date:e})=>({date:new Date(e)})))),[l]),h=(0,v.getSettings)(),g=/a(?!\\)/i.test(h.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,c.jsx)(im,{currentDate:n,onChange:e=>r({date:e}),is12Hour:g,dateOrder:(0,fs._x)("dmy","date order"),events:m,onMonthPreviewed:e=>a(Qp(e)),onClose:e,isCompact:s,showPopoverHeaderActions:t})}function cm(e){return dm(e)}function dm({full:e=!1}={}){const{date:t,isFloating:s}=(0,d.useSelect)((e=>({date:e(vc).getEditedPostAttribute("date"),isFloating:e(vc).isEditedPostDateFloating()})),[]);return e?um(t):function(e,{isFloating:t=!1,now:s=new Date}={}){if(!e||t)return(0,fs.__)("Immediately");if(!function(e){const{timezone:t}=(0,v.getSettings)(),s=Number(t.offset),n=e.getTimezoneOffset()/60*-1;return s===n}(s))return um(e);const n=(0,v.getDate)(e);if(pm(n,s))return(0,fs.sprintf)((0,fs.__)("Today at %s"),(0,v.dateI18n)((0,fs._x)("g:i a","post schedule time format"),n));const o=new Date(s);if(o.setDate(o.getDate()+1),pm(n,o))return(0,fs.sprintf)((0,fs.__)("Tomorrow at %s"),(0,v.dateI18n)((0,fs._x)("g:i a","post schedule time format"),n));if(n.getFullYear()===s.getFullYear())return(0,v.dateI18n)((0,fs._x)("F j g:i a","post schedule date format without year"),n);return(0,v.dateI18n)((0,fs._x)("F j, Y g:i a","post schedule full date format"),n)}(t,{isFloating:s})}function um(e){const t=(0,v.getDate)(e),s=function(){const{timezone:e}=(0,v.getSettings)();if(e.abbr&&isNaN(Number(e.abbr)))return e.abbr;return`UTC${e.offset<0?"":"+"}${e.offsetFormatted}`}(),n=(0,v.dateI18n)((0,fs._x)("F j, Y g:i a","post schedule full date format"),t);return(0,fs.isRTL)()?`${s} ${n}`:`${n} ${s}`}function pm(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}const mm=3,hm={per_page:10,orderby:"count",order:"desc",hide_empty:!0,_fields:"id,name,count",context:"view"};function gm({onSelect:e,taxonomy:t}){const{_terms:s,showTerms:n}=(0,d.useSelect)((e=>{const s=e(u.store).getEntityRecords("taxonomy",t.slug,hm);return{_terms:s,showTerms:s?.length>=mm}}),[t.slug]);if(!n)return null;const o=Ld(s);return(0,c.jsxs)("div",{className:"editor-post-taxonomies__flat-term-most-used",children:[(0,c.jsx)(Hn.BaseControl.VisualLabel,{as:"h3",className:"editor-post-taxonomies__flat-term-most-used-label",children:t.labels.most_used}),(0,c.jsx)("ul",{role:"list",className:"editor-post-taxonomies__flat-term-most-used-list",children:o.map((t=>(0,c.jsx)("li",{children:(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>e(t),children:t.name})},t.id)))})]})}const _m=[],fm=100,bm={per_page:fm,_fields:"id,name",context:"view"},ym=(e,t)=>Ad(e).toLowerCase()===Ad(t).toLowerCase(),xm=(e,t)=>e.map((e=>t.find((t=>ym(t.name,e)))?.id)).filter((e=>void 0!==e)),vm=({children:e,__nextHasNoMarginBottom:t})=>t?(0,c.jsx)(Hn.__experimentalVStack,{spacing:4,children:e}):(0,c.jsx)(p.Fragment,{children:e});function wm({slug:e,__nextHasNoMarginBottom:t}){const[s,n]=(0,p.useState)([]),[o,r]=(0,p.useState)(""),i=(0,m.useDebounce)(r,500);t||k()("Bottom margin styles for wp.editor.PostTaxonomiesFlatTermSelector",{since:"6.7",version:"7.0",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."});const{terms:a,termIds:l,taxonomy:h,hasAssignAction:g,hasCreateAction:_,hasResolvedTerms:f}=(0,d.useSelect)((t=>{const{getCurrentPost:s,getEditedPostAttribute:n}=t(vc),{getEntityRecords:o,getEntityRecord:r,hasFinishedResolution:i}=t(u.store),a=s(),l=r("root","taxonomy",e),c=l?n(l.rest_base):_m,d={...bm,include:c?.join(","),per_page:-1};return{hasCreateAction:!!l&&(a._links?.["wp:action-create-"+l.rest_base]??!1),hasAssignAction:!!l&&(a._links?.["wp:action-assign-"+l.rest_base]??!1),taxonomy:l,termIds:c,terms:c?.length?o("taxonomy",e,d):_m,hasResolvedTerms:i("getEntityRecords",["taxonomy",e,d])}}),[e]),{searchResults:b}=(0,d.useSelect)((t=>{const{getEntityRecords:s}=t(u.store);return{searchResults:o?s("taxonomy",e,{...bm,search:o}):_m}}),[o,e]);(0,p.useEffect)((()=>{if(f){const e=(a??[]).map((e=>Ad(e.name)));n(e)}}),[a,f]);const y=(0,p.useMemo)((()=>(b??[]).map((e=>Ad(e.name)))),[b]),{editPost:x}=(0,d.useDispatch)(vc),{saveEntityRecord:v}=(0,d.useDispatch)(u.store),{createErrorNotice:w}=(0,d.useDispatch)(_s.store);if(!g)return null;function S(e){x({[h.rest_base]:e})}const C=h?.labels?.add_new_item??("post_tag"===e?(0,fs.__)("Add Tag"):(0,fs.__)("Add Term")),P=h?.labels?.singular_name??("post_tag"===e?(0,fs.__)("Tag"):(0,fs.__)("Term")),j=(0,fs.sprintf)((0,fs._x)("%s added","term"),P),E=(0,fs.sprintf)((0,fs._x)("%s removed","term"),P),T=(0,fs.sprintf)((0,fs._x)("Remove %s","term"),P);return(0,c.jsxs)(vm,{__nextHasNoMarginBottom:t,children:[(0,c.jsx)(Hn.FormTokenField,{__next40pxDefaultSize:!0,value:s,suggestions:y,onChange:function(t){const s=[...a??[],...b??[]],o=t.reduce(((e,t)=>(e.some((e=>e.toLowerCase()===t.toLowerCase()))||e.push(t),e)),[]),r=o.filter((e=>!s.find((t=>ym(t.name,e)))));n(o),0!==r.length?_&&Promise.all(r.map((t=>async function(t){try{const s=await v("taxonomy",e,t,{throwOnError:!0});return Md(s)}catch(e){if("term_exists"!==e.code)throw e;return{id:e.data.term_id,name:t.name}}}({name:t})))).then((e=>{const t=s.concat(e);S(xm(o,t))})).catch((e=>{w(e.message,{type:"snackbar"}),S(xm(o,s))})):S(xm(o,s))},onInputChange:i,maxSuggestions:fm,label:C,messages:{added:j,removed:E,remove:T},__nextHasNoMarginBottom:t}),(0,c.jsx)(gm,{taxonomy:h,onSelect:function(t){if(l.includes(t.id))return;const s=[...l,t.id],n="post_tag"===e?(0,fs.__)("Tag"):(0,fs.__)("Term"),o=(0,fs.sprintf)((0,fs._x)("%s added","term"),h?.labels?.singular_name??n);(0,ms.speak)(o,"assertive"),S(s)}})]})}var Sm=(0,Hn.withFilters)("editor.PostTaxonomyType")(wm);const km=()=>{const e=(0,d.useSelect)((e=>{const t=e(u.store).getTaxonomy("post_tag");return t?.labels}),[]),t=e?.add_new_item??(0,fs.__)("Add tag"),s=e?.name??(0,fs.__)("Tags"),n=[(0,fs.__)("Suggestion:"),(0,c.jsx)("span",{className:"editor-post-publish-panel__link",children:t},"label")];return(0,c.jsxs)(Hn.PanelBody,{initialOpen:!1,title:n,children:[(0,c.jsx)("p",{children:(0,fs.sprintf)((0,fs.__)("%s help users and search engines navigate your site and find your content. Add a few keywords to describe your post."),s)}),(0,c.jsx)(Sm,{slug:"post_tag",__nextHasNoMarginBottom:!0})]})};var Cm=()=>{const{postHasTags:e,siteHasTags:t,isPostTypeSupported:s}=(0,d.useSelect)((e=>{const t=e(vc).getCurrentPostType(),s=e(u.store).getEntityRecord("root","taxonomy","post_tag"),n=s?.types?.includes(t),o=void 0!==s,r=s&&e(vc).getEditedPostAttribute(s.rest_base),i=!!n&&!!e(u.store).getEntityRecords("taxonomy","post_tag",{per_page:1})?.length;return{postHasTags:!!r?.length,siteHasTags:i,isPostTypeSupported:o&&n}}),[]),[n]=(0,p.useState)(e);return s&&t?n?null:(0,c.jsx)(km,{}):null};const Pm=(e,t)=>Pp.filter((t=>e?.includes(t.id))).find((e=>e.id===t)),jm=({suggestedPostFormat:e,suggestionText:t,onUpdatePostFormat:s})=>(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>s(e),children:t});function Em(){const{currentPostFormat:e,suggestion:t}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,getSuggestedPostFormat:s}=e(vc),n=e(u.store).getThemeSupports().formats??[];return{currentPostFormat:t("format"),suggestion:Pm(n,s())}}),[]),{editPost:s}=(0,d.useDispatch)(vc),n=[(0,fs.__)("Suggestion:"),(0,c.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,fs.__)("Use a post format")},"label")];return t&&t.id!==e?(0,c.jsxs)(Hn.PanelBody,{initialOpen:!1,title:n,children:[(0,c.jsx)("p",{children:(0,fs.__)("Your theme uses post formats to highlight different kinds of content, like images or videos. Apply a post format to see this special styling.")}),(0,c.jsx)("p",{children:(0,c.jsx)(jm,{onUpdatePostFormat:e=>s({format:e}),suggestedPostFormat:t.id,suggestionText:(0,fs.sprintf)((0,fs.__)('Apply the "%1$s" format.'),t.caption)})})]}):null}const{normalizeTextString:Tm}=$(Hn.privateApis),{RECEIVE_INTERMEDIATE_RESULTS:Bm}=$(u.privateApis),Im={per_page:-1,orderby:"name",order:"asc",_fields:"id,name,parent",context:"view",[Bm]:!0},Nm=8,Rm=[];function Dm({slug:e}){const[t,s]=(0,p.useState)(!1),[n,o]=(0,p.useState)(""),[r,i]=(0,p.useState)(""),[a,l]=(0,p.useState)(!1),[h,g]=(0,p.useState)(""),[_,f]=(0,p.useState)([]),b=(0,m.useDebounce)(ms.speak,500),{hasCreateAction:y,hasAssignAction:x,terms:v,loading:w,availableTerms:S,taxonomy:k}=(0,d.useSelect)((t=>{const{getCurrentPost:s,getEditedPostAttribute:n}=t(vc),{getEntityRecord:o,getEntityRecords:r,isResolving:i}=t(u.store),a=o("root","taxonomy",e),l=s();return{hasCreateAction:!!a&&!!l._links?.["wp:action-create-"+a.rest_base],hasAssignAction:!!a&&!!l._links?.["wp:action-assign-"+a.rest_base],terms:a?n(a.rest_base):Rm,loading:i("getEntityRecords",["taxonomy",e,Im]),availableTerms:r("taxonomy",e,Im)||Rm,taxonomy:a}}),[e]),{editPost:C}=(0,d.useDispatch)(vc),{saveEntityRecord:P}=(0,d.useDispatch)(u.store),j=(0,p.useMemo)((()=>function(e,t){const s=e=>-1!==t.indexOf(e.id)||void 0!==e.children&&e.children.map(s).filter((e=>e)).length>0,n=[...e];return n.sort(((e,t)=>{const n=s(e),o=s(t);return n===o?0:n&&!o?-1:!n&&o?1:0})),n}(Dd(S),v)),[S]),{createErrorNotice:E}=(0,d.useDispatch)(_s.store);if(!x)return null;const T=e=>{C({[k.rest_base]:e})},B=e=>e.map((e=>(0,c.jsxs)("div",{className:"editor-post-taxonomies__hierarchical-terms-choice",children:[(0,c.jsx)(Hn.CheckboxControl,{__nextHasNoMarginBottom:!0,checked:-1!==v.indexOf(e.id),onChange:()=>{(e=>{const t=v.includes(e)?v.filter((t=>t!==e)):[...v,e];T(t)})(parseInt(e.id,10))},label:(0,Ln.decodeEntities)(e.name)}),!!e.children.length&&(0,c.jsx)("div",{className:"editor-post-taxonomies__hierarchical-terms-subchoices",children:B(e.children)})]},e.id))),I=(t,s,n)=>k?.labels?.[t]??("category"===e?s:n),N=I("add_new_item",(0,fs.__)("Add Category"),(0,fs.__)("Add Term")),R=I("new_item_name",(0,fs.__)("Add Category"),(0,fs.__)("Add Term")),D=I("parent_item",(0,fs.__)("Parent Category"),(0,fs.__)("Parent Term")),A=`— ${D} —`,M=N,L=k?.labels?.search_items??(0,fs.__)("Search Terms"),O=k?.name??(0,fs.__)("Terms"),F=S.length>=Nm;return(0,c.jsxs)(Hn.Flex,{direction:"column",gap:"4",children:[F&&!w&&(0,c.jsx)(Hn.SearchControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:L,placeholder:L,value:h,onChange:e=>{const t=j.map(function(e){const t=s=>{if(""===e)return s;const n={...s};return n.children.length>0&&(n.children=n.children.map(t).filter((e=>e))),(-1!==Tm(n.name).indexOf(Tm(e))||n.children.length>0)&&n};return t}(e)).filter((e=>e)),s=e=>{let t=0;for(let n=0;n<e.length;n++)t++,void 0!==e[n].children&&(t+=s(e[n].children));return t};g(e),f(t);const n=s(t),o=(0,fs.sprintf)((0,fs._n)("%d result found.","%d results found.",n),n);b(o,"assertive")}}),w&&(0,c.jsx)(Hn.Flex,{justify:"center",style:{height:"40px"},children:(0,c.jsx)(Hn.Spinner,{})}),(0,c.jsx)("div",{className:"editor-post-taxonomies__hierarchical-terms-list",tabIndex:"0",role:"group","aria-label":O,children:B(""!==h?_:j)}),!w&&y&&(0,c.jsx)(Hn.FlexItem,{children:(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,onClick:()=>{l(!a)},className:"editor-post-taxonomies__hierarchical-terms-add","aria-expanded":a,variant:"link",children:N})}),a&&(0,c.jsx)("form",{onSubmit:async a=>{if(a.preventDefault(),""===n||t)return;const l=function(e,t,s){return e.find((e=>(!e.parent&&!t||parseInt(e.parent)===parseInt(t))&&e.name.toLowerCase()===s.toLowerCase()))}(S,r,n);if(l)return v.some((e=>e===l.id))||T([...v,l.id]),o(""),void i("");let c;s(!0);try{c=await(d={name:n,parent:r||void 0},P("taxonomy",e,d,{throwOnError:!0}))}catch(e){return void E(e.message,{type:"snackbar"})}var d;const u="category"===e?(0,fs.__)("Category"):(0,fs.__)("Term"),p=(0,fs.sprintf)((0,fs._x)("%s added","term"),k?.labels?.singular_name??u);(0,ms.speak)(p,"assertive"),s(!1),o(""),i(""),T([...v,c.id])},children:(0,c.jsxs)(Hn.Flex,{direction:"column",gap:"4",children:[(0,c.jsx)(Hn.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"editor-post-taxonomies__hierarchical-terms-input",label:R,value:n,onChange:e=>{o(e)},required:!0}),!!S.length&&(0,c.jsx)(Hn.TreeSelect,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:D,noOptionLabel:A,onChange:e=>{i(e)},selectedId:r,tree:j}),(0,c.jsx)(Hn.FlexItem,{children:(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"secondary",type:"submit",className:"editor-post-taxonomies__hierarchical-terms-submit",children:M})})]})})]})}var Am=(0,Hn.withFilters)("editor.PostTaxonomyType")(Dm);var Mm=function(){const{hasNoCategory:e,hasSiteCategories:t}=(0,d.useSelect)((e=>{const t=e(vc).getCurrentPostType(),{canUser:s,getEntityRecord:n}=e(u.store),o=n("root","taxonomy","category"),r=s("read",{kind:"root",name:"site"})?n("root","site")?.default_category:void 0,i=r?n("taxonomy","category",r):void 0,a=o&&o.types.some((e=>e===t)),l=o&&e(vc).getEditedPostAttribute(o.rest_base),c=!!a&&!!e(u.store).getEntityRecords("taxonomy","category",{exclude:[r],per_page:1})?.length;return{hasNoCategory:!!o&&!!i&&a&&(0===l?.length||1===l?.length&&i?.id===l[0]),hasSiteCategories:c}}),[]),[s,n]=(0,p.useState)(!1);if((0,p.useEffect)((()=>{e&&n(!0)}),[e]),!s||!t)return null;const o=[(0,fs.__)("Suggestion:"),(0,c.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,fs.__)("Assign a category")},"label")];return(0,c.jsxs)(Hn.PanelBody,{initialOpen:!1,title:o,children:[(0,c.jsx)("p",{children:(0,fs.__)("Categories provide a helpful way to group related posts together and to quickly tell readers what a post is about.")}),(0,c.jsx)(Am,{slug:"category"})]})};function Lm(e){return Object.fromEntries(Object.entries(function(e){const t=new Set;return Object.fromEntries(e.map((e=>{const s=(0,w.getFilename)(e);let n="";if(s){const e=s.split(".");e.length>1&&e.pop(),n=e.join(".")}return n||(n=fi()),t.has(n)&&(n=`${n}-${fi()}`),t.add(n),[e,n]})))}(e)).map((([e,t])=>{const s=window.fetch(e.includes("?")?e:e+"?").then((e=>e.blob())).then((e=>new File([e],`${t}.png`,{type:e.type})));return[e,s]})))}function Om(e){const t=[];return e.forEach((e=>{t.push(e),t.push(...Om(e.innerBlocks))})),t}function Fm(e){if("core/image"===e.name||"core/cover"===e.name){const{url:t,alt:s,id:n}=e.attributes;return{url:t,alt:s,id:n}}if("core/media-text"===e.name){const{mediaUrl:t,mediaAlt:s,mediaId:n}=e.attributes;return{url:t,alt:s,id:n}}return{}}function Vm({clientId:e,alt:t,url:s}){const{selectBlock:n}=(0,d.useDispatch)(g.store);return(0,c.jsx)(Hn.__unstableMotion.img,{tabIndex:0,role:"button","aria-label":(0,fs.__)("Select image block."),onClick:()=>{n(e)},onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(n(e),t.preventDefault())},alt:t,src:s,animate:{opacity:1},exit:{opacity:0,scale:0},style:{width:"32px",height:"32px",objectFit:"cover",borderRadius:"2px",cursor:"pointer"},whileHover:{scale:1.08}},e)}function Um(){const[e,t]=(0,p.useState)(!1),[s,n]=(0,p.useState)(!1),[o,r]=(0,p.useState)(!1),{editorBlocks:i,mediaUpload:a}=(0,d.useSelect)((e=>({editorBlocks:e(g.store).getBlocks(),mediaUpload:e(g.store).getSettings().mediaUpload})),[]),l=Om(i).filter((e=>function(e){return"core/image"===e.name||"core/cover"===e.name?e.attributes.url&&!e.attributes.id:"core/media-text"===e.name?e.attributes.mediaUrl&&!e.attributes.mediaId:void 0}(e))),{updateBlockAttributes:u}=(0,d.useDispatch)(g.store);if(!a||!l.length)return null;const m=[(0,fs.__)("Suggestion:"),(0,c.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,fs.__)("External media")},"label")];return(0,c.jsxs)(Hn.PanelBody,{initialOpen:!0,title:m,children:[(0,c.jsx)("p",{children:(0,fs.__)("Upload external images to the Media Library. Images from different domains may load slowly, display incorrectly, or be removed unexpectedly.")}),(0,c.jsxs)("div",{style:{display:"inline-flex",flexWrap:"wrap",gap:"8px"},children:[(0,c.jsx)(Hn.__unstableAnimatePresence,{onExitComplete:()=>n(!1),children:l.map((e=>{const{url:t,alt:s}=Fm(e);return(0,c.jsx)(Vm,{clientId:e.clientId,url:t,alt:s},e.clientId)}))}),e||s?(0,c.jsx)(Hn.Spinner,{}):(0,c.jsx)(Hn.Button,{size:"compact",variant:"primary",onClick:function(){t(!0),r(!1);const e=new Set(l.map((e=>{const{url:t}=Fm(e);return t}))),s=Object.fromEntries(Object.entries(Lm([...e])).map((([e,t])=>[e,t.then((e=>new Promise(((t,s)=>{a({filesList:[e],onFileChange:([e])=>{(0,Go.isBlobURL)(e.url)||t(e)},onError(){s()}})}))))])));Promise.allSettled(l.map((e=>{const{url:t}=Fm(e);return s[t].then((t=>function(e,t){"core/image"!==e.name&&"core/cover"!==e.name||u(e.clientId,{id:t.id,url:t.url}),"core/media-text"===e.name&&u(e.clientId,{mediaId:t.id,mediaUrl:t.url})}(e,t))).then((()=>n(!0))).catch((()=>r(!0)))}))).finally((()=>{t(!1)}))},children:(0,fs._x)("Upload","verb")})]}),o&&(0,c.jsx)("p",{children:(0,fs.__)("Upload failed, try again.")})]})}var Hm=function({children:e}){const{isBeingScheduled:t,isRequestingSiteIcon:s,hasPublishAction:n,siteIconUrl:o,siteTitle:r,siteHome:i}=(0,d.useSelect)((e=>{const{getCurrentPost:t,isEditedPostBeingScheduled:s}=e(vc),{getEntityRecord:n,isResolving:o}=e(u.store),r=n("root","__unstableBase",void 0)||{};return{hasPublishAction:t()._links?.["wp:action-publish"]??!1,isBeingScheduled:s(),isRequestingSiteIcon:o("getEntityRecord",["root","__unstableBase",void 0]),siteIconUrl:r.site_icon_url,siteTitle:r.name,siteHome:r.home&&(0,w.filterURLForDisplay)(r.home)}}),[]);let a,l,p=(0,c.jsx)(Hn.Icon,{className:"components-site-icon",size:"36px",icon:Up});return o&&(p=(0,c.jsx)("img",{alt:(0,fs.__)("Site Icon"),className:"components-site-icon",src:o})),s&&(p=null),n?t?(a=(0,fs.__)("Are you ready to schedule?"),l=(0,fs.__)("Your work will be published at the specified date and time.")):(a=(0,fs.__)("Are you ready to publish?"),l=(0,fs.__)("Double-check your settings before publishing.")):(a=(0,fs.__)("Are you ready to submit for review?"),l=(0,fs.__)("Your work will be reviewed and then approved.")),(0,c.jsxs)("div",{className:"editor-post-publish-panel__prepublish",children:[(0,c.jsx)("div",{children:(0,c.jsx)("strong",{children:a})}),(0,c.jsx)("p",{children:l}),(0,c.jsxs)("div",{className:"components-site-card",children:[p,(0,c.jsxs)("div",{className:"components-site-info",children:[(0,c.jsx)("span",{className:"components-site-name",children:(0,Ln.decodeEntities)(r)||(0,fs.__)("(Untitled)")}),(0,c.jsx)("span",{className:"components-site-home",children:i})]})]}),(0,c.jsx)(Um,{}),n&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.PanelBody,{initialOpen:!1,title:[(0,fs.__)("Visibility:"),(0,c.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,c.jsx)(Gp,{})},"label")],children:(0,c.jsx)(zp,{})}),(0,c.jsx)(Hn.PanelBody,{initialOpen:!1,title:[(0,fs.__)("Publish:"),(0,c.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,c.jsx)(cm,{})},"label")],children:(0,c.jsx)(am,{})})]}),(0,c.jsx)(Em,{}),(0,c.jsx)(Cm,{}),(0,c.jsx)(Mm,{}),e]})};const zm="%postname%",Gm="%pagename%";function $m({text:e}){const[t,s]=(0,p.useState)(!1),n=(0,p.useRef)(),o=(0,m.useCopyToClipboard)(e,(()=>{s(!0),n.current&&clearTimeout(n.current),n.current=setTimeout((()=>{s(!1)}),4e3)}));return(0,p.useEffect)((()=>()=>{n.current&&clearTimeout(n.current)}),[]),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"secondary",ref:o,children:t?(0,fs.__)("Copied!"):(0,fs.__)("Copy")})}function Wm({focusOnMount:e,children:t}){const{post:s,postType:n,isScheduled:o}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPost:s,isCurrentPostScheduled:n}=e(vc),{getPostType:o}=e(u.store);return{post:s(),postType:o(t("type")),isScheduled:n()}}),[]),r=n?.labels?.singular_name,i=n?.labels?.view_item,a=n?.labels?.add_new_item,l="future"===s.status?(e=>{const{slug:t}=e;return e.permalink_template.includes(zm)?e.permalink_template.replace(zm,t):e.permalink_template.includes(Gm)?e.permalink_template.replace(Gm,t):e.permalink_template})(s):s.link,m=(0,w.addQueryArgs)("post-new.php",{post_type:s.type}),h=(0,p.useCallback)((t=>{e&&t&&t.focus()}),[e]),g=o?(0,c.jsxs)(c.Fragment,{children:[(0,fs.__)("is now scheduled. It will go live on")," ",(0,c.jsx)(cm,{}),"."]}):(0,fs.__)("is now live.");return(0,c.jsxs)("div",{className:"post-publish-panel__postpublish",children:[(0,c.jsxs)(Hn.PanelBody,{className:"post-publish-panel__postpublish-header",children:[(0,c.jsx)(Hn.ExternalLink,{ref:h,href:l,children:(0,Ln.decodeEntities)(s.title)||(0,fs.__)("(no title)")})," ",g]}),(0,c.jsxs)(Hn.PanelBody,{children:[(0,c.jsx)("p",{className:"post-publish-panel__postpublish-subheader",children:(0,c.jsx)("strong",{children:(0,fs.__)("What’s next?")})}),(0,c.jsxs)("div",{className:"post-publish-panel__postpublish-post-address-container",children:[(0,c.jsx)(Hn.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"post-publish-panel__postpublish-post-address",readOnly:!0,label:(0,fs.sprintf)((0,fs.__)("%s address"),r),value:(0,w.safeDecodeURIComponent)(l),onFocus:e=>e.target.select()}),(0,c.jsx)("div",{className:"post-publish-panel__postpublish-post-address__copy-button-wrap",children:(0,c.jsx)($m,{text:l})})]}),(0,c.jsxs)("div",{className:"post-publish-panel__postpublish-buttons",children:[!o&&(0,c.jsxs)(Hn.Button,{variant:"primary",href:l,__next40pxDefaultSize:!0,icon:Fn,iconPosition:"right",target:"_blank",children:[i,(0,c.jsx)(Hn.VisuallyHidden,{as:"span",children:(0,fs.__)("(opens in a new tab)")})]}),(0,c.jsx)(Hn.Button,{variant:o?"primary":"secondary",__next40pxDefaultSize:!0,href:m,children:a})]})]}),t]})}class Zm extends p.Component{constructor(){super(...arguments),this.onSubmit=this.onSubmit.bind(this),this.cancelButtonNode=(0,p.createRef)()}componentDidMount(){this.timeoutID=setTimeout((()=>{this.cancelButtonNode.current.focus()}),0)}componentWillUnmount(){clearTimeout(this.timeoutID)}componentDidUpdate(e){(e.isPublished&&!this.props.isSaving&&this.props.isDirty||this.props.currentPostId!==e.currentPostId)&&this.props.onClose()}onSubmit(){const{onClose:e,hasPublishAction:t,isPostTypeViewable:s}=this.props;t&&s||e()}render(){const{forceIsDirty:e,isBeingScheduled:t,isPublished:s,isPublishSidebarEnabled:n,isScheduled:o,isSaving:r,isSavingNonPostEntityChanges:i,onClose:a,onTogglePublishSidebar:l,PostPublishExtension:d,PrePublishExtension:u,currentPostId:p,...m}=this.props,{hasPublishAction:h,isDirty:g,isPostTypeViewable:_,...f}=m,b=s||o&&t,y=!b&&!r,x=b&&!r;return(0,c.jsxs)("div",{className:"editor-post-publish-panel",...f,children:[(0,c.jsx)("div",{className:"editor-post-publish-panel__header",children:x?(0,c.jsx)(Hn.Button,{size:"compact",onClick:a,icon:la,label:(0,fs.__)("Close panel")}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"editor-post-publish-panel__header-cancel-button",children:(0,c.jsx)(Hn.Button,{ref:this.cancelButtonNode,accessibleWhenDisabled:!0,disabled:i,onClick:a,variant:"secondary",size:"compact",children:(0,fs.__)("Cancel")})}),(0,c.jsx)("div",{className:"editor-post-publish-panel__header-publish-button",children:(0,c.jsx)(Vp,{onSubmit:this.onSubmit,forceIsDirty:e})})]})}),(0,c.jsxs)("div",{className:"editor-post-publish-panel__content",children:[y&&(0,c.jsx)(Hm,{children:u&&(0,c.jsx)(u,{})}),x&&(0,c.jsx)(Wm,{focusOnMount:!0,children:d&&(0,c.jsx)(d,{})}),r&&(0,c.jsx)(Hn.Spinner,{})]}),(0,c.jsx)("div",{className:"editor-post-publish-panel__footer",children:(0,c.jsx)(Hn.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,fs.__)("Always show pre-publish checks."),checked:n,onChange:l})})]})}}var Ym=(0,m.compose)([(0,d.withSelect)((e=>{const{getPostType:t}=e(u.store),{getCurrentPost:s,getCurrentPostId:n,getEditedPostAttribute:o,isCurrentPostPublished:r,isCurrentPostScheduled:i,isEditedPostBeingScheduled:a,isEditedPostDirty:l,isAutosavingPost:c,isSavingPost:d,isSavingNonPostEntityChanges:p}=e(vc),{isPublishSidebarEnabled:m}=e(vc),h=t(o("type"));return{hasPublishAction:s()._links?.["wp:action-publish"]??!1,isPostTypeViewable:h?.viewable,isBeingScheduled:a(),isDirty:l(),isPublished:r(),isPublishSidebarEnabled:m(),isSaving:d()&&!c(),isSavingNonPostEntityChanges:p(),isScheduled:i(),currentPostId:n()}})),(0,d.withDispatch)(((e,{isPublishSidebarEnabled:t})=>{const{disablePublishSidebar:s,enablePublishSidebar:n}=e(vc);return{onTogglePublishSidebar:()=>{t?s():n()}}})),Hn.withFocusReturn,Hn.withConstrainedTabbing])(Zm),qm=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M17.3 10.1C17.3 7.60001 15.2 5.70001 12.5 5.70001C10.3 5.70001 8.4 7.10001 7.9 9.00001H7.7C5.7 9.00001 4 10.7 4 12.8C4 14.9 5.7 16.6 7.7 16.6H9.5V15.2H7.7C6.5 15.2 5.5 14.1 5.5 12.9C5.5 11.7 6.5 10.5 7.7 10.5H9L9.3 9.40001C9.7 8.10001 11 7.20001 12.5 7.20001C14.3 7.20001 15.8 8.50001 15.8 10.1V11.4L17.1 11.6C17.9 11.7 18.5 12.5 18.5 13.4C18.5 14.4 17.7 15.2 16.8 15.2H14.5V16.6H16.7C18.5 16.6 19.9 15.1 19.9 13.3C20 11.7 18.8 10.4 17.3 10.1Z M14.1245 14.2426L15.1852 13.182L12.0032 10L8.82007 13.1831L9.88072 14.2438L11.25 12.8745V18H12.75V12.8681L14.1245 14.2426Z"})}),Km=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M17.3 10.1c0-2.5-2.1-4.4-4.8-4.4-2.2 0-4.1 1.4-4.6 3.3h-.2C5.7 9 4 10.7 4 12.8c0 2.1 1.7 3.8 3.7 3.8h9c1.8 0 3.2-1.5 3.2-3.3.1-1.6-1.1-2.9-2.6-3.2zm-.5 5.1h-9c-1.2 0-2.2-1.1-2.2-2.3s1-2.4 2.2-2.4h1.3l.3-1.1c.4-1.3 1.7-2.2 3.2-2.2 1.8 0 3.3 1.3 3.3 2.9v1.3l1.3.2c.8.1 1.4.9 1.4 1.8-.1 1-.9 1.8-1.8 1.8z"})});function Qm({children:e}){const{hasStickyAction:t,postType:s}=(0,d.useSelect)((e=>{const t=e(vc).getCurrentPost();return{hasStickyAction:t._links?.["wp:action-sticky"]??!1,postType:e(vc).getCurrentPostType()}}),[]);return"post"===s&&t?e:null}function Xm(){const e=(0,d.useSelect)((e=>e(vc).getEditedPostAttribute("sticky")??!1),[]),{editPost:t}=(0,d.useDispatch)(vc);return(0,c.jsx)(Qm,{children:(0,c.jsx)(Hn.CheckboxControl,{className:"editor-post-sticky__checkbox-control",label:(0,fs.__)("Sticky"),help:(0,fs.__)("Pin this post to the top of the blog."),checked:e,onChange:()=>t({sticky:!e}),__nextHasNoMarginBottom:!0})})}const Jm={"auto-draft":{label:(0,fs.__)("Draft"),icon:br},draft:{label:(0,fs.__)("Draft"),icon:br},pending:{label:(0,fs.__)("Pending"),icon:xr},private:{label:(0,fs.__)("Private"),icon:vr},future:{label:(0,fs.__)("Scheduled"),icon:yr},publish:{label:(0,fs.__)("Published"),icon:wr}},eh=[{label:(0,fs.__)("Draft"),value:"draft",description:(0,fs.__)("Not ready to publish.")},{label:(0,fs.__)("Pending"),value:"pending",description:(0,fs.__)("Waiting for review before publishing.")},{label:(0,fs.__)("Private"),value:"private",description:(0,fs.__)("Only visible to site admins and editors.")},{label:(0,fs.__)("Scheduled"),value:"future",description:(0,fs.__)("Publish automatically on a chosen date.")},{label:(0,fs.__)("Published"),value:"publish",description:(0,fs.__)("Visible to everyone.")}],th=[B,I,N,R];function sh(){const{status:e,date:t,password:s,postId:n,postType:o,canEdit:r}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPostId:s,getCurrentPostType:n,getCurrentPost:o}=e(vc);return{status:t("status"),date:t("date"),password:t("password"),postId:s(),postType:n(),canEdit:o()._links?.["wp:action-publish"]??!1}}),[]),[i,a]=(0,p.useState)(!!s),l=(0,m.useInstanceId)(sh,"editor-change-status__password-input"),{editEntityRecord:h}=(0,d.useDispatch)(u.store),[_,f]=(0,p.useState)(null),b=(0,p.useMemo)((()=>({anchor:_,"aria-label":(0,fs.__)("Status & visibility"),headerTitle:(0,fs.__)("Status & visibility"),placement:"left-start",offset:36,shift:!0})),[_]);if(th.includes(o))return null;const y=({status:r=e,password:i=s,date:a=t})=>{h("postType",o,n,{status:r,date:a,password:i})},x=e=>{a(e),e||y({password:""})},v=n=>{let o=t,r=s;"future"===e&&new Date(t)>new Date&&(o=null),"private"===n&&s&&(r=""),y({status:n,date:o,password:r})};return(0,c.jsx)(Rd,{label:(0,fs.__)("Status"),ref:f,children:r?(0,c.jsx)(Hn.Dropdown,{className:"editor-post-status",contentClassName:"editor-change-status__content",popoverProps:b,focusOnMount:!0,renderToggle:({onToggle:t,isOpen:s})=>(0,c.jsx)(Hn.Button,{className:"editor-post-status__toggle",variant:"tertiary",size:"compact",onClick:t,icon:Jm[e]?.icon,"aria-label":(0,fs.sprintf)((0,fs.__)("Change status: %s"),Jm[e]?.label),"aria-expanded":s,children:Jm[e]?.label}),renderContent:({onClose:t})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Status & visibility"),onClose:t}),(0,c.jsx)("form",{onSubmit:e=>{e.preventDefault(),t()},children:(0,c.jsxs)(Hn.__experimentalVStack,{spacing:4,children:[(0,c.jsx)(Hn.RadioControl,{className:"editor-change-status__options",hideLabelFromVision:!0,label:(0,fs.__)("Status"),options:eh,onChange:v,selected:"auto-draft"===e?"draft":e}),"future"===e&&(0,c.jsx)("div",{className:"editor-change-status__publish-date-wrapper",children:(0,c.jsx)(lm,{showPopoverHeaderActions:!1,isCompact:!0})}),"private"!==e&&(0,c.jsxs)(Hn.__experimentalVStack,{as:"fieldset",spacing:4,className:"editor-change-status__password-fieldset",children:[(0,c.jsx)(Hn.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,fs.__)("Password protected"),help:(0,fs.__)("Only visible to those who know the password."),checked:i,onChange:x}),i&&(0,c.jsx)("div",{className:"editor-change-status__password-input",children:(0,c.jsx)(Hn.TextControl,{label:(0,fs.__)("Password"),onChange:e=>y({password:e}),value:s,placeholder:(0,fs.__)("Use a secure password"),type:"text",id:l,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,maxLength:255})})]}),(0,c.jsx)(Xm,{})]})})]})}):(0,c.jsx)("div",{className:"editor-post-status is-read-only",children:Jm[e]?.label})})}function nh({forceIsDirty:e}){const[t,s]=(0,p.useState)(!1),n=(0,m.useViewportMatch)("small"),{isAutosaving:o,isDirty:r,isNew:i,isPublished:a,isSaveable:l,isSaving:u,isScheduled:h,hasPublishAction:g,showIconLabels:_,postStatus:f,postStatusHasChanged:b}=(0,d.useSelect)((t=>{const{isEditedPostNew:s,isCurrentPostPublished:n,isCurrentPostScheduled:o,isEditedPostDirty:r,isSavingPost:i,isEditedPostSaveable:a,getCurrentPost:l,isAutosavingPost:c,getEditedPostAttribute:d,getPostEdits:u}=t(vc),{get:p}=t(C.store);return{isAutosaving:c(),isDirty:e||r(),isNew:s(),isPublished:n(),isSaving:i(),isSaveable:a(),isScheduled:o(),hasPublishAction:l()?._links?.["wp:action-publish"]??!1,showIconLabels:p("core","showIconLabels"),postStatus:d("status"),postStatusHasChanged:!!u()?.status}}),[e]),y="pending"===f,{savePost:x}=(0,d.useDispatch)(vc),v=(0,m.usePrevious)(u);if((0,p.useEffect)((()=>{let e;return v&&!u&&(s(!0),e=setTimeout((()=>{s(!1)}),1e3)),()=>clearTimeout(e)}),[u]),!g&&y)return null;const w=!["pending","draft","auto-draft"].includes(f)&&eh.map((({value:e})=>e)).includes(f);if(a||h||w||b&&["pending","draft"].includes(f))return null;const S=y?(0,fs.__)("Save as pending"):(0,fs.__)("Save draft"),k=(0,fs.__)("Save"),P=t||!i&&!r,j=u||P,E=u||P||!l;let T;return u?T=o?(0,fs.__)("Autosaving"):(0,fs.__)("Saving"):P?T=(0,fs.__)("Saved"):n?T=S:_&&(T=k),(0,c.jsxs)(Hn.Button,{className:l||u?mr({"editor-post-save-draft":!j,"editor-post-saved-state":j,"is-saving":u,"is-autosaving":o,"is-saved":P,[(0,Hn.__unstableGetAnimateClassName)({type:"loading"})]:u}):void 0,onClick:E?void 0:()=>x(),shortcut:E?void 0:ll.displayShortcut.primary("s"),variant:"tertiary",size:"compact",icon:n?void 0:qm,label:T||S,"aria-disabled":E,children:[j&&(0,c.jsx)(ei,{icon:P?zn:Km}),T]})}function oh({children:e}){return(0,d.useSelect)((e=>e(vc).getCurrentPost()._links?.["wp:action-publish"]??!1),[])?e:null}const rh=[B,I,N,R];function ih(){const[e,t]=(0,p.useState)(null),s=(0,d.useSelect)((e=>e(vc).getCurrentPostType()),[]),n=(0,p.useMemo)((()=>({anchor:e,"aria-label":(0,fs.__)("Change publish date"),placement:"left-start",offset:36,shift:!0})),[e]),o=dm(),r=dm({full:!0});return rh.includes(s)?null:(0,c.jsx)(oh,{children:(0,c.jsx)(Rd,{label:(0,fs.__)("Publish"),ref:t,children:(0,c.jsx)(Hn.Dropdown,{popoverProps:n,focusOnMount:!0,className:"editor-post-schedule__panel-dropdown",contentClassName:"editor-post-schedule__dialog",renderToggle:({onToggle:e,isOpen:t})=>(0,c.jsx)(Hn.Button,{size:"compact",className:"editor-post-schedule__dialog-toggle",variant:"tertiary",tooltipPosition:"middle left",onClick:e,"aria-label":(0,fs.sprintf)((0,fs.__)("Change date: %s"),o),label:r,showTooltip:o!==r,"aria-expanded":t,children:o}),renderContent:({onClose:e})=>(0,c.jsx)(am,{onClose:e})})})})}function ah(){k()("wp.editor.PostSwitchToDraftButton",{since:"6.7",version:"6.9"});const[e,t]=(0,p.useState)(!1),{editPost:s,savePost:n}=(0,d.useDispatch)(vc),{isSaving:o,isPublished:r,isScheduled:i}=(0,d.useSelect)((e=>{const{isSavingPost:t,isCurrentPostPublished:s,isCurrentPostScheduled:n}=e(vc);return{isSaving:t(),isPublished:s(),isScheduled:n()}}),[]),a=o||!r&&!i;let l,u;r?(l=(0,fs.__)("Are you sure you want to unpublish this post?"),u=(0,fs.__)("Unpublish")):i&&(l=(0,fs.__)("Are you sure you want to unschedule this post?"),u=(0,fs.__)("Unschedule"));return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,className:"editor-post-switch-to-draft",onClick:()=>{a||t(!0)},"aria-disabled":a,variant:"secondary",style:{flexGrow:"1",justifyContent:"center"},children:(0,fs.__)("Switch to draft")}),(0,c.jsx)(Hn.__experimentalConfirmDialog,{isOpen:e,onConfirm:()=>{t(!1),s({status:"draft"}),n()},onCancel:()=>t(!1),confirmButtonText:u,children:l})]})}function lh(){const{syncStatus:e,postType:t}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(vc),s=t("meta");return{syncStatus:"unsynced"===s?.wp_pattern_sync_status?"unsynced":t("wp_pattern_sync_status"),postType:t("type")}}));return"wp_block"!==t?null:(0,c.jsx)(Rd,{label:(0,fs.__)("Sync status"),children:(0,c.jsx)("div",{className:"editor-post-sync-status__value",children:"unsynced"===e?(0,fs._x)("Not synced","pattern (singular)"):(0,fs._x)("Synced","pattern (singular)")})})}const ch=e=>e;var dh=function({taxonomyWrapper:e=ch}){const{postType:t,taxonomies:s}=(0,d.useSelect)((e=>({postType:e(vc).getCurrentPostType(),taxonomies:e(u.store).getEntityRecords("root","taxonomy",{per_page:-1})})),[]);return(s??[]).filter((e=>e.types.includes(t)&&e.visibility?.show_ui)).map((t=>{const s=t.hierarchical?Am:Sm,n={slug:t.slug,...t.hierarchical?{}:{__nextHasNoMarginBottom:!0}};return(0,c.jsx)(p.Fragment,{children:e((0,c.jsx)(s,{...n}),t)},`taxonomy-${t.slug}`)}))};function uh({children:e}){const t=(0,d.useSelect)((e=>{const t=e(vc).getCurrentPostType(),s=e(u.store).getEntityRecords("root","taxonomy",{per_page:-1});return s?.some((e=>e.types.includes(t)))}),[]);return t?e:null}function ph({taxonomy:e,children:t}){const s=e?.slug,n=s?`taxonomy-panel-${s}`:"",{isEnabled:o,isOpened:r}=(0,d.useSelect)((e=>{const{isEditorPanelEnabled:t,isEditorPanelOpened:o}=e(vc);return{isEnabled:!!s&&t(n),isOpened:!!s&&o(n)}}),[n,s]),{toggleEditorPanelOpened:i}=(0,d.useDispatch)(vc);if(!o)return null;const a=e?.labels?.menu_name;return a?(0,c.jsx)(Hn.PanelBody,{title:a,opened:r,onToggle:()=>i(n),children:t}):null}function mh(){return(0,c.jsx)(uh,{children:(0,c.jsx)(dh,{taxonomyWrapper:(e,t)=>(0,c.jsx)(ph,{taxonomy:t,children:e})})})}var hh=s(4132);function gh(){const e=(0,m.useInstanceId)(gh),{content:t,blocks:s,type:n,id:o}=(0,d.useSelect)((e=>{const{getEditedEntityRecord:t}=e(u.store),{getCurrentPostType:s,getCurrentPostId:n}=e(vc),o=s(),r=n(),i=t("postType",o,r);return{content:i?.content,blocks:i?.blocks,type:o,id:r}}),[]),{editEntityRecord:r}=(0,d.useDispatch)(u.store),i=(0,p.useMemo)((()=>t instanceof Function?t({blocks:s}):s?(0,x.__unstableSerializeAndClean)(s):t),[t,s]);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.VisuallyHidden,{as:"label",htmlFor:`post-content-${e}`,children:(0,fs.__)("Type text or HTML")}),(0,c.jsx)(hh.A,{autoComplete:"off",dir:"auto",value:i,onChange:e=>{r("postType",n,o,{content:e.target.value,blocks:void 0,selection:void 0})},className:"editor-post-text-editor",id:`post-content-${e}`,placeholder:(0,fs.__)("Start writing with text or HTML")})]})}const _h="wp-block wp-block-post-title block-editor-block-list__block editor-post-title editor-post-title__input rich-text",fh=/[\r\n]+/g;function bh(e){const t=(0,p.useRef)(),{isCleanNewPost:s}=(0,d.useSelect)((e=>{const{isCleanNewPost:t}=e(vc);return{isCleanNewPost:t()}}),[]);return(0,p.useImperativeHandle)(e,(()=>({focus:()=>{t?.current?.focus()}}))),(0,p.useEffect)((()=>{if(!t.current)return;const{defaultView:e}=t.current.ownerDocument,{name:n,parent:o}=e,r="editor-canvas"===n?o.document:e.document,{activeElement:i,body:a}=r;!s||i&&a!==i||t.current.focus()}),[s]),{ref:t}}function yh(){const{editPost:e}=(0,d.useDispatch)(vc),{title:t}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(vc);return{title:t("title")}}),[]);return{title:t,setTitle:function(t){e({title:t})}}}const xh=(0,p.forwardRef)(((e,t)=>{const{placeholder:s}=(0,d.useSelect)((e=>{const{getSettings:t}=e(g.store),{titlePlaceholder:s}=t();return{placeholder:s}}),[]),[n,o]=(0,p.useState)(!1),{ref:r}=bh(t),{title:i,setTitle:a}=yh(),[l,u]=(0,p.useState)({}),{clearSelectedBlock:h,insertBlocks:_,insertDefaultBlock:f}=(0,d.useDispatch)(g.store),b=(0,Ln.decodeEntities)(s)||(0,fs.__)("Add title"),{value:y,onChange:v,ref:w}=(0,$c.__unstableUseRichText)({value:i,onChange(e){a(e.replace(fh," "))},placeholder:b,selectionStart:l.start,selectionEnd:l.end,onSelectionChange(e,t){u((s=>{const{start:n,end:o}=s;return n===e&&o===t?s:{start:e,end:t}}))},__unstableDisableFormats:!1});function S(e){_(e,0)}const k=mr(_h,{"is-selected":n});return(0,c.jsx)("h1",{ref:(0,m.useMergeRefs)([w,r]),contentEditable:!0,className:k,"aria-label":b,role:"textbox","aria-multiline":"true",onFocus:function(){o(!0),h()},onBlur:function(){o(!1),u({})},onKeyDown:function(e){e.keyCode===ll.ENTER&&(e.preventDefault(),f(void 0,void 0,0))},onPaste:function(e){const t=e.clipboardData;let s="",n="";try{s=t.getData("text/plain"),n=t.getData("text/html")}catch(e){return}window.console.log("Received HTML:\n\n",n),window.console.log("Received plain text:\n\n",s);const o=(0,x.pasteHandler)({HTML:n,plainText:s});if(e.preventDefault(),o.length)if("string"!=typeof o){const[e]=o;if(i||"core/heading"!==e.name&&"core/paragraph"!==e.name)S(o);else{const t=(0,Uc.__unstableStripHTML)(e.attributes.content);a(t),S(o.slice(1))}}else{const e=(0,Uc.__unstableStripHTML)(o);v((0,$c.insert)(y,(0,$c.create)({html:e})))}}})}));var vh=(0,p.forwardRef)(((e,t)=>(0,c.jsx)(Bd,{supportKeys:"title",children:(0,c.jsx)(xh,{ref:t})})));var wh=(0,p.forwardRef)((function(e,t){const{placeholder:s}=(0,d.useSelect)((e=>{const{getSettings:t}=e(g.store),{titlePlaceholder:s}=t();return{placeholder:s}}),[]),[n,o]=(0,p.useState)(!1),{title:r,setTitle:i}=yh(),{ref:a}=bh(t),l=mr(_h,{"is-selected":n,"is-raw-text":!0}),u=(0,Ln.decodeEntities)(s)||(0,fs.__)("Add title");return(0,c.jsx)(Hn.TextareaControl,{ref:a,value:r,onChange:function(e){i(e.replace(fh," "))},onFocus:function(){o(!0)},onBlur:function(){o(!1)},label:s,className:l,placeholder:u,hideLabelFromVision:!0,autoComplete:"off",dir:"auto",rows:1,__nextHasNoMarginBottom:!0})}));function Sh({children:e}){const{canTrashPost:t}=(0,d.useSelect)((e=>{const{isEditedPostNew:t,getCurrentPostId:s,getCurrentPostType:n}=e(vc),{canUser:o}=e(u.store),r=n(),i=s(),a=t(),l=!!i&&o("delete",{kind:"postType",name:r,id:i});return{canTrashPost:(!a||i)&&l&&!M.includes(r)}}),[]);return t?e:null}function kh({onActionPerformed:e}){const t=(0,d.useRegistry)(),{isNew:s,isDeleting:n,postId:o,title:r}=(0,d.useSelect)((e=>{const t=e(vc);return{isNew:t.isEditedPostNew(),isDeleting:t.isDeletingPost(),postId:t.getCurrentPostId(),title:t.getCurrentPostAttribute("title")}}),[]),{trashPost:i}=(0,d.useDispatch)(vc),[a,l]=(0,p.useState)(!1);if(s||!o)return null;return(0,c.jsxs)(Sh,{children:[(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,className:"editor-post-trash",isDestructive:!0,variant:"secondary",isBusy:n,"aria-disabled":n,onClick:n?void 0:()=>l(!0),children:(0,fs.__)("Move to trash")}),(0,c.jsx)(Hn.__experimentalConfirmDialog,{isOpen:a,onConfirm:async()=>{l(!1),await i();const s=await t.resolveSelect(vc).getCurrentPost();e?.("move-to-trash",[s])},onCancel:()=>l(!1),confirmButtonText:(0,fs.__)("Move to trash"),size:"small",children:(0,fs.sprintf)((0,fs.__)('Are you sure you want to move "%s" to the trash?'),r)})]})}function Ch({onClose:e}){const{isEditable:t,postSlug:s,postLink:n,permalinkPrefix:o,permalinkSuffix:r,permalink:i}=(0,d.useSelect)((e=>{const t=e(vc).getCurrentPost(),s=e(vc).getCurrentPostType(),n=e(u.store).getPostType(s),o=e(vc).getPermalinkParts(),r=t?._links?.["wp:action-publish"]??!1;return{isEditable:e(vc).isPermalinkEditable()&&r,postSlug:(0,w.safeDecodeURIComponent)(e(vc).getEditedPostSlug()),viewPostLabel:n?.labels.view_item,postLink:t.link,permalinkPrefix:o?.prefix,permalinkSuffix:o?.suffix,permalink:(0,w.safeDecodeURIComponent)(e(vc).getPermalink())}}),[]),{editPost:a}=(0,d.useDispatch)(vc),{createNotice:l}=(0,d.useDispatch)(_s.store),[h,_]=(0,p.useState)(!1),f=(0,m.useCopyToClipboard)(i,(()=>{l("info",(0,fs.__)("Copied Permalink to clipboard."),{isDismissible:!0,type:"snackbar"})})),b="editor-post-url__slug-description-"+(0,m.useInstanceId)(Ch);return(0,c.jsxs)("div",{className:"editor-post-url",children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Slug"),onClose:e}),(0,c.jsxs)(Hn.__experimentalVStack,{spacing:3,children:[t&&(0,c.jsx)("p",{className:"editor-post-url__intro",children:(0,p.createInterpolateElement)((0,fs.__)("<span>Customize the last part of the Permalink.</span> <a>Learn more.</a>"),{span:(0,c.jsx)("span",{id:b}),a:(0,c.jsx)(Hn.ExternalLink,{href:(0,fs.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#permalink")})})}),(0,c.jsxs)("div",{children:[t&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.__experimentalInputControl,{__next40pxDefaultSize:!0,prefix:(0,c.jsx)(Hn.__experimentalInputControlPrefixWrapper,{children:"/"}),suffix:(0,c.jsx)(Hn.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,c.jsx)(Hn.Button,{icon:Tr,ref:f,size:"small",label:"Copy"})}),label:(0,fs.__)("Slug"),hideLabelFromVision:!0,value:h?"":s,autoComplete:"off",spellCheck:"false",type:"text",className:"editor-post-url__input",onChange:e=>{a({slug:e}),e?h&&_(!1):h||_(!0)},onBlur:e=>{a({slug:(0,w.cleanForSlug)(e.target.value)}),h&&_(!1)},"aria-describedby":b}),(0,c.jsxs)("p",{className:"editor-post-url__permalink",children:[(0,c.jsx)("span",{className:"editor-post-url__permalink-visual-label",children:(0,fs.__)("Permalink:")}),(0,c.jsxs)(Hn.ExternalLink,{className:"editor-post-url__link",href:n,target:"_blank",children:[(0,c.jsx)("span",{className:"editor-post-url__link-prefix",children:o}),(0,c.jsx)("span",{className:"editor-post-url__link-slug",children:s}),(0,c.jsx)("span",{className:"editor-post-url__link-suffix",children:r})]})]})]}),!t&&(0,c.jsx)(Hn.ExternalLink,{className:"editor-post-url__link",href:n,target:"_blank",children:n})]})]})]})}function Ph({children:e}){const t=(0,d.useSelect)((e=>{const t=e(vc).getCurrentPostType(),s=e(u.store).getPostType(t);if(!s?.viewable)return!1;if(!e(vc).getCurrentPost().link)return!1;return!!e(vc).getPermalinkParts()}),[]);return t?e:null}function jh(){return Eh()}function Eh(){const e=(0,d.useSelect)((e=>e(vc).getPermalink()),[]);return(0,w.filterURLForDisplay)((0,w.safeDecodeURIComponent)(e))}function Th(){const{isFrontPage:e}=(0,d.useSelect)((e=>{const{getCurrentPostId:t}=e(vc),{getEditedEntityRecord:s,canUser:n}=e(u.store),o=n("read",{kind:"root",name:"site"})?s("root","site"):void 0,r=t();return{isFrontPage:o?.page_on_front===r}}),[]),[t,s]=(0,p.useState)(null),n=(0,p.useMemo)((()=>({anchor:t,placement:"left-start",offset:36,shift:!0})),[t]),o=e?(0,fs.__)("Link"):(0,fs.__)("Slug");return(0,c.jsx)(Ph,{children:(0,c.jsxs)(Rd,{label:o,ref:s,children:[!e&&(0,c.jsx)(Hn.Dropdown,{popoverProps:n,className:"editor-post-url__panel-dropdown",contentClassName:"editor-post-url__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,c.jsx)(Bh,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,c.jsx)(Ch,{onClose:e})}),e&&(0,c.jsx)(Ih,{})]})})}function Bh({isOpen:e,onClick:t}){const{slug:s}=(0,d.useSelect)((e=>({slug:e(vc).getEditedPostSlug()})),[]),n=(0,w.safeDecodeURIComponent)(s);return(0,c.jsx)(Hn.Button,{size:"compact",className:"editor-post-url__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.sprintf)((0,fs.__)("Change link: %s"),n),onClick:t,children:(0,c.jsx)(c.Fragment,{children:n})})}function Ih(){const{postLink:e}=(0,d.useSelect)((e=>{const{getCurrentPost:t}=e(vc);return{postLink:t()?.link}}),[]);return(0,c.jsx)(Hn.ExternalLink,{className:"editor-post-url__front-page-link",href:e,target:"_blank",children:e})}function Nh({render:e}){return e({canEdit:(0,d.useSelect)((e=>e(vc).getCurrentPost()._links?.["wp:action-publish"]??!1))})}var Rh=(0,c.jsx)(L.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z"})});const Dh=window.wp.wordcount;function Ah(){const e=(0,d.useSelect)((e=>e(vc).getEditedPostAttribute("content")),[]),t=(0,fs._x)("words","Word count type. Do not translate!");return(0,c.jsx)("span",{className:"word-count",children:(0,Dh.count)(e,t)})}const Mh=189;function Lh(){const e=(0,d.useSelect)((e=>e(vc).getEditedPostAttribute("content")),[]),t=(0,fs._x)("words","Word count type. Do not translate!"),s=Math.round((0,Dh.count)(e,t)/Mh),n=0===s?(0,p.createInterpolateElement)((0,fs.__)("<span>< 1</span> minute"),{span:(0,c.jsx)("span",{})}):(0,p.createInterpolateElement)((0,fs.sprintf)((0,fs._n)("<span>%s</span> minute","<span>%s</span> minutes",s),s),{span:(0,c.jsx)("span",{})});return(0,c.jsx)("span",{className:"time-to-read",children:n})}function Oh(){const e=(0,d.useSelect)((e=>e(vc).getEditedPostAttribute("content")),[]);return(0,Dh.count)(e,"characters_including_spaces")}var Fh=function({hasOutlineItemsDisabled:e,onRequestClose:t}){const{headingCount:s,paragraphCount:n,numberOfBlocks:o}=(0,d.useSelect)((e=>{const{getGlobalBlockCount:t}=e(g.store);return{headingCount:t("core/heading"),paragraphCount:t("core/paragraph"),numberOfBlocks:t()}}),[]);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"table-of-contents__wrapper",role:"note","aria-label":(0,fs.__)("Document Statistics"),tabIndex:"0",children:(0,c.jsxs)("ul",{role:"list",className:"table-of-contents__counts",children:[(0,c.jsxs)("li",{className:"table-of-contents__count",children:[(0,fs.__)("Words"),(0,c.jsx)(Ah,{})]}),(0,c.jsxs)("li",{className:"table-of-contents__count",children:[(0,fs.__)("Characters"),(0,c.jsx)("span",{className:"table-of-contents__number",children:(0,c.jsx)(Oh,{})})]}),(0,c.jsxs)("li",{className:"table-of-contents__count",children:[(0,fs.__)("Time to read"),(0,c.jsx)(Lh,{})]}),(0,c.jsxs)("li",{className:"table-of-contents__count",children:[(0,fs.__)("Headings"),(0,c.jsx)("span",{className:"table-of-contents__number",children:s})]}),(0,c.jsxs)("li",{className:"table-of-contents__count",children:[(0,fs.__)("Paragraphs"),(0,c.jsx)("span",{className:"table-of-contents__number",children:n})]}),(0,c.jsxs)("li",{className:"table-of-contents__count",children:[(0,fs.__)("Blocks"),(0,c.jsx)("span",{className:"table-of-contents__number",children:o})]})]})}),s>0&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("hr",{}),(0,c.jsx)("h2",{className:"table-of-contents__title",children:(0,fs.__)("Document Outline")}),(0,c.jsx)(ed,{onSelect:t,hasOutlineItemsDisabled:e})]})]})};var Vh=(0,p.forwardRef)((function({hasOutlineItemsDisabled:e,repositionDropdown:t,...s},n){const o=(0,d.useSelect)((e=>!!e(g.store).getBlockCount()),[]);return(0,c.jsx)(Hn.Dropdown,{popoverProps:{placement:t?"right":"bottom"},className:"table-of-contents",contentClassName:"table-of-contents__popover",renderToggle:({isOpen:e,onToggle:t})=>(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,...s,ref:n,onClick:o?t:void 0,icon:Rh,"aria-expanded":e,"aria-haspopup":"true",label:(0,fs.__)("Details"),tooltipPosition:"bottom","aria-disabled":!o}),renderContent:({onClose:t})=>(0,c.jsx)(Fh,{onRequestClose:t,hasOutlineItemsDisabled:e})})}));function Uh(){const{__experimentalGetDirtyEntityRecords:e}=(0,d.useSelect)(u.store);return(0,p.useEffect)((()=>{const t=t=>{if(e().length>0)return t.returnValue=(0,fs.__)("You have unsaved changes. If you proceed, they will be lost."),t.returnValue};return window.addEventListener("beforeunload",t),()=>{window.removeEventListener("beforeunload",t)}}),[e]),null}const Hh=window.wp.serverSideRender;var zh=s.n(Hh);function Gh(e,t,s=[]){const n=(0,p.forwardRef)(((s,n)=>(k()("wp.editor."+e,{since:"5.3",alternative:"wp.blockEditor."+e,version:"6.2"}),(0,c.jsx)(t,{ref:n,...s}))));return s.forEach((s=>{n[s]=Gh(e+"."+s,t[s])})),n}function $h(e,t){return(...s)=>(k()("wp.editor."+e,{since:"5.3",alternative:"wp.blockEditor."+e,version:"6.2"}),t(...s))}const Wh=Gh("RichText",g.RichText,["Content"]);Wh.isEmpty=$h("RichText.isEmpty",g.RichText.isEmpty);const Zh=Gh("Autocomplete",g.Autocomplete),Yh=Gh("AlignmentToolbar",g.AlignmentToolbar),qh=Gh("BlockAlignmentToolbar",g.BlockAlignmentToolbar),Kh=Gh("BlockControls",g.BlockControls,["Slot"]),Qh=Gh("BlockEdit",g.BlockEdit),Xh=Gh("BlockEditorKeyboardShortcuts",g.BlockEditorKeyboardShortcuts),Jh=Gh("BlockFormatControls",g.BlockFormatControls,["Slot"]),eg=Gh("BlockIcon",g.BlockIcon),tg=Gh("BlockInspector",g.BlockInspector),sg=Gh("BlockList",g.BlockList),ng=Gh("BlockMover",g.BlockMover),og=Gh("BlockNavigationDropdown",g.BlockNavigationDropdown),rg=Gh("BlockSelectionClearer",g.BlockSelectionClearer),ig=Gh("BlockSettingsMenu",g.BlockSettingsMenu),ag=Gh("BlockTitle",g.BlockTitle),lg=Gh("BlockToolbar",g.BlockToolbar),cg=Gh("ColorPalette",g.ColorPalette),dg=Gh("ContrastChecker",g.ContrastChecker),ug=Gh("CopyHandler",g.CopyHandler),pg=Gh("DefaultBlockAppender",g.DefaultBlockAppender),mg=Gh("FontSizePicker",g.FontSizePicker),hg=Gh("Inserter",g.Inserter),gg=Gh("InnerBlocks",g.InnerBlocks,["ButtonBlockAppender","DefaultBlockAppender","Content"]),_g=Gh("InspectorAdvancedControls",g.InspectorAdvancedControls,["Slot"]),fg=Gh("InspectorControls",g.InspectorControls,["Slot"]),bg=Gh("PanelColorSettings",g.PanelColorSettings),yg=Gh("PlainText",g.PlainText),xg=Gh("RichTextShortcut",g.RichTextShortcut),vg=Gh("RichTextToolbarButton",g.RichTextToolbarButton),wg=Gh("__unstableRichTextInputEvent",g.__unstableRichTextInputEvent),Sg=Gh("MediaPlaceholder",g.MediaPlaceholder),kg=Gh("MediaUpload",g.MediaUpload),Cg=Gh("MediaUploadCheck",g.MediaUploadCheck),Pg=Gh("MultiSelectScrollIntoView",g.MultiSelectScrollIntoView),jg=Gh("NavigableToolbar",g.NavigableToolbar),Eg=Gh("ObserveTyping",g.ObserveTyping),Tg=Gh("SkipToSelectedBlock",g.SkipToSelectedBlock),Bg=Gh("URLInput",g.URLInput),Ig=Gh("URLInputButton",g.URLInputButton),Ng=Gh("URLPopover",g.URLPopover),Rg=Gh("Warning",g.Warning),Dg=Gh("WritingFlow",g.WritingFlow),Ag=$h("createCustomColorsHOC",g.createCustomColorsHOC),Mg=$h("getColorClassName",g.getColorClassName),Lg=$h("getColorObjectByAttributeValues",g.getColorObjectByAttributeValues),Og=$h("getColorObjectByColorValue",g.getColorObjectByColorValue),Fg=$h("getFontSize",g.getFontSize),Vg=$h("getFontSizeClass",g.getFontSizeClass),Ug=$h("withColorContext",g.withColorContext),Hg=$h("withColors",g.withColors),zg=$h("withFontSizes",g.withFontSizes),Gg=kl,$g=kl;function Wg(e){return k()("wp.editor.cleanForSlug",{since:"12.7",plugin:"Gutenberg",alternative:"wp.url.cleanForSlug"}),(0,w.cleanForSlug)(e)}var Zg=(0,Hn.createSlotFill)(Symbol("EditCanvasContainerSlot"));const Yg="__experimentalMainDashboardButton",{Fill:qg,Slot:Kg}=(0,Hn.createSlotFill)(Yg),Qg=qg;Qg.Slot=()=>{const e=(0,Hn.__experimentalUseSlotFills)(Yg);return(0,c.jsx)(Kg,{bubblesVirtually:!0,fillProps:{length:e?e.length:0}})};var Xg=Qg,Jg=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z"})}),e_=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z"})});const{useHasBlockToolbar:t_}=$(g.privateApis);function s_({isCollapsed:e,onToggle:t}){const{blockSelectionStart:s}=(0,d.useSelect)((e=>({blockSelectionStart:e(g.store).getBlockSelectionStart()})),[]),n=t_(),o=!!s;return(0,p.useEffect)((()=>{s&&t(!1)}),[s,t]),n?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:mr("editor-collapsible-block-toolbar",{"is-collapsed":e||!o}),children:(0,c.jsx)(g.BlockToolbar,{hideDragHandle:!0})}),(0,c.jsx)(Hn.Popover.Slot,{name:"block-toolbar"}),(0,c.jsx)(Hn.Button,{className:"editor-collapsible-block-toolbar__toggle",icon:e?Jg:e_,onClick:()=>{t(!e)},label:e?(0,fs.__)("Show block tools"):(0,fs.__)("Hide block tools"),size:"compact"})]}):null}var n_=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})});var o_=function({className:e,disableBlockTools:t=!1}){const{setIsInserterOpened:s,setIsListViewOpened:n}=(0,d.useDispatch)(vc),{isDistractionFree:o,isInserterOpened:r,isListViewOpen:i,listViewShortcut:a,inserterSidebarToggleRef:l,listViewToggleRef:u,showIconLabels:h}=(0,d.useSelect)((e=>{const{get:t}=e(C.store),{isListViewOpened:s,getEditorMode:n,getInserterSidebarToggleRef:o,getListViewToggleRef:r}=$(e(vc)),{getShortcutRepresentation:i}=e(il.store);return{isInserterOpened:e(vc).isInserterOpened(),isListViewOpen:s(),listViewShortcut:i("core/editor/toggle-list-view"),inserterSidebarToggleRef:o(),listViewToggleRef:r(),showIconLabels:t("core","showIconLabels"),isDistractionFree:t("core","distractionFree"),isVisualMode:"visual"===n()}}),[]),_=(0,m.useViewportMatch)("wide"),f=(0,fs.__)("Document tools"),b=(0,p.useCallback)((()=>n(!i)),[n,i]),y=(0,p.useCallback)((()=>s(!r)),[r,s]),x=(0,fs._x)("Block Inserter","Generic label for block inserter button"),v=r?(0,fs.__)("Close"):(0,fs.__)("Add");return(0,c.jsx)(g.NavigableToolbar,{className:mr("editor-document-tools","edit-post-header-toolbar",e),"aria-label":f,variant:"unstyled",children:(0,c.jsxs)("div",{className:"editor-document-tools__left",children:[!o&&(0,c.jsx)(Hn.ToolbarButton,{ref:l,className:"editor-document-tools__inserter-toggle",variant:"primary",isPressed:r,onMouseDown:e=>{r&&e.preventDefault()},onClick:y,disabled:t,icon:n_,label:h?v:x,showTooltip:!h,"aria-expanded":r}),(_||!h)&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.ToolbarItem,{as:id,showTooltip:!h,variant:h?"tertiary":void 0,size:"compact"}),(0,c.jsx)(Hn.ToolbarItem,{as:rd,showTooltip:!h,variant:h?"tertiary":void 0,size:"compact"}),!o&&(0,c.jsx)(Hn.ToolbarButton,{className:"editor-document-tools__document-overview-toggle",icon:Wi,disabled:t,isPressed:i,label:(0,fs.__)("Document Overview"),onClick:b,shortcut:a,showTooltip:!h,variant:h?"tertiary":void 0,"aria-expanded":i,ref:u})]})]})})},r_=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})});function i_(){const{createNotice:e}=(0,d.useDispatch)(_s.store),{getCurrentPostId:t,getCurrentPostType:s}=(0,d.useSelect)(vc),{getEditedEntityRecord:n}=(0,d.useSelect)(u.store);const o=(0,m.useCopyToClipboard)((function(){const e=n("postType",s(),t());return e?"function"==typeof e.content?e.content(e):e.blocks?(0,x.__unstableSerializeAndClean)(e.blocks):e.content?e.content:void 0:""}),(function(){e("info",(0,fs.__)("All content copied."),{isDismissible:!0,type:"snackbar"})}));return(0,c.jsx)(Hn.MenuItem,{ref:o,children:(0,fs.__)("Copy all blocks")})}const a_=[{value:"visual",label:(0,fs.__)("Visual editor")},{value:"text",label:(0,fs.__)("Code editor")}];var l_=function(){const{shortcut:e,isRichEditingEnabled:t,isCodeEditingEnabled:s,mode:n}=(0,d.useSelect)((e=>({shortcut:e(il.store).getShortcutRepresentation("core/editor/toggle-mode"),isRichEditingEnabled:e(vc).getEditorSettings().richEditingEnabled,isCodeEditingEnabled:e(vc).getEditorSettings().codeEditingEnabled,mode:e(vc).getEditorMode()})),[]),{switchEditorMode:o}=(0,d.useDispatch)(vc);let r=n;t||"visual"!==n||(r="text"),s||"text"!==n||(r="visual");const i=a_.map((n=>(s||"text"!==n.value||(n={...n,disabled:!0}),t||"visual"!==n.value||(n={...n,disabled:!0,info:(0,fs.__)("You can enable the visual editor in your profile settings.")}),n.value===r||n.disabled?n:{...n,shortcut:e})));return(0,c.jsx)(Hn.MenuGroup,{label:(0,fs.__)("Editor"),children:(0,c.jsx)(Hn.MenuItemsChoice,{choices:i,value:r,onSelect:o})})};const{Fill:c_,Slot:d_}=(0,Hn.createSlotFill)("ToolsMoreMenuGroup");c_.Slot=({fillProps:e})=>(0,c.jsx)(d_,{fillProps:e});var u_=c_;const{Fill:p_,Slot:m_}=(0,Hn.createSlotFill)("web"===p.Platform.OS?Symbol("ViewMoreMenuGroup"):"ViewMoreMenuGroup");p_.Slot=({fillProps:e})=>(0,c.jsx)(m_,{fillProps:e});var h_=p_;function g_(){const{openModal:e}=(0,d.useDispatch)(ja),{set:t}=(0,d.useDispatch)(C.store),{toggleDistractionFree:s}=(0,d.useDispatch)(vc),n=(0,d.useSelect)((e=>e(C.store).get("core","showIconLabels")),[]),o=()=>{t("core","distractionFree",!1)};return(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(Hn.DropdownMenu,{icon:r_,label:(0,fs.__)("Options"),popoverProps:{placement:"bottom-end",className:"more-menu-dropdown__content"},toggleProps:{showTooltip:!n,...n&&{variant:"tertiary"},tooltipPosition:"bottom",size:"compact"},children:({onClose:t})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(Hn.MenuGroup,{label:(0,fs._x)("View","noun"),children:[(0,c.jsx)(C.PreferenceToggleMenuItem,{scope:"core",name:"fixedToolbar",onToggle:o,label:(0,fs.__)("Top toolbar"),info:(0,fs.__)("Access all block and document tools in a single place"),messageActivated:(0,fs.__)("Top toolbar activated."),messageDeactivated:(0,fs.__)("Top toolbar deactivated.")}),(0,c.jsx)(C.PreferenceToggleMenuItem,{scope:"core",name:"distractionFree",label:(0,fs.__)("Distraction free"),info:(0,fs.__)("Write with calmness"),handleToggling:!1,onToggle:()=>s({createNotice:!1}),messageActivated:(0,fs.__)("Distraction free mode activated."),messageDeactivated:(0,fs.__)("Distraction free mode deactivated."),shortcut:ll.displayShortcut.primaryShift("\\")}),(0,c.jsx)(C.PreferenceToggleMenuItem,{scope:"core",name:"focusMode",label:(0,fs.__)("Spotlight mode"),info:(0,fs.__)("Focus on one block at a time"),messageActivated:(0,fs.__)("Spotlight mode activated."),messageDeactivated:(0,fs.__)("Spotlight mode deactivated.")}),(0,c.jsx)(h_.Slot,{fillProps:{onClose:t}})]}),(0,c.jsx)(l_,{}),(0,c.jsx)(Na.Slot,{name:"core/plugin-more-menu",label:(0,fs.__)("Panels"),fillProps:{onClick:t}}),(0,c.jsxs)(Hn.MenuGroup,{label:(0,fs.__)("Tools"),children:[(0,c.jsx)(Hn.MenuItem,{onClick:()=>e("editor/keyboard-shortcut-help"),shortcut:ll.displayShortcut.access("h"),children:(0,fs.__)("Keyboard shortcuts")}),(0,c.jsx)(i_,{}),(0,c.jsxs)(Hn.MenuItem,{icon:Fn,href:(0,fs.__)("https://wordpress.org/documentation/article/wordpress-block-editor/"),target:"_blank",rel:"noopener noreferrer",children:[(0,fs.__)("Help"),(0,c.jsx)(Hn.VisuallyHidden,{as:"span",children:(0,fs.__)("(opens in a new tab)")})]}),(0,c.jsx)(u_.Slot,{fillProps:{onClose:t}})]}),(0,c.jsx)(Hn.MenuGroup,{children:(0,c.jsx)(Hn.MenuItem,{onClick:()=>e("editor/preferences"),children:(0,fs.__)("Preferences")})})]})})})}const __="toggle",f_="button";function b_({forceIsDirty:e,setEntitiesSavedStatesCallback:t}){let s;const n=(0,m.useViewportMatch)("medium","<"),{togglePublishSidebar:o}=(0,d.useDispatch)(vc),{hasPublishAction:r,isBeingScheduled:i,isPending:a,isPublished:l,isPublishSidebarEnabled:u,isPublishSidebarOpened:p,isScheduled:h,postStatus:g,postStatusHasChanged:_}=(0,d.useSelect)((e=>({hasPublishAction:!!e(vc).getCurrentPost()?._links?.["wp:action-publish"],isBeingScheduled:e(vc).isEditedPostBeingScheduled(),isPending:e(vc).isCurrentPostPending(),isPublished:e(vc).isCurrentPostPublished(),isPublishSidebarEnabled:e(vc).isPublishSidebarEnabled(),isPublishSidebarOpened:e(vc).isPublishSidebarOpened(),isScheduled:e(vc).isCurrentPostScheduled(),postStatus:e(vc).getEditedPostAttribute("status"),postStatusHasChanged:e(vc).getPostEdits()?.status})),[]);return s=l||_&&!["future","publish"].includes(g)||h&&i||a&&!r&&!n?f_:n||u?__:f_,(0,c.jsx)(Vp,{forceIsDirty:e,isOpen:p,isToggle:s===__,onToggle:o,setEntitiesSavedStatesCallback:t})}function y_(){const{hasLoaded:e,permalink:t,isPublished:s,label:n,showIconLabels:o}=(0,d.useSelect)((e=>{const t=e(vc).getCurrentPostType(),s=e(u.store).getPostType(t),{get:n}=e(C.store);return{permalink:e(vc).getPermalink(),isPublished:e(vc).isCurrentPostPublished(),label:s?.labels.view_item,hasLoaded:!!s,showIconLabels:n("core","showIconLabels")}}),[]);return s&&t&&e?(0,c.jsx)(Hn.Button,{icon:Fn,label:n||(0,fs.__)("View post"),href:t,target:"_blank",showTooltip:!o,size:"compact"}):null}var x_=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M20.5 16h-.7V8c0-1.1-.9-2-2-2H6.2c-1.1 0-2 .9-2 2v8h-.7c-.8 0-1.5.7-1.5 1.5h20c0-.8-.7-1.5-1.5-1.5zM5.7 8c0-.3.2-.5.5-.5h11.6c.3 0 .5.2.5.5v7.6H5.7V8z"})}),v_=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M15 4H9c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h6c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h6c.3 0 .5.2.5.5v12zm-4.5-.5h2V16h-2v1.5z"})}),w_=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M17 4H7c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v12zm-7.5-.5h4V16h-4v1.5z"})});function S_({forceIsAutosaveable:e,disabled:t}){const{deviceType:s,homeUrl:n,isTemplate:o,isViewable:r,showIconLabels:i,isTemplateHidden:a,templateId:l}=(0,d.useSelect)((e=>{const{getDeviceType:t,getCurrentPostType:s,getCurrentTemplateId:n,getRenderingMode:o}=e(vc),{getEntityRecord:r,getPostType:i}=e(u.store),{get:a}=e(C.store),l=s();return{deviceType:t(),homeUrl:r("root","__unstableBase")?.home,isTemplate:"wp_template"===l,isViewable:i(l)?.viewable??!1,showIconLabels:a("core","showIconLabels"),isTemplateHidden:"post-only"===o(),templateId:n()}}),[]),{setDeviceType:p,setRenderingMode:h,setDefaultRenderingMode:_}=$((0,d.useDispatch)(vc)),{resetZoomLevel:f}=$((0,d.useDispatch)(g.store)),b=e=>{p(e),f()};if((0,m.useViewportMatch)("medium","<"))return null;const y={className:"editor-preview-dropdown__toggle",iconPosition:"right",size:"compact",showTooltip:!i,disabled:t,accessibleWhenDisabled:t},x={"aria-label":(0,fs.__)("View options")},v={desktop:x_,mobile:v_,tablet:w_},w=[{value:"Desktop",label:(0,fs.__)("Desktop"),icon:x_},{value:"Tablet",label:(0,fs.__)("Tablet"),icon:w_},{value:"Mobile",label:(0,fs.__)("Mobile"),icon:v_}];return(0,c.jsx)(Hn.DropdownMenu,{className:mr("editor-preview-dropdown",`editor-preview-dropdown--${s.toLowerCase()}`),popoverProps:{placement:"bottom-end"},toggleProps:y,menuProps:x,icon:v[s.toLowerCase()],label:(0,fs.__)("View"),disableOpenOnArrowDown:t,children:({onClose:t})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.MenuGroup,{children:(0,c.jsx)(Hn.MenuItemsChoice,{choices:w,value:s,onSelect:b})}),o&&(0,c.jsx)(Hn.MenuGroup,{children:(0,c.jsxs)(Hn.MenuItem,{href:n,target:"_blank",icon:Fn,onClick:t,children:[(0,fs.__)("View site"),(0,c.jsx)(Hn.VisuallyHidden,{as:"span",children:(0,fs.__)("(opens in a new tab)")})]})}),!o&&!!l&&(0,c.jsx)(Hn.MenuGroup,{children:(0,c.jsx)(Hn.MenuItem,{icon:a?void 0:zn,isSelected:!a,role:"menuitemcheckbox",onClick:()=>{const e=a?"template-locked":"post-only";h(e),_(e),f()},children:(0,fs.__)("Show template")})}),r&&(0,c.jsx)(Hn.MenuGroup,{children:(0,c.jsx)(Mp,{className:"editor-preview-dropdown__button-external",role:"menuitem",forceIsAutosaveable:e,"aria-label":(0,fs.__)("Preview in new tab"),textContent:(0,c.jsxs)(c.Fragment,{children:[(0,fs.__)("Preview in new tab"),(0,c.jsx)(Hn.Icon,{icon:Fn})]}),onPreview:t})}),(0,c.jsx)(Na.Slot,{name:"core/plugin-preview-menu",fillProps:{onClick:t}})]})})}var k_=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fill:"none",d:"M5.75 12.75V18.25H11.25M12.75 5.75H18.25V11.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"square"})});var C_=({disabled:e})=>{const{isZoomOut:t,showIconLabels:s,isDistractionFree:n}=(0,d.useSelect)((e=>({isZoomOut:$(e(g.store)).isZoomOut(),showIconLabels:e(C.store).get("core","showIconLabels"),isDistractionFree:e(C.store).get("core","distractionFree")}))),{resetZoomLevel:o,setZoomLevel:r}=$((0,d.useDispatch)(g.store)),{registerShortcut:i,unregisterShortcut:a}=(0,d.useDispatch)(il.store);(0,p.useEffect)((()=>(i({name:"core/editor/zoom",category:"global",description:(0,fs.__)("Enter or exit zoom out."),keyCombination:{modifier:(0,ll.isAppleOS)()?"primaryShift":"secondary",character:"0"}}),()=>{a("core/editor/zoom")})),[i,a]),(0,il.useShortcut)("core/editor/zoom",(()=>{t?o():r("auto-scaled")}),{isDisabled:n});return(0,c.jsx)(Hn.Button,{accessibleWhenDisabled:!0,disabled:e,onClick:()=>{t?o():r("auto-scaled")},icon:k_,label:(0,fs.__)("Zoom Out"),isPressed:t,size:"compact",showTooltip:!s,className:"editor-zoom-out-toggle"})};const P_={distractionFreeDisabled:{y:"-50px"},distractionFreeHover:{y:0},distractionFreeHidden:{y:"-50px"},visible:{y:0},hidden:{y:0}},j_={distractionFreeDisabled:{x:"-100%"},distractionFreeHover:{x:0},distractionFreeHidden:{x:"-100%"},visible:{x:0},hidden:{x:0}};var E_=function({customSaveButton:e,forceIsDirty:t,forceDisableBlockTools:s,setEntitiesSavedStatesCallback:n,title:o}){const r=(0,m.useViewportMatch)("large"),i=(0,m.useViewportMatch)("medium"),a=(0,m.useMediaQuery)("(max-width: 403px)"),{postType:l,isTextEditor:u,isPublishSidebarOpened:h,showIconLabels:_,hasFixedToolbar:f,hasBlockSelection:b,hasSectionRootClientId:y}=(0,d.useSelect)((e=>{const{get:t}=e(C.store),{getEditorMode:s,getCurrentPostType:n,isPublishSidebarOpened:o}=e(vc),{getBlockSelectionStart:r,getSectionRootClientId:i}=$(e(g.store));return{postType:n(),isTextEditor:"text"===s(),isPublishSidebarOpened:o(),showIconLabels:t("core","showIconLabels"),hasFixedToolbar:t("core","fixedToolbar"),hasBlockSelection:!!r(),hasSectionRootClientId:!!i()}}),[]),x=["post","page","wp_template"].includes(l)&&y,v=[R,I,N].includes(l)||s,[w,S]=(0,p.useState)(!0),k=!a&&(!f||f&&(!b||w)),P=(()=>{const e=(0,Hn.__experimentalUseSlotFills)(Yg);return Boolean(e&&e.length)})();return(0,c.jsxs)("div",{className:"editor-header edit-post-header",children:[P&&(0,c.jsx)(Hn.__unstableMotion.div,{className:"editor-header__back-button",variants:j_,transition:{type:"tween"},children:(0,c.jsx)(Xg.Slot,{})}),(0,c.jsxs)(Hn.__unstableMotion.div,{variants:P_,className:"editor-header__toolbar",transition:{type:"tween"},children:[(0,c.jsx)(o_,{disableBlockTools:s||u}),f&&i&&(0,c.jsx)(s_,{isCollapsed:w,onToggle:S})]}),k&&(0,c.jsx)(Hn.__unstableMotion.div,{className:"editor-header__center",variants:P_,transition:{type:"tween"},children:(0,c.jsx)(Gc,{title:o})}),(0,c.jsxs)(Hn.__unstableMotion.div,{variants:P_,transition:{type:"tween"},className:"editor-header__settings",children:[!e&&!h&&(0,c.jsx)(nh,{forceIsDirty:t}),(0,c.jsx)(y_,{}),(0,c.jsx)(S_,{forceIsAutosaveable:t,disabled:v}),(0,c.jsx)(Mp,{className:"editor-header__post-preview-button",forceIsAutosaveable:t}),r&&x&&(0,c.jsx)(C_,{disabled:s}),(r||!_)&&(0,c.jsx)(Ma.Slot,{scope:"core"}),!e&&(0,c.jsx)(b_,{forceIsDirty:t,setEntitiesSavedStatesCallback:n}),e,(0,c.jsx)(g_,{})]})]})};const{PrivateInserterLibrary:T_}=$(g.privateApis);function B_(){const{blockSectionRootClientId:e,inserterSidebarToggleRef:t,inserter:s,showMostUsedBlocks:n,sidebarIsOpened:o}=(0,d.useSelect)((e=>{const{getInserterSidebarToggleRef:t,getInserter:s,isPublishSidebarOpened:n}=$(e(vc)),{getBlockRootClientId:o,isZoomOut:r,getSectionRootClientId:i}=$(e(g.store)),{get:a}=e(C.store),{getActiveComplementaryArea:l}=e(ja);return{inserterSidebarToggleRef:t(),inserter:s(),showMostUsedBlocks:a("core","mostUsedBlocks"),blockSectionRootClientId:(()=>{if(r()){const e=i();if(e)return e}return o()})(),sidebarIsOpened:!(!l("core")&&!n())}}),[]),{setIsInserterOpened:r}=(0,d.useDispatch)(vc),{disableComplementaryArea:i}=(0,d.useDispatch)(ja),a=(0,m.useViewportMatch)("medium","<"),l=(0,p.useRef)(),u=(0,p.useCallback)((()=>{r(!1),t.current?.focus()}),[t,r]),h=(0,p.useCallback)((e=>{e.keyCode!==ll.ESCAPE||e.defaultPrevented||(e.preventDefault(),u())}),[u]),_=(0,c.jsx)("div",{className:"editor-inserter-sidebar__content",children:(0,c.jsx)(T_,{showMostUsedBlocks:n,showInserterHelpPanel:!0,shouldFocusBlock:a,rootClientId:e,onSelect:s.onSelect,__experimentalInitialTab:s.tab,__experimentalInitialCategory:s.category,__experimentalFilterValue:s.filterValue,onPatternCategorySelection:o?()=>i("core"):void 0,ref:l,onClose:u})});return(0,c.jsx)("div",{onKeyDown:h,className:"editor-inserter-sidebar",children:_})}function I_(){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("div",{className:"editor-list-view-sidebar__outline",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(Hn.__experimentalText,{children:(0,fs.__)("Characters:")}),(0,c.jsx)(Hn.__experimentalText,{children:(0,c.jsx)(Oh,{})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(Hn.__experimentalText,{children:(0,fs.__)("Words:")}),(0,c.jsx)(Ah,{})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(Hn.__experimentalText,{children:(0,fs.__)("Time to read:")}),(0,c.jsx)(Lh,{})]})]}),(0,c.jsx)(ed,{})]})}const{TabbedSidebar:N_}=$(g.privateApis);function R_(){const{setIsListViewOpened:e}=(0,d.useDispatch)(vc),{getListViewToggleRef:t}=$((0,d.useSelect)(vc)),s=(0,m.useFocusOnMount)("firstElement"),n=(0,p.useCallback)((()=>{e(!1),t().current?.focus()}),[t,e]),o=(0,p.useCallback)((e=>{e.keyCode!==ll.ESCAPE||e.defaultPrevented||(e.preventDefault(),n())}),[n]),[r,i]=(0,p.useState)(null),[a,l]=(0,p.useState)("list-view"),u=(0,p.useRef)(),h=(0,p.useRef)(),_=(0,p.useRef)(),f=(0,m.useMergeRefs)([s,_,i]);const b=(0,p.useCallback)((()=>{u.current.contains(u.current.ownerDocument.activeElement)?n():function(e){const t=Uc.focus.tabbable.find(h.current)[0];if("list-view"===e){const e=Uc.focus.tabbable.find(_.current)[0];(u.current.contains(e)?e:t).focus()}else t.focus()}(a)}),[n,a]);return(0,il.useShortcut)("core/editor/toggle-list-view",b),(0,c.jsx)("div",{className:"editor-list-view-sidebar",onKeyDown:o,ref:u,children:(0,c.jsx)(N_,{tabs:[{name:"list-view",title:(0,fs._x)("List View","Post overview"),panel:(0,c.jsx)("div",{className:"editor-list-view-sidebar__list-view-container",children:(0,c.jsx)("div",{className:"editor-list-view-sidebar__list-view-panel-content",children:(0,c.jsx)(g.__experimentalListView,{dropZoneElement:r})})}),panelRef:f},{name:"outline",title:(0,fs._x)("Outline","Post overview"),panel:(0,c.jsx)("div",{className:"editor-list-view-sidebar__list-view-container",children:(0,c.jsx)(I_,{})})}],onClose:n,onSelect:e=>l(e),defaultTabId:"list-view",ref:h,closeButtonLabel:(0,fs.__)("Close")})})}const{Fill:D_,Slot:A_}=(0,Hn.createSlotFill)("ActionsPanel");function M_({setEntitiesSavedStatesCallback:e,closeEntitiesSavedStates:t,isEntitiesSavedStatesOpen:s,forceIsDirtyPublishPanel:n}){const{closePublishSidebar:o,togglePublishSidebar:r}=(0,d.useDispatch)(vc),{publishSidebarOpened:i,isPublishable:a,isDirty:l,hasOtherEntitiesChanges:u}=(0,d.useSelect)((e=>{const{isPublishSidebarOpened:t,isEditedPostPublishable:s,isCurrentPostPublished:n,isEditedPostDirty:o,hasNonPostEntityChanges:r}=e(vc),i=r();return{publishSidebarOpened:t(),isPublishable:!n()&&s(),isDirty:i||o(),hasOtherEntitiesChanges:i}}),[]),m=(0,p.useCallback)((()=>e(!0)),[]);let h;return h=i?(0,c.jsx)(Ym,{onClose:o,forceIsDirty:n,PrePublishExtension:Tu.Slot,PostPublishExtension:vu.Slot}):a&&!u?(0,c.jsx)("div",{className:"editor-layout__toggle-publish-panel",children:(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:r,"aria-expanded":!1,children:(0,fs.__)("Open publish panel")})}):(0,c.jsx)("div",{className:"editor-layout__toggle-entities-saved-states-panel",children:(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:m,"aria-expanded":!1,"aria-haspopup":"dialog",disabled:!l,accessibleWhenDisabled:!0,children:(0,fs.__)("Open save panel")})}),(0,c.jsxs)(c.Fragment,{children:[s&&(0,c.jsx)(yd,{close:t,renderDialog:!0}),(0,c.jsx)(A_,{bubblesVirtually:!0}),!s&&h]})}function L_({autoFocus:e=!1}){const{switchEditorMode:t}=(0,d.useDispatch)(vc),{shortcut:s,isRichEditingEnabled:n}=(0,d.useSelect)((e=>{const{getEditorSettings:t}=e(vc),{getShortcutRepresentation:s}=e(il.store);return{shortcut:s("core/editor/toggle-mode"),isRichEditingEnabled:t().richEditingEnabled}}),[]),o=(0,p.useRef)();return(0,p.useEffect)((()=>{e||o?.current?.focus()}),[e]),(0,c.jsxs)("div",{className:"editor-text-editor",children:[n&&(0,c.jsxs)("div",{className:"editor-text-editor__toolbar",children:[(0,c.jsx)("h2",{children:(0,fs.__)("Editing code")}),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>t("visual"),shortcut:s,children:(0,fs.__)("Exit code editor")})]}),(0,c.jsxs)("div",{className:"editor-text-editor__body",children:[(0,c.jsx)(wh,{ref:o}),(0,c.jsx)(gh,{})]})]})}function O_({contentRef:e}){const{onNavigateToEntityRecord:t,templateId:s}=(0,d.useSelect)((e=>{const{getEditorSettings:t,getCurrentTemplateId:s}=e(vc);return{onNavigateToEntityRecord:t().onNavigateToEntityRecord,templateId:s()}}),[]),n=(0,d.useSelect)((e=>!!e(u.store).canUser("create",{kind:"postType",name:"wp_template"})),[]),[o,r]=(0,p.useState)(!1);return(0,p.useEffect)((()=>{const t=e=>{n&&e.target.classList.contains("is-root-container")&&"core/template-part"!==e.target.dataset?.type&&(e.defaultPrevented||(e.preventDefault(),r(!0)))},s=e.current;return s?.addEventListener("dblclick",t),()=>{s?.removeEventListener("dblclick",t)}}),[e,n]),n?(0,c.jsx)(Hn.__experimentalConfirmDialog,{isOpen:o,confirmButtonText:(0,fs.__)("Edit template"),onConfirm:()=>{r(!1),t({postId:s,postType:"wp_template"})},onCancel:()=>r(!1),size:"medium",children:(0,fs.__)("You’ve tried to select a block that is part of a template that may be used elsewhere on your site. Would you like to edit the template?")}):null}function F_({direction:e,resizeWidthBy:t}){const s=`resizable-editor__resize-help-${e}`;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.Tooltip,{text:(0,fs.__)("Drag to resize"),children:(0,c.jsx)(Hn.__unstableMotion.button,{className:`editor-resizable-editor__resize-handle is-${e}`,"aria-label":(0,fs.__)("Drag to resize"),"aria-describedby":s,onKeyDown:function(s){const{keyCode:n}=s;n!==ll.LEFT&&n!==ll.RIGHT||(s.preventDefault(),"left"===e&&n===ll.LEFT||"right"===e&&n===ll.RIGHT?t(20):("left"===e&&n===ll.RIGHT||"right"===e&&n===ll.LEFT)&&t(-20))},variants:{active:{opacity:1,scaleY:1.3}},whileFocus:"active",whileHover:"active",whileTap:"active",role:"separator","aria-orientation":"vertical"},"handle")}),(0,c.jsx)(Hn.VisuallyHidden,{id:s,children:(0,fs.__)("Use left and right arrow keys to resize the canvas.")})]})}const V_={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 U_=function({className:e,enableResizing:t,height:s,children:n}){const[o,r]=(0,p.useState)("100%"),i=(0,p.useRef)(),a=(0,p.useCallback)((e=>{i.current&&r(i.current.offsetWidth+e)}),[]);return(0,c.jsx)(Hn.ResizableBox,{className:mr("editor-resizable-editor",e,{"is-resizable":t}),ref:e=>{i.current=e?.resizable},size:{width:t?o:"100%",height:t&&s?s:"100%"},onResizeStop:(e,t,s)=>{r(s.style.width)},minWidth:300,maxWidth:"100%",maxHeight:"100%",enable:{left:t,right:t},showHandle:t,resizeRatio:2,handleComponent:{left:(0,c.jsx)(F_,{direction:"left",resizeWidthBy:a}),right:(0,c.jsx)(F_,{direction:"right",resizeWidthBy:a})},handleClasses:void 0,handleStyles:{left:V_,right:V_},children:n})};function H_(e,t,s){return Math.min(Math.max(e,t),s)}function z_(e,t,s){const n=e-H_(e,s.left,s.right),o=t-H_(t,s.top,s.bottom);return Math.sqrt(n*n+o*o)}function G_({isEnabled:e=!0}={}){const{getEnabledClientIdsTree:t,getBlockName:s,getBlockOrder:n}=$((0,d.useSelect)(g.store)),{selectBlock:o}=(0,d.useDispatch)(g.store);return(0,m.useRefEffect)((r=>{if(!e)return;const i=e=>{(e.target===r||e.target.classList.contains("is-root-container"))&&((e,i)=>{const a=t().flatMap((({clientId:e})=>{const t=s(e);if("core/template-part"===t)return[];if("core/post-content"===t){const t=n(e);if(t.length)return t}return[e]}));let l=1/0,c=null;for(const t of a){const s=r.querySelector(`[data-block="${t}"]`);if(!s)continue;const n=z_(e,i,s.getBoundingClientRect());n<l&&n<500&&(l=n,c=t)}c&&o(c)})(e.clientX,e.clientY)};return r.addEventListener("click",i),()=>r.removeEventListener("click",i)}),[e])}function $_(){const{getSettings:e,isZoomOut:t}=$((0,d.useSelect)(g.store)),{resetZoomLevel:s}=$((0,d.useDispatch)(g.store));return(0,m.useRefEffect)((n=>{function o(n){if(t()&&!n.defaultPrevented){n.preventDefault();const{__experimentalSetIsInserterOpened:t}=e();"function"==typeof t&&t(!1),s()}}return n.addEventListener("dblclick",o),()=>{n.removeEventListener("dblclick",o)}}),[e,t,s])}const{LayoutStyle:W_,useLayoutClasses:Z_,useLayoutStyles:Y_,ExperimentalBlockCanvas:q_,useFlashEditableBlocks:K_}=$(g.privateApis),Q_=[N,B,R,I];function X_(e){for(let t=0;t<e.length;t++){if("core/post-content"===e[t].name)return e[t].attributes;if(e[t].innerBlocks.length){const s=X_(e[t].innerBlocks);if(s)return s}}}function J_(e){for(let t=0;t<e.length;t++)if("core/post-content"===e[t].name)return!0;return!1}var ef=function({autoFocus:e,styles:t,disableIframe:s=!1,iframeProps:n,contentRef:o,className:r}){const i=(0,m.useViewportMatch)("small","<"),{renderingMode:a,postContentAttributes:l,editedPostTemplate:h={},wrapperBlockName:_,wrapperUniqueId:f,deviceType:b,isFocusedEntity:y,isDesignPostType:v,postType:w,isPreview:S,canvasMinHeight:k}=(0,d.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:s,getCurrentTemplateId:n,getEditorSettings:o,getRenderingMode:r,getDeviceType:i,getCanvasMinHeight:a}=$(e(vc)),{getPostType:l,getEditedEntityRecord:c}=e(u.store),d=s(),p=r();let m;d===N?m="core/block":"post-only"===p&&(m="core/post-content");const h=o(),g=h.supportsTemplateMode,_=l(d),f=n(),b=f?c("postType",B,f):void 0;return{renderingMode:p,postContentAttributes:h.postContentAttributes,isDesignPostType:Q_.includes(d),editedPostTemplate:_?.viewable&&g?b:void 0,wrapperBlockName:m,wrapperUniqueId:t(),deviceType:i(),isFocusedEntity:!!h.onNavigateToPreviousEntityRecord,postType:d,isPreview:h.isPreviewMode,canvasMinHeight:a()}}),[]),{isCleanNewPost:C}=(0,d.useSelect)(vc),{hasRootPaddingAwareAlignments:P,themeHasDisabledLayoutStyles:j,themeSupportsLayout:E,isZoomedOut:T}=(0,d.useSelect)((e=>{const{getSettings:t,isZoomOut:s}=$(e(g.store)),n=t();return{themeHasDisabledLayoutStyles:n.disableLayoutStyles,themeSupportsLayout:n.supportsLayout,hasRootPaddingAwareAlignments:n.__experimentalFeatures?.useRootPaddingAwareAlignments,isZoomedOut:s()}}),[]),D=(0,p.useRef)(),A=(0,g.__experimentalUseResizeCanvas)(b),[M]=(0,g.useSettings)("layout"),L=(0,p.useMemo)((()=>"post-only"!==a||v?{type:"default"}:E?{...M,type:"constrained"}:{type:"default"}),[a,E,M,v]),O=(0,p.useMemo)((()=>{if(!h?.content&&!h?.blocks&&l)return l;if(h?.blocks)return X_(h?.blocks);const e="string"==typeof h?.content?h?.content:"";return X_((0,x.parse)(e))||{}}),[h?.content,h?.blocks,l]),F=(0,p.useMemo)((()=>{if(!h?.content&&!h?.blocks)return!1;if(h?.blocks)return J_(h?.blocks);const e="string"==typeof h?.content?h?.content:"";return J_((0,x.parse)(e))||!1}),[h?.content,h?.blocks]),{layout:V={},align:U=""}=O||{},H=Z_(O,"core/post-content"),z=mr({"is-layout-flow":!E},E&&H,U&&`align${U}`),G=Y_(O,"core/post-content",".block-editor-block-list__layout.is-root-container"),W=(0,p.useMemo)((()=>V&&("constrained"===V?.type||V?.inherit||V?.contentSize||V?.wideSize)?{...M,...V,type:"constrained"}:{...M,...V,type:"default"}),[V?.type,V?.inherit,V?.contentSize,V?.wideSize,M]),Z=l?W:L,Y="default"!==Z?.type||F?Z:L,q=(0,g.__unstableUseTypingObserver)(),K=(0,p.useRef)();(0,p.useEffect)((()=>{e&&C()&&K?.current?.focus()}),[e,C]);const Q=[R,I,N].includes(w)&&!S&&!i&&!T,X=(0,p.useMemo)((()=>{if(!D.current)return k;const{ownerDocument:e}=D.current,t=e.documentElement.scrollTop||e.body.scrollTop;return k+t}),[k]),J=(0,p.useMemo)((()=>[...t??[],{css:`:where(.block-editor-iframe__body){display:flow-root;${X?`min-height:${X}px;`:""}}.is-root-container{display:flow-root;${Q?"min-height:0!important;":""}}\n\t\t\t\t${Q?".block-editor-iframe__html{background:var(--wp-editor-canvas-background);display:flex;align-items:center;justify-content:center;min-height:100vh;}.block-editor-iframe__body{width:100%;}":""}`}]),[t,Q,X]),ee=(0,g.__unstableUseTypewriter)();return o=(0,m.useMergeRefs)([D,o,"post-only"===a?ee:null,K_({isEnabled:"template-locked"===a}),G_({isEnabled:"template-locked"===a}),$_()]),(0,c.jsx)("div",{className:mr("editor-visual-editor","edit-post-visual-editor",r,{"has-padding":y||Q,"is-resizable":Q,"is-iframed":!s}),children:(0,c.jsx)(U_,{enableResizing:Q,height:"100%",children:(0,c.jsxs)(q_,{shouldIframe:!s,contentRef:o,styles:J,height:"100%",iframeProps:{...n,style:{...n?.style,...A}},children:[E&&!j&&"post-only"===a&&!v&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(W_,{selector:".editor-visual-editor__post-title-wrapper",layout:L}),(0,c.jsx)(W_,{selector:".block-editor-block-list__layout.is-root-container",layout:Y}),U&&(0,c.jsx)(W_,{css:".is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);}\n\t\t.is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}"}),G&&(0,c.jsx)(W_,{layout:W,css:G})]}),"post-only"===a&&!v&&(0,c.jsx)("div",{className:mr("editor-visual-editor__post-title-wrapper","edit-post-visual-editor__post-title-wrapper",{"has-global-padding":P}),contentEditable:!1,ref:q,style:{marginTop:"4rem"},children:(0,c.jsx)(vh,{ref:K})}),(0,c.jsxs)(g.RecursionProvider,{blockName:_,uniqueId:f,children:[(0,c.jsx)(g.BlockList,{className:mr("is-"+b.toLowerCase()+"-preview","post-only"!==a||v?"wp-site-blocks":`${z} wp-block-post-content`,{"has-global-padding":"post-only"===a&&!v&&P}),layout:Z,dropZoneElement:s?D.current:D.current?.parentNode,__unstableDisableDropZone:"template-locked"===a}),"template-locked"===a&&(0,c.jsx)(O_,{contentRef:D})]})]})})})};const tf={header:(0,fs.__)("Editor top bar"),body:(0,fs.__)("Editor content"),sidebar:(0,fs.__)("Editor settings"),actions:(0,fs.__)("Editor publish"),footer:(0,fs.__)("Editor footer")};function sf({className:e,styles:t,children:s,forceIsDirty:n,contentRef:o,disableIframe:r,autoFocus:i,customSaveButton:a,customSavePanel:l,forceDisableBlockTools:u,title:h,iframeProps:_}){const{mode:f,isInserterOpened:b,isListViewOpened:y,isDistractionFree:x,isPreviewMode:v,showBlockBreadcrumbs:w,documentLabel:S}=(0,d.useSelect)((e=>{const{get:t}=e(C.store),{getEditorSettings:s,getPostTypeLabel:n}=e(vc),o=s(),r=n();let i=e(vc).getEditorMode();return o.richEditingEnabled||"visual"!==i||(i="text"),o.codeEditingEnabled||"text"!==i||(i="visual"),{mode:i,isInserterOpened:e(vc).isInserterOpened(),isListViewOpened:e(vc).isListViewOpened(),isDistractionFree:t("core","distractionFree"),isPreviewMode:o.isPreviewMode,showBlockBreadcrumbs:t("core","showBlockBreadcrumbs"),documentLabel:r||(0,fs._x)("Document","noun, breadcrumb")}}),[]),k=(0,m.useViewportMatch)("medium"),P=y?(0,fs.__)("Document Overview"):(0,fs.__)("Block Library"),[j,E]=(0,p.useState)(!1),T=(0,p.useCallback)((e=>{"function"==typeof j&&j(e),E(!1)}),[j]);return(0,c.jsx)(Wa,{isDistractionFree:x,className:mr("editor-editor-interface",e,{"is-entity-save-view-open":!!j,"is-distraction-free":x&&!v}),labels:{...tf,secondarySidebar:P},header:!v&&(0,c.jsx)(E_,{forceIsDirty:n,setEntitiesSavedStatesCallback:E,customSaveButton:a,forceDisableBlockTools:u,title:h}),editorNotices:(0,c.jsx)(ld,{}),secondarySidebar:!v&&"visual"===f&&(b&&(0,c.jsx)(B_,{})||y&&(0,c.jsx)(R_,{})),sidebar:!v&&!x&&(0,c.jsx)(Va.Slot,{scope:"core"}),content:(0,c.jsxs)(c.Fragment,{children:[!x&&!v&&(0,c.jsx)(ld,{}),(0,c.jsx)(Zg.Slot,{children:([e])=>e||(0,c.jsxs)(c.Fragment,{children:[!v&&"text"===f&&(0,c.jsx)(L_,{autoFocus:i}),!v&&!k&&"visual"===f&&(0,c.jsx)(g.BlockToolbar,{hideDragHandle:!0}),(v||"visual"===f)&&(0,c.jsx)(ef,{styles:t,contentRef:o,disableIframe:r,autoFocus:i,iframeProps:_}),s]})})]}),footer:!v&&!x&&k&&w&&"visual"===f&&(0,c.jsx)(g.BlockBreadcrumb,{rootLabelText:S}),actions:v?void 0:l||(0,c.jsx)(M_,{closeEntitiesSavedStates:T,isEntitiesSavedStatesOpen:j,setEntitiesSavedStatesCallback:E,forceIsDirtyPublishPanel:n})})}const{OverridesPanel:nf}=$(ao.privateApis);function of(){return(0,d.useSelect)((e=>"wp_block"===e(vc).getCurrentPostType()),[])?(0,c.jsx)(nf,{}):null}function rf(e){return"string"==typeof e.title?(0,Ln.decodeEntities)(e.title):e.title&&"rendered"in e.title?(0,Ln.decodeEntities)(e.title.rendered):e.title&&"raw"in e.title?(0,Ln.decodeEntities)(e.title.raw):""}const af=({items:e,closeModal:t})=>{const[s]=e,n=rf(s),{showOnFront:o,currentHomePage:r,isSaving:i}=(0,d.useSelect)((e=>{const{getEntityRecord:t,isSavingEntityRecord:s}=e(u.store),n=t("root","site"),o=t("postType","page",n?.page_on_front);return{showOnFront:n?.show_on_front,currentHomePage:o,isSaving:s("root","site")}})),{saveEntityRecord:a}=(0,d.useDispatch)(u.store),{createSuccessNotice:l,createErrorNotice:p}=(0,d.useDispatch)(_s.store);let m="";"posts"===o?m=(0,fs.__)("This will replace the current homepage which is set to display latest posts."):r&&(m=(0,fs.sprintf)((0,fs.__)('This will replace the current homepage: "%s"'),rf(r)));const h=(0,fs.sprintf)((0,fs.__)('Set "%1$s" as the site homepage? %2$s'),n,m).trim(),g=(0,fs.__)("Set homepage");return(0,c.jsx)("form",{onSubmit:async function(e){e.preventDefault();try{await a("root","site",{page_on_front:s.id,show_on_front:"page"}),l((0,fs.__)("Homepage updated."),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,fs.__)("An error occurred while setting the homepage.");p(t,{type:"snackbar"})}finally{t?.()}},children:(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"5",children:[(0,c.jsx)(Hn.__experimentalText,{children:h}),(0,c.jsxs)(Hn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},disabled:i,accessibleWhenDisabled:!0,children:(0,fs.__)("Cancel")}),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",disabled:i,accessibleWhenDisabled:!0,children:g})]})]})})},lf=({items:e,closeModal:t})=>{const[s]=e,n=rf(s),{currentPostsPage:o,isPageForPostsSet:r,isSaving:i}=(0,d.useSelect)((e=>{const{getEntityRecord:t,isSavingEntityRecord:s}=e(u.store),n=t("root","site");return{currentPostsPage:t("postType","page",n?.page_for_posts),isPageForPostsSet:0!==n?.page_for_posts,isSaving:s("root","site")}})),{saveEntityRecord:a}=(0,d.useDispatch)(u.store),{createSuccessNotice:l,createErrorNotice:p}=(0,d.useDispatch)(_s.store);const m=r&&o?(0,fs.sprintf)((0,fs.__)('This will replace the current posts page: "%s"'),rf(o)):(0,fs.__)("This page will show the latest posts."),h=(0,fs.sprintf)((0,fs.__)('Set "%1$s" as the posts page? %2$s'),n,m),g=(0,fs.__)("Set posts page");return(0,c.jsx)("form",{onSubmit:async function(e){e.preventDefault();try{await a("root","site",{page_for_posts:s.id,show_on_front:"page"}),l((0,fs.__)("Posts page updated."),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,fs.__)("An error occurred while setting the posts page.");p(t,{type:"snackbar"})}finally{t?.()}},children:(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"5",children:[(0,c.jsx)(Hn.__experimentalText,{children:h}),(0,c.jsxs)(Hn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},disabled:i,accessibleWhenDisabled:!0,children:(0,fs.__)("Cancel")}),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",disabled:i,accessibleWhenDisabled:!0,children:g})]})]})})};function cf({postType:e,onActionPerformed:t,context:s}){const{defaultActions:n}=(0,d.useSelect)((t=>{const{getEntityActions:s}=$(t(vc));return{defaultActions:s("postType",e)}}),[e]),o=(0,d.useSelect)((t=>{if("page"!==e)return!1;const{getDefaultTemplateId:s,getEntityRecord:n,canUser:o}=t(u.store);if(!o("update",{kind:"root",name:"site"}))return!1;const r=s({slug:"front-page"});if(!r)return!0;const i=n("postType","wp_template",r);return!i||"front-page"!==i.slug}),[e]),r=(()=>{const{pageOnFront:e,pageForPosts:t}=(0,d.useSelect)((e=>{const{getEntityRecord:t,canUser:s}=e(u.store),n=s("read",{kind:"root",name:"site"})?t("root","site"):void 0;return{pageOnFront:n?.page_on_front,pageForPosts:n?.page_for_posts}}));return(0,p.useMemo)((()=>({id:"set-as-homepage",label:(0,fs.__)("Set as homepage"),isEligible:s=>"publish"===s.status&&"page"===s.type&&e!==s.id&&t!==s.id,modalFocusOnMount:"firstContentElement",RenderModal:af})),[t,e])})(),i=(()=>{const{pageOnFront:e,pageForPosts:t}=(0,d.useSelect)((e=>{const{getEntityRecord:t,canUser:s}=e(u.store),n=s("read",{kind:"root",name:"site"})?t("root","site"):void 0;return{pageOnFront:n?.page_on_front,pageForPosts:n?.page_for_posts}}));return(0,p.useMemo)((()=>({id:"set-as-posts-page",label:(0,fs.__)("Set as posts page"),isEligible:s=>"publish"===s.status&&"page"===s.type&&e!==s.id&&t!==s.id,modalFocusOnMount:"firstContentElement",RenderModal:lf})),[t,e])})(),{registerPostTypeSchema:a}=$((0,d.useDispatch)(vc));return(0,p.useEffect)((()=>{a(e)}),[a,e]),(0,p.useMemo)((()=>{let e=[...n];if(o&&e.push(r,i),e=e.sort(((e,t)=>"move-to-trash"===t.id?-1:0)),e=e.filter((e=>!e.context||e.context===s)),t)for(let s=0;s<e.length;++s){if(e[s].callback){const n=e[s].callback;e[s]={...e[s],callback:(o,r)=>{n(o,{...r,onActionPerformed:n=>{r?.onActionPerformed&&r.onActionPerformed(n),t(e[s].id,n)}})}}}if(e[s].RenderModal){const n=e[s].RenderModal;e[s]={...e[s],RenderModal:o=>(0,c.jsx)(n,{...o,onActionPerformed:n=>{o.onActionPerformed&&o.onActionPerformed(n),t(e[s].id,n)}})}}}return e}),[s,n,t,r,i,o])}const{Menu:df,kebabCase:uf}=$(Hn.privateApis);function pf({postType:e,postId:t,onActionPerformed:s}){const[n,o]=(0,p.useState)(null),{item:r,permissions:i}=(0,d.useSelect)((s=>{const{getEditedEntityRecord:n,getEntityRecordPermissions:o}=$(s(u.store));return{item:n("postType",e,t),permissions:o("postType",e,t)}}),[t,e]),a=(0,p.useMemo)((()=>({...r,permissions:i})),[r,i]),l=cf({postType:e,onActionPerformed:s}),m=(0,p.useMemo)((()=>l.filter((e=>!e.isEligible||e.isEligible(a)))),[l,a]);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(df,{placement:"bottom-end",children:[(0,c.jsx)(df.TriggerButton,{render:(0,c.jsx)(Hn.Button,{size:"small",icon:r_,label:(0,fs.__)("Actions"),disabled:!m.length,accessibleWhenDisabled:!0,className:"editor-all-actions-button"})}),(0,c.jsx)(df.Popover,{children:(0,c.jsx)(gf,{actions:m,items:[a],setActiveModalAction:o})})]}),!!n&&(0,c.jsx)(hf,{action:n,items:[a],closeModal:()=>o(null)})]})}function mf({action:e,onClick:t,items:s}){const n="string"==typeof e.label?e.label:e.label(s);return(0,c.jsx)(df.Item,{onClick:t,children:(0,c.jsx)(df.ItemLabel,{children:n})})}function hf({action:e,items:t,closeModal:s}){const n="string"==typeof e.label?e.label:e.label(t);return(0,c.jsx)(Hn.Modal,{title:e.modalHeader||n,__experimentalHideHeader:!!e.hideModalHeader,onRequestClose:s??(()=>{}),focusOnMount:"firstContentElement",size:"medium",overlayClassName:`editor-action-modal editor-action-modal__${uf(e.id)}`,children:(0,c.jsx)(e.RenderModal,{items:t,closeModal:s})})}function gf({actions:e,items:t,setActiveModalAction:s}){const n=(0,d.useRegistry)();return(0,c.jsx)(df.Group,{children:e.map((e=>(0,c.jsx)(mf,{action:e,onClick:()=>{"RenderModal"in e?s(e):e.callback(t,{registry:n})},items:t},e.id)))})}const{Badge:_f}=$(Hn.privateApis);function ff({postType:e,postId:t,onActionPerformed:s}){const n=(0,p.useMemo)((()=>Array.isArray(t)?t:[t]),[t]),{postTitle:o,icon:r,labels:i}=(0,d.useSelect)((t=>{const{getEditedEntityRecord:s,getCurrentTheme:o,getPostType:r}=t(u.store),{getPostIcon:i}=$(t(vc));let a="";const l=s("postType",e,n[0]);if(1===n.length){const{default_template_types:t=[]}=o()??{},s=[B,I].includes(e)?Y({template:l,templateTypes:t}):{};a=s?.title||l?.title}return{postTitle:a,icon:i(e,{area:l?.area}),labels:r(e)?.labels}}),[n,e]),a=Hc(t);let l=(0,fs.__)("No title");return i?.name&&n.length>1?l=(0,fs.sprintf)((0,fs.__)("%1$d %2$s"),n.length,i?.name):o&&(l=(0,Uc.__unstableStripHTML)(o)),(0,c.jsxs)(Hn.__experimentalVStack,{spacing:1,className:"editor-post-card-panel",children:[(0,c.jsxs)(Hn.__experimentalHStack,{spacing:2,className:"editor-post-card-panel__header",align:"flex-start",children:[(0,c.jsx)(Hn.Icon,{className:"editor-post-card-panel__icon",icon:r}),(0,c.jsxs)(Hn.__experimentalText,{numberOfLines:2,truncate:!0,className:"editor-post-card-panel__title",as:"h2",children:[(0,c.jsx)("span",{className:"editor-post-card-panel__title-name",children:l}),a&&1===n.length&&(0,c.jsx)(_f,{children:a})]}),1===n.length&&(0,c.jsx)(pf,{postType:e,postId:n[0],onActionPerformed:s})]}),n.length>1&&(0,c.jsx)(Hn.__experimentalText,{className:"editor-post-card-panel__description",children:(0,fs.sprintf)((0,fs.__)("Changes will be applied to all selected %s."),i?.name.toLowerCase())})]})}function bf(){const{postContent:e}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPostType:s,getCurrentPostId:n}=e(vc),{canUser:o}=e(u.store),{getEntityRecord:r}=e(u.store),i=o("read",{kind:"root",name:"site"})?r("root","site"):void 0,a=s();return{postContent:!(+n()===i?.page_for_posts)&&![B,I].includes(a)&&t("content")}}),[]),t=(0,fs._x)("words","Word count type. Do not translate!"),s=(0,p.useMemo)((()=>e?(0,Dh.count)(e,t):0),[e,t]);if(!s)return null;const n=Math.round(s/189),o=(0,fs.sprintf)((0,fs._n)("%s word","%s words",s),s.toLocaleString()),r=n<=1?(0,fs.__)("1 minute"):(0,fs.sprintf)((0,fs._n)("%s minute","%s minutes",n),n.toLocaleString());return(0,c.jsx)("div",{className:"editor-post-content-information",children:(0,c.jsx)(Hn.__experimentalText,{children:(0,fs.sprintf)((0,fs.__)("%1$s, %2$s read time."),o,r)})})}var yf=function(){const{postFormat:e}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(vc);return{postFormat:t("format")??"standard"}}),[]),t=Pp.find((t=>t.id===e)),[s,n]=(0,p.useState)(null),o=(0,p.useMemo)((()=>({anchor:s,placement:"left-start",offset:36,shift:!0})),[s]);return(0,c.jsx)(Cp,{children:(0,c.jsx)(Rd,{label:(0,fs.__)("Format"),ref:n,children:(0,c.jsx)(Hn.Dropdown,{popoverProps:o,contentClassName:"editor-post-format__dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:s})=>(0,c.jsx)(Hn.Button,{size:"compact",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.sprintf)((0,fs.__)("Change format: %s"),t?.caption),onClick:s,children:t?.caption}),renderContent:({onClose:e})=>(0,c.jsxs)("div",{className:"editor-post-format__dialog-content",children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Format"),onClose:e}),(0,c.jsx)(jp,{})]})})})})};function xf(){const e=(0,d.useSelect)((e=>e(vc).getEditedPostAttribute("modified")),[]),t=e&&(0,fs.sprintf)((0,fs.__)("Last edited %s."),(0,v.humanTimeDiff)(e));return t?(0,c.jsx)("div",{className:"editor-post-last-edited-panel",children:(0,c.jsx)(Hn.__experimentalText,{children:t})}):null}var vf=function({className:e,children:t}){return(0,c.jsx)(Hn.__experimentalVStack,{className:mr("editor-post-panel__section",e),children:t})};const wf={};function Sf(){const{editEntityRecord:e}=(0,d.useDispatch)(u.store),{postsPageTitle:t,postsPageId:s,isTemplate:n,postSlug:o}=(0,d.useSelect)((e=>{const{getEntityRecord:t,getEditedEntityRecord:s,canUser:n}=e(u.store),o=n("read",{kind:"root",name:"site"})?t("root","site"):void 0,r=o?.page_for_posts?s("postType","page",o?.page_for_posts):wf,{getEditedPostAttribute:i,getCurrentPostType:a}=e(vc);return{postsPageId:r?.id,postsPageTitle:r?.title,isTemplate:a()===B,postSlug:i("slug")}}),[]),[r,i]=(0,p.useState)(null),a=(0,p.useMemo)((()=>({anchor:r,placement:"left-start",offset:36,shift:!0})),[r]);if(!n||!["home","index"].includes(o)||!s)return null;const l=t=>{e("postType","page",s,{title:t})},h=(0,Ln.decodeEntities)(t);return(0,c.jsx)(Rd,{label:(0,fs.__)("Blog title"),ref:i,children:(0,c.jsx)(Hn.Dropdown,{popoverProps:a,contentClassName:"editor-blog-title-dropdown__content",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,c.jsx)(Hn.Button,{size:"compact",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.sprintf)((0,fs.__)("Change blog title: %s"),h),onClick:t,children:h}),renderContent:({onClose:e})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Blog title"),onClose:e}),(0,c.jsx)(Hn.__experimentalInputControl,{placeholder:(0,fs.__)("No title"),size:"__unstable-large",value:t,onChange:(0,m.debounce)(l,300),label:(0,fs.__)("Blog title"),help:(0,fs.__)("Set the Posts Page title. Appears in search results, and when the page is shared on social media."),hideLabelFromVision:!0})]})})})}function kf(){const{editEntityRecord:e}=(0,d.useDispatch)(u.store),{postsPerPage:t,isTemplate:s,postSlug:n}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPostType:s}=e(vc),{getEditedEntityRecord:n,canUser:o}=e(u.store),r=o("read",{kind:"root",name:"site"})?n("root","site"):void 0;return{isTemplate:s()===B,postSlug:t("slug"),postsPerPage:r?.posts_per_page||1}}),[]),[o,r]=(0,p.useState)(null),i=(0,p.useMemo)((()=>({anchor:o,placement:"left-start",offset:36,shift:!0})),[o]);if(!s||!["home","index"].includes(n))return null;const a=t=>{e("root","site",void 0,{posts_per_page:t})};return(0,c.jsx)(Rd,{label:(0,fs.__)("Posts per page"),ref:r,children:(0,c.jsx)(Hn.Dropdown,{popoverProps:i,contentClassName:"editor-posts-per-page-dropdown__content",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:s})=>(0,c.jsx)(Hn.Button,{size:"compact",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.__)("Change posts per page"),onClick:s,children:t}),renderContent:({onClose:e})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Posts per page"),onClose:e}),(0,c.jsx)(Hn.__experimentalNumberControl,{placeholder:0,value:t,size:"__unstable-large",spinControls:"custom",step:"1",min:"1",onChange:a,label:(0,fs.__)("Posts per page"),help:(0,fs.__)("Set the default number of posts to display on blog pages, including categories and tags. Some templates may override this setting."),hideLabelFromVision:!0})]})})})}const Cf=[{label:(0,fs._x)("Open",'Adjective: e.g. "Comments are open"'),value:"open",description:(0,fs.__)("Visitors can add new comments and replies.")},{label:(0,fs.__)("Closed"),value:"",description:[(0,fs.__)("Visitors cannot add new comments or replies."),(0,fs.__)("Existing comments remain visible.")].join(" ")}];function Pf(){const{editEntityRecord:e}=(0,d.useDispatch)(u.store),{allowCommentsOnNewPosts:t,isTemplate:s,postSlug:n}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPostType:s}=e(vc),{getEditedEntityRecord:n,canUser:o}=e(u.store),r=o("read",{kind:"root",name:"site"})?n("root","site"):void 0;return{isTemplate:s()===B,postSlug:t("slug"),allowCommentsOnNewPosts:r?.default_comment_status||""}}),[]),[o,r]=(0,p.useState)(null),i=(0,p.useMemo)((()=>({anchor:o,placement:"left-start",offset:36,shift:!0})),[o]);if(!s||!["home","index"].includes(n))return null;const a=t=>{e("root","site",void 0,{default_comment_status:t?"open":null})};return(0,c.jsx)(Rd,{label:(0,fs.__)("Discussion"),ref:r,children:(0,c.jsx)(Hn.Dropdown,{popoverProps:i,contentClassName:"editor-site-discussion-dropdown__content",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:s})=>(0,c.jsx)(Hn.Button,{size:"compact",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.__)("Change discussion settings"),onClick:s,children:t?(0,fs.__)("Comments open"):(0,fs.__)("Comments closed")}),renderContent:({onClose:e})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Discussion"),onClose:e}),(0,c.jsxs)(Hn.__experimentalVStack,{spacing:3,children:[(0,c.jsx)(Hn.__experimentalText,{children:(0,fs.__)("Changes will apply to new posts only. Individual posts may override these settings.")}),(0,c.jsx)(Hn.RadioControl,{className:"editor-site-discussion__options",hideLabelFromVision:!0,label:(0,fs.__)("Comment status"),options:Cf,onChange:a,selected:t})]})]})})})}function jf({onActionPerformed:e}){const{isRemovedPostStatusPanel:t,postType:s,postId:n}=(0,d.useSelect)((e=>{const{isEditorPanelRemoved:t,getCurrentPostType:s,getCurrentPostId:n}=e(vc);return{isRemovedPostStatusPanel:t("post-status"),postType:s(),postId:n()}}),[]);return(0,c.jsx)(vf,{className:"editor-post-summary",children:(0,c.jsx)(Cu.Slot,{children:o=>(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)(Hn.__experimentalVStack,{spacing:4,children:[(0,c.jsx)(ff,{postType:s,postId:n,onActionPerformed:e}),(0,c.jsx)(kp,{withPanelBody:!1}),(0,c.jsx)(pp,{}),(0,c.jsxs)(Hn.__experimentalVStack,{spacing:1,children:[(0,c.jsx)(bf,{}),(0,c.jsx)(xf,{})]}),!t&&(0,c.jsxs)(Hn.__experimentalVStack,{spacing:4,children:[(0,c.jsxs)(Hn.__experimentalVStack,{spacing:1,children:[(0,c.jsx)(sh,{}),(0,c.jsx)(ih,{}),(0,c.jsx)(Th,{}),(0,c.jsx)(qu,{}),(0,c.jsx)(Vu,{}),(0,c.jsx)(sp,{}),(0,c.jsx)(Bp,{}),(0,c.jsx)(Wd,{}),(0,c.jsx)(lh,{}),(0,c.jsx)(Sf,{}),(0,c.jsx)(kf,{}),(0,c.jsx)(Pf,{}),(0,c.jsx)(yf,{}),o]}),(0,c.jsx)(kh,{onActionPerformed:e})]})]})})})})}const{EXCLUDED_PATTERN_SOURCES:Ef,PATTERN_TYPES:Tf}=$(ao.privateApis);function Bf(e,t){return e.innerBlocks=e.innerBlocks.map((e=>Bf(e,t))),"core/template-part"===e.name&&void 0===e.attributes.theme&&(e.attributes.theme=t),e}function If(e,t){return e.filter(((e,s,n)=>((e,t,s)=>t===s.findIndex((t=>e.name===t.name)))(e,s,n)&&(e=>!Ef.includes(e.source))(e)&&(e=>e.templateTypes?.includes(t.slug)||e.blockTypes?.includes("core/template-part/"+t.area))(e)))}function Nf(e,t){return e.map((e=>({...e,keywords:e.keywords||[],type:Tf.theme,blocks:(0,x.parse)(e.content,{__unstableSkipMigrationLogs:!0}).map((e=>Bf(e,t)))})))}function Rf({availableTemplates:e,onSelect:t}){return e&&0!==e?.length?(0,c.jsx)(g.__experimentalBlockPatternsList,{label:(0,fs.__)("Templates"),blockPatterns:e,onClickPattern:t,showTitlesAsTooltip:!0}):null}function Df(){const{area:e,name:t,slug:s,postType:n,postId:o}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(vc),{getEditedEntityRecord:n}=e(u.store),o=t(),r=s(),i=n("postType",o,r);return{area:i?.area,name:i?.name,slug:i?.slug,postType:o,postId:r}}),[]),{editEntityRecord:r}=(0,d.useDispatch)(u.store),i=function({area:e,name:t,slug:s}){const{blockPatterns:n,restBlockPatterns:o,currentThemeStylesheet:r}=(0,d.useSelect)((e=>{const{getEditorSettings:t}=e(vc),s=t();return{blockPatterns:s.__experimentalAdditionalBlockPatterns??s.__experimentalBlockPatterns,restBlockPatterns:e(u.store).getBlockPatterns(),currentThemeStylesheet:e(u.store).getCurrentTheme().stylesheet}}),[]);return(0,p.useMemo)((()=>Nf(If([...n||[],...o||[]],{area:e,name:t,slug:s}),r)),[e,t,s,n,o,r])}({area:e,name:t,slug:s});return i?.length?(0,c.jsx)(Hn.PanelBody,{title:(0,fs.__)("Design"),initialOpen:n===I,children:(0,c.jsx)(Rf,{availableTemplates:i,onSelect:async e=>{await r("postType",n,o,{blocks:e.blocks,content:(0,x.serialize)(e.blocks)})}})}):null}function Af(){const{postType:e}=(0,d.useSelect)((e=>{const{getCurrentPostType:t}=e(vc);return{postType:t()}}),[]);return[I,B].includes(e)?(0,c.jsx)(Df,{}):null}const Mf={document:"edit-post/document",block:"edit-post/block"},{Tabs:Lf}=$(Hn.privateApis);var Of=(0,p.forwardRef)(((e,t)=>{const{documentLabel:s}=(0,d.useSelect)((e=>{const{getPostTypeLabel:t}=e(vc);return{documentLabel:t()||(0,fs._x)("Document","noun, panel")}}),[]);return(0,c.jsxs)(Lf.TabList,{ref:t,children:[(0,c.jsx)(Lf.Tab,{tabId:Mf.document,"data-tab-id":Mf.document,children:s}),(0,c.jsx)(Lf.Tab,{tabId:Mf.block,"data-tab-id":Mf.block,children:(0,fs.__)("Block")})]})}));const{BlockQuickNavigation:Ff}=$(g.privateApis),Vf=["core/post-title","core/post-featured-image","core/post-content"];function Uf(){const e=(0,p.useMemo)((()=>(0,h.applyFilters)("editor.postContentBlockTypes",Vf)),[]),{clientIds:t,postType:s,renderingMode:n}=(0,d.useSelect)((t=>{const{getCurrentPostType:s,getPostBlocksByName:n,getRenderingMode:o}=$(t(vc)),r=s();return{postType:r,clientIds:n(B===r?"core/template-part":e),renderingMode:o()}}),[e]),{enableComplementaryArea:o}=(0,d.useDispatch)(ja);return"post-only"===n&&s!==B||0===t.length?null:(0,c.jsx)(Hn.PanelBody,{title:(0,fs.__)("Content"),children:(0,c.jsx)(Ff,{clientIds:t,onSelect:()=>{o("core","edit-post/document")}})})}const{BlockQuickNavigation:Hf}=$(g.privateApis);function zf(){const e=(0,d.useSelect)((e=>{const{getBlockTypes:t}=e(x.store);return t()}),[]),t=(0,p.useMemo)((()=>e.filter((e=>"theme"===e.category)).map((({name:e})=>e))),[e]),s=(0,d.useSelect)((e=>{const{getBlocksByName:s}=e(g.store);return s(t)}),[t]);return 0===s.length?null:(0,c.jsx)(Hn.PanelBody,{title:(0,fs.__)("Content"),children:(0,c.jsx)(Hf,{clientIds:s})})}function Gf(){const e=(0,d.useSelect)((e=>{const{getCurrentPostType:t}=e(vc);return t()}),[]);return e!==I?null:(0,c.jsx)(zf,{})}var $f=function(){const{hasBlockSelection:e}=(0,d.useSelect)((e=>({hasBlockSelection:!!e(g.store).getBlockSelectionStart()})),[]),{getActiveComplementaryArea:t}=(0,d.useSelect)(ja),{enableComplementaryArea:s}=(0,d.useDispatch)(ja),{get:n}=(0,d.useSelect)(C.store);(0,p.useEffect)((()=>{const o=t("core"),r=["edit-post/document","edit-post/block"].includes(o),i=n("core","distractionFree");r&&!i&&s("core",e?"edit-post/block":"edit-post/document")}),[e,t,s,n])};const{Tabs:Wf}=$(Hn.privateApis),Zf=p.Platform.select({web:!0,native:!1}),Yf=({tabName:e,keyboardShortcut:t,onActionPerformed:s,extraPanels:n})=>{const o=(0,p.useRef)(null),r=(0,p.useContext)(Wf.Context);return(0,p.useEffect)((()=>{const t=Array.from(o.current?.querySelectorAll('[role="tab"]')||[]),s=t.find((t=>t.getAttribute("data-tab-id")===e)),n=s?.ownerDocument.activeElement;t.some((e=>n&&n.id===e.id))&&s&&s.id!==n?.id&&s?.focus()}),[e]),(0,c.jsx)(Iu,{identifier:e,header:(0,c.jsx)(Wf.Context.Provider,{value:r,children:(0,c.jsx)(Of,{ref:o})}),closeLabel:(0,fs.__)("Close Settings"),className:"editor-sidebar__panel",headerClassName:"editor-sidebar__panel-tabs",title:(0,fs._x)("Settings","panel button label"),toggleShortcut:t,icon:(0,fs.isRTL)()?Yi:qi,isActiveByDefault:Zf,children:(0,c.jsxs)(Wf.Context.Provider,{value:r,children:[(0,c.jsxs)(Wf.TabPanel,{tabId:Mf.document,focusable:!1,children:[(0,c.jsx)(jf,{onActionPerformed:s}),(0,c.jsx)(gu.Slot,{}),(0,c.jsx)(Uf,{}),(0,c.jsx)(Gf,{}),(0,c.jsx)(Af,{}),(0,c.jsx)(mh,{}),(0,c.jsx)(of,{}),n]}),(0,c.jsx)(Wf.TabPanel,{tabId:Mf.block,focusable:!1,children:(0,c.jsx)(g.BlockInspector,{})})]})})};var qf=({extraPanels:e,onActionPerformed:t})=>{$f();const{tabName:s,keyboardShortcut:n,showSummary:o}=(0,d.useSelect)((e=>{const t=e(il.store).getShortcutRepresentation("core/editor/toggle-sidebar"),s=e(ja).getActiveComplementaryArea("core");let n=s;return[Mf.block,Mf.document].includes(s)||(n=e(g.store).getBlockSelectionStart()?Mf.block:Mf.document),{tabName:n,keyboardShortcut:t,showSummary:![B,I,R].includes(e(vc).getCurrentPostType())}}),[]),{enableComplementaryArea:r}=(0,d.useDispatch)(ja),i=(0,p.useCallback)((e=>{e&&r("core",e)}),[r]);return(0,c.jsx)(Wf,{selectedTabId:s,onSelect:i,selectOnMove:!1,children:(0,c.jsx)(Yf,{tabName:s,keyboardShortcut:n,showSummary:o,onActionPerformed:t,extraPanels:e})})},Kf=(0,c.jsx)(L.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(L.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z"})});const Qf="edit-post/collab-history-sidebar",Xf="edit-post/collab-sidebar",Jf=[Qf,Xf];function eb(){}const tb=["#3858E9","#9fB1FF","#1D35B4","#1A1919","#E26F56","#33F078","#FFF972","#7A00DF"];function sb(e){return tb[e%tb.length]}function nb(e,t,s){if(!t)return;const n=e?`[role=treeitem][id="comment-thread-${e}"]`:"[role=treeitem]:not([id])",o=s?`${n} ${s}`:n;return new Promise((e=>{if(t.querySelector(o))return e(t.querySelector(o));let s=null;const n=new window.MutationObserver((()=>{t.querySelector(o)&&(clearTimeout(s),n.disconnect(),e(t.querySelector(o)))}));n.observe(t,{childList:!0,subtree:!0}),s=setTimeout((()=>{n.disconnect(),e(null)}),3e3)})).then((e=>e?.focus()))}var ob=function({avatar:e,name:t,date:s,userId:n}){const o=!!e,r=(0,v.getSettings)(),{currentUserAvatar:i,currentUserName:a,currentUserId:l,dateFormat:p=r.formats.date}=(0,d.useSelect)((e=>{const{canUser:t,getCurrentUser:s,getEntityRecord:n}=e(u.store),r=t("read",{kind:"root",name:"site"})?n("root","site"):void 0;if(o)return{dateFormat:r?.date_format};const{getSettings:i}=e(g.store),{__experimentalDiscussionSettings:a}=i(),l=a?.avatarURL,c=s();return{currentUserAvatar:c?.avatar_urls?.[48]??l,currentUserName:c?.name,currentUserId:c?.id,dateFormat:r?.date_format}}),[o]),m=(0,v.getDate)(s),h=(0,v.dateI18n)("c",m),_=Math.floor((new Date-m)/864e5)<30?(0,v.humanTimeDiff)(m):(0,v.dateI18n)(p,m),f=(0,v.dateI18n)((0,fs._x)("F j, Y g:i a","Note date full date format"),s);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("img",{src:e||i,className:"editor-collab-sidebar-panel__user-avatar",alt:(0,fs.__)("User avatar"),width:32,height:32,style:{borderColor:sb(n??l)}}),(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"0",children:[(0,c.jsx)("span",{className:"editor-collab-sidebar-panel__user-name",children:t??a}),s&&(0,c.jsx)(Hn.Tooltip,{text:f,children:(0,c.jsx)("time",{dateTime:h,className:"editor-collab-sidebar-panel__user-time",children:_})})]})]})};var rb=function e({onSubmit:t,onCancel:s,thread:n,submitButtonText:o,labelText:r,reflowComments:i=eb}){const[a,l]=(0,p.useState)(n?.content?.raw??""),d=(0,m.useDebounce)(i,100),u=(0,m.useInstanceId)(e,"comment-input"),h=a===n?.content?.raw||!(g=a,g.trim()).length;var g;return(0,c.jsxs)(Hn.__experimentalVStack,{className:"editor-collab-sidebar-panel__comment-form",spacing:"4",as:"form",onSubmit:e=>{e.preventDefault(),t(a),l("")},children:[(0,c.jsx)(Hn.VisuallyHidden,{as:"label",htmlFor:u,children:r??(0,fs.__)("Note")}),(0,c.jsx)(hh.A,{id:u,value:a??"",onChange:e=>{var t;t=e.target.value,l(t),d()},rows:1,maxRows:20,onKeyDown:e=>{ll.isKeyboardEvent.primary(e,"Enter")&&!h&&e.target.parentNode.requestSubmit()}}),(0,c.jsxs)(Hn.__experimentalHStack,{spacing:"2",justify:"flex-end",wrap:!0,children:[(0,c.jsx)(Hn.Button,{size:"compact",variant:"tertiary",onClick:s,children:(0,c.jsx)(Hn.__experimentalTruncate,{children:(0,fs.__)("Cancel")})}),(0,c.jsx)(Hn.Button,{size:"compact",accessibleWhenDisabled:!0,variant:"primary",type:"submit",disabled:h,children:(0,c.jsx)(Hn.__experimentalTruncate,{children:o})})]})]})};Math.min,Math.max,Math.round,Math.floor;function ib(e){return e.split("-")[0]}function ab(e){return e.split("-")[1]}function lb(e){return"y"===e?"height":"width"}function cb(e){return["top","bottom"].includes(ib(e))?"y":"x"}function db(e){return"x"===cb(e)?"y":"x"}function ub(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function pb(e,t,s){let{reference:n,floating:o}=e;const r=cb(t),i=db(t),a=lb(i),l=ib(t),c="y"===r,d=n.x+n.width/2-o.width/2,u=n.y+n.height/2-o.height/2,p=n[a]/2-o[a]/2;let m;switch(l){case"top":m={x:d,y:n.y-o.height};break;case"bottom":m={x:d,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:u};break;case"left":m={x:n.x-o.width,y:u};break;default:m={x:n.x,y:n.y}}switch(ab(t)){case"start":m[i]-=p*(s&&c?-1:1);break;case"end":m[i]+=p*(s&&c?-1:1)}return m}const mb=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:s,y:n}=t,o=await async function(e,t){const{placement:s,platform:n,elements:o}=e,r=await(null==n.isRTL?void 0:n.isRTL(o.floating)),i=ib(s),a=ab(s),l="y"===cb(s),c=["left","top"].includes(i)?-1:1,d=r&&l?-1:1,u=(m=e,"function"==typeof(p=t)?p(m):p);var p,m;let{mainAxis:h,crossAxis:g,alignmentAxis:_}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return a&&"number"==typeof _&&(g="end"===a?-1*_:_),l?{x:g*d,y:h*c}:{x:h*c,y:g*d}}(t,e);return{x:s+o.x,y:n+o.y,data:o}}}},hb=Math.min,gb=Math.max,_b=Math.round,fb=Math.floor,bb=e=>({x:e,y:e});function yb(){return"undefined"!=typeof window}function xb(e){return Sb(e)?(e.nodeName||"").toLowerCase():"#document"}function vb(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function wb(e){var t;return null==(t=(Sb(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Sb(e){return!!yb()&&(e instanceof Node||e instanceof vb(e).Node)}function kb(e){return!!yb()&&(e instanceof Element||e instanceof vb(e).Element)}function Cb(e){return!!yb()&&(e instanceof HTMLElement||e instanceof vb(e).HTMLElement)}function Pb(e){return!(!yb()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof vb(e).ShadowRoot)}function jb(e){const{overflow:t,overflowX:s,overflowY:n,display:o}=Rb(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+s)&&!["inline","contents"].includes(o)}function Eb(e){return["table","td","th"].includes(xb(e))}function Tb(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function Bb(e){const t=Ib(),s=kb(e)?Rb(e):e;return["transform","translate","scale","rotate","perspective"].some((e=>!!s[e]&&"none"!==s[e]))||!!s.containerType&&"normal"!==s.containerType||!t&&!!s.backdropFilter&&"none"!==s.backdropFilter||!t&&!!s.filter&&"none"!==s.filter||["transform","translate","scale","rotate","perspective","filter"].some((e=>(s.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(s.contain||"").includes(e)))}function Ib(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Nb(e){return["html","body","#document"].includes(xb(e))}function Rb(e){return vb(e).getComputedStyle(e)}function Db(e){return kb(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ab(e){if("html"===xb(e))return e;const t=e.assignedSlot||e.parentNode||Pb(e)&&e.host||wb(e);return Pb(t)?t.host:t}function Mb(e){const t=Ab(e);return Nb(t)?e.ownerDocument?e.ownerDocument.body:e.body:Cb(t)&&jb(t)?t:Mb(t)}function Lb(e,t,s){var n;void 0===t&&(t=[]),void 0===s&&(s=!0);const o=Mb(e),r=o===(null==(n=e.ownerDocument)?void 0:n.body),i=vb(o);if(r){const e=function(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}(i);return t.concat(i,i.visualViewport||[],jb(o)?o:[],e&&s?Lb(e):[])}return t.concat(o,Lb(o,[],s))}function Ob(e){const t=Rb(e);let s=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Cb(e),r=o?e.offsetWidth:s,i=o?e.offsetHeight:n,a=_b(s)!==r||_b(n)!==i;return a&&(s=r,n=i),{width:s,height:n,$:a}}function Fb(e){return kb(e)?e:e.contextElement}function Vb(e){const t=Fb(e);if(!Cb(t))return bb(1);const s=t.getBoundingClientRect(),{width:n,height:o,$:r}=Ob(t);let i=(r?_b(s.width):s.width)/n,a=(r?_b(s.height):s.height)/o;return i&&Number.isFinite(i)||(i=1),a&&Number.isFinite(a)||(a=1),{x:i,y:a}}const Ub=bb(0);function Hb(e){const t=vb(e);return Ib()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Ub}function zb(e,t,s,n){void 0===t&&(t=!1),void 0===s&&(s=!1);const o=e.getBoundingClientRect(),r=Fb(e);let i=bb(1);t&&(n?kb(n)&&(i=Vb(n)):i=Vb(e));const a=function(e,t,s){return void 0===t&&(t=!1),!(!s||t&&s!==vb(e))&&t}(r,s,n)?Hb(r):bb(0);let l=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,d=o.width/i.x,u=o.height/i.y;if(r){const e=vb(r),t=n&&kb(n)?vb(n):n;let s=e,o=s.frameElement;for(;o&&n&&t!==s;){const e=Vb(o),t=o.getBoundingClientRect(),n=Rb(o),r=t.left+(o.clientLeft+parseFloat(n.paddingLeft))*e.x,i=t.top+(o.clientTop+parseFloat(n.paddingTop))*e.y;l*=e.x,c*=e.y,d*=e.x,u*=e.y,l+=r,c+=i,s=vb(o),o=s.frameElement}}return ub({width:d,height:u,x:l,y:c})}const Gb=[":popover-open",":modal"];function $b(e){return Gb.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function Wb(e){return zb(wb(e)).left+Db(e).scrollLeft}function Zb(e,t,s){let n;if("viewport"===t)n=function(e,t){const s=vb(e),n=wb(e),o=s.visualViewport;let r=n.clientWidth,i=n.clientHeight,a=0,l=0;if(o){r=o.width,i=o.height;const e=Ib();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:r,height:i,x:a,y:l}}(e,s);else if("document"===t)n=function(e){const t=wb(e),s=Db(e),n=e.ownerDocument.body,o=gb(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),r=gb(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-s.scrollLeft+Wb(e);const a=-s.scrollTop;return"rtl"===Rb(n).direction&&(i+=gb(t.clientWidth,n.clientWidth)-o),{width:o,height:r,x:i,y:a}}(wb(e));else if(kb(t))n=function(e,t){const s=zb(e,!0,"fixed"===t),n=s.top+e.clientTop,o=s.left+e.clientLeft,r=Cb(e)?Vb(e):bb(1);return{width:e.clientWidth*r.x,height:e.clientHeight*r.y,x:o*r.x,y:n*r.y}}(t,s);else{const s=Hb(e);n={...t,x:t.x-s.x,y:t.y-s.y}}return ub(n)}function Yb(e,t){const s=Ab(e);return!(s===t||!kb(s)||Nb(s))&&("fixed"===Rb(s).position||Yb(s,t))}function qb(e,t,s){const n=Cb(t),o=wb(t),r="fixed"===s,i=zb(e,!0,r,t);let a={scrollLeft:0,scrollTop:0};const l=bb(0);if(n||!n&&!r)if(("body"!==xb(t)||jb(o))&&(a=Db(t)),n){const e=zb(t,!0,r,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=Wb(o));return{x:i.left+a.scrollLeft-l.x,y:i.top+a.scrollTop-l.y,width:i.width,height:i.height}}function Kb(e,t){return Cb(e)&&"fixed"!==Rb(e).position?t?t(e):e.offsetParent:null}function Qb(e,t){const s=vb(e);if(!Cb(e)||$b(e))return s;let n=Kb(e,t);for(;n&&Eb(n)&&"static"===Rb(n).position;)n=Kb(n,t);return n&&("html"===xb(n)||"body"===xb(n)&&"static"===Rb(n).position&&!Bb(n))?s:n||function(e){let t=Ab(e);for(;Cb(t)&&!Nb(t);){if(Bb(t))return t;if(Tb(t))return null;t=Ab(t)}return null}(e)||s}const Xb={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:s,offsetParent:n,strategy:o}=e;const r="fixed"===o,i=wb(n),a=!!t&&$b(t.floating);if(n===i||a&&r)return s;let l={scrollLeft:0,scrollTop:0},c=bb(1);const d=bb(0),u=Cb(n);if((u||!u&&!r)&&(("body"!==xb(n)||jb(i))&&(l=Db(n)),Cb(n))){const e=zb(n);c=Vb(n),d.x=e.x+n.clientLeft,d.y=e.y+n.clientTop}return{width:s.width*c.x,height:s.height*c.y,x:s.x*c.x-l.scrollLeft*c.x+d.x,y:s.y*c.y-l.scrollTop*c.y+d.y}},getDocumentElement:wb,getClippingRect:function(e){let{element:t,boundary:s,rootBoundary:n,strategy:o}=e;const r=[..."clippingAncestors"===s?function(e,t){const s=t.get(e);if(s)return s;let n=Lb(e,[],!1).filter((e=>kb(e)&&"body"!==xb(e))),o=null;const r="fixed"===Rb(e).position;let i=r?Ab(e):e;for(;kb(i)&&!Nb(i);){const t=Rb(i),s=Bb(i);s||"fixed"!==t.position||(o=null),(r?!s&&!o:!s&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||jb(i)&&!s&&Yb(e,i))?n=n.filter((e=>e!==i)):o=t,i=Ab(i)}return t.set(e,n),n}(t,this._c):[].concat(s),n],i=r[0],a=r.reduce(((e,s)=>{const n=Zb(t,s,o);return e.top=gb(n.top,e.top),e.right=hb(n.right,e.right),e.bottom=hb(n.bottom,e.bottom),e.left=gb(n.left,e.left),e}),Zb(t,i,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Qb,getElementRects:async function(e){const t=this.getOffsetParent||Qb,s=this.getDimensions;return{reference:qb(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await s(e.floating)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:s}=Ob(e);return{width:t,height:s}},getScale:Vb,isElement:kb,isRTL:function(e){return"rtl"===Rb(e).direction}};function Jb(e,t,s,n){void 0===n&&(n={});const{ancestorScroll:o=!0,ancestorResize:r=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=n,c=Fb(e),d=o||r?[...c?Lb(c):[],...Lb(t)]:[];d.forEach((e=>{o&&e.addEventListener("scroll",s,{passive:!0}),r&&e.addEventListener("resize",s)}));const u=c&&a?function(e,t){let s,n=null;const o=wb(e);function r(){var e;clearTimeout(s),null==(e=n)||e.disconnect(),n=null}return function i(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),r();const{left:c,top:d,width:u,height:p}=e.getBoundingClientRect();if(a||t(),!u||!p)return;const m={rootMargin:-fb(d)+"px "+-fb(o.clientWidth-(c+u))+"px "+-fb(o.clientHeight-(d+p))+"px "+-fb(c)+"px",threshold:gb(0,hb(1,l))||1};let h=!0;function g(e){const t=e[0].intersectionRatio;if(t!==l){if(!h)return i();t?i(!1,t):s=setTimeout((()=>{i(!1,1e-7)}),100)}h=!1}try{n=new IntersectionObserver(g,{...m,root:o.ownerDocument})}catch(e){n=new IntersectionObserver(g,m)}n.observe(e)}(!0),r}(c,s):null;let p,m=-1,h=null;i&&(h=new ResizeObserver((e=>{let[n]=e;n&&n.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),s()})),c&&!l&&h.observe(c),h.observe(t));let g=l?zb(e):null;return l&&function t(){const n=zb(e);!g||n.x===g.x&&n.y===g.y&&n.width===g.width&&n.height===g.height||s();g=n,p=requestAnimationFrame(t)}(),s(),()=>{var e;d.forEach((e=>{o&&e.removeEventListener("scroll",s),r&&e.removeEventListener("resize",s)})),null==u||u(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const ey=(e,t,s)=>{const n=new Map,o={platform:Xb,...s},r={...o.platform,_c:n};return(async(e,t,s)=>{const{placement:n="bottom",strategy:o="absolute",middleware:r=[],platform:i}=s,a=r.filter(Boolean),l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=pb(c,n,l),p=n,m={},h=0;for(let s=0;s<a.length;s++){const{name:r,fn:g}=a[s],{x:_,y:f,data:b,reset:y}=await g({x:d,y:u,initialPlacement:n,placement:p,strategy:o,middlewareData:m,rects:c,platform:i,elements:{reference:e,floating:t}});d=null!=_?_:d,u=null!=f?f:u,m={...m,[r]:{...m[r],...b}},y&&h<=50&&(h++,"object"==typeof y&&(y.placement&&(p=y.placement),y.rects&&(c=!0===y.rects?await i.getElementRects({reference:e,floating:t,strategy:o}):y.rects),({x:d,y:u}=pb(c,p,l))),s=-1)}return{x:d,y:u,placement:p,strategy:o,middlewareData:m}})(e,t,{...o,platform:r})};var ty=s(1609);const sy=window.ReactDOM;var ny="undefined"!=typeof document?ty.useLayoutEffect:ty.useEffect;function oy(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let s,n,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(s=e.length,s!==t.length)return!1;for(n=s;0!=n--;)if(!oy(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),s=o.length,s!==Object.keys(t).length)return!1;for(n=s;0!=n--;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=s;0!=n--;){const s=o[n];if(("_owner"!==s||!e.$$typeof)&&!oy(e[s],t[s]))return!1}return!0}return e!=e&&t!=t}function ry(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function iy(e,t){const s=ry(e);return Math.round(t*s)/s}function ay(e){const t=ty.useRef(e);return ny((()=>{t.current=e})),t}const{useBlockElementRef:ly,cleanEmptyObject:cy}=$(g.privateApis);function dy({thread:e,calculatedOffset:t,setHeights:s,selectedThread:n,setBlockRef:o,commentLastUpdated:r}){const i=(0,p.useRef)();ly(e.blockClientId,i);const a=(0,p.useCallback)(((e,t)=>{s((s=>s[e]!==t?{...s,[e]:t}:s))}),[s]),{y:l,refs:c}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:s="absolute",middleware:n=[],platform:o,elements:{reference:r,floating:i}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[d,u]=ty.useState({x:0,y:0,strategy:s,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=ty.useState(n);oy(p,n)||m(n);const[h,g]=ty.useState(null),[_,f]=ty.useState(null),b=ty.useCallback((e=>{e!==w.current&&(w.current=e,g(e))}),[]),y=ty.useCallback((e=>{e!==S.current&&(S.current=e,f(e))}),[]),x=r||h,v=i||_,w=ty.useRef(null),S=ty.useRef(null),k=ty.useRef(d),C=null!=l,P=ay(l),j=ay(o),E=ty.useCallback((()=>{if(!w.current||!S.current)return;const e={placement:t,strategy:s,middleware:p};j.current&&(e.platform=j.current),ey(w.current,S.current,e).then((e=>{const t={...e,isPositioned:!0};T.current&&!oy(k.current,t)&&(k.current=t,sy.flushSync((()=>{u(t)})))}))}),[p,t,s,j]);ny((()=>{!1===c&&k.current.isPositioned&&(k.current.isPositioned=!1,u((e=>({...e,isPositioned:!1}))))}),[c]);const T=ty.useRef(!1);ny((()=>(T.current=!0,()=>{T.current=!1})),[]),ny((()=>{if(x&&(w.current=x),v&&(S.current=v),x&&v){if(P.current)return P.current(x,v,E);E()}}),[x,v,E,P,C]);const B=ty.useMemo((()=>({reference:w,floating:S,setReference:b,setFloating:y})),[b,y]),I=ty.useMemo((()=>({reference:x,floating:v})),[x,v]),N=ty.useMemo((()=>{const e={position:s,left:0,top:0};if(!I.floating)return e;const t=iy(I.floating,d.x),n=iy(I.floating,d.y);return a?{...e,transform:"translate("+t+"px, "+n+"px)",...ry(I.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:t,top:n}}),[s,a,I.floating,d.x,d.y]);return ty.useMemo((()=>({...d,update:E,refs:B,elements:I,floatingStyles:N})),[d,E,B,I,N])}({placement:"right-start",middleware:[mb({crossAxis:t||-16})],whileElementsMounted:Jb});return(0,p.useEffect)((()=>{i.current&&c.setReference(i.current)}),[i,c,r]),(0,p.useEffect)((()=>{c.floating?.current&&o(e.id,i.current)}),[e.id,c.floating,o]),(0,p.useEffect)((()=>{if(c.floating?.current){const t=c.floating.current.scrollHeight;a(e.id,t)}}),[e.id,a,c.floating,n,r]),{blockRef:i,y:l,refs:c}}const{useBlockElement:uy}=$(g.privateApis);function py({onSubmit:e,newNoteFormState:t,setNewNoteFormState:s,commentSidebarRef:n,reflowComments:o=eb,isFloating:r=!1,y:i,refs:a}){const{clientId:l}=(0,d.useSelect)((e=>{const{getSelectedBlockClientId:t}=e(g.store);return{clientId:t()}}),[]),u=uy(l),{toggleBlockSpotlight:p}=$((0,d.useDispatch)(g.store));return"open"===t&&l?(0,c.jsxs)(Hn.__experimentalVStack,{className:mr("editor-collab-sidebar-panel__thread is-selected",{"is-floating":r}),spacing:"3",tabIndex:0,"aria-label":(0,fs.__)("New note"),role:"treeitem",ref:r?a.setFloating:void 0,style:r?{top:i,opacity:i?void 0:0}:void 0,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(p(l,!1),s("closed"))},children:[(0,c.jsx)(Hn.__experimentalHStack,{alignment:"left",spacing:"3",children:(0,c.jsx)(ob,{})}),(0,c.jsx)(rb,{onSubmit:async t=>{const{id:o}=await e({content:t});nb(o,n.current),s("creating")},onCancel:()=>{s("closed"),u?.focus(),p(l,!1)},reflowComments:o,submitButtonText:(0,fs.__)("Add note"),labelText:(0,fs.__)("New note")})]}):null}const{useBlockElement:my}=$(g.privateApis),{Menu:hy}=$(Hn.privateApis);function gy({threads:e,onEditComment:t,onAddReply:s,onCommentDelete:n,newNoteFormState:o,setNewNoteFormState:r,commentSidebarRef:i,reflowComments:a,isFloating:l=!1,commentLastUpdated:u}){const[m,h]=(0,p.useState)({}),[_,f]=(0,p.useState)(null),[b,y]=(0,p.useState)({}),[x,v]=(0,p.useState)({}),{setCanvasMinHeight:w}=$((0,d.useDispatch)(vc)),{selectBlock:S,toggleBlockSpotlight:k}=$((0,d.useDispatch)(g.store)),{blockCommentId:C,selectedBlockClientId:P,orderedBlockIds:j}=(0,d.useSelect)((e=>{const{getBlockAttributes:t,getSelectedBlockClientId:s,getClientIdsWithDescendants:n}=e(g.store),o=s();return{blockCommentId:o?t(o)?.metadata?.noteId:null,selectedBlockClientId:o,orderedBlockIds:n()}}),[]),E=my(P),T=(0,p.useMemo)((()=>{const t=[...e],s=[];if(l&&"open"===o){const e={id:"new-note-thread",blockClientId:P,content:{rendered:""}};return j.forEach((n=>{if(n===P)s.push(e);else{const e=t.find((e=>e.blockClientId===n));e&&s.push(e)}})),s}return t}),[e,l,o,P,j]),B=async e=>{const t=T.findIndex((t=>t.id===e.id)),s=T[t+1],o=T[t-1];if(await n(e),0!==e.parent)return f(e.parent),void nb(e.parent,i.current);s?(f(s.id),nb(s.id,i.current)):o?(f(o.id),nb(o.id,i.current)):(f(null),r("closed"),E?.focus())};(0,p.useEffect)((()=>{f("open"===o?"new-note-thread":C)}),[C,o]);const I=(0,p.useCallback)(((e,t)=>{v((s=>({...s,[e]:t})))}),[]);(0,p.useEffect)((()=>{const{offsets:e,minHeight:t}=(()=>{const e={};if(!l)return{offsets:e,minHeight:0};const t=T.findIndex((e=>e.id===_)),s=-1===t?0:t,n=T[s];if(!n||!x[n.id])return{offsets:e,minHeight:0};let o=x[n.id],r=o?.getBoundingClientRect();const i=r?.top||0,a=m[n.id]||0;e[n.id]=-16;let c={threadTop:i-16,threadHeight:a};for(let t=s+1;t<T.length;t++){const s=T[t];if(!x[s.id])continue;o=x[s.id],r=o?.getBoundingClientRect();const n=r?.top||0,i=m[s.id]||0;let a=-16;const l=c.threadTop+c.threadHeight;n<l+16&&(a=l-n+20),e[s.id]=a,c={threadTop:n+a,threadHeight:i}}let d={threadTop:i-16};for(let s=t-1;s>=0;s--){const t=T[s];if(!x[t.id])continue;o=x[t.id],r=o?.getBoundingClientRect();const n=r?.top||0,i=m[t.id]||0;let a=-16;n+i>d.threadTop&&(a=d.threadTop-n-i-20),e[t.id]=a,d={threadTop:n+a}}let u=0;const p=T[T.length-1];if(x[p.id]){const t=x[p.id],s=t?.getBoundingClientRect();u=(s?.top||0)+(m[p.id]||0)+(e[p.id]||0)+32}return{offsets:e,minHeight:u}})();Object.keys(e).length>0&&y(e),w(t)}),[m,x,l,T,_,w]);return Array.isArray(T)&&T.length>0||l?(0,c.jsxs)(c.Fragment,{children:[!l&&"open"===o&&(0,c.jsx)(py,{onSubmit:s,newNoteFormState:o,setNewNoteFormState:r,commentSidebarRef:i}),T.map((e=>(0,c.jsx)(_y,{thread:e,onAddReply:s,onCommentDelete:B,onEditComment:t,isSelected:_===e.id,setSelectedThread:f,setNewNoteFormState:r,commentSidebarRef:i,reflowComments:a,isFloating:l,calculatedOffset:b[e.id]??0,setHeights:h,setBlockRef:I,selectedThread:_,commentLastUpdated:u,newNoteFormState:o,onKeyDown:t=>((e,t,s)=>{if(e.defaultPrevented)return;const n=T.findIndex((e=>e.id===t.id));"Enter"!==e.key&&"ArrowRight"!==e.key||e.currentTarget!==e.target||s?("Enter"===e.key||"ArrowLeft"===e.key)&&e.currentTarget===e.target&&s||"Escape"===e.key?(f(null),r("closed"),t.blockClientId&&k(t.blockClientId,!1),nb(t.id,i.current)):"ArrowDown"===e.key&&n<T.length-1&&e.currentTarget===e.target?nb(T[n+1].id,i.current):"ArrowUp"===e.key&&n>0&&e.currentTarget===e.target?nb(T[n-1].id,i.current):"Home"===e.key&&e.currentTarget===e.target?nb(T[0].id,i.current):"End"===e.key&&e.currentTarget===e.target&&nb(T[T.length-1].id,i.current):(r("closed"),f(t.id),t.blockClientId&&(S(t.blockClientId,null),k(t.blockClientId,!0)))})(t,e,_===e.id)},e.id)))]}):(0,c.jsx)(py,{onSubmit:s,newNoteFormState:o,setNewNoteFormState:r,commentSidebarRef:i})}function _y({thread:e,onEditComment:t,onAddReply:s,onCommentDelete:n,isSelected:o,setNewNoteFormState:r,commentSidebarRef:i,reflowComments:a,isFloating:l,calculatedOffset:u,setHeights:h,setBlockRef:_,setSelectedThread:f,selectedThread:b,commentLastUpdated:y,newNoteFormState:x,onKeyDown:v}){const{toggleBlockHighlight:w,selectBlock:S,toggleBlockSpotlight:k}=$((0,d.useDispatch)(g.store)),C=my(e.blockClientId),P=(0,m.useDebounce)(w,50),{y:j,refs:E}=dy({thread:e,calculatedOffset:u,setHeights:h,setBlockRef:_,selectedThread:b,commentLastUpdated:y}),T=(0,p.useRef)(!1),B=()=>{f(null),r("closed"),k(e.blockClientId,!1)},I=e?.reply||[],N=I.length>0?I[I.length-1]:void 0,R=I.length>0?I.slice(0,-1):[],D=function(e,t=10){if(!e)return"";const s=(0,fs._x)("words","Word count type. Do not translate!"),n=e.trim();let o="";if("words"===s)o=n.split(" ",t).join(" ");else if("characters_excluding_spaces"===s){const e=n.split("",t).join(""),s=e.length-e.replaceAll(" ","").length;o=n.split("",t+s).join("")}else"characters_including_spaces"===s&&(o=n.split("",t).join(""));return o!==n?o+"…":o}((0,Uc.__unstableStripHTML)(e.content?.rendered),10),A=e.blockClientId?(0,fs.sprintf)((0,fs.__)("Note: %s"),D):(0,fs.sprintf)((0,fs.__)("Original block deleted. Note: %s"),D);return"new-note-thread"===e.id&&"open"===x&&l?(0,c.jsx)(py,{onSubmit:s,newNoteFormState:x,setNewNoteFormState:r,commentSidebarRef:i,reflowComments:a,isFloating:l,y:j,refs:E}):(0,c.jsxs)(Hn.__experimentalVStack,{className:mr("editor-collab-sidebar-panel__thread",{"is-selected":o,"is-floating":l}),id:`comment-thread-${e.id}`,spacing:"3",onClick:()=>{r("closed"),f(e.id),k(e.blockClientId,!0),e.blockClientId&&S(e.blockClientId,null)},onMouseEnter:()=>{P(e.blockClientId,!0)},onMouseLeave:()=>{P(e.blockClientId,!1)},onFocus:()=>{w(e.blockClientId,!0)},onBlur:t=>{const s=t.relatedTarget?.closest(".editor-collab-sidebar-panel__thread"),n=t.relatedTarget?.closest('[role="dialog"]'),o=T.current;s&&!o||n||o&&t.currentTarget.contains(t.relatedTarget)||(w(e.blockClientId,!1),B())},onKeyUp:e=>{"Tab"===e.key&&(T.current=!1)},onKeyDown:e=>{"Tab"===e.key?T.current=!0:v(e)},tabIndex:0,role:"treeitem","aria-label":A,"aria-expanded":o,ref:l?E.setFloating:void 0,style:l?{top:j}:void 0,children:[(0,c.jsx)(Hn.Button,{className:"editor-collab-sidebar-panel__skip-to-comment",variant:"secondary",size:"compact",onClick:()=>{nb(e.id,i.current,"textarea")},children:(0,fs.__)("Add new reply")}),!e.blockClientId&&(0,c.jsx)(Hn.__experimentalText,{as:"p",weight:500,variant:"muted",children:(0,fs.__)("Original block deleted.")}),(0,c.jsx)(fy,{thread:e,isExpanded:o,onEdit:(s={})=>{t(s),"approved"===s.status&&(B(),l?C?.focus():nb(e.id,i.current))},onDelete:n,reflowComments:a}),o&&I.map((s=>(0,c.jsx)(fy,{thread:s,parent:e,isExpanded:o,onEdit:t,onDelete:n,reflowComments:a},s.id))),!o&&R.length>0&&(0,c.jsx)(Hn.__experimentalHStack,{className:"editor-collab-sidebar-panel__more-reply-separator",children:(0,c.jsx)(Hn.Button,{size:"compact",variant:"tertiary",className:"editor-collab-sidebar-panel__more-reply-button",onClick:()=>{f(e.id),nb(e.id,i.current)},children:(0,fs.sprintf)((0,fs._n)("%s more reply","%s more replies",R.length),R.length)})}),!o&&N&&(0,c.jsx)(fy,{thread:N,parent:e,isExpanded:o,onEdit:t,onDelete:n,reflowComments:a}),o&&(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"2",role:"treeitem",children:[(0,c.jsx)(Hn.__experimentalHStack,{alignment:"left",spacing:"3",justify:"flex-start",children:(0,c.jsx)(ob,{})}),(0,c.jsx)(Hn.__experimentalVStack,{spacing:"2",children:(0,c.jsx)(rb,{onSubmit:n=>{"approved"===e.status?t({id:e.id,status:"hold",content:n}):s({content:n,parent:e.id})},onCancel:t=>{t.stopPropagation(),B(),nb(e.id,i.current)},submitButtonText:"approved"===e.status?(0,fs.__)("Reopen & Reply"):(0,fs.__)("Reply"),rows:"approved"===e.status?2:4,labelText:(0,fs.sprintf)((0,fs.__)("Reply to note %1$s by %2$s"),e.id,e.author_name),reflowComments:a})})]}),!!e.blockClientId&&(0,c.jsx)(Hn.Button,{className:"editor-collab-sidebar-panel__skip-to-block",variant:"secondary",size:"compact",onClick:e=>{e.stopPropagation(),C?.focus()},children:(0,fs.__)("Back to block")})]})}const fy=({thread:e,parent:t,isExpanded:s,onEdit:n,onDelete:o,reflowComments:r})=>{const[i,a]=(0,p.useState)(!1),[l,d]=(0,p.useState)(!1),u=(0,p.useRef)(null),m=()=>{a(!1),d(!1),u.current?.focus()},h="note"===e.type&&e.meta&&("resolved"===e.meta._wp_note_status||"reopen"===e.meta._wp_note_status),g=[{id:"edit",title:(0,fs.__)("Edit"),isEligible:({status:e})=>"approved"!==e,onClick:()=>{a("edit")}},{id:"reopen",title:(0,fs._x)("Reopen","Reopen note"),isEligible:({status:e})=>"approved"===e,onClick:()=>{n({id:e.id,status:"hold"})}},{id:"delete",title:(0,fs.__)("Delete"),isEligible:()=>!0,onClick:()=>{a("delete"),d(!0)}}],_=0===e.parent,f="approved"!==t?.status?g.filter((t=>t.isEligible(e))):[],b=0===e.parent?(0,fs.__)("Are you sure you want to delete this note? This will also delete all of this note's replies."):(0,fs.__)("Are you sure you want to delete this reply?");return(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"2",role:0!==e.parent?"treeitem":void 0,children:[(0,c.jsxs)(Hn.__experimentalHStack,{alignment:"left",spacing:"3",justify:"flex-start",children:[(0,c.jsx)(ob,{avatar:e?.author_avatar_urls?.[48],name:e?.author_name,date:e?.date,userId:e?.author}),s&&(0,c.jsx)(Hn.FlexItem,{className:"editor-collab-sidebar-panel__comment-status",onClick:e=>{e.stopPropagation()},children:(0,c.jsxs)(Hn.__experimentalHStack,{spacing:"0",children:[_&&(0,c.jsx)(Hn.Button,{label:(0,fs._x)("Resolve","Mark note as resolved"),size:"small",icon:wr,disabled:"approved"===e.status,accessibleWhenDisabled:"approved"===e.status,onClick:()=>{n({id:e.id,status:"approved"})}}),(0,c.jsxs)(hy,{placement:"bottom-end",children:[(0,c.jsx)(hy.TriggerButton,{render:(0,c.jsx)(Hn.Button,{ref:u,size:"small",icon:r_,label:(0,fs.__)("Actions"),disabled:!f.length,accessibleWhenDisabled:!0})}),(0,c.jsx)(hy.Popover,{modal:!1,children:f.map((e=>(0,c.jsx)(hy.Item,{onClick:()=>e.onClick(),children:(0,c.jsx)(hy.ItemLabel,{children:e.title})},e.id)))})]})]})})]}),"edit"===i?(0,c.jsx)(rb,{onSubmit:t=>{n({id:e.id,content:t}),a(!1),u.current?.focus()},onCancel:()=>m(),thread:e,submitButtonText:(0,fs._x)("Update","verb"),labelText:(0,fs.sprintf)((0,fs.__)("Edit note %1$s by %2$s"),e.id,e.author_name),reflowComments:r}):(0,c.jsx)(p.RawHTML,{className:mr("editor-collab-sidebar-panel__user-comment",{"editor-collab-sidebar-panel__resolution-text":h}),children:h?(()=>{const t="resolved"===e.meta._wp_note_status?(0,fs.__)("Marked as resolved"):(0,fs.__)("Reopened"),s=e?.content?.raw;return s&&"string"==typeof s&&""!==s.trim()?(0,fs.sprintf)((0,fs.__)("%1$s: %2$s"),t,s):t})():e?.content?.rendered}),"delete"===i&&(0,c.jsx)(Hn.__experimentalConfirmDialog,{isOpen:l,onConfirm:()=>{o(e),a(!1),d(!1)},onCancel:m,confirmButtonText:(0,fs.__)("Delete"),children:b})]})};const{CommentIconSlotFill:by}=$(g.privateApis),yy=({clientId:e,onClick:t,isDistractionFree:s})=>{const n=(0,d.useSelect)((t=>t(g.store).getBlock(e)),[e]);if(!n?.isValid||n?.name===(0,x.getUnregisteredTypeHandlerName)())return null;const o=s||"core/freeform"===n?.name;let r;return s?r=(0,fs.__)("Notes are disabled in distraction free mode."):"core/freeform"===n?.name&&(r=(0,fs.__)("Convert to blocks to add notes.")),(0,c.jsx)(Hn.MenuItem,{icon:Kf,onClick:t,"aria-haspopup":"dialog",disabled:o,info:r,children:(0,fs.__)("Add note")})};var xy=({onClick:e,isDistractionFree:t})=>(0,c.jsx)(by.Fill,{children:({clientId:s,onClose:n})=>(0,c.jsx)(yy,{clientId:s,isDistractionFree:t,onClick:()=>{e(),n()}})});const{CommentIconToolbarSlotFill:vy}=$(g.privateApis);var wy=({onClick:e,thread:t})=>{const s=(0,p.useMemo)((()=>{if(!t)return[];const e=new Map,s=[t,...t.reply];return s.sort(((e,t)=>new Date(e.date)-new Date(t.date))),s.forEach((t=>{t.author_name&&t.author_avatar_urls&&(e.has(t.author)||e.set(t.author,{name:t.author_name,avatar:t.author_avatar_urls?.[48]||t.author_avatar_urls?.[96],id:t.author,date:t.date}))})),Array.from(e.values())}),[t]);if(!s.length)return null;const n=s.length>3?s.slice(0,2):s,o=Math.max(0,s.length-n.length),r=s.length>100&&o>0?(0,fs.__)("100+"):(0,fs.sprintf)((0,fs.__)("+%s"),o);return(0,c.jsx)(vy.Fill,{children:(0,c.jsx)(Hn.ToolbarButton,{className:"comment-avatar-indicator",label:(0,fs.__)("View notes"),onClick:e,showTooltip:!0,children:(0,c.jsxs)(Hn.__experimentalHStack,{spacing:"1",children:[n.map((e=>(0,c.jsx)("img",{src:e.avatar,alt:e.name,className:"comment-avatar",style:{borderColor:sb(e.id)}},e.id))),o>0&&(0,c.jsx)(Hn.__experimentalText,{weight:500,children:r})]})})})};function Sy({newNoteFormState:e,setNewNoteFormState:t,styles:s,comments:n,commentSidebarRef:o,reflowComments:r,commentLastUpdated:i,isFloating:a=!1}){const{onCreate:l,onEdit:p,onDelete:m}=function(e=eb){const{createNotice:t}=(0,d.useDispatch)(_s.store),{saveEntityRecord:s,deleteEntityRecord:n}=(0,d.useDispatch)(u.store),{getCurrentPostId:o}=(0,d.useSelect)(vc),{getBlockAttributes:r,getSelectedBlockClientId:i}=(0,d.useSelect)(g.store),{updateBlockAttributes:a}=(0,d.useDispatch)(g.store),l=e=>{const s=e.message&&"unknown_error"!==e.code?(0,Ln.decodeEntities)(e.message):(0,fs.__)("An error occurred while performing an update.");t("error",s,{type:"snackbar",isDismissible:!0})};return{onCreate:async({content:n,parent:c})=>{try{const l=await s("root","comment",{post:o(),content:n,status:"hold",type:"note",parent:c||0},{throwOnError:!0});if(!c&&l?.id){const e=i(),t=r(e)?.metadata;a(e,{metadata:{...t,noteId:l.id}})}return t("snackbar",c?(0,fs.__)("Reply added."):(0,fs.__)("Note added."),{type:"snackbar",isDismissible:!0}),setTimeout(e,300),l}catch(t){e(),l(t)}},onEdit:async({id:n,content:r,status:i})=>{const a=i||"updated",c={approved:(0,fs.__)("Note marked as resolved."),hold:(0,fs.__)("Note reopened."),updated:(0,fs.__)("Note updated.")};try{if("approved"===i||"hold"===i){await s("root","comment",{id:n,status:i},{throwOnError:!0});const e={post:o(),content:r||"",type:"note",status:i,parent:n,meta:{_wp_note_status:"approved"===i?"resolved":"reopen"}};await s("root","comment",e,{throwOnError:!0})}else{const e={id:n,content:r,status:i};await s("root","comment",e,{throwOnError:!0})}t("snackbar",c[a]??(0,fs.__)("Note updated."),{type:"snackbar",isDismissible:!0}),e()}catch(t){e(),l(t)}},onDelete:async s=>{try{if(await n("root","comment",s.id,void 0,{throwOnError:!0}),!s.parent){const e=i(),t=r(e)?.metadata;a(e,{metadata:cy({...t,noteId:void 0})})}t("snackbar",(0,fs.__)("Note deleted."),{type:"snackbar",isDismissible:!0}),e()}catch(t){e(),l(t)}}}}(r);return(0,c.jsx)(Hn.__experimentalVStack,{className:"editor-collab-sidebar-panel",style:s,role:"tree",spacing:"3",justify:"flex-start",ref:e=>{e&&(o.current=e)},"aria-label":a?(0,fs.__)("Unresolved notes"):(0,fs.__)("All notes"),children:(0,c.jsx)(gy,{threads:n,onEditComment:p,onAddReply:l,onCommentDelete:m,newNoteFormState:e,setNewNoteFormState:t,commentSidebarRef:o,reflowComments:r,commentLastUpdated:i,isFloating:a})})}function ky({postId:e,mode:t}){const[s,n]=(0,p.useState)("closed"),{getActiveComplementaryArea:o}=(0,d.useSelect)(ja),{enableComplementaryArea:r}=(0,d.useDispatch)(ja),{toggleBlockSpotlight:i}=$((0,d.useDispatch)(g.store)),a=(0,m.useViewportMatch)("medium"),l=(0,p.useRef)(null),h=a&&"post-only"===t,{clientId:_,blockCommentId:f,isDistractionFree:b}=(0,d.useSelect)((e=>{const{getBlockAttributes:t,getSelectedBlockClientId:s,getSettings:n}=e(g.store),o=s();return{clientId:o,blockCommentId:o?t(o)?.metadata?.noteId:null,isDistractionFree:n().isDistractionFree}}),[]),{resultComments:y,unresolvedSortedThreads:x,reflowComments:v,commentLastUpdated:w}=function(e){const[t,s]=(0,p.useReducer)((()=>Date.now()),0),n={post:e,type:"note",status:"all",per_page:-1},{records:o}=(0,u.useEntityRecords)("root","comment",n,{enabled:!!e&&"number"==typeof e}),{getBlockAttributes:r}=(0,d.useSelect)(g.store),{clientIds:i}=(0,d.useSelect)((e=>{const{getClientIdsWithDescendants:t}=e(g.store);return{clientIds:t()}}),[]),{resultComments:a,unresolvedSortedThreads:l}=(0,p.useMemo)((()=>{if(!o||0===o.length)return{resultComments:[],unresolvedSortedThreads:[]};const e=i.reduce(((e,t)=>{const s=r(t)?.metadata?.noteId;return s&&(e[t]=s),e}),{}),t={},s=[];if(o.forEach((s=>{const n=Object.keys(e).find((t=>e[t]===s.id));t[s.id]={...s,reply:[],blockClientId:0===s.parent?n:null}})),o.forEach((e=>{0===e.parent?s.push(t[e.id]):t[e.parent]&&t[e.parent].reply.push(t[e.id])})),0===s?.length)return{resultComments:[],unresolvedSortedThreads:[]};const n=s.map((e=>({...e,reply:[...e.reply].reverse()}))),a=new Map(n.map((e=>[String(e.id),e]))),l=new Set(Object.values(e).map((e=>String(e)))),c=Object.values(e).map((e=>a.get(String(e)))).filter((e=>void 0!==e&&"hold"===e.status)),d=Object.values(e).map((e=>a.get(String(e)))).filter((e=>void 0!==e&&"approved"===e.status)),u=n.filter((e=>!l.has(String(e.id))));return{resultComments:[...c,...d,...u],unresolvedSortedThreads:c}}),[i,o,r]);return{resultComments:a,unresolvedSortedThreads:l,reflowComments:s,commentLastUpdated:t}}(e);!function(e=!1){const t=(0,d.useRegistry)();(0,p.useEffect)((()=>{if(!e)return;const{getActiveComplementaryArea:s}=t.select(ja),{disableComplementaryArea:n,enableComplementaryArea:o}=t.dispatch(ja),r=t.subscribe((()=>{null===s("core")&&o("core",Xf)}));return()=>{r(),s("core")===Xf&&n("core",Xf)}}),[e,t])}(h&&(x.length>0||"closed"!==s));const{merged:S}=Ti(),k=S?.styles?.color?.background,C=f?y.find((e=>e.id===f)):null,P=y.length>0||!h;async function j(){const e=await o("core"),t=Jf.find((t=>t===e));"approved"===C?.status?r("core",Qf):t&&P||r("core",h?Xf:Qf);const s=await o("core");Jf.includes(s)&&(n(C?"closed":"open"),nb(C?.id,l.current,C?void 0:"textarea"),i(_,!0))}return b?(0,c.jsx)(xy,{isDistractionFree:!0}):(0,c.jsxs)(c.Fragment,{children:[!!C&&(0,c.jsx)(wy,{thread:C,onClick:j}),(0,c.jsx)(xy,{onClick:j}),P&&(0,c.jsx)(Iu,{identifier:Qf,name:Qf,title:(0,fs.__)("All notes"),header:(0,c.jsx)("h2",{className:"interface-complementary-area-header__title",children:(0,fs.__)("All notes")}),icon:Kf,closeLabel:(0,fs.__)("Close Notes"),children:(0,c.jsx)(Sy,{comments:y,newNoteFormState:s,setNewNoteFormState:n,commentSidebarRef:l,reflowComments:v,commentLastUpdated:w})}),a&&(0,c.jsx)(Iu,{isPinnable:!1,header:!1,identifier:Xf,className:"editor-collab-sidebar",headerClassName:"editor-collab-sidebar__header",backgroundColor:k,children:(0,c.jsx)(Sy,{comments:x,newNoteFormState:s,setNewNoteFormState:n,commentSidebarRef:l,reflowComments:v,commentLastUpdated:w,styles:{backgroundColor:k},isFloating:!0})})]})}function Cy(){const{postId:e,mode:t,editorMode:s}=(0,d.useSelect)((e=>{const{getCurrentPostId:t,getRenderingMode:s,getEditorMode:n}=e(vc);return{postId:t(),mode:s(),editorMode:n()}}),[]);return e&&"number"==typeof e?"text"===s?null:(0,c.jsx)(Bd,{supportKeys:"editor.notes",children:(0,c.jsx)(ky,{postId:e,mode:t})}):null}var Py=function({postType:e,postId:t,templateId:s,settings:n,children:o,initialEdits:r,onActionPerformed:i,extraContent:a,extraSidebarPanels:l,...p}){const{post:m,template:h,hasLoadedPost:g,error:_}=(0,d.useSelect)((n=>{const{getEntityRecord:o,getResolutionError:r,hasFinishedResolution:i}=n(u.store),a=["postType",e,t];return{post:o(...a),template:s?o("postType",B,s):void 0,hasLoadedPost:i("getEntityRecord",a),error:r("getEntityRecord",a)?.message}}),[e,t,s]);return(0,c.jsxs)(c.Fragment,{children:[g&&!m&&(0,c.jsx)(Hn.Notice,{status:_?"error":"warning",isDismissible:!1,children:_||(0,fs.__)("You attempted to edit an item that doesn't exist. Perhaps it was deleted?")}),!!m&&(0,c.jsxs)(Rl,{post:m,__unstableTemplate:h,settings:n,initialEdits:r,useSubRegistry:!1,children:[(0,c.jsx)(sf,{...p,children:a}),o,(0,c.jsx)(qf,{onActionPerformed:i,extraPanels:l}),(0,c.jsx)(Cy,{})]})]})};const{PreferenceBaseOption:jy}=$(C.privateApis);function Ey(e){const t=(0,d.useSelect)((e=>e(vc).isPublishSidebarEnabled()),[]),{enablePublishSidebar:s,disablePublishSidebar:n}=(0,d.useDispatch)(vc);return(0,c.jsx)(jy,{isChecked:t,onChange:e=>e?s():n(),...e})}const{BlockManager:Ty}=$(g.privateApis),By=[];function Iy(){const{showBlockTypes:e,hideBlockTypes:t}=$((0,d.useDispatch)(vc)),{blockTypes:s,allowedBlockTypes:n,hiddenBlockTypes:o}=(0,d.useSelect)((e=>({blockTypes:e(x.store).getBlockTypes(),allowedBlockTypes:e(vc).getEditorSettings().allowedBlockTypes,hiddenBlockTypes:e(C.store).get("core","hiddenBlockTypes")??By})),[]),r=(0,p.useMemo)((()=>!0===n?s:s.filter((({name:e})=>n?.includes(e)))),[n,s]).filter((e=>(0,x.hasBlockSupport)(e,"inserter",!0)&&(!e.parent||e.parent.includes("core/post-content")))),i=o.filter((e=>r.some((t=>t.name===e)))),a=r.filter((e=>!i.includes(e.name))),l=r.length-a.length;const u=s=>{if(a.length>s.length){const e=a.filter((e=>!s.find((({name:t})=>t===e.name))));t(e.map((({name:e})=>e)))}else if(a.length<s.length){const t=s.filter((e=>!a.find((({name:t})=>t===e.name))));e(t.map((({name:e})=>e)))}};return(0,c.jsxs)("div",{className:"editor-block-visibility",children:[!!l&&(0,c.jsxs)("div",{className:"editor-block-visibility__disabled-blocks-count",children:[(0,fs.sprintf)((0,fs._n)("%d block is hidden.","%d blocks are hidden.",l),l),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:function(){u(r)},children:(0,fs.__)("Reset")})]}),(0,c.jsx)(Ty,{blockTypes:r,selectedBlockTypes:a,onChange:u,showSelectAll:!1})]})}const{PreferencesModal:Ny,PreferencesModalTabs:Ry,PreferencesModalSection:Dy,PreferenceToggleControl:Ay}=$(C.privateApis);function My({extraSections:e={}}){const t=(0,m.useViewportMatch)("medium"),s=(0,d.useSelect)((e=>{const{getEditorSettings:s}=e(vc),{get:n}=e(C.store),o=s().richEditingEnabled;return!n("core","distractionFree")&&t&&o}),[t]),{setIsListViewOpened:n,setIsInserterOpened:o}=(0,d.useDispatch)(vc),{set:r}=(0,d.useDispatch)(C.store),i=(0,p.useMemo)((()=>[{name:"general",tabLabel:(0,fs.__)("General"),content:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(Dy,{title:(0,fs.__)("Interface"),children:[(0,c.jsx)(Ay,{scope:"core",featureName:"showListViewByDefault",help:(0,fs.__)("Opens the List View panel by default."),label:(0,fs.__)("Always open List View")}),s&&(0,c.jsx)(Ay,{scope:"core",featureName:"showBlockBreadcrumbs",help:(0,fs.__)("Display the block hierarchy trail at the bottom of the editor."),label:(0,fs.__)("Show block breadcrumbs")}),(0,c.jsx)(Ay,{scope:"core",featureName:"allowRightClickOverrides",help:(0,fs.__)("Allows contextual List View menus via right-click, overriding browser defaults."),label:(0,fs.__)("Allow right-click contextual menus")}),(0,c.jsx)(Ay,{scope:"core",featureName:"enableChoosePatternModal",help:(0,fs.__)("Pick from starter content when creating a new page."),label:(0,fs.__)("Show starter patterns")})]}),(0,c.jsxs)(Dy,{title:(0,fs.__)("Document settings"),description:(0,fs.__)("Select what settings are shown in the document panel."),children:[(0,c.jsx)(uu.Slot,{}),(0,c.jsx)(dh,{taxonomyWrapper:(e,t)=>(0,c.jsx)(au,{label:t.labels.menu_name,panelName:`taxonomy-panel-${t.slug}`})}),(0,c.jsx)(gp,{children:(0,c.jsx)(au,{label:(0,fs.__)("Featured image"),panelName:"featured-image"})}),(0,c.jsx)(op,{children:(0,c.jsx)(au,{label:(0,fs.__)("Excerpt"),panelName:"post-excerpt"})}),(0,c.jsx)(Bd,{supportKeys:["comments","trackbacks"],children:(0,c.jsx)(au,{label:(0,fs.__)("Discussion"),panelName:"discussion-panel"})}),(0,c.jsx)(Td,{children:(0,c.jsx)(au,{label:(0,fs.__)("Page attributes"),panelName:"page-attributes"})})]}),t&&(0,c.jsx)(Dy,{title:(0,fs.__)("Publishing"),children:(0,c.jsx)(Ey,{help:(0,fs.__)("Review settings, such as visibility and tags."),label:(0,fs.__)("Enable pre-publish checks")})}),e?.general]})},{name:"appearance",tabLabel:(0,fs.__)("Appearance"),content:(0,c.jsxs)(Dy,{title:(0,fs.__)("Appearance"),description:(0,fs.__)("Customize the editor interface to suit your needs."),children:[(0,c.jsx)(Ay,{scope:"core",featureName:"fixedToolbar",onToggle:()=>r("core","distractionFree",!1),help:(0,fs.__)("Access all block and document tools in a single place."),label:(0,fs.__)("Top toolbar")}),(0,c.jsx)(Ay,{scope:"core",featureName:"distractionFree",onToggle:()=>{r("core","fixedToolbar",!0),o(!1),n(!1)},help:(0,fs.__)("Reduce visual distractions by hiding the toolbar and other elements to focus on writing."),label:(0,fs.__)("Distraction free")}),(0,c.jsx)(Ay,{scope:"core",featureName:"focusMode",help:(0,fs.__)("Highlights the current block and fades other content."),label:(0,fs.__)("Spotlight mode")}),e?.appearance]})},{name:"accessibility",tabLabel:(0,fs.__)("Accessibility"),content:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Dy,{title:(0,fs.__)("Navigation"),description:(0,fs.__)("Optimize the editing experience for enhanced control."),children:(0,c.jsx)(Ay,{scope:"core",featureName:"keepCaretInsideBlock",help:(0,fs.__)("Keeps the text cursor within blocks while navigating with arrow keys, preventing it from moving to other blocks and enhancing accessibility for keyboard users."),label:(0,fs.__)("Contain text cursor inside block")})}),(0,c.jsx)(Dy,{title:(0,fs.__)("Interface"),children:(0,c.jsx)(Ay,{scope:"core",featureName:"showIconLabels",label:(0,fs.__)("Show button text labels"),help:(0,fs.__)("Show text instead of icons on buttons across the interface.")})})]})},{name:"blocks",tabLabel:(0,fs.__)("Blocks"),content:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Dy,{title:(0,fs.__)("Inserter"),children:(0,c.jsx)(Ay,{scope:"core",featureName:"mostUsedBlocks",help:(0,fs.__)("Adds a category with the most frequently used blocks in the inserter."),label:(0,fs.__)("Show most used blocks")})}),(0,c.jsx)(Dy,{title:(0,fs.__)("Manage block visibility"),description:(0,fs.__)("Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later."),children:(0,c.jsx)(Iy,{})})]})},window.__experimentalMediaProcessing&&{name:"media",tabLabel:(0,fs.__)("Media"),content:(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)(Dy,{title:(0,fs.__)("General"),description:(0,fs.__)("Customize options related to the media upload flow."),children:[(0,c.jsx)(Ay,{scope:"core/media",featureName:"optimizeOnUpload",help:(0,fs.__)("Compress media items before uploading to the server."),label:(0,fs.__)("Pre-upload compression")}),(0,c.jsx)(Ay,{scope:"core/media",featureName:"requireApproval",help:(0,fs.__)("Require approval step when optimizing existing media."),label:(0,fs.__)("Approval step")})]})})}].filter(Boolean)),[s,e,o,n,r,t]);return(0,c.jsx)(Ry,{sections:i})}var Ly=function({postType:e}){const{registerPostTypeSchema:t}=$((0,d.useDispatch)(vc));(0,p.useEffect)((()=>{t(e)}),[t,e]);const{fields:s}=(0,d.useSelect)((t=>{const{getEntityFields:s}=$(t(vc));return{fields:s("postType",e)}}),[e]);return s};const Oy="content";var Fy={name:"core/pattern-overrides",getValues({select:e,clientId:t,context:s,bindings:n}){const o=s["pattern/overrides"],{getBlockAttributes:r}=e(g.store),i=r(t),a={};for(const e of Object.keys(n)){const t=o?.[i?.metadata?.name]?.[e];void 0!==t?a[e]=""===t?void 0:t:a[e]=i[e]}return a},setValues({select:e,dispatch:t,clientId:s,bindings:n}){const{getBlockAttributes:o,getBlockParentsByBlockName:r,getBlocks:i}=e(g.store),a=o(s),l=a?.metadata?.name;if(!l)return;const[c]=r(s,"core/block",!0),d=Object.entries(n).reduce(((e,[t,{newValue:s}])=>(e[t]=s,e)),{});if(!c){const e=s=>{for(const n of s)n.attributes?.metadata?.name===l&&t(g.store).updateBlockAttributes(n.clientId,d),e(n.innerBlocks)};return void e(i())}const u=o(c)?.[Oy];t(g.store).updateBlockAttributes(c,{[Oy]:{...u,[l]:{...u?.[l],...Object.entries(d).reduce(((e,[t,s])=>(e[t]=void 0===s?"":s,e)),{})}}})},canUserEditValue:()=>!0};const Vy=["core/navigation-link","core/navigation-submenu"],Uy=[{label:(0,fs.__)("Post Date"),args:{field:"date"},type:"string"},{label:(0,fs.__)("Post Modified Date"),args:{field:"modified"},type:"string"},{label:(0,fs.__)("Post Link"),args:{field:"link"},type:"string"}];var Hy={name:"core/post-data",getValues({select:e,context:t,bindings:s,clientId:n}){const o=Uy.map((e=>e.args.field)),{getBlockAttributes:r,getBlockName:i}=e(g.store),a=i?.(n);let l,c;if(Vy.includes(a)){const e=r?.(n);l=e?.id,c=e?.type}else l=t?.postId,c=t?.postType;const{getEditedEntityRecord:d}=e(u.store),p=d("postType",c,l),m={};for(const[e,t]of Object.entries(s))o.includes(t.args.field)?m[e]=p?.[t.args.field]??Uy.find((e=>e.args.field===t.args.field)).label:m[e]={};return m},setValues({dispatch:e,context:t,bindings:s,clientId:n,select:o}){const{getBlockName:r}=o(g.store),i=r?.(n);if(Vy.includes(i))return!1;const a={};Object.values(s).forEach((({args:e,newValue:t})=>{a[e.field]=t})),e(u.store).editEntityRecord("postType",t?.postType,t?.postId,a)},canUserEditValue({select:e,context:t}){const{getBlockName:s,getSelectedBlockClientId:n}=e(g.store),o=n(),r=s?.(o);if(Vy.includes(r))return!1;if(t?.query||t?.queryId)return!1;if(!t?.postType)return!1;return!!e(u.store).canUser("update",{kind:"postType",name:t?.postType,id:t?.postId})},getFieldsList({select:e}){const t=e(g.store).getSelectedBlock();return"core/post-date"!==t?.name||Vy.includes(t?.name)?[]:Uy}};function zy(e,t){const{getRegisteredPostMeta:s}=$(e(u.store)),n=s(t?.postType),o=[];return Object.entries(n).forEach((([e,t])=>{"footnotes"!==e&&"_"!==e.charAt(0)&&o.push({label:t.title||e,args:{key:e},default:t.default,type:t.type})})),o}function Gy({select:e,context:t,args:s}){const n=zy(e,t).find((e=>e.args.key===s.key));if(!n)return s.key;if(!t?.postId)return n.default||n.label||s.key;const{getEditedEntityRecord:o}=e(u.store),r=o("postType",t?.postType,t?.postId).meta;return r?.[s.key]??n?.label??s.key}var $y={name:"core/post-meta",getValues({select:e,context:t,bindings:s}){const n={};for(const[o,r]of Object.entries(s))n[o]=Gy({select:e,context:t,args:r.args});return n},setValues({dispatch:e,context:t,bindings:s}){const n={};Object.values(s).forEach((({args:e,newValue:t})=>{n[e.key]=t})),e(u.store).editEntityRecord("postType",t?.postType,t?.postId,{meta:n})},canUserEditValue({select:e,context:t,args:s}){if(t?.query||t?.queryId)return!1;if(!t?.postType)return!1;if(!zy(e,t).some((e=>e.args.key===s.key)))return!1;if(e(vc).getEditorSettings().enableCustomFields)return!1;return!!e(u.store).canUser("update",{kind:"postType",name:t?.postType,id:t?.postId})},getFieldsList:({select:e,context:t})=>zy(e,t).map((({default:e,...t})=>({...t})))};const Wy=["core/navigation-link","core/navigation-submenu"];function Zy(e,t){return{id:{label:(0,fs.__)("Term ID"),value:t,type:"string"},name:{label:(0,fs.__)("Name"),value:e?.name,type:"string"},slug:{label:(0,fs.__)("Slug"),value:e?.slug,type:"string"},link:{label:(0,fs.__)("Link"),value:e?.link,type:"string"},description:{label:(0,fs.__)("Description"),value:e?.description,type:"string"},parent:{label:(0,fs.__)("Parent ID"),value:e?.parent,type:"string"},count:{label:(0,fs.__)("Count"),value:`(${e?.count??0})`,type:"string"}}}function Yy(e,t,s){const{getEntityRecord:n}=e(u.store),{getBlockAttributes:o,getBlockName:r}=e(g.store);let i,a;const l=r?.(s);let c,d;if(Wy.includes(l)){const e=o?.(s);c=e?.id;const t=e?.type;d="tag"===t?"post_tag":t}else c=t?.termId,d=t?.taxonomy;return d&&c?(i=n("taxonomy",d,c),!i&&t?.termData&&(i=t.termData),i&&(a=Zy(i,c))):t?.termData&&(i=t.termData,a=Zy(i,i?.term_id)),a&&Object.keys(a).length?a:null}var qy={name:"core/term-data",usesContext:["taxonomy","termId","termData"],getValues({select:e,context:t,bindings:s,clientId:n}){const o=Yy(e,t,n),r={};for(const[e,t]of Object.entries(s)){const s=t.args.field,{value:n,label:i}=o?.[s]||{};r[e]=n??i??s}return r},setValues:({dispatch:e,context:t,bindings:s})=>!1,canUserEditValue({select:e,context:t,args:s}){const{getBlockName:n,getSelectedBlockClientId:o}=e(g.store),r=o(),i=n?.(r);if(Wy.includes(i))return!1;if(t?.termQuery)return!1;if(!t?.taxonomy||!t?.termId)return!1;Yy(e,t,void 0)?.[s.field];return!1},getFieldsList({select:e,context:t}){const s=e(g.store).getSelectedBlockClientId(),n=Yy(e,t,s);return n?Object.entries(n).map((([e,t])=>({label:t.label,type:t.type,args:{field:e}}))):[]}};const{store:Ky,...Qy}=i,Xy={};function Jy(e,t,s){const{registerEntityAction:n}=$((0,d.dispatch)(vc))}function ex(e,t,s){const{unregisterEntityAction:n}=$((0,d.dispatch)(vc))}function tx(e,t,s){const{registerEntityField:n}=$((0,d.dispatch)(vc))}function sx(e,t,s){const{unregisterEntityField:n}=$((0,d.dispatch)(vc))}G(Xy,{CreateTemplatePartModal:Jn,patternTitleField:ni,templateTitleField:Jr,BackButton:Xg,EntitiesSavedStatesExtensible:xd,Editor:Py,EditorContentSlotFill:Zg,GlobalStylesProvider:function({children:e}){const t=Ti();return t.isReady?(0,c.jsx)(Pi.Provider,{value:t,children:e}):null},mergeBaseAndUserConfigs:Ei,PluginPostExcerpt:lp,PostCardPanel:ff,PreferencesModal:function({extraSections:e={}}){const t=(0,d.useSelect)((e=>e(ja).isModalActive("editor/preferences")),[]),{closeModal:s}=(0,d.useDispatch)(ja);return t?(0,c.jsx)(Ny,{closeModal:s,children:(0,c.jsx)(My,{extraSections:e})}):null},usePostActions:cf,usePostFields:Ly,ToolsMoreMenuGroup:u_,ViewMoreMenuGroup:h_,ResizableEditor:U_,registerCoreBlockBindingsSources:function(){(0,x.registerBlockBindingsSource)(Fy),(0,x.registerBlockBindingsSource)(Hy),(0,x.registerBlockBindingsSource)($y),(0,x.registerBlockBindingsSource)(qy)},getTemplateInfo:Y,interfaceStore:Ky,...Qy})})(),(window.wp=window.wp||{}).editor=n})();

Al-HUWAITI Shell