WordPress/wp-includes/js/dist/edit-widgets.min.js
youknowriad 1516d05128 Block Editor: Package updates for 5.8 beta 1.
This includes the following fixes:


Widgets Editor:
  - Load widgets.php https://github.com/WordPress/gutenberg/pull/32299
 - Fix Legacy Widget Preview https://github.com/WordPress/gutenberg/pull/32300
 - Fix error when saving empty Legacy Widget block https://github.com/WordPress/gutenberg/pull/32359

Widget blocks in the customizer: 
 - Fix deselection blocks when the inspector is open https://github.com/WordPress/gutenberg/pull/32361
 - Display wide widgets as popovers https://github.com/WordPress/gutenberg/pull/31736

Global Styles:
 - Align classNames generation between client and server https://github.com/WordPress/gutenberg/pull/32352
 - Group typography block supports https://github.com/WordPress/gutenberg/pull/32252 https://github.com/WordPress/gutenberg/pull/32444 https://github.com/WordPress/gutenberg/pull/32459
 - Make theme.json syntax errors more visible to the users https://github.com/WordPress/gutenberg/pull/32404


Template Editor:
  - Update the appearance of the template details https://github.com/WordPress/gutenberg/pull/32042
  - Fix layout definition https://github.com/WordPress/gutenberg/pull/32425
  - Fix grouping post content block https://github.com/WordPress/gutenberg/pull/32453

Miscellaneous:
 - Prevent saving when the post is locked https://github.com/WordPress/gutenberg/pull/32341
 - Fix allowed block patterns selector https://github.com/WordPress/gutenberg/pull/32376
 - Fix wrong results in the Post Author picker https://github.com/WordPress/gutenberg/pull/32344
 - Fix notices position in top toolbar mode https://github.com/WordPress/gutenberg/pull/32238
 - Allow non-latin characters in post slugs https://github.com/WordPress/gutenberg/pull/32232
 - Fix Random collapse of the color settings panel https://github.com/WordPress/gutenberg/pull/32388
 - Fix theme logo theme mode not being removed on theme removal https://github.com/WordPress/gutenberg/pull/32370
 - Fix block alignment styles in the editor https://github.com/WordPress/gutenberg/pull/32454
 - Fix some block toolbar overlaps https://github.com/WordPress/gutenberg/pull/32424
 - Fix content loss when switching list types https://github.com/WordPress/gutenberg/pull/32432


Performance:
 - Improve the performance of buttons block https://github.com/WordPress/gutenberg/pull/32356
 - Improve the performance of the container blocks https://github.com/WordPress/gutenberg/pull/32380

Props noisysocks, nosolosw, jorgefilipecosta.
See #52991.

Built from https://develop.svn.wordpress.org/trunk@51089


git-svn-id: http://core.svn.wordpress.org/trunk@50698 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 08:09:53 +00:00

7 lines
54 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*! This file is auto-generated */
this.wp=this.wp||{},this.wp.editWidgets=function(e){var t={};function r(n){if(t[n])return t[n].exports;var c=t[n]={i:n,l:!1,exports:{}};return e[n].call(c.exports,c,c.exports,r),c.l=!0,c.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var c in e)r.d(n,c,function(t){return e[t]}.bind(null,c));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s="F35A")}({"//Lo":function(e,t,r){"use strict";var n=r("GRId"),c=r("Tqx9");const i=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(c.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"}));t.a=i},"1ZqX":function(e,t){e.exports=window.wp.data},"6aBm":function(e,t){e.exports=window.wp.mediaUtils},Cg8A:function(e,t,r){"use strict";var n=r("GRId"),c=r("Tqx9");const i=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(c.Path,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"}));t.a=i},F35A:function(e,t,r){"use strict";r.r(t),r.d(t,"initialize",(function(){return mt}));var n={};r.r(n),r.d(n,"persistStubPost",(function(){return B})),r.d(n,"saveEditedWidgetAreas",(function(){return R})),r.d(n,"saveWidgetAreas",(function(){return C})),r.d(n,"saveWidgetArea",(function(){return W})),r.d(n,"setWidgetIdForClientId",(function(){return L})),r.d(n,"setWidgetAreasOpenState",(function(){return P})),r.d(n,"setIsWidgetAreaOpen",(function(){return M})),r.d(n,"setIsInserterOpened",(function(){return G})),r.d(n,"closeGeneralSidebar",(function(){return D})),r.d(n,"moveBlockToWidgetArea",(function(){return F})),r.d(n,"__unstableToggleFeature",(function(){return V}));var c={};r.r(c),r.d(c,"getWidgetAreas",(function(){return U})),r.d(c,"getWidgets",(function(){return q}));var i={};r.r(i),r.d(i,"getWidgets",(function(){return z})),r.d(i,"getWidget",(function(){return H})),r.d(i,"getWidgetAreas",(function(){return K})),r.d(i,"getWidgetAreaForWidgetId",(function(){return Q})),r.d(i,"getEditedWidgetAreas",(function(){return Y})),r.d(i,"getReferenceWidgetBlocks",(function(){return J})),r.d(i,"isSavingWidgetAreas",(function(){return X})),r.d(i,"getIsWidgetAreaOpen",(function(){return Z})),r.d(i,"isInserterOpened",(function(){return $})),r.d(i,"canInsertBlockInWidgetArea",(function(){return ee})),r.d(i,"__unstableIsFeatureActive",(function(){return te}));var o={};r.r(o),r.d(o,"metadata",(function(){return me})),r.d(o,"name",(function(){return ge})),r.d(o,"settings",(function(){return pe}));var a=r("GRId"),s=r("HSyU"),l=r("QyPg"),d=r("jZUy"),u=r("GLVC"),b=r("ywyh"),m=r.n(b),g=r("1ZqX"),p=r("YLtl");const O=Object(p.flow)([g.combineReducers,(j={features:{fixedToolbar:!1,welcomeGuide:!0}},e=>(t=j,r)=>e(t,r))])({features:(e,t)=>"TOGGLE_FEATURE"===t.type?{...e,[t.feature]:!e[t.feature]}:e});var j,f=Object(g.combineReducers)({blockInserterPanel:function(e=!1,t){switch(t.type){case"SET_IS_INSERTER_OPENED":return t.value}return e},widgetAreasOpenState:function(e={},t){const{type:r}=t;switch(r){case"SET_WIDGET_AREAS_OPEN_STATE":return t.widgetAreasOpenState;case"SET_IS_WIDGET_AREA_OPEN":{const{clientId:r,isOpen:n}=t;return{...e,[r]:n}}default:return e}},preferences:O});const _="root",E=e=>"widget-area-"+e;const w="core/edit-widgets";function h(e,t,...r){return{type:"SELECT",registryName:e,selectorName:t,args:r}}function y(e,t,...r){return{type:"DISPATCH",registryName:e,actionName:t,args:r}}const v={AWAIT_PROMISE:({promise:e})=>e,SELECT:Object(g.createRegistryControl)(e=>({registryName:t,selectorName:r,args:n})=>e.select(t)[r](...n)),GET_PENDING_ACTIONS:Object(g.createRegistryControl)(e=>({postId:t})=>{var r;return(null===(r=k(e).processingQueue[t])||void 0===r?void 0:r.pendingActions)||[]}),IS_PROCESSING_POST:Object(g.createRegistryControl)(e=>({postId:t})=>{var r;return null===(r=k(e).processingQueue[t])||void 0===r?void 0:r.inProgress}),DISPATCH:Object(g.createRegistryControl)(e=>({registryName:t,actionName:r,args:n})=>e.dispatch(t)[r](...n)),RESOLVE_WIDGET_AREAS:Object(g.createRegistryControl)(e=>({query:t})=>e.resolveSelect("core").getEntityRecords(_,"sidebar",t)),RESOLVE_WIDGETS:Object(g.createRegistryControl)(e=>({query:t})=>e.resolveSelect("core").getEntityRecords("root","widget",t))},k=e=>e.stores[w].store.getState();var S=v,I=r("l3Sj"),A=r("onLe"),x=r("U60i");function T(e){if("block"===e.id_base){const t=Object(s.parse)(e.instance.raw.content);return t.length?Object(u.addWidgetIdToBlock)(t[0],e.id):Object(u.addWidgetIdToBlock)(Object(s.createBlock)("core/paragraph",{},[]),e.id)}let t;return t=e._embedded.about[0].is_multi?{idBase:e.id_base,instance:e.instance}:{id:e.id},Object(u.addWidgetIdToBlock)(Object(s.createBlock)("core/legacy-widget",t,[]),e.id)}function N(e,t={}){let r;var n,c,i;"core/legacy-widget"===e.name&&(e.attributes.id||e.attributes.instance)?r={...t,id:null!==(n=e.attributes.id)&&void 0!==n?n:t.id,id_base:null!==(c=e.attributes.idBase)&&void 0!==c?c:t.id_base,instance:null!==(i=e.attributes.instance)&&void 0!==i?i:t.instance}:r={...t,id_base:"block",instance:{raw:{content:Object(s.serialize)(e)}}};return delete r.rendered,delete r.rendered_form,r}const B=function*(e,t){const r=((e,t)=>({id:e,slug:e,status:"draft",type:"page",blocks:t,meta:{widgetAreaId:e}}))(e,t);return yield y("core","receiveEntityRecords",_,"postType",r,{id:r.id},!1),r};function*R(){const e=yield h(w,"getEditedWidgetAreas");if(null!=e&&e.length)try{yield*C(e),yield y(A.store,"createSuccessNotice",Object(I.__)("Widgets saved."),{type:"snackbar"})}catch(e){yield y(A.store,"createErrorNotice",Object(I.sprintf)(Object(I.__)("There was an error. %s"),e.message),{type:"snackbar"})}}function*C(e){try{for(const t of e)yield*W(t.id)}finally{yield y("core","finishResolution","getEntityRecord",_,"sidebar",{per_page:-1})}}function*W(e){const t=yield h(w,"getWidgets"),r=yield h("core","getEditedEntityRecord",_,"postType",E(e)),n=Object.values(t).filter(({sidebar:t})=>t===e),c=[],i=r.blocks.filter(({attributes:{id:e}})=>{if(e){if(c.includes(e))return!1;c.push(e)}return!0}),o=n.filter(({id:e})=>!i.some(t=>Object(u.getWidgetIdFromBlock)(t)===e)),a=[],s=[],l=[];for(let r=0;r<i.length;r++){const n=i[r],c=Object(u.getWidgetIdFromBlock)(n),o=N(n,t[c]);if(l.push(c),c){yield y("core","editEntityRecord","root","widget",c,{...o,sidebar:e});if(!(yield h("core","hasEditsForEntityRecord","root","widget",c)))continue;s.push(({saveEditedEntityRecord:e})=>e("root","widget",c))}else s.push(({saveEntityRecord:t})=>t("root","widget",{...o,sidebar:e}));a.push({block:n,position:r,clientId:n.clientId})}for(const e of o)s.push(({deleteEntityRecord:t})=>t("root","widget",e.id,{force:!0}));const d=(yield y("core","__experimentalBatch",s)).filter(e=>!e.hasOwnProperty("deleted")),b=[];for(let e=0;e<d.length;e++){const t=d[e],{block:r,position:n}=a[e];yield y("core/block-editor","updateBlockAttributes",r.clientId,{__internalWidgetId:t.id});var m;if(yield h("core","getLastEntitySaveError","root","widget",t.id))b.push((null===(m=r.attributes)||void 0===m?void 0:m.name)||(null==r?void 0:r.name));l[n]||(l[n]=t.id)}if(b.length)throw new Error(Object(I.sprintf)(Object(I.__)("Could not save the following widgets: %s."),b.join(", ")));yield y("core","editEntityRecord",_,"sidebar",e,{widgets:l}),yield*function*(e){const t=yield h("core","getLastEntitySaveError",_,"sidebar",e);yield y("core","saveEditedEntityRecord",_,"sidebar",e);const r=yield h("core","getLastEntitySaveError",_,"sidebar",e);if(r&&t!==r)throw new Error(r)}(e),yield y("core","receiveEntityRecords",_,"postType",r,void 0)}function L(e,t){return{type:"SET_WIDGET_ID_FOR_CLIENT_ID",clientId:e,widgetId:t}}function P(e){return{type:"SET_WIDGET_AREAS_OPEN_STATE",widgetAreasOpenState:e}}function M(e,t){return{type:"SET_IS_WIDGET_AREA_OPEN",clientId:e,isOpen:t}}function G(e){return{type:"SET_IS_INSERTER_OPENED",value:e}}function*D(){yield y(x.g.name,"disableComplementaryArea",w)}function*F(e,t){const r=yield h("core/block-editor","getBlockRootClientId",[e]),n=(yield h("core/block-editor","getBlocks")).find(({attributes:e})=>e.id===t).clientId,c=(yield h("core/block-editor","getBlockOrder",n)).length;(yield h(w,"getIsWidgetAreaOpen",n))||(yield y(w,"setIsWidgetAreaOpen",n,!0)),yield y("core/block-editor","moveBlocksToPosition",[e],r,n,c)}function V(e){return{type:"TOGGLE_FEATURE",feature:e}}function*U(){const e={per_page:-1};yield function(e={per_page:-1}){return{type:"RESOLVE_WIDGET_AREAS",query:e}}(e);const t=[],r=(yield h("core","getEntityRecords",_,"sidebar",e)).sort((e,t)=>"wp_inactive_widgets"===e.id?1:"wp_inactive_widgets"===t.id?-1:0);for(const e of r)t.push(Object(s.createBlock)("core/widget-area",{id:e.id,name:e.name})),e.widgets.length||(yield B(E(e.id),[]));const n={};t.forEach((e,t)=>{n[e.clientId]=0===t}),yield P(n),yield B("widget-areas",t)}function*q(){const e={per_page:-1,_embed:"about"};yield function(e={per_page:-1,_embed:"about"}){return{type:"RESOLVE_WIDGETS",query:e}}(e);const t=yield h("core","getEntityRecords","root","widget",e),r={};for(const e of t){const t=T(e);r[e.sidebar]=r[e.sidebar]||[],r[e.sidebar].push(t)}for(const e in r)r.hasOwnProperty(e)&&(yield B(E(e),r[e]))}const z=Object(g.createRegistrySelector)(e=>()=>{const t=e("core").getEntityRecords("root","widget",{per_page:-1,_embed:"about"});return Object(p.keyBy)(t,"id")}),H=Object(g.createRegistrySelector)(e=>(t,r)=>e(w).getWidgets()[r]),K=Object(g.createRegistrySelector)(e=>()=>{const t={per_page:-1};return e("core").getEntityRecords(_,"sidebar",t)}),Q=Object(g.createRegistrySelector)(e=>(t,r)=>e(w).getWidgetAreas().find(t=>e("core").getEditedEntityRecord(_,"postType",E(t.id)).blocks.map(e=>Object(u.getWidgetIdFromBlock)(e)).includes(r))),Y=Object(g.createRegistrySelector)(e=>(t,r)=>{let n=e(w).getWidgetAreas();return n?(r&&(n=n.filter(({id:e})=>r.includes(e))),n.filter(({id:t})=>e("core").hasEditsForEntityRecord(_,"postType",E(t))).map(({id:t})=>e("core").getEditedEntityRecord(_,"sidebar",t))):[]}),J=Object(g.createRegistrySelector)(e=>(t,r=null)=>{const n=[],c=e(w).getWidgetAreas();for(const t of c){const c=e("core").getEditedEntityRecord(_,"postType",E(t.id));for(const e of c.blocks){var i;"core/legacy-widget"!==e.name||r&&(null===(i=e.attributes)||void 0===i?void 0:i.referenceWidgetName)!==r||n.push(e)}}return n}),X=Object(g.createRegistrySelector)(e=>()=>{var t;const r=null===(t=e(w).getWidgetAreas())||void 0===t?void 0:t.map(({id:e})=>e);if(!r)return!1;for(const t of r){if(e("core").isSavingEntityRecord(_,"sidebar",t))return!0}const n=[...Object.keys(e(w).getWidgets()),void 0];for(const t of n){if(e("core").isSavingEntityRecord("root","widget",t))return!0}return!1}),Z=(e,t)=>{const{widgetAreasOpenState:r}=e;return!!r[t]};function $(e){return!!e.blockInserterPanel}const ee=Object(g.createRegistrySelector)(e=>(t,r)=>{const n=e("core/block-editor").getBlocks(),[c]=n;return e("core/block-editor").canInsertBlockType(r,c.clientId)});function te(e,t){return Object(p.get)(e.preferences.features,[t],!1)}const re={reducer:f,controls:S,selectors:i,resolvers:c,actions:n,persist:["preferences"]},ne=Object(g.createReduxStore)(w,re);Object(g.registerStore)(w,re),m.a.use((function(e,t){var r;return 0===(null===(r=e.path)||void 0===r?void 0:r.indexOf("/wp/v2/types/widget-area"))?Promise.resolve({}):t(e)}));var ce=r("axFQ"),ie=r("K9lf"),oe=r("g56x");const ae=Object(ie.createHigherOrderComponent)(e=>t=>{const r=Object(u.getWidgetIdFromBlock)(t),n=t.name,{widgetAreas:c,currentWidgetAreaId:i,canInsertBlockInWidgetArea:o}=Object(g.useSelect)(e=>{var t;if("core/widget-area"===n)return{};const c=e(ne);return{widgetAreas:c.getWidgetAreas(),currentWidgetAreaId:r?null===(t=c.getWidgetAreaForWidgetId(r))||void 0===t?void 0:t.id:void 0,canInsertBlockInWidgetArea:c.canInsertBlockInWidgetArea(n)}},[r,n]),{moveBlockToWidgetArea:s}=Object(g.useDispatch)(ne),l=(null==c?void 0:c.length)>1,d="core/widget-area"!==n&&l&&o;return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(e,t),d&&Object(a.createElement)(ce.BlockControls,null,Object(a.createElement)(u.MoveToWidgetArea,{widgetAreas:c,currentWidgetAreaId:i,onSelect:e=>{s(t.clientId,e)}})))},"withMoveToWidgetAreaToolbarItem");Object(oe.addFilter)("editor.BlockEdit","core/edit-widgets/block-edit",ae);var se=r("6aBm");Object(oe.addFilter)("editor.MediaUpload","core/edit-widgets/replace-media-upload",()=>se.MediaUpload);var le=r("tI+e");function de(){const[e,t,r]=Object(d.useEntityBlockEditor)("root","postType");return Object(a.createElement)(ce.InnerBlocks,{value:e,onInput:t,onChange:r,templateLock:!1,renderAppender:ce.InnerBlocks.DefaultBlockAppender})}const ue=e=>{const[t,r]=Object(a.useState)(!1);return Object(a.useEffect)(()=>{const{ownerDocument:t}=e.current;function n(){r(!0)}function c(){r(!1)}return t.addEventListener("dragstart",n),t.addEventListener("dragend",c),()=>{t.removeEventListener("dragstart",n),t.removeEventListener("dragend",c)}},[]),t},be=e=>{const[t,r]=Object(a.useState)(!1);return Object(a.useEffect)(()=>{const{ownerDocument:t}=e.current;function n(e){i(e)}function c(){r(!1)}function i(t){e.current.contains(t.target)?r(!0):r(!1)}return t.addEventListener("dragstart",n),t.addEventListener("dragend",c),t.addEventListener("dragenter",i),()=>{t.removeEventListener("dragstart",n),t.removeEventListener("dragend",c),t.removeEventListener("dragenter",i)}},[]),t},me={name:"core/widget-area",category:"widgets",attributes:{id:{type:"string"},name:{type:"string"}},supports:{html:!1,inserter:!1,customClassName:!1,reusable:!1,__experimentalToolbar:!1,__experimentalParentSelector:!1},editorStyle:"wp-block-widget-area-editor",style:"wp-block-widget-area"},{name:ge}=me,pe={title:Object(I.__)("Widget Area"),description:Object(I.__)("A widget area container."),__experimentalLabel:({name:e})=>e,edit:function({clientId:e,className:t,attributes:{id:r,name:n}}){const c=Object(g.useSelect)(t=>t(ne).getIsWidgetAreaOpen(e),[e]),{setIsWidgetAreaOpen:i}=Object(g.useDispatch)(ne),o=Object(a.useRef)(),s=Object(a.useCallback)(t=>i(e,t),[e]),l=ue(o),u=be(o),[b,m]=Object(a.useState)(!1);return Object(a.useEffect)(()=>{l?u&&!c?(s(!0),m(!0)):!u&&c&&b&&s(!1):m(!1)},[c,l,u,b]),Object(a.createElement)(le.Panel,{className:t,ref:o},Object(a.createElement)(le.PanelBody,{title:n,opened:c,onToggle:()=>{i(e,!c)},scrollAfterOpen:!l},({opened:e})=>Object(a.createElement)(le.__unstableDisclosureContent,{visible:e},Object(a.createElement)(d.EntityProvider,{kind:"root",type:"postType",id:"widget-area-"+r},Object(a.createElement)(de,null)))))}};var Oe=r("TvNi"),je=r("wx14"),fe=r("diJD"),_e=r("hF7m");function Ee(){const{redo:e,undo:t}=Object(g.useDispatch)("core"),{saveEditedWidgetAreas:r}=Object(g.useDispatch)(ne);return Object(_e.useShortcut)("core/edit-widgets/undo",e=>{t(),e.preventDefault()},{bindGlobal:!0}),Object(_e.useShortcut)("core/edit-widgets/redo",t=>{e(),t.preventDefault()},{bindGlobal:!0}),Object(_e.useShortcut)("core/edit-widgets/save",e=>{e.preventDefault(),r()},{bindGlobal:!0}),null}Ee.Register=function(){const{registerShortcut:e}=Object(g.useDispatch)(_e.store);return Object(a.useEffect)(()=>{e({name:"core/edit-widgets/undo",category:"global",description:Object(I.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/edit-widgets/redo",category:"global",description:Object(I.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"}}),e({name:"core/edit-widgets/save",category:"global",description:Object(I.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),e({name:"core/edit-widgets/keyboard-shortcuts",category:"main",description:Object(I.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}})},[e]),null};var we=Ee;var he=()=>Object(g.useSelect)(e=>{var t;const{getBlockSelectionEnd:r,getBlockParents:n,getBlockName:c}=e("core/block-editor"),i=r();if("core/widget-area"===c(i))return i;const o=n(i).find(e=>"core/widget-area"===c(e));if(o)return o;const{getEntityRecord:a}=e("core"),s=a(_,"postType","widget-areas");return null==s||null===(t=s.blocks[0])||void 0===t?void 0:t.clientId},[]);function ye({blockEditorSettings:e,children:t,...r}){const{hasUploadPermissions:n,reusableBlocks:c,isFixedToolbarActive:i,keepCaretInsideBlock:o}=Object(g.useSelect)(e=>({hasUploadPermissions:Object(p.defaultTo)(e("core").canUser("create","media"),!0),widgetAreas:e(ne).getWidgetAreas(),widgets:e(ne).getWidgets(),reusableBlocks:e("core").getEntityRecords("postType","wp_block"),isFixedToolbarActive:e(ne).__unstableIsFeatureActive("fixedToolbar"),keepCaretInsideBlock:e(ne).__unstableIsFeatureActive("keepCaretInsideBlock")}),[]),{setIsInserterOpened:s}=Object(g.useDispatch)(ne),l=Object(a.useMemo)(()=>{let t;return n&&(t=({onError:t,...r})=>{Object(se.uploadMedia)({wpAllowedMimeTypes:e.allowedMimeTypes,onError:({message:e})=>t(e),...r})}),{...e,__experimentalReusableBlocks:c,hasFixedToolbar:i,keepCaretInsideBlock:o,mediaUpload:t,templateLock:"all",__experimentalSetIsInserterOpened:s}},[e,i,o,n,c,s]),u=he(),[b,m,O]=Object(d.useEntityBlockEditor)(_,"postType",{id:"widget-areas"});return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(ce.BlockEditorKeyboardShortcuts.Register,null),Object(a.createElement)(we.Register,null),Object(a.createElement)(le.SlotFillProvider,null,Object(a.createElement)(ce.BlockEditorProvider,Object(je.a)({value:b,onInput:m,onChange:O,settings:l,useSubRegistry:!1},r),t,Object(a.createElement)(fe.ReusableBlocksMenuItems,{rootClientId:u}))))}var ve=r("TSYQ"),ke=r.n(ve),Se=r("Cg8A"),Ie=r("//Lo"),Ae=r("Mmq9");function xe({selectedWidgetAreaId:e}){const t=Object(g.useSelect)(e=>e(ne).getWidgetAreas(),[]),r=Object(a.useMemo)(()=>e&&(null==t?void 0:t.find(t=>t.id===e)),[e,t]);let n;return n=r?"wp_inactive_widgets"===e?Object(I.__)("Blocks in this Widget Area will not be displayed in your site."):r.description:Object(I.__)("Widget Areas are global parts in your sites layout that can accept blocks. These vary by theme, but are typically parts like your Sidebar or Footer."),Object(a.createElement)("div",{className:"edit-widgets-widget-areas"},Object(a.createElement)("div",{className:"edit-widgets-widget-areas__top-container"},Object(a.createElement)(ce.BlockIcon,{icon:Ie.a}),Object(a.createElement)("div",null,Object(a.createElement)("p",null,n),0===(null==t?void 0:t.length)&&Object(a.createElement)("p",null,Object(I.__)("Your theme does not contain any Widget Areas.")),!r&&Object(a.createElement)(le.Button,{href:Object(Ae.addQueryArgs)("customize.php",{"autofocus[panel]":"widgets",return:window.location.pathname}),isTertiary:!0},Object(I.__)("Manage with live preview")))))}const Te=a.Platform.select({web:!0,native:!1});function Ne({identifier:e,label:t,isActive:r}){const{enableComplementaryArea:n}=Object(g.useDispatch)(x.g);return Object(a.createElement)(le.Button,{onClick:()=>n(ne.name,e),className:ke()("edit-widgets-sidebar__panel-tab",{"is-active":r}),"aria-label":r?Object(I.sprintf)(Object(I.__)("%s (selected)"),t):t,"data-label":t},t)}function Be(){const{enableComplementaryArea:e}=Object(g.useDispatch)(x.g),{currentArea:t,hasSelectedNonAreaBlock:r,isGeneralSidebarOpen:n,selectedWidgetAreaBlock:c}=Object(g.useSelect)(e=>{const{getSelectedBlock:t,getBlock:r,getBlockParentsByBlockName:n}=e(ce.store),{getActiveComplementaryArea:c}=e(x.g),i=t();let o=c(ne.name);o||(o=i?"edit-widgets/block-inspector":"edit-widgets/block-areas");const a=!!o;let s;return i&&(s="core/widget-area"===i.name?i:r(n(i.clientId,"core/widget-area")[0])),{currentArea:o,hasSelectedNonAreaBlock:!(!i||"core/widget-area"===i.name),isGeneralSidebarOpen:a,selectedWidgetAreaBlock:s}},[]);return Object(a.useEffect)(()=>{r&&"edit-widgets/block-areas"===t&&n&&e("core/edit-widgets","edit-widgets/block-inspector"),!r&&"edit-widgets/block-inspector"===t&&n&&e("core/edit-widgets","edit-widgets/block-areas")},[r,e]),Object(a.createElement)(x.b,{className:"edit-widgets-sidebar",header:Object(a.createElement)("ul",null,Object(a.createElement)("li",null,Object(a.createElement)(Ne,{identifier:"edit-widgets/block-areas",label:c?c.attributes.name:Object(I.__)("Widget Areas"),isActive:"edit-widgets/block-areas"===t})),Object(a.createElement)("li",null,Object(a.createElement)(Ne,{identifier:"edit-widgets/block-inspector",label:Object(I.__)("Block"),isActive:"edit-widgets/block-inspector"===t}))),headerClassName:"edit-widgets-sidebar__panel-tabs",title:Object(I.__)("Settings"),closeLabel:Object(I.__)("Close settings"),scope:"core/edit-widgets",identifier:t,icon:Se.a,isActiveByDefault:Te},"edit-widgets/block-areas"===t&&Object(a.createElement)(xe,{selectedWidgetAreaId:null==c?void 0:c.attributes.id}),"edit-widgets/block-inspector"===t&&(r?Object(a.createElement)(ce.BlockInspector,null):Object(a.createElement)("span",{className:"block-editor-block-inspector__no-blocks"},Object(I.__)("No block selected."))))}var Re=r("w95h"),Ce=r("Q4Sy");var We=function(){const{hasEditedWidgetAreaIds:e,isSaving:t}=Object(g.useSelect)(e=>{var t;const{getEditedWidgetAreas:r,isSavingWidgetAreas:n}=e(ne);return{hasEditedWidgetAreaIds:(null===(t=r())||void 0===t?void 0:t.length)>0,isSaving:n()}},[]),{saveEditedWidgetAreas:r}=Object(g.useDispatch)(ne);return Object(a.createElement)(le.Button,{isPrimary:!0,isBusy:t,"aria-disabled":t,onClick:t?void 0:r,disabled:!e},t?Object(I.__)("Saving…"):Object(I.__)("Update"))},Le=r("Ntru"),Pe=r("K2cm"),Me=r("RxS6");function Ge(){const e=Object(g.useSelect)(e=>e(d.store).hasUndo()),{undo:t}=Object(g.useDispatch)(d.store);return Object(a.createElement)(le.ToolbarButton,{icon:Object(I.isRTL)()?Pe.a:Le.a,label:Object(I.__)("Undo"),shortcut:Me.displayShortcut.primary("z"),"aria-disabled":!e,onClick:e?t:void 0})}function De(){const e=Object(g.useSelect)(e=>e(d.store).hasRedo()),{redo:t}=Object(g.useDispatch)(d.store);return Object(a.createElement)(le.ToolbarButton,{icon:Object(I.isRTL)()?Le.a:Pe.a,label:Object(I.__)("Redo"),shortcut:Me.displayShortcut.primaryShift("z"),"aria-disabled":!e,onClick:e?t:void 0})}var Fe=r("VKE3"),Ve=r("K+tz"),Ue=r("RMJe"),qe=r("gdqT");function ze({label:e,info:t,messageActivated:r,messageDeactivated:n,shortcut:c,feature:i}){const o=Object(g.useSelect)(e=>e(ne).__unstableIsFeatureActive(i),[i]),{__unstableToggleFeature:s}=Object(g.useDispatch)(ne);return Object(a.createElement)(le.MenuItem,{icon:o&&Ue.a,isSelected:o,onClick:()=>{s(i),o?Object(qe.speak)(n||Object(I.__)("Feature deactivated")):Object(qe.speak)(r||Object(I.__)("Feature activated"))},role:"menuitemcheckbox",info:t,shortcut:c},e)}const He=[{keyCombination:{modifier:"primary",character:"b"},description:Object(I.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:Object(I.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:Object(I.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:Object(I.__)("Remove a link.")},{keyCombination:{modifier:"primary",character:"u"},description:Object(I.__)("Underline the selected text.")}];function Ke({keyCombination:e,forceAriaLabel:t}){const r=e.modifier?Me.displayShortcutList[e.modifier](e.character):e.character,n=e.modifier?Me.shortcutAriaLabel[e.modifier](e.character):e.character;return Object(a.createElement)("kbd",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":t||n},Object(p.castArray)(r).map((e,t)=>"+"===e?Object(a.createElement)(a.Fragment,{key:t},e):Object(a.createElement)("kbd",{key:t,className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-key"},e)))}var Qe=function({description:e,keyCombination:t,aliases:r=[],ariaLabel:n}){return Object(a.createElement)(a.Fragment,null,Object(a.createElement)("div",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-description"},e),Object(a.createElement)("div",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-term"},Object(a.createElement)(Ke,{keyCombination:t,forceAriaLabel:n}),r.map((e,t)=>Object(a.createElement)(Ke,{keyCombination:e,forceAriaLabel:n,key:t}))))};var Ye=function({name:e}){const{keyCombination:t,description:r,aliases:n}=Object(g.useSelect)(t=>{const{getShortcutKeyCombination:r,getShortcutDescription:n,getShortcutAliases:c}=t(_e.store);return{keyCombination:r(e),aliases:c(e),description:n(e)}});return t?Object(a.createElement)(Qe,{keyCombination:t,description:r,aliases:n}):null};const Je=({shortcuts:e})=>Object(a.createElement)("ul",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-list",role:"list"},e.map((e,t)=>Object(a.createElement)("li",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut",key:t},Object(p.isString)(e)?Object(a.createElement)(Ye,{name:e}):Object(a.createElement)(Qe,e)))),Xe=({title:e,shortcuts:t,className:r})=>Object(a.createElement)("section",{className:ke()("edit-widgets-keyboard-shortcut-help-modal__section",r)},!!e&&Object(a.createElement)("h2",{className:"edit-widgets-keyboard-shortcut-help-modal__section-title"},e),Object(a.createElement)(Je,{shortcuts:t})),Ze=({title:e,categoryName:t,additionalShortcuts:r=[]})=>{const n=Object(g.useSelect)(e=>e(_e.store).getCategoryShortcuts(t),[t]);return Object(a.createElement)(Xe,{title:e,shortcuts:n.concat(r)})};function $e({isModalActive:e,toggleModal:t}){return Object(_e.useShortcut)("core/edit-widgets/keyboard-shortcuts",t,{bindGlobal:!0}),e?Object(a.createElement)(le.Modal,{className:"edit-widgets-keyboard-shortcut-help-modal",title:Object(I.__)("Keyboard shortcuts"),closeLabel:Object(I.__)("Close"),onRequestClose:t},Object(a.createElement)(Xe,{className:"edit-widgets-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/edit-widgets/keyboard-shortcuts"]}),Object(a.createElement)(Ze,{title:Object(I.__)("Global shortcuts"),categoryName:"global"}),Object(a.createElement)(Ze,{title:Object(I.__)("Selection shortcuts"),categoryName:"selection"}),Object(a.createElement)(Ze,{title:Object(I.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:Object(I.__)("Change the block type after adding a new paragraph."),ariaLabel:Object(I.__)("Forward-slash")}]}),Object(a.createElement)(Xe,{title:Object(I.__)("Text formatting"),shortcuts:He})):null}const et={className:"edit-widgets-more-menu__content",position:"bottom left"},tt={tooltipPosition:"bottom"};function rt(){const[e,t]=Object(a.useState)(!1),r=()=>t(!e);return Object(_e.useShortcut)("core/edit-widgets/keyboard-shortcuts",r,{bindGlobal:!0}),Object(a.createElement)(a.Fragment,null,Object(a.createElement)(le.DropdownMenu,{className:"edit-widgets-more-menu",icon:Fe.a,label:Object(I.__)("Options"),popoverProps:et,toggleProps:tt},()=>Object(a.createElement)(a.Fragment,null,Object(a.createElement)(le.MenuGroup,{label:Object(I._x)("View","noun")},Object(a.createElement)(ze,{feature:"fixedToolbar",label:Object(I.__)("Top toolbar"),info:Object(I.__)("Access all block and document tools in a single place"),messageActivated:Object(I.__)("Top toolbar activated"),messageDeactivated:Object(I.__)("Top toolbar deactivated")})),Object(a.createElement)(le.MenuGroup,{label:Object(I.__)("Tools")},Object(a.createElement)(le.MenuItem,{onClick:()=>{t(!0)},shortcut:Me.displayShortcut.access("h")},Object(I.__)("Keyboard shortcuts")),Object(a.createElement)(ze,{feature:"welcomeGuide",label:Object(I.__)("Welcome Guide")}),Object(a.createElement)(le.MenuItem,{role:"menuitem",icon:Ve.a,href:Object(I.__)("https://wordpress.org/support/article/wordpress-editor/"),target:"_blank",rel:"noopener noreferrer"},Object(I.__)("Help"),Object(a.createElement)(le.VisuallyHidden,{as:"span"},Object(I.__)("(opens in a new tab)")))),Object(a.createElement)(le.MenuGroup,{label:Object(I.__)("Preferences")},Object(a.createElement)(ze,{feature:"keepCaretInsideBlock",label:Object(I.__)("Contain text cursor inside block"),info:Object(I.__)("Aids screen readers by stopping text caret from leaving blocks."),messageActivated:Object(I.__)("Contain text cursor inside block activated"),messageDeactivated:Object(I.__)("Contain text cursor inside block deactivated")})))),Object(a.createElement)($e,{isModalActive:e,toggleModal:r}))}var nt=function(){const e=Object(ie.useViewportMatch)("medium"),t=Object(a.useRef)(),r=he(),n=Object(g.useSelect)(e=>e(ne).getIsWidgetAreaOpen(r),[r]),c=Object(g.useSelect)(e=>e(ne).isInserterOpened()),{setIsWidgetAreaOpen:i,setIsInserterOpened:o}=Object(g.useDispatch)(ne),{selectBlock:s}=Object(g.useDispatch)(ce.store);return Object(a.createElement)(a.Fragment,null,Object(a.createElement)("div",{className:"edit-widgets-header"},Object(a.createElement)("div",{className:"edit-widgets-header__navigable-toolbar-wrapper"},e&&Object(a.createElement)("h1",{className:"edit-widgets-header__title"},Object(I.__)("Widgets")),!e&&Object(a.createElement)(le.VisuallyHidden,{as:"h1",className:"edit-widgets-header__title"},Object(I.__)("Widgets")),Object(a.createElement)(ce.NavigableToolbar,{className:"edit-widgets-header-toolbar","aria-label":Object(I.__)("Document tools")},Object(a.createElement)(le.ToolbarItem,{ref:t,as:le.Button,className:"edit-widgets-header-toolbar__inserter-toggle",isPrimary:!0,isPressed:c,onMouseDown:e=>{e.preventDefault()},onClick:()=>{c?t.current.focus():(n||(s(r),i(r,!0)),window.requestAnimationFrame(()=>o(!0)))},icon:Ce.a,label:Object(I._x)("Add block","Generic label for block inserter button")}),e&&Object(a.createElement)(a.Fragment,null,Object(a.createElement)(Ge,null),Object(a.createElement)(De,null),Object(a.createElement)(le.ToolbarItem,{as:ce.BlockNavigationDropdown})))),Object(a.createElement)("div",{className:"edit-widgets-header__actions"},Object(a.createElement)(We,null),Object(a.createElement)(x.f.Slot,{scope:"core/edit-widgets"}),Object(a.createElement)(rt,null))))};var ct=function(){const{removeNotice:e}=Object(g.useDispatch)(A.store),{notices:t}=Object(g.useSelect)(e=>({notices:e(A.store).getNotices()}),[]),r=Object(p.filter)(t,{isDismissible:!0,type:"default"}),n=Object(p.filter)(t,{isDismissible:!1,type:"default"}),c=Object(p.filter)(t,{type:"snackbar"});return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(le.NoticeList,{notices:n,className:"edit-widgets-notices__pinned"}),Object(a.createElement)(le.NoticeList,{notices:r,className:"edit-widgets-notices__dismissible",onRemove:e}),Object(a.createElement)(le.SnackbarList,{notices:c,className:"edit-widgets-notices__snackbar",onRemove:e}))};function it({blockEditorSettings:e}){return Object(a.createElement)("div",{className:"edit-widgets-block-editor"},Object(a.createElement)(ct,null),Object(a.createElement)(ce.BlockTools,null,Object(a.createElement)(we,null),Object(a.createElement)(ce.BlockEditorKeyboardShortcuts,null),Object(a.createElement)("div",{className:"editor-styles-wrapper"},Object(a.createElement)(ce.__unstableEditorStyles,{styles:e.styles}),Object(a.createElement)(ce.BlockSelectionClearer,null,Object(a.createElement)(ce.WritingFlow,null,Object(a.createElement)(ce.ObserveTyping,null,Object(a.createElement)(ce.BlockList,{className:"edit-widgets-main-block-list"})))))))}var ot=()=>{const e=Object(g.useSelect)(e=>{var t;const{getEntityRecord:r}=e("core"),n=r(_,"postType","widget-areas");return null==n||null===(t=n.blocks[0])||void 0===t?void 0:t.clientId},[]);return Object(g.useSelect)(t=>{const{getBlockRootClientId:r,getBlockSelectionEnd:n,getBlockOrder:c,getBlockIndex:i}=t(ce.store),o=n()||e,a=r(o);return o&&""===a?{rootClientId:o,insertionIndex:c(o).length}:{rootClientId:a,insertionIndex:i(o,a)+1}},[e])};const at={header:Object(I.__)("Widgets top bar"),body:Object(I.__)("Widgets and blocks"),sidebar:Object(I.__)("Widgets settings")};var st=function({blockEditorSettings:e}){const t=Object(ie.useViewportMatch)("medium","<"),r=Object(ie.useViewportMatch)("huge",">="),{setIsInserterOpened:n,closeGeneralSidebar:c}=Object(g.useDispatch)(ne),{rootClientId:i,insertionIndex:o}=ot(),{hasSidebarEnabled:s,isInserterOpened:l}=Object(g.useSelect)(e=>({hasSidebarEnabled:!!e(x.g).getActiveComplementaryArea(ne.name),isInserterOpened:!!e(ne).isInserterOpened()}),[]);Object(a.useEffect)(()=>{s&&!r&&n(!1)},[s,r]),Object(a.useEffect)(()=>{l&&!r&&c()},[l,r]);const[d,u]=Object(ie.__experimentalUseDialog)({onClose:()=>n(!1)});return Object(a.createElement)(x.e,{labels:at,header:Object(a.createElement)(nt,null),secondarySidebar:l&&Object(a.createElement)("div",Object(je.a)({ref:d},u,{className:"edit-widgets-layout__inserter-panel"}),Object(a.createElement)("div",{className:"edit-widgets-layout__inserter-panel-header"},Object(a.createElement)(le.Button,{icon:Re.a,onClick:()=>n(!1)})),Object(a.createElement)("div",{className:"edit-widgets-layout__inserter-panel-content"},Object(a.createElement)(ce.__experimentalLibrary,{showInserterHelpPanel:!0,shouldFocusBlock:t,rootClientId:i,__experimentalInsertionIndex:o}))),sidebar:s&&Object(a.createElement)(x.b.Slot,{scope:"core/edit-widgets"}),content:Object(a.createElement)(it,{blockEditorSettings:e})})};function lt(){const e=Object(g.useSelect)(e=>{const{getEditedWidgetAreas:t}=e(ne),r=t();return(null==r?void 0:r.length)>0},[]);return Object(a.useEffect)(()=>{const t=t=>{if(e)return t.returnValue=Object(I.__)("You have unsaved changes. If you proceed, they will be lost."),t.returnValue};return window.addEventListener("beforeunload",t),()=>{window.removeEventListener("beforeunload",t)}},[e]),null}function dt(){var e;const t=Object(g.useSelect)(e=>e(ne).__unstableIsFeatureActive("welcomeGuide"),[]),{__unstableToggleFeature:r}=Object(g.useDispatch)(ne),n=Object(g.useSelect)(e=>e(ne).getWidgetAreas({per_page:-1}));if(!t)return null;const c=null==n?void 0:n.every(e=>"wp_inactive_widgets"===e.id||e.widgets.every(e=>e.startsWith("block-"))),i=null!==(e=null==n?void 0:n.filter(e=>"wp_inactive_widgets"!==e.id).length)&&void 0!==e?e:0;return Object(a.createElement)(le.Guide,{className:"edit-widgets-welcome-guide",contentLabel:Object(I.__)("Welcome to block Widgets"),finishButtonText:Object(I.__)("Get started"),onFinish:()=>r("welcomeGuide"),pages:[{image:Object(a.createElement)(ut,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.gif"}),content:Object(a.createElement)(a.Fragment,null,Object(a.createElement)("h1",{className:"edit-widgets-welcome-guide__heading"},Object(I.__)("Welcome to block Widgets")),c?Object(a.createElement)(a.Fragment,null,Object(a.createElement)("p",{className:"edit-widgets-welcome-guide__text"},Object(I.sprintf)(Object(I._n)("Your theme provides %s “block” area for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how theyll look on your site.","Your theme provides %s different “block” areas for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how theyll look on your site.",i),i))):Object(a.createElement)(a.Fragment,null,Object(a.createElement)("p",{className:"edit-widgets-welcome-guide__text"},Object(I.__)("You can now add any block to your sites widget areas. Dont worry, all of your favorite widgets still work flawlessly.")),Object(a.createElement)("p",{className:"edit-widgets-welcome-guide__text"},Object(a.createElement)("strong",null,Object(I.__)("Want to stick with the old widgets?"))," ",Object(a.createElement)(le.ExternalLink,{href:Object(I.__)("https://wordpress.org/plugins/classic-widgets/")},Object(I.__)("Get the Classic Widgets plugin.")))))},{image:Object(a.createElement)(ut,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-editor.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-editor.gif"}),content:Object(a.createElement)(a.Fragment,null,Object(a.createElement)("h1",{className:"edit-widgets-welcome-guide__heading"},Object(I.__)("Make each block your own")),Object(a.createElement)("p",{className:"edit-widgets-welcome-guide__text"},Object(I.__)("Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.")))},{image:Object(a.createElement)(ut,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-library.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-library.gif"}),content:Object(a.createElement)(a.Fragment,null,Object(a.createElement)("h1",{className:"edit-widgets-welcome-guide__heading"},Object(I.__)("Get to know the block library")),Object(a.createElement)("p",{className:"edit-widgets-welcome-guide__text"},Object(a.createInterpolateElement)(Object(I.__)("All of the blocks available to you live in the block library. Youll find it wherever you see the <InserterIconImage /> icon."),{InserterIconImage:Object(a.createElement)("img",{className:"edit-widgets-welcome-guide__inserter-icon",alt:Object(I.__)("inserter"),src:"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A"})})))},{image:Object(a.createElement)(ut,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.gif"}),content:Object(a.createElement)(a.Fragment,null,Object(a.createElement)("h1",{className:"edit-widgets-welcome-guide__heading"},Object(I.__)("Learn how to use the block editor")),Object(a.createElement)("p",{className:"edit-widgets-welcome-guide__text"},Object(I.__)("New to the block editor? Want to learn more about using it? "),Object(a.createElement)(le.ExternalLink,{href:Object(I.__)("https://wordpress.org/support/article/wordpress-editor/")},Object(I.__)("Here's a detailed guide."))))}]})}function ut({nonAnimatedSrc:e,animatedSrc:t}){return Object(a.createElement)("picture",{className:"edit-widgets-welcome-guide__image"},Object(a.createElement)("source",{srcSet:e,media:"(prefers-reduced-motion: reduce)"}),Object(a.createElement)("img",{src:t,width:"312",height:"240",alt:""}))}var bt=function({blockEditorSettings:e}){return Object(a.createElement)(ye,{blockEditorSettings:e},Object(a.createElement)(st,{blockEditorSettings:e}),Object(a.createElement)(Be,null),Object(a.createElement)(le.Popover.Slot,null),Object(a.createElement)(Oe.PluginArea,null),Object(a.createElement)(lt,null),Object(a.createElement)(dt,null))};function mt(e,t){const r=Object(l.__experimentalGetCoreBlocks)().filter(e=>!["core/more"].includes(e.name));Object(l.registerCoreBlocks)(r),Object(u.registerLegacyWidgetVariations)(t),gt(o),t.__experimentalFetchLinkSuggestions=(e,r)=>Object(d.__experimentalFetchLinkSuggestions)(e,r,t),Object(a.render)(Object(a.createElement)(bt,{blockEditorSettings:t}),document.getElementById(e))}const gt=e=>{if(!e)return;const{metadata:t,settings:r,name:n}=e;t&&Object(s.unstable__bootstrapServerSideBlockDefinitions)({[n]:t}),Object(s.registerBlockType)(n,r)}},GLVC:function(e,t){e.exports=window.wp.widgets},GRId:function(e,t){e.exports=window.wp.element},HSyU:function(e,t){e.exports=window.wp.blocks},"K+tz":function(e,t,r){"use strict";var n=r("GRId"),c=r("Tqx9");const i=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(c.Path,{d:"M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"}));t.a=i},K2cm:function(e,t,r){"use strict";var n=r("GRId"),c=r("Tqx9");const i=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(c.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"}));t.a=i},K9lf:function(e,t){e.exports=window.wp.compose},KEfo:function(e,t){e.exports=window.wp.viewport},Mmq9:function(e,t){e.exports=window.wp.url},Ntru:function(e,t,r){"use strict";var n=r("GRId"),c=r("Tqx9");const i=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(c.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"}));t.a=i},Q4Sy:function(e,t,r){"use strict";var n=r("GRId"),c=r("Tqx9");const i=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(c.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));t.a=i},QyPg:function(e,t){e.exports=window.wp.blockLibrary},RMJe:function(e,t,r){"use strict";var n=r("GRId"),c=r("Tqx9");const i=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(c.Path,{d:"M18.3 5.6L9.9 16.9l-4.6-3.4-.9 1.2 5.8 4.3 9.3-12.6z"}));t.a=i},RxS6:function(e,t){e.exports=window.wp.keycodes},TSYQ:function(e,t,r){var n;
/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/!function(){"use strict";var r={}.hasOwnProperty;function c(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)){if(n.length){var o=c.apply(null,n);o&&e.push(o)}}else if("object"===i)if(n.toString===Object.prototype.toString)for(var a in n)r.call(n,a)&&n[a]&&e.push(a);else e.push(n.toString())}}return e.join(" ")}e.exports?(c.default=c,e.exports=c):void 0===(n=function(){return c}.apply(t,[]))||(e.exports=n)}()},Tqx9:function(e,t){e.exports=window.wp.primitives},TvNi:function(e,t){e.exports=window.wp.plugins},U60i:function(e,t,r){"use strict";r.d(t,"g",(function(){return j})),r.d(t,"b",(function(){return F})),r.d(t,"c",(function(){return L})),r.d(t,"d",(function(){return U})),r.d(t,"e",(function(){return z})),r.d(t,"f",(function(){return M})),r.d(t,"a",(function(){return C}));var n={};r.r(n),r.d(n,"enableComplementaryArea",(function(){return d})),r.d(n,"disableComplementaryArea",(function(){return u})),r.d(n,"pinItem",(function(){return m})),r.d(n,"unpinItem",(function(){return g}));var c={};r.r(c),r.d(c,"getActiveComplementaryArea",(function(){return p})),r.d(c,"isItemPinned",(function(){return O}));var i=r("1ZqX"),o=r("YLtl");const a=Object(i.combineReducers)({singleEnableItems:function(e={},{type:t,itemType:r,scope:n,item:c}){return"SET_SINGLE_ENABLE_ITEM"===t&&r&&n?{...e,[r]:{...e[r],[n]:c||null}}:e},multipleEnableItems:function(e={},{type:t,itemType:r,scope:n,item:c,isEnable:i}){if("SET_MULTIPLE_ENABLE_ITEM"!==t||!r||!n||!c||Object(o.get)(e,[r,n,c])===i)return e;const a=e[r]||{},s=a[n]||{};return{...e,[r]:{...a,[n]:{...s,[c]:i||!1}}}}});var s=Object(i.combineReducers)({enableItems:a});function l(e,t,r){return{type:"SET_SINGLE_ENABLE_ITEM",itemType:e,scope:t,item:r}}function d(e,t){return l("complementaryArea",e,t)}function u(e){return l("complementaryArea",e,void 0)}function b(e,t,r,n){return{type:"SET_MULTIPLE_ENABLE_ITEM",itemType:e,scope:t,item:r,isEnable:n}}function m(e,t){return b("pinnedItems",e,t,!0)}function g(e,t){return b("pinnedItems",e,t,!1)}function p(e,t){return function(e,t,r){return Object(o.get)(e.enableItems.singleEnableItems,[t,r])}(e,"complementaryArea",t)}function O(e,t,r){return!1!==function(e,t,r,n){return Object(o.get)(e.enableItems.multipleEnableItems,[t,r,n])}(e,"pinnedItems",t,r)}const j=Object(i.createReduxStore)("core/interface",{reducer:s,actions:n,selectors:c,persist:["enableItems"]});Object(i.registerStore)("core/interface",{reducer:s,actions:n,selectors:c,persist:["enableItems"]});var f=r("wx14"),_=r("GRId"),E=r("TSYQ"),w=r.n(E),h=r("tI+e"),y=r("l3Sj"),v=r("RMJe"),k=r("URob"),S=r("Xxwi"),I=r("KEfo"),A=r("bWcr"),x=r("TvNi"),T=Object(x.withPluginContext)((e,t)=>({icon:t.icon||e.icon,identifier:t.identifier||`${e.name}/${t.name}`}));var N=T((function({as:e=h.Button,scope:t,identifier:r,icon:n,selectedIcon:c,...a}){const s=e,l=Object(i.useSelect)(e=>e(j).getActiveComplementaryArea(t)===r,[r]),{enableComplementaryArea:d,disableComplementaryArea:u}=Object(i.useDispatch)(j);return Object(_.createElement)(s,Object(f.a)({icon:c&&l?c:n,onClick:()=>{l?u(t):d(t,r)}},Object(o.omit)(a,["name"])))}));var B=({smallScreenTitle:e,children:t,className:r,toggleButtonProps:n})=>{const c=Object(_.createElement)(N,Object(f.a)({icon:A.a},n));return Object(_.createElement)(_.Fragment,null,Object(_.createElement)("div",{className:"components-panel__header interface-complementary-area-header__small"},e&&Object(_.createElement)("span",{className:"interface-complementary-area-header__small-title"},e),c),Object(_.createElement)("div",{className:w()("components-panel__header","interface-complementary-area-header",r),tabIndex:-1},t,c))};function R({name:e,as:t=h.Button,onClick:r,...n}){return Object(_.createElement)(h.Fill,{name:e},({onClick:e})=>Object(_.createElement)(t,Object(f.a)({onClick:r||e?(...t)=>{(r||o.noop)(...t),(e||o.noop)(...t)}:void 0},n)))}R.Slot=function({name:e,as:t=h.ButtonGroup,fillProps:r={},bubblesVirtually:n,...c}){return Object(_.createElement)(h.Slot,{name:e,bubblesVirtually:n,fillProps:r},e=>{if(Object(o.isEmpty)(_.Children.toArray(e)))return null;const r=[];_.Children.forEach(e,({props:{__unstableExplicitMenuItem:e,__unstableTarget:t}})=>{t&&e&&r.push(t)});const n=_.Children.map(e,e=>!e.props.__unstableExplicitMenuItem&&r.includes(e.props.__unstableTarget)?null:e);return Object(_.createElement)(t,c,n)})};var C=R;const W=e=>Object(_.createElement)(h.MenuItem,Object(o.omit)(e,["__unstableExplicitMenuItem","__unstableTarget"]));function L({scope:e,target:t,__unstableExplicitMenuItem:r,...n}){return Object(_.createElement)(N,Object(f.a)({as:n=>Object(_.createElement)(C,Object(f.a)({__unstableExplicitMenuItem:r,__unstableTarget:`${e}/${t}`,as:W,name:e+"/plugin-more-menu"},n)),role:"menuitemcheckbox",selectedIcon:v.a,name:t,scope:e},n))}function P({scope:e,...t}){return Object(_.createElement)(h.Fill,Object(f.a)({name:"PinnedItems/"+e},t))}P.Slot=function({scope:e,className:t,...r}){return Object(_.createElement)(h.Slot,Object(f.a)({name:"PinnedItems/"+e},r),e=>!Object(o.isEmpty)(e)&&Object(_.createElement)("div",{className:w()(t,"interface-pinned-items")},e))};var M=P;function G({scope:e,children:t,className:r}){return Object(_.createElement)(h.Fill,{name:"ComplementaryArea/"+e},Object(_.createElement)("div",{className:r},t))}const D=T((function({children:e,className:t,closeLabel:r=Object(y.__)("Close plugin"),identifier:n,header:c,headerClassName:o,icon:a,isPinnable:s=!0,panelClassName:l,scope:d,name:u,smallScreenTitle:b,title:m,toggleShortcut:g,isActiveByDefault:p,showIconLabels:O=!1}){const{isActive:f,isPinned:E,activeArea:A,isSmall:x,isLarge:T}=Object(i.useSelect)(e=>{const{getActiveComplementaryArea:t,isItemPinned:r}=e(j),c=t(d);return{isActive:c===n,isPinned:r(d,n),activeArea:c,isSmall:e(I.store).isViewportMatch("< medium"),isLarge:e(I.store).isViewportMatch("large")}},[n,d]);!function(e,t,r,n,c){const o=Object(_.useRef)(!1),a=Object(_.useRef)(!1),{enableComplementaryArea:s,disableComplementaryArea:l}=Object(i.useDispatch)(j);Object(_.useEffect)(()=>{n&&c&&!o.current?(l(e),a.current=!0):a.current&&!c&&o.current?(a.current=!1,s(e,t)):a.current&&r&&r!==t&&(a.current=!1),c!==o.current&&(o.current=c)},[n,c,e,t,r])}(d,n,A,f,x);const{enableComplementaryArea:R,disableComplementaryArea:C,pinItem:W,unpinItem:P}=Object(i.useDispatch)(j);return Object(_.useEffect)(()=>{p&&void 0===A&&!x&&R(d,n)},[A,p,d,n,x]),Object(_.createElement)(_.Fragment,null,s&&Object(_.createElement)(M,{scope:d},E&&Object(_.createElement)(N,{scope:d,identifier:n,isPressed:f&&(!O||T),"aria-expanded":f,label:m,icon:O?v.a:a,showTooltip:!O,isTertiary:O})),u&&s&&Object(_.createElement)(L,{target:u,scope:d,icon:a},m),f&&Object(_.createElement)(G,{className:w()("interface-complementary-area",t),scope:d},Object(_.createElement)(B,{className:o,closeLabel:r,onClose:()=>C(d),smallScreenTitle:b,toggleButtonProps:{label:r,shortcut:g,scope:d,identifier:n}},c||Object(_.createElement)(_.Fragment,null,Object(_.createElement)("strong",null,m),s&&Object(_.createElement)(h.Button,{className:"interface-complementary-area__pin-unpin-item",icon:E?k.a:S.a,label:E?Object(y.__)("Unpin from toolbar"):Object(y.__)("Pin to toolbar"),onClick:()=>(E?P:W)(d,n),isPressed:E,"aria-expanded":E}))),Object(_.createElement)(h.Panel,{className:l},e)))}));D.Slot=function({scope:e,...t}){return Object(_.createElement)(h.Slot,Object(f.a)({name:"ComplementaryArea/"+e},t))};var F=D;class V extends _.Component{componentDidMount(){this.isSticky=!1,this.sync(),document.body.classList.contains("sticky-menu")&&(this.isSticky=!0,document.body.classList.remove("sticky-menu"))}componentWillUnmount(){this.isSticky&&document.body.classList.add("sticky-menu"),this.props.isActive&&document.body.classList.remove("is-fullscreen-mode")}componentDidUpdate(e){this.props.isActive!==e.isActive&&this.sync()}sync(){const{isActive:e}=this.props;e?document.body.classList.add("is-fullscreen-mode"):document.body.classList.remove("is-fullscreen-mode")}render(){return null}}var U=V,q=r("K9lf");var z=Object(_.forwardRef)((function({footer:e,header:t,sidebar:r,secondarySidebar:n,content:c,drawer:i,actions:o,labels:a,className:s,shortcuts:l},d){const u=Object(_.useRef)(),b=Object(h.__unstableUseNavigateRegions)(u,l);!function(e){Object(_.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 m={...{drawer:Object(y.__)("Drawer"),header:Object(y.__)("Header"),body:Object(y.__)("Content"),secondarySidebar:Object(y.__)("Block Library"),sidebar:Object(y.__)("Settings"),actions:Object(y.__)("Publish"),footer:Object(y.__)("Footer")},...a};return Object(_.createElement)("div",{ref:Object(q.useMergeRefs)([d,u]),className:w()(s,"interface-interface-skeleton",b,!!e&&"has-footer")},!!i&&Object(_.createElement)("div",{className:"interface-interface-skeleton__drawer",role:"region","aria-label":m.drawer},i),Object(_.createElement)("div",{className:"interface-interface-skeleton__editor"},!!t&&Object(_.createElement)("div",{className:"interface-interface-skeleton__header",role:"region","aria-label":m.header,tabIndex:"-1"},t),Object(_.createElement)("div",{className:"interface-interface-skeleton__body"},!!n&&Object(_.createElement)("div",{className:"interface-interface-skeleton__secondary-sidebar",role:"region","aria-label":m.secondarySidebar,tabIndex:"-1"},n),Object(_.createElement)("div",{className:"interface-interface-skeleton__content",role:"region","aria-label":m.body,tabIndex:"-1"},c),!!r&&Object(_.createElement)("div",{className:"interface-interface-skeleton__sidebar",role:"region","aria-label":m.sidebar,tabIndex:"-1"},r),!!o&&Object(_.createElement)("div",{className:"interface-interface-skeleton__actions",role:"region","aria-label":m.actions,tabIndex:"-1"},o))),!!e&&Object(_.createElement)("div",{className:"interface-interface-skeleton__footer",role:"region","aria-label":m.footer,tabIndex:"-1"},e))}))},URob:function(e,t,r){"use strict";var n=r("GRId"),c=r("Tqx9");const i=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(c.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"}));t.a=i},VKE3:function(e,t,r){"use strict";var n=r("GRId"),c=r("Tqx9");const i=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(c.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));t.a=i},Xxwi:function(e,t,r){"use strict";var n=r("GRId"),c=r("Tqx9");const i=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(c.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"}));t.a=i},YLtl:function(e,t){e.exports=window.lodash},axFQ:function(e,t){e.exports=window.wp.blockEditor},bWcr:function(e,t,r){"use strict";var n=r("GRId"),c=r("Tqx9");const i=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(c.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"}));t.a=i},diJD:function(e,t){e.exports=window.wp.reusableBlocks},g56x:function(e,t){e.exports=window.wp.hooks},gdqT:function(e,t){e.exports=window.wp.a11y},hF7m:function(e,t){e.exports=window.wp.keyboardShortcuts},jZUy:function(e,t){e.exports=window.wp.coreData},l3Sj:function(e,t){e.exports=window.wp.i18n},onLe:function(e,t){e.exports=window.wp.notices},"tI+e":function(e,t){e.exports=window.wp.components},w95h:function(e,t,r){"use strict";var n=r("GRId"),c=r("Tqx9");const i=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(c.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));t.a=i},wx14:function(e,t,r){"use strict";function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}r.d(t,"a",(function(){return n}))},ywyh:function(e,t){e.exports=window.wp.apiFetch}});