mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-09 20:30:43 +01:00
dc3ffcbde3
Update packages to include these bug fixes from Gutenberg: - Include cascading properties in Navigation deprecation - Reorganize e2e tests folders and file - Border panel: Update to display multiple palette origins - Add CSS fix for 33580 - Add: Uneditable duotone palette on the palette gradient panel - Site Editor: Allow editing custom template title - Writing Flow: Double escape unselects all blocks - Fix icon scaling. - [Block Library - Query Pagination Next/Previous]: Remove text and link color support - Add: Border indication to global styles colors. - Color Picker: Improve border, padding, and box shadow styles. - theme.json: sort keys alphabetically - Remove navigationArea context. See #54487. Built from https://develop.svn.wordpress.org/trunk@52277 git-svn-id: http://core.svn.wordpress.org/trunk@51869 1a063a9b-81f0-0310-95a4-ce76da25c4cd
7 lines
132 KiB
JavaScript
7 lines
132 KiB
JavaScript
/*! This file is auto-generated */
|
||
this.wp=this.wp||{},this.wp.editSite=function(e){var t={};function n(c){if(t[c])return t[c].exports;var r=t[c]={i:c,l:!1,exports:{}};return e[c].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,c){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:c})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var c=Object.create(null);if(n.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(c,r,function(t){return e[t]}.bind(null,r));return c},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="IqXm")}({"0Ene":function(e,t,n){"use strict";var c=n("GRId"),r=n("Tqx9");const a=Object(c.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(r.Path,{d:"M10.5 4v4h3V4H15v4h1.5a1 1 0 011 1v4l-3 4v2a1 1 0 01-1 1h-3a1 1 0 01-1-1v-2l-3-4V9a1 1 0 011-1H9V4h1.5zm.5 12.5v2h2v-2l3-4v-3H8v3l3 4z"}));t.a=a},"1ZqX":function(e,t){e.exports=window.wp.data},"1iEr":function(e,t,n){"use strict";var c=n("GRId"),r=n("Tqx9");const a=Object(c.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(r.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));t.a=a},"2gm7":function(e,t,n){"use strict";var c=n("GRId"),r=n("Tqx9");const a=Object(c.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(r.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));t.a=a},"51Zz":function(e,t){e.exports=window.wp.dataControls},"6aBm":function(e,t){e.exports=window.wp.mediaUtils},B9Az:function(e,t,n){"use strict";var c=n("GRId"),r=n("Tqx9");var a=Object(c.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(r.Path,{d:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"}));t.a=a},Cg8A:function(e,t,n){"use strict";var c=n("GRId"),r=n("Tqx9");const a=Object(c.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(r.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=a},Civd:function(e,t,n){"use strict";var c=n("GRId"),r=n("Tqx9");const a=Object(c.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(r.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"}));t.a=a},GRId:function(e,t){e.exports=window.wp.element},HSyU:function(e,t){e.exports=window.wp.blocks},IqXm:function(e,t,n){"use strict";n.r(t),n.d(t,"reinitializeEditor",(function(){return mr})),n.d(t,"initializeEditor",(function(){return dr})),n.d(t,"initializeList",(function(){return br})),n.d(t,"__experimentalMainDashboardButton",(function(){return Xn})),n.d(t,"__experimentalNavigationToggle",(function(){return tc})),n.d(t,"PluginSidebar",(function(){return ir})),n.d(t,"PluginSidebarMoreMenuItem",(function(){return sr})),n.d(t,"PluginMoreMenuItem",(function(){return ur}));var c={};n.r(c),n.d(c,"toggleFeature",(function(){return V})),n.d(c,"__experimentalSetPreviewDeviceType",(function(){return z})),n.d(c,"setTemplate",(function(){return U})),n.d(c,"addTemplate",(function(){return H})),n.d(c,"removeTemplate",(function(){return W})),n.d(c,"setTemplatePart",(function(){return q})),n.d(c,"pushTemplatePart",(function(){return $})),n.d(c,"setHomeTemplateId",(function(){return K})),n.d(c,"setPage",(function(){return Q})),n.d(c,"goBack",(function(){return Y})),n.d(c,"showHomepage",(function(){return X})),n.d(c,"setNavigationPanelActiveMenu",(function(){return Z})),n.d(c,"openNavigationPanelToMenu",(function(){return J})),n.d(c,"setIsNavigationPanelOpened",(function(){return ee})),n.d(c,"setIsInserterOpened",(function(){return te})),n.d(c,"updateSettings",(function(){return ne})),n.d(c,"setIsListViewOpened",(function(){return ce})),n.d(c,"revertTemplate",(function(){return re})),n.d(c,"openGeneralSidebar",(function(){return ae})),n.d(c,"closeGeneralSidebar",(function(){return le}));var r={};n.r(r),n.d(r,"isFeatureActive",(function(){return me})),n.d(r,"__experimentalGetPreviewDeviceType",(function(){return de})),n.d(r,"getCanUserCreateMedia",(function(){return be})),n.d(r,"getReusableBlocks",(function(){return pe})),n.d(r,"getSettings",(function(){return Oe})),n.d(r,"getHomeTemplateId",(function(){return _e})),n.d(r,"getEditedPostType",(function(){return Ee})),n.d(r,"getEditedPostId",(function(){return fe})),n.d(r,"getPreviousEditedPostType",(function(){return he})),n.d(r,"getPreviousEditedPostId",(function(){return ve})),n.d(r,"getPage",(function(){return ye})),n.d(r,"getNavigationPanelActiveMenu",(function(){return we})),n.d(r,"getCurrentTemplateNavigationPanelSubMenu",(function(){return Se})),n.d(r,"isNavigationOpened",(function(){return xe})),n.d(r,"isInserterOpened",(function(){return Te})),n.d(r,"__experimentalGetInsertionPoint",(function(){return ke})),n.d(r,"isListViewOpened",(function(){return Ie})),n.d(r,"getCurrentTemplateTemplateParts",(function(){return Ce}));var a=n("GRId"),l=n("HSyU"),o=n("QyPg"),i=n("1ZqX"),s=n("jZUy"),u=n("jSdM"),m=n("KEfo"),d=n("rrFr"),b=n.n(d),p=n("tI+e"),O=n("l3Sj"),_=n("TvNi"),j=n("ywyh"),g=n.n(j),E=n("Tqx9");var f=Object(a.createElement)(E.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)(E.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"})),h=n("YLtl");const{Fill:v,Slot:y}=Object(p.createSlotFill)("EditSiteToolsMoreMenuGroup");v.Slot=e=>{let{fillProps:t}=e;return Object(a.createElement)(y,{fillProps:t},e=>!Object(h.isEmpty)(e)&&Object(a.createElement)(p.MenuGroup,{label:Object(O.__)("Tools")},e))};var w=v,S=n("U60i"),x=n("51Zz");const T={features:{welcomeGuide:!0,welcomeGuideStyles:!0}},k="core/edit-site",I={header:Object(O.__)("Header"),footer:Object(O.__)("Footer"),sidebar:Object(O.__)("Sidebar"),uncategorized:Object(O.__)("General")},C=["index","singular","archive","single","page","home","404","search","author","category","taxonomy","date","tag","attachment","single-post","front-page"],N=["page-home"],P=["post-","author-","single-post-","tag-"],A=["page-"],M={singular:["single","page"],index:["archive","404","search","singular","home"],home:["front-page"]},R=[{area:"header",menu:"template-parts-headers",title:Object(O.__)("headers")},{area:"footer",menu:"template-parts-footers",title:Object(O.__)("footers")},{area:"sidebar",menu:"template-parts-sidebars",title:Object(O.__)("sidebars")},{area:"uncategorized",menu:"template-parts-general",title:Object(O.__)("general")}],L=Object(i.combineReducers)({features(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:T.features,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"TOGGLE_FEATURE":return{...e,[t.feature]:!e[t.feature]};default:return e}}});var B=Object(i.combineReducers)({preferences:L,deviceType:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Desktop",t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_PREVIEW_DEVICE_TYPE":return t.deviceType}return e},settings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"UPDATE_SETTINGS":return{...e,...t.settings}}return e},editedPost:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_TEMPLATE":case"SET_PAGE":return[{type:"wp_template",id:t.templateId,page:t.page}];case"SET_TEMPLATE_PART":return[{type:"wp_template_part",id:t.templatePartId}];case"PUSH_TEMPLATE_PART":return[...e,{type:"wp_template_part",id:t.templatePartId}];case"GO_BACK":return e.slice(0,-1)}return e},homeTemplateId:function(e,t){switch(t.type){case"SET_HOME_TEMPLATE":return t.homeTemplateId}return e},navigationPanel:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{menu:"root",isOpen:!1},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_NAVIGATION_PANEL_ACTIVE_MENU":return{...e,menu:t.menu};case"OPEN_NAVIGATION_PANEL_TO_MENU":return{...e,isOpen:!0,menu:t.menu};case"SET_IS_NAVIGATION_PANEL_OPENED":return{...e,menu:t.isOpen?e.menu:"root",isOpen:t.isOpen};case"SET_IS_LIST_VIEW_OPENED":return{...e,menu:e.isOpen&&t.isOpen?"root":e.menu,isOpen:!t.isOpen&&e.isOpen};case"SET_IS_INSERTER_OPENED":return{...e,menu:e.isOpen&&t.value?"root":e.menu,isOpen:!t.value&&e.isOpen}}return e},blockInserterPanel:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"OPEN_NAVIGATION_PANEL_TO_MENU":return!1;case"SET_IS_NAVIGATION_PANEL_OPENED":case"SET_IS_LIST_VIEW_OPENED":return!t.isOpen&&e;case"SET_IS_INSERTER_OPENED":return t.value}return e},listViewPanel:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"OPEN_NAVIGATION_PANEL_TO_MENU":return!1;case"SET_IS_NAVIGATION_PANEL_OPENED":return!t.isOpen&&e;case"SET_IS_INSERTER_OPENED":return!t.value&&e;case"SET_IS_LIST_VIEW_OPENED":return t.isOpen}return e}}),D=n("Mmq9"),F=n("onLe");function G(e){return!!e&&("custom"===(null==e?void 0:e.source)&&(null==e?void 0:e.has_theme_file))}function V(e){return{type:"TOGGLE_FEATURE",feature:e}}function z(e){return{type:"SET_PREVIEW_DEVICE_TYPE",deviceType:e}}function*U(e,t){const n={templateSlug:t};if(!t){const t=yield i.controls.resolveSelect(s.store,"getEntityRecord","postType","wp_template",e);n.templateSlug=null==t?void 0:t.slug}return{type:"SET_TEMPLATE",templateId:e,page:{context:n}}}function*H(e){const t=yield i.controls.dispatch(s.store,"saveEntityRecord","postType","wp_template",e);return e.content&&(yield i.controls.dispatch(s.store,"editEntityRecord","postType","wp_template",t.id,{blocks:Object(l.parse)(e.content)},{undoIgnore:!0})),{type:"SET_TEMPLATE",templateId:t.id,page:{context:{templateSlug:t.slug}}}}function*W(e){try{yield i.controls.dispatch(s.store,"deleteEntityRecord","postType",e.type,e.id,{force:!0});const t=yield i.controls.select(s.store,"getLastEntityDeleteError","postType",e.type,e.id);if(t)throw t;yield i.controls.dispatch(F.store,"createSuccessNotice",Object(O.sprintf)(Object(O.__)('"%s" removed.'),e.title.rendered),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:Object(O.__)("An error occurred while deleting the template.");yield i.controls.dispatch(F.store,"createErrorNotice",t,{type:"snackbar"})}}function q(e){return{type:"SET_TEMPLATE_PART",templatePartId:e}}function $(e){return{type:"PUSH_TEMPLATE_PART",templatePartId:e}}function K(e){return{type:"SET_HOME_TEMPLATE",homeTemplateId:e}}function*Q(e){var t;if(!e.path&&null!==(t=e.context)&&void 0!==t&&t.postId){const t=yield i.controls.resolveSelect(s.store,"getEntityRecord","postType",e.context.postType||"post",e.context.postId);e.path=Object(D.getPathAndQueryString)(t.link)}const{id:n,slug:c}=yield i.controls.resolveSelect(s.store,"__experimentalGetTemplateForLink",e.path);return yield{type:"SET_PAGE",page:c?{...e,context:{...e.context,templateSlug:c}}:e,templateId:n},n}function Y(){return{type:"GO_BACK"}}function*X(){const{show_on_front:e,page_on_front:t}=yield i.controls.resolveSelect(s.store,"getEntityRecord","root","site"),{siteUrl:n}=yield i.controls.select(k,"getSettings"),c={path:n,context:"page"===e?{postType:"page",postId:t}:{}},r=yield*Q(c);yield K(r)}function Z(e){return{type:"SET_NAVIGATION_PANEL_ACTIVE_MENU",menu:e}}function J(e){return{type:"OPEN_NAVIGATION_PANEL_TO_MENU",menu:e}}function ee(e){return{type:"SET_IS_NAVIGATION_PANEL_OPENED",isOpen:e}}function te(e){return{type:"SET_IS_INSERTER_OPENED",value:e}}function ne(e){return{type:"UPDATE_SETTINGS",settings:e}}function ce(e){return{type:"SET_IS_LIST_VIEW_OPENED",isOpen:e}}function*re(e){let{allowUndo:t=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(G(e))try{var n;const c=yield i.controls.select(s.store,"getEntity","postType",e.type);if(!c)return void(yield i.controls.dispatch(F.store,"createErrorNotice",Object(O.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"}));const r=Object(D.addQueryArgs)(`${c.baseURL}/${e.id}`,{context:"edit",source:"theme"}),a=yield Object(x.apiFetch)({path:r});if(!a)return void(yield i.controls.dispatch(F.store,"createErrorNotice",Object(O.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"}));const o=e=>{let{blocks:t=[]}=e;return Object(l.__unstableSerializeAndClean)(t)},u=yield i.controls.select(s.store,"getEditedEntityRecord","postType",e.type,e.id);yield i.controls.dispatch(s.store,"editEntityRecord","postType",e.type,e.id,{content:o,blocks:u.blocks,source:"custom"},{undoIgnore:!0});const m=Object(l.parse)(null==a||null===(n=a.content)||void 0===n?void 0:n.raw);if(yield i.controls.dispatch(s.store,"editEntityRecord","postType",e.type,a.id,{content:o,blocks:m,source:"theme"}),t){const t=async()=>{await Object(i.dispatch)(s.store).editEntityRecord("postType",e.type,u.id,{content:o,blocks:u.blocks,source:"custom"})};yield i.controls.dispatch(F.store,"createSuccessNotice",Object(O.__)("Template reverted."),{type:"snackbar",actions:[{label:Object(O.__)("Undo"),onClick:t}]})}else yield i.controls.dispatch(F.store,"createSuccessNotice",Object(O.__)("Template reverted."))}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:Object(O.__)("Template revert failed. Please reload.");yield i.controls.dispatch(F.store,"createErrorNotice",t,{type:"snackbar"})}else yield i.controls.dispatch(F.store,"createErrorNotice",Object(O.__)("This template is not revertable."),{type:"snackbar"})}function*ae(e){yield i.controls.dispatch(S.i,"enableComplementaryArea",k,e)}function*le(){yield i.controls.dispatch(S.i,"disableComplementaryArea",k)}var oe=n("pPDe"),ie=n("6aBm");function se(e,t,n){return!!M[e]&&("home"===e&&"posts"!==n||M[e].every(e=>t.includes(e)||se(e,t,n)))}function ue(e){if(C.includes(e))return"templates";if(N.includes(e))return"templates-general";if(P.some(t=>e.startsWith(t)))return"templates-posts";return A.some(t=>e.startsWith(t))?"templates-pages":"templates-general"}function me(e,t){return Object(h.get)(e.preferences.features,[t],!1)}function de(e){return e.deviceType}const be=Object(i.createRegistrySelector)(e=>()=>e(s.store).canUser("create","media")),pe=Object(i.createRegistrySelector)(e=>()=>"web"===a.Platform.OS?e(s.store).getEntityRecords("postType","wp_block",{per_page:-1}):[]),Oe=Object(oe.a)((e,t)=>{const n={...e.settings,outlineMode:!0,focusMode:me(e,"focusMode"),hasFixedToolbar:me(e,"fixedToolbar"),__experimentalSetIsInserterOpened:t,__experimentalReusableBlocks:pe(e)};return be(e)?(n.mediaUpload=t=>{let{onError:n,...c}=t;Object(ie.uploadMedia)({wpAllowedMimeTypes:e.settings.allowedMimeTypes,onError:e=>{let{message:t}=e;return n(t)},...c})},n):n},e=>[be(e),e.settings,me(e,"focusMode"),me(e,"fixedToolbar"),pe(e)]);function _e(e){return e.homeTemplateId}function je(e){return e.editedPost[e.editedPost.length-1]||{}}function ge(e){return e.editedPost[e.editedPost.length-2]||{}}function Ee(e){return je(e).type}function fe(e){return je(e).id}function he(e){return ge(e).type}function ve(e){return ge(e).id}function ye(e){return je(e).page}function we(e){return e.navigationPanel.menu}const Se=Object(i.createRegistrySelector)(e=>t=>{const n=Ee(t),c=fe(t),r=c?e(s.store).getEntityRecord("postType",n,c):null;if(!r)return"root";var a;if("wp_template_part"===n)return(null===(a=R.find(e=>e.area===(null==r?void 0:r.area)))||void 0===a?void 0:a.menu)||"template-parts";const l=e(s.store).getEntityRecords("postType","wp_template"),o=e(s.store).getEditedEntityRecord("root","site").show_on_front;return se(r.slug,Object(h.map)(l,"slug"),o)?"templates-unused":ue(r.slug)});function xe(e){return e.navigationPanel.isOpen}function Te(e){return!!e.blockInserterPanel}function ke(e){const{rootClientId:t,insertionIndex:n,filterValue:c}=e.blockInserterPanel;return{rootClientId:t,insertionIndex:n,filterValue:c}}function Ie(e){return e.listViewPanel}const Ce=Object(i.createRegistrySelector)(e=>t=>{var n;const c=Ee(t),r=fe(t),a=e(s.store).getEditedEntityRecord("postType",c,r),o=e(s.store).getEntityRecords("postType","wp_template_part",{per_page:-1}),i=Object(h.keyBy)(o,e=>e.id);return(null!==(n=a.blocks)&&void 0!==n?n:[]).filter(e=>Object(l.isTemplatePart)(e)).map(e=>{const{attributes:{theme:t,slug:n}}=e;return{templatePart:i[`${t}//${n}`],block:e}}).filter(e=>{let{templatePart:t}=e;return!!t})}),Ne={reducer:B,actions:c,selectors:r,controls:x.controls,persist:["preferences"]},Pe=Object(i.createReduxStore)(k,Ne);function Ae(){const{toggleFeature:e}=Object(i.useDispatch)(Pe),t=Object(i.useSelect)(e=>"edit-site/global-styles"===e(S.i).getActiveComplementaryArea(Pe.name),[]);return Object(a.createElement)(p.MenuItem,{onClick:()=>e(t?"welcomeGuideStyles":"welcomeGuide")},Object(O.__)("Welcome Guide"))}Object(i.registerStore)(k,Ne),Object(_.registerPlugin)("edit-site",{render:()=>Object(a.createElement)(a.Fragment,null,Object(a.createElement)(w,null,Object(a.createElement)(p.MenuItem,{role:"menuitem",icon:f,onClick:()=>g()({path:"/wp-block-editor/v1/export",parse:!1}).then(e=>e.blob()).then(e=>b()(e,"edit-site-export.zip","application/zip")),info:Object(O.__)("Download your templates and template parts.")},Object(O.__)("Export")),Object(a.createElement)(Ae,null)))});var Me=n("g56x");Object(Me.addFilter)("editor.MediaUpload","core/edit-site/components/media-upload",()=>ie.MediaUpload);var Re=n("axFQ"),Le=n("hF7m"),Be=n("K9lf"),De=n("Q4Sy"),Fe=n("OzlF"),Ge=n("VKE3"),Ve=n("RMJe"),ze=n("gdqT");function Ue(e){let{feature:t,label:n,info:c,messageActivated:r,messageDeactivated:l}=e;const o=Object(i.useSelect)(e=>e(Pe).isFeatureActive(t),[]),{toggleFeature:s}=Object(i.useDispatch)(Pe);return Object(a.createElement)(p.MenuItem,{icon:o&&Ve.a,isSelected:o,onClick:Object(h.flow)(s.bind(null,t),()=>{o?Object(ze.speak)(l||Object(O.__)("Feature deactivated")):Object(ze.speak)(r||Object(O.__)("Feature activated"))}),role:"menuitemcheckbox",info:c},n)}const He={className:"edit-site-more-menu__content",position:"bottom left"},We={tooltipPosition:"bottom"};var qe=()=>Object(a.createElement)(p.DropdownMenu,{className:"edit-site-more-menu",icon:Ge.a,label:Object(O.__)("More tools & options"),popoverProps:He,toggleProps:We},e=>{let{onClose:t}=e;return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(p.MenuGroup,{label:Object(O._x)("View","noun")},Object(a.createElement)(Ue,{feature:"fixedToolbar",label:Object(O.__)("Top toolbar"),info:Object(O.__)("Access all block and document tools in a single place"),messageActivated:Object(O.__)("Top toolbar activated"),messageDeactivated:Object(O.__)("Top toolbar deactivated")}),Object(a.createElement)(Ue,{feature:"focusMode",label:Object(O.__)("Spotlight mode"),info:Object(O.__)("Focus on one block at a time"),messageActivated:Object(O.__)("Spotlight mode activated"),messageDeactivated:Object(O.__)("Spotlight mode deactivated")}),Object(a.createElement)(S.a.Slot,{name:"core/edit-site/plugin-more-menu",label:Object(O.__)("Plugins"),as:p.MenuGroup,fillProps:{onClick:t}})),Object(a.createElement)(w.Slot,{fillProps:{onClose:t}}))});function $e(e){let{openEntitiesSavedStates:t,isEntitiesSavedStatesOpen:n}=e;const{isDirty:c,isSaving:r}=Object(i.useSelect)(e=>{const{__experimentalGetDirtyEntityRecords:t,isSavingEntityRecord:n}=e(s.store),c=t();return{isDirty:c.length>0,isSaving:Object(h.some)(c,e=>n(e.kind,e.name,e.key))}},[]),l=!c||r;return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(p.Button,{variant:"primary",className:"edit-site-save-button__button","aria-disabled":l,"aria-expanded":n,disabled:l,isBusy:r,onClick:l?void 0:t},Object(O.__)("Save")))}var Ke=n("Ntru"),Qe=n("K2cm"),Ye=n("RxS6");function Xe(){const e=Object(i.useSelect)(e=>e(s.store).hasUndo(),[]),{undo:t}=Object(i.useDispatch)(s.store);return Object(a.createElement)(p.Button,{icon:Object(O.isRTL)()?Qe.a:Ke.a,label:Object(O.__)("Undo"),shortcut:Ye.displayShortcut.primary("z"),"aria-disabled":!e,onClick:e?t:void 0})}function Ze(){const e=Object(i.useSelect)(e=>e(s.store).hasRedo(),[]),{redo:t}=Object(i.useDispatch)(s.store);return Object(a.createElement)(p.Button,{icon:Object(O.isRTL)()?Ke.a:Qe.a,label:Object(O.__)("Redo"),shortcut:Ye.displayShortcut.primaryShift("z"),"aria-disabled":!e,onClick:e?t:void 0})}var Je=n("TSYQ"),et=n.n(Je),tt=n("NWDH");function nt(e){if(e){const t=Object(l.getBlockType)(e.name);return t?Object(l.__experimentalGetBlockLabel)(t,e.attributes):null}return null}function ct(e){let{entityTitle:t,entityLabel:n,isLoaded:c,children:r}=e;const{label:l}=function(){const{getBlock:e}=Object(i.useSelect)(Re.store),t=Object(i.useSelect)(e=>e(Re.store).__experimentalGetActiveBlockIdByBlockNames(["core/template-part"]),[]);return t?{label:nt(e(t)),isActive:!0}:{}}(),o=Object(a.useRef)();return c?t?Object(a.createElement)("div",{className:et()("edit-site-document-actions",{"has-secondary-label":!!l})},Object(a.createElement)("div",{ref:o,className:"edit-site-document-actions__title-wrapper"},Object(a.createElement)(p.__experimentalText,{size:"body",className:"edit-site-document-actions__title-prefix"},Object(a.createElement)(p.VisuallyHidden,{as:"span"},Object(O.sprintf)(Object(O.__)("Editing %s:"),n))),Object(a.createElement)(p.__experimentalText,{size:"body",className:"edit-site-document-actions__title",as:"h1"},t),Object(a.createElement)(p.__experimentalText,{size:"body",className:"edit-site-document-actions__secondary-item"},null!=l?l:""),r&&Object(a.createElement)(p.Dropdown,{popoverProps:{anchorRef:o.current},position:"bottom center",renderToggle:e=>{let{isOpen:t,onToggle:c}=e;return Object(a.createElement)(p.Button,{className:"edit-site-document-actions__get-info",icon:tt.a,"aria-expanded":t,"aria-haspopup":"true",onClick:c,label:Object(O.sprintf)(Object(O.__)("Show %s details"),n)})},contentClassName:"edit-site-document-actions__info-dropdown",renderContent:r}))):Object(a.createElement)("div",{className:"edit-site-document-actions"},Object(O.__)("Template not found")):Object(a.createElement)("div",{className:"edit-site-document-actions"},Object(O.__)("Loading…"))}function rt(e){var t;let{onClose:n,templatePart:c,closeTemplateDetailsDropdown:r}=e;const{pushTemplatePart:l,revertTemplate:o}=Object(i.useDispatch)(Pe);return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(p.MenuGroup,null,Object(a.createElement)(p.MenuItem,{onClick:function(){l(c.id),n(),r()}},Object(O.sprintf)(Object(O.__)("Edit %s"),null===(t=c.title)||void 0===t?void 0:t.rendered))),G(c)&&Object(a.createElement)(p.MenuGroup,null,Object(a.createElement)(p.MenuItem,{info:Object(O.__)("Restore template to theme default"),onClick:function(){o(c),n(),r()}},Object(O.__)("Clear customizations"))))}function at(e){let{templatePart:t,clientId:n,closeTemplateDetailsDropdown:c}=e;const{selectBlock:r,toggleBlockHighlight:l}=Object(i.useDispatch)(Re.store),o=()=>l(n,!0),s=()=>l(n,!1);return Object(a.createElement)("div",{role:"menuitem",className:"edit-site-template-details__template-areas-item"},Object(a.createElement)(p.MenuItem,{role:"button",icon:Object(u.getTemplatePartIcon)(t.area),iconPosition:"left",onClick:()=>{r(n)},onMouseOver:o,onMouseLeave:s,onFocus:o,onBlur:s},I[t.area]),Object(a.createElement)(p.DropdownMenu,{icon:Ge.a,label:Object(O.__)("More options"),className:"edit-site-template-details__template-areas-item-more"},e=>{let{onClose:n}=e;return Object(a.createElement)(rt,{onClose:n,templatePart:t,closeTemplateDetailsDropdown:c})}))}function lt(e){let{closeTemplateDetailsDropdown:t}=e;const n=Object(i.useSelect)(e=>e(Pe).getCurrentTemplateTemplateParts(),[]);return n.length?Object(a.createElement)(p.MenuGroup,{label:Object(O.__)("Areas"),className:"edit-site-template-details__group edit-site-template-details__template-areas"},n.map(e=>{let{templatePart:n,block:c}=e;return Object(a.createElement)(at,{key:n.slug,clientId:c.clientId,templatePart:n,closeTemplateDetailsDropdown:t})})):null}function ot(e){let{template:t}=e;const[n,c]=Object(s.useEntityProp)("postType",t.type,"title",t.id);return Object(a.createElement)(p.TextControl,{label:Object(O.__)("Title"),value:n,help:Object(O.__)('Give the template a title that indicates its purpose, e.g. "Full Width".'),onChange:e=>{c(e||t.slug)}})}function it(e){let{template:t,onClose:n}=e;const{title:c,description:r}=Object(i.useSelect)(e=>e(u.store).__experimentalGetTemplateInfo(t),[]),{revertTemplate:l}=Object(i.useDispatch)(Pe),o=Object(a.useMemo)(()=>"wp_template"===(null==t?void 0:t.type)?{title:Object(O.__)("templates"),menu:"templates"}:R.find(e=>{let{area:n}=e;return n===(null==t?void 0:t.area)}),[t]);if(!t)return null;return Object(a.createElement)("div",{className:"edit-site-template-details"},Object(a.createElement)("div",{className:"edit-site-template-details__group"},t.is_custom?Object(a.createElement)(ot,{template:t}):Object(a.createElement)(p.__experimentalHeading,{level:4,weight:600,className:"edit-site-template-details__title"},c),r&&Object(a.createElement)(p.__experimentalText,{size:"body",className:"edit-site-template-details__description",as:"p"},r)),Object(a.createElement)(lt,{closeTemplateDetailsDropdown:n}),G(t)&&Object(a.createElement)(p.MenuGroup,{className:"edit-site-template-details__group edit-site-template-details__revert"},Object(a.createElement)(p.MenuItem,{className:"edit-site-template-details__revert-button",info:Object(O.__)("Restore template to theme default"),onClick:()=>{l(t),n()}},Object(O.__)("Clear customizations"))),Object(a.createElement)(p.Button,{className:"edit-site-template-details__show-all-button",href:Object(D.addQueryArgs)(window.location.href,{postId:void 0,postType:t.type})},Object(O.sprintf)(Object(O.__)("Browse all %s"),o.title)))}const st=e=>{e.preventDefault()};function ut(e){let{openEntitiesSavedStates:t,isEntitiesSavedStatesOpen:n}=e;const c=Object(a.useRef)(),{deviceType:r,entityTitle:l,template:o,templateType:m,isInserterOpen:d,isListViewOpen:b,listViewShortcut:_,isLoaded:j}=Object(i.useSelect)(e=>{const{__experimentalGetPreviewDeviceType:t,getEditedPostType:n,getEditedPostId:c,isInserterOpened:r,isListViewOpened:a}=e(Pe),{getEditedEntityRecord:l}=e(s.store),{__experimentalGetTemplateInfo:o}=e(u.store),{getShortcutRepresentation:i}=e(Le.store),m=n(),d=c(),b=l("postType",m,d),p=!!d;return{deviceType:t(),entityTitle:o(b).title,isLoaded:p,template:b,templateType:m,isInserterOpen:r(),isListViewOpen:a(),listViewShortcut:i("core/edit-site/toggle-list-view")}},[]),{__experimentalSetPreviewDeviceType:g,setIsInserterOpened:E,setIsListViewOpened:f}=Object(i.useDispatch)(Pe),h=Object(Be.useViewportMatch)("medium"),v=Object(a.useCallback)(()=>{d?c.current.focus():E(!0)},[d,E]),y=Object(a.useCallback)(()=>f(!b),[f,b]),w="wp_template_part"===m;return Object(a.createElement)("div",{className:"edit-site-header"},Object(a.createElement)("div",{className:"edit-site-header_start"},Object(a.createElement)("div",{className:"edit-site-header__toolbar"},Object(a.createElement)(p.Button,{ref:c,variant:"primary",isPressed:d,className:"edit-site-header-toolbar__inserter-toggle",onMouseDown:st,onClick:v,icon:De.a,label:Object(O._x)("Toggle block inserter","Generic label for block inserter button")}),h&&Object(a.createElement)(a.Fragment,null,Object(a.createElement)(Re.ToolSelector,null),Object(a.createElement)(Xe,null),Object(a.createElement)(Ze,null),Object(a.createElement)(p.Button,{className:"edit-site-header-toolbar__list-view-toggle",icon:Fe.a,isPressed:b,label:Object(O.__)("List View"),onClick:y,shortcut:_})))),Object(a.createElement)("div",{className:"edit-site-header_center"},Object(a.createElement)(ct,{entityTitle:l,entityLabel:"wp_template_part"===m?"template part":"template",isLoaded:j},e=>{let{onClose:t}=e;return Object(a.createElement)(it,{template:o,onClose:t})})),Object(a.createElement)("div",{className:"edit-site-header_end"},Object(a.createElement)("div",{className:"edit-site-header__actions"},!w&&Object(a.createElement)(Re.__experimentalPreviewOptions,{deviceType:r,setDeviceType:g}),Object(a.createElement)($e,{openEntitiesSavedStates:t,isEntitiesSavedStatesOpen:n}),Object(a.createElement)(S.h.Slot,{scope:"core/edit-site"}),Object(a.createElement)(qe,null))))}var mt=n("Cg8A");function dt(e){let{className:t,identifier:n,title:c,icon:r,children:l,closeLabel:o,header:i,headerClassName:s}=e;return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(S.b,{className:t,scope:"core/edit-site",identifier:n,title:c,icon:r,closeLabel:o,header:i,headerClassName:s},l),Object(a.createElement)(S.c,{scope:"core/edit-site",identifier:n,icon:r},c))}var bt=Object(a.createElement)(E.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(a.createElement)(E.Path,{d:"M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z"}));const pt=[{path:["color","palette"],valueKey:"color",cssVarInfix:"color",classes:[{classSuffix:"color",propertyName:"color"},{classSuffix:"background-color",propertyName:"background-color"},{classSuffix:"border-color",propertyName:"border-color"}]},{path:["color","gradients"],valueKey:"gradient",cssVarInfix:"gradient",classes:[{classSuffix:"gradient-background",propertyName:"background"}]},{path:["typography","fontSizes"],valueKey:"size",cssVarInfix:"font-size",classes:[{classSuffix:"font-size",propertyName:"font-size"}]},{path:["typography","fontFamilies"],valueKey:"fontFamily",cssVarInfix:"font-family",classes:[{classSuffix:"font-family",propertyName:"font-family"}]}],Ot={"color.background":"color","color.text":"color","elements.link.color.text":"color","color.gradient":"gradient","typography.fontSize":"font-size","typography.fontFamily":"font-family"};function _t(e,t,n,c,r){const a=[Object(h.get)(e,["blocks",t,...n]),Object(h.get)(e,n)];for(const l of a)if(l){const a=["custom","theme","default"];for(const o of a){const a=l[o];if(a){const l=Object(h.find)(a,e=>e[c]===r);if(l){if("slug"===c)return l;return _t(e,t,n,"slug",l.slug)[c]===l[c]?l:void 0}}}}}function jt(e,t,n,c){if(!c)return c;const r=Ot[n],a=Object(h.find)(pt,["cssVarInfix",r]);if(!a)return c;const{valueKey:l,path:o}=a,i=_t(e,t,o,l,c);return i?`var:preset|${r}|${i.slug}`:c}function gt(e,t,n){if(!n||!Object(h.isString)(n))return n;let c;if(n.startsWith("var:"))c=n.slice("var:".length).split("|");else{if(!n.startsWith("var(--wp--")||!n.endsWith(")"))return n;c=n.slice("var(--wp--".length,-")".length).split("--")}const[r,...a]=c;return"preset"===r?function(e,t,n,c){let[r,a]=c;const l=Object(h.find)(pt,["cssVarInfix",r]);if(!l)return n;const o=_t(e,t,l.path,"slug",a);if(o){const{valueKey:n}=l;return gt(e,t,o[n])}return n}(e,t,n,a):"custom"===r?function(e,t,n,c){var r;const a=null!==(r=Object(h.get)(e,["blocks",t,"custom",...c]))&&void 0!==r?r:Object(h.get)(e,["custom",...c]);return a?gt(e,t,a):n}(e,t,n,a):n}const Et=Object(a.createContext)({user:{},base:{},merged:{},setUserConfig:()=>{}}),ft={isGlobalStylesUserThemeJSON:!0,version:1};function ht(e,t){var n;let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"all";const{merged:r,base:o,user:i,setUserConfig:s}=Object(a.useContext)(Et),u=t?`settings.blocks.${t}.${e}`:"settings."+e,m=t=>{s(n=>{const c=Object(h.cloneDeep)(n),r=l.__EXPERIMENTAL_PATHS_WITH_MERGE[e]?u+".custom":u;return Object(h.set)(c,r,t),c})},d=t=>{const n=t?`settings.blocks.${t}.${e}`:"settings."+e,a=t=>{const c=Object(h.get)(t,n);var r,a;return l.__EXPERIMENTAL_PATHS_WITH_MERGE[e]?null!==(r=null!==(a=null==c?void 0:c.custom)&&void 0!==a?a:null==c?void 0:c.theme)&&void 0!==r?r:null==c?void 0:c.default:c};let s;switch(c){case"all":s=a(r);break;case"user":s=a(i);break;case"base":s=a(o);break;default:throw"Unsupported source"}return s},b=null!==(n=d(t))&&void 0!==n?n:d();return[b,m]}function vt(e,t){var n;let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"all";const{merged:r,base:l,user:o,setUserConfig:i}=Object(a.useContext)(Et),s=t?`styles.blocks.${t}.${e}`:"styles."+e,u=n=>{i(c=>{const a=Object(h.cloneDeep)(c);return Object(h.set)(a,s,jt(r.settings,t,e,n)),a})};let m;switch(c){case"all":m=gt(r.settings,t,null!==(n=Object(h.get)(o,s))&&void 0!==n?n:Object(h.get)(l,s));break;case"user":m=gt(r.settings,t,Object(h.get)(o,s));break;case"base":m=gt(l.settings,t,Object(h.get)(l,s));break;default:throw"Unsupported source"}return[m,u]}const yt=["background","backgroundColor","color","linkColor","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","textDecoration","textTransform","padding"];function wt(e){if(!e)return yt;const t=Object(l.getBlockType)(e);if(!t)return[];const n=[];return Object.keys(l.__EXPERIMENTAL_STYLE_PROPERTY).forEach(e=>{if(l.__EXPERIMENTAL_STYLE_PROPERTY[e].support)return l.__EXPERIMENTAL_STYLE_PROPERTY[e].requiresOptOut&&Object(h.has)(t.supports,l.__EXPERIMENTAL_STYLE_PROPERTY[e].support[0])&&!1!==Object(h.get)(t.supports,l.__EXPERIMENTAL_STYLE_PROPERTY[e].support)||Object(h.get)(t.supports,l.__EXPERIMENTAL_STYLE_PROPERTY[e].support,!1)?n.push(e):void 0}),n}function St(e){const[t]=ht("color.palette.custom",e),[n]=ht("color.palette.theme",e),[c]=ht("color.palette.default",e),[r]=ht("color.defaultPalette");return Object(a.useMemo)(()=>{const e=[];return n&&n.length&&e.push({name:Object(O._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&c&&c.length&&e.push({name:Object(O._x)("Default","Indicates this palette comes from WordPress."),colors:c}),t&&t.length&&e.push({name:Object(O._x)("Custom","Indicates this palette is created by the user."),colors:t}),e},[t,n,c])}var xt=()=>{const[e="serif"]=vt("typography.fontFamily"),[t="black"]=vt("color.text"),[n="blue"]=vt("elements.link.color.text"),[c="white"]=vt("color.background"),[r]=vt("color.gradient");return Object(a.createElement)(p.Card,{className:"edit-site-global-styles-preview",style:{background:null!=r?r:c}},Object(a.createElement)(p.__experimentalHStack,{spacing:5},Object(a.createElement)("div",{style:{fontFamily:e,fontSize:"80px",color:t}},"Aa"),Object(a.createElement)(p.__experimentalVStack,{spacing:2},Object(a.createElement)(p.ColorIndicator,{colorValue:t}),Object(a.createElement)(p.ColorIndicator,{colorValue:n}))))},Tt=n("wx14"),kt=n("iClF");var It=function(e){let{path:t,icon:n,children:c,isBack:r=!1,...l}=e;const o=Object(p.__experimentalUseNavigator)();return Object(a.createElement)(p.__experimentalItem,Object(Tt.a)({onClick:()=>o.push(t,{isBack:r})},l),n&&Object(a.createElement)(p.__experimentalHStack,{justify:"flex-start"},Object(a.createElement)(p.FlexItem,null,Object(a.createElement)(kt.a,{icon:n,size:24})),Object(a.createElement)(p.FlexItem,null,c)),!n&&c)};var Ct=Object(a.createElement)(E.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)(E.Path,{d:"M6.9 7L3 17.8h1.7l1-2.8h4.1l1 2.8h1.7L8.6 7H6.9zm-.7 6.6l1.5-4.3 1.5 4.3h-3zM21.6 17c-.1.1-.2.2-.3.2-.1.1-.2.1-.4.1s-.3-.1-.4-.2c-.1-.1-.1-.3-.1-.6V12c0-.5 0-1-.1-1.4-.1-.4-.3-.7-.5-1-.2-.2-.5-.4-.9-.5-.4 0-.8-.1-1.3-.1s-1 .1-1.4.2c-.4.1-.7.3-1 .4-.2.2-.4.3-.6.5-.1.2-.2.4-.2.7 0 .3.1.5.2.8.2.2.4.3.8.3.3 0 .6-.1.8-.3.2-.2.3-.4.3-.7 0-.3-.1-.5-.2-.7-.2-.2-.4-.3-.6-.4.2-.2.4-.3.7-.4.3-.1.6-.1.8-.1.3 0 .6 0 .8.1.2.1.4.3.5.5.1.2.2.5.2.9v1.1c0 .3-.1.5-.3.6-.2.2-.5.3-.9.4-.3.1-.7.3-1.1.4-.4.1-.8.3-1.1.5-.3.2-.6.4-.8.7-.2.3-.3.7-.3 1.2 0 .6.2 1.1.5 1.4.3.4.9.5 1.6.5.5 0 1-.1 1.4-.3.4-.2.8-.6 1.1-1.1 0 .4.1.7.3 1 .2.3.6.4 1.2.4.4 0 .7-.1.9-.2.2-.1.5-.3.7-.4h-.3zm-3-.9c-.2.4-.5.7-.8.8-.3.2-.6.2-.8.2-.4 0-.6-.1-.9-.3-.2-.2-.3-.6-.3-1.1 0-.5.1-.9.3-1.2s.5-.5.8-.7c.3-.2.7-.3 1-.5.3-.1.6-.3.7-.6v3.4z"}));var Nt=Object(a.createElement)(E.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(a.createElement)(E.Path,{d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z"})),Pt=n("Civd");const At=[];function Mt(e){return[Rt(e),Lt(e),Bt(e),Dt(e)].some(Boolean)}function Rt(e){const t=wt(e);return ht("border.color",e)[0]&&t.includes("borderColor")}function Lt(e){const t=wt(e);return ht("border.radius",e)[0]&&t.includes("borderRadius")}function Bt(e){const t=wt(e);return ht("border.style",e)[0]&&t.includes("borderStyle")}function Dt(e){const t=wt(e);return ht("border.width",e)[0]&&t.includes("borderWidth")}function Ft(e){let{name:t}=e;const n=Object(p.__experimentalUseCustomUnits)({availableUnits:ht("spacing.units")[0]||["px","em","rem"]}),c=Dt(t),[r,l]=vt("border.width",t),o=Bt(t),[i,s]=vt("border.style",t),[u=At]=ht("color.palette"),m=!ht("color.custom")[0],d=!ht("color.customGradient")[0],b=Rt(t),[_,j]=vt("border.color",t),g=Lt(t),[E,f]=vt("border.radius",t);return Object(a.createElement)(p.PanelBody,{title:Object(O.__)("Border"),initialOpen:!0},(c||o)&&Object(a.createElement)("div",{className:"edit-site-global-styles-sidebar__border-controls-row"},c&&Object(a.createElement)(p.__experimentalUnitControl,{value:r,label:Object(O.__)("Width"),min:0,onChange:e=>{l(e||void 0)},units:n}),o&&Object(a.createElement)(Re.__experimentalBorderStyleControl,{value:i,onChange:s})),b&&Object(a.createElement)(Re.__experimentalColorGradientControl,{label:Object(O.__)("Color"),colorValue:_,colors:u,gradients:void 0,disableCustomColors:m,disableCustomGradients:d,onColorChange:j}),g&&Object(a.createElement)(Re.__experimentalBorderRadiusControl,{values:E,onChange:f}))}function Gt(e){const t=wt(e);return t.includes("color")||t.includes("backgroundColor")||t.includes("background")||t.includes("linkColor")}const Vt=["horizontal","vertical"];function zt(e){const t=Ut(e),n=Ht(e),c=Wt(e);return t||n||c}function Ut(e){const t=wt(e),[n]=ht("spacing.padding",e);return n&&t.includes("padding")}function Ht(e){const t=wt(e),[n]=ht("spacing.margin",e);return n&&t.includes("margin")}function Wt(e){const t=wt(e),[n]=ht("spacing.blockGap",e);return n&&t.includes("--wp--style--block-gap")}function qt(e,t){if(!t)return e;const n={};return t.forEach(t=>{"vertical"===t&&(n.top=e.top,n.bottom=e.bottom),"horizontal"===t&&(n.left=e.left,n.right=e.right),n[t]=e[t]}),n}function $t(e){return e&&"string"==typeof e?{top:e,right:e,bottom:e,left:e}:e}function Kt(e){let{name:t}=e;const n=Ut(t),c=Ht(t),r=Wt(t),l=Object(p.__experimentalUseCustomUnits)({availableUnits:ht("spacing.units",t)[0]||["%","px","em","rem","vw"]}),[o,i]=vt("spacing.padding",t),s=$t(o),u=Object(Re.__experimentalUseCustomSides)(t,"padding"),m=u&&u.some(e=>Vt.includes(e)),d=e=>{const t=qt(e,u);i(t)},b=()=>d({}),[_,j]=vt("spacing.margin",t),g=$t(_),E=Object(Re.__experimentalUseCustomSides)(t,"margin"),f=E&&E.some(e=>Vt.includes(e)),h=e=>{const t=qt(e,E);j(t)},v=()=>h({}),[y,w]=vt("spacing.blockGap",t),S=()=>w(void 0);return Object(a.createElement)(p.__experimentalToolsPanel,{label:Object(O.__)("Dimensions"),resetAll:()=>{b(),v(),S()}},n&&Object(a.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>!!s&&Object.keys(s).length,label:Object(O.__)("Padding"),onDeselect:b,isShownByDefault:!0},Object(a.createElement)(p.__experimentalBoxControl,{values:s,onChange:d,label:Object(O.__)("Padding"),sides:u,units:l,allowReset:!1,splitOnAxis:m})),c&&Object(a.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>!!g&&Object.keys(g).length,label:Object(O.__)("Margin"),onDeselect:v,isShownByDefault:!0},Object(a.createElement)(p.__experimentalBoxControl,{values:g,onChange:h,label:Object(O.__)("Margin"),sides:E,units:l,allowReset:!1,splitOnAxis:f})),r&&Object(a.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>!!y,label:Object(O.__)("Block spacing"),onDeselect:S,isShownByDefault:!0},Object(a.createElement)(p.__experimentalUnitControl,{label:Object(O.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:w,units:l,value:y})))}function Qt(e){const t=Yt(e),n=Xt(e),c=Zt(e),r=wt(e);return t||n||c||r.includes("fontSize")}function Yt(e){const t=wt(e);return ht("typography.lineHeight",e)[0]&&t.includes("lineHeight")}function Xt(e){const t=wt(e),n=ht("typography.fontStyle",e)[0]&&t.includes("fontStyle"),c=ht("typography.fontWeight",e)[0]&&t.includes("fontWeight");return n||c}function Zt(e){const t=wt(e);return ht("typography.letterSpacing",e)[0]&&t.includes("letterSpacing")}function Jt(e){let{name:t,element:n}=e;const c=wt(t),r="text"!==n&&n?`elements.${n}.`:"",[l]=ht("typography.fontSizes",t),o=!ht("typography.customFontSize",t)[0],[i]=ht("typography.fontFamilies",t),s=ht("typography.fontStyle",t)[0]&&c.includes("fontStyle"),u=ht("typography.fontWeight",t)[0]&&c.includes("fontWeight"),m=Yt(t),d=Xt(t),b=Zt(t),[O,_]=vt(r+"typography.fontFamily",t),[j,g]=vt(r+"typography.fontSize",t),[E,f]=vt(r+"typography.fontStyle",t),[h,v]=vt(r+"typography.fontWeight",t),[y,w]=vt(r+"typography.lineHeight",t),[S,x]=vt(r+"typography.letterSpacing",t),[T]=vt(r+"color.background",t),[k]=vt(r+"color.gradient",t),[I]=vt(r+"color.text",t),C="link"===n?{textDecoration:"underline"}:{};return Object(a.createElement)(p.PanelBody,{className:"edit-site-typography-panel",initialOpen:!0},Object(a.createElement)("div",{className:"edit-site-typography-panel__preview",style:{fontFamily:null!=O?O:"serif",background:null!=k?k:T,color:I,fontSize:j,fontStyle:E,fontWeight:h,letterSpacing:S,...C}},"Aa"),c.includes("fontFamily")&&Object(a.createElement)(Re.__experimentalFontFamilyControl,{fontFamilies:i,value:O,onChange:_}),c.includes("fontSize")&&Object(a.createElement)(p.FontSizePicker,{value:j,onChange:g,fontSizes:l,disableCustomFontSizes:o}),m&&Object(a.createElement)(Re.LineHeightControl,{value:y,onChange:w}),d&&Object(a.createElement)(Re.__experimentalFontAppearanceControl,{value:{fontStyle:E,fontWeight:h},onChange:e=>{let{fontStyle:t,fontWeight:n}=e;f(t),v(n)},hasFontStyles:s,hasFontWeights:u}),b&&Object(a.createElement)(Re.__experimentalLetterSpacingControl,{value:S,onChange:x}))}var en=function(e){let{name:t,parentMenu:n=""}=e;const c=Qt(t),r=Gt(t),l=Mt(t),o=zt(t),i=l||o;return Object(a.createElement)(p.__experimentalItemGroup,null,c&&Object(a.createElement)(It,{icon:Ct,path:n+"/typography"},Object(O.__)("Typography")),r&&Object(a.createElement)(It,{icon:Nt,path:n+"/colors"},Object(O.__)("Colors")),i&&Object(a.createElement)(It,{icon:Pt.a,path:n+"/layout"},Object(O.__)("Layout")))};var tn=function(){return Object(a.createElement)(p.Card,{size:"small"},Object(a.createElement)(p.CardBody,null,Object(a.createElement)(xt,null)),Object(a.createElement)(p.CardBody,null,Object(a.createElement)(en,null)),Object(a.createElement)(p.CardDivider,null),Object(a.createElement)(p.CardBody,null,Object(a.createElement)(p.__experimentalItemGroup,null,Object(a.createElement)(p.__experimentalItem,null,Object(a.createElement)("p",null,Object(O.__)("Customize the appearance of specific blocks for the whole site."))),Object(a.createElement)(It,{path:"/blocks"},Object(O.__)("Blocks")))))},nn=n("1iEr"),cn=n("2gm7");var rn=function(e){let{back:t,title:n,description:c}=e;return Object(a.createElement)(p.__experimentalVStack,{spacing:2},Object(a.createElement)(p.__experimentalHStack,{spacing:2},Object(a.createElement)(p.__experimentalView,null,Object(a.createElement)(It,{path:t,icon:Object(a.createElement)(kt.a,{icon:Object(O.isRTL)()?nn.a:cn.a,variant:"muted"}),size:"small",isBack:!0,"aria-label":Object(O.__)("Navigate to the previous view")})),Object(a.createElement)(p.__experimentalSpacer,null,Object(a.createElement)(p.__experimentalHeading,{level:5},n))),c&&Object(a.createElement)("p",{className:"edit-site-global-styles-header__description"},c))};function an(e){let{block:t}=e;const n=Qt(t.name),c=Gt(t.name),r=Mt(t.name),l=zt(t.name);return n||c||(r||l)?Object(a.createElement)(It,{path:"/blocks/"+t.name},Object(a.createElement)(p.__experimentalHStack,{justify:"flex-start"},Object(a.createElement)(p.FlexItem,null,Object(a.createElement)(Re.BlockIcon,{icon:t.icon})),Object(a.createElement)(p.FlexItem,null,t.title))):null}var ln=function(){return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(rn,{back:"/",title:Object(O.__)("Blocks"),description:Object(O.__)("Customize the appearance of specific blocks and for the whole site.")}),Object(l.getBlockTypes)().map(e=>Object(a.createElement)(an,{block:e,key:"menu-itemblock-"+e.name})))};var on=function(e){let{name:t}=e;const n=Object(l.getBlockType)(t);return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(rn,{back:"/blocks",title:n.title}),Object(a.createElement)(en,{parentMenu:"/blocks/"+t,name:t}))};var sn=function(e){let{children:t}=e;return Object(a.createElement)(p.__experimentalHeading,{className:"edit-site-global-styles-subtitle",level:2},t)};function un(e){let{name:t,parentMenu:n,element:c,label:r}=e;const l=!t,o="text"!==c&&c?`elements.${c}.`:"",i="link"===c?{textDecoration:"underline"}:{},[s]=vt(o+"typography.fontFamily",t),[u]=vt(o+"typography.fontStyle",t),[m]=vt(o+"typography.fontWeight",t),[d]=vt(o+"typography.letterSpacing",t),[b]=vt(o+"color.background",t),[_]=vt(o+"color.gradient",t),[j]=vt(o+"color.text",t);return l?Object(a.createElement)(It,{path:n+"/typography/"+c},Object(a.createElement)(p.__experimentalHStack,{justify:"flex-start"},Object(a.createElement)(p.FlexItem,{className:"edit-site-global-styles-screen-typography__indicator",style:{fontFamily:null!=s?s:"serif",background:null!=_?_:b,color:j,fontStyle:u,fontWeight:m,letterSpacing:d,...i}},Object(O.__)("Aa")),Object(a.createElement)(p.FlexItem,null,r))):null}var mn=function(e){let{name:t}=e;const n=void 0===t?"":"/blocks/"+t;return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(rn,{back:n||"/",title:Object(O.__)("Typography"),description:Object(O.__)("Manage the typography settings for different elements.")}),!t&&Object(a.createElement)("div",{className:"edit-site-global-styles-screen-typography"},Object(a.createElement)(p.__experimentalVStack,{spacing:3},Object(a.createElement)(sn,null,Object(O.__)("Elements")),Object(a.createElement)(p.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},Object(a.createElement)(un,{name:t,parentMenu:n,element:"text",label:Object(O.__)("Text")}),Object(a.createElement)(un,{name:t,parentMenu:n,element:"link",label:Object(O.__)("Links")})))),!!t&&Object(a.createElement)(Jt,{name:t,element:"text"}))};const dn={text:{description:Object(O.__)("Manage the fonts used on the site."),title:Object(O.__)("Text")},link:{description:Object(O.__)("Manage the fonts and typography used on the links."),title:Object(O.__)("Links")}};var bn=function(e){let{name:t,element:n}=e;const c=void 0===t?"/typography":"/blocks/"+t+"/typography";return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(rn,{back:c,title:dn[n].title,description:dn[n].description}),Object(a.createElement)(Jt,{name:t,element:n}))};const pn=[];var On=function(e){let{name:t}=e;const[n]=ht("color.palette.custom"),[c]=ht("color.palette.theme"),[r]=ht("color.palette.default"),[l]=ht("color.defaultPalette",t),o=Object(a.useMemo)(()=>[...n||pn,...c||pn,...r&&l?r:pn],[n,c,r,l]),i=t?"/blocks/"+t+"/colors/palette":"/colors/palette",s=o.length>0?Object(O.sprintf)(Object(O._n)("%d color","%d colors",o.length),o.length):Object(O.__)("Add custom colors");return Object(a.createElement)(p.__experimentalVStack,{spacing:3},Object(a.createElement)(sn,null,Object(O.__)("Palette")),Object(a.createElement)(p.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},Object(a.createElement)(It,{path:i},Object(a.createElement)(p.__experimentalHStack,{isReversed:0===o.length},Object(a.createElement)(p.FlexBlock,null,Object(a.createElement)(p.__experimentalZStack,{isLayered:!1,offset:-8},o.slice(0,5).map(e=>{let{color:t}=e;return Object(a.createElement)(p.ColorIndicator,{key:t,colorValue:t})}))),Object(a.createElement)(p.FlexItem,null,s)))))};function _n(e){let{name:t,parentMenu:n}=e;const c=wt(t),r=c.includes("backgroundColor")||c.includes("background"),[l]=vt("color.background",t),[o]=vt("color.gradient",t);return r?Object(a.createElement)(It,{path:n+"/colors/background"},Object(a.createElement)(p.__experimentalHStack,{justify:"flex-start"},Object(a.createElement)(p.FlexItem,null,Object(a.createElement)(p.ColorIndicator,{colorValue:null!=o?o:l})),Object(a.createElement)(p.FlexItem,null,Object(O.__)("Background")))):null}function jn(e){let{name:t,parentMenu:n}=e;const c=wt(t).includes("color"),[r]=vt("color.text",t);return c?Object(a.createElement)(It,{path:n+"/colors/text"},Object(a.createElement)(p.__experimentalHStack,{justify:"flex-start"},Object(a.createElement)(p.FlexItem,null,Object(a.createElement)(p.ColorIndicator,{colorValue:r})),Object(a.createElement)(p.FlexItem,null,Object(O.__)("Text")))):null}function gn(e){let{name:t,parentMenu:n}=e;const c=wt(t).includes("linkColor"),[r]=vt("elements.link.color.text",t);return c?Object(a.createElement)(It,{path:n+"/colors/link"},Object(a.createElement)(p.__experimentalHStack,{justify:"flex-start"},Object(a.createElement)(p.FlexItem,null,Object(a.createElement)(p.ColorIndicator,{colorValue:r})),Object(a.createElement)(p.FlexItem,null,Object(O.__)("Links")))):null}var En=function(e){let{name:t}=e;const n=void 0===t?"":"/blocks/"+t;return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(rn,{back:n||"/",title:Object(O.__)("Colors"),description:Object(O.__)("Manage palettes and the default color of different global elements on the website.")}),Object(a.createElement)("div",{className:"edit-site-global-styles-screen-colors"},Object(a.createElement)(p.__experimentalVStack,{spacing:10},Object(a.createElement)(On,{name:t}),Object(a.createElement)(p.__experimentalVStack,{spacing:3},Object(a.createElement)(sn,null,Object(O.__)("Elements")),Object(a.createElement)(p.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},Object(a.createElement)(_n,{name:t,parentMenu:n}),Object(a.createElement)(jn,{name:t,parentMenu:n}),Object(a.createElement)(gn,{name:t,parentMenu:n}))))))};function fn(e){let{name:t}=e;const[n,c]=ht("color.palette.theme",t),[r]=ht("color.palette.theme",t,"base"),[l,o]=ht("color.palette.default",t),[i]=ht("color.palette.default",t,"base"),[s,u]=ht("color.palette.custom",t),[m]=ht("color.defaultPalette",t);return Object(a.createElement)(p.__experimentalVStack,{className:"edit-site-global-styles-color-palette-panel",spacing:10},!!n&&!!n.length&&Object(a.createElement)(p.__experimentalPaletteEdit,{canReset:n!==r,canOnlyChangeValues:!0,colors:n,onChange:c,paletteLabel:Object(O.__)("Theme")}),!!l&&!!l.length&&!!m&&Object(a.createElement)(p.__experimentalPaletteEdit,{canReset:l!==i,canOnlyChangeValues:!0,colors:l,onChange:o,paletteLabel:Object(O.__)("Default")}),Object(a.createElement)(p.__experimentalPaletteEdit,{colors:s,onChange:u,paletteLabel:Object(O.__)("Custom"),emptyMessage:Object(O.__)("Custom colors are empty! Add some colors to create your own color palette."),slugPrefix:"custom-"}))}function hn(e){let{name:t}=e;const[n,c]=ht("color.gradients.theme",t),[r]=ht("color.gradients.theme",t,"base"),[l,o]=ht("color.gradients.default",t),[i]=ht("color.gradients.default",t,"base"),[s,u]=ht("color.gradients.custom",t),[m]=ht("color.defaultGradients",t),[d]=ht("color.duotone")||[];return Object(a.createElement)(p.__experimentalVStack,{className:"edit-site-global-styles-gradient-palette-panel",spacing:10},Object(a.createElement)("div",null,Object(a.createElement)(p.__experimentalHeading,{className:"edit-site-global-styles-gradient-palette-panel__duotone-heading"},Object(O.__)("Duotone")),Object(a.createElement)(p.DuotonePicker,{duotonePalette:d,disableCustomDuotone:!0,disableCustomColors:!0,clearable:!1,onChange:h.noop})),!!n&&!!n.length&&Object(a.createElement)(p.__experimentalPaletteEdit,{canReset:n!==r,canOnlyChangeValues:!0,gradients:n,onChange:c,paletteLabel:Object(O.__)("Theme")}),!!l&&!!l.length&&!!m&&Object(a.createElement)(p.__experimentalPaletteEdit,{canReset:l!==i,canOnlyChangeValues:!0,gradients:l,onChange:o,paletteLabel:Object(O.__)("Default")}),Object(a.createElement)(p.__experimentalPaletteEdit,{gradients:s,onChange:u,paletteLabel:Object(O.__)("Custom"),emptyMessage:Object(O.__)("Custom gradients are empty! Add some gradients to create your own palette."),slugPrefix:"custom-"}))}var vn=function(e){let{name:t}=e;const[n,c]=Object(a.useState)("solid"),r=void 0===t?"":"/blocks/"+t;return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(rn,{back:r+"/colors",title:Object(O.__)("Palette"),description:Object(O.__)("Palettes are used to provide default color options for blocks and various design tools. Here you can edit the colors with their labels.")}),Object(a.createElement)(p.__experimentalToggleGroupControl,{className:"edit-site-screen-color-palette-toggle",value:n,onChange:c,label:Object(O.__)("Select palette type"),hideLabelFromVision:!0,isBlock:!0},Object(a.createElement)(p.__experimentalToggleGroupControlOption,{value:"solid",label:Object(O.__)("Solid")}),Object(a.createElement)(p.__experimentalToggleGroupControlOption,{value:"gradient",label:Object(O.__)("Gradient")})),"solid"===n&&Object(a.createElement)(fn,{name:t}),"gradient"===n&&Object(a.createElement)(hn,{name:t}))};var yn=function(e){let{name:t}=e;const n=void 0===t?"":"/blocks/"+t,c=wt(t),[r]=ht("color.palette",t),[l]=ht("color.gradients",t),[o]=ht("color.custom",t),[i]=ht("color.customGradient",t),s=St(t),u=function(e){const[t]=ht("color.gradients.custom",e),[n]=ht("color.gradients.theme",e),[c]=ht("color.gradients.default",e),[r]=ht("color.defaultGradients");return Object(a.useMemo)(()=>{const e=[];return n&&n.length&&e.push({name:Object(O._x)("Theme","Indicates this palette comes from the theme."),gradients:n}),r&&c&&c.length&&e.push({name:Object(O._x)("Default","Indicates this palette comes from WordPress."),gradients:c}),t&&t.length&&e.push({name:Object(O._x)("Custom","Indicates this palette is created by the user."),gradients:t}),e},[t,n,c])}(t),[m]=ht("color.background",t),d=c.includes("backgroundColor")&&m&&(r.length>0||o),b=c.includes("background")&&(l.length>0||i),[p,_]=vt("color.background",t),[j]=vt("color.background",t,"user"),[g,E]=vt("color.gradient",t),[f]=vt("color.gradient",t,"user");if(!d&&!b)return null;const h=[];let v={};d&&(v={colorValue:p,onColorChange:_},p&&(v.clearable=p===j));let y={};return b&&(y={gradientValue:g,onGradientChange:E},g&&(y.clearable=g===f)),h.push({...v,...y,label:Object(O.__)("Background color")}),Object(a.createElement)(a.Fragment,null,Object(a.createElement)(rn,{back:n+"/colors",title:Object(O.__)("Background"),description:Object(O.__)("Set a background color or gradient for the whole website.")}),Object(a.createElement)(Re.__experimentalPanelColorGradientSettings,{title:Object(O.__)("Color"),settings:h,colors:s,gradients:u,disableCustomColors:!o,disableCustomGradients:!i,__experimentalHasMultipleOrigins:!0,showTitle:!1,enableAlpha:!0}))};var wn=function(e){let{name:t}=e;const n=void 0===t?"":"/blocks/"+t,c=wt(t),[r]=ht("color.palette",t),[l]=ht("color.custom",t),[o]=ht("color.text",t),i=St(t),s=c.includes("color")&&o&&(r.length>0||l),[u,m]=vt("color.text",t),[d]=vt("color.text",t,"user");if(!s)return null;const b=[{colorValue:u,onColorChange:m,label:Object(O.__)("Text color"),clearable:u===d}];return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(rn,{back:n+"/colors",title:Object(O.__)("Text"),description:Object(O.__)("Set the default color used for text across the site.")}),Object(a.createElement)(Re.__experimentalPanelColorGradientSettings,{title:Object(O.__)("Color"),settings:b,colors:i,disableCustomColors:!l,__experimentalHasMultipleOrigins:!0,showTitle:!1,enableAlpha:!0}))};var Sn=function(e){let{name:t}=e;const n=void 0===t?"":"/blocks/"+t,c=wt(t),[r]=ht("color.palette",t),[l]=ht("color.custom",t),o=St(t),[i]=ht("color.link",t),s=c.includes("linkColor")&&i&&(r.length>0||l),[u,m]=vt("elements.link.color.text",t),[d]=vt("elements.link.color.text",t,"user");if(!s)return null;const b=[{colorValue:u,onColorChange:m,label:Object(O.__)("Link color"),clearable:u===d}];return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(rn,{back:n+"/colors",title:Object(O.__)("Links"),description:Object(O.__)("Set the default color used for links across the site.")}),Object(a.createElement)(Re.__experimentalPanelColorGradientSettings,{title:Object(O.__)("Color"),settings:b,colors:o,disableCustomColors:!l,__experimentalHasMultipleOrigins:!0,showTitle:!1,enableAlpha:!0}))};var xn=function(e){let{name:t}=e;const n=void 0===t?"":"/blocks/"+t,c=Mt(t),r=zt(t);return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(rn,{back:n||"/",title:Object(O.__)("Layout")}),r&&Object(a.createElement)(Kt,{name:t}),c&&Object(a.createElement)(Ft,{name:t}))};function Tn(e){let{name:t}=e;const n=void 0===t?"":"/blocks/"+t;return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(p.__experimentalNavigatorScreen,{path:n+"/typography"},Object(a.createElement)(mn,{name:t})),Object(a.createElement)(p.__experimentalNavigatorScreen,{path:n+"/typography/text"},Object(a.createElement)(bn,{name:t,element:"text"})),Object(a.createElement)(p.__experimentalNavigatorScreen,{path:n+"/typography/link"},Object(a.createElement)(bn,{name:t,element:"link"})),Object(a.createElement)(p.__experimentalNavigatorScreen,{path:n+"/colors"},Object(a.createElement)(En,{name:t})),Object(a.createElement)(p.__experimentalNavigatorScreen,{path:n+"/colors/palette"},Object(a.createElement)(vn,{name:t})),Object(a.createElement)(p.__experimentalNavigatorScreen,{path:n+"/colors/background"},Object(a.createElement)(yn,{name:t})),Object(a.createElement)(p.__experimentalNavigatorScreen,{path:n+"/colors/text"},Object(a.createElement)(wn,{name:t})),Object(a.createElement)(p.__experimentalNavigatorScreen,{path:n+"/colors/link"},Object(a.createElement)(Sn,{name:t})),Object(a.createElement)(p.__experimentalNavigatorScreen,{path:n+"/layout"},Object(a.createElement)(xn,{name:t})))}var kn=function(){const e=Object(l.getBlockTypes)();return Object(a.createElement)(p.__experimentalNavigatorProvider,{initialPath:"/"},Object(a.createElement)(p.__experimentalNavigatorScreen,{path:"/"},Object(a.createElement)(tn,null)),Object(a.createElement)(p.__experimentalNavigatorScreen,{path:"/blocks"},Object(a.createElement)(ln,null)),e.map(e=>Object(a.createElement)(p.__experimentalNavigatorScreen,{key:"menu-block-"+e.name,path:"/blocks/"+e.name},Object(a.createElement)(on,{name:e.name}))),Object(a.createElement)(Tn,null),e.map(e=>Object(a.createElement)(Tn,{key:"screens-block-"+e.name,name:e.name})))};function In(e){if(Object(h.startsWith)(e,"var:")){return`var(--wp--${e.slice("var:".length).split("|").join("--")})`}return e}const Cn=(e,t)=>{var n,c;const r=[];if(null==e||!e.settings)return r;const a=e=>{const t={};return pt.forEach(n=>{let{path:c}=n;const r=Object(h.get)(e,c,!1);!1!==r&&Object(h.set)(t,c,r)}),t},l=a(e.settings),o=null===(n=e.settings)||void 0===n?void 0:n.custom;return Object(h.isEmpty)(l)&&!o||r.push({presets:l,custom:o,selector:"body"}),Object(h.forEach)(null===(c=e.settings)||void 0===c?void 0:c.blocks,(e,n)=>{const c=a(e),l=e.custom;Object(h.isEmpty)(c)&&!l||r.push({presets:c,custom:l,selector:t[n].selector})}),r},Nn=(e,t)=>{const n=Cn(e,t);let c="";return n.forEach(e=>{let{presets:t,custom:n,selector:r}=e;const a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(h.reduce)(pt,(t,n)=>{let{path:c,valueKey:r,cssVarInfix:a}=n;const l=Object(h.get)(e,c,[]);return["default","theme","custom"].forEach(e=>{l[e]&&l[e].forEach(e=>{t.push(`--wp--preset--${a}--${Object(h.kebabCase)(e.slug)}: ${e[r]}`)})}),t},[])}(t),l=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,c=arguments.length>2?arguments[2]:void 0,r=[];return Object.keys(t).forEach(a=>{const l=n+Object(h.kebabCase)(a.replace("/","-")),o=t[a];if(o instanceof Object){const t=l+c;r=[...r,...e(o,t,c)]}else r.push(`${l}: ${o}`)}),r}(n,"--wp--custom--","--");l.length>0&&a.push(...l),a.length>0&&(c+=`${r}{${a.join(";")};}`)}),c},Pn=(e,t)=>{const n=((e,t)=>{var n,c;const r=[];if(null==e||!e.styles)return r;const a=e=>Object(h.pickBy)(e,(e,t)=>["border","color","spacing","typography"].includes(t)),o=a(e.styles);return o&&r.push({styles:o,selector:"body"}),Object(h.forEach)(null===(n=e.styles)||void 0===n?void 0:n.elements,(e,t)=>{e&&l.__EXPERIMENTAL_ELEMENTS[t]&&r.push({styles:e,selector:l.__EXPERIMENTAL_ELEMENTS[t]})}),Object(h.forEach)(null===(c=e.styles)||void 0===c?void 0:c.blocks,(e,n)=>{var c;const o=a(e);o&&null!=t&&null!==(c=t[n])&&void 0!==c&&c.selector&&r.push({styles:o,selector:t[n].selector}),Object(h.forEach)(null==e?void 0:e.elements,(e,c)=>{e&&null!=t&&t[n]&&null!==l.__EXPERIMENTAL_ELEMENTS&&void 0!==l.__EXPERIMENTAL_ELEMENTS&&l.__EXPERIMENTAL_ELEMENTS[c]&&r.push({styles:e,selector:t[n].selector.split(",").map(e=>e+" "+l.__EXPERIMENTAL_ELEMENTS[c]).join(",")})})}),r})(e,t),c=Cn(e,t);let r=".wp-site-blocks > * { margin-top: 0; margin-bottom: 0; }.wp-site-blocks > * + * { margin-top: var( --wp--style--block-gap ); }";return n.forEach(e=>{let{selector:t,styles:n}=e;const c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(h.reduce)(l.__EXPERIMENTAL_STYLE_PROPERTY,(t,n,c)=>{let{value:r,properties:a}=n;const l=r;if("elements"===Object(h.first)(l))return t;const o=Object(h.get)(e,l);if(a&&!Object(h.isString)(o))Object.entries(a).forEach(e=>{const[n,c]=e;if(!Object(h.get)(o,[c],!1))return;const r=Object(h.kebabCase)(n);t.push(`${r}: ${In(Object(h.get)(o,[c]))}`)});else if(Object(h.get)(e,l,!1)){const n=c.startsWith("--")?c:Object(h.kebabCase)(c);t.push(`${n}: ${In(Object(h.get)(e,l))}`)}return t},[])}(n);0!==c.length&&(r+=`${t}{${c.join(";")};}`)}),c.forEach(e=>{let{selector:t,presets:n}=e;"body"===t&&(t="");const c=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(h.reduce)(pt,(n,c)=>{let{path:r,cssVarInfix:a,classes:l}=c;if(!l)return n;const o=Object(h.get)(t,r,[]);return["default","theme","custom"].forEach(t=>{o[t]&&o[t].forEach(t=>{let{slug:c}=t;l.forEach(t=>{let{classSuffix:r,propertyName:l}=t;const o=`.has-${Object(h.kebabCase)(c)}-${r}`,i=e.split(",").map(e=>`${e}${o}`).join(","),s=`var(--wp--preset--${a}--${Object(h.kebabCase)(c)})`;n+=`${i}{${l}: ${s} !important;}`})})}),n},"")}(t,n);Object(h.isEmpty)(c)||(r+=c)}),r};function An(){const[e,t]=(()=>{const{user:e,setUserConfig:t}=Object(a.useContext)(Et);return[!!e&&!Object(h.isEqual)(e,ft),Object(a.useCallback)(()=>t(()=>ft),[t])]})();return Object(a.createElement)(dt,{className:"edit-site-global-styles-sidebar",identifier:"edit-site/global-styles",title:Object(O.__)("Styles"),icon:bt,closeLabel:Object(O.__)("Close global styles sidebar"),header:Object(a.createElement)(p.Flex,null,Object(a.createElement)(p.FlexBlock,null,Object(a.createElement)("strong",null,Object(O.__)("Styles")),Object(a.createElement)("span",{className:"edit-site-global-styles-sidebar__beta"},Object(O.__)("Beta"))),Object(a.createElement)(p.FlexItem,null,Object(a.createElement)(p.DropdownMenu,{icon:Ge.a,label:Object(O.__)("More Global Styles Actions"),toggleProps:{disabled:!e},controls:[{title:Object(O.__)("Reset to defaults"),onClick:t}]})))},Object(a.createElement)(kn,null))}const Mn="edit-site/template",Rn="edit-site/block-inspector";var Ln=e=>{let{sidebarName:t}=e;const{enableComplementaryArea:n}=Object(i.useDispatch)(S.i),[c,r]=t===Mn?[Object(O.__)("Template (selected)"),"is-active"]:[Object(O.__)("Template"),""],[l,o]=t===Rn?[Object(O.__)("Block (selected)"),"is-active"]:[Object(O.__)("Block"),""];return Object(a.createElement)("ul",null,Object(a.createElement)("li",null,Object(a.createElement)(p.Button,{onClick:()=>n(k,Mn),className:"edit-site-sidebar__panel-tab "+r,"aria-label":c,"data-label":Object(O.__)("Template")},Object(O.__)("Template"))),Object(a.createElement)("li",null,Object(a.createElement)(p.Button,{onClick:()=>n(k,Rn),className:"edit-site-sidebar__panel-tab "+o,"aria-label":l,"data-label":Object(O.__)("Block")},Object(O.__)("Block"))))};function Bn(e){let{area:t,clientId:n}=e;const{selectBlock:c,toggleBlockHighlight:r}=Object(i.useDispatch)(Re.store),l=()=>r(n,!0),o=()=>r(n,!1);return Object(a.createElement)(p.Button,{className:"edit-site-template-card__template-areas-item",icon:Object(u.getTemplatePartIcon)(t),onMouseOver:l,onMouseLeave:o,onFocus:l,onBlur:o,onClick:()=>{c(n)}},I[t])}function Dn(){const e=Object(i.useSelect)(e=>e(Pe).getCurrentTemplateTemplateParts(),[]);return e.length?Object(a.createElement)("section",{className:"edit-site-template-card__template-areas"},Object(a.createElement)(p.__experimentalHeading,{level:3,className:"edit-site-template-card__template-areas-title"},Object(O.__)("Areas")),Object(a.createElement)("ul",{className:"edit-site-template-card__template-areas-list"},e.map(e=>{let{templatePart:t,block:n}=e;return Object(a.createElement)("li",{key:t.slug},Object(a.createElement)(Bn,{area:t.area,clientId:n.clientId}))}))):null}function Fn(){const{title:e,description:t,icon:n}=Object(i.useSelect)(e=>{const{getEditedPostType:t,getEditedPostId:n}=e(Pe),{getEntityRecord:c}=e(s.store),{__experimentalGetTemplateInfo:r}=e(u.store),a=c("postType",t(),n());return a?r(a):{}},[]);return e||t?Object(a.createElement)("div",{className:"edit-site-template-card"},Object(a.createElement)(p.Icon,{className:"edit-site-template-card__icon",icon:n}),Object(a.createElement)("div",{className:"edit-site-template-card__content"},Object(a.createElement)("h2",{className:"edit-site-template-card__title"},e),Object(a.createElement)("div",{className:"edit-site-template-card__description"},t),Object(a.createElement)(Dn,null))):null}const{Slot:Gn,Fill:Vn}=Object(p.createSlotFill)("EditSiteSidebarInspector"),zn=Vn;function Un(){const{sidebar:e,isEditorSidebarOpened:t,hasBlockSelection:n}=Object(i.useSelect)(e=>{const t=e(S.i).getActiveComplementaryArea(k);return{sidebar:t,isEditorSidebarOpened:[Rn,Mn].includes(t),hasBlockSelection:!!e(Re.store).getBlockSelectionStart()}},[]),{enableComplementaryArea:c}=Object(i.useDispatch)(S.i);Object(a.useEffect)(()=>{t&&c(k,n?Rn:Mn)},[n,t]);let r=e;return t||(r=n?Rn:Mn),Object(a.createElement)(a.Fragment,null,Object(a.createElement)(dt,{identifier:r,title:Object(O.__)("Settings"),icon:mt.a,closeLabel:Object(O.__)("Close settings sidebar"),header:Object(a.createElement)(Ln,{sidebarName:r}),headerClassName:"edit-site-sidebar__panel-tabs"},r===Mn&&Object(a.createElement)(p.PanelBody,null,Object(a.createElement)(Fn,null)),r===Rn&&Object(a.createElement)(Gn,{bubblesVirtually:!0})),Object(a.createElement)(An,null))}var Hn=n("rmEH");var Wn=Object(a.createElement)(E.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)(E.Path,{d:"M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"})),qn=n("OE6V");const $n="__experimentalMainDashboardButton",{Fill:Kn,Slot:Qn}=Object(p.createSlotFill)($n),Yn=Kn;Yn.Slot=e=>{let{children:t}=e;const n=Object(p.__experimentalUseSlot)($n);return Boolean(n.fills&&n.fills.length)?Object(a.createElement)(Qn,{bubblesVirtually:!0}):t};var Xn=Yn;const Zn="site-editor";var Jn=e=>{let{activeItem:t=Zn}=e;const{isNavigationOpen:n,siteTitle:c}=Object(i.useSelect)(e=>{const{getEntityRecord:t}=e(s.store);return{siteTitle:(t("root","__unstableBase",void 0)||{}).name,isNavigationOpen:e(Pe).isNavigationOpened()}},[]),{setIsNavigationPanelOpened:r}=Object(i.useDispatch)(Pe),l=Object(a.useRef)();Object(a.useEffect)(()=>{n&&l.current.focus()},[t,n]);return Object(a.createElement)("div",{className:et()("edit-site-navigation-panel",{"is-open":n}),ref:l,tabIndex:"-1",onKeyDown:e=>{e.keyCode!==Ye.ESCAPE||e.defaultPrevented||(e.preventDefault(),r(!1))}},Object(a.createElement)("div",{className:"edit-site-navigation-panel__inner"},Object(a.createElement)("div",{className:"edit-site-navigation-panel__site-title-container"},Object(a.createElement)("div",{className:"edit-site-navigation-panel__site-title"},Object(Hn.decodeEntities)(c))),Object(a.createElement)("div",{className:"edit-site-navigation-panel__scroll-container"},Object(a.createElement)(p.__experimentalNavigation,{activeItem:t},Object(a.createElement)(Xn.Slot,null,Object(a.createElement)(p.__experimentalNavigationBackButton,{backButtonLabel:Object(O.__)("Dashboard"),className:"edit-site-navigation-panel__back-to-dashboard",href:"index.php"})),Object(a.createElement)(p.__experimentalNavigationMenu,null,Object(a.createElement)(p.__experimentalNavigationGroup,{title:Object(O.__)("Editor")},Object(a.createElement)(p.__experimentalNavigationItem,{icon:Wn,title:Object(O.__)("Site"),item:Zn,href:Object(D.addQueryArgs)(window.location.href,{postId:void 0,postType:void 0})}),Object(a.createElement)(p.__experimentalNavigationItem,{icon:Pt.a,title:Object(O.__)("Templates"),item:"wp_template",href:Object(D.addQueryArgs)(window.location.href,{postId:void 0,postType:"wp_template"})}),Object(a.createElement)(p.__experimentalNavigationItem,{icon:qn.a,title:Object(O.__)("Template Parts"),item:"wp_template_part",href:Object(D.addQueryArgs)(window.location.href,{postId:void 0,postType:"wp_template_part"})})))))))},ec=n("wduq");var tc=function(e){let{icon:t}=e;const{isNavigationOpen:n,isRequestingSiteIcon:c,siteIconUrl:r}=Object(i.useSelect)(e=>{const{getEntityRecord:t,isResolving:n}=e(s.store),c=t("root","__unstableBase",void 0)||{};return{isNavigationOpen:e(Pe).isNavigationOpened(),isRequestingSiteIcon:n("core","getEntityRecord",["root","__unstableBase",void 0]),siteIconUrl:c.site_icon_url}},[]),{setIsNavigationPanelOpened:l}=Object(i.useDispatch)(Pe),o=Object(Be.useReducedMotion)();let u=Object(a.createElement)(p.Icon,{size:"36px",icon:ec.a});const m={expand:{scale:1.7,borderRadius:0,transition:{type:"tween",duration:"0.2"}}};return r?u=Object(a.createElement)(p.__unstableMotion.img,{variants:!o&&m,alt:Object(O.__)("Site Icon"),className:"edit-site-navigation-toggle__site-icon",src:r}):c?u=null:t&&(u=Object(a.createElement)(p.Icon,{size:"36px",icon:t})),Object(a.createElement)(p.__unstableMotion.div,{className:"edit-site-navigation-toggle"+(n?" is-open":""),whileHover:"expand"},Object(a.createElement)(p.Button,{className:"edit-site-navigation-toggle__button has-icon",label:Object(O.__)("Toggle navigation"),onClick:()=>l(!n),showTooltip:!0},u))};const{Fill:nc,Slot:cc}=Object(p.createSlotFill)("EditSiteNavigationPanelPreview");function rc(e){let{isDefaultOpen:t=!1,activeTemplateType:n}=e;const c=Object(Be.useViewportMatch)("medium"),{setIsNavigationPanelOpened:r}=Object(i.useDispatch)(Pe);return Object(a.useEffect)(()=>{t&&c&&r(!0),c||r(!1)},[t,c,r]),Object(a.createElement)(a.Fragment,null,Object(a.createElement)(tc,null),Object(a.createElement)(Jn,{activeItem:n}),Object(a.createElement)(cc,null))}var ac=n("diJD");function lc(e){let{clientId:t}=e;const{getBlocks:n}=Object(i.useSelect)(Re.store),{replaceBlocks:c}=Object(i.useDispatch)(Re.store);return Object(a.createElement)(Re.BlockSettingsMenuControls,null,e=>{let{onClose:r}=e;return Object(a.createElement)(p.MenuItem,{onClick:()=>{c(t,n(t)),r()}},Object(O.__)("Detach blocks from template part"))})}function oc(e){let{closeModal:t,onCreate:n}=e;const[c,r]=Object(a.useState)(""),[l,o]=Object(a.useState)("uncategorized"),[s,m]=Object(a.useState)(!1),d=Object(Be.useInstanceId)(oc),b=Object(i.useSelect)(e=>e(u.store).__experimentalGetDefaultTemplatePartAreas(),[]);return Object(a.createElement)(p.Modal,{title:Object(O.__)("Create a template part"),closeLabel:Object(O.__)("Close"),onRequestClose:t,overlayClassName:"edit-site-create-template-part-modal"},Object(a.createElement)("form",{onSubmit:async e=>{e.preventDefault(),c&&(m(!0),await n({title:c,area:l}),m(!1),t())}},Object(a.createElement)(p.TextControl,{label:Object(O.__)("Name"),value:c,onChange:r,required:!0}),Object(a.createElement)(p.BaseControl,{label:Object(O.__)("Area"),id:"edit-site-create-template-part-modal__area-selection-"+d,className:"edit-site-create-template-part-modal__area-base-control"},Object(a.createElement)(p.__experimentalRadioGroup,{label:Object(O.__)("Area"),className:"edit-site-create-template-part-modal__area-radio-group",id:"edit-site-create-template-part-modal__area-selection-"+d,onChange:o,checked:l},b.map(e=>{let{icon:t,label:n,area:c,description:r}=e;return Object(a.createElement)(p.__experimentalRadio,{key:n,value:c,className:"edit-site-create-template-part-modal__area-radio"},Object(a.createElement)(p.Flex,{align:"start",justify:"start"},Object(a.createElement)(p.FlexItem,null,Object(a.createElement)(p.Icon,{icon:t})),Object(a.createElement)(p.FlexBlock,{className:"edit-site-create-template-part-modal__option-label"},n,Object(a.createElement)("div",null,r)),Object(a.createElement)(p.FlexItem,{className:"edit-site-create-template-part-modal__checkbox"},l===c&&Object(a.createElement)(p.Icon,{icon:Ve.a}))))}))),Object(a.createElement)(p.Flex,{className:"edit-site-create-template-part-modal__modal-actions",justify:"flex-end"},Object(a.createElement)(p.FlexItem,null,Object(a.createElement)(p.Button,{variant:"secondary",onClick:()=>{t()}},Object(O.__)("Cancel"))),Object(a.createElement)(p.FlexItem,null,Object(a.createElement)(p.Button,{variant:"primary",type:"submit",disabled:!c,isBusy:s},Object(O.__)("Create"))))))}function ic(e){let{clientIds:t,blocks:n}=e;const[c,r]=Object(a.useState)(!1),{replaceBlocks:o}=Object(i.useDispatch)(Re.store),{saveEntityRecord:u}=Object(i.useDispatch)(s.store),{createSuccessNotice:m}=Object(i.useDispatch)(F.store);return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(Re.BlockSettingsMenuControls,null,e=>{let{onClose:t}=e;return Object(a.createElement)(p.MenuItem,{onClick:()=>{r(!0),t()}},Object(O.__)("Make template part"))}),c&&Object(a.createElement)(oc,{closeModal:()=>{r(!1)},onCreate:async e=>{let{title:c,area:r}=e;const a=await u("postType","wp_template_part",{slug:Object(h.kebabCase)(c),title:c,content:Object(l.serialize)(n),area:r});o(t,Object(l.createBlock)("core/template-part",{slug:a.slug,theme:a.theme})),m(Object(O.__)("Template part created."),{type:"snackbar"})}}))}function sc(){var e;const{clientIds:t,blocks:n}=Object(i.useSelect)(e=>{const{getSelectedBlockClientIds:t,getBlocksByClientId:n}=e(Re.store),c=t();return{clientIds:c,blocks:n(c)}},[]);return 1===n.length&&"core/template-part"===(null===(e=n[0])||void 0===e?void 0:e.name)?Object(a.createElement)(lc,{clientId:t[0]}):Object(a.createElement)(ic,{clientIds:t,blocks:n})}var uc=n("B9Az");function mc(e){let{type:t,id:n,activePage:c,onActivePageChange:r}=e;const l=Object(i.useSelect)(e=>t&&n&&"URL"!==t&&e(s.store).getEntityRecord("postType",t,n),[t,n]),o=Object(a.useMemo)(()=>{if(null==l||!l.link)return null;const e=Object(D.getPathAndQueryString)(l.link);return e===(null==c?void 0:c.path)?null:()=>r({type:t,slug:l.slug,path:e,context:{postType:l.type,postId:l.id}})},[l,null==c?void 0:c.path,r]);return o&&Object(a.createElement)(p.Button,{icon:uc.a,label:Object(O.__)("Edit Page Template"),onClick:o})}function dc(e){let{onClick:t=(()=>{})}=e;const{shortcut:n,isBlockInspectorOpen:c}=Object(i.useSelect)(e=>({shortcut:e(Le.store).getShortcutRepresentation("core/edit-site/toggle-block-settings-sidebar"),isBlockInspectorOpen:e(S.i).getActiveComplementaryArea(Pe.name)===Rn}),[]),{enableComplementaryArea:r,disableComplementaryArea:l}=Object(i.useDispatch)(S.i),o=c?Object(O.__)("Hide more settings"):Object(O.__)("Show more settings");return Object(a.createElement)(p.MenuItem,{onClick:()=>{c?(l(k),Object(ze.speak)(Object(O.__)("Block settings closed"))):(r(k,Rn),Object(ze.speak)(Object(O.__)("Additional settings are now available in the Editor block settings sidebar"))),t()},shortcut:n},o)}function bc(){return Object(a.createElement)(Re.BlockSettingsMenuControls,null,e=>{let{selectedClientIds:t,onClose:n}=e;return Object(a.createElement)(pc,{selectedClientId:t[0],onClose:n})})}function pc(e){let{selectedClientId:t,onClose:n}=e;const c=Object(i.useSelect)(e=>{const n=e(Re.store).getBlock(t);if(n&&Object(l.isTemplatePart)(n)){const{theme:t,slug:c}=n.attributes;return e(s.store).getEntityRecord("postType","wp_template_part",`${t}//${c}`)}},[t]),{pushTemplatePart:r}=Object(i.useDispatch)(Pe);return c?Object(a.createElement)(p.MenuItem,{onClick:()=>{r(c.id),n()}},Object(O.sprintf)(Object(O.__)("Edit %s"),c.slug)):null}var Oc=n("cjQ8");var _c=function(){const{isTemplatePart:e,previousTemplateId:t}=Object(i.useSelect)(e=>{const{getEditedPostType:t,getPreviousEditedPostId:n}=e(Pe);return{isTemplatePart:"wp_template_part"===t(),previousTemplateId:n()}},[]),{goBack:n}=Object(i.useDispatch)(Pe);return e&&t?Object(a.createElement)(p.Button,{className:"edit-site-visual-editor__back-button",icon:Oc.a,onClick:()=>{n()}},Object(O.__)("Back")):null};function jc(e){let{direction:t,resizeWidthBy:n}=e;return Object(a.createElement)(a.Fragment,null,Object(a.createElement)("button",{className:"resizable-editor__drag-handle is-"+t,"aria-label":Object(O.__)("Drag to resize"),"aria-describedby":"resizable-editor__resize-help-"+t,onKeyDown:function(e){const{keyCode:c}=e;"left"===t&&c===Ye.LEFT||"right"===t&&c===Ye.RIGHT?n(20):("left"===t&&c===Ye.RIGHT||"right"===t&&c===Ye.LEFT)&&n(-20)}}),Object(a.createElement)(p.VisuallyHidden,{id:"resizable-editor__resize-help-"+t},Object(O.__)("Use left and right arrow keys to resize the canvas.")))}const gc="100%",Ec="100%",fc={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 hc=function(e){let{enableResizing:t,settings:n,...c}=e;const r=Object(i.useSelect)(e=>e(Pe).__experimentalGetPreviewDeviceType(),[]),l=Object(Re.__experimentalUseResizeCanvas)(r),[o,s]=Object(a.useState)(gc),[u,m]=Object(a.useState)(Ec),d=Object(a.useRef)(),b=Object(Re.__unstableUseMouseMoveTypingReset)(),O=Object(Be.useMergeRefs)([d,b]);Object(a.useEffect)((function(){const e=d.current;if(!e||!t)return;const n=new e.contentWindow.ResizeObserver(()=>{m(e.contentDocument.querySelector(".edit-site-block-editor__block-list").offsetHeight)});return n.observe(e.contentDocument.documentElement),()=>{n.disconnect()}}),[t]);const _=Object(a.useCallback)(e=>{d.current&&s(d.current.offsetWidth+e)},[]);return Object(a.createElement)(p.ResizableBox,{size:{width:o,height:u},onResizeStop:(e,t,n)=>{s(n.style.width)},minWidth:300,maxWidth:"100%",maxHeight:"100%",enable:{right:t,left:t},showHandle:t,resizeRatio:2,handleComponent:{left:Object(a.createElement)(jc,{direction:"left",resizeWidthBy:_}),right:Object(a.createElement)(jc,{direction:"right",resizeWidthBy:_})},handleClasses:void 0,handleStyles:{left:fc,right:fc}},Object(a.createElement)(Re.__unstableIframe,Object(Tt.a)({style:t?void 0:l,head:Object(a.createElement)(a.Fragment,null,Object(a.createElement)(Re.__unstableEditorStyles,{styles:n.styles}),Object(a.createElement)("style",null,".edit-site-block-editor__block-list { display: flow-root; }")),ref:O,name:"editor-canvas",className:"edit-site-visual-editor__editor-canvas"},c)))};const vc={type:"default",alignments:[]};function yc(e){let{setIsInserterOpen:t}=e;const{settings:n,templateType:c,templateId:r,page:l}=Object(i.useSelect)(e=>{const{getSettings:n,getEditedPostType:c,getEditedPostId:r,getPage:a}=e(Pe);return{settings:n(t),templateType:c(),templateId:r(),page:a()}},[t]),[o,u,m]=Object(s.useEntityBlockEditor)("postType",c),{setPage:d}=Object(i.useDispatch)(Pe),b=Object(a.useRef)(),p=Object(Be.useMergeRefs)([b,Object(Re.__unstableUseTypingObserver)()]),O=Object(Be.useViewportMatch)("small","<"),{clearSelectedBlock:_}=Object(i.useDispatch)(Re.store),j="wp_template_part"===c;return Object(a.createElement)(Re.BlockEditorProvider,{settings:n,value:o,onInput:u,onChange:m,useSubRegistry:!1},Object(a.createElement)(bc,null),Object(a.createElement)(sc,null),Object(a.createElement)(Re.__experimentalLinkControl.ViewerFill,null,Object(a.useCallback)(e=>Object(a.createElement)(mc,Object(Tt.a)({},e,{activePage:l,onActivePageChange:d})),[l])),Object(a.createElement)(zn,null,Object(a.createElement)(Re.BlockInspector,null)),Object(a.createElement)(Re.BlockTools,{className:et()("edit-site-visual-editor",{"is-focus-mode":j}),__unstableContentRef:b,onClick:e=>{e.target===e.currentTarget&&_()}},Object(a.createElement)(_c,null),Object(a.createElement)(hc,{key:r,enableResizing:j&&!O,settings:n,contentRef:p},Object(a.createElement)(Re.BlockList,{className:"edit-site-block-editor__block-list wp-site-blocks",__experimentalLayout:vc})),Object(a.createElement)(Re.__unstableBlockSettingsMenuFirstItem,null,e=>{let{onClose:t}=e;return Object(a.createElement)(dc,{onClick:t})})),Object(a.createElement)(ac.ReusableBlocksMenuItems,null))}function wc(e){let{openEntitiesSavedStates:t}=e;const{__experimentalGetDirtyEntityRecords:n,isSavingEntityRecord:c}=Object(i.useSelect)(s.store),r=Object(i.useSelect)(e=>e(Pe).isListViewOpened(),[]),a=Object(i.useSelect)(e=>e(S.i).getActiveComplementaryArea(Pe.name)===Rn,[]),{redo:l,undo:o}=Object(i.useDispatch)(s.store),{setIsListViewOpened:u}=Object(i.useDispatch)(Pe),{enableComplementaryArea:m,disableComplementaryArea:d}=Object(i.useDispatch)(S.i);return Object(Le.useShortcut)("core/edit-site/save",e=>{e.preventDefault();const r=n(),a=!!r.length;!r.some(e=>c(e.kind,e.name,e.key))&&a&&t()}),Object(Le.useShortcut)("core/edit-site/undo",e=>{o(),e.preventDefault()}),Object(Le.useShortcut)("core/edit-site/redo",e=>{l(),e.preventDefault()}),Object(Le.useShortcut)("core/edit-site/toggle-list-view",()=>{u(!r)}),Object(Le.useShortcut)("core/edit-site/toggle-block-settings-sidebar",e=>{e.preventDefault(),a?d(k):m(k,Rn)}),null}wc.Register=function(){const{registerShortcut:e}=Object(i.useDispatch)(Le.store);return Object(a.useEffect)(()=>{e({name:"core/edit-site/save",category:"global",description:Object(O.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),e({name:"core/edit-site/undo",category:"global",description:Object(O.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/edit-site/redo",category:"global",description:Object(O.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"}}),e({name:"core/edit-site/toggle-list-view",category:"global",description:Object(O.__)("Open the block list view."),keyCombination:{modifier:"access",character:"o"}}),e({name:"core/edit-site/toggle-block-settings-sidebar",category:"global",description:Object(O.__)("Show or hide the block settings sidebar."),keyCombination:{modifier:"primaryShift",character:","}}),e({name:"core/edit-site/next-region",category:"global",description:Object(O.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),e({name:"core/edit-site/previous-region",category:"global",description:Object(O.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"}]})},[e]),null};var Sc=wc;function xc(){const{setTemplate:e,setTemplatePart:t,showHomepage:n,setPage:c}=Object(i.useDispatch)(Pe);Object(a.useEffect)(()=>{const r=window.location.href,a=Object(D.getQueryArg)(r,"postId");if(!a)return void n();const l=Object(D.getQueryArg)(r,"postType");"page"===l||"post"===l?c({context:{postType:l,postId:a}}):"wp_template"===l?e(a):"wp_template_part"===l?t(a):n()},[]);const r=Object(i.useSelect)(e=>{var t,n;const{getEditedPostType:c,getEditedPostId:r,getPage:a}=e(Pe),l=a();let o=r(),i=c();return null!=l&&null!==(t=l.context)&&void 0!==t&&t.postId&&null!=l&&null!==(n=l.context)&&void 0!==n&&n.postType&&(o=l.context.postId,i=l.context.postType),o&&i?{postId:o,postType:i}:null},[]);return Object(a.useEffect)(()=>{const e=r?Object(D.addQueryArgs)(window.location.href,r):Object(D.removeQueryArgs)(window.location.href,"postType","postId");window.history.replaceState({},"",e)},[r]),null}var Tc=n("w95h");function kc(){const{setIsInserterOpened:e}=Object(i.useDispatch)(Pe),t=Object(i.useSelect)(e=>e(Pe).__experimentalGetInsertionPoint(),[]),n=Object(Be.useViewportMatch)("medium","<"),[c,r]=Object(Be.__experimentalUseDialog)({onClose:()=>e(!1)});return Object(a.createElement)("div",Object(Tt.a)({ref:c},r,{className:"edit-site-editor__inserter-panel"}),Object(a.createElement)("div",{className:"edit-site-editor__inserter-panel-header"},Object(a.createElement)(p.Button,{icon:Tc.a,onClick:()=>e(!1)})),Object(a.createElement)("div",{className:"edit-site-editor__inserter-panel-content"},Object(a.createElement)(Re.__experimentalLibrary,{showInserterHelpPanel:!0,shouldFocusBlock:n,rootClientId:t.rootClientId,__experimentalInsertionIndex:t.insertionIndex,__experimentalFilterValue:t.filterValue})))}var Ic=n("bWcr");function Cc(){const{setIsListViewOpened:e}=Object(i.useDispatch)(Pe),{clearSelectedBlock:t,selectBlock:n}=Object(i.useDispatch)(Re.store);const c=Object(Be.useFocusOnMount)("firstElement"),r=Object(Be.useFocusReturn)();const l="edit-site-editor__list-view-panel-label-"+Object(Be.useInstanceId)(Cc);return Object(a.createElement)("div",{"aria-labelledby":l,className:"edit-site-editor__list-view-panel",onKeyDown:function(t){t.keyCode!==Ye.ESCAPE||t.defaultPrevented||e(!1)}},Object(a.createElement)("div",{className:"edit-site-editor__list-view-panel-header"},Object(a.createElement)("strong",{id:l},Object(O.__)("List view")),Object(a.createElement)(p.Button,{icon:Ic.a,label:Object(O.__)("Close list view sidebar"),onClick:()=>e(!1)})),Object(a.createElement)("div",{className:"edit-site-editor__list-view-panel-content",ref:Object(Be.useMergeRefs)([r,c])},Object(a.createElement)(Re.__experimentalListView,{onSelect:async function(e){await t(),n(e,-1)},showNestedBlocks:!0,__experimentalFeatures:!0,__experimentalPersistentListViewFeatures:!0})))}function Nc(e){let{text:t,children:n}=e;const c=Object(Be.useCopyToClipboard)(t);return Object(a.createElement)(p.Button,{variant:"secondary",ref:c},n)}class Pc extends a.Component{constructor(){super(...arguments),this.reboot=this.reboot.bind(this),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}reboot(){this.props.onError()}render(){const{error:e}=this.state;return e?Object(a.createElement)(Re.Warning,{className:"editor-error-boundary",actions:[Object(a.createElement)(p.Button,{key:"recovery",onClick:this.reboot,variant:"secondary"},Object(O.__)("Attempt Recovery")),Object(a.createElement)(Nc,{key:"copy-error",text:e.stack},Object(O.__)("Copy Error"))]},Object(O.__)("The editor has encountered an unexpected error.")):this.props.children}}function Ac(e){let{nonAnimatedSrc:t,animatedSrc:n}=e;return Object(a.createElement)("picture",{className:"edit-site-welcome-guide__image"},Object(a.createElement)("source",{srcSet:t,media:"(prefers-reduced-motion: reduce)"}),Object(a.createElement)("img",{src:n,width:"312",height:"240",alt:""}))}function Mc(){const{toggleFeature:e}=Object(i.useDispatch)(Pe);return Object(a.createElement)(p.Guide,{className:"edit-site-welcome-guide",contentLabel:Object(O.__)("Welcome to the site editor"),finishButtonText:Object(O.__)("Get Started"),onFinish:()=>e("welcomeGuide"),pages:[{image:Object(a.createElement)(Ac,{nonAnimatedSrc:"https://s.w.org/images/block-editor/edit-your-site.svg?1",animatedSrc:"https://s.w.org/images/block-editor/edit-your-site.gif?1"}),content:Object(a.createElement)(a.Fragment,null,Object(a.createElement)("h1",{className:"edit-site-welcome-guide__heading"},Object(O.__)("Edit your site")),Object(a.createElement)("p",{className:"edit-site-welcome-guide__text"},Object(O.__)("Design everything on your site — from the header right down to the footer — using blocks.")),Object(a.createElement)("p",{className:"edit-site-welcome-guide__text"},Object(a.createInterpolateElement)(Object(O.__)("Click <StylesIconImage /> to start designing your blocks, and choose your typography, layout, and colors."),{StylesIconImage:Object(a.createElement)("img",{alt:Object(O.__)("styles"),src:"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z' fill='%231E1E1E'/%3E%3C/svg%3E%0A"})})))}]})}function Rc(){const{toggleFeature:e}=Object(i.useDispatch)(Pe);return Object(a.createElement)(p.Guide,{className:"edit-site-welcome-guide",contentLabel:Object(O.__)("Welcome to styles"),finishButtonText:Object(O.__)("Get Started"),onFinish:()=>e("welcomeGuideStyles"),pages:[{image:Object(a.createElement)(Ac,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-to-styles.svg?1",animatedSrc:"https://s.w.org/images/block-editor/welcome-to-styles.gif?1"}),content:Object(a.createElement)(a.Fragment,null,Object(a.createElement)("h1",{className:"edit-site-welcome-guide__heading"},Object(O.__)("Welcome to Styles")),Object(a.createElement)("p",{className:"edit-site-welcome-guide__text"},Object(O.__)("Tweak your site, or give it a whole new look! Get creative — how about a new color palette for your buttons, or choosing a new font? Take a look at what you can do here.")))},{image:Object(a.createElement)(Ac,{nonAnimatedSrc:"https://s.w.org/images/block-editor/set-the-design.svg?1",animatedSrc:"https://s.w.org/images/block-editor/set-the-design.gif?1"}),content:Object(a.createElement)(a.Fragment,null,Object(a.createElement)("h1",{className:"edit-site-welcome-guide__heading"},Object(O.__)("Set the design")),Object(a.createElement)("p",{className:"edit-site-welcome-guide__text"},Object(O.__)("You can customize your site as much as you like with different colors, typography, and layouts. Or if you prefer, just leave it up to your theme to handle! ")))},{image:Object(a.createElement)(Ac,{nonAnimatedSrc:"https://s.w.org/images/block-editor/personalize-blocks.svg?1",animatedSrc:"https://s.w.org/images/block-editor/personalize-blocks.gif?1"}),content:Object(a.createElement)(a.Fragment,null,Object(a.createElement)("h1",{className:"edit-site-welcome-guide__heading"},Object(O.__)("Personalize blocks")),Object(a.createElement)("p",{className:"edit-site-welcome-guide__text"},Object(O.__)("You can adjust your blocks to ensure a cohesive experience across your site — add your unique colors to a branded Button block, or adjust the Heading block to your preferred size.")))},{image:Object(a.createElement)(Ac,{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-site-welcome-guide__heading"},Object(O.__)("Learn more")),Object(a.createElement)("p",{className:"edit-site-welcome-guide__text"},Object(O.__)("New to block themes and styling your site? "),Object(a.createElement)(p.ExternalLink,{href:Object(O.__)("https://wordpress.org/support/article/wordpress-editor/")},Object(O.__)("Here’s a detailed guide to learn how to make the most of it."))))}]})}function Lc(){const{isActive:e,isStylesOpen:t}=Object(i.useSelect)(e=>{const t="edit-site/global-styles"===e(S.i).getActiveComplementaryArea(Pe.name),n=t?"welcomeGuideStyles":"welcomeGuide";return{isActive:e(Pe).isFeatureActive(n),isStylesOpen:t}},[]);return e?t?Object(a.createElement)(Rc,null):Object(a.createElement)(Mc,null):null}function Bc(){const[e,t]=function(){const[e,t]=Object(a.useState)([]),[n,c]=Object(a.useState)({}),{merged:r}=Object(a.useContext)(Et);return Object(a.useEffect)(()=>{if(null==r||!r.styles||null==r||!r.settings)return;const e=(e=>{const t={};return e.forEach(e=>{var n,c;const r=e.name,a=null!==(n=null==e||null===(c=e.supports)||void 0===c?void 0:c.__experimentalSelector)&&void 0!==n?n:".wp-block-"+r.replace("core/","").replace("/","-");t[r]={name:r,selector:a}}),t})(Object(l.getBlockTypes)()),n=Nn(r,e),a=Pn(r,e);t([{css:n,isGlobalStyles:!0,__experimentalNoWrapper:!0},{css:a,isGlobalStyles:!0}]),c(r.settings)},[r]),[e,n]}(),{getSettings:n}=Object(i.useSelect)(Pe),{updateSettings:c}=Object(i.useDispatch)(Pe);Object(a.useEffect)(()=>{var r;if(!e||!t)return;const a=n(),l=null==a||null===(r=a.styles)||void 0===r?void 0:r.filter(e=>!e.isGlobalStyles);c({...a,styles:[...l,...e],__experimentalFeatures:t})},[e,t])}function Dc(){return Bc(),null}function Fc(e,t){if(Array.isArray(t))return t}const Gc=e=>{if(!Object(h.isObject)(e)||Array.isArray(e))return e;const t=Object(h.pickBy)(Object(h.mapValues)(e,Gc),h.identity);return Object(h.isEmpty)(t)?void 0:t};function Vc(){const[e,t,n]=function(){const{globalStylesId:e,settings:t,styles:n}=Object(i.useSelect)(e=>{const t=e(s.store).__experimentalGetCurrentGlobalStylesId(),n=t?e(s.store).getEditedEntityRecord("root","globalStyles",t):void 0;return{globalStylesId:t,settings:null==n?void 0:n.settings,styles:null==n?void 0:n.styles}},[]),{getEditedEntityRecord:c}=Object(i.useSelect)(s.store),{editEntityRecord:r}=Object(i.useDispatch)(s.store),l=Object(a.useMemo)(()=>({settings:null!=t?t:{},styles:null!=n?n:{}}),[t,n]),o=Object(a.useCallback)(t=>{var n,a;const l=c("root","globalStyles",e),o=t({styles:null!==(n=null==l?void 0:l.styles)&&void 0!==n?n:{},settings:null!==(a=null==l?void 0:l.settings)&&void 0!==a?a:{}});r("root","globalStyles",e,{styles:Gc(o.styles)||{},settings:Gc(o.settings)||{}})},[e]);return[!!t||!!n,l,o]}(),[c,r]=function(){const e=Object(i.useSelect)(e=>e(s.store).__experimentalGetCurrentThemeBaseGlobalStyles(),[]);return[!!e,e]}(),l=Object(a.useMemo)(()=>{return r&&t?(e=r,n=t,Object(h.mergeWith)({},e,n,Fc)):{};var e,n},[t,r]);return Object(a.useMemo)(()=>({isReady:e&&c,user:t,base:r,merged:l,setUserConfig:n}),[l,t,r,n,e,c])}function zc(e){let{children:t}=e;const n=Vc();return n.isReady?Object(a.createElement)(Et.Provider,{value:n},t):null}const Uc={secondarySidebar:Object(O.__)("Block Library"),drawer:Object(O.__)("Navigation Sidebar")};var Hc=function(e){let{initialSettings:t,onError:n}=e;const{isInserterOpen:c,isListViewOpen:r,sidebarIsOpened:l,settings:o,entityId:m,templateType:d,page:b,template:j,templateResolved:g,isNavigationOpen:E,previousShortcut:f,nextShortcut:h}=Object(i.useSelect)(e=>{const{isInserterOpened:t,isListViewOpened:n,getSettings:c,getEditedPostType:r,getEditedPostId:a,getPage:l,isNavigationOpened:o}=e(Pe),{hasFinishedResolution:i,getEntityRecord:u}=e(s.store),m=r(),d=a();return{isInserterOpen:t(),isListViewOpen:n(),sidebarIsOpened:!!e(S.i).getActiveComplementaryArea(Pe.name),settings:c(),templateType:m,page:l(),template:d?u("postType",m,d):null,templateResolved:!!d&&i("getEntityRecord",["postType",m,d]),entityId:d,isNavigationOpen:o(),previousShortcut:e(Le.store).getAllShortcutKeyCombinations("core/edit-site/previous-region"),nextShortcut:e(Le.store).getAllShortcutKeyCombinations("core/edit-site/next-region")}},[]),{updateEditorSettings:v}=Object(i.useDispatch)(u.store),{setPage:y,setIsInserterOpened:w,updateSettings:x}=Object(i.useDispatch)(Pe);Object(a.useEffect)(()=>{x(t)},[]);const{defaultTemplateTypes:T,defaultTemplatePartAreas:k}=o;Object(a.useEffect)(()=>{v({defaultTemplateTypes:T,defaultTemplatePartAreas:k})},[T,k]);const[I,C]=Object(a.useState)(!1),N=Object(a.useCallback)(()=>C(!0),[]),P=Object(a.useCallback)(()=>{C(!1)},[]),A=Object(a.useMemo)(()=>({...null==b?void 0:b.context,queryContext:[(null==b?void 0:b.context.queryContext)||{page:1},e=>y({...b,context:{...null==b?void 0:b.context,queryContext:{...null==b?void 0:b.context.queryContext,...e}}})]}),[null==b?void 0:b.context]);Object(a.useEffect)(()=>{E?document.body.classList.add("is-navigation-sidebar-open"):document.body.classList.remove("is-navigation-sidebar-open")},[E]);const M=(null==o?void 0:o.siteUrl)&&void 0!==d&&void 0!==m;return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(xc,null),M&&Object(a.createElement)(Le.ShortcutProvider,null,Object(a.createElement)(p.SlotFillProvider,null,Object(a.createElement)(s.EntityProvider,{kind:"root",type:"site"},Object(a.createElement)(s.EntityProvider,{kind:"postType",type:d,id:m},Object(a.createElement)(zc,null,Object(a.createElement)(Re.BlockContextProvider,{value:A},Object(a.createElement)(Dc,null),Object(a.createElement)(Pc,{onError:n},Object(a.createElement)(S.d,{isActive:!0}),Object(a.createElement)(u.UnsavedChangesWarning,null),Object(a.createElement)(Sc.Register,null),Object(a.createElement)(Un,null),Object(a.createElement)(S.e,{labels:Uc,secondarySidebar:c?Object(a.createElement)(kc,null):r?Object(a.createElement)(Cc,null):null,sidebar:l&&Object(a.createElement)(S.b.Slot,{scope:"core/edit-site"}),drawer:Object(a.createElement)(rc,null),header:Object(a.createElement)(ut,{openEntitiesSavedStates:N}),notices:Object(a.createElement)(u.EditorSnackbars,null),content:Object(a.createElement)(a.Fragment,null,Object(a.createElement)(u.EditorNotices,null),j&&Object(a.createElement)(yc,{setIsInserterOpen:w}),g&&!j&&(null==o?void 0:o.siteUrl)&&m&&Object(a.createElement)(p.Notice,{status:"warning",isDismissible:!1},Object(O.__)("You attempted to edit an item that doesn't exist. Perhaps it was deleted?")),Object(a.createElement)(Sc,{openEntitiesSavedStates:N})),actions:Object(a.createElement)(a.Fragment,null,I?Object(a.createElement)(u.EntitiesSavedStates,{close:P}):Object(a.createElement)("div",{className:"edit-site-editor__toggle-save-panel"},Object(a.createElement)(p.Button,{variant:"secondary",className:"edit-site-editor__toggle-save-panel-button",onClick:N,"aria-expanded":!1},Object(O.__)("Open save panel")))),footer:Object(a.createElement)(Re.BlockBreadcrumb,null),shortcuts:{previous:f,next:h}}),Object(a.createElement)(Lc,null),Object(a.createElement)(p.Popover.Slot,null),Object(a.createElement)(_.PluginArea,null)))))))))};const Wc=["front-page","single-post","page","archive","search","404","index"];function qc(e){let{postType:t}=e;const{templates:n,defaultTemplateTypes:c}=Object(i.useSelect)(e=>({templates:e(s.store).getEntityRecords("postType","wp_template",{per_page:-1}),defaultTemplateTypes:e(u.store).__experimentalGetDefaultTemplateTypes()}),[]),{createErrorNotice:r}=Object(i.useDispatch)(F.store);const l=Object(h.map)(n,"slug"),o=Object(h.filter)(c,e=>Object(h.includes)(Wc,e.slug)&&!Object(h.includes)(l,e.slug));return o.length?Object(a.createElement)(p.DropdownMenu,{className:"edit-site-new-template-dropdown",icon:null,text:t.labels.add_new,label:t.labels.add_new_item,popoverProps:{noArrow:!1},toggleProps:{variant:"primary"}},()=>Object(a.createElement)(p.NavigableMenu,{className:"edit-site-new-template-dropdown__popover"},Object(a.createElement)(p.MenuGroup,{label:t.labels.add_new_item},Object(h.map)(o,e=>{let{title:t,description:n,slug:l}=e;return Object(a.createElement)(p.MenuItem,{info:n,key:l,onClick:()=>{!async function(e){let{slug:t}=e;try{const{title:e,description:n}=Object(h.find)(c,{slug:t}),r=await g()({path:"/wp/v2/templates",method:"POST",data:{excerpt:n,slug:t.toString(),status:"publish",title:e}});window.location.href=Object(D.addQueryArgs)(window.location.href,{postId:r.id,postType:"wp_template"}),await new Promise(()=>{})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:Object(O.__)("An error occurred while creating the template.");r(t,{type:"snackbar"})}}({slug:l})}},t)})))):null}function $c(e){let{postType:t}=e;const[n,c]=Object(a.useState)(!1),{createErrorNotice:r}=Object(i.useDispatch)(F.store);return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(p.Button,{variant:"primary",onClick:()=>{c(!0)}},t.labels.add_new),n&&Object(a.createElement)(oc,{closeModal:()=>c(!1),onCreate:async function(e){let{title:t,area:n}=e;if(t)try{const e=await g()({path:"/wp/v2/template-parts",method:"POST",data:{slug:Object(h.kebabCase)(t),title:t,content:"",area:n}});window.location.href=Object(D.addQueryArgs)(window.location.href,{postId:e.id,postType:"wp_template_part"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:Object(O.__)("An error occurred while creating the template part.");r(t,{type:"snackbar"})}else r(Object(O.__)("Title is not defined."),{type:"snackbar"})}}))}function Kc(e){let{templateType:t="wp_template"}=e;const n=Object(i.useSelect)(e=>e(s.store).getPostType(t),[t]);return n?"wp_template"===t?Object(a.createElement)(qc,{postType:n}):"wp_template_part"===t?Object(a.createElement)($c,{postType:n}):null:null}function Qc(e){var t;let{templateType:n}=e;const c=Object(i.useSelect)(e=>e(s.store).getPostType(n),[n]);return c?Object(a.createElement)("header",{className:"edit-site-list-header"},Object(a.createElement)(p.__experimentalHeading,{level:1,className:"edit-site-list-header__title"},null===(t=c.labels)||void 0===t?void 0:t.name),Object(a.createElement)("div",{className:"edit-site-list-header__right"},Object(a.createElement)(Kc,{templateType:n}))):null}function Yc(e){let{template:t,onClose:n}=e;const[c,r]=Object(a.useState)(()=>t.title.rendered),[l,o]=Object(a.useState)(!1),{getLastEntitySaveError:u}=Object(i.useSelect)(s.store),{editEntityRecord:m,saveEditedEntityRecord:d}=Object(i.useDispatch)(s.store),{createSuccessNotice:b,createErrorNotice:_}=Object(i.useDispatch)(F.store);if(!t.is_custom)return null;return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(p.MenuItem,{onClick:()=>{o(!0),r(t.title.rendered)}},Object(O.__)("Rename")),l&&Object(a.createElement)(p.Modal,{title:Object(O.__)("Rename template"),closeLabel:Object(O.__)("Close"),onRequestClose:()=>{o(!1)},overlayClassName:"edit-site-list__rename-modal"},Object(a.createElement)("form",{onSubmit:async function(e){e.preventDefault();try{await m("postType",t.type,t.id,{title:c}),r(""),o(!1),n(),await d("postType",t.type,t.id);const e=u("postType",t.type,t.id);if(e)throw e;b(Object(O.__)("Template has been renamed."),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:Object(O.__)("An error occurred while renaming the template.");_(t,{type:"snackbar"})}}},Object(a.createElement)(p.Flex,{align:"flex-start",gap:8},Object(a.createElement)(p.FlexItem,null,Object(a.createElement)(p.TextControl,{label:Object(O.__)("Name"),value:c,onChange:r,required:!0}))),Object(a.createElement)(p.Flex,{className:"edit-site-list__rename-modal-actions",justify:"flex-end",expanded:!1},Object(a.createElement)(p.FlexItem,null,Object(a.createElement)(p.Button,{variant:"tertiary",onClick:()=>{o(!1)}},Object(O.__)("Cancel"))),Object(a.createElement)(p.FlexItem,null,Object(a.createElement)(p.Button,{variant:"primary",type:"submit"},Object(O.__)("Save")))))))}function Xc(e){let{template:t}=e;const{removeTemplate:n,revertTemplate:c}=Object(i.useDispatch)(Pe),{saveEditedEntityRecord:r}=Object(i.useDispatch)(s.store),{createSuccessNotice:l,createErrorNotice:o}=Object(i.useDispatch)(F.store),u=function(e){return!!e&&("custom"===e.source&&!e.has_theme_file)}(t),m=G(t);if(!u&&!m)return null;return Object(a.createElement)(p.DropdownMenu,{icon:Ge.a,label:Object(O.__)("Actions"),className:"edit-site-list-table__actions"},e=>{let{onClose:i}=e;return Object(a.createElement)(p.MenuGroup,null,u&&Object(a.createElement)(a.Fragment,null,Object(a.createElement)(Yc,{template:t,onClose:i}),Object(a.createElement)(p.MenuItem,{isDestructive:!0,onClick:()=>{n(t),i()}},Object(O.__)("Delete template"))),m&&Object(a.createElement)(p.MenuItem,{info:Object(O.__)("Restore template to theme default"),onClick:()=>{!async function(){try{await c(t,{allowUndo:!1}),await r("postType",t.type,t.id),l(Object(O.__)("Template reverted."),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:Object(O.__)("An error occurred while reverting the template.");o(t,{type:"snackbar"})}}(),i()}},Object(O.__)("Clear customizations")))})}var Zc=n("0Ene");const Jc=["wp_template","wp_template_part"];function er(e){let{isCustomized:t,children:n}=e;return t?Object(a.createElement)(p.Tooltip,{text:Object(O.__)("This template has been customized")},n):n}function tr(e){var t;let{slug:n,isCustomized:c}=e;const r=Object(i.useSelect)(e=>e(s.store).getTheme(n),[n]);return Object(a.createElement)(p.__experimentalHStack,{alignment:"left"},Object(a.createElement)(er,{isCustomized:c},Object(a.createElement)("div",{className:et()("edit-site-list-added-by__icon",{"is-customized":c})},Object(a.createElement)(p.Icon,{icon:Pt.a}))),Object(a.createElement)("span",null,(null==r||null===(t=r.name)||void 0===t?void 0:t.rendered)||n))}function nr(e){let{slug:t,isCustomized:n}=e;const c=Object(i.useSelect)(e=>e(s.store).getPlugin(t),[t]);return Object(a.createElement)(p.__experimentalHStack,{alignment:"left"},Object(a.createElement)(er,{isCustomized:n},Object(a.createElement)("div",{className:"edit-site-list-added-by__icon"},Object(a.createElement)(p.Icon,{icon:Zc.a}))),Object(a.createElement)("span",null,(null==c?void 0:c.name)||t))}function cr(e){let{id:t}=e;const n=Object(i.useSelect)(e=>e(s.store).getUser(t),[t]),[c,r]=Object(a.useState)(!1);return Object(a.createElement)(p.__experimentalHStack,{alignment:"left"},Object(a.createElement)("div",{className:et()("edit-site-list-added-by__avatar",{"is-loaded":c})},Object(a.createElement)("img",{onLoad:()=>r(!0),alt:"",src:null==n?void 0:n.avatar_urls[48]})),Object(a.createElement)("span",null,null==n?void 0:n.nickname))}function rr(){const{name:e,logoURL:t}=Object(i.useSelect)(e=>{var t;const{getEntityRecord:n,getMedia:c}=e(s.store),r=n("root","__unstableBase");return{name:r.name,logoURL:null!=r&&r.site_logo?null===(t=c(r.site_logo))||void 0===t?void 0:t.source_url:void 0}},[]),[n,c]=Object(a.useState)(!1);return Object(a.createElement)(p.__experimentalHStack,{alignment:"left"},Object(a.createElement)("div",{className:et()("edit-site-list-added-by__avatar",{"is-loaded":n})},Object(a.createElement)("img",{onLoad:()=>c(!0),alt:"",src:t})),Object(a.createElement)("span",null,e))}function ar(e){let{templateType:t,template:n}=e;if(n){if(Jc.includes(t)){if(n.has_theme_file&&("theme"===n.origin||!n.origin&&["theme","custom"].includes(n.source)))return Object(a.createElement)(tr,{slug:n.theme,isCustomized:"custom"===n.source});if(n.has_theme_file&&"plugin"===n.origin)return Object(a.createElement)(nr,{slug:n.theme,isCustomized:"custom"===n.source});if(!n.has_theme_file&&"custom"===n.source&&!n.author)return Object(a.createElement)(rr,null)}return Object(a.createElement)(cr,{id:n.author})}}function lr(e){let{templateType:t}=e;const{templates:n,isLoading:c,postType:r}=Object(i.useSelect)(e=>{const{getEntityRecords:n,hasFinishedResolution:c,getPostType:r}=e(s.store);return{templates:n("postType",t,{per_page:-1}),isLoading:!c("getEntityRecords",["postType",t,{per_page:-1}]),postType:r(t)}},[t]);return!n||c?null:n.length?Object(a.createElement)("table",{className:"edit-site-list-table",role:"table"},Object(a.createElement)("thead",null,Object(a.createElement)("tr",{className:"edit-site-list-table-head",role:"row"},Object(a.createElement)("th",{className:"edit-site-list-table-column",role:"columnheader"},Object(O.__)("Template")),Object(a.createElement)("th",{className:"edit-site-list-table-column",role:"columnheader"},Object(O.__)("Added by")),Object(a.createElement)("th",{className:"edit-site-list-table-column",role:"columnheader"},Object(a.createElement)(p.VisuallyHidden,null,Object(O.__)("Actions"))))),Object(a.createElement)("tbody",null,n.map(e=>Object(a.createElement)("tr",{key:e.id,className:"edit-site-list-table-row",role:"row"},Object(a.createElement)("td",{className:"edit-site-list-table-column",role:"cell"},Object(a.createElement)(p.__experimentalHeading,{level:4},Object(a.createElement)("a",{href:Object(D.addQueryArgs)(window.location.href,{postId:e.id,postType:e.type})},e.title.rendered)),e.description),Object(a.createElement)("td",{className:"edit-site-list-table-column",role:"cell"},Object(a.createElement)(ar,{templateType:t,template:e})),Object(a.createElement)("td",{className:"edit-site-list-table-column",role:"cell"},Object(a.createElement)(Xc,{template:e})))))):Object(a.createElement)("div",null,Object(O.sprintf)(Object(O.__)("No %s found."),null==r||null===(l=r.labels)||void 0===l||null===(o=l.name)||void 0===o?void 0:o.toLowerCase()));var l,o}function or(e){var t;let{templateType:n}=e;!function(){const{registerShortcut:e}=Object(i.useDispatch)(Le.store);Object(a.useEffect)(()=>{e({name:"core/edit-site/next-region",category:"global",description:Object(O.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),e({name:"core/edit-site/previous-region",category:"global",description:Object(O.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"}]})},[])}();const{previousShortcut:c,nextShortcut:r,isNavigationOpen:l}=Object(i.useSelect)(e=>({previousShortcut:e(Le.store).getAllShortcutKeyCombinations("core/edit-site/previous-region"),nextShortcut:e(Le.store).getAllShortcutKeyCombinations("core/edit-site/next-region"),isNavigationOpen:e(Pe).isNavigationOpened()}),[]),o=Object(i.useSelect)(e=>e(s.store).getPostType(n),[n]),m=null==o||null===(t=o.labels)||void 0===t?void 0:t.items_list,d=o?{header:Object(O.sprintf)(Object(O.__)("%s - Header"),m),body:Object(O.sprintf)(Object(O.__)("%s - Content"),m)}:void 0;return Object(a.createElement)(S.e,{className:et()("edit-site-list",{"is-navigation-open":l}),labels:{drawer:Object(O.__)("Navigation Sidebar"),...d},header:Object(a.createElement)(Qc,{templateType:n}),drawer:Object(a.createElement)(rc,{activeTemplateType:n,isDefaultOpen:!0}),notices:Object(a.createElement)(u.EditorSnackbars,null),content:Object(a.createElement)("main",{className:"edit-site-list-main"},Object(a.createElement)(lr,{templateType:n})),shortcuts:{previous:c,next:r}})}function ir(e){let{className:t,...n}=e;return Object(a.createElement)(S.b,Object(Tt.a)({panelClassName:t,className:"edit-site-sidebar",scope:"core/edit-site"},n))}function sr(e){return Object(a.createElement)(S.c,Object(Tt.a)({__unstableExplicitMenuItem:!0,scope:"core/edit-site"},e))}var ur=Object(Be.compose)(Object(_.withPluginContext)((e,t)=>({icon:t.icon||e.icon,name:"core/edit-site/plugin-more-menu"})))(S.a);function mr(e,t){Object(a.unmountComponentAtNode)(e);const n=mr.bind(null,e,t);Object(a.render)(Object(a.createElement)(Hc,{initialSettings:t,onError:n}),e)}function dr(e,t){t.__experimentalFetchLinkSuggestions=(e,n)=>Object(s.__experimentalFetchLinkSuggestions)(e,n,t),t.__experimentalFetchRichUrlData=s.__experimentalFetchUrlData,t.__experimentalSpotlightEntityBlocks=["core/template-part"];const n=document.getElementById(e),c=mr.bind(null,n,t);Object(i.dispatch)(l.store).__experimentalReapplyBlockTypeFilters(),Object(o.registerCoreBlocks)(),Object(a.render)(Object(a.createElement)(Hc,{initialSettings:t,onError:c}),n)}function br(e,t,n){const c=document.getElementById(e);Object(i.dispatch)(u.store).updateEditorSettings({defaultTemplateTypes:n.defaultTemplateTypes,defaultTemplatePartAreas:n.defaultTemplatePartAreas}),Object(i.dispatch)(Pe).setIsNavigationPanelOpened(Object(i.select)(m.store).isViewportMatch("medium")),Object(a.render)(Object(a.createElement)(or,{templateType:t}),c)}},K2cm:function(e,t,n){"use strict";var c=n("GRId"),r=n("Tqx9");const a=Object(c.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(r.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=a},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},NWDH:function(e,t,n){"use strict";var c=n("GRId"),r=n("Tqx9");const a=Object(c.createElement)(r.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(c.createElement)(r.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));t.a=a},Ntru:function(e,t,n){"use strict";var c=n("GRId"),r=n("Tqx9");const a=Object(c.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(r.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=a},OE6V:function(e,t,n){"use strict";var c=n("GRId"),r=n("Tqx9");const a=Object(c.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(r.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"}));t.a=a},OzlF:function(e,t,n){"use strict";var c=n("GRId"),r=n("Tqx9");const a=Object(c.createElement)(r.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(c.createElement)(r.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));t.a=a},Q4Sy:function(e,t,n){"use strict";var c=n("GRId"),r=n("Tqx9");const a=Object(c.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(r.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));t.a=a},QyPg:function(e,t){e.exports=window.wp.blockLibrary},RMJe:function(e,t,n){"use strict";var c=n("GRId"),r=n("Tqx9");const a=Object(c.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(r.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));t.a=a},RxS6:function(e,t){e.exports=window.wp.keycodes},TSYQ:function(e,t,n){var c;
|
||
/*!
|
||
Copyright (c) 2018 Jed Watson.
|
||
Licensed under the MIT License (MIT), see
|
||
http://jedwatson.github.io/classnames
|
||
*/!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var c=arguments[t];if(c){var a=typeof c;if("string"===a||"number"===a)e.push(c);else if(Array.isArray(c)){if(c.length){var l=r.apply(null,c);l&&e.push(l)}}else if("object"===a)if(c.toString===Object.prototype.toString)for(var o in c)n.call(c,o)&&c[o]&&e.push(o);else e.push(c.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(c=function(){return r}.apply(t,[]))||(e.exports=c)}()},Tqx9:function(e,t){e.exports=window.wp.primitives},TvNi:function(e,t){e.exports=window.wp.plugins},U60i:function(e,t,n){"use strict";n.d(t,"b",(function(){return $})),n.d(t,"c",(function(){return z})),n.d(t,"d",(function(){return K})),n.d(t,"e",(function(){return Y})),n.d(t,"h",(function(){return H})),n.d(t,"f",(function(){return Z})),n.d(t,"g",(function(){return ee})),n.d(t,"a",(function(){return G})),n.d(t,"i",(function(){return M}));var c={};n.r(c),n.d(c,"enableComplementaryArea",(function(){return y})),n.d(c,"disableComplementaryArea",(function(){return w})),n.d(c,"pinItem",(function(){return x})),n.d(c,"unpinItem",(function(){return T})),n.d(c,"toggleFeature",(function(){return k})),n.d(c,"setFeatureValue",(function(){return I})),n.d(c,"setFeatureDefaults",(function(){return C}));var r={};n.r(r),n.d(r,"getActiveComplementaryArea",(function(){return N})),n.d(r,"isItemPinned",(function(){return P})),n.d(r,"isFeatureActive",(function(){return A}));var a=n("wx14"),l=n("GRId"),o=n("TSYQ"),i=n.n(o),s=n("tI+e"),u=n("1ZqX"),m=n("l3Sj"),d=n("RMJe"),b=n("URob"),p=n("Xxwi"),O=n("KEfo"),_=n("bWcr"),j=n("YLtl");const g=Object(u.combineReducers)({features(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("SET_FEATURE_DEFAULTS"===t.type){const{scope:n,defaults:c}=t;return{...e,[n]:{...e[n],...c}}}return e}}),E=Object(u.combineReducers)({features(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("SET_FEATURE_VALUE"===t.type){const{scope:n,featureName:c,value:r}=t;return{...e,[n]:{...e[n],[c]:r}}}return e}}),f=Object(u.combineReducers)({singleEnableItems:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,itemType:n,scope:c,item:r}=arguments.length>1?arguments[1]:void 0;return"SET_SINGLE_ENABLE_ITEM"===t&&n&&c?{...e,[n]:{...e[n],[c]:r||null}}:e},multipleEnableItems:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,itemType:n,scope:c,item:r,isEnable:a}=arguments.length>1?arguments[1]:void 0;if("SET_MULTIPLE_ENABLE_ITEM"!==t||!n||!c||!r||Object(j.get)(e,[n,c,r])===a)return e;const l=e[n]||{},o=l[c]||{};return{...e,[n]:{...l,[c]:{...o,[r]:a||!1}}}}});var h=Object(u.combineReducers)({enableItems:f,preferenceDefaults:g,preferences:E});function v(e,t,n){return{type:"SET_SINGLE_ENABLE_ITEM",itemType:e,scope:t,item:n}}function y(e,t){return v("complementaryArea",e,t)}function w(e){return v("complementaryArea",e,void 0)}function S(e,t,n,c){return{type:"SET_MULTIPLE_ENABLE_ITEM",itemType:e,scope:t,item:n,isEnable:c}}function x(e,t){return S("pinnedItems",e,t,!0)}function T(e,t){return S("pinnedItems",e,t,!1)}function k(e,t){return function(n){let{select:c,dispatch:r}=n;const a=c.isFeatureActive(e,t);r.setFeatureValue(e,t,!a)}}function I(e,t,n){return{type:"SET_FEATURE_VALUE",scope:e,featureName:t,value:!!n}}function C(e,t){return{type:"SET_FEATURE_DEFAULTS",scope:e,defaults:t}}function N(e,t){return function(e,t,n){return Object(j.get)(e.enableItems.singleEnableItems,[t,n])}(e,"complementaryArea",t)}function P(e,t,n){return!1!==function(e,t,n,c){return Object(j.get)(e.enableItems.multipleEnableItems,[t,n,c])}(e,"pinnedItems",t,n)}function A(e,t,n){var c,r;const a=null===(c=e.preferences.features[t])||void 0===c?void 0:c[n];return!!(void 0!==a?a:null===(r=e.preferenceDefaults.features[t])||void 0===r?void 0:r[n])}const M=Object(u.createReduxStore)("core/interface",{reducer:h,actions:c,selectors:r,persist:["enableItems","preferences"],__experimentalUseThunks:!0});Object(u.registerStore)("core/interface",{reducer:h,actions:c,selectors:r,persist:["enableItems","preferences"],__experimentalUseThunks:!0});var R=n("TvNi"),L=Object(R.withPluginContext)((e,t)=>({icon:t.icon||e.icon,identifier:t.identifier||`${e.name}/${t.name}`}));var B=L((function(e){let{as:t=s.Button,scope:n,identifier:c,icon:r,selectedIcon:o,...i}=e;const m=t,d=Object(u.useSelect)(e=>e(M).getActiveComplementaryArea(n)===c,[c]),{enableComplementaryArea:b,disableComplementaryArea:p}=Object(u.useDispatch)(M);return Object(l.createElement)(m,Object(a.a)({icon:o&&d?o:r,onClick:()=>{d?p(n):b(n,c)}},Object(j.omit)(i,["name"])))}));var D=e=>{let{smallScreenTitle:t,children:n,className:c,toggleButtonProps:r}=e;const o=Object(l.createElement)(B,Object(a.a)({icon:_.a},r));return Object(l.createElement)(l.Fragment,null,Object(l.createElement)("div",{className:"components-panel__header interface-complementary-area-header__small"},t&&Object(l.createElement)("span",{className:"interface-complementary-area-header__small-title"},t),o),Object(l.createElement)("div",{className:i()("components-panel__header","interface-complementary-area-header",c),tabIndex:-1},n,o))};function F(e){let{name:t,as:n=s.Button,onClick:c,...r}=e;return Object(l.createElement)(s.Fill,{name:t},e=>{let{onClick:t}=e;return Object(l.createElement)(n,Object(a.a)({onClick:c||t?function(){(c||j.noop)(...arguments),(t||j.noop)(...arguments)}:void 0},r))})}F.Slot=function(e){let{name:t,as:n=s.ButtonGroup,fillProps:c={},bubblesVirtually:r,...a}=e;return Object(l.createElement)(s.Slot,{name:t,bubblesVirtually:r,fillProps:c},e=>{if(Object(j.isEmpty)(l.Children.toArray(e)))return null;const t=[];l.Children.forEach(e,e=>{let{props:{__unstableExplicitMenuItem:n,__unstableTarget:c}}=e;c&&n&&t.push(c)});const c=l.Children.map(e,e=>!e.props.__unstableExplicitMenuItem&&t.includes(e.props.__unstableTarget)?null:e);return Object(l.createElement)(n,a,c)})};var G=F;const V=e=>Object(l.createElement)(s.MenuItem,Object(j.omit)(e,["__unstableExplicitMenuItem","__unstableTarget"]));function z(e){let{scope:t,target:n,__unstableExplicitMenuItem:c,...r}=e;return Object(l.createElement)(B,Object(a.a)({as:e=>Object(l.createElement)(G,Object(a.a)({__unstableExplicitMenuItem:c,__unstableTarget:`${t}/${n}`,as:V,name:t+"/plugin-more-menu"},e)),role:"menuitemcheckbox",selectedIcon:d.a,name:n,scope:t},r))}function U(e){let{scope:t,...n}=e;return Object(l.createElement)(s.Fill,Object(a.a)({name:"PinnedItems/"+t},n))}U.Slot=function(e){let{scope:t,className:n,...c}=e;return Object(l.createElement)(s.Slot,Object(a.a)({name:"PinnedItems/"+t},c),e=>!Object(j.isEmpty)(e)&&Object(l.createElement)("div",{className:i()(n,"interface-pinned-items")},e))};var H=U;function W(e){let{scope:t,children:n,className:c}=e;return Object(l.createElement)(s.Fill,{name:"ComplementaryArea/"+t},Object(l.createElement)("div",{className:c},n))}const q=L((function(e){let{children:t,className:n,closeLabel:c=Object(m.__)("Close plugin"),identifier:r,header:a,headerClassName:o,icon:_,isPinnable:j=!0,panelClassName:g,scope:E,name:f,smallScreenTitle:h,title:v,toggleShortcut:y,isActiveByDefault:w,showIconLabels:S=!1}=e;const{isActive:x,isPinned:T,activeArea:k,isSmall:I,isLarge:C}=Object(u.useSelect)(e=>{const{getActiveComplementaryArea:t,isItemPinned:n}=e(M),c=t(E);return{isActive:c===r,isPinned:n(E,r),activeArea:c,isSmall:e(O.store).isViewportMatch("< medium"),isLarge:e(O.store).isViewportMatch("large")}},[r,E]);!function(e,t,n,c,r){const a=Object(l.useRef)(!1),o=Object(l.useRef)(!1),{enableComplementaryArea:i,disableComplementaryArea:s}=Object(u.useDispatch)(M);Object(l.useEffect)(()=>{c&&r&&!a.current?(s(e),o.current=!0):o.current&&!r&&a.current?(o.current=!1,i(e,t)):o.current&&n&&n!==t&&(o.current=!1),r!==a.current&&(a.current=r)},[c,r,e,t,n])}(E,r,k,x,I);const{enableComplementaryArea:N,disableComplementaryArea:P,pinItem:A,unpinItem:R}=Object(u.useDispatch)(M);return Object(l.useEffect)(()=>{w&&void 0===k&&!I&&N(E,r)},[k,w,E,r,I]),Object(l.createElement)(l.Fragment,null,j&&Object(l.createElement)(H,{scope:E},T&&Object(l.createElement)(B,{scope:E,identifier:r,isPressed:x&&(!S||C),"aria-expanded":x,label:v,icon:S?d.a:_,showTooltip:!S,variant:S?"tertiary":void 0})),f&&j&&Object(l.createElement)(z,{target:f,scope:E,icon:_},v),x&&Object(l.createElement)(W,{className:i()("interface-complementary-area",n),scope:E},Object(l.createElement)(D,{className:o,closeLabel:c,onClose:()=>P(E),smallScreenTitle:h,toggleButtonProps:{label:c,shortcut:y,scope:E,identifier:r}},a||Object(l.createElement)(l.Fragment,null,Object(l.createElement)("strong",null,v),j&&Object(l.createElement)(s.Button,{className:"interface-complementary-area__pin-unpin-item",icon:T?b.a:p.a,label:T?Object(m.__)("Unpin from toolbar"):Object(m.__)("Pin to toolbar"),onClick:()=>(T?R:A)(E,r),isPressed:T,"aria-expanded":T}))),Object(l.createElement)(s.Panel,{className:g},t)))}));q.Slot=function(e){let{scope:t,...n}=e;return Object(l.createElement)(s.Slot,Object(a.a)({name:"ComplementaryArea/"+t},n))};var $=q;var K=e=>{let{isActive:t}=e;return Object(l.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")}},[]),Object(l.useEffect)(()=>(t?document.body.classList.add("is-fullscreen-mode"):document.body.classList.remove("is-fullscreen-mode"),()=>{t&&document.body.classList.remove("is-fullscreen-mode")}),[t]),null},Q=n("K9lf");var Y=Object(l.forwardRef)((function(e,t){let{footer:n,header:c,sidebar:r,secondarySidebar:o,notices:u,content:d,drawer:b,actions:p,labels:O,className:_,shortcuts:j}=e;const g=Object(s.__unstableUseNavigateRegions)(j);!function(e){Object(l.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 E={...{drawer:Object(m.__)("Drawer"),header:Object(m.__)("Header"),body:Object(m.__)("Content"),secondarySidebar:Object(m.__)("Block Library"),sidebar:Object(m.__)("Settings"),actions:Object(m.__)("Publish"),footer:Object(m.__)("Footer")},...O};return Object(l.createElement)("div",Object(a.a)({},g,{ref:Object(Q.useMergeRefs)([t,g.ref]),className:i()(_,"interface-interface-skeleton",g.className,!!n&&"has-footer")}),!!b&&Object(l.createElement)("div",{className:"interface-interface-skeleton__drawer",role:"region","aria-label":E.drawer,tabIndex:"-1"},b),Object(l.createElement)("div",{className:"interface-interface-skeleton__editor"},!!c&&Object(l.createElement)("div",{className:"interface-interface-skeleton__header",role:"region","aria-label":E.header,tabIndex:"-1"},c),Object(l.createElement)("div",{className:"interface-interface-skeleton__body"},!!o&&Object(l.createElement)("div",{className:"interface-interface-skeleton__secondary-sidebar",role:"region","aria-label":E.secondarySidebar,tabIndex:"-1"},o),!!u&&Object(l.createElement)("div",{className:"interface-interface-skeleton__notices"},u),Object(l.createElement)("div",{className:"interface-interface-skeleton__content",role:"region","aria-label":E.body,tabIndex:"-1"},d),!!r&&Object(l.createElement)("div",{className:"interface-interface-skeleton__sidebar",role:"region","aria-label":E.sidebar,tabIndex:"-1"},r),!!p&&Object(l.createElement)("div",{className:"interface-interface-skeleton__actions",role:"region","aria-label":E.actions,tabIndex:"-1"},p))),!!n&&Object(l.createElement)("div",{className:"interface-interface-skeleton__footer",role:"region","aria-label":E.footer,tabIndex:"-1"},n))})),X=n("VKE3");function Z(e){let{as:t=s.DropdownMenu,className:n,label:c=Object(m.__)("Options"),popoverProps:r,toggleProps:a,children:o}=e;return Object(l.createElement)(t,{className:i()("interface-more-menu-dropdown",n),icon:X.a,label:c,popoverProps:{position:"bottom left",...r,className:i()("interface-more-menu-dropdown__content",null==r?void 0:r.className)},toggleProps:{tooltipPosition:"bottom",...a}},e=>o(e))}var J=n("gdqT");function ee(e){let{scope:t,label:n,info:c,messageActivated:r,messageDeactivated:a,shortcut:o,feature:i}=e;const b=Object(u.useSelect)(e=>e(M).isFeatureActive(t,i),[i]),{toggleFeature:p}=Object(u.useDispatch)(M);return Object(l.createElement)(s.MenuItem,{icon:b&&d.a,isSelected:b,onClick:()=>{p(t,i),b?Object(J.speak)(a||Object(m.__)("Feature deactivated")):Object(J.speak)(r||Object(m.__)("Feature activated"))},role:"menuitemcheckbox",info:c,shortcut:o},n)}},URob:function(e,t,n){"use strict";var c=n("GRId"),r=n("Tqx9");const a=Object(c.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(r.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=a},VKE3:function(e,t,n){"use strict";var c=n("GRId"),r=n("Tqx9");const a=Object(c.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(r.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));t.a=a},Xxwi:function(e,t,n){"use strict";var c=n("GRId"),r=n("Tqx9");const a=Object(c.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(r.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=a},YLtl:function(e,t){e.exports=window.lodash},axFQ:function(e,t){e.exports=window.wp.blockEditor},bWcr:function(e,t,n){"use strict";var c=n("GRId"),r=n("Tqx9");const a=Object(c.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(r.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=a},cjQ8:function(e,t,n){"use strict";var c=n("GRId"),r=n("Tqx9");const a=Object(c.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(r.Path,{d:"M20 10.8H6.7l4.1-4.5-1.1-1.1-5.8 6.3 5.8 5.8 1.1-1.1-4-3.9H20z"}));t.a=a},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},iClF:function(e,t,n){"use strict";var c=n("GRId");t.a=function(e){let{icon:t,size:n=24,...r}=e;return Object(c.cloneElement)(t,{width:n,height:n,...r})}},jSdM:function(e,t){e.exports=window.wp.editor},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},pPDe:function(e,t,n){"use strict";var c,r;function a(e){return[e]}function l(){var e={clear:function(){e.head=null}};return e}function o(e,t,n){var c;if(e.length!==t.length)return!1;for(c=n;c<e.length;c++)if(e[c]!==t[c])return!1;return!0}c={},r="undefined"!=typeof WeakMap,t.a=function(e,t){var n,i;function s(){n=r?new WeakMap:l()}function u(){var n,c,r,a,l,s=arguments.length;for(a=new Array(s),r=0;r<s;r++)a[r]=arguments[r];for(l=t.apply(null,a),(n=i(l)).isUniqueByDependants||(n.lastDependants&&!o(l,n.lastDependants,0)&&n.clear(),n.lastDependants=l),c=n.head;c;){if(o(c.args,a,1))return c!==n.head&&(c.prev.next=c.next,c.next&&(c.next.prev=c.prev),c.next=n.head,c.prev=null,n.head.prev=c,n.head=c),c.val;c=c.next}return c={val:e.apply(null,a)},a[0]=null,c.args=a,n.head&&(n.head.prev=c,c.next=n.head),n.head=c,c.val}return t||(t=a),i=r?function(e){var t,r,a,o,i,s=n,u=!0;for(t=0;t<e.length;t++){if(r=e[t],!(i=r)||"object"!=typeof i){u=!1;break}s.has(r)?s=s.get(r):(a=new WeakMap,s.set(r,a),s=a)}return s.has(c)||((o=l()).isUniqueByDependants=u,s.set(c,o)),s.get(c)}:function(){return n},u.getDependants=t,u.clear=s,s(),u}},rmEH:function(e,t){e.exports=window.wp.htmlEntities},rrFr:function(e,t,n){var c,r,a;r=[],void 0===(a="function"==typeof(c=function(){return function e(t,n,c){var r,a,l=window,o="application/octet-stream",i=c||o,s=t,u=!n&&!c&&s,m=document.createElement("a"),d=function(e){return String(e)},b=l.Blob||l.MozBlob||l.WebKitBlob||d,p=n||"download";if(b=b.call?b.bind(l):Blob,"true"===String(this)&&(i=(s=[s,i])[0],s=s[1]),u&&u.length<2048&&(p=u.split("/").pop().split("?")[0],m.href=u,-1!==m.href.indexOf(u))){var O=new XMLHttpRequest;return O.open("GET",u,!0),O.responseType="blob",O.onload=function(t){e(t.target.response,p,o)},setTimeout((function(){O.send()}),0),O}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(s)){if(!(s.length>2096103.424&&b!==d))return navigator.msSaveBlob?navigator.msSaveBlob(E(s),p):f(s);i=(s=E(s)).type||o}else if(/([\x80-\xff])/.test(s)){for(var _=0,j=new Uint8Array(s.length),g=j.length;_<g;++_)j[_]=s.charCodeAt(_);s=new b([j],{type:i})}function E(e){for(var t=e.split(/[:;,]/),n=t[1],c=("base64"==t[2]?atob:decodeURIComponent)(t.pop()),r=c.length,a=0,l=new Uint8Array(r);a<r;++a)l[a]=c.charCodeAt(a);return new b([l],{type:n})}function f(e,t){if("download"in m)return m.href=e,m.setAttribute("download",p),m.className="download-js-link",m.innerHTML="downloading...",m.style.display="none",document.body.appendChild(m),setTimeout((function(){m.click(),document.body.removeChild(m),!0===t&&setTimeout((function(){l.URL.revokeObjectURL(m.href)}),250)}),66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,o)),window.open(e)||confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")&&(location.href=e),!0;var n=document.createElement("iframe");document.body.appendChild(n),!t&&/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,o)),n.src=e,setTimeout((function(){document.body.removeChild(n)}),333)}if(r=s instanceof b?s:new b([s],{type:i}),navigator.msSaveBlob)return navigator.msSaveBlob(r,p);if(l.URL)f(l.URL.createObjectURL(r),!0);else{if("string"==typeof r||r.constructor===d)try{return f("data:"+i+";base64,"+l.btoa(r))}catch(e){return f("data:"+i+","+encodeURIComponent(r))}(a=new FileReader).onload=function(e){f(this.result)},a.readAsDataURL(r)}return!0}})?c.apply(t,r):c)||(e.exports=a)},"tI+e":function(e,t){e.exports=window.wp.components},w95h:function(e,t,n){"use strict";var c=n("GRId"),r=n("Tqx9");const a=Object(c.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(r.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=a},wduq:function(e,t,n){"use strict";var c=n("GRId"),r=n("Tqx9");const a=Object(c.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(c.createElement)(r.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"}));t.a=a},wx14:function(e,t,n){"use strict";function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var c in n)Object.prototype.hasOwnProperty.call(n,c)&&(e[c]=n[c])}return e}).apply(this,arguments)}n.d(t,"a",(function(){return c}))},ywyh:function(e,t){e.exports=window.wp.apiFetch}}); |