WordPress/wp-includes/js/dist/customize-widgets.min.js
youknowriad e335b68afc Block Editor: Update packages and backport the latest Gutenberg fixes.
This includes the following fixes:

- Generate babel polyfill dynamically https://github.com/WordPress/gutenberg/pull/31279
- Improve the List View component https://github.com/WordPress/gutenberg/pull/31290 https://github.com/WordPress/gutenberg/pull/32063
- Template mode:
    - Fix embed dimensions https://github.com/WordPress/gutenberg/pull/32057
    - Update the welcome guide https://github.com/WordPress/gutenberg/pull/32055 https://github.com/WordPress/gutenberg/pull/32026
    - Don’t display the notice at the same time as the welcome guide https://github.com/WordPress/gutenberg/pull/32076
    - Remove MetaBoxes https://github.com/WordPress/gutenberg/pull/32315
    - Update the title area https://github.com/WordPress/gutenberg/pull/32037 
- Widgets Screen:
    - Fix unsaved changes https://github.com/WordPress/gutenberg/pull/31757
    - Fix toolbar alignment https://github.com/WordPress/gutenberg/pull/31991
    - Fix block toolbar position after scroll https://github.com/WordPress/gutenberg/pull/32212
    - Fix the visible widget area header https://github.com/WordPress/gutenberg/pull/32262
    - Fix legacy widgets preview https://github.com/WordPress/gutenberg/pull/32260
    - 
- Block Widgets in the customizer: 
    - Fix customizer title overlapping block toolbar https://github.com/WordPress/gutenberg/pull/32140
    - Fix styling issues https://github.com/WordPress/gutenberg/pull/32072
    - Fix escape key events https://github.com/WordPress/gutenberg/pull/32175
    - Add preferences menu group label https://github.com/WordPress/gutenberg/pull/32259
    - Fix creating and replacing legacy widgets https://github.com/WordPress/gutenberg/pull/32005
    - Fix the welcome guide’s image https://github.com/WordPress/gutenberg/pull/32264 https://github.com/WordPress/gutenberg/pull/32302 
- Fix Cover to Image transform duotone error https://github.com/WordPress/gutenberg/pull/32006
- Remove filter_var usage from blocks https://github.com/WordPress/gutenberg/pull/32046 
- Fix image width for aligned Post Featured Image block https://github.com/WordPress/gutenberg/pull/32070
- Prevent excessive Image block re-rendering https://github.com/WordPress/gutenberg/pull/32102
- Remove gutenberg domain from core blocks https://github.com/WordPress/gutenberg/pull/32152
- Use the block editor context class for the the different settings filters https://github.com/WordPress/gutenberg/pull/32159
- Fix Latest Posts block grid view https://github.com/WordPress/gutenberg/pull/32160
- Fix preset classes generation per block https://github.com/WordPress/gutenberg/pull/32190
- Fix logic to enable custom colors and gradients https://github.com/WordPress/gutenberg/pull/32200
- Update the Site Logo logic to use a dedicated site option https://github.com/WordPress/gutenberg/pull/32229
- Limit the Latest Posts block’s featured image width https://github.com/WordPress/gutenberg/pull/32245
- Remove opacity animation in the canvas. https://github.com/WordPress/gutenberg/pull/32266
- Make the focus style valid CSS https://github.com/WordPress/gutenberg/pull/32305
- Fix theme.json styles for the core/list block https://github.com/WordPress/gutenberg/pull/32343
- Fix PHP notice when calling render_block https://github.com/WordPress/gutenberg/pull/32135

Props nosolosw, noisysocks.
See #52991.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50660 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-01 08:10:04 +00:00

7 lines
34 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

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

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

/*! This file is auto-generated */
this.wp=this.wp||{},this.wp.customizeWidgets=function(e){var t={};function s(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,s),n.l=!0,n.exports}return s.m=e,s.c=t,s.d=function(e,t,i){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(s.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)s.d(i,n,function(t){return e[t]}.bind(null,n));return i},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="",s(s.s="9pbN")}({"1CF3":function(e,t){e.exports=window.wp.dom},"1ZqX":function(e,t){e.exports=window.wp.data},"6aBm":function(e,t){e.exports=window.wp.mediaUtils},"9pbN":function(e,t,s){"use strict";s.r(t),s.d(t,"initialize",(function(){return Ee}));var i={};s.r(i),s.d(i,"__unstableIsFeatureActive",(function(){return T}));var n={};s.r(n),s.d(n,"__unstableToggleFeature",(function(){return M}));var c=s("GRId"),o=s("QyPg"),r=s("GLVC"),a=s("tI+e"),l=s("YLtl"),d=s("jZUy"),u=s("1ZqX"),b=s("axFQ"),m=s("6aBm"),h=s("wx14"),p=s("l3Sj");var g=function({inspector:e,closeMenu:t,...s}){const i=Object(u.useSelect)(e=>e(b.store).getSelectedBlockClientId(),[]),n=Object(c.useMemo)(()=>document.getElementById("block-"+i),[i]);return Object(c.createElement)(a.MenuItem,Object(h.a)({onClick:()=>{e.open({returnFocusWhenClose:n}),t()}},s),Object(p.__)("Show more settings"))},O=s("TSYQ"),w=s.n(O),f=s("RxS6"),j=s("Ntru"),_=s("K2cm"),y=s("Q4Sy"),v=s("K9lf"),E=s("bWcr");var k=function e({setIsOpened:t}){const s=Object(v.useInstanceId)(e,"customize-widget-layout__inserter-panel-title");return Object(c.createElement)("div",{className:"customize-widgets-layout__inserter-panel","aria-labelledby":s},Object(c.createElement)("div",{className:"customize-widgets-layout__inserter-panel-header"},Object(c.createElement)("h2",{id:s,className:"customize-widgets-layout__inserter-panel-header-title"},Object(p.__)("Add a block")),Object(c.createElement)(a.Button,{className:"customize-widgets-layout__inserter-panel-header-close-button",icon:E.a,onClick:()=>t(!1),"aria-label":Object(p.__)("Close inserter")})),Object(c.createElement)("div",{className:"customize-widgets-layout__inserter-panel-content"},Object(c.createElement)(b.__experimentalLibrary,{showInserterHelpPanel:!0,onSelect:()=>t(!1)})))},C=s("VKE3"),x=s("K+tz"),S=s("hF7m"),z=s("RMJe"),I=s("gdqT");const W=Object(l.flow)([u.combineReducers,(B={features:{fixedToolbar:!1,welcomeGuide:!0}},e=>(t=B,s)=>e(t,s))])({features:(e,t)=>"TOGGLE_FEATURE"===t.type?{...e,[t.feature]:!e[t.feature]}:e});var B;function T(e,t){return Object(l.get)(e.preferences.features,[t],!1)}function M(e){return{type:"TOGGLE_FEATURE",feature:e}}const F={reducer:Object(u.combineReducers)({preferences:W}),selectors:i,actions:n,persist:["preferences"]},N=Object(u.createReduxStore)("core/customize-widgets",F);function G({label:e,info:t,messageActivated:s,messageDeactivated:i,shortcut:n,feature:o}){const r=Object(u.useSelect)(e=>e(N).__unstableIsFeatureActive(o),[o]),{__unstableToggleFeature:l}=Object(u.useDispatch)(N);return Object(c.createElement)(a.MenuItem,{icon:r&&z.a,isSelected:r,onClick:()=>{l(o),r?Object(I.speak)(i||Object(p.__)("Feature deactivated")):Object(I.speak)(s||Object(p.__)("Feature activated"))},role:"menuitemcheckbox",info:t,shortcut:n},e)}Object(u.registerStore)("core/customize-widgets",F);const A=[{keyCombination:{modifier:"primary",character:"b"},description:Object(p.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:Object(p.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:Object(p.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:Object(p.__)("Remove a link.")},{keyCombination:{modifier:"primary",character:"u"},description:Object(p.__)("Underline the selected text.")}];function P({keyCombination:e,forceAriaLabel:t}){const s=e.modifier?f.displayShortcutList[e.modifier](e.character):e.character,i=e.modifier?f.shortcutAriaLabel[e.modifier](e.character):e.character;return Object(c.createElement)("kbd",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":t||i},Object(l.castArray)(s).map((e,t)=>"+"===e?Object(c.createElement)(c.Fragment,{key:t},e):Object(c.createElement)("kbd",{key:t,className:"customize-widgets-keyboard-shortcut-help-modal__shortcut-key"},e)))}var L=function({description:e,keyCombination:t,aliases:s=[],ariaLabel:i}){return Object(c.createElement)(c.Fragment,null,Object(c.createElement)("div",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut-description"},e),Object(c.createElement)("div",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut-term"},Object(c.createElement)(P,{keyCombination:t,forceAriaLabel:i}),s.map((e,t)=>Object(c.createElement)(P,{keyCombination:e,forceAriaLabel:i,key:t}))))};var R=function({name:e}){const{keyCombination:t,description:s,aliases:i}=Object(u.useSelect)(t=>{const{getShortcutKeyCombination:s,getShortcutDescription:i,getShortcutAliases:n}=t(S.store);return{keyCombination:s(e),aliases:n(e),description:i(e)}});return t?Object(c.createElement)(L,{keyCombination:t,description:s,aliases:i}):null};const H=({shortcuts:e})=>Object(c.createElement)("ul",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut-list",role:"list"},e.map((e,t)=>Object(c.createElement)("li",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut",key:t},Object(l.isString)(e)?Object(c.createElement)(R,{name:e}):Object(c.createElement)(L,e)))),D=({title:e,shortcuts:t,className:s})=>Object(c.createElement)("section",{className:w()("customize-widgets-keyboard-shortcut-help-modal__section",s)},!!e&&Object(c.createElement)("h2",{className:"customize-widgets-keyboard-shortcut-help-modal__section-title"},e),Object(c.createElement)(H,{shortcuts:t})),V=({title:e,categoryName:t,additionalShortcuts:s=[]})=>{const i=Object(u.useSelect)(e=>e(S.store).getCategoryShortcuts(t),[t]);return Object(c.createElement)(D,{title:e,shortcuts:i.concat(s)})};function U({isModalActive:e,toggleModal:t}){const{registerShortcut:s}=Object(u.useDispatch)(S.store);return s({name:"core/customize-widgets/keyboard-shortcuts",category:"main",description:Object(p.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),Object(S.useShortcut)("core/customize-widgets/keyboard-shortcuts",t,{bindGlobal:!0}),e?Object(c.createElement)(a.Modal,{className:"customize-widgets-keyboard-shortcut-help-modal",title:Object(p.__)("Keyboard shortcuts"),closeLabel:Object(p.__)("Close"),onRequestClose:t},Object(c.createElement)(D,{className:"customize-widgets-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/customize-widgets/keyboard-shortcuts"]}),Object(c.createElement)(V,{title:Object(p.__)("Global shortcuts"),categoryName:"global"}),Object(c.createElement)(V,{title:Object(p.__)("Selection shortcuts"),categoryName:"selection"}),Object(c.createElement)(V,{title:Object(p.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:Object(p.__)("Change the block type after adding a new paragraph."),ariaLabel:Object(p.__)("Forward-slash")}]}),Object(c.createElement)(D,{title:Object(p.__)("Text formatting"),shortcuts:A})):null}const q={className:"customize-widgets-more-menu__content",position:"bottom left"},K={tooltipPosition:"bottom"};function $(){const[e,t]=Object(c.useState)(!1),s=()=>t(!e);return Object(S.useShortcut)("core/customize-widgets/keyboard-shortcuts",s,{bindGlobal:!0}),Object(c.createElement)(c.Fragment,null,Object(c.createElement)(a.ToolbarDropdownMenu,{className:"customize-widgets-more-menu",icon:C.a,label:Object(p.__)("Options"),popoverProps:q,toggleProps:K},()=>Object(c.createElement)(c.Fragment,null,Object(c.createElement)(a.MenuGroup,{label:Object(p._x)("View","noun")},Object(c.createElement)(G,{feature:"fixedToolbar",label:Object(p.__)("Top toolbar"),info:Object(p.__)("Access all block and document tools in a single place"),messageActivated:Object(p.__)("Top toolbar activated"),messageDeactivated:Object(p.__)("Top toolbar deactivated")})),Object(c.createElement)(a.MenuGroup,{label:Object(p.__)("Tools")},Object(c.createElement)(a.MenuItem,{onClick:()=>{t(!0)},shortcut:f.displayShortcut.access("h")},Object(p.__)("Keyboard shortcuts")),Object(c.createElement)(G,{feature:"welcomeGuide",label:Object(p.__)("Welcome Guide")}),Object(c.createElement)(a.MenuItem,{role:"menuitem",icon:x.a,href:Object(p.__)("https://wordpress.org/support/article/wordpress-editor/"),target:"_blank",rel:"noopener noreferrer"},Object(p.__)("Help"),Object(c.createElement)(a.VisuallyHidden,{as:"span"},Object(p.__)("(opens in a new tab)")))),Object(c.createElement)(a.MenuGroup,{label:Object(p.__)("Preferences")},Object(c.createElement)(G,{feature:"keepCaretInsideBlock",label:Object(p.__)("Contain text cursor inside block"),info:Object(p.__)("Aids screen readers by stopping text caret from leaving blocks."),messageActivated:Object(p.__)("Contain text cursor inside block activated"),messageDeactivated:Object(p.__)("Contain text cursor inside block deactivated")})))),Object(c.createElement)(U,{isModalActive:e,toggleModal:s}))}var Q=function({sidebar:e,inserter:t,isInserterOpened:s,setIsInserterOpened:i,isFixedToolbarActive:n}){const[[o,r],l]=Object(c.useState)([e.hasUndo(),e.hasRedo()]);return Object(c.useEffect)(()=>e.subscribeHistory(()=>{l([e.hasUndo(),e.hasRedo()])}),[e]),Object(c.createElement)(c.Fragment,null,Object(c.createElement)("div",{className:w()("customize-widgets-header",{"is-fixed-toolbar-active":n})},Object(c.createElement)(b.NavigableToolbar,{className:"customize-widgets-header-toolbar","aria-label":Object(p.__)("Document tools")},Object(c.createElement)(a.ToolbarButton,{icon:Object(p.isRTL)()?_.a:j.a,label:Object(p.__)("Undo"),shortcut:f.displayShortcut.primary("z"),"aria-disabled":!o,onClick:e.undo,className:"customize-widgets-editor-history-button undo-button"}),Object(c.createElement)(a.ToolbarButton,{icon:Object(p.isRTL)()?j.a:_.a,label:Object(p.__)("Redo"),shortcut:f.displayShortcut.primaryShift("z"),"aria-disabled":!r,onClick:e.redo,className:"customize-widgets-editor-history-button redo-button"}),Object(c.createElement)(a.ToolbarButton,{className:"customize-widgets-header-toolbar__inserter-toggle",isPressed:s,isPrimary:!0,icon:y.a,label:Object(p._x)("Add block","Generic label for block inserter button"),onClick:()=>{i(e=>!e)}}),Object(c.createElement)($,null))),Object(c.createPortal)(Object(c.createElement)(k,{setIsOpened:i}),t.contentContainer[0]))};var Y=s("HSyU"),Z=s("rl8x"),J=s.n(Z);function X(e,t=null){let s;if("core/legacy-widget"===e.name&&(e.attributes.id||e.attributes.instance))if(e.attributes.id)s={id:e.attributes.id};else{const{encoded:i,hash:n,raw:c,...o}=e.attributes.instance;s={idBase:e.attributes.idBase,instance:{...null==t?void 0:t.instance,is_widget_customizer_js_value:!0,encoded_serialized_instance:i,instance_hash_key:n,raw_instance:c,...o}}}else{s={idBase:"block",widgetClass:"WP_Widget_Block",instance:{raw_instance:{content:Object(Y.serialize)(e)}}}}return{...Object(l.omit)(t,["form","rendered"]),...s}}function ee({id:e,idBase:t,number:s,instance:i}){let n;const{encoded_serialized_instance:c,instance_hash_key:o,raw_instance:a,...l}=i;if("block"===t){const e=Object(Y.parse)(a.content);n=e.length?e[0]:Object(Y.createBlock)("core/paragraph",{})}else n=s?Object(Y.createBlock)("core/legacy-widget",{idBase:t,instance:{encoded:c,hash:o,raw:a,...l}}):Object(Y.createBlock)("core/legacy-widget",{id:e});return Object(r.addWidgetIdToBlock)(n,e)}function te(e){const[t,s]=Object(c.useState)(()=>e.getWidgets().map(e=>ee(e)));Object(c.useEffect)(()=>e.subscribe((e,t)=>{s(s=>{const i=new Map(e.map(e=>[e.id,e])),n=new Map(s.map(e=>[Object(r.getWidgetIdFromBlock)(e),e])),c=t.map(e=>{const t=i.get(e.id);return t&&t===e?n.get(e.id):ee(e)});return J()(s,c)?s:c})}),[e]);const i=Object(c.useCallback)(t=>{s(s=>{if(J()(s,t))return s;const i=new Map(s.map(e=>[Object(r.getWidgetIdFromBlock)(e),e])),n=t.map(t=>{const s=Object(r.getWidgetIdFromBlock)(t);if(s&&i.has(s)){const n=i.get(s),c=e.getWidget(s);return Object(l.isEqual)(t,n)&&c?c:X(t,c)}return X(t)});if(J()(e.getWidgets(),n))return s;const c=e.setWidgets(n);return t.reduce((e,s,i)=>{const n=c[i];return null!==n&&(e===t&&(e=t.slice()),e[i]=Object(r.addWidgetIdToBlock)(s,n)),e},t)})},[e]);return[t,i,i]}function se(e){const t=e.match(/^widget_(.+)(?:\[(\d+)\])$/);if(t){return`${t[1]}-${parseInt(t[2],10)}`}return e}const ie=Object(c.createContext)();function ne({api:e,sidebarControls:t,children:s}){const[i,n]=Object(c.useState)({current:null}),o=Object(c.useCallback)(e=>{for(const s of t){if(s.setting.get().includes(e)){s.sectionInstance.expand({completeCallback(){n({current:e})}});break}}},[t]);Object(c.useEffect)(()=>{function t(e){const t=se(e);o(t)}function s(){e.previewer.preview.bind("focus-control-for-setting",t)}return e.previewer.bind("ready",s),()=>{e.previewer.unbind("ready",s),e.previewer.preview.unbind("focus-control-for-setting",t)}},[e,o]);const r=Object(c.useMemo)(()=>[i,o],[i,o]);return Object(c.createElement)(ie.Provider,{value:r},s)}function ce(e){const{selectBlock:t}=Object(u.useDispatch)(b.store),[s]=Object(c.useContext)(ie),i=Object(c.useRef)(e);Object(c.useEffect)(()=>{i.current=e},[e]),Object(c.useEffect)(()=>{if(s.current){const e=i.current.find(e=>Object(r.getWidgetIdFromBlock)(e)===s.current);if(e){t(e.clientId);const s=document.querySelector(`[data-block="${e.clientId}"]`);null==s||s.focus()}}},[s,t])}function oe({sidebar:e,settings:t,children:s}){const[i,n,o]=te(e);return ce(i),Object(c.createElement)(b.BlockEditorProvider,{value:i,onInput:n,onChange:o,settings:t,useSubRegistry:!1},s)}function re({sidebar:e}){const{__unstableToggleFeature:t}=Object(u.useDispatch)(N),s=e.getWidgets().every(e=>e.id.startsWith("block-"));return Object(c.createElement)("div",{className:"customize-widgets-welcome-guide"},Object(c.createElement)("div",{className:"customize-widgets-welcome-guide__image__wrapper"},Object(c.createElement)("picture",null,Object(c.createElement)("source",{srcSet:"https://s.w.org/images/block-editor/welcome-editor.svg",media:"(prefers-reduced-motion: reduce)"}),Object(c.createElement)("img",{className:"customize-widgets-welcome-guide__image",src:"https://s.w.org/images/block-editor/welcome-editor.gif",width:"312",height:"240",alt:""}))),Object(c.createElement)("h1",{className:"customize-widgets-welcome-guide__heading"},Object(p.__)("Welcome to block Widgets")),Object(c.createElement)("p",{className:"customize-widgets-welcome-guide__text"},s?Object(p.__)("Your theme provides different “block” areas for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how theyll look on your site."):Object(p.__)("You can now add any block to your sites widget areas. Dont worry, all of your favorite widgets still work flawlessly.")),Object(c.createElement)(a.Button,{className:"customize-widgets-welcome-guide__button",isPrimary:!0,onClick:()=>t("welcomeGuide")},Object(p.__)("Got it")),Object(c.createElement)("hr",{className:"customize-widgets-welcome-guide__separator"}),!s&&Object(c.createElement)("p",{className:"customize-widgets-welcome-guide__more-info"},Object(p.__)("Want to stick with the old widgets?"),Object(c.createElement)("br",null),Object(c.createElement)(a.ExternalLink,{href:Object(p.__)("https://wordpress.org/plugins/classic-widgets/")},Object(p.__)("Get the Classic Widgets plugin."))),Object(c.createElement)("p",{className:"customize-widgets-welcome-guide__more-info"},Object(p.__)("New to the block editor?"),Object(c.createElement)("br",null),Object(c.createElement)(a.ExternalLink,{href:Object(p.__)("https://wordpress.org/support/article/wordpress-editor/")},Object(p.__)("Here's a detailed guide."))))}function ae({undo:e,redo:t,save:s}){return Object(S.useShortcut)("core/customize-widgets/undo",t=>{e(),t.preventDefault()},{bindGlobal:!0}),Object(S.useShortcut)("core/customize-widgets/redo",e=>{t(),e.preventDefault()},{bindGlobal:!0}),Object(S.useShortcut)("core/customize-widgets/save",e=>{e.preventDefault(),s()},{bindGlobal:!0}),null}ae.Register=function(){const{registerShortcut:e,unregisterShortcut:t}=Object(u.useDispatch)(S.store);return Object(c.useEffect)(()=>(e({name:"core/customize-widgets/undo",category:"global",description:Object(p.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/customize-widgets/redo",category:"global",description:Object(p.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"}}),e({name:"core/customize-widgets/save",category:"global",description:Object(p.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),()=>{t("core/customize-widgets/undo"),t("core/customize-widgets/redo"),t("core/customize-widgets/save")}),[e]),null};var le=ae;function de({blockEditorSettings:e,sidebar:t,inserter:s,inspector:i}){const[n,o]=function(e){const[t,s]=Object(c.useState)(()=>e.isOpen);return Object(c.useEffect)(()=>e.subscribe(s),[e]),[t,Object(c.useCallback)(t=>{let s=t;"function"==typeof t&&(s=t(e.isOpen)),s?e.open():e.close()},[e])]}(s),{hasUploadPermissions:r,isFixedToolbarActive:a,keepCaretInsideBlock:h,isWelcomeGuideActive:p}=Object(u.useSelect)(e=>({hasUploadPermissions:Object(l.defaultTo)(e(d.store).canUser("create","media"),!0),isFixedToolbarActive:e(N).__unstableIsFeatureActive("fixedToolbar"),keepCaretInsideBlock:e(N).__unstableIsFeatureActive("keepCaretInsideBlock"),isWelcomeGuideActive:e(N).__unstableIsFeatureActive("welcomeGuide")}),[]),O=Object(c.useMemo)(()=>{let t;return r&&(t=({onError:t,...s})=>{Object(m.uploadMedia)({wpAllowedMimeTypes:e.allowedMimeTypes,onError:({message:e})=>t(e),...s})}),{...e,__experimentalSetIsInserterOpened:o,mediaUpload:t,hasFixedToolbar:a,keepCaretInsideBlock:h}},[r,e,a,h]);return p?Object(c.createElement)(re,{sidebar:t}):Object(c.createElement)(c.Fragment,null,Object(c.createElement)(b.BlockEditorKeyboardShortcuts.Register,null),Object(c.createElement)(le.Register,null),Object(c.createElement)(oe,{sidebar:t,settings:O},Object(c.createElement)(b.BlockEditorKeyboardShortcuts,null),Object(c.createElement)(le,{undo:t.undo,redo:t.redo,save:t.save}),Object(c.createElement)(Q,{sidebar:t,inserter:s,isInserterOpened:n,setIsInserterOpened:o,isFixedToolbarActive:a}),Object(c.createElement)(b.BlockTools,null,Object(c.createElement)(b.BlockSelectionClearer,null,Object(c.createElement)(b.WritingFlow,null,Object(c.createElement)(b.ObserveTyping,null,Object(c.createElement)(b.BlockList,null))))),Object(c.createPortal)(Object(c.createElement)("form",{onSubmit:e=>e.preventDefault()},Object(c.createElement)(b.BlockInspector,null)),i.contentContainer[0])),Object(c.createElement)(b.__unstableBlockSettingsMenuFirstItem,null,({onClose:e})=>Object(c.createElement)(g,{inspector:i,closeMenu:e})))}const ue=Object(c.createContext)();function be({sidebarControls:e,activeSidebarControl:t,children:s}){const i=Object(c.useMemo)(()=>({sidebarControls:e,activeSidebarControl:t}),[e,t]);return Object(c.createElement)(ue.Provider,{value:i},s)}function me({api:e,sidebarControls:t,blockEditorSettings:s}){const[i,n]=Object(c.useState)(null),o=document.getElementById("customize-theme-controls"),r=Object(c.useRef)();!function(e,t){const{hasSelectedBlock:s,hasMultiSelection:i}=Object(u.useSelect)(b.store),{clearSelectedBlock:n}=Object(u.useDispatch)(b.store);Object(c.useEffect)(()=>{if(t.current&&e){const a=e.inspector.contentContainer[0],l=e.container[0],d=l.ownerDocument,u=d.defaultView;function c(e){!s()&&!i()||!e||!d.contains(e)||l.contains(e)||t.current.contains(e)||a.contains(e)||e.closest('[role="dialog"]')||n()}function o(e){c(e.target)}function r(){c(d.activeElement)}return d.addEventListener("focusin",o),u.addEventListener("blur",r),()=>{d.removeEventListener("focusin",o),u.removeEventListener("blur",r)}}},[t,e,s,i,n])}(i,r),Object(c.useEffect)(()=>{const e=t.map(e=>e.subscribe(t=>{t&&n(e)}));return()=>{e.forEach(e=>e())}},[t]);const l=i&&Object(c.createPortal)(Object(c.createElement)(de,{key:i.id,blockEditorSettings:s,sidebar:i.sidebarAdapter,inserter:i.inserter,inspector:i.inspector}),i.container[0]),d=o&&Object(c.createPortal)(Object(c.createElement)("div",{className:"customize-widgets-popover",ref:r},Object(c.createElement)(a.Popover.Slot,null)),o);return Object(c.createElement)(a.SlotFillProvider,null,Object(c.createElement)(be,{sidebarControls:t,activeSidebarControl:i},Object(c.createElement)(ne,{api:e,sidebarControls:t},l,d)))}function he(){const{wp:{customize:e}}=window;return class extends e.Section{ready(){const t=function(){const{wp:{customize:e}}=window;return class extends e.Section{constructor(e,t){super(e,t),this.parentSection=t.parentSection,this.returnFocusWhenClose=null}ready(){this.contentContainer[0].classList.add("customize-widgets-layout__inspector")}onChangeExpanded(e,t){super.onChangeExpanded(e,t),this.parentSection&&!t.unchanged&&(e?this.parentSection.collapse({manualTransition:!0}):this.parentSection.expand({manualTransition:!0,completeCallback:()=>{this.returnFocusWhenClose&&!this.contentContainer[0].contains(this.returnFocusWhenClose)&&this.returnFocusWhenClose.focus()}}))}open({returnFocusWhenClose:e}={}){this.returnFocusWhenClose=e,this.expand({allowMultiple:!0})}close(){this.collapse({allowMultiple:!0})}}}();this.inspector=new t("widgets-inspector-"+this.id,{title:Object(p.__)("Block Settings"),parentSection:this,customizeAction:[Object(p.__)("Customizing"),Object(p.__)("Widgets"),this.params.title].join(" ▸ ")}),e.section.add(this.inspector),this.contentContainer[0].classList.add("customize-widgets__sidebar-section")}hasSubSectionOpened(){return this.inspector.expanded()}onChangeExpanded(e,t){const s=this.controls(),i={...t,completeCallback(){var n;s.forEach(t=>{t.onChangeSectionExpanded(e,i)}),null===(n=t.completeCallback)||void 0===n||n.call(t)}};i.manualTransition?e?(this.contentContainer.addClass(["busy","open"]),this.contentContainer.removeClass("is-sub-section-open"),this.contentContainer.closest(".wp-full-overlay").addClass("section-open"),this.contentContainer.one("transitionend",()=>{this.contentContainer.removeClass("busy"),i.completeCallback()})):(this.contentContainer.addClass(["busy","is-sub-section-open"]),this.contentContainer.closest(".wp-full-overlay").addClass("section-open"),this.contentContainer.removeClass("open"),this.contentContainer.one("transitionend",()=>{this.contentContainer.removeClass("busy"),i.completeCallback()})):super.onChangeExpanded(e,i)}}}const{wp:pe}=window;function ge(e){const t=e.match(/^(.+)-(\d+)$/);return t?{idBase:t[1],number:parseInt(t[2],10)}:{idBase:e}}function Oe(e){const{idBase:t,number:s}=ge(e);return s?`widget_${t}[${s}]`:"widget_"+t}class we{constructor(e,t){this.setting=e,this.api=t,this.locked=!1,this.widgetsCache=new WeakMap,this.subscribers=new Set,this.history=[this._getWidgetIds().map(e=>this.getWidget(e))],this.historyIndex=0,this.historySubscribers=new Set,this._debounceSetHistory=function(e,t,s){let i,n=!1;function c(...c){const o=(n?t:e).apply(this,c);return n=!0,clearTimeout(i),i=setTimeout(()=>{n=!1},s),o}return c.cancel=()=>{n=!1,clearTimeout(i)},c}(this._pushHistory,this._replaceHistory,1e3),this.setting.bind(this._handleSettingChange.bind(this)),this.api.bind("change",this._handleAllSettingsChange.bind(this)),this.undo=this.undo.bind(this),this.redo=this.redo.bind(this),this.save=this.save.bind(this)}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}getWidgets(){return this.history[this.historyIndex]}_emit(...e){for(const t of this.subscribers)t(...e)}_getWidgetIds(){return this.setting.get()}_pushHistory(){this.history=[...this.history.slice(0,this.historyIndex+1),this._getWidgetIds().map(e=>this.getWidget(e))],this.historyIndex+=1,this.historySubscribers.forEach(e=>e())}_replaceHistory(){this.history[this.historyIndex]=this._getWidgetIds().map(e=>this.getWidget(e))}_handleSettingChange(){if(this.locked)return;const e=this.getWidgets();this._pushHistory(),this._emit(e,this.getWidgets())}_handleAllSettingsChange(e){if(this.locked)return;if(!e.id.startsWith("widget_"))return;const t=se(e.id);if(!this.setting.get().includes(t))return;const s=this.getWidgets();this._pushHistory(),this._emit(s,this.getWidgets())}_createWidget(e){const t=pe.customize.Widgets.availableWidgets.findWhere({id_base:e.idBase});let s=e.number;t.get("is_multi")&&!s&&(t.set("multi_number",t.get("multi_number")+1),s=t.get("multi_number"));const i=s?`widget_${e.idBase}[${s}]`:"widget_"+e.idBase,n={transport:pe.customize.Widgets.data.selectiveRefreshableWidgets[t.get("id_base")]?"postMessage":"refresh",previewer:this.setting.previewer};this.api.create(i,i,"",n).set(e.instance);return se(i)}_removeWidget(e){const t=Oe(e.id),s=this.api(t);if(s){const e=s.get();this.widgetsCache.delete(e)}this.api.remove(t)}_updateWidget(e){const t=this.getWidget(e.id);if(t===e)return e.id;if(t.idBase&&e.idBase&&t.idBase===e.idBase){const t=Oe(e.id);return this.api(t).set(e.instance),e.id}return this._removeWidget(e),this._createWidget(e)}getWidget(e){if(!e)return null;const{idBase:t,number:s}=ge(e),i=Oe(e),n=this.api(i);if(!n)return null;const c=n.get();if(this.widgetsCache.has(c))return this.widgetsCache.get(c);const o={id:e,idBase:t,number:s,instance:c};return this.widgetsCache.set(c,o),o}_updateWidgets(e){this.locked=!0;const t=[],s=e.map(e=>{if(e.id&&this.getWidget(e.id))return t.push(null),this._updateWidget(e);const s=this._createWidget(e);return t.push(s),s});return this.getWidgets().filter(e=>!s.includes(e.id)).forEach(e=>this._removeWidget(e)),this.setting.set(s),this.locked=!1,t}setWidgets(e){const t=this._updateWidgets(e);return this._debounceSetHistory(),t}hasUndo(){return this.historyIndex>0}hasRedo(){return this.historyIndex<this.history.length-1}_seek(e){const t=this.getWidgets();this.historyIndex=e;const s=this.history[this.historyIndex];this._updateWidgets(s),this._emit(t,this.getWidgets()),this.historySubscribers.forEach(e=>e()),this._debounceSetHistory.cancel()}undo(){this.hasUndo()&&this._seek(this.historyIndex-1)}redo(){this.hasRedo()&&this._seek(this.historyIndex+1)}subscribeHistory(e){return this.historySubscribers.add(e),()=>{this.historySubscribers.delete(e)}}save(){this.api.previewer.save()}}var fe=s("1CF3");function je(){const{wp:{customize:e}}=window;return class extends e.Control{constructor(...e){super(...e),this.subscribers=new Set}ready(){const t=function(){const{wp:{customize:e}}=window,t=e.OuterSection;return e.OuterSection=class extends t{onChangeExpanded(t,s){return t&&e.section.each(e=>{"outer"===e.params.type&&e.id!==this.id&&e.expanded()&&e.collapse()}),super.onChangeExpanded(t,s)}},e.sectionConstructor.outer=e.OuterSection,class extends e.OuterSection{constructor(...e){super(...e),this.params.type="outer",this.activeElementBeforeExpanded=null;this.contentContainer[0].ownerDocument.defaultView.addEventListener("keydown",e=>{!this.isOpen||e.keyCode!==f.ESCAPE&&"Escape"!==e.code||(e.stopPropagation(),this.close())},!0),this.contentContainer.addClass("widgets-inserter")}get isOpen(){return this.expanded()}subscribe(e){return this.expanded.bind(e),()=>this.expanded.unbind(e)}open(){if(!this.isOpen){const e=this.contentContainer[0];this.activeElementBeforeExpanded=e.ownerDocument.activeElement,this.expand({completeCallback(){const t=fe.focus.tabbable.find(e)[1];t&&t.focus()}})}}close(){if(this.isOpen){const e=this.contentContainer[0],t=e.ownerDocument.activeElement;this.collapse({completeCallback(){e.contains(t)&&this.activeElementBeforeExpanded&&this.activeElementBeforeExpanded.focus()}})}}}}();this.inserter=new t("widgets-inserter-"+this.id,{}),e.section.add(this.inserter),this.sectionInstance=e.section(this.section()),this.inspector=this.sectionInstance.inspector,this.sidebarAdapter=new we(this.setting,e)}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}onChangeSectionExpanded(e,t){t.unchanged||(e||this.inserter.close(),this.subscribers.forEach(s=>s(e,t)))}}}var _e=s("g56x");const ye=Object(v.createHigherOrderComponent)(e=>t=>{const s=Object(r.getWidgetIdFromBlock)(t),i=function(){const{sidebarControls:e}=Object(c.useContext)(ue);return e}(),n=function(){const{activeSidebarControl:e}=Object(c.useContext)(ue);return e}(),o=(null==i?void 0:i.length)>1,a=t.name,d=Object(u.useSelect)(e=>e(b.store).canInsertBlockType(a,""),[a]);return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(e,t),o&&d&&Object(c.createElement)(b.BlockControls,null,Object(c.createElement)(r.MoveToWidgetArea,{widgetAreas:i.map(e=>({id:e.id,name:e.params.label,description:e.params.description})),currentWidgetAreaId:null==n?void 0:n.id,onSelect:function(e){const t=i.find(t=>t.id===e),c=n.setting,o=t.setting;c(Object(l.without)(c(),s)),o([...o(),s]),t.expand()}})))},"withMoveToSidebarToolbarItem");Object(_e.addFilter)("editor.BlockEdit","core/customize-widgets/block-edit",ye);Object(_e.addFilter)("editor.MediaUpload","core/edit-widgets/replace-media-upload",()=>m.MediaUpload);const{wp:ve}=window;function Ee(e,t){const s=Object(o.__experimentalGetCoreBlocks)().filter(e=>!["core/more"].includes(e.name));Object(o.registerCoreBlocks)(s),Object(r.registerLegacyWidgetVariations)(t);const i=je();ve.customize.sectionConstructor.sidebar=he(),ve.customize.controlConstructor.sidebar_block_editor=i;const n=document.createElement("div");document.body.appendChild(n),ve.customize.bind("ready",()=>{const e=[];ve.customize.control.each(t=>{t instanceof i&&e.push(t)}),Object(c.render)(Object(c.createElement)(me,{api:ve.customize,sidebarControls:e,blockEditorSettings:t}),n)})}},GLVC:function(e,t){e.exports=window.wp.widgets},GRId:function(e,t){e.exports=window.wp.element},HSyU:function(e,t){e.exports=window.wp.blocks},"K+tz":function(e,t,s){"use strict";var i=s("GRId"),n=s("Tqx9");const c=Object(i.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)(n.Path,{d:"M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"}));t.a=c},K2cm:function(e,t,s){"use strict";var i=s("GRId"),n=s("Tqx9");const c=Object(i.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)(n.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=c},K9lf:function(e,t){e.exports=window.wp.compose},Ntru:function(e,t,s){"use strict";var i=s("GRId"),n=s("Tqx9");const c=Object(i.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)(n.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=c},Q4Sy:function(e,t,s){"use strict";var i=s("GRId"),n=s("Tqx9");const c=Object(i.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)(n.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));t.a=c},QyPg:function(e,t){e.exports=window.wp.blockLibrary},RMJe:function(e,t,s){"use strict";var i=s("GRId"),n=s("Tqx9");const c=Object(i.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)(n.Path,{d:"M18.3 5.6L9.9 16.9l-4.6-3.4-.9 1.2 5.8 4.3 9.3-12.6z"}));t.a=c},RxS6:function(e,t){e.exports=window.wp.keycodes},TSYQ:function(e,t,s){var i;
/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/!function(){"use strict";var s={}.hasOwnProperty;function n(){for(var e=[],t=0;t<arguments.length;t++){var i=arguments[t];if(i){var c=typeof i;if("string"===c||"number"===c)e.push(i);else if(Array.isArray(i)){if(i.length){var o=n.apply(null,i);o&&e.push(o)}}else if("object"===c)if(i.toString===Object.prototype.toString)for(var r in i)s.call(i,r)&&i[r]&&e.push(r);else e.push(i.toString())}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):void 0===(i=function(){return n}.apply(t,[]))||(e.exports=i)}()},Tqx9:function(e,t){e.exports=window.wp.primitives},VKE3:function(e,t,s){"use strict";var i=s("GRId"),n=s("Tqx9");const c=Object(i.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)(n.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));t.a=c},YLtl:function(e,t){e.exports=window.lodash},axFQ:function(e,t){e.exports=window.wp.blockEditor},bWcr:function(e,t,s){"use strict";var i=s("GRId"),n=s("Tqx9");const c=Object(i.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)(n.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=c},g56x:function(e,t){e.exports=window.wp.hooks},gdqT:function(e,t){e.exports=window.wp.a11y},hF7m:function(e,t){e.exports=window.wp.keyboardShortcuts},jZUy:function(e,t){e.exports=window.wp.coreData},l3Sj:function(e,t){e.exports=window.wp.i18n},rl8x:function(e,t){e.exports=window.wp.isShallowEqual},"tI+e":function(e,t){e.exports=window.wp.components},wx14:function(e,t,s){"use strict";function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(e[i]=s[i])}return e}).apply(this,arguments)}s.d(t,"a",(function(){return i}))}});