Gutenberg - Version 10.6.2

Version Description

Download this release

Release Info

Developer gutenbergplugin
Plugin Icon 128x128 Gutenberg
Version 10.6.2
Comparing to
See all releases

Code changes from version 10.6.1 to 10.6.2

build/block-library/index.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'moment', 'react', 'wp-api-fetch', 'wp-autop', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-reusable-blocks', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport'), 'version' => '1066a93409706095a0461fb5da18e8cc');
1
+ <?php return array('dependencies' => array('lodash', 'moment', 'react', 'wp-api-fetch', 'wp-autop', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-reusable-blocks', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport'), 'version' => 'e490b0b5c3edef4d676fc868ddd7a5a8');
build/block-library/index.js CHANGED
@@ -13,7 +13,7 @@ Object(Se.__)("Level %1$s. %2$s"),n,t)}},transforms:wn,deprecated:gn,merge:(e,t)
13
  Object(Se.__)("Add quote"),onReplace:r,onSplit:t=>Object(Ce.createBlock)("core/quote",{...e,value:t}),__unstableOnSplitMiddle:()=>Object(Ce.createBlock)("core/paragraph"),textAlign:i}),(!Ee.RichText.isEmpty(u)||n)&&Object(Be.createElement)(Ee.RichText,{identifier:"citation",tagName:Tn?"cite":void 0,style:{display:"block"},value:u,onChange:e=>t({citation:e}),__unstableMobileNoFocusOnMount:!0,"aria-label":Object(Se.__)("Quote citation text"),placeholder:// translators: placeholder text used for the citation
14
  Object(Se.__)("Add citation"),className:"wp-block-quote__citation",textAlign:i,__unstableOnSplitAtEnd:()=>c(Object(Ce.createBlock)("core/paragraph"))})))},save:function({attributes:e}){const{align:t,value:n,citation:o}=e,r=Ne()({["has-text-align-"+t]:t});return Object(Be.createElement)("blockquote",Ee.useBlockProps.save({className:r}),Object(Be.createElement)(Ee.RichText.Content,{multiline:!0,value:n}),!Ee.RichText.isEmpty(o)&&Object(Be.createElement)(Ee.RichText.Content,{tagName:"cite",value:o}))},merge:(e,{value:t,citation:n})=>(n||(n=e.citation),t&&"<p></p>"!==t?{...e,value:e.value+t,citation:n}:{...e,citation:n}),deprecated:Bn};var Hn=Object(Be.createElement)(Te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Be.createElement)(Te.Path,{d:"M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8h-1.5zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zM4.5 4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1V12l-2.3-1.7c-.3-.2-.6-.2-.9 0l-2.9 2.1L8 11.3c-.2-.1-.5-.1-.7 0l-2.9 1.5V4.6zm0 11.8v-1.8l3.2-1.7 2.4 1.2c.2.1.5.1.8-.1l2.8-2 2.8 2v2.5c0 .1-.1.1-.1.1H4.6c0-.1-.1-.2-.1-.2z"}));function In(e){return Math.min(3,e.images.length)}const Rn=(e,t="large")=>{const n=Object(xe.pick)(e,["alt","id","link","caption"]);n.url=Object(xe.get)(e,["sizes",t,"url"])||Object(xe.get)(e,["media_details","sizes",t,"source_url"])||e.url;const o=Object(xe.get)(e,["sizes","full","url"])||Object(xe.get)(e,["media_details","sizes","full","source_url"]);return o&&(n.fullUrl=o),n};var An=[{attributes:{images:{type:"array",default:[],source:"query",selector:".blocks-gallery-item",query:{url:{type:"string",source:"attribute",selector:"img",attribute:"src"},fullUrl:{type:"string",source:"attribute",selector:"img",attribute:"data-full-url"},link:{type:"string",source:"attribute",selector:"img",attribute:"data-link"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},id:{type:"string",source:"attribute",selector:"img",attribute:"data-id"},caption:{type:"string",source:"html",selector:".blocks-gallery-item__caption"}}},ids:{type:"array",items:{type:"number"},default:[]},columns:{type:"number",minimum:1,maximum:8},caption:{type:"string",source:"html",selector:".blocks-gallery-caption"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"},sizeSlug:{type:"string",default:"large"}},supports:{align:!0},isEligible:({linkTo:e})=>!e||"attachment"===e||"media"===e,migrate(e){let t=e.linkTo;return e.linkTo?"attachment"===e.linkTo?t="post":"media"===e.linkTo&&(t="file"):t="none",{...e,linkTo:t}},save({attributes:e}){const{images:t,columns:n=In(e),imageCrop:o,caption:r,linkTo:a}=e;return Object(Be.createElement)("figure",{className:`columns-${n} ${o?"is-cropped":""}`},Object(Be.createElement)("ul",{className:"blocks-gallery-grid"},t.map(e=>{let t;switch(a){case"media":t=e.fullUrl||e.url;break;case"attachment":t=e.link}const n=Object(Be.createElement)("img",{src:e.url,alt:e.alt,"data-id":e.id,"data-full-url":e.fullUrl,"data-link":e.link,className:e.id?"wp-image-"+e.id:null});return Object(Be.createElement)("li",{key:e.id||e.url,className:"blocks-gallery-item"},Object(Be.createElement)("figure",null,t?Object(Be.createElement)("a",{href:t},n):n,!Ee.RichText.isEmpty(e.caption)&&Object(Be.createElement)(Ee.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-item__caption",value:e.caption})))})),!Ee.RichText.isEmpty(r)&&Object(Be.createElement)(Ee.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-caption",value:r}))}},{attributes:{images:{type:"array",default:[],source:"query",selector:".blocks-gallery-item",query:{url:{source:"attribute",selector:"img",attribute:"src"},fullUrl:{source:"attribute",selector:"img",attribute:"data-full-url"},link:{source:"attribute",selector:"img",attribute:"data-link"},alt:{source:"attribute",selector:"img",attribute:"alt",default:""},id:{source:"attribute",selector:"img",attribute:"data-id"},caption:{type:"string",source:"html",selector:".blocks-gallery-item__caption"}}},ids:{type:"array",default:[]},columns:{type:"number"},caption:{type:"string",source:"html",selector:".blocks-gallery-caption"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"}},supports:{align:!0},isEligible:({ids:e})=>e&&e.some(e=>"string"==typeof e),migrate:e=>({...e,ids:Object(xe.map)(e.ids,e=>{const t=parseInt(e,10);return Number.isInteger(t)?t:null})}),save({attributes:e}){const{images:t,columns:n=In(e),imageCrop:o,caption:r,linkTo:a}=e;return Object(Be.createElement)("figure",{className:`columns-${n} ${o?"is-cropped":""}`},Object(Be.createElement)("ul",{className:"blocks-gallery-grid"},t.map(e=>{let t;switch(a){case"media":t=e.fullUrl||e.url;break;case"attachment":t=e.link}const n=Object(Be.createElement)("img",{src:e.url,alt:e.alt,"data-id":e.id,"data-full-url":e.fullUrl,"data-link":e.link,className:e.id?"wp-image-"+e.id:null});return Object(Be.createElement)("li",{key:e.id||e.url,className:"blocks-gallery-item"},Object(Be.createElement)("figure",null,t?Object(Be.createElement)("a",{href:t},n):n,!Ee.RichText.isEmpty(e.caption)&&Object(Be.createElement)(Ee.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-item__caption",value:e.caption})))})),!Ee.RichText.isEmpty(r)&&Object(Be.createElement)(Ee.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-caption",value:r}))}},{attributes:{images:{type:"array",default:[],source:"query",selector:"ul.wp-block-gallery .blocks-gallery-item",query:{url:{source:"attribute",selector:"img",attribute:"src"},fullUrl:{source:"attribute",selector:"img",attribute:"data-full-url"},alt:{source:"attribute",selector:"img",attribute:"alt",default:""},id:{source:"attribute",selector:"img",attribute:"data-id"},link:{source:"attribute",selector:"img",attribute:"data-link"},caption:{type:"array",source:"children",selector:"figcaption"}}},ids:{type:"array",default:[]},columns:{type:"number"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"}},supports:{align:!0},save({attributes:e}){const{images:t,columns:n=In(e),imageCrop:o,linkTo:r}=e;return Object(Be.createElement)("ul",{className:`columns-${n} ${o?"is-cropped":""}`},t.map(e=>{let t;switch(r){case"media":t=e.fullUrl||e.url;break;case"attachment":t=e.link}const n=Object(Be.createElement)("img",{src:e.url,alt:e.alt,"data-id":e.id,"data-full-url":e.fullUrl,"data-link":e.link,className:e.id?"wp-image-"+e.id:null});return Object(Be.createElement)("li",{key:e.id||e.url,className:"blocks-gallery-item"},Object(Be.createElement)("figure",null,t?Object(Be.createElement)("a",{href:t},n):n,e.caption&&e.caption.length>0&&Object(Be.createElement)(Ee.RichText.Content,{tagName:"figcaption",value:e.caption})))}))}},{attributes:{images:{type:"array",default:[],source:"query",selector:"ul.wp-block-gallery .blocks-gallery-item",query:{url:{source:"attribute",selector:"img",attribute:"src"},alt:{source:"attribute",selector:"img",attribute:"alt",default:""},id:{source:"attribute",selector:"img",attribute:"data-id"},link:{source:"attribute",selector:"img",attribute:"data-link"},caption:{type:"array",source:"children",selector:"figcaption"}}},columns:{type:"number"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"}},isEligible:({images:e,ids:t})=>e&&e.length>0&&(!t&&e||t&&e&&t.length!==e.length||Object(xe.some)(e,(e,n)=>!e&&null!==t[n]||parseInt(e,10)!==t[n])),migrate:e=>({...e,ids:Object(xe.map)(e.images,({id:e})=>e?parseInt(e,10):null)}),supports:{align:!0},save({attributes:e}){const{images:t,columns:n=In(e),imageCrop:o,linkTo:r}=e;return Object(Be.createElement)("ul",{className:`columns-${n} ${o?"is-cropped":""}`},t.map(e=>{let t;switch(r){case"media":t=e.url;break;case"attachment":t=e.link}const n=Object(Be.createElement)("img",{src:e.url,alt:e.alt,"data-id":e.id,"data-link":e.link,className:e.id?"wp-image-"+e.id:null});return Object(Be.createElement)("li",{key:e.id||e.url,className:"blocks-gallery-item"},Object(Be.createElement)("figure",null,t?Object(Be.createElement)("a",{href:t},n):n,e.caption&&e.caption.length>0&&Object(Be.createElement)(Ee.RichText.Content,{tagName:"figcaption",value:e.caption})))}))}},{attributes:{images:{type:"array",default:[],source:"query",selector:"div.wp-block-gallery figure.blocks-gallery-image img",query:{url:{source:"attribute",attribute:"src"},alt:{source:"attribute",attribute:"alt",default:""},id:{source:"attribute",attribute:"data-id"}}},columns:{type:"number"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"},align:{type:"string",default:"none"}},supports:{align:!0},save({attributes:e}){const{images:t,columns:n=In(e),align:o,imageCrop:r,linkTo:a}=e,c=Ne()("columns-"+n,{alignnone:"none"===o,"is-cropped":r});return Object(Be.createElement)("div",{className:c},t.map(e=>{let t;switch(a){case"media":t=e.url;break;case"attachment":t=e.link}const n=Object(Be.createElement)("img",{src:e.url,alt:e.alt,"data-id":e.id});return Object(Be.createElement)("figure",{key:e.id||e.url,className:"blocks-gallery-image"},t?Object(Be.createElement)("a",{href:t},n):n)}))}}],Ln=n(57);const Dn=Object(Be.createElement)(Ee.BlockIcon,{icon:Hn});var Fn=n(215),Gn=n(214),Un=n(202),qn=n(100);class Wn extends Be.Component{constructor(){super(...arguments),this.onSelectImage=this.onSelectImage.bind(this),this.onSelectCaption=this.onSelectCaption.bind(this),this.onRemoveImage=this.onRemoveImage.bind(this),this.bindContainer=this.bindContainer.bind(this),this.onEdit=this.onEdit.bind(this),this.onSelectImageFromLibrary=this.onSelectImageFromLibrary.bind(this),this.onSelectCustomURL=this.onSelectCustomURL.bind(this),this.state={captionSelected:!1,isEditing:!1}}bindContainer(e){this.container=e}onSelectCaption(){this.state.captionSelected||this.setState({captionSelected:!0}),this.props.isSelected||this.props.onSelect()}onSelectImage(){this.props.isSelected||this.props.onSelect(),this.state.captionSelected&&this.setState({captionSelected:!1})}onRemoveImage(e){this.container===this.container.ownerDocument.activeElement&&this.props.isSelected&&-1!==[hn.BACKSPACE,hn.DELETE].indexOf(e.keyCode)&&(e.stopPropagation(),e.preventDefault(),this.props.onRemove())}onEdit(){this.setState({isEditing:!0})}componentDidUpdate(e){const{isSelected:t,image:n,url:o,__unstableMarkNextChangeAsNotPersistent:r}=this.props;n&&!o&&(r(),this.props.setAttributes({url:n.source_url,alt:n.alt_text})),this.state.captionSelected&&!t&&e.isSelected&&this.setState({captionSelected:!1})}deselectOnBlur(){this.props.onDeselect()}onSelectImageFromLibrary(e){const{setAttributes:t,id:n,url:o,alt:r,caption:a,sizeSlug:c}=this.props;if(!e||!e.url)return;let l=Rn(e,c);((e,t)=>!e&&Object(Je.isBlobURL)(t))(n,o)&&r&&(l=Object(xe.omit)(l,["alt"])),a&&!Object(xe.get)(l,["caption"])&&(l=Object(xe.omit)(l,["caption"])),t(l),this.setState({isEditing:!1})}onSelectCustomURL(e){const{setAttributes:t,url:n}=this.props;e!==n&&(t({url:e,id:void 0}),this.setState({isEditing:!1}))}render(){const{url:e,alt:t,id:n,linkTo:o,link:r,isFirstItem:a,isLastItem:c,isSelected:l,caption:i,onRemove:s,onMoveForward:u,onMoveBackward:m,setAttributes:d,"aria-label":b}=this.props,{isEditing:p}=this.state;let g;switch(o){case"file":g=e;break;case"post":g=r}const h=Object(Be.createElement)(Be.Fragment,null,Object(Be.createElement)("img",{src:e,alt:t,"data-id":n,onClick:this.onSelectImage,onFocus:this.onSelectImage,onKeyDown:this.onRemoveImage,tabIndex:"0","aria-label":b,ref:this.bindContainer}),Object(Je.isBlobURL)(e)&&Object(Be.createElement)(Ae.Spinner,null)),v=Ne()({"is-selected":l,"is-transient":Object(Je.isBlobURL)(e)});return Object(Be.createElement)("figure",{className:v},!p&&(g?Object(Be.createElement)("a",{href:g},h):h),p&&Object(Be.createElement)(Ee.MediaPlaceholder,{labels:{title:Object(Se.__)("Edit gallery image")},icon:$e,onSelect:this.onSelectImageFromLibrary,onSelectURL:this.onSelectCustomURL,accept:"image/*",allowedTypes:["image"],value:{id:n,src:e}}),Object(Be.createElement)(Ae.ButtonGroup,{className:"block-library-gallery-item__inline-menu is-left"},Object(Be.createElement)(Ae.Button,{icon:Fn.a,onClick:a?void 0:m,label:Object(Se.__)("Move image backward"),"aria-disabled":a,disabled:!l}),Object(Be.createElement)(Ae.Button,{icon:Gn.a,onClick:c?void 0:u,label:Object(Se.__)("Move image forward"),"aria-disabled":c,disabled:!l})),Object(Be.createElement)(Ae.ButtonGroup,{className:"block-library-gallery-item__inline-menu is-right"},Object(Be.createElement)(Ae.Button,{icon:Un.a,onClick:this.onEdit,label:Object(Se.__)("Replace image"),disabled:!l}),Object(Be.createElement)(Ae.Button,{icon:qn.a,onClick:s,label:Object(Se.__)("Remove image"),disabled:!l})),!p&&(l||i)&&Object(Be.createElement)(Ee.RichText,{tagName:"figcaption","aria-label":Object(Se.__)("Image caption text"),placeholder:l?Object(Se.__)("Add caption"):null,value:i,isSelected:this.state.captionSelected,onChange:e=>d({caption:e}),unstableOnFocus:this.onSelectCaption,inlineToolbar:!0}))}}var $n=Object(Ye.compose)([Object(Ke.withSelect)((e,t)=>{const{getMedia:n}=e(ke.store),{id:o}=t;return{image:o?n(parseInt(o,10)):null}}),Object(Ke.withDispatch)(e=>{const{__unstableMarkNextChangeAsNotPersistent:t}=e(Ee.store);return{__unstableMarkNextChangeAsNotPersistent:t}})])(Wn);function Zn({isHidden:e,...t}){return e?Object(Be.createElement)(Ae.VisuallyHidden,Object(Re.a)({as:Ee.RichText},t)):Object(Be.createElement)(Ee.RichText,t)}var Qn=e=>{const{attributes:t,isSelected:n,setAttributes:o,selectedImage:r,mediaPlaceholder:a,onMoveBackward:c,onMoveForward:l,onRemoveImage:i,onSelectImage:s,onDeselectImage:u,onSetImageAttributes:m,onFocusGalleryCaption:d,insertBlocksAfter:b,blockProps:p}=e,{align:g,columns:h=In(t),caption:v,imageCrop:O,images:j}=t;return Object(Be.createElement)("figure",Object(Re.a)({},p,{className:Ne()(p.className,{["align"+g]:g,["columns-"+h]:h,"is-cropped":O})}),Object(Be.createElement)("ul",{className:"blocks-gallery-grid"},j.map((e,o)=>{const a=Object(Se.sprintf)(
15
  /* translators: 1: the order number of the image. 2: the total number of images. */
16
- Object(Se.__)("image %1$d of %2$d in gallery"),o+1,j.length);return Object(Be.createElement)("li",{className:"blocks-gallery-item",key:e.id||e.url},Object(Be.createElement)($n,{url:e.url,alt:e.alt,id:e.id,isFirstItem:0===o,isLastItem:o+1===j.length,isSelected:n&&r===o,onMoveBackward:c(o),onMoveForward:l(o),onRemove:i(o),onSelect:s(o),onDeselect:u(o),setAttributes:e=>m(o,e),caption:e.caption,"aria-label":a,sizeSlug:t.sizeSlug}))})),a,Object(Be.createElement)(Zn,{isHidden:!n&&Ee.RichText.isEmpty(v),tagName:"figcaption",className:"blocks-gallery-caption","aria-label":Object(Se.__)("Gallery caption text"),placeholder:Object(Se.__)("Write gallery caption…"),value:v,unstableOnFocus:d,onChange:e=>o({caption:e}),inlineToolbar:!0,__unstableOnSplitAtEnd:()=>b(Object(Ce.createBlock)("core/paragraph"))}))};const Jn=[{value:"post",label:Object(Se.__)("Attachment Page")},{value:"file",label:Object(Se.__)("Media File")},{value:"none",label:Object(Se.__)("None")}],Kn=["image"],Yn=Be.Platform.select({web:Object(Se.__)("Drag images, upload new ones or select files from your library."),native:Object(Se.__)("ADD MEDIA")}),Xn=Be.Platform.select({web:{},native:{type:"stepper"}});var eo=Object(Ye.compose)([Ae.withNotices,Object(Ln.withViewportMatch)({isNarrow:"< small"})])((function(e){const{attributes:t,clientId:n,isSelected:o,noticeUI:r,noticeOperations:a,onFocus:c}=e,{columns:l=In(t),imageCrop:i,images:s,linkTo:u,sizeSlug:m}=t,[d,b]=Object(Be.useState)(),[p,g]=Object(Be.useState)(),{__unstableMarkNextChangeAsNotPersistent:h}=Object(Ke.useDispatch)(Ee.store),{imageSizes:v,mediaUpload:O,getMedia:j,wasBlockJustInserted:f}=Object(Ke.useSelect)(e=>{const t=e(Ee.store).getSettings();return{imageSizes:t.imageSizes,mediaUpload:t.mediaUpload,getMedia:e(ke.store).getMedia,wasBlockJustInserted:e(Ee.store).wasBlockJustInserted(n,"inserter_menu")}}),{resizedImages:y}=Object(Be.useMemo)(()=>o?Object(xe.reduce)(t.ids,(e,t)=>{if(!t)return e;const n=j(t),o=Object(xe.reduce)(v,(e,t)=>{const o=Object(xe.get)(n,["sizes",t.slug,"url"]),r=Object(xe.get)(n,["media_details","sizes",t.slug,"source_url"]);return{...e,[t.slug]:o||r}},{});return{...e,[parseInt(t,10)]:o}},{}):{},[o,t.ids,v]);function _(t){if(t.ids)throw new Error('The "ids" attribute should not be changed directly. It is managed automatically when "images" attribute changes');t.images&&(t={...t,ids:Object(xe.map)(t.images,({id:e})=>parseInt(e,10))}),e.setAttributes(t)}function w(e,t){const n=[...s];n.splice(t,1,s[e]),n.splice(e,1,s[t]),b(t),_({images:n})}function k(e){const t=Object(xe.toString)(e.id),n=Object(xe.find)(s,{id:t}),o=n?n.caption:e.caption;if(!p)return o;const r=Object(xe.find)(p,{id:t});return r&&r.caption!==e.caption?e.caption:o}function E(e){g(e.map(e=>({id:Object(xe.toString)(e.id),caption:e.caption}))),_({images:e.map(e=>({...Rn(e,m),caption:k(e),id:Object(xe.toString)(e.id)})),columns:t.columns?Math.min(e.length,t.columns):t.columns})}Object(Be.useEffect)(()=>{if("web"===Be.Platform.OS&&s&&s.length>0&&Object(xe.every)(s,({url:e})=>Object(Je.isBlobURL)(e))){const e=Object(xe.map)(s,({url:e})=>Object(Je.getBlobByURL)(e));Object(xe.forEach)(s,({url:e})=>Object(Je.revokeBlobURL)(e)),O({filesList:e,onFileChange:E,allowedTypes:["image"]})}},[]),Object(Be.useEffect)(()=>{o||b()},[o]),Object(Be.useEffect)(()=>{var e,t,n,o,r,a;u||(h(),_({linkTo:(null===(e=window)||void 0===e||null===(t=e.wp)||void 0===t||null===(n=t.media)||void 0===n||null===(o=n.view)||void 0===o||null===(r=o.settings)||void 0===r||null===(a=r.defaultProps)||void 0===a?void 0:a.link)||"none"}))},[u]);const C=!!s.length,x=C&&s.some(e=>!!e.id),S=Object(Be.createElement)(Ee.MediaPlaceholder,{addToGallery:x,isAppender:C,disableMediaButtons:C&&!o,icon:!C&&Dn,labels:{title:!C&&Object(Se.__)("Gallery"),instructions:!C&&Yn},onSelect:E,accept:"image/*",allowedTypes:Kn,multiple:!0,value:x?s:{},onError:function(e){a.removeAllNotices(),a.createErrorNotice(e)},notices:C?void 0:r,onFocus:c,autoOpenMediaUpload:!C&&o&&f}),B=Object(Ee.useBlockProps)();if(!C)return Object(Be.createElement)(Te.View,B,S);const T=Object(xe.map)(Object(xe.filter)(v,({slug:e})=>Object(xe.some)(y,t=>t[e])),({name:e,slug:t})=>({value:t,label:e})),z=C&&!Object(xe.isEmpty)(T);return Object(Be.createElement)(Be.Fragment,null,Object(Be.createElement)(Ee.InspectorControls,null,Object(Be.createElement)(Ae.PanelBody,{title:Object(Se.__)("Gallery settings")},s.length>1&&Object(Be.createElement)(Ae.RangeControl,Object(Re.a)({label:Object(Se.__)("Columns"),value:l,onChange:function(e){_({columns:e})},min:1,max:Math.min(8,s.length)},Xn,{required:!0})),Object(Be.createElement)(Ae.ToggleControl,{label:Object(Se.__)("Crop images"),checked:!!i,onChange:function(){_({imageCrop:!i})},help:function(e){return e?Object(Se.__)("Thumbnails are cropped to align."):Object(Se.__)("Thumbnails are not cropped.")}}),Object(Be.createElement)(Ae.SelectControl,{label:Object(Se.__)("Link to"),value:u,onChange:function(e){_({linkTo:e})},options:Jn,hideCancelButton:!0}),z&&Object(Be.createElement)(Ae.SelectControl,{label:Object(Se.__)("Image size"),value:m,options:T,onChange:function(e){_({images:Object(xe.map)(s,t=>{if(!t.id)return t;const n=Object(xe.get)(y,[parseInt(t.id,10),e]);return{...t,...n&&{url:n}}}),sizeSlug:e})},hideCancelButton:!0}))),r,Object(Be.createElement)(Qn,Object(Re.a)({},e,{selectedImage:d,mediaPlaceholder:S,onMoveBackward:function(e){return()=>{0!==e&&w(e,e-1)}},onMoveForward:function(e){return()=>{e!==s.length-1&&w(e,e+1)}},onRemoveImage:function(e){return()=>{const n=Object(xe.filter)(s,(t,n)=>e!==n);b(),_({images:n,columns:t.columns?Math.min(n.length,t.columns):t.columns})}},onSelectImage:function(e){return()=>{b(e)}},onDeselectImage:function(){return()=>{b()}},onSetImageAttributes:function(e,t){s[e]&&_({images:[...s.slice(0,e),{...s[e],...t},...s.slice(e+1)]})},onFocusGalleryCaption:function(){b()},blockProps:B})))}));const to=e=>e?e.split(",").map(e=>parseInt(e,10)):[];var no={from:[{type:"block",isMultiBlock:!0,blocks:["core/image"],transform:e=>{let{align:t,sizeSlug:n}=e[0];t=Object(xe.every)(e,["align",t])?t:void 0,n=Object(xe.every)(e,["sizeSlug",n])?n:void 0;const o=Object(xe.filter)(e,({url:e})=>e);return Object(Ce.createBlock)("core/gallery",{images:o.map(({id:e,url:t,alt:n,caption:o})=>({id:Object(xe.toString)(e),url:t,alt:n,caption:o})),ids:o.map(({id:e})=>parseInt(e,10)),align:t,sizeSlug:n})}},{type:"shortcode",tag:"gallery",attributes:{images:{type:"array",shortcode:({named:{ids:e}})=>to(e).map(e=>({id:Object(xe.toString)(e)}))},ids:{type:"array",shortcode:({named:{ids:e}})=>to(e)},columns:{type:"number",shortcode:({named:{columns:e="3"}})=>parseInt(e,10)},linkTo:{type:"string",shortcode:({named:{link:e="post"}})=>e}},isMatch:({named:e})=>void 0!==e.ids},{type:"files",isMatch:e=>1!==e.length&&Object(xe.every)(e,e=>0===e.type.indexOf("image/")),transform:e=>Object(Ce.createBlock)("core/gallery",{images:e.map(e=>Rn({url:Object(Je.createBlobURL)(e)}))})}],to:[{type:"block",blocks:["core/image"],transform:({images:e,align:t,sizeSlug:n,ids:o})=>e.length>0?e.map(({url:e,alt:r,caption:a},c)=>Object(Ce.createBlock)("core/image",{id:o[c],url:e,alt:r,caption:a,align:t,sizeSlug:n})):Object(Ce.createBlock)("core/image",{align:t})}]};const oo={apiVersion:2,name:"core/gallery",title:"Gallery",category:"media",description:"Display multiple images in a rich gallery.",keywords:["images","photos"],textdomain:"default",attributes:{images:{type:"array",default:[],source:"query",selector:".blocks-gallery-item",query:{url:{type:"string",source:"attribute",selector:"img",attribute:"src"},fullUrl:{type:"string",source:"attribute",selector:"img",attribute:"data-full-url"},link:{type:"string",source:"attribute",selector:"img",attribute:"data-link"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},id:{type:"string",source:"attribute",selector:"img",attribute:"data-id"},caption:{type:"string",source:"html",selector:".blocks-gallery-item__caption"}}},ids:{type:"array",items:{type:"number"},default:[]},columns:{type:"number",minimum:1,maximum:8},caption:{type:"string",source:"html",selector:".blocks-gallery-caption"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string"},sizeSlug:{type:"string",default:"large"}},supports:{anchor:!0,align:!0},editorStyle:"wp-block-gallery-editor",style:"wp-block-gallery"},{name:ro}=oo,ao={icon:Hn,example:{attributes:{columns:2,images:[{url:"https://s.w.org/images/core/5.3/Glacial_lakes%2C_Bhutan.jpg"},{url:"https://s.w.org/images/core/5.3/Sediment_off_the_Yucatan_Peninsula.jpg"}]}},transforms:no,edit:eo,save:function({attributes:e}){const{images:t,columns:n=In(e),imageCrop:o,caption:r,linkTo:a}=e,c=`columns-${n} ${o?"is-cropped":""}`;return Object(Be.createElement)("figure",Ee.useBlockProps.save({className:c}),Object(Be.createElement)("ul",{className:"blocks-gallery-grid"},t.map(e=>{let t;switch(a){case"file":t=e.fullUrl||e.url;break;case"post":t=e.link}const n=Object(Be.createElement)("img",{src:e.url,alt:e.alt,"data-id":e.id,"data-full-url":e.fullUrl,"data-link":e.link,className:e.id?"wp-image-"+e.id:null});return Object(Be.createElement)("li",{key:e.id||e.url,className:"blocks-gallery-item"},Object(Be.createElement)("figure",null,t?Object(Be.createElement)("a",{href:t},n):n,!Ee.RichText.isEmpty(e.caption)&&Object(Be.createElement)(Ee.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-item__caption",value:e.caption})))})),!Ee.RichText.isEmpty(r)&&Object(Be.createElement)(Ee.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-caption",value:r}))},deprecated:An};var co=Object(Be.createElement)(Te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Be.createElement)(Te.Path,{d:"M19 6.2h-5.9l-.6-1.1c-.3-.7-1-1.1-1.8-1.1H5c-1.1 0-2 .9-2 2v11.8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8.2c0-1.1-.9-2-2-2zm.5 11.6c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h5.8c.2 0 .4.1.4.3l1 2H19c.3 0 .5.2.5.5v9.5zM8 12.8h8v-1.5H8v1.5zm0 3h8v-1.5H8v1.5z"})),lo=n(68),io=n.n(lo);const so={apiVersion:2,name:"core/archives",title:"Archives",category:"widgets",description:"Display a monthly archive of your posts.",textdomain:"default",attributes:{displayAsDropdown:{type:"boolean",default:!1},showPostCounts:{type:"boolean",default:!1}},supports:{align:!0,html:!1},editorStyle:"wp-block-archives-editor"},{name:uo}=so,mo={icon:co,example:{},edit:function({attributes:e,setAttributes:t}){const{showPostCounts:n,displayAsDropdown:o}=e;return Object(Be.createElement)(Be.Fragment,null,Object(Be.createElement)(Ee.InspectorControls,null,Object(Be.createElement)(Ae.PanelBody,{title:Object(Se.__)("Archives settings")},Object(Be.createElement)(Ae.ToggleControl,{label:Object(Se.__)("Display as dropdown"),checked:o,onChange:()=>t({displayAsDropdown:!o})}),Object(Be.createElement)(Ae.ToggleControl,{label:Object(Se.__)("Show post counts"),checked:n,onChange:()=>t({showPostCounts:!n})}))),Object(Be.createElement)("div",Object(Ee.useBlockProps)(),Object(Be.createElement)(Ae.Disabled,null,Object(Be.createElement)(io.a,{block:"core/archives",attributes:e}))))}};var bo=Object(Be.createElement)(Te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Be.createElement)(Te.Path,{d:"M17.7 4.3c-1.2 0-2.8 0-3.8 1-.6.6-.9 1.5-.9 2.6V14c-.6-.6-1.5-1-2.5-1C8.6 13 7 14.6 7 16.5S8.6 20 10.5 20c1.5 0 2.8-1 3.3-2.3.5-.8.7-1.8.7-2.5V7.9c0-.7.2-1.2.5-1.6.6-.6 1.8-.6 2.8-.6h.3V4.3h-.4z"})),po=[{attributes:{src:{type:"string",source:"attribute",selector:"audio",attribute:"src"},caption:{type:"string",source:"html",selector:"figcaption"},id:{type:"number"},autoplay:{type:"boolean",source:"attribute",selector:"audio",attribute:"autoplay"},loop:{type:"boolean",source:"attribute",selector:"audio",attribute:"loop"},preload:{type:"string",source:"attribute",selector:"audio",attribute:"preload"}},supports:{align:!0},save({attributes:e}){const{autoplay:t,caption:n,loop:o,preload:r,src:a}=e;return Object(Be.createElement)("figure",null,Object(Be.createElement)("audio",{controls:"controls",src:a,autoPlay:t,loop:o,preload:r}),!Ee.RichText.isEmpty(n)&&Object(Be.createElement)(Ee.RichText.Content,{tagName:"figcaption",value:n}))}}];const go=["audio"];var ho=Object(Ae.withNotices)((function({attributes:e,noticeOperations:t,setAttributes:n,onReplace:o,isSelected:r,noticeUI:a,insertBlocksAfter:c}){const{id:l,autoplay:i,caption:s,loop:u,preload:m,src:d}=e,b=Object(Ee.useBlockProps)(),p=Object(Ke.useSelect)(e=>{const{getSettings:t}=e(Ee.store);return t().mediaUpload},[]);function g(e){return t=>{n({[e]:t})}}function h(e){if(e!==d){const t=mt({attributes:{url:e}});if(void 0!==t)return void o(t);n({src:e,id:void 0})}}function v(e){t.removeAllNotices(),t.createErrorNotice(e)}function O(e){e&&e.url?n({src:e.url,id:e.id}):n({src:void 0,id:void 0})}return Object(Be.useEffect)(()=>{if(!l&&Object(Je.isBlobURL)(d)){const e=Object(Je.getBlobByURL)(d);e&&p({filesList:[e],onFileChange:([{id:e,url:t}])=>{n({id:e,src:t})},onError:e=>{n({src:void 0,id:void 0}),t.createErrorNotice(e)},allowedTypes:go})}},[]),d?Object(Be.createElement)(Be.Fragment,null,Object(Be.createElement)(Ee.BlockControls,{group:"other"},Object(Be.createElement)(Ee.MediaReplaceFlow,{mediaId:l,mediaURL:d,allowedTypes:go,accept:"audio/*",onSelect:O,onSelectURL:h,onError:v})),Object(Be.createElement)(Ee.InspectorControls,null,Object(Be.createElement)(Ae.PanelBody,{title:Object(Se.__)("Audio settings")},Object(Be.createElement)(Ae.ToggleControl,{label:Object(Se.__)("Autoplay"),onChange:g("autoplay"),checked:i,help:function(e){return e?Object(Se.__)("Note: Autoplaying audio may cause usability issues for some visitors."):null}}),Object(Be.createElement)(Ae.ToggleControl,{label:Object(Se.__)("Loop"),onChange:g("loop"),checked:u}),Object(Be.createElement)(Ae.SelectControl,{label:Object(Se.__)("Preload"),value:m||"",onChange:e=>n({preload:e||void 0}),options:[{value:"",label:Object(Se.__)("Browser default")},{value:"auto",label:Object(Se.__)("Auto")},{value:"metadata",label:Object(Se.__)("Metadata")},{value:"none",label:Object(Se.__)("None")}]}))),Object(Be.createElement)("figure",b,Object(Be.createElement)(Ae.Disabled,{isDisabled:!r},Object(Be.createElement)("audio",{controls:"controls",src:d})),(!Ee.RichText.isEmpty(s)||r)&&Object(Be.createElement)(Ee.RichText,{tagName:"figcaption","aria-label":Object(Se.__)("Audio caption text"),placeholder:Object(Se.__)("Add caption"),value:s,onChange:e=>n({caption:e}),inlineToolbar:!0,__unstableOnSplitAtEnd:()=>c(Object(Ce.createBlock)("core/paragraph"))}))):Object(Be.createElement)("div",b,Object(Be.createElement)(Ee.MediaPlaceholder,{icon:Object(Be.createElement)(Ee.BlockIcon,{icon:bo}),onSelect:O,onSelectURL:h,accept:"audio/*",allowedTypes:go,value:e,notices:a,onError:v}))})),vo={from:[{type:"files",isMatch:e=>1===e.length&&0===e[0].type.indexOf("audio/"),transform(e){const t=e[0];return Object(Ce.createBlock)("core/audio",{src:Object(Je.createBlobURL)(t)})}},{type:"shortcode",tag:"audio",attributes:{src:{type:"string",shortcode:({named:{src:e,mp3:t,m4a:n,ogg:o,wav:r,wma:a}})=>e||t||n||o||r||a},loop:{type:"string",shortcode:({named:{loop:e}})=>e},autoplay:{type:"string",shortcode:({named:{autoplay:e}})=>e},preload:{type:"string",shortcode:({named:{preload:e}})=>e}}}]};const Oo={apiVersion:2,name:"core/audio",title:"Audio",category:"media",description:"Embed a simple audio player.",keywords:["music","sound","podcast","recording"],textdomain:"default",attributes:{src:{type:"string",source:"attribute",selector:"audio",attribute:"src"},caption:{type:"string",source:"html",selector:"figcaption"},id:{type:"number"},autoplay:{type:"boolean",source:"attribute",selector:"audio",attribute:"autoplay"},loop:{type:"boolean",source:"attribute",selector:"audio",attribute:"loop"},preload:{type:"string",source:"attribute",selector:"audio",attribute:"preload"}},supports:{anchor:!0,align:!0},editorStyle:"wp-block-audio-editor",style:"wp-block-audio"},{name:jo}=Oo,fo={icon:bo,transforms:vo,deprecated:po,edit:ho,save:function({attributes:e}){const{autoplay:t,caption:n,loop:o,preload:r,src:a}=e;return a&&Object(Be.createElement)("figure",Ee.useBlockProps.save(),Object(Be.createElement)("audio",{controls:"controls",src:a,autoPlay:t,loop:o,preload:r}),!Ee.RichText.isEmpty(n)&&Object(Be.createElement)(Ee.RichText.Content,{tagName:"figcaption",value:n}))}};var yo=Object(Be.createElement)(Te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Be.createElement)(Te.Path,{d:"M17 3H7c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 6c0 .3-.2.5-.5.5H7c-.3 0-.5-.2-.5-.5V5c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v4zm-8-1.2h5V6.2h-5v1.6zM17 13H7c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2v-4c0-1.1-.9-2-2-2zm.5 6c0 .3-.2.5-.5.5H7c-.3 0-.5-.2-.5-.5v-4c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v4zm-8-1.2h5v-1.5h-5v1.5z"})),_o=[{supports:{align:["center","left","right"],anchor:!0},save:()=>Object(Be.createElement)("div",null,Object(Be.createElement)(Ee.InnerBlocks.Content,null)),isEligible:({align:e})=>e&&["center","left","right"].includes(e),migrate:e=>({...e,align:void 0,contentJustification:e.align})}];const{name:wo}={apiVersion:2,name:"core/buttons",title:"Buttons",category:"design",description:"Prompt visitors to take action with a group of button-style links.",keywords:["link"],textdomain:"default",attributes:{contentJustification:{type:"string"},orientation:{type:"string",default:"horizontal"}},supports:{anchor:!0,align:["wide","full"]},editorStyle:"wp-block-buttons-editor",style:"wp-block-buttons"};var ko={from:[{type:"block",isMultiBlock:!0,blocks:["core/button"],transform:e=>Object(Ce.createBlock)(wo,{},e.map(e=>Object(Ce.createBlock)("core/button",e)))},{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>Object(Ce.createBlock)(wo,{},e.map(e=>{const t=document.createElement("div");t.innerHTML=e.content;const n=t.innerText||"",o=t.querySelector("a"),r=null==o?void 0:o.getAttribute("href");return Object(Ce.createBlock)("core/button",{text:n,url:r})})),isMatch:e=>e.every(e=>{const t=document.createElement("div");t.innerHTML=e.content;const n=t.innerText||"",o=t.querySelectorAll("a");return n.length<=30&&o.length<=1})}]},Eo=n(303);const Co=e=>{const{borderRadius:t,...n}=e;return t||0===t?{...n,style:{...n.style,border:{radius:t}}}:n},xo=e=>{if(!e.customTextColor&&!e.customBackgroundColor&&!e.customGradient)return e;const t={color:{}};return e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor),e.customGradient&&(t.color.gradient=e.customGradient),{...Object(xe.omit)(e,["customTextColor","customBackgroundColor","customGradient"]),style:t}},So=e=>xo(Object(xe.omit)({...e,customTextColor:e.textColor&&"#"===e.textColor[0]?e.textColor:void 0,customBackgroundColor:e.color&&"#"===e.color[0]?e.color:void 0},["color","textColor"])),Bo={url:{type:"string",source:"attribute",selector:"a",attribute:"href"},title:{type:"string",source:"attribute",selector:"a",attribute:"title"},text:{type:"string",source:"html",selector:"a"}};var To=[{supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0},reusable:!1,__experimentalSelector:".wp-block-button__link"},attributes:{...Bo,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},style:{type:"object"},width:{type:"number"}},save({attributes:e,className:t}){const{borderRadius:n,linkTarget:o,rel:r,text:a,title:c,url:l,width:i}=e,s=Object(Ee.__experimentalGetColorClassesAndStyles)(e),u=Ne()("wp-block-button__link",s.className,{"no-border-radius":0===n}),m={borderRadius:n?n+"px":void 0,...s.style},d=Ne()(t,{["has-custom-width wp-block-button__width-"+i]:i});return Object(Be.createElement)("div",Ee.useBlockProps.save({className:d}),Object(Be.createElement)(Ee.RichText.Content,{tagName:"a",className:u,href:l,title:c,style:m,value:a,target:o,rel:r}))},migrate:Co},{supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0},reusable:!1,__experimentalSelector:".wp-block-button__link"},attributes:{...Bo,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},style:{type:"object"},width:{type:"number"}},save({attributes:e,className:t}){const{borderRadius:n,linkTarget:o,rel:r,text:a,title:c,url:l,width:i}=e,s=Object(Ee.__experimentalGetColorClassesAndStyles)(e),u=Ne()("wp-block-button__link",s.className,{"no-border-radius":0===n}),m={borderRadius:n?n+"px":void 0,...s.style},d=Ne()(t,{["has-custom-width wp-block-button__width-"+i]:i});return Object(Be.createElement)("div",Ee.useBlockProps.save({className:d}),Object(Be.createElement)(Ee.RichText.Content,{tagName:"a",className:u,href:l,title:c,style:m,value:a,target:o,rel:r}))},migrate:Co},{supports:{align:!0,alignWide:!1,color:{gradients:!0}},attributes:{...Bo,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},style:{type:"object"}},save({attributes:e}){const{borderRadius:t,linkTarget:n,rel:o,text:r,title:a,url:c}=e,l=Ne()("wp-block-button__link",{"no-border-radius":0===t}),i={borderRadius:t?t+"px":void 0};return Object(Be.createElement)(Ee.RichText.Content,{tagName:"a",className:l,href:c,title:a,style:i,value:r,target:n,rel:o})},migrate:Co},{supports:{align:!0,alignWide:!1},attributes:{...Bo,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},customGradient:{type:"string"},gradient:{type:"string"}},isEligible:e=>!!e.customTextColor||!!e.customBackgroundColor||!!e.customGradient,migrate:Object(Ye.compose)(Co,xo),save({attributes:e}){const{backgroundColor:t,borderRadius:n,customBackgroundColor:o,customTextColor:r,customGradient:a,linkTarget:c,gradient:l,rel:i,text:s,textColor:u,title:m,url:d}=e,b=Object(Ee.getColorClassName)("color",u),p=!a&&Object(Ee.getColorClassName)("background-color",t),g=Object(Ee.__experimentalGetGradientClass)(l),h=Ne()("wp-block-button__link",{"has-text-color":u||r,[b]:b,"has-background":t||o||a||l,[p]:p,"no-border-radius":0===n,[g]:g}),v={background:a||void 0,backgroundColor:p||a||l?void 0:o,color:b?void 0:r,borderRadius:n?n+"px":void 0};return Object(Be.createElement)("div",null,Object(Be.createElement)(Ee.RichText.Content,{tagName:"a",className:h,href:d,title:m,style:v,value:s,target:c,rel:i}))}},{attributes:{...Bo,align:{type:"string",default:"none"},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"}},isEligible:e=>e.className&&e.className.includes("is-style-squared"),migrate(e){let t=e.className;return t&&(t=t.replace(/is-style-squared[\s]?/,"").trim()),Co(xo({...e,className:t||void 0,borderRadius:0}))},save({attributes:e}){const{backgroundColor:t,customBackgroundColor:n,customTextColor:o,linkTarget:r,rel:a,text:c,textColor:l,title:i,url:s}=e,u=Object(Ee.getColorClassName)("color",l),m=Object(Ee.getColorClassName)("background-color",t),d=Ne()("wp-block-button__link",{"has-text-color":l||o,[u]:u,"has-background":t||n,[m]:m}),b={backgroundColor:m?void 0:n,color:u?void 0:o};return Object(Be.createElement)("div",null,Object(Be.createElement)(Ee.RichText.Content,{tagName:"a",className:d,href:s,title:i,style:b,value:c,target:r,rel:a}))}},{attributes:{...Bo,align:{type:"string",default:"none"},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"}},migrate:So,save({attributes:e}){const{url:t,text:n,title:o,backgroundColor:r,textColor:a,customBackgroundColor:c,customTextColor:l}=e,i=Object(Ee.getColorClassName)("color",a),s=Object(Ee.getColorClassName)("background-color",r),u=Ne()("wp-block-button__link",{"has-text-color":a||l,[i]:i,"has-background":r||c,[s]:s}),m={backgroundColor:s?void 0:c,color:i?void 0:l};return Object(Be.createElement)("div",null,Object(Be.createElement)(Ee.RichText.Content,{tagName:"a",className:u,href:t,title:o,style:m,value:n}))}},{attributes:{...Bo,color:{type:"string"},textColor:{type:"string"},align:{type:"string",default:"none"}},save({attributes:e}){const{url:t,text:n,title:o,align:r,color:a,textColor:c}=e,l={backgroundColor:a,color:c};return Object(Be.createElement)("div",{className:"align"+r},Object(Be.createElement)(Ee.RichText.Content,{tagName:"a",className:"wp-block-button__link",href:t,title:o,style:l,value:n}))},migrate:So},{attributes:{...Bo,color:{type:"string"},textColor:{type:"string"},align:{type:"string",default:"none"}},save({attributes:e}){const{url:t,text:n,title:o,align:r,color:a,textColor:c}=e;return Object(Be.createElement)("div",{className:"align"+r,style:{backgroundColor:a}},Object(Be.createElement)(Ee.RichText.Content,{tagName:"a",href:t,title:o,style:{color:c},value:n}))},migrate:So}],zo=n(193),Po=n(220);function No({selectedWidth:e,setAttributes:t}){return Object(Be.createElement)(Ae.PanelBody,{title:Object(Se.__)("Width settings")},Object(Be.createElement)(Ae.ButtonGroup,{"aria-label":Object(Se.__)("Button width")},[25,50,75,100].map(n=>Object(Be.createElement)(Ae.Button,{key:n,isSmall:!0,isPrimary:n===e,onClick:()=>{var o;t({width:e===(o=n)?void 0:o})}},n,"%"))))}function Mo({isSelected:e,url:t,setAttributes:n,opensInNewTab:o,onToggleOpenInNewTab:r,anchorRef:a}){const[c,l]=Object(Be.useState)(!1),i=!!t,s=i&&e,u=()=>(l(!0),!1),m=()=>{n({url:void 0,linkTarget:void 0,rel:void 0}),l(!1)},d=(c||s)&&Object(Be.createElement)(Ae.Popover,{position:"bottom center",onClose:()=>l(!1),anchorRef:null==a?void 0:a.current},Object(Be.createElement)(Ee.__experimentalLinkControl,{className:"wp-block-navigation-link__inline-link-input",value:{url:t,opensInNewTab:o},onChange:({url:e="",opensInNewTab:t})=>{n({url:e}),o!==t&&r(t)}}));return Object(Be.createElement)(Be.Fragment,null,Object(Be.createElement)(Ee.BlockControls,{group:"block"},!i&&Object(Be.createElement)(Ae.ToolbarButton,{name:"link",icon:zo.a,title:Object(Se.__)("Link"),shortcut:hn.displayShortcut.primary("k"),onClick:u}),s&&Object(Be.createElement)(Ae.ToolbarButton,{name:"link",icon:Po.a,title:Object(Se.__)("Unlink"),shortcut:hn.displayShortcut.primaryShift("k"),onClick:m,isActive:!0})),e&&Object(Be.createElement)(Ae.KeyboardShortcuts,{bindGlobal:!0,shortcuts:{[hn.rawShortcut.primary("k")]:u,[hn.rawShortcut.primaryShift("k")]:m}}),d)}const Vo={apiVersion:2,name:"core/button",title:"Button",category:"design",parent:["core/buttons"],description:"Prompt visitors to take action with a button-style link.",keywords:["link"],textdomain:"default",attributes:{url:{type:"string",source:"attribute",selector:"a",attribute:"href"},title:{type:"string",source:"attribute",selector:"a",attribute:"title"},text:{type:"string",source:"html",selector:"a"},linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},width:{type:"number"}},supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0,gradients:!0},fontSize:!0,reusable:!1,__experimentalBorder:{radius:!0,__experimentalSkipSerialization:!0},__experimentalFontFamily:!0,__experimentalSelector:".wp-block-button__link"},styles:[{name:"fill",label:"Fill",isDefault:!0},{name:"outline",label:"Outline"}],editorStyle:"wp-block-button-editor",style:"wp-block-button"},{name:Ho}=Vo,Io={icon:Eo.a,example:{attributes:{className:"is-style-fill",backgroundColor:"vivid-green-cyan",text:Object(Se.__)("Call to Action")}},edit:function(e){var t;const{attributes:n,setAttributes:o,className:r,isSelected:a,onReplace:c,mergeBlocks:l}=e,{linkTarget:i,placeholder:s,rel:u,style:m,text:d,url:b,width:p}=n,g=Object(Be.useCallback)(e=>{o({rel:e})},[o]),h=Object(Be.useCallback)(e=>{const t=e?"_blank":void 0;let n=u;t&&!u?n="noreferrer noopener":t||"noreferrer noopener"!==u||(n=void 0),o({linkTarget:t,rel:n})},[u,o]),v=null==m||null===(t=m.border)||void 0===t?void 0:t.radius,O=Object(Ee.__experimentalUseColorProps)(n),j=Object(Be.useRef)(),f=Object(Ee.useBlockProps)({ref:j});return Object(Be.createElement)(Be.Fragment,null,Object(Be.createElement)("div",Object(Re.a)({},f,{className:Ne()(f.className,{["has-custom-width wp-block-button__width-"+p]:p,"has-custom-font-size":f.style.fontSize})}),Object(Be.createElement)(Ee.RichText,{"aria-label":Object(Se.__)("Button text"),placeholder:s||Object(Se.__)("Add text…"),value:d,onChange:e=>{o({text:e.replace(/<\/?a[^>]*>/g,"")})},withoutInteractiveFormatting:!0,className:Ne()(r,"wp-block-button__link",O.className,{"no-border-radius":0===v}),style:{borderRadius:v?v+"px":void 0,...O.style},onSplit:e=>Object(Ce.createBlock)("core/button",{...n,text:e}),onReplace:c,onMerge:l,identifier:"text"})),Object(Be.createElement)(Mo,{url:b,setAttributes:o,isSelected:a,opensInNewTab:"_blank"===i,onToggleOpenInNewTab:h,anchorRef:j}),Object(Be.createElement)(Ee.InspectorControls,null,Object(Be.createElement)(No,{selectedWidth:p,setAttributes:o})),Object(Be.createElement)(Ee.InspectorAdvancedControls,null,Object(Be.createElement)(Ae.TextControl,{label:Object(Se.__)("Link rel"),value:u||"",onChange:g})))},save:function({attributes:e,className:t}){var n,o;const{fontSize:r,linkTarget:a,rel:c,style:l,text:i,title:s,url:u,width:m}=e;if(!i)return null;const d=null==l||null===(n=l.border)||void 0===n?void 0:n.radius,b=Object(Ee.__experimentalGetColorClassesAndStyles)(e),p=Ne()("wp-block-button__link",b.className,{"no-border-radius":0===d}),g={borderRadius:d?d+"px":void 0,...b.style},h=Ne()(t,{["has-custom-width wp-block-button__width-"+m]:m,"has-custom-font-size":r||(null==l||null===(o=l.typography)||void 0===o?void 0:o.fontSize)});return Object(Be.createElement)("div",Ee.useBlockProps.save({className:h}),Object(Be.createElement)(Ee.RichText.Content,{tagName:"a",className:p,href:u,title:s,style:g,value:i,target:a,rel:c}))},deprecated:To,merge:(e,{text:t=""})=>({...e,text:(e.text||"")+t})},Ro=[Ho],Ao=[["core/button"]];var Lo=[{name:"buttons-horizontal",isDefault:!0,title:Object(Se.__)("Horizontal"),description:Object(Se.__)("Buttons shown in a row."),attributes:{orientation:"horizontal"},scope:["transform"]},{name:"buttons-vertical",title:Object(Se.__)("Vertical"),description:Object(Se.__)("Buttons shown in a column."),attributes:{orientation:"vertical"},scope:["transform"]}];const Do={apiVersion:2,name:"core/buttons",title:"Buttons",category:"design",description:"Prompt visitors to take action with a group of button-style links.",keywords:["link"],textdomain:"default",attributes:{contentJustification:{type:"string"},orientation:{type:"string",default:"horizontal"}},supports:{anchor:!0,align:["wide","full"]},editorStyle:"wp-block-buttons-editor",style:"wp-block-buttons"},{name:Fo}=Do,Go={icon:yo,example:{innerBlocks:[{name:"core/button",attributes:{text:Object(Se.__)("Find out more")}},{name:"core/button",attributes:{text:Object(Se.__)("Contact us")}}]},deprecated:_o,transforms:ko,edit:function({attributes:{contentJustification:e,orientation:t},setAttributes:n}){const o=Object(Ee.useBlockProps)({className:Ne()({["is-content-justification-"+e]:e,"is-vertical":"vertical"===t})}),r=Object(Ee.__experimentalUseInnerBlocksProps)(o,{allowedBlocks:Ro,template:Ao,orientation:t,__experimentalLayout:{type:"default",alignments:[]},templateInsertUpdatesSelection:!0}),a="vertical"===t?["left","center","right"]:["left","center","right","space-between"];return Object(Be.createElement)(Be.Fragment,null,Object(Be.createElement)(Ee.BlockControls,{group:"block"},Object(Be.createElement)(Ee.JustifyContentControl,{allowedControls:a,value:e,onChange:e=>n({contentJustification:e}),popoverProps:{position:"bottom right",isAlternate:!0}})),Object(Be.createElement)("div",r))},save:function({attributes:{contentJustification:e,orientation:t}}){return Object(Be.createElement)("div",Ee.useBlockProps.save({className:Ne()({["is-content-justification-"+e]:e,"is-vertical":"vertical"===t})}),Object(Be.createElement)(Ee.InnerBlocks.Content,null))},variations:Lo};var Uo=Object(Be.createElement)(Te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Be.createElement)(Te.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7h15v12zM9 10H7v2h2v-2zm0 4H7v2h2v-2zm4-4h-2v2h2v-2zm4 0h-2v2h2v-2zm-4 4h-2v2h2v-2zm4 0h-2v2h2v-2z"})),qo=n(35),Wo=n.n(qo),$o=n(21);const Zo=it()(e=>{if(!e)return{};const t=Wo()(e);return{year:t.year(),month:t.month()+1}}),Qo={apiVersion:2,name:"core/calendar",title:"Calendar",category:"widgets",description:"A calendar of your site’s posts.",keywords:["posts","archive"],textdomain:"default",attributes:{month:{type:"integer"},year:{type:"integer"}},supports:{align:!0},style:"wp-block-calendar"},{name:Jo}=Qo,Ko={icon:Uo,example:{},edit:function({attributes:e}){const t=Object(Ke.useSelect)(e=>{const{getEditedPostAttribute:t}=e($o.store);return"post"===t("type")?t("date"):void 0},[]);return Object(Be.createElement)("div",Object(Ee.useBlockProps)(),Object(Be.createElement)(Ae.Disabled,null,Object(Be.createElement)(io.a,{block:"core/calendar",attributes:{...e,...Zo(t)}})))}};var Yo=Object(Be.createElement)(Te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Be.createElement)(Te.Path,{d:"M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z",fillRule:"evenodd",clipRule:"evenodd"})),Xo=Object(Be.createElement)(Te.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(Be.createElement)(Te.Path,{d:"M10.44 3.02l1.82-1.82 6.36 6.35-1.83 1.82c-1.05-.68-2.48-.57-3.41.36l-.75.75c-.92.93-1.04 2.35-.35 3.41l-1.83 1.82-2.41-2.41-2.8 2.79c-.42.42-3.38 2.71-3.8 2.29s1.86-3.39 2.28-3.81l2.79-2.79L4.1 9.36l1.83-1.82c1.05.69 2.48.57 3.4-.36l.75-.75c.93-.92 1.05-2.35.36-3.41z"}));const er={apiVersion:2,name:"core/categories",title:"Categories",category:"widgets",description:"Display a list of all categories.",textdomain:"default",attributes:{displayAsDropdown:{type:"boolean",default:!1},showHierarchy:{type:"boolean",default:!1},showPostCounts:{type:"boolean",default:!1}},supports:{align:!0,html:!1},editorStyle:"wp-block-categories-editor",style:"wp-block-categories"},{name:tr}=er,nr={icon:Yo,example:{},edit:function e({attributes:{displayAsDropdown:t,showHierarchy:n,showPostCounts:o},setAttributes:r}){const a=Object(Ye.useInstanceId)(e,"blocks-category-select"),{categories:c,isRequesting:l}=Object(Ke.useSelect)(e=>{const{getEntityRecords:t}=e(ke.store),{isResolving:n}=e("core/data"),o={per_page:-1,hide_empty:!0};return{categories:t("taxonomy","category",o),isRequesting:n("core","getEntityRecords",["taxonomy","category",o])}},[]),i=e=>null!=c&&c.length?null===e?c:c.filter(({parent:t})=>t===e):[],s=e=>"wp-block-categories__list wp-block-categories__list-level-"+e,u=e=>t=>r({[e]:t}),m=e=>e?Object(xe.unescape)(e).trim():Object(Se.__)("(Untitled)"),d=(e,t)=>{const r=i(e.id),{id:a,link:c,count:l,name:u}=e;return Object(Be.createElement)("li",{key:a},Object(Be.createElement)("a",{href:c,target:"_blank",rel:"noreferrer noopener"},m(u)),o&&Object(Be.createElement)("span",{className:"wp-block-categories__post-count"},` (${l})`),n&&!!r.length&&Object(Be.createElement)("ul",{className:s(t+1)},r.map(e=>d(e,t+1))))},b=(e,t)=>{const{id:r,count:a,name:c}=e,l=i(r);return[Object(Be.createElement)("option",{key:r},Object(xe.times)(3*t,()=>" "),m(c),o&&` (${a})`),n&&!!l.length&&l.map(e=>b(e,t+1))]};return Object(Be.createElement)("div",Object(Ee.useBlockProps)(),Object(Be.createElement)(Ee.InspectorControls,null,Object(Be.createElement)(Ae.PanelBody,{title:Object(Se.__)("Categories settings")},Object(Be.createElement)(Ae.ToggleControl,{label:Object(Se.__)("Display as dropdown"),checked:t,onChange:u("displayAsDropdown")}),Object(Be.createElement)(Ae.ToggleControl,{label:Object(Se.__)("Show hierarchy"),checked:n,onChange:u("showHierarchy")}),Object(Be.createElement)(Ae.ToggleControl,{label:Object(Se.__)("Show post counts"),checked:o,onChange:u("showPostCounts")}))),l&&Object(Be.createElement)(Ae.Placeholder,{icon:Xo,label:Object(Se.__)("Categories")},Object(Be.createElement)(Ae.Spinner,null)),!l&&0===c.length&&Object(Be.createElement)("p",null,Object(Se.__)("Your site does not have any posts, so there is nothing to display here at the moment.")),!l&&c.length>0&&(t?(()=>{const e=i(n?0:null);return Object(Be.createElement)(Be.Fragment,null,Object(Be.createElement)(Ae.VisuallyHidden,{as:"label",htmlFor:a},Object(Se.__)("Categories")),Object(Be.createElement)("select",{id:a,className:"wp-block-categories__dropdown"},e.map(e=>b(e,0))))})():(()=>{const e=i(n?0:null);return Object(Be.createElement)("ul",{className:s(0)},e.map(e=>d(e,0)))})()))}};var or=n(304);function rr(e){return e.replace(/\[/g,"&#91;")}function ar(e){return e.replace(/^(\s*https?:)\/\/([^\s<>"]+\s*)$/m,"$1&#47;&#47;$2")}var cr={from:[{type:"enter",regExp:/^```$/,transform:()=>Object(Ce.createBlock)("core/code")},{type:"block",blocks:["core/html"],transform:({content:e})=>Object(Ce.createBlock)("core/code",{content:e})},{type:"raw",isMatch:e=>"PRE"===e.nodeName&&1===e.children.length&&"CODE"===e.firstChild.nodeName,schema:{pre:{children:{code:{children:{"#text":{}}}}}}}]};const lr={apiVersion:2,name:"core/code",title:"Code",category:"text",description:"Display code snippets that respect your spacing and tabs.",textdomain:"default",attributes:{content:{type:"string",source:"html",selector:"code"}},supports:{anchor:!0,fontSize:!0},style:"wp-block-code"},{name:ir}=lr,sr={icon:or.a,example:{attributes:{
17
  // translators: Preserve \n markers for line breaks
18
  content:Object(Se.__)('// A "block" is the abstract term used\n// to describe units of markup that\n// when composed together, form the\n// content or layout of a page.\nregisterBlockType( name, settings );')}},transforms:cr,edit:function({attributes:e,setAttributes:t,onRemove:n}){const o=Object(Ee.useBlockProps)();return Object(Be.createElement)("pre",o,Object(Be.createElement)(Ee.RichText,{tagName:"code",value:e.content,onChange:e=>t({content:e}),onRemove:n,placeholder:Object(Se.__)("Write code…"),"aria-label":Object(Se.__)("Code"),preserveWhiteSpace:!0,__unstablePastePlainText:!0}))},save:function({attributes:e}){return Object(Be.createElement)("pre",Ee.useBlockProps.save(),Object(Be.createElement)(Ee.RichText.Content,{tagName:"code",value:(t=e.content,Object(xe.flow)(rr,ar)(t||""))}));var t}};var ur=Object(Be.createElement)(Te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Be.createElement)(Te.Path,{d:"M19 6H6c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm-4.1 1.5v10H10v-10h4.9zM5.5 17V8c0-.3.2-.5.5-.5h2.5v10H6c-.3 0-.5-.2-.5-.5zm14 0c0 .3-.2.5-.5.5h-2.6v-10H19c.3 0 .5.2.5.5v9z"}));function mr(e){let t,{doc:n}=mr;n||(n=document.implementation.createHTMLDocument(""),mr.doc=n),n.body.innerHTML=e;for(const e of n.body.firstChild.classList)if(t=e.match(/^layout-column-(\d+)$/))return Number(t[1])-1}var dr=[{attributes:{verticalAlignment:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>{if(!e.customTextColor&&!e.customBackgroundColor)return e;const t={color:{}};return e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor),{...Object(xe.omit)(e,["customTextColor","customBackgroundColor"]),style:t}},save({attributes:e}){const{verticalAlignment:t,backgroundColor:n,customBackgroundColor:o,textColor:r,customTextColor:a}=e,c=Object(Ee.getColorClassName)("background-color",n),l=Object(Ee.getColorClassName)("color",r),i=Ne()({"has-background":n||o,"has-text-color":r||a,[c]:c,[l]:l,["are-vertically-aligned-"+t]:t}),s={backgroundColor:c?void 0:o,color:l?void 0:a};return Object(Be.createElement)("div",{className:i||void 0,style:s},Object(Be.createElement)(Ee.InnerBlocks.Content,null))}},{attributes:{columns:{type:"number",default:2}},isEligible:(e,t)=>!!t.some(e=>/layout-column-\d+/.test(e.originalContent))&&t.some(e=>void 0!==mr(e.originalContent)),migrate(e,t){const n=t.reduce((e,t)=>{const{originalContent:n}=t;let o=mr(n);return void 0===o&&(o=0),e[o]||(e[o]=[]),e[o].push(t),e},[]).map(e=>Object(Ce.createBlock)("core/column",{},e));return[Object(xe.omit)(e,["columns"]),n]},save({attributes:e}){const{columns:t}=e;return Object(Be.createElement)("div",{className:`has-${t}-columns`},Object(Be.createElement)(Ee.InnerBlocks.Content,null))}},{attributes:{columns:{type:"number",default:2}},migrate:(e,t)=>[e=Object(xe.omit)(e,["columns"]),t],save({attributes:e}){const{verticalAlignment:t,columns:n}=e,o=Ne()(`has-${n}-columns`,{["are-vertically-aligned-"+t]:t});return Object(Be.createElement)("div",{className:o},Object(Be.createElement)(Ee.InnerBlocks.Content,null))}}];const br=e=>{const t=parseFloat(e);return Number.isFinite(t)?parseFloat(t.toFixed(2)):void 0};function pr(e,t){const{width:n=100/t}=e.attributes;return br(n)}function gr(e,t,n=e.length){const o=function(e,t=e.length){return Object(xe.sumBy)(e,e=>pr(e,t))}(e,n);return Object(xe.mapValues)(function(e,t=e.length){return e.reduce((e,n)=>{const o=pr(n,t);return Object.assign(e,{[n.clientId]:o})},{})}(e,n),e=>br(t*e/o))}function hr(e,t){return e.map(e=>Object(xe.merge)({},e,{attributes:{width:t[e.clientId]}}))}const vr="web"===Be.Platform.OS,Or=[{value:"%",label:vr?"%":Object(Se.__)("Percentage (%)"),default:""},{value:"px",label:vr?"px":Object(Se.__)("Pixels (px)"),default:""},{value:"em",label:vr?"em":Object(Se.__)("Relative to parent font size (em)"),default:""},{value:"rem",label:vr?"rem":Object(Se.__)("Relative to root font size (rem)"),default:""},{value:"vw",label:vr?"vw":Object(Se.__)("Viewport width (vw)"),default:""}],jr=["core/column"],fr=Object(Ke.withDispatch)((e,t,n)=>({updateAlignment(o){const{clientId:r,setAttributes:a}=t,{updateBlockAttributes:c}=e(Ee.store),{getBlockOrder:l}=n.select(Ee.store);a({verticalAlignment:o}),l(r).forEach(e=>{c(e,{verticalAlignment:o})})},updateColumns(o,r){const{clientId:a}=t,{replaceInnerBlocks:c}=e(Ee.store),{getBlocks:l}=n.select(Ee.store);let i=l(a);const s=i.every(e=>{var t;const n=e.attributes.width;return Number.isFinite(null!=n&&null!==(t=n.endsWith)&&void 0!==t&&t.call(n,"%")?parseFloat(n):n)}),u=r>o;if(u&&s){const e=br(100/r);i=[...hr(i,gr(i,100-e)),...Object(xe.times)(r-o,()=>Object(Ce.createBlock)("core/column",{width:e}))]}else u?i=[...i,...Object(xe.times)(r-o,()=>Object(Ce.createBlock)("core/column"))]:(i=Object(xe.dropRight)(i,o-r),s&&(i=hr(i,gr(i,100))));c(a,i)}}))((function({attributes:e,updateAlignment:t,updateColumns:n,clientId:o}){const{verticalAlignment:r}=e,{count:a}=Object(Ke.useSelect)(e=>({count:e(Ee.store).getBlockCount(o)}),[o]),c=Ne()({["are-vertically-aligned-"+r]:r}),l=Object(Ee.useBlockProps)({className:c}),i=Object(Ee.__experimentalUseInnerBlocksProps)(l,{allowedBlocks:jr,orientation:"horizontal",renderAppender:!1});return Object(Be.createElement)(Be.Fragment,null,Object(Be.createElement)(Ee.BlockControls,null,Object(Be.createElement)(Ee.BlockVerticalAlignmentToolbar,{onChange:t,value:r})),Object(Be.createElement)(Ee.InspectorControls,null,Object(Be.createElement)(Ae.PanelBody,null,Object(Be.createElement)(Ae.RangeControl,{label:Object(Se.__)("Columns"),value:a,onChange:e=>n(a,e),min:1,max:Math.max(6,a)}),a>6&&Object(Be.createElement)(Ae.Notice,{status:"warning",isDismissible:!1},Object(Se.__)("This column count exceeds the recommended amount and may cause visual breakage.")))),Object(Be.createElement)("div",i))}));function yr({clientId:e,name:t,setAttributes:n}){const{blockType:o,defaultVariation:r,variations:a}=Object(Ke.useSelect)(e=>{const{getBlockVariations:n,getBlockType:o,getDefaultBlockVariation:r}=e(Ce.store);return{blockType:o(t),defaultVariation:r(t,"block"),variations:n(t,"block")}},[t]),{replaceInnerBlocks:c}=Object(Ke.useDispatch)(Ee.store),l=Object(Ee.useBlockProps)();return Object(Be.createElement)("div",l,Object(Be.createElement)(Ee.__experimentalBlockVariationPicker,{icon:Object(xe.get)(o,["icon","src"]),label:Object(xe.get)(o,["title"]),variations:a,onSelect:(t=r)=>{t.attributes&&n(t.attributes),t.innerBlocks&&c(e,Object(Ce.createBlocksFromInnerBlocksTemplate)(t.innerBlocks),!0)},allowSkip:!0}))}var _r=[{name:"one-column-full",title:Object(Se.__)("100"),description:Object(Se.__)("One column"),icon:Object(Be.createElement)(Ae.SVG,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},Object(Be.createElement)(Ae.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"m39.0625 14h-30.0625v20.0938h30.0625zm-30.0625-2c-1.10457 0-2 .8954-2 2v20.0938c0 1.1045.89543 2 2 2h30.0625c1.1046 0 2-.8955 2-2v-20.0938c0-1.1046-.8954-2-2-2z"})),innerBlocks:[["core/column"]],scope:["block"]},{name:"two-columns-equal",title:Object(Se.__)("50 / 50"),description:Object(Se.__)("Two columns; equal split"),icon:Object(Be.createElement)(Ae.SVG,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},Object(Be.createElement)(Ae.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H25V34H39ZM23 34H9V14H23V34Z"})),isDefault:!0,innerBlocks:[["core/column"],["core/column"]],scope:["block"]},{name:"two-columns-one-third-two-thirds",title:Object(Se.__)("30 / 70"),description:Object(Se.__)("Two columns; one-third, two-thirds split"),icon:Object(Be.createElement)(Ae.SVG,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},Object(Be.createElement)(Ae.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H20V34H39ZM18 34H9V14H18V34Z"})),innerBlocks:[["core/column",{width:"33.33%"}],["core/column",{width:"66.66%"}]],scope:["block"]},{name:"two-columns-two-thirds-one-third",title:Object(Se.__)("70 / 30"),description:Object(Se.__)("Two columns; two-thirds, one-third split"),icon:Object(Be.createElement)(Ae.SVG,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},Object(Be.createElement)(Ae.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H30V34H39ZM28 34H9V14H28V34Z"})),innerBlocks:[["core/column",{width:"66.66%"}],["core/column",{width:"33.33%"}]],scope:["block"]},{name:"three-columns-equal",title:Object(Se.__)("33 / 33 / 33"),description:Object(Se.__)("Three columns; equal split"),icon:Object(Be.createElement)(Ae.SVG,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},Object(Be.createElement)(Ae.Path,{fillRule:"evenodd",d:"M41 14a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h30a2 2 0 0 0 2-2V14zM28.5 34h-9V14h9v20zm2 0V14H39v20h-8.5zm-13 0H9V14h8.5v20z"})),innerBlocks:[["core/column"],["core/column"],["core/column"]],scope:["block"]},{name:"three-columns-wider-center",title:Object(Se.__)("25 / 50 / 25"),description:Object(Se.__)("Three columns; wide center column"),icon:Object(Be.createElement)(Ae.SVG,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},Object(Be.createElement)(Ae.Path,{fillRule:"evenodd",d:"M41 14a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h30a2 2 0 0 0 2-2V14zM31 34H17V14h14v20zm2 0V14h6v20h-6zm-18 0H9V14h6v20z"})),innerBlocks:[["core/column",{width:"25%"}],["core/column",{width:"50%"}],["core/column",{width:"25%"}]],scope:["block"]}],wr={from:[{type:"block",isMultiBlock:!0,blocks:["*"],__experimentalConvert:e=>{const t=+(100/e.length).toFixed(2),n=e.map(({name:e,attributes:n,innerBlocks:o})=>["core/column",{width:t+"%"},[[e,{...n},o]]]);return Object(Ce.createBlock)("core/columns",{},Object(Ce.createBlocksFromInnerBlocksTemplate)(n))},isMatch:({length:e})=>e&&e<=6},{type:"block",blocks:["core/media-text"],priority:1,transform:(e,t)=>{const{align:n,backgroundColor:o,textColor:r,style:a,mediaAlt:c,mediaId:l,mediaPosition:i,mediaSizeSlug:s,mediaType:u,mediaUrl:m,mediaWidth:d,verticalAlignment:b}=e;let p;p="image"!==u&&u?["core/video",{id:l,src:m}]:["core/image",{id:l,alt:c,url:m,sizeSlug:s,href:e.href,linkClass:e.linkClass,linkDestination:e.linkDestination,linkTarget:e.linkTarget,rel:e.rel}];const g=[["core/column",{width:d+"%"},[p]],["core/column",{width:100-d+"%"},t]];return"right"===i&&g.reverse(),Object(Ce.createBlock)("core/columns",{align:n,backgroundColor:o,textColor:r,style:a,verticalAlignment:b},Object(Ce.createBlocksFromInnerBlocksTemplate)(g))}}]};const kr={apiVersion:2,name:"core/columns",title:"Columns",category:"design",description:"Add a block that displays content in multiple columns, then add whatever content blocks you’d like.",textdomain:"default",attributes:{verticalAlignment:{type:"string"}},supports:{anchor:!0,align:["wide","full"],html:!1,color:{gradients:!0,link:!0}},editorStyle:"wp-block-columns-editor",style:"wp-block-columns"},{name:Er}=kr,Cr={icon:ur,variations:_r,example:{innerBlocks:[{name:"core/column",innerBlocks:[{name:"core/paragraph",attributes:{
19
  /* translators: example text. */
13
  Object(Se.__)("Add quote"),onReplace:r,onSplit:t=>Object(Ce.createBlock)("core/quote",{...e,value:t}),__unstableOnSplitMiddle:()=>Object(Ce.createBlock)("core/paragraph"),textAlign:i}),(!Ee.RichText.isEmpty(u)||n)&&Object(Be.createElement)(Ee.RichText,{identifier:"citation",tagName:Tn?"cite":void 0,style:{display:"block"},value:u,onChange:e=>t({citation:e}),__unstableMobileNoFocusOnMount:!0,"aria-label":Object(Se.__)("Quote citation text"),placeholder:// translators: placeholder text used for the citation
14
  Object(Se.__)("Add citation"),className:"wp-block-quote__citation",textAlign:i,__unstableOnSplitAtEnd:()=>c(Object(Ce.createBlock)("core/paragraph"))})))},save:function({attributes:e}){const{align:t,value:n,citation:o}=e,r=Ne()({["has-text-align-"+t]:t});return Object(Be.createElement)("blockquote",Ee.useBlockProps.save({className:r}),Object(Be.createElement)(Ee.RichText.Content,{multiline:!0,value:n}),!Ee.RichText.isEmpty(o)&&Object(Be.createElement)(Ee.RichText.Content,{tagName:"cite",value:o}))},merge:(e,{value:t,citation:n})=>(n||(n=e.citation),t&&"<p></p>"!==t?{...e,value:e.value+t,citation:n}:{...e,citation:n}),deprecated:Bn};var Hn=Object(Be.createElement)(Te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Be.createElement)(Te.Path,{d:"M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8h-1.5zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zM4.5 4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1V12l-2.3-1.7c-.3-.2-.6-.2-.9 0l-2.9 2.1L8 11.3c-.2-.1-.5-.1-.7 0l-2.9 1.5V4.6zm0 11.8v-1.8l3.2-1.7 2.4 1.2c.2.1.5.1.8-.1l2.8-2 2.8 2v2.5c0 .1-.1.1-.1.1H4.6c0-.1-.1-.2-.1-.2z"}));function In(e){return Math.min(3,e.images.length)}const Rn=(e,t="large")=>{const n=Object(xe.pick)(e,["alt","id","link","caption"]);n.url=Object(xe.get)(e,["sizes",t,"url"])||Object(xe.get)(e,["media_details","sizes",t,"source_url"])||e.url;const o=Object(xe.get)(e,["sizes","full","url"])||Object(xe.get)(e,["media_details","sizes","full","source_url"]);return o&&(n.fullUrl=o),n};var An=[{attributes:{images:{type:"array",default:[],source:"query",selector:".blocks-gallery-item",query:{url:{type:"string",source:"attribute",selector:"img",attribute:"src"},fullUrl:{type:"string",source:"attribute",selector:"img",attribute:"data-full-url"},link:{type:"string",source:"attribute",selector:"img",attribute:"data-link"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},id:{type:"string",source:"attribute",selector:"img",attribute:"data-id"},caption:{type:"string",source:"html",selector:".blocks-gallery-item__caption"}}},ids:{type:"array",items:{type:"number"},default:[]},columns:{type:"number",minimum:1,maximum:8},caption:{type:"string",source:"html",selector:".blocks-gallery-caption"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"},sizeSlug:{type:"string",default:"large"}},supports:{align:!0},isEligible:({linkTo:e})=>!e||"attachment"===e||"media"===e,migrate(e){let t=e.linkTo;return e.linkTo?"attachment"===e.linkTo?t="post":"media"===e.linkTo&&(t="file"):t="none",{...e,linkTo:t}},save({attributes:e}){const{images:t,columns:n=In(e),imageCrop:o,caption:r,linkTo:a}=e;return Object(Be.createElement)("figure",{className:`columns-${n} ${o?"is-cropped":""}`},Object(Be.createElement)("ul",{className:"blocks-gallery-grid"},t.map(e=>{let t;switch(a){case"media":t=e.fullUrl||e.url;break;case"attachment":t=e.link}const n=Object(Be.createElement)("img",{src:e.url,alt:e.alt,"data-id":e.id,"data-full-url":e.fullUrl,"data-link":e.link,className:e.id?"wp-image-"+e.id:null});return Object(Be.createElement)("li",{key:e.id||e.url,className:"blocks-gallery-item"},Object(Be.createElement)("figure",null,t?Object(Be.createElement)("a",{href:t},n):n,!Ee.RichText.isEmpty(e.caption)&&Object(Be.createElement)(Ee.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-item__caption",value:e.caption})))})),!Ee.RichText.isEmpty(r)&&Object(Be.createElement)(Ee.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-caption",value:r}))}},{attributes:{images:{type:"array",default:[],source:"query",selector:".blocks-gallery-item",query:{url:{source:"attribute",selector:"img",attribute:"src"},fullUrl:{source:"attribute",selector:"img",attribute:"data-full-url"},link:{source:"attribute",selector:"img",attribute:"data-link"},alt:{source:"attribute",selector:"img",attribute:"alt",default:""},id:{source:"attribute",selector:"img",attribute:"data-id"},caption:{type:"string",source:"html",selector:".blocks-gallery-item__caption"}}},ids:{type:"array",default:[]},columns:{type:"number"},caption:{type:"string",source:"html",selector:".blocks-gallery-caption"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"}},supports:{align:!0},isEligible:({ids:e})=>e&&e.some(e=>"string"==typeof e),migrate:e=>({...e,ids:Object(xe.map)(e.ids,e=>{const t=parseInt(e,10);return Number.isInteger(t)?t:null})}),save({attributes:e}){const{images:t,columns:n=In(e),imageCrop:o,caption:r,linkTo:a}=e;return Object(Be.createElement)("figure",{className:`columns-${n} ${o?"is-cropped":""}`},Object(Be.createElement)("ul",{className:"blocks-gallery-grid"},t.map(e=>{let t;switch(a){case"media":t=e.fullUrl||e.url;break;case"attachment":t=e.link}const n=Object(Be.createElement)("img",{src:e.url,alt:e.alt,"data-id":e.id,"data-full-url":e.fullUrl,"data-link":e.link,className:e.id?"wp-image-"+e.id:null});return Object(Be.createElement)("li",{key:e.id||e.url,className:"blocks-gallery-item"},Object(Be.createElement)("figure",null,t?Object(Be.createElement)("a",{href:t},n):n,!Ee.RichText.isEmpty(e.caption)&&Object(Be.createElement)(Ee.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-item__caption",value:e.caption})))})),!Ee.RichText.isEmpty(r)&&Object(Be.createElement)(Ee.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-caption",value:r}))}},{attributes:{images:{type:"array",default:[],source:"query",selector:"ul.wp-block-gallery .blocks-gallery-item",query:{url:{source:"attribute",selector:"img",attribute:"src"},fullUrl:{source:"attribute",selector:"img",attribute:"data-full-url"},alt:{source:"attribute",selector:"img",attribute:"alt",default:""},id:{source:"attribute",selector:"img",attribute:"data-id"},link:{source:"attribute",selector:"img",attribute:"data-link"},caption:{type:"array",source:"children",selector:"figcaption"}}},ids:{type:"array",default:[]},columns:{type:"number"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"}},supports:{align:!0},save({attributes:e}){const{images:t,columns:n=In(e),imageCrop:o,linkTo:r}=e;return Object(Be.createElement)("ul",{className:`columns-${n} ${o?"is-cropped":""}`},t.map(e=>{let t;switch(r){case"media":t=e.fullUrl||e.url;break;case"attachment":t=e.link}const n=Object(Be.createElement)("img",{src:e.url,alt:e.alt,"data-id":e.id,"data-full-url":e.fullUrl,"data-link":e.link,className:e.id?"wp-image-"+e.id:null});return Object(Be.createElement)("li",{key:e.id||e.url,className:"blocks-gallery-item"},Object(Be.createElement)("figure",null,t?Object(Be.createElement)("a",{href:t},n):n,e.caption&&e.caption.length>0&&Object(Be.createElement)(Ee.RichText.Content,{tagName:"figcaption",value:e.caption})))}))}},{attributes:{images:{type:"array",default:[],source:"query",selector:"ul.wp-block-gallery .blocks-gallery-item",query:{url:{source:"attribute",selector:"img",attribute:"src"},alt:{source:"attribute",selector:"img",attribute:"alt",default:""},id:{source:"attribute",selector:"img",attribute:"data-id"},link:{source:"attribute",selector:"img",attribute:"data-link"},caption:{type:"array",source:"children",selector:"figcaption"}}},columns:{type:"number"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"}},isEligible:({images:e,ids:t})=>e&&e.length>0&&(!t&&e||t&&e&&t.length!==e.length||Object(xe.some)(e,(e,n)=>!e&&null!==t[n]||parseInt(e,10)!==t[n])),migrate:e=>({...e,ids:Object(xe.map)(e.images,({id:e})=>e?parseInt(e,10):null)}),supports:{align:!0},save({attributes:e}){const{images:t,columns:n=In(e),imageCrop:o,linkTo:r}=e;return Object(Be.createElement)("ul",{className:`columns-${n} ${o?"is-cropped":""}`},t.map(e=>{let t;switch(r){case"media":t=e.url;break;case"attachment":t=e.link}const n=Object(Be.createElement)("img",{src:e.url,alt:e.alt,"data-id":e.id,"data-link":e.link,className:e.id?"wp-image-"+e.id:null});return Object(Be.createElement)("li",{key:e.id||e.url,className:"blocks-gallery-item"},Object(Be.createElement)("figure",null,t?Object(Be.createElement)("a",{href:t},n):n,e.caption&&e.caption.length>0&&Object(Be.createElement)(Ee.RichText.Content,{tagName:"figcaption",value:e.caption})))}))}},{attributes:{images:{type:"array",default:[],source:"query",selector:"div.wp-block-gallery figure.blocks-gallery-image img",query:{url:{source:"attribute",attribute:"src"},alt:{source:"attribute",attribute:"alt",default:""},id:{source:"attribute",attribute:"data-id"}}},columns:{type:"number"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"},align:{type:"string",default:"none"}},supports:{align:!0},save({attributes:e}){const{images:t,columns:n=In(e),align:o,imageCrop:r,linkTo:a}=e,c=Ne()("columns-"+n,{alignnone:"none"===o,"is-cropped":r});return Object(Be.createElement)("div",{className:c},t.map(e=>{let t;switch(a){case"media":t=e.url;break;case"attachment":t=e.link}const n=Object(Be.createElement)("img",{src:e.url,alt:e.alt,"data-id":e.id});return Object(Be.createElement)("figure",{key:e.id||e.url,className:"blocks-gallery-image"},t?Object(Be.createElement)("a",{href:t},n):n)}))}}],Ln=n(57);const Dn=Object(Be.createElement)(Ee.BlockIcon,{icon:Hn});var Fn=n(215),Gn=n(214),Un=n(202),qn=n(100);class Wn extends Be.Component{constructor(){super(...arguments),this.onSelectImage=this.onSelectImage.bind(this),this.onSelectCaption=this.onSelectCaption.bind(this),this.onRemoveImage=this.onRemoveImage.bind(this),this.bindContainer=this.bindContainer.bind(this),this.onEdit=this.onEdit.bind(this),this.onSelectImageFromLibrary=this.onSelectImageFromLibrary.bind(this),this.onSelectCustomURL=this.onSelectCustomURL.bind(this),this.state={captionSelected:!1,isEditing:!1}}bindContainer(e){this.container=e}onSelectCaption(){this.state.captionSelected||this.setState({captionSelected:!0}),this.props.isSelected||this.props.onSelect()}onSelectImage(){this.props.isSelected||this.props.onSelect(),this.state.captionSelected&&this.setState({captionSelected:!1})}onRemoveImage(e){this.container===this.container.ownerDocument.activeElement&&this.props.isSelected&&-1!==[hn.BACKSPACE,hn.DELETE].indexOf(e.keyCode)&&(e.stopPropagation(),e.preventDefault(),this.props.onRemove())}onEdit(){this.setState({isEditing:!0})}componentDidUpdate(e){const{isSelected:t,image:n,url:o,__unstableMarkNextChangeAsNotPersistent:r}=this.props;n&&!o&&(r(),this.props.setAttributes({url:n.source_url,alt:n.alt_text})),this.state.captionSelected&&!t&&e.isSelected&&this.setState({captionSelected:!1})}deselectOnBlur(){this.props.onDeselect()}onSelectImageFromLibrary(e){const{setAttributes:t,id:n,url:o,alt:r,caption:a,sizeSlug:c}=this.props;if(!e||!e.url)return;let l=Rn(e,c);((e,t)=>!e&&Object(Je.isBlobURL)(t))(n,o)&&r&&(l=Object(xe.omit)(l,["alt"])),a&&!Object(xe.get)(l,["caption"])&&(l=Object(xe.omit)(l,["caption"])),t(l),this.setState({isEditing:!1})}onSelectCustomURL(e){const{setAttributes:t,url:n}=this.props;e!==n&&(t({url:e,id:void 0}),this.setState({isEditing:!1}))}render(){const{url:e,alt:t,id:n,linkTo:o,link:r,isFirstItem:a,isLastItem:c,isSelected:l,caption:i,onRemove:s,onMoveForward:u,onMoveBackward:m,setAttributes:d,"aria-label":b}=this.props,{isEditing:p}=this.state;let g;switch(o){case"file":g=e;break;case"post":g=r}const h=Object(Be.createElement)(Be.Fragment,null,Object(Be.createElement)("img",{src:e,alt:t,"data-id":n,onClick:this.onSelectImage,onFocus:this.onSelectImage,onKeyDown:this.onRemoveImage,tabIndex:"0","aria-label":b,ref:this.bindContainer}),Object(Je.isBlobURL)(e)&&Object(Be.createElement)(Ae.Spinner,null)),v=Ne()({"is-selected":l,"is-transient":Object(Je.isBlobURL)(e)});return Object(Be.createElement)("figure",{className:v},!p&&(g?Object(Be.createElement)("a",{href:g},h):h),p&&Object(Be.createElement)(Ee.MediaPlaceholder,{labels:{title:Object(Se.__)("Edit gallery image")},icon:$e,onSelect:this.onSelectImageFromLibrary,onSelectURL:this.onSelectCustomURL,accept:"image/*",allowedTypes:["image"],value:{id:n,src:e}}),Object(Be.createElement)(Ae.ButtonGroup,{className:"block-library-gallery-item__inline-menu is-left"},Object(Be.createElement)(Ae.Button,{icon:Fn.a,onClick:a?void 0:m,label:Object(Se.__)("Move image backward"),"aria-disabled":a,disabled:!l}),Object(Be.createElement)(Ae.Button,{icon:Gn.a,onClick:c?void 0:u,label:Object(Se.__)("Move image forward"),"aria-disabled":c,disabled:!l})),Object(Be.createElement)(Ae.ButtonGroup,{className:"block-library-gallery-item__inline-menu is-right"},Object(Be.createElement)(Ae.Button,{icon:Un.a,onClick:this.onEdit,label:Object(Se.__)("Replace image"),disabled:!l}),Object(Be.createElement)(Ae.Button,{icon:qn.a,onClick:s,label:Object(Se.__)("Remove image"),disabled:!l})),!p&&(l||i)&&Object(Be.createElement)(Ee.RichText,{tagName:"figcaption","aria-label":Object(Se.__)("Image caption text"),placeholder:l?Object(Se.__)("Add caption"):null,value:i,isSelected:this.state.captionSelected,onChange:e=>d({caption:e}),unstableOnFocus:this.onSelectCaption,inlineToolbar:!0}))}}var $n=Object(Ye.compose)([Object(Ke.withSelect)((e,t)=>{const{getMedia:n}=e(ke.store),{id:o}=t;return{image:o?n(parseInt(o,10)):null}}),Object(Ke.withDispatch)(e=>{const{__unstableMarkNextChangeAsNotPersistent:t}=e(Ee.store);return{__unstableMarkNextChangeAsNotPersistent:t}})])(Wn);function Zn({isHidden:e,...t}){return e?Object(Be.createElement)(Ae.VisuallyHidden,Object(Re.a)({as:Ee.RichText},t)):Object(Be.createElement)(Ee.RichText,t)}var Qn=e=>{const{attributes:t,isSelected:n,setAttributes:o,selectedImage:r,mediaPlaceholder:a,onMoveBackward:c,onMoveForward:l,onRemoveImage:i,onSelectImage:s,onDeselectImage:u,onSetImageAttributes:m,onFocusGalleryCaption:d,insertBlocksAfter:b,blockProps:p}=e,{align:g,columns:h=In(t),caption:v,imageCrop:O,images:j}=t;return Object(Be.createElement)("figure",Object(Re.a)({},p,{className:Ne()(p.className,{["align"+g]:g,["columns-"+h]:h,"is-cropped":O})}),Object(Be.createElement)("ul",{className:"blocks-gallery-grid"},j.map((e,o)=>{const a=Object(Se.sprintf)(
15
  /* translators: 1: the order number of the image. 2: the total number of images. */
16
+ Object(Se.__)("image %1$d of %2$d in gallery"),o+1,j.length);return Object(Be.createElement)("li",{className:"blocks-gallery-item",key:e.id||e.url},Object(Be.createElement)($n,{url:e.url,alt:e.alt,id:e.id,isFirstItem:0===o,isLastItem:o+1===j.length,isSelected:n&&r===o,onMoveBackward:c(o),onMoveForward:l(o),onRemove:i(o),onSelect:s(o),onDeselect:u(o),setAttributes:e=>m(o,e),caption:e.caption,"aria-label":a,sizeSlug:t.sizeSlug}))})),a,Object(Be.createElement)(Zn,{isHidden:!n&&Ee.RichText.isEmpty(v),tagName:"figcaption",className:"blocks-gallery-caption","aria-label":Object(Se.__)("Gallery caption text"),placeholder:Object(Se.__)("Write gallery caption…"),value:v,unstableOnFocus:d,onChange:e=>o({caption:e}),inlineToolbar:!0,__unstableOnSplitAtEnd:()=>b(Object(Ce.createBlock)("core/paragraph"))}))};const Jn=[{value:"post",label:Object(Se.__)("Attachment Page")},{value:"file",label:Object(Se.__)("Media File")},{value:"none",label:Object(Se.__)("None")}],Kn=["image"],Yn=Be.Platform.select({web:Object(Se.__)("Drag images, upload new ones or select files from your library."),native:Object(Se.__)("ADD MEDIA")}),Xn=Be.Platform.select({web:{},native:{type:"stepper"}});var eo=Object(Ye.compose)([Ae.withNotices,Object(Ln.withViewportMatch)({isNarrow:"< small"})])((function(e){const{attributes:t,clientId:n,isSelected:o,noticeUI:r,noticeOperations:a,onFocus:c}=e,{columns:l=In(t),imageCrop:i,images:s,linkTo:u,sizeSlug:m}=t,[d,b]=Object(Be.useState)(),[p,g]=Object(Be.useState)(),{__unstableMarkNextChangeAsNotPersistent:h}=Object(Ke.useDispatch)(Ee.store),{imageSizes:v,mediaUpload:O,getMedia:j,wasBlockJustInserted:f}=Object(Ke.useSelect)(e=>{const t=e(Ee.store).getSettings();return{imageSizes:t.imageSizes,mediaUpload:t.mediaUpload,getMedia:e(ke.store).getMedia,wasBlockJustInserted:e(Ee.store).wasBlockJustInserted(n,"inserter_menu")}}),y=Object(Be.useMemo)(()=>o?Object(xe.reduce)(t.ids,(e,t)=>{if(!t)return e;const n=j(t),o=Object(xe.reduce)(v,(e,t)=>{const o=Object(xe.get)(n,["sizes",t.slug,"url"]),r=Object(xe.get)(n,["media_details","sizes",t.slug,"source_url"]);return{...e,[t.slug]:o||r}},{});return{...e,[parseInt(t,10)]:o}},{}):{},[o,t.ids,v]);function _(t){if(t.ids)throw new Error('The "ids" attribute should not be changed directly. It is managed automatically when "images" attribute changes');t.images&&(t={...t,ids:Object(xe.map)(t.images,({id:e})=>parseInt(e,10))}),e.setAttributes(t)}function w(e,t){const n=[...s];n.splice(t,1,s[e]),n.splice(e,1,s[t]),b(t),_({images:n})}function k(e){const t=Object(xe.toString)(e.id),n=Object(xe.find)(s,{id:t}),o=n?n.caption:e.caption;if(!p)return o;const r=Object(xe.find)(p,{id:t});return r&&r.caption!==e.caption?e.caption:o}function E(e){g(e.map(e=>({id:Object(xe.toString)(e.id),caption:e.caption}))),_({images:e.map(e=>({...Rn(e,m),caption:k(e),id:Object(xe.toString)(e.id)})),columns:t.columns?Math.min(e.length,t.columns):t.columns})}Object(Be.useEffect)(()=>{if("web"===Be.Platform.OS&&s&&s.length>0&&Object(xe.every)(s,({url:e})=>Object(Je.isBlobURL)(e))){const e=Object(xe.map)(s,({url:e})=>Object(Je.getBlobByURL)(e));Object(xe.forEach)(s,({url:e})=>Object(Je.revokeBlobURL)(e)),O({filesList:e,onFileChange:E,allowedTypes:["image"]})}},[]),Object(Be.useEffect)(()=>{o||b()},[o]),Object(Be.useEffect)(()=>{var e,t,n,o,r,a;u||(h(),_({linkTo:(null===(e=window)||void 0===e||null===(t=e.wp)||void 0===t||null===(n=t.media)||void 0===n||null===(o=n.view)||void 0===o||null===(r=o.settings)||void 0===r||null===(a=r.defaultProps)||void 0===a?void 0:a.link)||"none"}))},[u]);const C=!!s.length,x=C&&s.some(e=>!!e.id),S=Object(Be.createElement)(Ee.MediaPlaceholder,{addToGallery:x,isAppender:C,disableMediaButtons:C&&!o,icon:!C&&Dn,labels:{title:!C&&Object(Se.__)("Gallery"),instructions:!C&&Yn},onSelect:E,accept:"image/*",allowedTypes:Kn,multiple:!0,value:x?s:{},onError:function(e){a.removeAllNotices(),a.createErrorNotice(e)},notices:C?void 0:r,onFocus:c,autoOpenMediaUpload:!C&&o&&f}),B=Object(Ee.useBlockProps)();if(!C)return Object(Be.createElement)(Te.View,B,S);const T=Object(xe.map)(Object(xe.filter)(v,({slug:e})=>Object(xe.some)(y,t=>t[e])),({name:e,slug:t})=>({value:t,label:e})),z=C&&!Object(xe.isEmpty)(T);return Object(Be.createElement)(Be.Fragment,null,Object(Be.createElement)(Ee.InspectorControls,null,Object(Be.createElement)(Ae.PanelBody,{title:Object(Se.__)("Gallery settings")},s.length>1&&Object(Be.createElement)(Ae.RangeControl,Object(Re.a)({label:Object(Se.__)("Columns"),value:l,onChange:function(e){_({columns:e})},min:1,max:Math.min(8,s.length)},Xn,{required:!0})),Object(Be.createElement)(Ae.ToggleControl,{label:Object(Se.__)("Crop images"),checked:!!i,onChange:function(){_({imageCrop:!i})},help:function(e){return e?Object(Se.__)("Thumbnails are cropped to align."):Object(Se.__)("Thumbnails are not cropped.")}}),Object(Be.createElement)(Ae.SelectControl,{label:Object(Se.__)("Link to"),value:u,onChange:function(e){_({linkTo:e})},options:Jn,hideCancelButton:!0}),z&&Object(Be.createElement)(Ae.SelectControl,{label:Object(Se.__)("Image size"),value:m,options:T,onChange:function(e){_({images:Object(xe.map)(s,t=>{if(!t.id)return t;const n=Object(xe.get)(y,[parseInt(t.id,10),e]);return{...t,...n&&{url:n}}}),sizeSlug:e})},hideCancelButton:!0}))),r,Object(Be.createElement)(Qn,Object(Re.a)({},e,{selectedImage:d,mediaPlaceholder:S,onMoveBackward:function(e){return()=>{0!==e&&w(e,e-1)}},onMoveForward:function(e){return()=>{e!==s.length-1&&w(e,e+1)}},onRemoveImage:function(e){return()=>{const n=Object(xe.filter)(s,(t,n)=>e!==n);b(),_({images:n,columns:t.columns?Math.min(n.length,t.columns):t.columns})}},onSelectImage:function(e){return()=>{b(e)}},onDeselectImage:function(){return()=>{b()}},onSetImageAttributes:function(e,t){s[e]&&_({images:[...s.slice(0,e),{...s[e],...t},...s.slice(e+1)]})},onFocusGalleryCaption:function(){b()},blockProps:B})))}));const to=e=>e?e.split(",").map(e=>parseInt(e,10)):[];var no={from:[{type:"block",isMultiBlock:!0,blocks:["core/image"],transform:e=>{let{align:t,sizeSlug:n}=e[0];t=Object(xe.every)(e,["align",t])?t:void 0,n=Object(xe.every)(e,["sizeSlug",n])?n:void 0;const o=Object(xe.filter)(e,({url:e})=>e);return Object(Ce.createBlock)("core/gallery",{images:o.map(({id:e,url:t,alt:n,caption:o})=>({id:Object(xe.toString)(e),url:t,alt:n,caption:o})),ids:o.map(({id:e})=>parseInt(e,10)),align:t,sizeSlug:n})}},{type:"shortcode",tag:"gallery",attributes:{images:{type:"array",shortcode:({named:{ids:e}})=>to(e).map(e=>({id:Object(xe.toString)(e)}))},ids:{type:"array",shortcode:({named:{ids:e}})=>to(e)},columns:{type:"number",shortcode:({named:{columns:e="3"}})=>parseInt(e,10)},linkTo:{type:"string",shortcode:({named:{link:e="post"}})=>e}},isMatch:({named:e})=>void 0!==e.ids},{type:"files",isMatch:e=>1!==e.length&&Object(xe.every)(e,e=>0===e.type.indexOf("image/")),transform:e=>Object(Ce.createBlock)("core/gallery",{images:e.map(e=>Rn({url:Object(Je.createBlobURL)(e)}))})}],to:[{type:"block",blocks:["core/image"],transform:({images:e,align:t,sizeSlug:n,ids:o})=>e.length>0?e.map(({url:e,alt:r,caption:a},c)=>Object(Ce.createBlock)("core/image",{id:o[c],url:e,alt:r,caption:a,align:t,sizeSlug:n})):Object(Ce.createBlock)("core/image",{align:t})}]};const oo={apiVersion:2,name:"core/gallery",title:"Gallery",category:"media",description:"Display multiple images in a rich gallery.",keywords:["images","photos"],textdomain:"default",attributes:{images:{type:"array",default:[],source:"query",selector:".blocks-gallery-item",query:{url:{type:"string",source:"attribute",selector:"img",attribute:"src"},fullUrl:{type:"string",source:"attribute",selector:"img",attribute:"data-full-url"},link:{type:"string",source:"attribute",selector:"img",attribute:"data-link"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},id:{type:"string",source:"attribute",selector:"img",attribute:"data-id"},caption:{type:"string",source:"html",selector:".blocks-gallery-item__caption"}}},ids:{type:"array",items:{type:"number"},default:[]},columns:{type:"number",minimum:1,maximum:8},caption:{type:"string",source:"html",selector:".blocks-gallery-caption"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string"},sizeSlug:{type:"string",default:"large"}},supports:{anchor:!0,align:!0},editorStyle:"wp-block-gallery-editor",style:"wp-block-gallery"},{name:ro}=oo,ao={icon:Hn,example:{attributes:{columns:2,images:[{url:"https://s.w.org/images/core/5.3/Glacial_lakes%2C_Bhutan.jpg"},{url:"https://s.w.org/images/core/5.3/Sediment_off_the_Yucatan_Peninsula.jpg"}]}},transforms:no,edit:eo,save:function({attributes:e}){const{images:t,columns:n=In(e),imageCrop:o,caption:r,linkTo:a}=e,c=`columns-${n} ${o?"is-cropped":""}`;return Object(Be.createElement)("figure",Ee.useBlockProps.save({className:c}),Object(Be.createElement)("ul",{className:"blocks-gallery-grid"},t.map(e=>{let t;switch(a){case"file":t=e.fullUrl||e.url;break;case"post":t=e.link}const n=Object(Be.createElement)("img",{src:e.url,alt:e.alt,"data-id":e.id,"data-full-url":e.fullUrl,"data-link":e.link,className:e.id?"wp-image-"+e.id:null});return Object(Be.createElement)("li",{key:e.id||e.url,className:"blocks-gallery-item"},Object(Be.createElement)("figure",null,t?Object(Be.createElement)("a",{href:t},n):n,!Ee.RichText.isEmpty(e.caption)&&Object(Be.createElement)(Ee.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-item__caption",value:e.caption})))})),!Ee.RichText.isEmpty(r)&&Object(Be.createElement)(Ee.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-caption",value:r}))},deprecated:An};var co=Object(Be.createElement)(Te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Be.createElement)(Te.Path,{d:"M19 6.2h-5.9l-.6-1.1c-.3-.7-1-1.1-1.8-1.1H5c-1.1 0-2 .9-2 2v11.8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8.2c0-1.1-.9-2-2-2zm.5 11.6c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h5.8c.2 0 .4.1.4.3l1 2H19c.3 0 .5.2.5.5v9.5zM8 12.8h8v-1.5H8v1.5zm0 3h8v-1.5H8v1.5z"})),lo=n(68),io=n.n(lo);const so={apiVersion:2,name:"core/archives",title:"Archives",category:"widgets",description:"Display a monthly archive of your posts.",textdomain:"default",attributes:{displayAsDropdown:{type:"boolean",default:!1},showPostCounts:{type:"boolean",default:!1}},supports:{align:!0,html:!1},editorStyle:"wp-block-archives-editor"},{name:uo}=so,mo={icon:co,example:{},edit:function({attributes:e,setAttributes:t}){const{showPostCounts:n,displayAsDropdown:o}=e;return Object(Be.createElement)(Be.Fragment,null,Object(Be.createElement)(Ee.InspectorControls,null,Object(Be.createElement)(Ae.PanelBody,{title:Object(Se.__)("Archives settings")},Object(Be.createElement)(Ae.ToggleControl,{label:Object(Se.__)("Display as dropdown"),checked:o,onChange:()=>t({displayAsDropdown:!o})}),Object(Be.createElement)(Ae.ToggleControl,{label:Object(Se.__)("Show post counts"),checked:n,onChange:()=>t({showPostCounts:!n})}))),Object(Be.createElement)("div",Object(Ee.useBlockProps)(),Object(Be.createElement)(Ae.Disabled,null,Object(Be.createElement)(io.a,{block:"core/archives",attributes:e}))))}};var bo=Object(Be.createElement)(Te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Be.createElement)(Te.Path,{d:"M17.7 4.3c-1.2 0-2.8 0-3.8 1-.6.6-.9 1.5-.9 2.6V14c-.6-.6-1.5-1-2.5-1C8.6 13 7 14.6 7 16.5S8.6 20 10.5 20c1.5 0 2.8-1 3.3-2.3.5-.8.7-1.8.7-2.5V7.9c0-.7.2-1.2.5-1.6.6-.6 1.8-.6 2.8-.6h.3V4.3h-.4z"})),po=[{attributes:{src:{type:"string",source:"attribute",selector:"audio",attribute:"src"},caption:{type:"string",source:"html",selector:"figcaption"},id:{type:"number"},autoplay:{type:"boolean",source:"attribute",selector:"audio",attribute:"autoplay"},loop:{type:"boolean",source:"attribute",selector:"audio",attribute:"loop"},preload:{type:"string",source:"attribute",selector:"audio",attribute:"preload"}},supports:{align:!0},save({attributes:e}){const{autoplay:t,caption:n,loop:o,preload:r,src:a}=e;return Object(Be.createElement)("figure",null,Object(Be.createElement)("audio",{controls:"controls",src:a,autoPlay:t,loop:o,preload:r}),!Ee.RichText.isEmpty(n)&&Object(Be.createElement)(Ee.RichText.Content,{tagName:"figcaption",value:n}))}}];const go=["audio"];var ho=Object(Ae.withNotices)((function({attributes:e,noticeOperations:t,setAttributes:n,onReplace:o,isSelected:r,noticeUI:a,insertBlocksAfter:c}){const{id:l,autoplay:i,caption:s,loop:u,preload:m,src:d}=e,b=Object(Ee.useBlockProps)(),p=Object(Ke.useSelect)(e=>{const{getSettings:t}=e(Ee.store);return t().mediaUpload},[]);function g(e){return t=>{n({[e]:t})}}function h(e){if(e!==d){const t=mt({attributes:{url:e}});if(void 0!==t)return void o(t);n({src:e,id:void 0})}}function v(e){t.removeAllNotices(),t.createErrorNotice(e)}function O(e){e&&e.url?n({src:e.url,id:e.id}):n({src:void 0,id:void 0})}return Object(Be.useEffect)(()=>{if(!l&&Object(Je.isBlobURL)(d)){const e=Object(Je.getBlobByURL)(d);e&&p({filesList:[e],onFileChange:([{id:e,url:t}])=>{n({id:e,src:t})},onError:e=>{n({src:void 0,id:void 0}),t.createErrorNotice(e)},allowedTypes:go})}},[]),d?Object(Be.createElement)(Be.Fragment,null,Object(Be.createElement)(Ee.BlockControls,{group:"other"},Object(Be.createElement)(Ee.MediaReplaceFlow,{mediaId:l,mediaURL:d,allowedTypes:go,accept:"audio/*",onSelect:O,onSelectURL:h,onError:v})),Object(Be.createElement)(Ee.InspectorControls,null,Object(Be.createElement)(Ae.PanelBody,{title:Object(Se.__)("Audio settings")},Object(Be.createElement)(Ae.ToggleControl,{label:Object(Se.__)("Autoplay"),onChange:g("autoplay"),checked:i,help:function(e){return e?Object(Se.__)("Note: Autoplaying audio may cause usability issues for some visitors."):null}}),Object(Be.createElement)(Ae.ToggleControl,{label:Object(Se.__)("Loop"),onChange:g("loop"),checked:u}),Object(Be.createElement)(Ae.SelectControl,{label:Object(Se.__)("Preload"),value:m||"",onChange:e=>n({preload:e||void 0}),options:[{value:"",label:Object(Se.__)("Browser default")},{value:"auto",label:Object(Se.__)("Auto")},{value:"metadata",label:Object(Se.__)("Metadata")},{value:"none",label:Object(Se.__)("None")}]}))),Object(Be.createElement)("figure",b,Object(Be.createElement)(Ae.Disabled,{isDisabled:!r},Object(Be.createElement)("audio",{controls:"controls",src:d})),(!Ee.RichText.isEmpty(s)||r)&&Object(Be.createElement)(Ee.RichText,{tagName:"figcaption","aria-label":Object(Se.__)("Audio caption text"),placeholder:Object(Se.__)("Add caption"),value:s,onChange:e=>n({caption:e}),inlineToolbar:!0,__unstableOnSplitAtEnd:()=>c(Object(Ce.createBlock)("core/paragraph"))}))):Object(Be.createElement)("div",b,Object(Be.createElement)(Ee.MediaPlaceholder,{icon:Object(Be.createElement)(Ee.BlockIcon,{icon:bo}),onSelect:O,onSelectURL:h,accept:"audio/*",allowedTypes:go,value:e,notices:a,onError:v}))})),vo={from:[{type:"files",isMatch:e=>1===e.length&&0===e[0].type.indexOf("audio/"),transform(e){const t=e[0];return Object(Ce.createBlock)("core/audio",{src:Object(Je.createBlobURL)(t)})}},{type:"shortcode",tag:"audio",attributes:{src:{type:"string",shortcode:({named:{src:e,mp3:t,m4a:n,ogg:o,wav:r,wma:a}})=>e||t||n||o||r||a},loop:{type:"string",shortcode:({named:{loop:e}})=>e},autoplay:{type:"string",shortcode:({named:{autoplay:e}})=>e},preload:{type:"string",shortcode:({named:{preload:e}})=>e}}}]};const Oo={apiVersion:2,name:"core/audio",title:"Audio",category:"media",description:"Embed a simple audio player.",keywords:["music","sound","podcast","recording"],textdomain:"default",attributes:{src:{type:"string",source:"attribute",selector:"audio",attribute:"src"},caption:{type:"string",source:"html",selector:"figcaption"},id:{type:"number"},autoplay:{type:"boolean",source:"attribute",selector:"audio",attribute:"autoplay"},loop:{type:"boolean",source:"attribute",selector:"audio",attribute:"loop"},preload:{type:"string",source:"attribute",selector:"audio",attribute:"preload"}},supports:{anchor:!0,align:!0},editorStyle:"wp-block-audio-editor",style:"wp-block-audio"},{name:jo}=Oo,fo={icon:bo,transforms:vo,deprecated:po,edit:ho,save:function({attributes:e}){const{autoplay:t,caption:n,loop:o,preload:r,src:a}=e;return a&&Object(Be.createElement)("figure",Ee.useBlockProps.save(),Object(Be.createElement)("audio",{controls:"controls",src:a,autoPlay:t,loop:o,preload:r}),!Ee.RichText.isEmpty(n)&&Object(Be.createElement)(Ee.RichText.Content,{tagName:"figcaption",value:n}))}};var yo=Object(Be.createElement)(Te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Be.createElement)(Te.Path,{d:"M17 3H7c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 6c0 .3-.2.5-.5.5H7c-.3 0-.5-.2-.5-.5V5c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v4zm-8-1.2h5V6.2h-5v1.6zM17 13H7c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2v-4c0-1.1-.9-2-2-2zm.5 6c0 .3-.2.5-.5.5H7c-.3 0-.5-.2-.5-.5v-4c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v4zm-8-1.2h5v-1.5h-5v1.5z"})),_o=[{supports:{align:["center","left","right"],anchor:!0},save:()=>Object(Be.createElement)("div",null,Object(Be.createElement)(Ee.InnerBlocks.Content,null)),isEligible:({align:e})=>e&&["center","left","right"].includes(e),migrate:e=>({...e,align:void 0,contentJustification:e.align})}];const{name:wo}={apiVersion:2,name:"core/buttons",title:"Buttons",category:"design",description:"Prompt visitors to take action with a group of button-style links.",keywords:["link"],textdomain:"default",attributes:{contentJustification:{type:"string"},orientation:{type:"string",default:"horizontal"}},supports:{anchor:!0,align:["wide","full"]},editorStyle:"wp-block-buttons-editor",style:"wp-block-buttons"};var ko={from:[{type:"block",isMultiBlock:!0,blocks:["core/button"],transform:e=>Object(Ce.createBlock)(wo,{},e.map(e=>Object(Ce.createBlock)("core/button",e)))},{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>Object(Ce.createBlock)(wo,{},e.map(e=>{const t=document.createElement("div");t.innerHTML=e.content;const n=t.innerText||"",o=t.querySelector("a"),r=null==o?void 0:o.getAttribute("href");return Object(Ce.createBlock)("core/button",{text:n,url:r})})),isMatch:e=>e.every(e=>{const t=document.createElement("div");t.innerHTML=e.content;const n=t.innerText||"",o=t.querySelectorAll("a");return n.length<=30&&o.length<=1})}]},Eo=n(303);const Co=e=>{const{borderRadius:t,...n}=e;return t||0===t?{...n,style:{...n.style,border:{radius:t}}}:n},xo=e=>{if(!e.customTextColor&&!e.customBackgroundColor&&!e.customGradient)return e;const t={color:{}};return e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor),e.customGradient&&(t.color.gradient=e.customGradient),{...Object(xe.omit)(e,["customTextColor","customBackgroundColor","customGradient"]),style:t}},So=e=>xo(Object(xe.omit)({...e,customTextColor:e.textColor&&"#"===e.textColor[0]?e.textColor:void 0,customBackgroundColor:e.color&&"#"===e.color[0]?e.color:void 0},["color","textColor"])),Bo={url:{type:"string",source:"attribute",selector:"a",attribute:"href"},title:{type:"string",source:"attribute",selector:"a",attribute:"title"},text:{type:"string",source:"html",selector:"a"}};var To=[{supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0},reusable:!1,__experimentalSelector:".wp-block-button__link"},attributes:{...Bo,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},style:{type:"object"},width:{type:"number"}},save({attributes:e,className:t}){const{borderRadius:n,linkTarget:o,rel:r,text:a,title:c,url:l,width:i}=e,s=Object(Ee.__experimentalGetColorClassesAndStyles)(e),u=Ne()("wp-block-button__link",s.className,{"no-border-radius":0===n}),m={borderRadius:n?n+"px":void 0,...s.style},d=Ne()(t,{["has-custom-width wp-block-button__width-"+i]:i});return Object(Be.createElement)("div",Ee.useBlockProps.save({className:d}),Object(Be.createElement)(Ee.RichText.Content,{tagName:"a",className:u,href:l,title:c,style:m,value:a,target:o,rel:r}))},migrate:Co},{supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0},reusable:!1,__experimentalSelector:".wp-block-button__link"},attributes:{...Bo,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},style:{type:"object"},width:{type:"number"}},save({attributes:e,className:t}){const{borderRadius:n,linkTarget:o,rel:r,text:a,title:c,url:l,width:i}=e,s=Object(Ee.__experimentalGetColorClassesAndStyles)(e),u=Ne()("wp-block-button__link",s.className,{"no-border-radius":0===n}),m={borderRadius:n?n+"px":void 0,...s.style},d=Ne()(t,{["has-custom-width wp-block-button__width-"+i]:i});return Object(Be.createElement)("div",Ee.useBlockProps.save({className:d}),Object(Be.createElement)(Ee.RichText.Content,{tagName:"a",className:u,href:l,title:c,style:m,value:a,target:o,rel:r}))},migrate:Co},{supports:{align:!0,alignWide:!1,color:{gradients:!0}},attributes:{...Bo,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},style:{type:"object"}},save({attributes:e}){const{borderRadius:t,linkTarget:n,rel:o,text:r,title:a,url:c}=e,l=Ne()("wp-block-button__link",{"no-border-radius":0===t}),i={borderRadius:t?t+"px":void 0};return Object(Be.createElement)(Ee.RichText.Content,{tagName:"a",className:l,href:c,title:a,style:i,value:r,target:n,rel:o})},migrate:Co},{supports:{align:!0,alignWide:!1},attributes:{...Bo,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},customGradient:{type:"string"},gradient:{type:"string"}},isEligible:e=>!!e.customTextColor||!!e.customBackgroundColor||!!e.customGradient,migrate:Object(Ye.compose)(Co,xo),save({attributes:e}){const{backgroundColor:t,borderRadius:n,customBackgroundColor:o,customTextColor:r,customGradient:a,linkTarget:c,gradient:l,rel:i,text:s,textColor:u,title:m,url:d}=e,b=Object(Ee.getColorClassName)("color",u),p=!a&&Object(Ee.getColorClassName)("background-color",t),g=Object(Ee.__experimentalGetGradientClass)(l),h=Ne()("wp-block-button__link",{"has-text-color":u||r,[b]:b,"has-background":t||o||a||l,[p]:p,"no-border-radius":0===n,[g]:g}),v={background:a||void 0,backgroundColor:p||a||l?void 0:o,color:b?void 0:r,borderRadius:n?n+"px":void 0};return Object(Be.createElement)("div",null,Object(Be.createElement)(Ee.RichText.Content,{tagName:"a",className:h,href:d,title:m,style:v,value:s,target:c,rel:i}))}},{attributes:{...Bo,align:{type:"string",default:"none"},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"}},isEligible:e=>e.className&&e.className.includes("is-style-squared"),migrate(e){let t=e.className;return t&&(t=t.replace(/is-style-squared[\s]?/,"").trim()),Co(xo({...e,className:t||void 0,borderRadius:0}))},save({attributes:e}){const{backgroundColor:t,customBackgroundColor:n,customTextColor:o,linkTarget:r,rel:a,text:c,textColor:l,title:i,url:s}=e,u=Object(Ee.getColorClassName)("color",l),m=Object(Ee.getColorClassName)("background-color",t),d=Ne()("wp-block-button__link",{"has-text-color":l||o,[u]:u,"has-background":t||n,[m]:m}),b={backgroundColor:m?void 0:n,color:u?void 0:o};return Object(Be.createElement)("div",null,Object(Be.createElement)(Ee.RichText.Content,{tagName:"a",className:d,href:s,title:i,style:b,value:c,target:r,rel:a}))}},{attributes:{...Bo,align:{type:"string",default:"none"},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"}},migrate:So,save({attributes:e}){const{url:t,text:n,title:o,backgroundColor:r,textColor:a,customBackgroundColor:c,customTextColor:l}=e,i=Object(Ee.getColorClassName)("color",a),s=Object(Ee.getColorClassName)("background-color",r),u=Ne()("wp-block-button__link",{"has-text-color":a||l,[i]:i,"has-background":r||c,[s]:s}),m={backgroundColor:s?void 0:c,color:i?void 0:l};return Object(Be.createElement)("div",null,Object(Be.createElement)(Ee.RichText.Content,{tagName:"a",className:u,href:t,title:o,style:m,value:n}))}},{attributes:{...Bo,color:{type:"string"},textColor:{type:"string"},align:{type:"string",default:"none"}},save({attributes:e}){const{url:t,text:n,title:o,align:r,color:a,textColor:c}=e,l={backgroundColor:a,color:c};return Object(Be.createElement)("div",{className:"align"+r},Object(Be.createElement)(Ee.RichText.Content,{tagName:"a",className:"wp-block-button__link",href:t,title:o,style:l,value:n}))},migrate:So},{attributes:{...Bo,color:{type:"string"},textColor:{type:"string"},align:{type:"string",default:"none"}},save({attributes:e}){const{url:t,text:n,title:o,align:r,color:a,textColor:c}=e;return Object(Be.createElement)("div",{className:"align"+r,style:{backgroundColor:a}},Object(Be.createElement)(Ee.RichText.Content,{tagName:"a",href:t,title:o,style:{color:c},value:n}))},migrate:So}],zo=n(193),Po=n(220);function No({selectedWidth:e,setAttributes:t}){return Object(Be.createElement)(Ae.PanelBody,{title:Object(Se.__)("Width settings")},Object(Be.createElement)(Ae.ButtonGroup,{"aria-label":Object(Se.__)("Button width")},[25,50,75,100].map(n=>Object(Be.createElement)(Ae.Button,{key:n,isSmall:!0,isPrimary:n===e,onClick:()=>{var o;t({width:e===(o=n)?void 0:o})}},n,"%"))))}function Mo({isSelected:e,url:t,setAttributes:n,opensInNewTab:o,onToggleOpenInNewTab:r,anchorRef:a}){const[c,l]=Object(Be.useState)(!1),i=!!t,s=i&&e,u=()=>(l(!0),!1),m=()=>{n({url:void 0,linkTarget:void 0,rel:void 0}),l(!1)},d=(c||s)&&Object(Be.createElement)(Ae.Popover,{position:"bottom center",onClose:()=>l(!1),anchorRef:null==a?void 0:a.current},Object(Be.createElement)(Ee.__experimentalLinkControl,{className:"wp-block-navigation-link__inline-link-input",value:{url:t,opensInNewTab:o},onChange:({url:e="",opensInNewTab:t})=>{n({url:e}),o!==t&&r(t)}}));return Object(Be.createElement)(Be.Fragment,null,Object(Be.createElement)(Ee.BlockControls,{group:"block"},!i&&Object(Be.createElement)(Ae.ToolbarButton,{name:"link",icon:zo.a,title:Object(Se.__)("Link"),shortcut:hn.displayShortcut.primary("k"),onClick:u}),s&&Object(Be.createElement)(Ae.ToolbarButton,{name:"link",icon:Po.a,title:Object(Se.__)("Unlink"),shortcut:hn.displayShortcut.primaryShift("k"),onClick:m,isActive:!0})),e&&Object(Be.createElement)(Ae.KeyboardShortcuts,{bindGlobal:!0,shortcuts:{[hn.rawShortcut.primary("k")]:u,[hn.rawShortcut.primaryShift("k")]:m}}),d)}const Vo={apiVersion:2,name:"core/button",title:"Button",category:"design",parent:["core/buttons"],description:"Prompt visitors to take action with a button-style link.",keywords:["link"],textdomain:"default",attributes:{url:{type:"string",source:"attribute",selector:"a",attribute:"href"},title:{type:"string",source:"attribute",selector:"a",attribute:"title"},text:{type:"string",source:"html",selector:"a"},linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},width:{type:"number"}},supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0,gradients:!0},fontSize:!0,reusable:!1,__experimentalBorder:{radius:!0,__experimentalSkipSerialization:!0},__experimentalFontFamily:!0,__experimentalSelector:".wp-block-button__link"},styles:[{name:"fill",label:"Fill",isDefault:!0},{name:"outline",label:"Outline"}],editorStyle:"wp-block-button-editor",style:"wp-block-button"},{name:Ho}=Vo,Io={icon:Eo.a,example:{attributes:{className:"is-style-fill",backgroundColor:"vivid-green-cyan",text:Object(Se.__)("Call to Action")}},edit:function(e){var t;const{attributes:n,setAttributes:o,className:r,isSelected:a,onReplace:c,mergeBlocks:l}=e,{linkTarget:i,placeholder:s,rel:u,style:m,text:d,url:b,width:p}=n,g=Object(Be.useCallback)(e=>{o({rel:e})},[o]),h=Object(Be.useCallback)(e=>{const t=e?"_blank":void 0;let n=u;t&&!u?n="noreferrer noopener":t||"noreferrer noopener"!==u||(n=void 0),o({linkTarget:t,rel:n})},[u,o]),v=null==m||null===(t=m.border)||void 0===t?void 0:t.radius,O=Object(Ee.__experimentalUseColorProps)(n),j=Object(Be.useRef)(),f=Object(Ee.useBlockProps)({ref:j});return Object(Be.createElement)(Be.Fragment,null,Object(Be.createElement)("div",Object(Re.a)({},f,{className:Ne()(f.className,{["has-custom-width wp-block-button__width-"+p]:p,"has-custom-font-size":f.style.fontSize})}),Object(Be.createElement)(Ee.RichText,{"aria-label":Object(Se.__)("Button text"),placeholder:s||Object(Se.__)("Add text…"),value:d,onChange:e=>{o({text:e.replace(/<\/?a[^>]*>/g,"")})},withoutInteractiveFormatting:!0,className:Ne()(r,"wp-block-button__link",O.className,{"no-border-radius":0===v}),style:{borderRadius:v?v+"px":void 0,...O.style},onSplit:e=>Object(Ce.createBlock)("core/button",{...n,text:e}),onReplace:c,onMerge:l,identifier:"text"})),Object(Be.createElement)(Mo,{url:b,setAttributes:o,isSelected:a,opensInNewTab:"_blank"===i,onToggleOpenInNewTab:h,anchorRef:j}),Object(Be.createElement)(Ee.InspectorControls,null,Object(Be.createElement)(No,{selectedWidth:p,setAttributes:o})),Object(Be.createElement)(Ee.InspectorAdvancedControls,null,Object(Be.createElement)(Ae.TextControl,{label:Object(Se.__)("Link rel"),value:u||"",onChange:g})))},save:function({attributes:e,className:t}){var n,o;const{fontSize:r,linkTarget:a,rel:c,style:l,text:i,title:s,url:u,width:m}=e;if(!i)return null;const d=null==l||null===(n=l.border)||void 0===n?void 0:n.radius,b=Object(Ee.__experimentalGetColorClassesAndStyles)(e),p=Ne()("wp-block-button__link",b.className,{"no-border-radius":0===d}),g={borderRadius:d?d+"px":void 0,...b.style},h=Ne()(t,{["has-custom-width wp-block-button__width-"+m]:m,"has-custom-font-size":r||(null==l||null===(o=l.typography)||void 0===o?void 0:o.fontSize)});return Object(Be.createElement)("div",Ee.useBlockProps.save({className:h}),Object(Be.createElement)(Ee.RichText.Content,{tagName:"a",className:p,href:u,title:s,style:g,value:i,target:a,rel:c}))},deprecated:To,merge:(e,{text:t=""})=>({...e,text:(e.text||"")+t})},Ro=[Ho],Ao=[["core/button"]];var Lo=[{name:"buttons-horizontal",isDefault:!0,title:Object(Se.__)("Horizontal"),description:Object(Se.__)("Buttons shown in a row."),attributes:{orientation:"horizontal"},scope:["transform"]},{name:"buttons-vertical",title:Object(Se.__)("Vertical"),description:Object(Se.__)("Buttons shown in a column."),attributes:{orientation:"vertical"},scope:["transform"]}];const Do={apiVersion:2,name:"core/buttons",title:"Buttons",category:"design",description:"Prompt visitors to take action with a group of button-style links.",keywords:["link"],textdomain:"default",attributes:{contentJustification:{type:"string"},orientation:{type:"string",default:"horizontal"}},supports:{anchor:!0,align:["wide","full"]},editorStyle:"wp-block-buttons-editor",style:"wp-block-buttons"},{name:Fo}=Do,Go={icon:yo,example:{innerBlocks:[{name:"core/button",attributes:{text:Object(Se.__)("Find out more")}},{name:"core/button",attributes:{text:Object(Se.__)("Contact us")}}]},deprecated:_o,transforms:ko,edit:function({attributes:{contentJustification:e,orientation:t},setAttributes:n}){const o=Object(Ee.useBlockProps)({className:Ne()({["is-content-justification-"+e]:e,"is-vertical":"vertical"===t})}),r=Object(Ee.__experimentalUseInnerBlocksProps)(o,{allowedBlocks:Ro,template:Ao,orientation:t,__experimentalLayout:{type:"default",alignments:[]},templateInsertUpdatesSelection:!0}),a="vertical"===t?["left","center","right"]:["left","center","right","space-between"];return Object(Be.createElement)(Be.Fragment,null,Object(Be.createElement)(Ee.BlockControls,{group:"block"},Object(Be.createElement)(Ee.JustifyContentControl,{allowedControls:a,value:e,onChange:e=>n({contentJustification:e}),popoverProps:{position:"bottom right",isAlternate:!0}})),Object(Be.createElement)("div",r))},save:function({attributes:{contentJustification:e,orientation:t}}){return Object(Be.createElement)("div",Ee.useBlockProps.save({className:Ne()({["is-content-justification-"+e]:e,"is-vertical":"vertical"===t})}),Object(Be.createElement)(Ee.InnerBlocks.Content,null))},variations:Lo};var Uo=Object(Be.createElement)(Te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Be.createElement)(Te.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7h15v12zM9 10H7v2h2v-2zm0 4H7v2h2v-2zm4-4h-2v2h2v-2zm4 0h-2v2h2v-2zm-4 4h-2v2h2v-2zm4 0h-2v2h2v-2z"})),qo=n(35),Wo=n.n(qo),$o=n(21);const Zo=it()(e=>{if(!e)return{};const t=Wo()(e);return{year:t.year(),month:t.month()+1}}),Qo={apiVersion:2,name:"core/calendar",title:"Calendar",category:"widgets",description:"A calendar of your site’s posts.",keywords:["posts","archive"],textdomain:"default",attributes:{month:{type:"integer"},year:{type:"integer"}},supports:{align:!0},style:"wp-block-calendar"},{name:Jo}=Qo,Ko={icon:Uo,example:{},edit:function({attributes:e}){const t=Object(Ke.useSelect)(e=>{const{getEditedPostAttribute:t}=e($o.store);return"post"===t("type")?t("date"):void 0},[]);return Object(Be.createElement)("div",Object(Ee.useBlockProps)(),Object(Be.createElement)(Ae.Disabled,null,Object(Be.createElement)(io.a,{block:"core/calendar",attributes:{...e,...Zo(t)}})))}};var Yo=Object(Be.createElement)(Te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Be.createElement)(Te.Path,{d:"M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z",fillRule:"evenodd",clipRule:"evenodd"})),Xo=Object(Be.createElement)(Te.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(Be.createElement)(Te.Path,{d:"M10.44 3.02l1.82-1.82 6.36 6.35-1.83 1.82c-1.05-.68-2.48-.57-3.41.36l-.75.75c-.92.93-1.04 2.35-.35 3.41l-1.83 1.82-2.41-2.41-2.8 2.79c-.42.42-3.38 2.71-3.8 2.29s1.86-3.39 2.28-3.81l2.79-2.79L4.1 9.36l1.83-1.82c1.05.69 2.48.57 3.4-.36l.75-.75c.93-.92 1.05-2.35.36-3.41z"}));const er={apiVersion:2,name:"core/categories",title:"Categories",category:"widgets",description:"Display a list of all categories.",textdomain:"default",attributes:{displayAsDropdown:{type:"boolean",default:!1},showHierarchy:{type:"boolean",default:!1},showPostCounts:{type:"boolean",default:!1}},supports:{align:!0,html:!1},editorStyle:"wp-block-categories-editor",style:"wp-block-categories"},{name:tr}=er,nr={icon:Yo,example:{},edit:function e({attributes:{displayAsDropdown:t,showHierarchy:n,showPostCounts:o},setAttributes:r}){const a=Object(Ye.useInstanceId)(e,"blocks-category-select"),{categories:c,isRequesting:l}=Object(Ke.useSelect)(e=>{const{getEntityRecords:t}=e(ke.store),{isResolving:n}=e("core/data"),o={per_page:-1,hide_empty:!0};return{categories:t("taxonomy","category",o),isRequesting:n("core","getEntityRecords",["taxonomy","category",o])}},[]),i=e=>null!=c&&c.length?null===e?c:c.filter(({parent:t})=>t===e):[],s=e=>"wp-block-categories__list wp-block-categories__list-level-"+e,u=e=>t=>r({[e]:t}),m=e=>e?Object(xe.unescape)(e).trim():Object(Se.__)("(Untitled)"),d=(e,t)=>{const r=i(e.id),{id:a,link:c,count:l,name:u}=e;return Object(Be.createElement)("li",{key:a},Object(Be.createElement)("a",{href:c,target:"_blank",rel:"noreferrer noopener"},m(u)),o&&Object(Be.createElement)("span",{className:"wp-block-categories__post-count"},` (${l})`),n&&!!r.length&&Object(Be.createElement)("ul",{className:s(t+1)},r.map(e=>d(e,t+1))))},b=(e,t)=>{const{id:r,count:a,name:c}=e,l=i(r);return[Object(Be.createElement)("option",{key:r},Object(xe.times)(3*t,()=>" "),m(c),o&&` (${a})`),n&&!!l.length&&l.map(e=>b(e,t+1))]};return Object(Be.createElement)("div",Object(Ee.useBlockProps)(),Object(Be.createElement)(Ee.InspectorControls,null,Object(Be.createElement)(Ae.PanelBody,{title:Object(Se.__)("Categories settings")},Object(Be.createElement)(Ae.ToggleControl,{label:Object(Se.__)("Display as dropdown"),checked:t,onChange:u("displayAsDropdown")}),Object(Be.createElement)(Ae.ToggleControl,{label:Object(Se.__)("Show hierarchy"),checked:n,onChange:u("showHierarchy")}),Object(Be.createElement)(Ae.ToggleControl,{label:Object(Se.__)("Show post counts"),checked:o,onChange:u("showPostCounts")}))),l&&Object(Be.createElement)(Ae.Placeholder,{icon:Xo,label:Object(Se.__)("Categories")},Object(Be.createElement)(Ae.Spinner,null)),!l&&0===c.length&&Object(Be.createElement)("p",null,Object(Se.__)("Your site does not have any posts, so there is nothing to display here at the moment.")),!l&&c.length>0&&(t?(()=>{const e=i(n?0:null);return Object(Be.createElement)(Be.Fragment,null,Object(Be.createElement)(Ae.VisuallyHidden,{as:"label",htmlFor:a},Object(Se.__)("Categories")),Object(Be.createElement)("select",{id:a,className:"wp-block-categories__dropdown"},e.map(e=>b(e,0))))})():(()=>{const e=i(n?0:null);return Object(Be.createElement)("ul",{className:s(0)},e.map(e=>d(e,0)))})()))}};var or=n(304);function rr(e){return e.replace(/\[/g,"&#91;")}function ar(e){return e.replace(/^(\s*https?:)\/\/([^\s<>"]+\s*)$/m,"$1&#47;&#47;$2")}var cr={from:[{type:"enter",regExp:/^```$/,transform:()=>Object(Ce.createBlock)("core/code")},{type:"block",blocks:["core/html"],transform:({content:e})=>Object(Ce.createBlock)("core/code",{content:e})},{type:"raw",isMatch:e=>"PRE"===e.nodeName&&1===e.children.length&&"CODE"===e.firstChild.nodeName,schema:{pre:{children:{code:{children:{"#text":{}}}}}}}]};const lr={apiVersion:2,name:"core/code",title:"Code",category:"text",description:"Display code snippets that respect your spacing and tabs.",textdomain:"default",attributes:{content:{type:"string",source:"html",selector:"code"}},supports:{anchor:!0,fontSize:!0},style:"wp-block-code"},{name:ir}=lr,sr={icon:or.a,example:{attributes:{
17
  // translators: Preserve \n markers for line breaks
18
  content:Object(Se.__)('// A "block" is the abstract term used\n// to describe units of markup that\n// when composed together, form the\n// content or layout of a page.\nregisterBlockType( name, settings );')}},transforms:cr,edit:function({attributes:e,setAttributes:t,onRemove:n}){const o=Object(Ee.useBlockProps)();return Object(Be.createElement)("pre",o,Object(Be.createElement)(Ee.RichText,{tagName:"code",value:e.content,onChange:e=>t({content:e}),onRemove:n,placeholder:Object(Se.__)("Write code…"),"aria-label":Object(Se.__)("Code"),preserveWhiteSpace:!0,__unstablePastePlainText:!0}))},save:function({attributes:e}){return Object(Be.createElement)("pre",Ee.useBlockProps.save(),Object(Be.createElement)(Ee.RichText.Content,{tagName:"code",value:(t=e.content,Object(xe.flow)(rr,ar)(t||""))}));var t}};var ur=Object(Be.createElement)(Te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Be.createElement)(Te.Path,{d:"M19 6H6c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm-4.1 1.5v10H10v-10h4.9zM5.5 17V8c0-.3.2-.5.5-.5h2.5v10H6c-.3 0-.5-.2-.5-.5zm14 0c0 .3-.2.5-.5.5h-2.6v-10H19c.3 0 .5.2.5.5v9z"}));function mr(e){let t,{doc:n}=mr;n||(n=document.implementation.createHTMLDocument(""),mr.doc=n),n.body.innerHTML=e;for(const e of n.body.firstChild.classList)if(t=e.match(/^layout-column-(\d+)$/))return Number(t[1])-1}var dr=[{attributes:{verticalAlignment:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>{if(!e.customTextColor&&!e.customBackgroundColor)return e;const t={color:{}};return e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor),{...Object(xe.omit)(e,["customTextColor","customBackgroundColor"]),style:t}},save({attributes:e}){const{verticalAlignment:t,backgroundColor:n,customBackgroundColor:o,textColor:r,customTextColor:a}=e,c=Object(Ee.getColorClassName)("background-color",n),l=Object(Ee.getColorClassName)("color",r),i=Ne()({"has-background":n||o,"has-text-color":r||a,[c]:c,[l]:l,["are-vertically-aligned-"+t]:t}),s={backgroundColor:c?void 0:o,color:l?void 0:a};return Object(Be.createElement)("div",{className:i||void 0,style:s},Object(Be.createElement)(Ee.InnerBlocks.Content,null))}},{attributes:{columns:{type:"number",default:2}},isEligible:(e,t)=>!!t.some(e=>/layout-column-\d+/.test(e.originalContent))&&t.some(e=>void 0!==mr(e.originalContent)),migrate(e,t){const n=t.reduce((e,t)=>{const{originalContent:n}=t;let o=mr(n);return void 0===o&&(o=0),e[o]||(e[o]=[]),e[o].push(t),e},[]).map(e=>Object(Ce.createBlock)("core/column",{},e));return[Object(xe.omit)(e,["columns"]),n]},save({attributes:e}){const{columns:t}=e;return Object(Be.createElement)("div",{className:`has-${t}-columns`},Object(Be.createElement)(Ee.InnerBlocks.Content,null))}},{attributes:{columns:{type:"number",default:2}},migrate:(e,t)=>[e=Object(xe.omit)(e,["columns"]),t],save({attributes:e}){const{verticalAlignment:t,columns:n}=e,o=Ne()(`has-${n}-columns`,{["are-vertically-aligned-"+t]:t});return Object(Be.createElement)("div",{className:o},Object(Be.createElement)(Ee.InnerBlocks.Content,null))}}];const br=e=>{const t=parseFloat(e);return Number.isFinite(t)?parseFloat(t.toFixed(2)):void 0};function pr(e,t){const{width:n=100/t}=e.attributes;return br(n)}function gr(e,t,n=e.length){const o=function(e,t=e.length){return Object(xe.sumBy)(e,e=>pr(e,t))}(e,n);return Object(xe.mapValues)(function(e,t=e.length){return e.reduce((e,n)=>{const o=pr(n,t);return Object.assign(e,{[n.clientId]:o})},{})}(e,n),e=>br(t*e/o))}function hr(e,t){return e.map(e=>Object(xe.merge)({},e,{attributes:{width:t[e.clientId]}}))}const vr="web"===Be.Platform.OS,Or=[{value:"%",label:vr?"%":Object(Se.__)("Percentage (%)"),default:""},{value:"px",label:vr?"px":Object(Se.__)("Pixels (px)"),default:""},{value:"em",label:vr?"em":Object(Se.__)("Relative to parent font size (em)"),default:""},{value:"rem",label:vr?"rem":Object(Se.__)("Relative to root font size (rem)"),default:""},{value:"vw",label:vr?"vw":Object(Se.__)("Viewport width (vw)"),default:""}],jr=["core/column"],fr=Object(Ke.withDispatch)((e,t,n)=>({updateAlignment(o){const{clientId:r,setAttributes:a}=t,{updateBlockAttributes:c}=e(Ee.store),{getBlockOrder:l}=n.select(Ee.store);a({verticalAlignment:o}),l(r).forEach(e=>{c(e,{verticalAlignment:o})})},updateColumns(o,r){const{clientId:a}=t,{replaceInnerBlocks:c}=e(Ee.store),{getBlocks:l}=n.select(Ee.store);let i=l(a);const s=i.every(e=>{var t;const n=e.attributes.width;return Number.isFinite(null!=n&&null!==(t=n.endsWith)&&void 0!==t&&t.call(n,"%")?parseFloat(n):n)}),u=r>o;if(u&&s){const e=br(100/r);i=[...hr(i,gr(i,100-e)),...Object(xe.times)(r-o,()=>Object(Ce.createBlock)("core/column",{width:e}))]}else u?i=[...i,...Object(xe.times)(r-o,()=>Object(Ce.createBlock)("core/column"))]:(i=Object(xe.dropRight)(i,o-r),s&&(i=hr(i,gr(i,100))));c(a,i)}}))((function({attributes:e,updateAlignment:t,updateColumns:n,clientId:o}){const{verticalAlignment:r}=e,{count:a}=Object(Ke.useSelect)(e=>({count:e(Ee.store).getBlockCount(o)}),[o]),c=Ne()({["are-vertically-aligned-"+r]:r}),l=Object(Ee.useBlockProps)({className:c}),i=Object(Ee.__experimentalUseInnerBlocksProps)(l,{allowedBlocks:jr,orientation:"horizontal",renderAppender:!1});return Object(Be.createElement)(Be.Fragment,null,Object(Be.createElement)(Ee.BlockControls,null,Object(Be.createElement)(Ee.BlockVerticalAlignmentToolbar,{onChange:t,value:r})),Object(Be.createElement)(Ee.InspectorControls,null,Object(Be.createElement)(Ae.PanelBody,null,Object(Be.createElement)(Ae.RangeControl,{label:Object(Se.__)("Columns"),value:a,onChange:e=>n(a,e),min:1,max:Math.max(6,a)}),a>6&&Object(Be.createElement)(Ae.Notice,{status:"warning",isDismissible:!1},Object(Se.__)("This column count exceeds the recommended amount and may cause visual breakage.")))),Object(Be.createElement)("div",i))}));function yr({clientId:e,name:t,setAttributes:n}){const{blockType:o,defaultVariation:r,variations:a}=Object(Ke.useSelect)(e=>{const{getBlockVariations:n,getBlockType:o,getDefaultBlockVariation:r}=e(Ce.store);return{blockType:o(t),defaultVariation:r(t,"block"),variations:n(t,"block")}},[t]),{replaceInnerBlocks:c}=Object(Ke.useDispatch)(Ee.store),l=Object(Ee.useBlockProps)();return Object(Be.createElement)("div",l,Object(Be.createElement)(Ee.__experimentalBlockVariationPicker,{icon:Object(xe.get)(o,["icon","src"]),label:Object(xe.get)(o,["title"]),variations:a,onSelect:(t=r)=>{t.attributes&&n(t.attributes),t.innerBlocks&&c(e,Object(Ce.createBlocksFromInnerBlocksTemplate)(t.innerBlocks),!0)},allowSkip:!0}))}var _r=[{name:"one-column-full",title:Object(Se.__)("100"),description:Object(Se.__)("One column"),icon:Object(Be.createElement)(Ae.SVG,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},Object(Be.createElement)(Ae.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"m39.0625 14h-30.0625v20.0938h30.0625zm-30.0625-2c-1.10457 0-2 .8954-2 2v20.0938c0 1.1045.89543 2 2 2h30.0625c1.1046 0 2-.8955 2-2v-20.0938c0-1.1046-.8954-2-2-2z"})),innerBlocks:[["core/column"]],scope:["block"]},{name:"two-columns-equal",title:Object(Se.__)("50 / 50"),description:Object(Se.__)("Two columns; equal split"),icon:Object(Be.createElement)(Ae.SVG,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},Object(Be.createElement)(Ae.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H25V34H39ZM23 34H9V14H23V34Z"})),isDefault:!0,innerBlocks:[["core/column"],["core/column"]],scope:["block"]},{name:"two-columns-one-third-two-thirds",title:Object(Se.__)("30 / 70"),description:Object(Se.__)("Two columns; one-third, two-thirds split"),icon:Object(Be.createElement)(Ae.SVG,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},Object(Be.createElement)(Ae.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H20V34H39ZM18 34H9V14H18V34Z"})),innerBlocks:[["core/column",{width:"33.33%"}],["core/column",{width:"66.66%"}]],scope:["block"]},{name:"two-columns-two-thirds-one-third",title:Object(Se.__)("70 / 30"),description:Object(Se.__)("Two columns; two-thirds, one-third split"),icon:Object(Be.createElement)(Ae.SVG,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},Object(Be.createElement)(Ae.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H30V34H39ZM28 34H9V14H28V34Z"})),innerBlocks:[["core/column",{width:"66.66%"}],["core/column",{width:"33.33%"}]],scope:["block"]},{name:"three-columns-equal",title:Object(Se.__)("33 / 33 / 33"),description:Object(Se.__)("Three columns; equal split"),icon:Object(Be.createElement)(Ae.SVG,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},Object(Be.createElement)(Ae.Path,{fillRule:"evenodd",d:"M41 14a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h30a2 2 0 0 0 2-2V14zM28.5 34h-9V14h9v20zm2 0V14H39v20h-8.5zm-13 0H9V14h8.5v20z"})),innerBlocks:[["core/column"],["core/column"],["core/column"]],scope:["block"]},{name:"three-columns-wider-center",title:Object(Se.__)("25 / 50 / 25"),description:Object(Se.__)("Three columns; wide center column"),icon:Object(Be.createElement)(Ae.SVG,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},Object(Be.createElement)(Ae.Path,{fillRule:"evenodd",d:"M41 14a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h30a2 2 0 0 0 2-2V14zM31 34H17V14h14v20zm2 0V14h6v20h-6zm-18 0H9V14h6v20z"})),innerBlocks:[["core/column",{width:"25%"}],["core/column",{width:"50%"}],["core/column",{width:"25%"}]],scope:["block"]}],wr={from:[{type:"block",isMultiBlock:!0,blocks:["*"],__experimentalConvert:e=>{const t=+(100/e.length).toFixed(2),n=e.map(({name:e,attributes:n,innerBlocks:o})=>["core/column",{width:t+"%"},[[e,{...n},o]]]);return Object(Ce.createBlock)("core/columns",{},Object(Ce.createBlocksFromInnerBlocksTemplate)(n))},isMatch:({length:e})=>e&&e<=6},{type:"block",blocks:["core/media-text"],priority:1,transform:(e,t)=>{const{align:n,backgroundColor:o,textColor:r,style:a,mediaAlt:c,mediaId:l,mediaPosition:i,mediaSizeSlug:s,mediaType:u,mediaUrl:m,mediaWidth:d,verticalAlignment:b}=e;let p;p="image"!==u&&u?["core/video",{id:l,src:m}]:["core/image",{id:l,alt:c,url:m,sizeSlug:s,href:e.href,linkClass:e.linkClass,linkDestination:e.linkDestination,linkTarget:e.linkTarget,rel:e.rel}];const g=[["core/column",{width:d+"%"},[p]],["core/column",{width:100-d+"%"},t]];return"right"===i&&g.reverse(),Object(Ce.createBlock)("core/columns",{align:n,backgroundColor:o,textColor:r,style:a,verticalAlignment:b},Object(Ce.createBlocksFromInnerBlocksTemplate)(g))}}]};const kr={apiVersion:2,name:"core/columns",title:"Columns",category:"design",description:"Add a block that displays content in multiple columns, then add whatever content blocks you’d like.",textdomain:"default",attributes:{verticalAlignment:{type:"string"}},supports:{anchor:!0,align:["wide","full"],html:!1,color:{gradients:!0,link:!0}},editorStyle:"wp-block-columns-editor",style:"wp-block-columns"},{name:Er}=kr,Cr={icon:ur,variations:_r,example:{innerBlocks:[{name:"core/column",innerBlocks:[{name:"core/paragraph",attributes:{
19
  /* translators: example text. */
changelog.txt CHANGED
@@ -1,15 +1,31 @@
1
  == Changelog ==
2
 
3
- = 10.6.1 =
4
 
 
 
5
  ### Bug Fixes
6
 
7
- - Revert "components: Promote VisuallyHidden from ui into full components (#31244)". ([31882](https://github.com/WordPress/gutenberg/pull/31882))
8
- - Allow more complex contentWidth & wideWidth values. ([31740](https://github.com/WordPress/gutenberg/pull/31740))
9
- - Fix link color selector. ([31820](https://github.com/WordPress/gutenberg/pull/31820))
10
- - Register template part variations server side. ([31761](https://github.com/WordPress/gutenberg/pull/31761))
11
- - Do not provide a default value for the link color property. ([31755](https://github.com/WordPress/gutenberg/pull/31755))
12
- - Fixes FSE Navigation sub-menu item styling regression. ([31754](https://github.com/WordPress/gutenberg/pull/31754))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
 
15
  = 10.6.0 =
1
  == Changelog ==
2
 
3
+ = 10.6.2 =
4
 
5
+
6
+
7
  ### Bug Fixes
8
 
9
+ - Workflows: Fix "Stable tag:" readme.txt field in SVN upload. ([31897](https://github.com/WordPress/gutenberg/pull/31897))
10
+ - Gallery: Fix Image Size regression. ([31884](https://github.com/WordPress/gutenberg/pull/31884))
11
+
12
+ ### Various
13
+
14
+ - Plugin: Guard `construct_wp_query_args` with check if implemented in WordPress Core. ([32008](https://github.com/WordPress/gutenberg/pull/32008))
15
+
16
+
17
+
18
+
19
+ = 10.6.1 =
20
+
21
+ ### Bug Fixes
22
+
23
+ - Revert "components: Promote VisuallyHidden from ui into full components (#31244)". ([31882](https://github.com/WordPress/gutenberg/pull/31882))
24
+ - Allow more complex contentWidth & wideWidth values. ([31740](https://github.com/WordPress/gutenberg/pull/31740))
25
+ - Fix link color selector. ([31820](https://github.com/WordPress/gutenberg/pull/31820))
26
+ - Register template part variations server side. ([31761](https://github.com/WordPress/gutenberg/pull/31761))
27
+ - Do not provide a default value for the link color property. ([31755](https://github.com/WordPress/gutenberg/pull/31755))
28
+ - Fixes FSE Navigation sub-menu item styling regression. ([31754](https://github.com/WordPress/gutenberg/pull/31754))
29
 
30
 
31
  = 10.6.0 =
gutenberg.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Printing since 1440. This is the development plugin for the new block editor in core.
6
  * Requires at least: 5.6
7
  * Requires PHP: 5.6
8
- * Version: 10.6.1
9
  * Author: Gutenberg Team
10
  * Text Domain: gutenberg
11
  *
@@ -13,8 +13,8 @@
13
  */
14
 
15
  ### BEGIN AUTO-GENERATED DEFINES
16
- define( 'GUTENBERG_VERSION', '10.6.1' );
17
- define( 'GUTENBERG_GIT_COMMIT', 'd22bf13fdd182d2951f4bcda50a8920ae52af737' );
18
  ### END AUTO-GENERATED DEFINES
19
 
20
  gutenberg_pre_init();
5
  * Description: Printing since 1440. This is the development plugin for the new block editor in core.
6
  * Requires at least: 5.6
7
  * Requires PHP: 5.6
8
+ * Version: 10.6.2
9
  * Author: Gutenberg Team
10
  * Text Domain: gutenberg
11
  *
13
  */
14
 
15
  ### BEGIN AUTO-GENERATED DEFINES
16
+ define( 'GUTENBERG_VERSION', '10.6.2' );
17
+ define( 'GUTENBERG_GIT_COMMIT', '6227d381ced7b1a37595026067e5c31fdb16579f' );
18
  ### END AUTO-GENERATED DEFINES
19
 
20
  gutenberg_pre_init();
lib/compat/wordpress-5.8.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Temporary compatibility shims for features present in Gutenberg.
4
+ * This file should be removed when WordPress 5.8.0 becomes the lowest
5
+ * supported version by this plugin.
6
+ *
7
+ * @package gutenberg
8
+ */
9
+
10
+ if ( ! function_exists( 'construct_wp_query_args' ) ) {
11
+ /**
12
+ * Helper function that constructs a WP_Query args array from
13
+ * a `Query` block properties.
14
+ *
15
+ * It's used in QueryLoop, QueryPaginationNumbers and QueryPaginationNext blocks.
16
+ *
17
+ * @param WP_Block $block Block instance.
18
+ * @param int $page Current query's page.
19
+ *
20
+ * @return array Returns the constructed WP_Query arguments.
21
+ */
22
+ function construct_wp_query_args( $block, $page ) {
23
+ $query = array(
24
+ 'post_type' => 'post',
25
+ 'order' => 'DESC',
26
+ 'orderby' => 'date',
27
+ 'post__not_in' => array(),
28
+ );
29
+
30
+ if ( isset( $block->context['query'] ) ) {
31
+ if ( isset( $block->context['query']['postType'] ) ) {
32
+ $query['post_type'] = $block->context['query']['postType'];
33
+ }
34
+ if ( isset( $block->context['query']['sticky'] ) && ! empty( $block->context['query']['sticky'] ) ) {
35
+ $sticky = get_option( 'sticky_posts' );
36
+ if ( 'only' === $block->context['query']['sticky'] ) {
37
+ $query['post__in'] = $sticky;
38
+ } else {
39
+ $query['post__not_in'] = array_merge( $query['post__not_in'], $sticky );
40
+ }
41
+ }
42
+ if ( isset( $block->context['query']['exclude'] ) ) {
43
+ $query['post__not_in'] = array_merge( $query['post__not_in'], $block->context['query']['exclude'] );
44
+ }
45
+ if ( isset( $block->context['query']['perPage'] ) ) {
46
+ $query['offset'] = ( $block->context['query']['perPage'] * ( $page - 1 ) ) + $block->context['query']['offset'];
47
+ $query['posts_per_page'] = $block->context['query']['perPage'];
48
+ }
49
+ if ( isset( $block->context['query']['categoryIds'] ) ) {
50
+ $query['category__in'] = $block->context['query']['categoryIds'];
51
+ }
52
+ if ( isset( $block->context['query']['tagIds'] ) ) {
53
+ $query['tag__in'] = $block->context['query']['tagIds'];
54
+ }
55
+ if ( isset( $block->context['query']['order'] ) ) {
56
+ $query['order'] = strtoupper( $block->context['query']['order'] );
57
+ }
58
+ if ( isset( $block->context['query']['orderBy'] ) ) {
59
+ $query['orderby'] = $block->context['query']['orderBy'];
60
+ }
61
+ if ( isset( $block->context['query']['author'] ) ) {
62
+ $query['author'] = $block->context['query']['author'];
63
+ }
64
+ if ( isset( $block->context['query']['search'] ) ) {
65
+ $query['s'] = $block->context['query']['search'];
66
+ }
67
+ }
68
+ return $query;
69
+ }
70
+ }
lib/load.php CHANGED
@@ -83,6 +83,7 @@ if ( ! class_exists( 'WP_Widget_Block' ) ) {
83
  require_once __DIR__ . '/widgets-page.php';
84
 
85
  require __DIR__ . '/compat.php';
 
86
  require __DIR__ . '/utils.php';
87
  require __DIR__ . '/editor-settings.php';
88
 
@@ -120,7 +121,6 @@ require __DIR__ . '/navigation.php';
120
  require __DIR__ . '/navigation-page.php';
121
  require __DIR__ . '/experiments-page.php';
122
  require __DIR__ . '/global-styles.php';
123
- require __DIR__ . '/query-utils.php';
124
 
125
  require __DIR__ . '/block-supports/generated-classname.php';
126
  require __DIR__ . '/block-supports/colors.php';
83
  require_once __DIR__ . '/widgets-page.php';
84
 
85
  require __DIR__ . '/compat.php';
86
+ require __DIR__ . '/compat/wordpress-5.8.php';
87
  require __DIR__ . '/utils.php';
88
  require __DIR__ . '/editor-settings.php';
89
 
121
  require __DIR__ . '/navigation-page.php';
122
  require __DIR__ . '/experiments-page.php';
123
  require __DIR__ . '/global-styles.php';
 
124
 
125
  require __DIR__ . '/block-supports/generated-classname.php';
126
  require __DIR__ . '/block-supports/colors.php';
lib/query-utils.php DELETED
@@ -1,67 +0,0 @@
1
- <?php
2
- /**
3
- * Utility functions used for handling Query block and blocks
4
- * that
5
- *
6
- * @package gutenberg
7
- */
8
-
9
- /**
10
- * Helper function that constructs a WP_Query args array from
11
- * a `Query` block properties.
12
- *
13
- * It's used in QueryLoop, QueryPaginationNumbers and QueryPaginationNext blocks.
14
- *
15
- * @param WP_Block $block Block instance.
16
- * @param int $page Current query's page.
17
- *
18
- * @return array Returns the constructed WP_Query arguments.
19
- */
20
- function construct_wp_query_args( $block, $page ) {
21
- $query = array(
22
- 'post_type' => 'post',
23
- 'order' => 'DESC',
24
- 'orderby' => 'date',
25
- 'post__not_in' => array(),
26
- );
27
-
28
- if ( isset( $block->context['query'] ) ) {
29
- if ( isset( $block->context['query']['postType'] ) ) {
30
- $query['post_type'] = $block->context['query']['postType'];
31
- }
32
- if ( isset( $block->context['query']['sticky'] ) && ! empty( $block->context['query']['sticky'] ) ) {
33
- $sticky = get_option( 'sticky_posts' );
34
- if ( 'only' === $block->context['query']['sticky'] ) {
35
- $query['post__in'] = $sticky;
36
- } else {
37
- $query['post__not_in'] = array_merge( $query['post__not_in'], $sticky );
38
- }
39
- }
40
- if ( isset( $block->context['query']['exclude'] ) ) {
41
- $query['post__not_in'] = array_merge( $query['post__not_in'], $block->context['query']['exclude'] );
42
- }
43
- if ( isset( $block->context['query']['perPage'] ) ) {
44
- $query['offset'] = ( $block->context['query']['perPage'] * ( $page - 1 ) ) + $block->context['query']['offset'];
45
- $query['posts_per_page'] = $block->context['query']['perPage'];
46
- }
47
- if ( isset( $block->context['query']['categoryIds'] ) ) {
48
- $query['category__in'] = $block->context['query']['categoryIds'];
49
- }
50
- if ( isset( $block->context['query']['tagIds'] ) ) {
51
- $query['tag__in'] = $block->context['query']['tagIds'];
52
- }
53
- if ( isset( $block->context['query']['order'] ) ) {
54
- $query['order'] = strtoupper( $block->context['query']['order'] );
55
- }
56
- if ( isset( $block->context['query']['orderBy'] ) ) {
57
- $query['orderby'] = $block->context['query']['orderBy'];
58
- }
59
- if ( isset( $block->context['query']['author'] ) ) {
60
- $query['author'] = $block->context['query']['author'];
61
- }
62
- if ( isset( $block->context['query']['search'] ) ) {
63
- $query['s'] = $block->context['query']['search'];
64
- }
65
- }
66
- return $query;
67
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -1,7 +1,7 @@
1
  === Gutenberg ===
2
  Contributors: matveb, joen, karmatosed
3
  Tested up to: 5.7
4
- Stable tag:
5
  License: GPLv2 or later
6
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
 
@@ -55,4 +55,4 @@ View <a href="https://developer.wordpress.org/block-editor/principles/versions-i
55
 
56
  == Changelog ==
57
 
58
- To read the changelog for Gutenberg 10.6.1, please navigate to the <a href="https://github.com/WordPress/gutenberg/releases/tag/v10.6.1">release page</a>.
1
  === Gutenberg ===
2
  Contributors: matveb, joen, karmatosed
3
  Tested up to: 5.7
4
+ Stable tag: 10.6.1
5
  License: GPLv2 or later
6
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
 
55
 
56
  == Changelog ==
57
 
58
+ To read the changelog for Gutenberg 10.6.2, please navigate to the <a href="https://github.com/WordPress/gutenberg/releases/tag/v10.6.2">release page</a>.