diff --git a/CHANGELOG.md b/CHANGELOG.md index 3fe90d68..0a1f5b2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.25.0] - 2023-06-13 + +### Added +- `settings.iso.sidebar.customComponent` added to allow a custom settings sidebar to be supplied +- Fix buttons in link popup (see #226) + ## [2.24.0] - 2023-04-24 ### Update diff --git a/README.md b/README.md index 8a5b8621..bcdc9dd8 100644 --- a/README.md +++ b/README.md @@ -215,11 +215,13 @@ The following function is also provided: - _iso.blocks.disallowBlocks_ `[string[]]` - list of block names to disallow, defaults to none - _iso.disallowEmbed_ `[string[]]` - List of embed names to remove, defaults to none. - _iso.toolbar_ `[Object]` - Toolbar settings -- _iso.toolbar.inserter_ `[boolean]` - Enable or disable the toolbar block inserter, defaults to `true` -- _iso.toolbar.inspector_ `[boolean]` - Enable or disable the toolbar block inspector, defaults to `false` - _iso.toolbar.navigation_ `[boolean]` - Enable or disable the toolbar navigation button, defaults to `false` - _iso.toolbar.undo_ `[boolean]` - Enable or disable the toolbar undo/redo buttons, defaults to `true` - _iso.toolbar.documentInspector_ `[string|null]` - Set to a string to show as a new tab in the inspector and filled with `DocumentSection`, otherwise defaults to no new tab +- _iso.sidebar_ `[Object]` - Sidebar settings +- _iso.sidebar.inserter_ `[boolean]` - Enable or disable the sidebar block inserter, defaults to `true` +- _iso.sidebar.inspector_ `[boolean]` - Enable or disable the sidebar block inspector, defaults to `false` +- _iso.sidebar.customComponent_ `[function]` - A function returning a custom sidebar component, or null to uses the default sidebar - _iso.moreMenu_ `[Object]` - More menu settings - _iso.moreMenu.editor_ `[boolean]` - Enable or disable the editor sub menu (visual/code editing), defaults to `false` - _iso.moreMenu.fullscreen_ `[boolean]` - Enable or disable the fullscreen option, defaults to `false` @@ -321,6 +323,22 @@ settings.editor.mediaUpload = mediaUpload; In versions earlier than 2.21.0 this was automatically done, but this meant that you were unable to modify or disable it. +### Custom settings sidebar + +By default the editor will use the Gutenberg settings sidebar. This provides the block and document inspector tabs, along with associated content. + +If you wish to customise this sidebar then you can use the `iso.sidebar.customComponent` setting and pass a function that returns a React component. + +You will need to manage the display of the sidebar yourself, including whether it should appear or not. It may help to look at the [existing sidebar code](src/components/block-editor/sidebar.js) for reference. + +For example: + +```js +sidebar: { + customComponent: () =>
{o.removeEventListener("scroll",l,!0),o.removeEventListener("resize",l,!0),t.removeEventListener("keydown",s),t.removeEventListener("keyup",c),t.removeEventListener("mousedown",u),t.removeEventListener("touchstart",u),n.removeEventListener("selectionchange",p),o.cancelAnimationFrame(r),o.cancelAnimationFrame(a)}}),[e])}const Ade=(0,Bt.createContext)({});function yde(e){let{children:t,uniqueId:n,blockName:o=""}=e;const r=(0,Bt.useContext)(Ade),{name:a}=CN();o=o||a;const i=(0,Bt.useMemo)((()=>function(e,t,n){const o={...e,[t]:e[t]?new Set(e[t]):new Set};return o[t].add(n),o}(r,o,n)),[r,o,n]);return(0,Bt.createElement)(Ade.Provider,{value:i},t)}function _de(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const o=(0,Bt.useContext)(Ade),{name:r}=CN();return n=n||r,Boolean(null===(t=o[n])||void 0===t?void 0:t.has(e))}function qde(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function kde(e,t){if(t.length =0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=wde(e),b=d.getDay(),m=6+(b o.getTime()}(e,t))&&(Fde(e,n)||function(e,t){kde(2,arguments);var n=wde(e),o=wde(t);return n.getTime() =1&&b<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var m=new Date(0);m.setUTCFullYear(p+1,0,b),m.setUTCHours(0,0,0,0);var M=bbe(m,t),z=new Date(0);z.setUTCFullYear(p,0,b),z.setUTCHours(0,0,0,0);var f=bbe(z,t);return u.getTime()>=M.getTime()?p+1:u.getTime()>=f.getTime()?p:p-1}function Mbe(e,t){var n,o,r,a,i,l,s,c;$de(1,arguments);var u=dbe(),p=Zde(null!==(n=null!==(o=null!==(r=null!==(a=null==t?void 0:t.firstWeekContainsDate)&&void 0!==a?a:null==t||null===(i=t.locale)||void 0===i||null===(l=i.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==r?r:u.firstWeekContainsDate)&&void 0!==o?o:null===(s=u.locale)||void 0===s||null===(c=s.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1),d=mbe(e,t),b=new Date(0);b.setUTCFullYear(d,0,p),b.setUTCHours(0,0,0,0);var m=bbe(b,t);return m}var zbe=6048e5;function fbe(e,t){for(var n=e<0?"-":"",o=Math.abs(e).toString();o.length =0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=Kde(e),b=d.getDay(),m=6+(b {const{timezone:e}=Xie(),t=(new Date).getTimezoneOffset()/60*-1;if(Number(e.offset)===t)return null;const n=Number(e.offset)>=0?"+":"",o=""!==e.abbr&&isNaN(Number(e.abbr))?e.abbr:`UTC${n}${e.offset}`,r="UTC"===e.string?gr("Coordinated Universal Time"):`(${o}) ${e.string.replace("_"," ")}`;return(0,Bt.createElement)(ww,{position:"top center",text:r},(0,Bt.createElement)(Hme,{className:"components-datetime__timezone"},o))};function Yme(e,t){return t?(e%12+12)%24:e%12}function Xme(e){return(t,n)=>{const o={...t};return n.type!==BI&&n.type!==jI&&n.type!==YI||void 0!==o.value&&(o.value=o.value.toString().padStart(e,"0")),o}}const jme=function(e){let{is12Hour:t,currentTime:n,onChange:o}=e;const[r,a]=(0,Bt.useState)((()=>n?kme(vme(n)):new Date));(0,Bt.useEffect)((()=>{a(n?kme(vme(n)):new Date)}),[n]);const{day:i,month:l,year:s,minutes:c,hours:u,am:p}=(0,Bt.useMemo)((()=>({day:lme(r,"dd"),month:lme(r,"MM"),year:lme(r,"yyyy"),minutes:lme(r,"mm"),hours:lme(r,t?"hh":"HH"),am:lme(r,"a")})),[r,t]),d=e=>(n,i)=>{let{event:l}=i;if(!(l.target instanceof HTMLInputElement))return;if(!l.target.validity.valid)return;let s=Number(n);"hours"===e&&t&&(s=Yme(s,"PM"===p));const c=function(e,t){if($de(2,arguments),"object"!==Wme(t)||null===t)throw new RangeError("values parameter must be an object");var n=Kde(e);return isNaN(n.getTime())?new Date(NaN):(null!=t.year&&n.setFullYear(t.year),null!=t.month&&(n=Eme(n,t.month)),null!=t.date&&n.setDate(Zde(t.date)),null!=t.hours&&n.setHours(Zde(t.hours)),null!=t.minutes&&n.setMinutes(Zde(t.minutes)),null!=t.seconds&&n.setSeconds(Zde(t.seconds)),null!=t.milliseconds&&n.setMilliseconds(Zde(t.milliseconds)),n)}(r,{[e]:s});a(c),null==o||o(lme(c,Ame))};function b(e){return()=>{if(p===e)return;const t=parseInt(u,10),n=function(e,t){$de(2,arguments);var n=Kde(e),o=Zde(t);return n.setHours(o),n}(r,Yme(t,"PM"===e));a(n),null==o||o(lme(n,Ame))}}const m=(0,Bt.createElement)(Ime,{className:"components-datetime__time-field components-datetime__time-field-day",label:gr("Day"),hideLabelFromVision:!0,__next36pxDefaultSize:!0,value:i,step:1,min:1,max:31,required:!0,spinControls:"none",isPressEnterToChange:!0,isDragEnabled:!1,isShiftStepEnabled:!1,onChange:d("date")}),M=(0,Bt.createElement)(Bme,null,(0,Bt.createElement)(Dme,{className:"components-datetime__time-field components-datetime__time-field-month",label:gr("Month"),hideLabelFromVision:!0,__nextHasNoMarginBottom:!0,value:l,options:[{value:"01",label:gr("January")},{value:"02",label:gr("February")},{value:"03",label:gr("March")},{value:"04",label:gr("April")},{value:"05",label:gr("May")},{value:"06",label:gr("June")},{value:"07",label:gr("July")},{value:"08",label:gr("August")},{value:"09",label:gr("September")},{value:"10",label:gr("October")},{value:"11",label:gr("November")},{value:"12",label:gr("December")}],onChange:e=>{const t=Eme(r,Number(e)-1);a(t),null==o||o(lme(t,Ame))}}));return(0,Bt.createElement)(Lme,{className:"components-datetime__time"},(0,Bt.createElement)(xme,null,(0,Bt.createElement)(ET.VisualLabel,{as:"legend",className:"components-datetime__time-legend"},gr("Time")),(0,Bt.createElement)(lD,{className:"components-datetime__time-wrapper"},(0,Bt.createElement)(Cme,{className:"components-datetime__time-field components-datetime__time-field-time"},(0,Bt.createElement)(Sme,{className:"components-datetime__time-field-hours-input",label:gr("Hours"),hideLabelFromVision:!0,__next36pxDefaultSize:!0,value:u,step:1,min:t?1:0,max:t?12:23,required:!0,spinControls:"none",isPressEnterToChange:!0,isDragEnabled:!1,isShiftStepEnabled:!1,onChange:d("hours"),__unstableStateReducer:Xme(2)}),(0,Bt.createElement)(Nme,{className:"components-datetime__time-separator","aria-hidden":"true"},":"),(0,Bt.createElement)(Tme,{className:"components-datetime__time-field-minutes-input",label:gr("Minutes"),hideLabelFromVision:!0,__next36pxDefaultSize:!0,value:c,step:1,min:0,max:59,required:!0,spinControls:"none",isPressEnterToChange:!0,isDragEnabled:!1,isShiftStepEnabled:!1,onChange:d("minutes"),__unstableStateReducer:Xme(2)})),t&&(0,Bt.createElement)(Lae,{className:"components-datetime__time-field components-datetime__time-field-am-pm"},(0,Bt.createElement)(bE,{className:"components-datetime__time-am-button",variant:"AM"===p?"primary":"secondary",onClick:b("AM")},gr("AM")),(0,Bt.createElement)(bE,{className:"components-datetime__time-pm-button",variant:"PM"===p?"primary":"secondary",onClick:b("PM")},gr("PM"))),(0,Bt.createElement)(cF,null),(0,Bt.createElement)(Fme,null))),(0,Bt.createElement)(xme,null,(0,Bt.createElement)(ET.VisualLabel,{as:"legend",className:"components-datetime__time-legend"},gr("Date")),(0,Bt.createElement)(lD,{className:"components-datetime__time-wrapper"},t?(0,Bt.createElement)(Bt.Fragment,null,M,m):(0,Bt.createElement)(Bt.Fragment,null,m,M),(0,Bt.createElement)(Pme,{className:"components-datetime__time-field components-datetime__time-field-year",label:gr("Year"),hideLabelFromVision:!0,__next36pxDefaultSize:!0,value:s,step:1,min:1,max:9999,required:!0,spinControls:"none",isPressEnterToChange:!0,isDragEnabled:!1,isShiftStepEnabled:!1,onChange:d("year"),__unstableStateReducer:Xme(4)}))))};const Vme=lE($Q,{target:"e1p5onf01"})({name:"1khn195",styles:"box-sizing:border-box"}),Ume=lE("div",{target:"e1p5onf00"})({name:"l0rwn2",styles:"min-width:260px"}),$me=()=>{};const Gme=(0,Bt.forwardRef)((function(e,t){let{currentDate:n,is12Hour:o,isInvalidDate:r,onMonthPreviewed:a=$me,onChange:i,events:l,startOfWeek:s,__nextRemoveHelpButton:c=!1,__nextRemoveResetButton:u=!1}=e;c||jo("Help button in wp.components.DateTimePicker",{since:"13.4",version:"15.8",hint:"Set the `__nextRemoveHelpButton` prop to `true` to remove this warning and opt in to the new behaviour, which will become the default in a future version."}),u||jo("Reset button in wp.components.DateTimePicker",{since:"13.4",version:"15.8",hint:"Set the `__nextRemoveResetButton` prop to `true` to remove this warning and opt in to the new behaviour, which will become the default in a future version."});const[p,d]=(0,Bt.useState)(!1);return(0,Bt.createElement)(Vme,{ref:t,className:"components-datetime",spacing:4},!p&&(0,Bt.createElement)(Bt.Fragment,null,(0,Bt.createElement)(jme,{currentTime:n,onChange:i,is12Hour:o}),(0,Bt.createElement)(qme,{currentDate:n,onChange:i,isInvalidDate:r,events:l,onMonthPreviewed:a,startOfWeek:s})),p&&(0,Bt.createElement)(Ume,{className:"components-datetime__calendar-help"},(0,Bt.createElement)(RX,{level:4},gr("Click to Select")),(0,Bt.createElement)("ul",null,(0,Bt.createElement)("li",null,gr("Click the right or left arrows to select other months in the past or the future.")),(0,Bt.createElement)("li",null,gr("Click the desired day to select it."))),(0,Bt.createElement)(RX,{level:4},gr("Navigating with a keyboard")),(0,Bt.createElement)("ul",null,(0,Bt.createElement)("li",null,(0,Bt.createElement)("abbr",{"aria-label":Or("Enter","keyboard button")},"↵")," ",(0,Bt.createElement)("span",null,gr("Select the date in focus."))),(0,Bt.createElement)("li",null,(0,Bt.createElement)("abbr",{"aria-label":gr("Left and Right Arrows")},"←/→")," ",gr("Move backward (left) or forward (right) by one day.")),(0,Bt.createElement)("li",null,(0,Bt.createElement)("abbr",{"aria-label":gr("Up and Down Arrows")},"↑/↓")," ",gr("Move backward (up) or forward (down) by one week.")),(0,Bt.createElement)("li",null,(0,Bt.createElement)("abbr",{"aria-label":gr("Page Up and Page Down")},gr("PgUp/PgDn"))," ",gr("Move backward (PgUp) or forward (PgDn) by one month.")),(0,Bt.createElement)("li",null,(0,Bt.createElement)("abbr",{"aria-label":gr("Home and End")},gr("Home/End"))," ",gr("Go to the first (Home) or last (End) day of a week.")))),(!u||!c)&&(0,Bt.createElement)(lD,{className:"components-datetime__buttons"},!u&&!p&&n&&(0,Bt.createElement)(bE,{className:"components-datetime__date-reset-button",variant:"link",onClick:()=>null==i?void 0:i(null)},gr("Reset")),(0,Bt.createElement)(cF,null),!c&&(0,Bt.createElement)(bE,{className:"components-datetime__date-help-toggle",variant:"link",onClick:function(){d(!p)}},gr(p?"Close":"Calendar Help"))))})),Kme=Gme;function Jme(e){let{title:t,help:n,actions:o=[],onClose:r}=e;return(0,Bt.createElement)($Q,{className:"block-editor-inspector-popover-header",spacing:4},(0,Bt.createElement)(lD,{alignment:"center"},(0,Bt.createElement)(RX,{className:"block-editor-inspector-popover-header__heading",level:2,size:13},t),(0,Bt.createElement)(cF,null),o.map((e=>{let{label:t,icon:n,onClick:o}=e;return(0,Bt.createElement)(bE,{key:t,className:"block-editor-inspector-popover-header__action",label:t,icon:n,variant:!n&&"tertiary",onClick:o},!n&&t)})),r&&(0,Bt.createElement)(bE,{className:"block-editor-inspector-popover-header__action",label:gr("Close"),icon:fK,onClick:r})),n&&(0,Bt.createElement)(kP,null,n))}const Zme=(0,Bt.forwardRef)((function(e,t){let{onClose:n,onChange:o,...r}=e;return(0,Bt.createElement)("div",{ref:t,className:"block-editor-publish-date-time-picker"},(0,Bt.createElement)(Jme,{title:gr("Publish"),actions:[{label:gr("Now"),onClick:()=>null==o?void 0:o(null)}],onClose:n}),(0,Bt.createElement)(Kme,Pt({startOfWeek:Xie().l10n.startOfWeek,__nextRemoveHelpButton:!0,__nextRemoveResetButton:!0,onChange:o},r)))})),Qme={button:"wp-element-button",caption:"wp-element-caption"},eMe=e=>Qme[e]?Qme[e]:"";function tMe(e,t){return Object.entries(t).every((t=>{let[n,o]=t;return"object"==typeof o&&"object"==typeof e[n]?tMe(e[n],o):e[n]===o}))}const nMe=(e,t)=>{if(!t||!e)return;const n=t.filter((t=>{let{attributes:n}=t;return!(!n||!Object.keys(n).length)&&tMe(e,n)}));return 1===n.length?n[0]:void 0},oMe={__experimentalBorder:"border",color:"color",spacing:"spacing",typography:"typography"};function rMe(e){var t;const n="var:";if(null!=e&&null!==(t=e.startsWith)&&void 0!==t&&t.call(e,n)){return`var(--wp--${e.slice(n.length).split("|").join("--")})`}return e}function aMe(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"*",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return GD.reduce(((n,o)=>{let{path:r,cssVarInfix:a,classes:i}=o;if(!i)return n;const l=(0,Ht.get)(t,r,[]);return["default","theme","custom"].forEach((t=>{l[t]&&l[t].forEach((t=>{let{slug:o}=t;i.forEach((t=>{let{classSuffix:r,propertyName:i}=t;const l=`.has-${(0,Ht.kebabCase)(o)}-${r}`,s=e.split(",").map((e=>`${e}${l}`)).join(","),c=`var(--wp--preset--${a}--${(0,Ht.kebabCase)(o)})`;n+=`${s}{${i}: ${c} !important;}`}))}))})),n}),"")}function iMe(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,o=[];return Object.keys(e).forEach((r=>{const a=t+(0,Ht.kebabCase)(r.replace("/","-")),i=e[r];if(i instanceof Object){const e=a+n;o=[...o,...iMe(i,e,n)]}else o.push(`${a}: ${i}`)})),o}function lMe(e,t){const n=e.split(","),o=[];return n.forEach((e=>{o.push(`${t.trim()}${e.trim()}`)})),o.join(", ")}const sMe=(e,t)=>{const n={};return Object.entries(e).forEach((e=>{let[o,r]=e;if("root"===o||null==t||!t[o])return;const a="string"==typeof r;if(a||Object.entries(r).forEach((e=>{let[r,a]=e;if("root"===r||null==t||!t[o][r])return;const i=cMe({[o]:{[r]:t[o][r]}});n[a]=[...n[a]||[],...i],delete t[o][r]})),a||r.root){const e=a?r:r.root,i=cMe({[o]:t[o]});n[e]=[...n[e]||[],...i],delete t[o]}})),n};function cMe(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r=$D===t,a=Object.entries(sa).reduce(((t,o)=>{let[a,{value:i,properties:l,useEngine:s,rootOnly:c}]=o;if(c&&!r)return t;const u=i;if("elements"===u[0]||s)return t;const p=(0,Ht.get)(e,u);if("--wp--style--root--padding"===a&&("string"==typeof p||!n))return t;if(l&&"string"!=typeof p)Object.entries(l).forEach((e=>{const[n,o]=e;if(!(0,Ht.get)(p,[o],!1))return;const r=n.startsWith("--")?n:(0,Ht.kebabCase)(n);t.push(`${r}: ${rMe((0,Ht.get)(p,[o]))}`)}));else if((0,Ht.get)(e,u,!1)){const n=a.startsWith("--")?a:(0,Ht.kebabCase)(a);t.push(`${n}: ${rMe((0,Ht.get)(e,u))}`)}return t}),[]),i=tY(e);return i.forEach((e=>{var t;if(r&&n&&e.key.startsWith("padding"))return;const i=e.key.startsWith("--")?e.key:(0,Ht.kebabCase)(e.key);let l=e.value;if("string"!=typeof l&&null!==(t=l)&&void 0!==t&&t.ref){var s;const e=l.ref.split(".");if(l=(0,Ht.get)(o,e),!l||null!==(s=l)&&void 0!==s&&s.ref)return}var c;"font-size"===i&&(l=UD({size:l},null==o||null===(c=o.settings)||void 0===c?void 0:c.typography));a.push(`${i}: ${l}`)})),a}function uMe(e){var t,n,o,r,a;let{tree:i,style:l,selector:s,hasBlockGapSupport:c,hasFallbackGapSupport:u,fallbackGapValue:p}=e,d="",b=c?AD(null==l||null===(t=l.spacing)||void 0===t?void 0:t.blockGap):"";if(u&&(s===$D?b=b||"0.5em":!c&&p&&(b=p)),b&&null!=i&&null!==(n=i.settings)&&void 0!==n&&null!==(o=n.layout)&&void 0!==o&&o.definitions&&(Object.values(i.settings.layout.definitions).forEach((e=>{let{className:t,name:n,spacingStyles:o}=e;(c||"flex"===n)&&null!=o&&o.length&&o.forEach((e=>{const n=[];if(e.rules&&Object.entries(e.rules).forEach((e=>{let[t,o]=e;n.push(`${t}: ${o||b}`)})),n.length){let o="";o=c?s===$D?`:where(${s} .${t})${(null==e?void 0:e.selector)||""}`:`${s}-${t}${(null==e?void 0:e.selector)||""}`:s===$D?`:where(.${t}${(null==e?void 0:e.selector)||""})`:`:where(${s}.${t}${(null==e?void 0:e.selector)||""})`,d+=`${o} { ${n.join("; ")}; }`}}))})),s===$D&&c&&(d+=`${s} { --wp--style--block-gap: ${b}; }`)),s===$D&&null!=i&&null!==(r=i.settings)&&void 0!==r&&null!==(a=r.layout)&&void 0!==a&&a.definitions){const e=["block","flex","grid"];Object.values(i.settings.layout.definitions).forEach((t=>{let{className:n,displayMode:o,baseStyles:r}=t;o&&e.includes(o)&&(d+=`${s} .${n} { display:${o}; }`),null!=r&&r.length&&r.forEach((e=>{const t=[];if(e.rules&&Object.entries(e.rules).forEach((e=>{let[n,o]=e;t.push(`${n}: ${o}`)})),t.length){const o=`${s} .${n}${(null==e?void 0:e.selector)||""}`;d+=`${o} { ${t.join("; ")}; }`}}))}))}return d}const pMe=(e,t)=>{var n,o;const r=[];if(null==e||!e.styles)return r;const a=e=>Object.fromEntries(Object.entries(null!=e?e:{}).filter((e=>{let[t]=e;return["border","color","dimensions","spacing","typography","filter","outline","shadow"].includes(t)}))),i=a(e.styles);return i&&r.push({styles:i,selector:$D}),Object.entries(ca).forEach((t=>{var n,o;let[a,i]=t;var l,s;null!==(n=e.styles)&&void 0!==n&&null!==(o=n.elements)&&void 0!==o&&o[a]&&r.push({styles:null===(l=e.styles)||void 0===l||null===(s=l.elements)||void 0===s?void 0:s[a],selector:i})})),Object.entries(null!==(n=null===(o=e.styles)||void 0===o?void 0:o.blocks)&&void 0!==n?n:{}).forEach((e=>{var n,o;let[i,l]=e;const s=a(l);if(null!=l&&l.variations){const e={};Object.keys(l.variations).forEach((t=>{e[t]=a(l.variations[t])})),s.variations=e}var c;s&&null!=t&&null!==(n=t[i])&&void 0!==n&&n.selector&&r.push({duotoneSelector:t[i].duotoneSelector,fallbackGapValue:t[i].fallbackGapValue,hasLayoutSupport:t[i].hasLayoutSupport,selector:null===(c=t[i])||void 0===c?void 0:c.selector,styles:s,featureSelectors:t[i].featureSelectors,styleVariationSelectors:t[i].styleVariationSelectors});Object.entries(null!==(o=null==l?void 0:l.elements)&&void 0!==o?o:{}).forEach((e=>{let[n,o]=e;var a;o&&null!=t&&t[i]&&null!=ca&&ca[n]&&r.push({styles:o,selector:null===(a=t[i])||void 0===a?void 0:a.selector.split(",").map((e=>ca[n].split(",").map((t=>e+" "+t)))).join(",")})}))})),r},dMe=(e,t)=>{var n,o,r;const a=[];if(null==e||!e.settings)return a;const i=e=>{const t={};return GD.forEach((n=>{let{path:o}=n;const r=(0,Ht.get)(e,o,!1);!1!==r&&(0,Ht.set)(t,o,r)})),t},l=i(e.settings),s=null===(n=e.settings)||void 0===n?void 0:n.custom;return(0,Ht.isEmpty)(l)&&!s||a.push({presets:l,custom:s,selector:$D}),Object.entries(null!==(o=null===(r=e.settings)||void 0===r?void 0:r.blocks)&&void 0!==o?o:{}).forEach((e=>{let[n,o]=e;const r=i(o),l=o.custom;var s;(0,Ht.isEmpty)(r)&&!l||a.push({presets:r,custom:l,selector:null===(s=t[n])||void 0===s?void 0:s.selector})})),a},bMe=(e,t)=>{const n=dMe(e,t);let o="";return n.forEach((t=>{let{presets:n,custom:r,selector:a}=t;const i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return GD.reduce(((n,o)=>{let{path:r,valueKey:a,valueFunc:i,cssVarInfix:l}=o;const s=(0,Ht.get)(e,r,[]);return["default","theme","custom"].forEach((e=>{s[e]&&s[e].forEach((e=>{a&&!i?n.push(`--wp--preset--${l}--${(0,Ht.kebabCase)(e.slug)}: ${e[a]}`):i&&"function"==typeof i&&n.push(`--wp--preset--${l}--${(0,Ht.kebabCase)(e.slug)}: ${i(e,t)}`)}))})),n}),[])}(n,null==e?void 0:e.settings),l=iMe(r,"--wp--custom--","--");l.length>0&&i.push(...l),i.length>0&&(o+=`${a}{${i.join(";")};}`)})),o};function mMe(e,t){return dMe(e,t).flatMap((e=>{let{presets:t}=e;return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return GD.filter((e=>"duotone"===e.path.at(-1))).flatMap((t=>{const n=(0,Ht.get)(e,t.path,{});return["default","theme"].filter((e=>n[e])).flatMap((e=>n[e].map((e=>gs((0,Bt.createElement)(Oae,{preset:e,key:e.slug})))))).join("")}))}(t)}))}const MMe=(e,t)=>{const n={};return e.forEach((e=>{var o,r,a,i;const l=e.name,s=vae(e);let c=vae(e,"filter.duotone");if(!c){const t=vae(e),n=Ba(e,"color.__experimentalDuotone",!1);c=n&&eI(t,n)}const u=!(null==e||null===(o=e.supports)||void 0===o||!o.__experimentalLayout),p=null==e||null===(r=e.supports)||void 0===r||null===(a=r.spacing)||void 0===a||null===(i=a.blockGap)||void 0===i?void 0:i.__experimentalDefault,d=t(l),b={};null!=d&&d.length&&d.forEach((e=>{const t=`.is-style-${e.name}${s}`;b[e.name]=t}));const m=((e,t)=>{if(!(0,Ht.isEmpty)(null==e?void 0:e.selectors))return e.selectors;const n={root:t};return Object.entries(oMe).forEach((t=>{let[o,r]=t;const a=vae(e,o);a&&(n[r]=a)})),n})(e,s);n[l]={duotoneSelector:c,fallbackGapValue:p,featureSelectors:Object.keys(m).length?m:void 0,hasLayoutSupport:u,name:l,selector:s,styleVariationSelectors:Object.keys(b).length?b:void 0}})),n};const zMe=(e,t)=>{let n="";return e.split("&").forEach((e=>{n+=e.includes("{")?t+e:t+"{"+e+"}"})),n};function fMe(){let{merged:e}=(0,Bt.useContext)(tI);const[t]=aI("spacing.blockGap"),n=null!==t,o=!n,r=fp((e=>{const{getSettings:t}=e(wN);return!!t().disableLayoutStyles})),a=fp((e=>e(kl).getBlockStyles),[]);return(0,Bt.useMemo)((()=>{var t,i,l;if(null===(t=e)||void 0===t||!t.styles||null===(i=e)||void 0===i||!i.settings)return[];e=function(e){var t,n,o,r,a,i,l,s,c,u,p,d;return!(null===(t=e.styles)||void 0===t||null===(n=t.blocks)||void 0===n?void 0:n["core/separator"])||!(null===(o=e.styles)||void 0===o||null===(r=o.blocks)||void 0===r||null===(a=r["core/separator"].color)||void 0===a?void 0:a.background)||null!==(i=e.styles)&&void 0!==i&&null!==(l=i.blocks)&&void 0!==l&&null!==(s=l["core/separator"].color)&&void 0!==s&&s.text||null!==(c=e.styles)&&void 0!==c&&null!==(u=c.blocks)&&void 0!==u&&null!==(p=u["core/separator"].border)&&void 0!==p&&p.color?e:{...e,styles:{...e.styles,blocks:{...e.styles.blocks,"core/separator":{...e.styles.blocks["core/separator"],color:{...e.styles.blocks["core/separator"].color,text:null===(d=e.styles)||void 0===d?void 0:d.blocks["core/separator"].color.background}}}}}}(e);const s=MMe(Ta(),a),c=bMe(e,s),u=function(e,t,n,o){var r,a;let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const l=pMe(e,t),s=dMe(e,t),c=null==e||null===(r=e.settings)||void 0===r?void 0:r.useRootPaddingAwareAlignments,{contentSize:u,wideSize:p}=(null==e||null===(a=e.settings)||void 0===a?void 0:a.layout)||{};let d="body {margin: 0;";if(u&&(d+=` --wp--style--global--content-size: ${u};`),p&&(d+=` --wp--style--global--wide-size: ${p};`),c&&(d+="padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) }\n\t\t\t.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t.has-global-padding :where(.has-global-padding) { padding-right: 0; padding-left: 0; }\n\t\t\t.has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); }\n\t\t\t.has-global-padding :where(.has-global-padding) > .alignfull { margin-right: 0; margin-left: 0; }\n\t\t\t.has-global-padding > .alignfull:where(:not(.has-global-padding)) > :where(.wp-block:not(.alignfull),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t.has-global-padding :where(.has-global-padding) > .alignfull:where(:not(.has-global-padding)) > :where(.wp-block:not(.alignfull),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: 0; padding-left: 0;"),d+="}",l.forEach((t=>{let{selector:r,duotoneSelector:a,styles:l,fallbackGapValue:s,hasLayoutSupport:u,featureSelectors:p,styleVariationSelectors:b}=t;if(p){const e=sMe(p,l);Object.entries(e).forEach((e=>{let[t,n]=e;if(n.length){const e=n.join(";");d+=`${t}{${e}}`}}))}b&&Object.entries(b).forEach((t=>{var n;let[o,r]=t;if(null!=l&&null!==(n=l.variations)&&void 0!==n&&n[o]){var a;if(p){var i;const e=sMe(p,null==l||null===(i=l.variations)||void 0===i?void 0:i[o]);Object.entries(e).forEach((e=>{let[t,n]=e;if(n.length){const e=lMe(t,r),o=n.join(";");d+=`${e}{${o}}`}}))}const t=cMe(null==l||null===(a=l.variations)||void 0===a?void 0:a[o],r,c,e);t.length&&(d+=`${r}{${t.join(";")}}`)}}));const m={};if(null!=l&&l.filter&&(m.filter=l.filter,delete l.filter),a){const e=cMe(m);e.length>0&&(d+=`${a}{${e.join(";")};}`)}i||$D!==r&&!u||(d+=uMe({tree:e,style:l,selector:r,hasBlockGapSupport:n,hasFallbackGapSupport:o,fallbackGapValue:s}));const M=cMe(l,r,c,e);null!=M&&M.length&&(d+=`${r}{${M.join(";")};}`);const z=Object.entries(l).filter((e=>{let[t]=e;return t.startsWith(":")}));null!=z&&z.length&&z.forEach((e=>{let[t,n]=e;const o=cMe(n);if(null==o||!o.length)return;const a=`${r.split(",").map((e=>e+t)).join(",")}{${o.join(";")};}`;d+=a}))})),d+=".wp-site-blocks > .alignleft { float: left; margin-right: 2em; }",d+=".wp-site-blocks > .alignright { float: right; margin-left: 2em; }",d+=".wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }",n){var b,m;const t=AD(null==e||null===(b=e.styles)||void 0===b||null===(m=b.spacing)||void 0===m?void 0:m.blockGap)||"0.5em";d+=`:where(.wp-site-blocks) > * { margin-block-start: ${t}; margin-block-end: 0; }`,d+=":where(.wp-site-blocks) > :first-child:first-child { margin-block-start: 0; }",d+=":where(.wp-site-blocks) > :last-child:last-child { margin-block-end: 0; }"}return s.forEach((e=>{let{selector:t,presets:n}=e;$D===t&&(t="");const o=aMe(t,n);(0,Ht.isEmpty)(o)||(d+=o)})),d}(e,s,n,o,r),p=mMe(e,s),d=[{css:c,isGlobalStyles:!0},{css:u,isGlobalStyles:!0},{css:null!==(l=e.styles.css)&&void 0!==l?l:"",isGlobalStyles:!0},{assets:p,__unstableType:"svg",isGlobalStyles:!0}];return Ta().forEach((t=>{var n;if(null!==(n=e.styles.blocks[t.name])&&void 0!==n&&n.css){var o;const n=s[t.name].selector;d.push({css:zMe(null===(o=e.styles.blocks[t.name])||void 0===o?void 0:o.css,n),isGlobalStyles:!0})}})),[d,e.settings]}),[n,o,e,r])}const hMe=(0,Bt.createElement)(rk,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,Bt.createElement)(nk,{d:"M12 8c-2.2 0-4 1.8-4 4s1.8 4 4 4 4-1.8 4-4-1.8-4-4-4zm0 6.5c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5zM12.8 3h-1.5v3h1.5V3zm-1.6 18h1.5v-3h-1.5v3zm6.8-9.8v1.5h3v-1.5h-3zm-12 0H3v1.5h3v-1.5zm9.7 5.6 2.1 2.1 1.1-1.1-2.1-2.1-1.1 1.1zM8.3 7.2 6.2 5.1 5.1 6.2l2.1 2.1 1.1-1.1zM5.1 17.8l1.1 1.1 2.1-2.1-1.1-1.1-2.1 2.1zM18.9 6.2l-1.1-1.1-2.1 2.1 1.1 1.1 2.1-2.1z"}));function gMe(e){return OMe(e)}function OMe(e){return!(null==e||!e.shadow)}function vMe(e){let{resetAllFilter:t,onChange:n,value:o,panelId:r,children:a}=e;return(0,Bt.createElement)(ZX,{label:gr("Effects"),resetAll:()=>{const e=t(o);n(e)},panelId:r},a)}const AMe={shadow:!0};function yMe(e){let{as:t=vMe,value:n,onChange:o,inheritedValue:r=n,settings:a,panelId:i,defaultControls:l=AMe}=e;const s=OMe(a),c=(u=null==r?void 0:r.shadow,QD({settings:a},"",u));var u;const p=e=>{o(pI(n,["shadow"],e))},d=(0,Bt.useCallback)((e=>({...e,shadow:void 0})),[]);return(0,Bt.createElement)(t,{resetAllFilter:d,value:n,onChange:o,panelId:i},s&&(0,Bt.createElement)(s6,{label:gr("Shadow"),hasValue:()=>!(null==n||!n.shadow),onDeselect:()=>p(void 0),isShownByDefault:l.shadow,panelId:i},(0,Bt.createElement)(rQ,{isBordered:!0,isSeparated:!0},(0,Bt.createElement)(_Me,{shadow:c,onShadowChange:p,settings:a}))))}const _Me=e=>{let{shadow:t,onShadowChange:n,settings:o}=e;return(0,Bt.createElement)(BW,{popoverProps:{placement:"left-start",offset:36,shift:!0},className:"block-editor-global-styles-effects-panel__shadow-dropdown",renderToggle:e=>{let{onToggle:t,isOpen:n}=e;const o={onClick:t,className:eM()({"is-open":n}),"aria-expanded":n};return(0,Bt.createElement)(bE,o,(0,Bt.createElement)(lD,{justify:"flex-start"},(0,Bt.createElement)(AF,{className:"block-editor-global-styles-effects-panel__toggle-icon",icon:hMe,size:24}),(0,Bt.createElement)(cT,null,gr("Shadow"))))},renderContent:()=>(0,Bt.createElement)(T9,{paddingSize:"medium"},(0,Bt.createElement)(qMe,{shadow:t,onShadowChange:n,settings:o}))})};function qMe(e){var t,n,o,r,a;let{shadow:i,onShadowChange:l,settings:s}=e;const c=null==s||null===(t=s.shadow)||void 0===t||null===(n=t.presets)||void 0===n?void 0:n.default,u=null==s||null===(o=s.shadow)||void 0===o||null===(r=o.presets)||void 0===r?void 0:r.theme,p=[...(null==s||null===(a=s.shadow)||void 0===a?void 0:a.defaultPresets)?c:[],...u||[]];return(0,Bt.createElement)("div",{className:"block-editor-global-styles-effects-panel__shadow-popover-container"},(0,Bt.createElement)($Q,{spacing:4},(0,Bt.createElement)(RX,{level:5},gr("Shadow")),(0,Bt.createElement)(kMe,{presets:p,activeShadow:i,onSelect:l})))}function kMe(e){let{presets:t,activeShadow:n,onSelect:o}=e;return t?(0,Bt.createElement)(JX,{columns:6,gap:0,align:"center",justify:"center"},t.map((e=>{let{name:t,slug:r,shadow:a}=e;return(0,Bt.createElement)(wMe,{key:r,label:t,isActive:a===n,onSelect:()=>o(a===n?void 0:a),shadow:a})}))):null}function wMe(e){let{label:t,isActive:n,onSelect:o,shadow:r}=e;return(0,Bt.createElement)("div",{className:"block-editor-global-styles-effects-panel__shadow-indicator-wrapper"},(0,Bt.createElement)(bE,{className:"block-editor-global-styles-effects-panel__shadow-indicator",onClick:o,label:t,style:{boxShadow:r},showTooltip:!0},n&&(0,Bt.createElement)(AF,{icon:xX})))}const EMe=[];function WMe(e,t){var n,o,r,a,i,l,s;let{presetSetting:c,defaultSetting:u}=t;const p=!(null!=e&&null!==(n=e.color)&&void 0!==n&&n[u]),d=(null==e||null===(o=e.color)||void 0===o||null===(r=o[c])||void 0===r?void 0:r.custom)||EMe,b=(null==e||null===(a=e.color)||void 0===a||null===(i=a[c])||void 0===i?void 0:i.theme)||EMe,m=(null==e||null===(l=e.color)||void 0===l||null===(s=l[c])||void 0===s?void 0:s.default)||EMe;return(0,Bt.useMemo)((()=>[...d,...b,...p?EMe:m]),[p,d,b,m])}function LMe(e){return xMe(e)}function xMe(e){return e.color.customDuotone||e.color.defaultDuotone}function CMe(e){let{resetAllFilter:t,onChange:n,value:o,panelId:r,children:a}=e;return(0,Bt.createElement)(ZX,{label:gr("Filters"),resetAll:()=>{const e=t(o);n(e)},panelId:r},a)}const RMe={duotone:!0};function SMe(e){var t;let{as:n=CMe,value:o,onChange:r,inheritedValue:a=o,settings:i,panelId:l,defaultControls:s=RMe}=e;const c=xMe(i),u=WMe(i,{presetSetting:"duotone",defaultSetting:"defaultDuotone"}),p=WMe(i,{presetSetting:"palette",defaultSetting:"defaultPalette"}),d=(b=null==a||null===(t=a.filter)||void 0===t?void 0:t.duotone,QD({settings:i},"",b));var b;const m=e=>{const t=u.find((t=>{let{colors:n}=t;return n===e})),n=t?`var:preset|duotone|${t.slug}`:e;r(pI(o,["filter","duotone"],n))},M=(0,Bt.useCallback)((e=>({...e,filter:{...e.filter,duotone:void 0}})),[]);return(0,Bt.createElement)(n,{resetAllFilter:M,value:o,onChange:r,panelId:l},c&&(0,Bt.createElement)(s6,{label:gr("Duotone"),hasValue:()=>{var e;return!(null==o||null===(e=o.filter)||void 0===e||!e.duotone)},onDeselect:()=>m(void 0),isShownByDefault:s.duotone,panelId:l},(0,Bt.createElement)($Q,null,(0,Bt.createElement)("p",null,gr("Create a two-tone color effect without losing your original image.")),(0,Bt.createElement)(mae,{colorPalette:p,duotonePalette:u,disableCustomColors:!0,disableCustomDuotone:!0,value:d,onChange:m}))))}const NMe=["core/navigation-link/page","core/navigation-link"],TMe=(0,Bt.forwardRef)(((e,t)=>{let{nestingLevel:n,blockCount:o,clientId:r,...a}=e;const[i,l]=(0,Bt.useState)(null),s=Tz(TMe),{hideInserter:c}=fp((e=>{const{getTemplateLock:t,__unstableGetEditorMode:n}=e(wN);return{hideInserter:!!t(r)||"zoom-out"===n()}}),[r]),u=W1({clientId:r,context:"list-view"}),p=W1({clientId:null==i?void 0:i.clientId,context:"list-view"});(0,Bt.useEffect)((()=>{null!=p&&p.length&&vx(lr(gr("%s block inserted"),p),"assertive")}),[p]);const d=(0,Bt.useCallback)((e=>(e.sort(((e,t)=>{let{id:n}=e,{id:o}=t,r=NMe.indexOf(n),a=NMe.indexOf(o);return r<0&&(r=NMe.length),a<0&&(a=NMe.length),r-a})),e)),[]);if(c)return null;const{PrivateInserter:b}=qN(Jze),m=`off-canvas-editor-appender__${s}`,M=lr(gr("Append to %1$s block at position %2$d, Level %3$d"),u,o+1,n);return(0,Bt.createElement)("div",{className:"offcanvas-editor-appender"},(0,Bt.createElement)(b,Pt({ref:t,rootClientId:r,position:"bottom right",isAppender:!0,selectBlockOnInsert:!1,shouldDirectInsert:!1,__experimentalIsQuick:!0},a,{toggleProps:{"aria-describedby":m},onSelectOrClose:e=>{null!=e&&e.clientId&&l(e)},orderInitialBlockItems:d})),(0,Bt.createElement)("div",{className:"offcanvas-editor-appender__description",id:m},M))})),BMe=LG(uce);function DMe(e){let{isSelected:t,position:n,level:o,rowCount:r,children:a,className:i,path:l,...s}=e;const c=RG({isSelected:t,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:l});return(0,Bt.createElement)(BMe,Pt({ref:c,className:eM()("block-editor-list-view-leaf","offcanvas-editor-list-view-leaf",i),level:o,positionInSet:n,setSize:r},s),a)}function IMe(e){let{onClick:t}=e;return(0,Bt.createElement)("span",{className:"block-editor-list-view__expander",onClick:e=>t(e,{forceToggle:!0}),"aria-hidden":"true"},(0,Bt.createElement)(AF,{icon:Ar()?Ace:xie}))}const PMe=(0,Bt.forwardRef)((function(e,t){let{className:n,block:o,onClick:r,onToggleExpanded:a,tabIndex:i,onFocus:l,onDragStart:s,onDragEnd:c,draggable:u}=e;const{clientId:p}=o,d=E1(p),b=W1({clientId:p,context:"list-view"}),{isLocked:m}=a3(p),M=d?lr(gr("Edit %s block"),d.title):gr("Edit");return(0,Bt.createElement)(Bt.Fragment,null,(0,Bt.createElement)(bE,{className:eM()("block-editor-list-view-block-select-button",n),onClick:r,onKeyDown:function(e){e.keyCode!==cq&&32!==e.keyCode||r(e)},ref:t,tabIndex:i,onFocus:l,onDragStart:e=>{e.dataTransfer.clearData(),null==s||s(e)},onDragEnd:c,draggable:u,href:`#block-${p}`,"aria-hidden":!0,title:M},(0,Bt.createElement)(IMe,{onClick:a}),(0,Bt.createElement)(IK,{icon:null==d?void 0:d.icon,showColors:!0,context:"list-view"}),(0,Bt.createElement)(lD,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1},(0,Bt.createElement)("span",{className:"block-editor-list-view-block-select-button__title"},(0,Bt.createElement)(AZ,{ellipsizeMode:"auto"},b)),(null==d?void 0:d.anchor)&&(0,Bt.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor-wrapper"},(0,Bt.createElement)(AZ,{className:"block-editor-list-view-block-select-button__anchor",ellipsizeMode:"auto"},d.anchor)),m&&(0,Bt.createElement)("span",{className:"block-editor-list-view-block-select-button__lock"},(0,Bt.createElement)(AF,{icon:vce})))))}));function HMe(e,t){switch(e){case"post":case"page":return{type:"post",subtype:e};case"category":return{type:"term",subtype:"category"};case"tag":return{type:"term",subtype:"post_tag"};case"post_format":return{type:"post-format"};default:return"taxonomy"===t?{type:"term",subtype:e}:"post-type"===t?{type:"post",subtype:e}:{}}}function FMe(e){let{clientId:t}=e;const{getBlock:n,blockTransforms:o}=fp((e=>{const{getBlock:n,getBlockRootClientId:o,getBlockTransformItems:r}=e(wN);return{getBlock:n,blockTransforms:r(n(t),o(t))}}),[t]),{replaceBlock:r}=Lm(wN),a=["core/page-list","core/site-logo","core/social-links","core/search"],i=o.filter((e=>a.includes(e.name)));return null!=i&&i.length&&t?(0,Bt.createElement)("div",{className:"link-control-transform"},(0,Bt.createElement)("h3",{className:"link-control-transform__subheading"},gr("Transform")),(0,Bt.createElement)("div",{className:"link-control-transform__items"},i.map((e=>(0,Bt.createElement)(bE,{key:`transform-${e.name}`,onClick:()=>r(t,si(n(t),e.name)),className:"link-control-transform__item"},(0,Bt.createElement)(IK,{icon:e.icon}),e.title))))):null}function YMe(e){const{label:t,url:n,opensInNewTab:o,type:r,kind:a}=e.link,i={url:n,opensInNewTab:o,title:t&&aa(t)};return(0,Bt.createElement)(gw,{placement:"bottom",onClose:e.onClose,anchor:e.anchor,shift:!0},(0,Bt.createElement)(tce,{hasTextControl:!0,hasRichPreviews:!0,className:e.className,value:i,showInitialSuggestions:!0,withCreateSuggestion:e.hasCreateSuggestion,noDirectEntry:!!r,noURLSuggestion:!!r,suggestionsQuery:HMe(r,a),onChange:e.onChange,onRemove:e.onRemove,onCancel:e.onCancel,renderControlBottom:n?null:()=>(0,Bt.createElement)(FMe,{clientId:e.clientId})}))}const XMe=(0,Bt.createContext)({}),jMe=()=>(0,Bt.useContext)(XMe),VMe=["core/navigation-link","core/navigation-submenu"],UMe=(0,Bt.forwardRef)(((e,t)=>{let{onClick:n,onToggleExpanded:o,block:r,isSelected:a,position:i,siblingBlockCount:l,level:s,isExpanded:c,selectedClientIds:u,...p}=e;const{clientId:d}=r,[b,m]=(0,Bt.useState)(),{blockMovingClientId:M,selectedBlockInBlockEditor:z,lastInsertedBlockClientId:f}=fp((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n,getLastInsertedBlocksClientIds:o}=qN(e(wN)),r=o();return{blockMovingClientId:t(),selectedBlockInBlockEditor:n(),lastInsertedBlockClientId:r&&r[0]}}),[d]),{insertedBlockAttributes:h,insertedBlockName:g,setInsertedBlockAttributes:O}=(e=>{const{insertedBlockAttributes:t,insertedBlockName:n}=fp((t=>{const{getBlockName:n,getBlockAttributes:o}=t(wN);return{insertedBlockAttributes:o(e),insertedBlockName:n(e)}}),[e]),{updateBlockAttributes:o}=Lm(wN),r=t=>{e&&o(e,t)};return e?{insertedBlockAttributes:t,insertedBlockName:n,setInsertedBlockAttributes:r}:{insertedBlockAttributes:void 0,insertedBlockName:void 0,setInsertedBlockAttributes:r}})(f),v=null==h?void 0:h.url;(0,Bt.useEffect)((()=>{d===f&&null!=VMe&&VMe.includes(g)&&!v&&m(!0)}),[f,d,g,v]);const{renderAdditionalBlockUI:A}=jMe(),y=M&&z===d,_=eM()("block-editor-list-view-block-contents",{"is-dropping-before":y}),q=u.includes(d)?u:[d];return(0,Bt.createElement)(Bt.Fragment,null,A&&A(r),b&&(0,Bt.createElement)(YMe,{clientId:f,link:h,onClose:()=>m(!1),hasCreateSuggestion:!1,onChange:e=>{!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{label:o="",kind:r="",type:a=""}=n,{title:i="",url:l="",opensInNewTab:s,id:c,kind:u=r,type:p=a}=e,d=i.replace(/http(s?):\/\//gi,""),b=l.replace(/http(s?):\/\//gi,""),m=i&&i!==o&&d!==b?$l(i):o||$l(b),M="post_tag"===p?"tag":p.replace("-","_"),z=["post","page","tag","category"].indexOf(M)>-1,f=!u&&!z||"custom"===u?"custom":u;t({...l&&{url:encodeURI(pse(l))},...m&&{label:m},...void 0!==s&&{opensInNewTab:s},...c&&Number.isInteger(c)&&{id:c},...f&&{kind:f},...M&&"URL"!==M&&{type:M}})}(e,O,h),m(!1)},onCancel:()=>m(!1)}),(0,Bt.createElement)(x1,{clientIds:q},(e=>{let{draggable:u,onDragStart:d,onDragEnd:b}=e;return(0,Bt.createElement)(PMe,Pt({ref:t,className:_,block:r,onClick:n,onToggleExpanded:o,isSelected:a,position:i,siblingBlockCount:l,level:s,draggable:u,onDragStart:d,onDragEnd:b,isExpanded:c},p))})))})),$Me=UMe;const GMe=(0,Bt.memo)((function e(t){let{block:{clientId:n},isDragged:o,isSelected:r,isBranchSelected:a,selectBlock:i,position:l,level:s,rowCount:c,siblingBlockCount:u,showBlockMovers:p,path:d,isExpanded:b,selectedClientIds:m,preventAnnouncement:M}=t;const z=(0,Bt.useRef)(null),[f,h]=(0,Bt.useState)(!1),{isLocked:g,isContentLocked:O}=a3(n),v=fp((e=>!r&&(!!O&&e(wN).hasSelectedInnerBlock(n,!0))),[O,n,r]),A=v||r&&m[0]===n,y=v||r&&m[m.length-1]===n,{toggleBlockHighlight:_}=Lm(wN),q=E1(n),k=fp((e=>e(wN).getBlock(n)),[n]);(0,Bt.useEffect)((()=>{!x&&r&&z.current.focus()}),[]);const w=(0,Bt.useCallback)((()=>{h(!0),_(n,!0)}),[n,h,_]),E=(0,Bt.useCallback)((()=>{h(!1),_(n,!1)}),[n,h,_]),W=(0,Bt.useCallback)((e=>{i(e,n),e.preventDefault()}),[n,i]),L=(0,Bt.useCallback)((e=>{i(void 0,e)}),[i]),{isTreeGridMounted:x,expand:C,collapse:R,LeafMoreMenu:S}=jMe(),N=(0,Bt.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===b?R(n):!1===b&&C(n)}),[n,C,R,b]),T=Tz(e);if(!k)return null;const B=!!k&&Da(k.name,"__experimentalToolbar",!0),D=`list-view-block-select-button__${T}`,I=((e,t,n)=>lr(gr("Block %1$d of %2$d, Level %3$d"),e,t,n))(l,u,s);let P=gr("Link");q&&(P=lr(gr(g?"%s link (locked)":"%s link"),q.title));const H=q?lr(gr("Options for %s block"),q.title):gr("Options"),F=p&&u>0,Y=eM()("block-editor-list-view-block__mover-cell",{"is-visible":f||r}),X=eM()("block-editor-list-view-block__menu-cell",{"is-visible":f||A});let j;F?j=1:B||(j=2);const V=eM()({"is-selected":r||v,"is-first-selected":A,"is-last-selected":y,"is-branch-selected":a,"is-dragging":o,"has-single-cell":!B}),U=m.includes(n)?m:[n],$=S||A3;return(0,Bt.createElement)(DMe,{className:V,onMouseEnter:w,onMouseLeave:E,onFocus:w,onBlur:E,level:s,position:l,rowCount:c,path:d,id:`list-view-block-${n}`,"data-block":n,isExpanded:O?void 0:b,"aria-selected":!!r||v},(0,Bt.createElement)(zce,{className:"block-editor-list-view-block__contents-cell",colSpan:j,ref:z,"aria-label":P,"aria-selected":!!r||v,"aria-expanded":O?void 0:b,"aria-describedby":D},(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,Bt.createElement)("div",{className:"block-editor-list-view-block__contents-container"},(0,Bt.createElement)($Me,{block:k,onClick:W,onToggleExpanded:N,isSelected:r,position:l,siblingBlockCount:u,level:s,ref:t,tabIndex:n,onFocus:o,isExpanded:b,selectedClientIds:m,preventAnnouncement:M}),(0,Bt.createElement)("div",{className:"block-editor-list-view-block-select-button__description",id:D},I))})),F&&(0,Bt.createElement)(Bt.Fragment,null,(0,Bt.createElement)(zce,{className:Y,withoutGridItem:!0},(0,Bt.createElement)(mce,null,(e=>{let{ref:t,tabIndex:o,onFocus:r}=e;return(0,Bt.createElement)(B1,{orientation:"vertical",clientIds:[n],ref:t,tabIndex:o,onFocus:r})})),(0,Bt.createElement)(mce,null,(e=>{let{ref:t,tabIndex:o,onFocus:r}=e;return(0,Bt.createElement)(D1,{orientation:"vertical",clientIds:[n],ref:t,tabIndex:o,onFocus:r})})))),B&&(0,Bt.createElement)(Bt.Fragment,null,(0,Bt.createElement)(zce,{className:X,"aria-selected":!!r||v},(e=>{let{ref:t,tabIndex:o,onFocus:r}=e;return(0,Bt.createElement)(Bt.Fragment,null,(0,Bt.createElement)($,{clientIds:U,block:k,clientId:n,icon:CX,label:H,toggleProps:{ref:t,className:"block-editor-list-view-block__menu",tabIndex:o,onFocus:r},disableOpenOnArrowDown:!0,__experimentalSelectBlock:L}))}))))}));function KMe(e,t,n,o){var r;if(null==n?void 0:n.includes(e.clientId))return 0;return(null!==(r=t[e.clientId])&&void 0!==r?r:o)?1+e.innerBlocks.reduce(JMe(t,n,o),0):1}const JMe=(e,t,n)=>(o,r)=>{var a;if(null==t?void 0:t.includes(r.clientId))return o;return(null!==(a=e[r.clientId])&&void 0!==a?a:n)&&r.innerBlocks.length>0?o+KMe(r,e,t,n):o+1},ZMe=()=>{};const QMe=(0,Bt.memo)((function e(t){const{blocks:n,selectBlock:o=ZMe,showBlockMovers:r,selectedClientIds:a,level:i=1,path:l="",isBranchSelected:s=!1,listPosition:c=0,fixedListWindow:u,isExpanded:p,parentId:d,shouldShowInnerBlocks:b=!0,showAppender:m=!0}=t,M=fp((e=>!(!d||"contentOnly"!==e(wN).getTemplateLock(d))),[d]),{expandedState:z,draggedClientIds:f}=jMe();if(M)return null;const h=m&&1===i,g=n.filter(Boolean),O=g.length,v=h?O+1:O;let A=c;return(0,Bt.createElement)(Bt.Fragment,null,g.map(((t,n)=>{var c;const{clientId:d,innerBlocks:M}=t;n>0&&(A+=KMe(g[n-1],z,f,p));const{itemInView:h}=u,y=h(A),_=n+1,q=l.length>0?`${l}_${_}`:`${_}`,k=!(null==M||!M.length),w=k&&b?null!==(c=z[d])&&void 0!==c?c:p:void 0,E=!(null==f||!f.includes(d)),W=E||y,L=((e,t)=>Array.isArray(t)&&t.length?-1!==t.indexOf(e):t===e)(d,a),x=s||L&&k;return(0,Bt.createElement)(bp,{key:d,value:!L},W&&(0,Bt.createElement)(GMe,{block:t,selectBlock:o,isSelected:L,isBranchSelected:x,isDragged:E,level:i,position:_,rowCount:v,siblingBlockCount:O,showBlockMovers:r,path:q,isExpanded:w,listPosition:A,selectedClientIds:a}),!W&&(0,Bt.createElement)("tr",null,(0,Bt.createElement)("td",{className:"block-editor-list-view-placeholder"})),k&&w&&!E&&(0,Bt.createElement)(e,{parentId:d,blocks:M,selectBlock:o,showBlockMovers:r,level:i+1,path:q,listPosition:A+1,fixedListWindow:u,isBranchSelected:x,selectedClientIds:a,isExpanded:p,showAppender:m}))})),h&&(0,Bt.createElement)(uce,{level:i,setSize:v,positionInSet:v,isExpanded:!0},(0,Bt.createElement)(zce,null,(e=>(0,Bt.createElement)(TMe,Pt({clientId:d,nestingLevel:i,blockCount:O},e))))))}));function eze(e){let{listViewRef:t,blockDropTarget:n}=e;const{rootClientId:o,clientId:r,dropPosition:a}=n||{},[i,l]=(0,Bt.useMemo)((()=>{if(!t.current)return[];return[o?t.current.querySelector(`[data-block="${o}"]`):void 0,r?t.current.querySelector(`[data-block="${r}"]`):void 0]}),[o,r]),s=l||i,c=(0,Bt.useCallback)((()=>{if(!i)return 0;const e=s.getBoundingClientRect();return i.querySelector(".block-editor-block-icon").getBoundingClientRect().right-e.left}),[i,s]),u=(0,Bt.useMemo)((()=>{if(!s)return{};const e=c();return{width:s.offsetWidth-e}}),[c,s]),p=(0,Bt.useMemo)((()=>{if(s&&("top"===a||"bottom"===a||"inside"===a))return{ownerDocument:s.ownerDocument,getBoundingClientRect(){const e=s.getBoundingClientRect(),t=c(),n=e.left+t,o=e.right;let r=0,i=0;"top"===a?(r=e.top,i=e.top):(r=e.bottom,i=e.bottom);const l=o-n,u=i-r;return new window.DOMRect(n,r,l,u)}}}),[s,a,c]);return s?(0,Bt.createElement)(gw,{animate:!1,anchor:p,focusOnMount:!1,className:"block-editor-list-view-drop-indicator",variant:"unstyled"},(0,Bt.createElement)("div",{style:u,className:"block-editor-list-view-drop-indicator__line"})):null}function tze(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=Lm(wN),{getBlockName:o,getBlockParents:r,getBlockSelectionStart:a,getBlockSelectionEnd:i,getSelectedBlockClientIds:l,hasMultiSelection:s,hasSelectedBlock:c}=fp(wN),{getBlockType:u}=fp(kl),p=(0,Bt.useCallback)((async(i,p,d)=>{if(null==i||!i.shiftKey)return void n(p);i.preventDefault();const b="keydown"===i.type&&(i.keyCode===mq||i.keyCode===zq||i.keyCode===dq||i.keyCode===pq);if(!b&&!c()&&!s())return void n(p,null);const m=l(),M=[...r(p),p];b&&!m.some((e=>M.includes(e)))&&await e();let z=a(),f=p;b&&(c()||s()||(z=p),d&&(f=d));const h=r(z),g=r(f),{start:O,end:v}=function(e,t,n,o){const r=[...n,e],a=[...o,t],i=Math.min(r.length,a.length)-1;return{start:r[i],end:a[i]}}(z,f,h,g);await t(O,v,null);const A=l();if((i.keyCode===dq||i.keyCode===pq)&&A.length>1)return;const y=m.filter((e=>!A.includes(e)));let _;if(1===y.length){var q;const e=null===(q=u(o(y[0])))||void 0===q?void 0:q.title;e&&(_=lr(gr("%s deselected."),e))}else y.length>1&&(_=lr(gr("%s blocks deselected."),y.length));_&&vx(_)}),[e,o,u,r,a,i,l,s,c,t,n]);return{updateBlockSelection:p}}const nze=["top","bottom"];function oze(){const{getBlockRootClientId:e,getBlockIndex:t,getBlockCount:n,getDraggedBlockClientIds:o,canInsertBlocks:r}=fp(wN),[a,i]=(0,Bt.useState)(),{rootClientId:l,blockIndex:s}=a||{},c=L5(l,s),u=o(),p=_5((0,Bt.useCallback)(((o,a)=>{const l={x:o.clientX,y:o.clientY},s=!(null==u||!u.length),c=function(e,t){let n,o,r,a;for(const i of e){if(i.isDraggedBlock)continue;const l=i.element.getBoundingClientRect(),[s,c]=C5(t,l,nze),u=R5(t,l);if(void 0===r||s
")})}}]},zye=Mye,fye={$schema:"https://schemas.wp.org/trunk/block.json",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,typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},spacing:{margin:["top","bottom"],padding:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{width:!0,color:!0}},color:{text:!0,background:!0,gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}}},style:"wp-block-code"},{name:hye}=fye,gye={icon:dye,example:{attributes:{content:gr("// 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:zye,edit:function(e){let{attributes:t,setAttributes:n,onRemove:o}=e;const r=pK();return(0,Bt.createElement)("pre",r,(0,Bt.createElement)(Xue,{tagName:"code",value:t.content,onChange:e=>n({content:e}),onRemove:o,placeholder:gr("Write code…"),"aria-label":gr("Code"),preserveWhiteSpace:!0,__unstablePastePlainText:!0}))},save:function(e){let{attributes:t}=e;return(0,Bt.createElement)("pre",pK.save(),(0,Bt.createElement)(Xue.Content,{tagName:"code",value:(n=t.content,mn(bye,mye)(n||""))}));var n}},Oye=()=>nve({name:hye,metadata:fye,settings:gye}),vye=(0,Bt.createElement)(rk,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,Bt.createElement)(nk,{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-2zM6 17.5c-.3 0-.5-.2-.5-.5V8c0-.3.2-.5.5-.5h3v10H6zm13.5-.5c0 .3-.2.5-.5.5h-3v-10h3c.3 0 .5.2.5.5v9z"})),Aye=[{attributes:{verticalAlignment:{type:"string"},width:{type:"number",min:0,max:100}},isEligible(e){let{width:t}=e;return isFinite(t)},migrate:e=>({...e,width:`${e.width}%`}),save(e){let{attributes:t}=e;const{verticalAlignment:n,width:o}=t,r=fve()({[`is-vertically-aligned-${n}`]:n}),a={flexBasis:o+"%"};return(0,Bt.createElement)("div",{className:r,style:a},(0,Bt.createElement)(H5.Content,null))}}],yye=Aye;const _ye=function(e){let{attributes:{verticalAlignment:t,width:n,templateLock:o,allowedBlocks:r},setAttributes:a,clientId:i}=e;const l=fve()("block-core-columns",{[`is-vertically-aligned-${t}`]:t}),s=NI({availableUnits:ID("spacing.units")||["%","px","em","rem","vw"]}),{columnsIds:c,hasChildBlocks:u,rootClientId:p}=fp((e=>{const{getBlockOrder:t,getBlockRootClientId:n}=e(wN),o=n(i);return{hasChildBlocks:t(i).length>0,rootClientId:o,columnsIds:t(o)}}),[i]),{updateBlockAttributes:d}=Lm(wN),b=Number.isFinite(n)?n+"%":n,m=pK({className:l,style:b?{flexBasis:b}:void 0}),M=c.length,z=c.indexOf(i)+1,f=lr(gr("%1$s (%2$d of %3$d)"),m["aria-label"],z,M),h=P5({...m,"aria-label":f},{templateLock:o,allowedBlocks:r,renderAppender:u?void 0:H5.ButtonBlockAppender});return(0,Bt.createElement)(Bt.Fragment,null,(0,Bt.createElement)(DN,null,(0,Bt.createElement)(CD,{onChange:e=>{a({verticalAlignment:e}),d(p,{verticalAlignment:null})},value:t})),(0,Bt.createElement)(rj,null,(0,Bt.createElement)(fX,{title:gr("Column settings")},(0,Bt.createElement)(vF,{label:gr("Width"),labelPosition:"edge",__unstableInputWidth:"80px",value:n||"",onChange:e=>{e=0>parseFloat(e)?"0":e,a({width:e})},units:s}))),(0,Bt.createElement)("div",h))};const qye={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:2,name:"core/column",title:"Column",category:"text",parent:["core/columns"],description:"A single column within a columns block.",textdomain:"default",attributes:{verticalAlignment:{type:"string"},width:{type:"string"},allowedBlocks:{type:"array"},templateLock:{type:["string","boolean"],enum:["all","insert","contentOnly",!1]}},supports:{anchor:!0,reusable:!1,html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{blockGap:!0,padding:!0,__experimentalDefaultControls:{padding:!0,blockGap:!0}},__experimentalBorder:{color:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,style:!0,width:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalLayout:!0}},{name:kye}=qye,wye={icon:vye,edit:_ye,save:function(e){let{attributes:t}=e;const{verticalAlignment:n,width:o}=t,r=fve()({[`is-vertically-aligned-${n}`]:n});let a;if(o&&/\d/.test(o)){let e=Number.isFinite(o)?o+"%":o;if(!Number.isFinite(o)&&null!=o&&o.endsWith("%")){const t=1e12;e=Math.round(Number.parseFloat(o)*t)/t+"%"}a={flexBasis:e}}const i=pK.save({className:r,style:a}),l=P5.save(i);return(0,Bt.createElement)("div",l)},deprecated:yye},Eye=()=>nve({name:kye,metadata:qye,settings:wye}),Wye=(0,Bt.createElement)(rk,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,Bt.createElement)(nk,{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 Lye(e){let t,{doc:n}=Lye;n||(n=document.implementation.createHTMLDocument(""),Lye.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}const xye=[{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:{}};e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor);const{customTextColor:n,customBackgroundColor:o,...r}=e;return{...r,style:t,isStackedOnMobile:!0}},save(e){let{attributes:t}=e;const{verticalAlignment:n,backgroundColor:o,customBackgroundColor:r,textColor:a,customTextColor:i}=t,l=a6("background-color",o),s=a6("color",a),c=fve()({"has-background":o||r,"has-text-color":a||i,[l]:l,[s]:s,[`are-vertically-aligned-${n}`]:n}),u={backgroundColor:l?void 0:r,color:s?void 0:i};return(0,Bt.createElement)("div",{className:c||void 0,style:u},(0,Bt.createElement)(H5.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!==Lye(e.originalContent))),migrate(e,t){const n=t.reduce(((e,t)=>{const{originalContent:n}=t;let o=Lye(n);return void 0===o&&(o=0),e[o]||(e[o]=[]),e[o].push(t),e}),[]).map((e=>Ja("core/column",{},e))),{columns:o,...r}=e;return[{...r,isStackedOnMobile:!0},n]},save(e){let{attributes:t}=e;const{columns:n}=t;return(0,Bt.createElement)("div",{className:`has-${n}-columns`},(0,Bt.createElement)(H5.Content,null))}},{attributes:{columns:{type:"number",default:2}},migrate(e,t){const{columns:n,...o}=e;return[e={...o,isStackedOnMobile:!0},t]},save(e){let{attributes:t}=e;const{verticalAlignment:n,columns:o}=t,r=fve()(`has-${o}-columns`,{[`are-vertically-aligned-${n}`]:n});return(0,Bt.createElement)("div",{className:r},(0,Bt.createElement)(H5.Content,null))}}],Cye=e=>{const t=parseFloat(e);return Number.isFinite(t)?parseFloat(t.toFixed(2)):void 0};function Rye(e,t){const{width:n=100/t}=e.attributes;return Cye(n)}function Sye(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.length;return e.reduce(((e,n)=>e+Rye(n,t)),0)}function Nye(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.length;return e.reduce(((e,n)=>{const o=Rye(n,t);return Object.assign(e,{[n.clientId]:o})}),{})}function Tye(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length;const o=Sye(e,n);return Object.fromEntries(Object.entries(Nye(e,n)).map((e=>{let[n,r]=e;return[n,Cye(t*r/o)]})))}function Bye(e,t){return e.map((e=>({...e,attributes:{...e.attributes,width:`${t[e.clientId]}%`}})))}const Dye=["core/column"];const Iye=Mj(((e,t,n)=>({updateAlignment(o){const{clientId:r,setAttributes:a}=t,{updateBlockAttributes:i}=e(wN),{getBlockOrder:l}=n.select(wN);a({verticalAlignment:o});l(r).forEach((e=>{i(e,{verticalAlignment:o})}))},updateColumns(o,r){const{clientId:a}=t,{replaceInnerBlocks:i}=e(wN),{getBlocks:l}=n.select(wN);let s=l(a);const c=function(e){return e.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)}))}(s),u=r>o;if(u&&c){const e=Cye(100/r);s=[...Bye(s,Tye(s,100-e)),...Array.from({length:r-o}).map((()=>Ja("core/column",{width:`${e}%`})))]}else if(u)s=[...s,...Array.from({length:r-o}).map((()=>Ja("core/column")))];else if(r