M/others Institute for Collaboration and Art (MICA) Presents MICAfest 2024!

We did it! Thank you everyone!

MICAfest Art for Change: The M/others’ View

Northampton, MA, May 1-31, 2024

Visual/Performing/Literary Arts Festival

  • 80 m/other artists
  • Visual Art Exhibition at Northampton Center for the Arts, NEVAmuseum at Anchor House of Artists, and Bombyx Center for Arts and Equity.
  • Interdisciplinary performances at Northampton Center for the Arts at 33 Hawley and New England Visionary Artists Museum at Anchor House of Artists.

More Than Just Art: What Makes MICA Unique? (Watch Now!)

`;return t=URL.createObjectURL(new Blob([o],{type:"text/html"})),EG.set(e,t),g_e?.register(e,t),t}function k_e({contentRef:e,children:t,tabIndex:o=0,scale:r=1,frameSize:n=0,readonly:i,forwardedRef:s,title:a=(0,TG.__)("Editor canvas"),...c}){let{resolvedAssets:u,isPreviewMode:d}=(0,zD.useSelect)(T=>{let O=T(_).getSettings();return{resolvedAssets:O.__unstableResolvedAssets,isPreviewMode:O.isPreviewMode}},[]),[f,m]=(0,om.useState)(),[h,p]=(0,om.useState)([]),[g,b,v]=FD(),k=(0,Vu.useRefEffect)(T=>{T._load=()=>{m(T.contentDocument)};let O;function D(z){z.preventDefault()}function U(z){z.target.tagName==="A"&&z.target.getAttribute("href")?.startsWith("#")&&(z.preventDefault(),O.defaultView.location.hash=z.target.getAttribute("href").slice(1))}let{ownerDocument:G}=T;p(Array.from(G.body.classList).filter(z=>z.startsWith("admin-color-")||z.startsWith("post-type-")||z==="wp-embed-responsive"));function j(){let{contentDocument:z}=T,{documentElement:W}=z;O=z,W.classList.add("block-editor-iframe__html"),z.dir=G.dir;for(let ee of wG())z.getElementById(ee.id)||(z.head.appendChild(ee.cloneNode(!0)),d||console.warn(`${ee.id} was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`,ee));O.addEventListener("dragover",D,!1),O.addEventListener("drop",D,!1),O.addEventListener("click",U)}return T.addEventListener("load",j),()=>{delete T._load,T.removeEventListener("load",j),O?.removeEventListener("dragover",D),O?.removeEventListener("drop",D),O?.removeEventListener("click",U)}},[]),{contentResizeListener:y,containerResizeListener:S,isZoomedOut:x,scaleContainerWidth:C}=BG({scale:r,frameSize:parseInt(n),iframeDocument:f}),B=(0,Vu.useDisabled)({isDisabled:!i}),I=(0,Vu.useMergeRefs)([h_e(f),e,b,B]),P=b_e(u),E=o>=0&&!d,L=(0,Rs.jsxs)(Rs.Fragment,{children:[E&&g,(0,Rs.jsx)("iframe",{...c,style:{...c.style,height:c.style?.height,border:0},ref:(0,Vu.useMergeRefs)([s,k]),tabIndex:o,src:P,title:a,onKeyDown:T=>{if(c.onKeyDown&&c.onKeyDown(T),T.currentTarget.ownerDocument!==T.target.ownerDocument){let{stopPropagation:O}=T.nativeEvent;T.nativeEvent.stopPropagation=()=>{},T.stopPropagation(),T.nativeEvent.stopPropagation=O,PG(T,window.KeyboardEvent,T.currentTarget)}},children:f&&(0,om.createPortal)((0,Rs.jsxs)("body",{ref:I,className:V("block-editor-iframe__body","editor-styles-wrapper",...h),children:[y,(0,Rs.jsx)(IG.__experimentalStyleProvider,{document:f,children:t})]}),f.documentElement)}),E&&v]});return(0,Rs.jsxs)("div",{className:"block-editor-iframe__container",children:[S,(0,Rs.jsx)("div",{className:V("block-editor-iframe__scale-container",x&&"is-zoomed-out"),style:{"--wp-block-editor-iframe-zoom-out-scale-container-width":x&&`${C}px`},children:L})]})}function v_e(e,t){return(0,zD.useSelect)(r=>r(_).getSettings().__internalIsInitialized,[])?(0,Rs.jsx)(k_e,{...e,forwardedRef:t}):null}var Mh=(0,om.forwardRef)(v_e);var x$=l(A(),1),Hh=l(R(),1),w$=l(F(),1);var P1={attribute:/\[\s*(?:(?\*|[-\w\P{ASCII}]*)\|)?(?[-\w\P{ASCII}]+)\s*(?:(?\W?=)\s*(?.+?)\s*(\s(?[iIsS]))?\s*)?\]/gu,id:/#(?[-\w\P{ASCII}]+)/gu,class:/\.(?[-\w\P{ASCII}]+)/gu,comma:/\s*,\s*/g,combinator:/\s*[\s>+~]\s*/g,"pseudo-element":/::(?[-\w\P{ASCII}]+)(?:\((?¶*)\))?/gu,"pseudo-class":/:(?[-\w\P{ASCII}]+)(?:\((?¶*)\))?/gu,universal:/(?:(?\*|[-\w\P{ASCII}]*)\|)?\*/gu,type:/(?:(?\*|[-\w\P{ASCII}]*)\|)?(?[-\w\P{ASCII}]+)/gu},y_e=new Set(["combinator","comma"]);var S_e=e=>{switch(e){case"pseudo-element":case"pseudo-class":return new RegExp(P1[e].source.replace("(?\xB6*)","(?.*)"),"gu");default:return P1[e]}};function __e(e,t){let o=0,r="";for(;t(o.push({value:i,offset:s}),"\uE000".repeat(i.length))),e=e.replace(w_e,(i,s,a,c)=>(o.push({value:i,offset:c}),`${s}${"\uE001".repeat(a.length)}${s}`));{let i=0,s;for(;(s=e.indexOf("(",i))>-1;){let a=__e(e,s);o.push({value:a,offset:s}),e=`${e.substring(0,s)}(${"\xB6".repeat(a.length-2)})${e.substring(s+a.length)}`,i=s+a.length}}let r=x_e(e,t),n=new Set;for(let i of o.reverse())for(let s of r){let{offset:a,value:c}=i;if(!(s.pos[0]<=a&&a+c.length<=s.pos[1]))continue;let{content:u}=s,d=a-s.pos[0];s.content=u.slice(0,d)+c+u.slice(d+c.length),s.content!==u&&n.add(s)}for(let i of n){let s=S_e(i.type);if(!s)throw new Error(`Unknown token type: ${i.type}`);s.lastIndex=0;let a=s.exec(i.content);if(!a)throw new Error(`Unable to parse content for ${i.type}: ${i.content}`);Object.assign(i,a.groups)}return r}function*I1(e,t){switch(e.type){case"list":for(let o of e.list)yield*I1(o,e);break;case"complex":yield*I1(e.left,e),yield*I1(e.right,e);break;case"compound":yield*e.list.map(o=>[o,e]);break;default:yield[e,t]}}function RG(e){let t;return Array.isArray(e)?t=e:t=[...I1(e)].map(([o])=>o),t.map(o=>o.content).join("")}var k$=l(XW(),1),v$=l(A1(),1),y$=l(e$(),1),S$=l(g$(),1),b$=new Map,_$=[{type:"type",content:"body"},{type:"type",content:"html"},{type:"pseudo-class",content:":root"},{type:"pseudo-class",content:":where(body)"},{type:"pseudo-class",content:":where(:root)"},{type:"pseudo-class",content:":where(html)"}];function D0e(e,t){let o=jD(t),r=o.findLastIndex(({content:s,type:a})=>_$.some(c=>s===c.content&&a===c.type)),n=-1;for(let s=r+1;sd instanceof RegExp?a.match(d):a.includes(d))?a:_$.some(d=>a.startsWith(d.content))?D0e(s,a):c}}),o&&(0,S$.default)({rootUrl:o})].filter(Boolean)).process(e,{}).css}catch(i){return i instanceof v$.default?console.warn("wp.blockEditor.transformStyles Failed to transform CSS.",i.message+` `+i.showSourceCode(!1)):console.warn("wp.blockEditor.transformStyles Failed to transform CSS.",i),null}}var F0e=(e,t="",o)=>{let r=b$.get(t);return r||(r=new WeakMap,b$.set(t,r)),e.map(n=>{let i=r.get(n);return i||(i=V0e(n,t,o),r.set(n,i)),i})},Uh=F0e;var Uu=l(w(),1);Kc([Yc,Op]);function z0e(e,t){return(0,Hh.useCallback)(o=>{if(!o)return;let{ownerDocument:r}=o,{defaultView:n,body:i}=r,s=t?r.querySelector(t):i,a;if(s)a=n?.getComputedStyle(s,null).getPropertyValue("background-color");else{let u=r.createElement("div");u.classList.add("editor-styles-wrapper"),i.appendChild(u),a=n?.getComputedStyle(u,null).getPropertyValue("background-color"),i.removeChild(u)}let c=Bt(a);c.luminance()>.5||c.alpha()===0?i.classList.remove("is-dark-theme"):i.classList.add("is-dark-theme")},[e,t])}function j0e({styles:e,scope:t,transformOptions:o}){let r=(0,w$.useSelect)(s=>M(s(_)).getStyleOverrides(),[]),[n,i]=(0,Hh.useMemo)(()=>{let s=Object.values(e??[]);for(let[a,c]of r){let u=s.findIndex(({id:f})=>a===f),d={...c,id:a};u===-1?s.push(d):s[u]=d}return[Uh(s.filter(a=>a?.css),t,o),s.filter(a=>a.__unstableType==="svgs").map(a=>a.assets).join("")]},[e,r,t,o]);return(0,Uu.jsxs)(Uu.Fragment,{children:[(0,Uu.jsx)("style",{ref:z0e(n,t)}),n.map((s,a)=>(0,Uu.jsx)("style",{children:s},a)),(0,Uu.jsx)(x$.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 0 0",width:"0",height:"0",role:"none",style:{visibility:"hidden",position:"absolute",left:"-9999px",overflow:"hidden"},dangerouslySetInnerHTML:{__html:i}})]})}var Nl=(0,Hh.memo)(j0e);var Fi=l(w(),1),U0e=(0,q1.memo)(Gh),_5=2e3,H0e=[];function G0e({viewportWidth:e,containerWidth:t,minHeight:o,additionalStyles:r=H0e}){e||(e=t);let[n,{height:i}]=(0,Dy.useResizeObserver)(),{styles:s}=(0,C$.useSelect)(d=>({styles:d(_).getSettings().styles}),[]),a=(0,q1.useMemo)(()=>s&&[...s,{css:"body{height:auto;overflow:hidden;border:none;padding:0;}",__unstableType:"presets"},...r],[s,r]),c=t/e,u=i?t/(i*c):0;return(0,Fi.jsx)(B$.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${c})`,aspectRatio:u,maxHeight:i>_5?_5*c:void 0,minHeight:o},children:(0,Fi.jsxs)(Mh,{contentRef:(0,Dy.useRefEffect)(d=>{let{ownerDocument:{documentElement:f}}=d;f.classList.add("block-editor-block-preview__content-iframe"),f.style.position="absolute",f.style.width="100%",d.style.boxSizing="border-box",d.style.position="absolute",d.style.width="100%"},[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:e,height:i,pointerEvents:"none",maxHeight:_5,minHeight:c!==0&&c<1&&o?o/c:o},children:[(0,Fi.jsx)(Nl,{styles:a}),n,(0,Fi.jsx)(U0e,{renderAppender:!1})]})})}function E$(e){let[t,{width:o}]=(0,Dy.useResizeObserver)();return(0,Fi.jsxs)(Fi.Fragment,{children:[(0,Fi.jsx)("div",{style:{position:"relative",width:"100%",height:0},children:t}),(0,Fi.jsx)("div",{className:"block-editor-block-preview__container",children:!!o&&(0,Fi.jsx)(G0e,{...e,containerWidth:o})})]})}var Wh=l(R(),1),R$=l(I$(),1),P$=(0,R$.createQueue)();function O$({children:e,placeholder:t}){let[o,r]=(0,Wh.useState)(!1);return(0,Wh.useEffect)(()=>{let n={};return P$.add(n,()=>{(0,Wh.flushSync)(()=>{r(!0)})}),()=>{P$.cancel(n)}},[]),o?e:t}var am=l(w(),1),W0e=[];function $0e({blocks:e,viewportWidth:t=1200,minHeight:o,additionalStyles:r=W0e,__experimentalMinHeight:n,__experimentalPadding:i}){n&&(o=n,(0,x5.default)("The __experimentalMinHeight prop",{since:"6.2",version:"6.4",alternative:"minHeight"})),i&&(r=[...r,{css:`body { padding: ${i}px; }`}],(0,x5.default)("The __experimentalPadding prop of BlockPreview",{since:"6.2",version:"6.4",alternative:"additionalStyles"}));let s=(0,w5.useSelect)(u=>u(_).getSettings(),[]),a=(0,sm.useMemo)(()=>({...s,focusMode:!1,isPreviewMode:!0}),[s]),c=(0,sm.useMemo)(()=>Array.isArray(e)?e:[e],[e]);return!e||e.length===0?null:(0,am.jsx)(Ph,{value:c,settings:a,children:(0,am.jsx)(E$,{viewportWidth:t,minHeight:o,additionalStyles:r})})}var A$=(0,sm.memo)($0e);A$.Async=O$;var vn=A$;function L$({blocks:e,props:t={},layout:o}){let r=(0,w5.useSelect)(u=>u(_).getSettings(),[]),n=(0,sm.useMemo)(()=>({...r,styles:void 0,focusMode:!1,isPreviewMode:!0}),[r]),i=(0,Z1.useDisabled)(),s=(0,Z1.useMergeRefs)([t.ref,i]),a=(0,sm.useMemo)(()=>Array.isArray(e)?e:[e],[e]),c=(0,am.jsxs)(Ph,{value:a,settings:n,children:[(0,am.jsx)(Nl,{}),(0,am.jsx)(Vy,{renderAppender:!1,layout:o})]});return{...t,ref:s,className:V(t.className,"block-editor-block-preview__live-content","components-disabled"),children:e?.length?c:null}}var Hu=l(w(),1);function K0e({item:e}){let{name:t,title:o,icon:r,description:n,initialAttributes:i,example:s}=e,a=(0,$h.isReusableBlock)(e),c=(0,N$.useMemo)(()=>s?(0,$h.getBlockFromExample)(t,{attributes:{...s.attributes,...i},innerBlocks:s.innerBlocks}):(0,$h.createBlock)(t,i),[t,s,i]),u=144,d=280,f=s?.viewportWidth??500,m=d/f,h=m!==0&&m<1&&u?u/m:u;return(0,Hu.jsxs)("div",{className:"block-editor-inserter__preview-container",children:[(0,Hu.jsx)("div",{className:"block-editor-inserter__preview",children:a||s?(0,Hu.jsx)("div",{className:"block-editor-inserter__preview-content",children:(0,Hu.jsx)(vn,{blocks:c,viewportWidth:f,minHeight:u,additionalStyles:[{css:` body { padding: 24px; min-height:${Math.round(h)}px; display:flex; align-items:center; } .is-root-container { width: 100%; } `}]})}):(0,Hu.jsx)("div",{className:"block-editor-inserter__preview-content-missing",children:(0,M$.__)("No preview available.")})}),!a&&(0,Hu.jsx)(yy,{title:o,icon:r,description:n})]})}var X1=K0e;var Jh=l(N(),1),Vl=l(R(),1),R5=l(Z(),1);var Z$=l($(),1),X$=l(Z(),1);var Qh=l(R(),1),Gu=l($(),1),Y$=l(A(),1),Fy=l(it(),1);var G$=l(A(),1),W$=l(R(),1);var Kh=l(R(),1),D$=l(N(),1),V$=l(Xo(),1),F$=l(w(),1);function Y0e(e,t){let[o,r]=(0,Kh.useState)(!1);return(0,Kh.useEffect)(()=>{o&&(0,V$.speak)((0,D$.__)("Use left and right arrow keys to move through blocks"))},[o]),(0,F$.jsx)("div",{ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{r(!0)},onBlur:n=>{!n.currentTarget.contains(n.relatedTarget)&&r(!1)},...e})}var C5=(0,Kh.forwardRef)(Y0e);var z$=l(R(),1),j$=l(A(),1),U$=l(w(),1);function q0e(e,t){return(0,U$.jsx)(j$.Composite.Group,{role:"presentation",ref:t,...e})}var B5=(0,z$.forwardRef)(q0e);var J1=l(A(),1),H$=l(R(),1),Q1=l(w(),1);function Z0e({isFirst:e,as:t,children:o,...r},n){return(0,Q1.jsx)(J1.Composite.Item,{ref:n,role:"option",accessibleWhenDisabled:!0,...r,render:i=>{let s={...i,tabIndex:e?0:i.tabIndex};return t?(0,Q1.jsx)(t,{...s,children:o}):typeof o=="function"?o(s):(0,Q1.jsx)(J1.Button,{__next40pxDefaultSize:!0,...s,children:o})}})}var E5=(0,H$.forwardRef)(Z0e);var T5=l(w(),1);function X0e({key:e,children:t}){return(0,T5.jsx)(W$.Fragment,{children:t},e)}function Q0e({children:e}){return(0,T5.jsx)(G$.Composite,{focusShift:!0,focusWrap:"horizontal",render:X0e,children:e})}var Yh=Q0e;var $$=l(A(),1),tB=l($(),1),oB=l(F(),1),K$=l(R(),1);var Zh=l(N(),1),qh=l(A(),1);var As=l(w(),1);function eB({count:e,icon:t,isPattern:o,fadeWhenDisabled:r}){let n=o&&(0,Zh.__)("Pattern");return(0,As.jsx)("div",{className:"block-editor-block-draggable-chip-wrapper",children:(0,As.jsx)("div",{className:"block-editor-block-draggable-chip","data-testid":"block-draggable-chip",children:(0,As.jsxs)(qh.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content",children:[(0,As.jsx)(qh.FlexItem,{children:t?(0,As.jsx)(Ae,{icon:t}):n||(0,Zh.sprintf)((0,Zh._n)("%d block","%d blocks",e),e)}),(0,As.jsx)(qh.FlexItem,{children:(0,As.jsx)(Ae,{icon:tv})}),r&&(0,As.jsx)(qh.FlexItem,{className:"block-editor-block-draggable-chip__disabled",children:(0,As.jsx)("span",{className:"block-editor-block-draggable-chip__disabled-icon"})})]})})})}var I5=l(w(),1),J0e=({isEnabled:e,blocks:t,icon:o,children:r,pattern:n})=>{let i=t.length===1?t[0].name:void 0,s=(0,oB.useSelect)(f=>i&&f(tB.store).getBlockType(i)?.icon,[i]),{startDragging:a,stopDragging:c}=M((0,oB.useDispatch)(_)),u=(0,K$.useMemo)(()=>n?.type===Nt.user&&n?.syncStatus!=="unsynced"?[(0,tB.createBlock)("core/block",{ref:n.id})]:void 0,[n?.type,n?.syncStatus,n?.id]);if(!e)return r({draggable:!1,onDragStart:void 0,onDragEnd:void 0});let d=u??t;return(0,I5.jsx)($$.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:{type:"inserter",blocks:d},onDragStart:f=>{a();let m=new Set;for(let h of d){let p=`wp-block:${h.name}`;m.has(p)||(f.dataTransfer.items.add("",p),m.add(p))}},onDragEnd:()=>{c()},__experimentalDragComponent:(0,I5.jsx)(eB,{count:t.length,icon:o||!n&&s,isPattern:!!n}),children:({onDraggableStart:f,onDraggableEnd:m})=>r({draggable:!0,onDragStart:f,onDragEnd:m})})},Xh=J0e;var Ml=l(w(),1);function exe({className:e,isFirst:t,item:o,onSelect:r,onHover:n,isDraggable:i,...s}){let a=(0,Qh.useRef)(!1),c=o.icon?{backgroundColor:o.icon.background,color:o.icon.foreground}:{},u=(0,Qh.useMemo)(()=>[(0,Gu.createBlock)(o.name,o.initialAttributes,(0,Gu.createBlocksFromInnerBlocksTemplate)(o.innerBlocks))],[o.name,o.initialAttributes,o.innerBlocks]),d=(0,Gu.isReusableBlock)(o)&&o.syncStatus!=="unsynced"||(0,Gu.isTemplatePart)(o);return(0,Ml.jsx)(Xh,{isEnabled:i&&!o.isDisabled,blocks:u,icon:o.icon,children:({draggable:f,onDragStart:m,onDragEnd:h})=>(0,Ml.jsx)("div",{className:V("block-editor-block-types-list__list-item",{"is-synced":d}),draggable:f,onDragStart:p=>{a.current=!0,m&&(n(null),m(p))},onDragEnd:p=>{a.current=!1,h&&h(p)},children:(0,Ml.jsxs)(E5,{isFirst:t,className:V("block-editor-block-types-list__item",e),disabled:o.isDisabled,onClick:p=>{p.preventDefault(),r(o,(0,Fy.isAppleOS)()?p.metaKey:p.ctrlKey),n(null)},onKeyDown:p=>{let{keyCode:g}=p;g===Fy.ENTER&&(p.preventDefault(),r(o,(0,Fy.isAppleOS)()?p.metaKey:p.ctrlKey),n(null))},onMouseEnter:()=>{a.current||n(o)},onMouseLeave:()=>n(null),...s,children:[(0,Ml.jsx)("span",{className:"block-editor-block-types-list__item-icon",style:c,children:(0,Ml.jsx)(Ae,{icon:o.icon,showColors:!0})}),(0,Ml.jsx)("span",{className:"block-editor-block-types-list__item-title",children:(0,Ml.jsx)(Y$.__experimentalTruncate,{numberOfLines:3,children:o.title})})]})})})}var q$=(0,Qh.memo)(exe);var zy=l(w(),1);function txe(e,t){let o=[];for(let r=0,n=e.length;r{},children:r,label:n,isDraggable:i=!0}){let s="block-editor-block-types-list",a=(0,X$.useInstanceId)(Q$,s);return(0,zy.jsxs)(C5,{className:s,"aria-label":n,children:[txe(e,3).map((c,u)=>(0,zy.jsx)(B5,{children:c.map((d,f)=>(0,zy.jsx)(q$,{item:d,className:(0,Z$.getBlockMenuDefaultClassName)(d.id),onSelect:t,onHover:o,isDraggable:i&&!d.isDisabled,isFirst:u===0&&f===0,rowId:`${a}-${u}`},d.id))},u)),r]})}var lm=Q$;var J$=l(A(),1),Dl=l(w(),1);function oxe({title:e,icon:t,children:o}){return(0,Dl.jsxs)(Dl.Fragment,{children:[(0,Dl.jsxs)("div",{className:"block-editor-inserter__panel-header",children:[(0,Dl.jsx)("h2",{className:"block-editor-inserter__panel-title",children:e}),(0,Dl.jsx)(J$.Icon,{icon:t})]}),(0,Dl.jsx)("div",{className:"block-editor-inserter__panel-content",children:o})]})}var Wu=oxe;var eK=l(N(),1),P5=l(w(),1);function rxe(){return(0,P5.jsx)("div",{className:"block-editor-inserter__no-results",children:(0,P5.jsx)("p",{children:(0,eK.__)("No results found.")})})}var Ls=rxe;var zo=l(w(),1),nxe=e=>e.name.split("/")[0],ixe=6,sxe=[];function tK({items:e,collections:t,categories:o,onSelectItem:r,onHover:n,showMostUsedBlocks:i,className:s}){let a=(0,Vl.useMemo)(()=>ma(e,"frecency","desc").slice(0,ixe),[e]),c=(0,Vl.useMemo)(()=>e.filter(p=>!p.category),[e]),u=(0,Vl.useMemo)(()=>{let p={...t};return Object.keys(t).forEach(g=>{p[g]=e.filter(b=>nxe(b)===g),p[g].length===0&&delete p[g]}),p},[e,t]);(0,Vl.useEffect)(()=>()=>n(null),[]);let d=(0,R5.useAsyncList)(o),f=o.length===d.length,m=(0,Vl.useMemo)(()=>Object.entries(t),[t]),h=(0,R5.useAsyncList)(f?m:sxe);return(0,zo.jsxs)("div",{className:s,children:[i&&e.length>3&&!!a.length&&(0,zo.jsx)(Wu,{title:(0,Jh._x)("Most used","blocks"),children:(0,zo.jsx)(lm,{items:a,onSelect:r,onHover:n,label:(0,Jh._x)("Most used","blocks")})}),d.map(p=>{let g=e.filter(b=>b.category===p.slug);return!g||!g.length?null:(0,zo.jsx)(Wu,{title:p.title,icon:p.icon,children:(0,zo.jsx)(lm,{items:g,onSelect:r,onHover:n,label:p.title})},p.slug)}),f&&c.length>0&&(0,zo.jsx)(Wu,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,Jh.__)("Uncategorized"),children:(0,zo.jsx)(lm,{items:c,onSelect:r,onHover:n,label:(0,Jh.__)("Uncategorized")})}),h.map(([p,g])=>{let b=u[p];return!b||!b.length?null:(0,zo.jsx)(Wu,{title:g.title,icon:g.icon,children:(0,zo.jsx)(lm,{items:b,onSelect:r,onHover:n,label:g.title})},p)})]})}function axe({rootClientId:e,onInsert:t,onHover:o,showMostUsedBlocks:r},n){let[i,s,a,c]=ku(e,t);if(!i.length)return(0,zo.jsx)(Ls,{});let u=[],d=[];for(let f of i)f.category!=="reusable"&&(f.isSearchOnly||(f.isAllowedInCurrentRoot?u.push(f):d.push(f)));return(0,zo.jsx)(Yh,{children:(0,zo.jsxs)("div",{ref:n,children:[!!u.length&&(0,zo.jsx)(zo.Fragment,{children:(0,zo.jsx)(tK,{items:u,categories:s,collections:a,onSelectItem:c,onHover:o,showMostUsedBlocks:r,className:"block-editor-inserter__insertable-blocks-at-selection"})}),(0,zo.jsx)(tK,{items:d,categories:s,collections:a,onSelectItem:c,onHover:o,showMostUsedBlocks:r,className:"block-editor-inserter__all-blocks"})]})})}var oK=(0,Vl.forwardRef)(axe);var xK=l(R(),1),wK=l(Z(),1),CK=l(A(),1),BK=l(N(),1);var bK=l(A(),1),D5=l(R(),1),kK=l(N(),1);var rB=l(A(),1),O5=l(N(),1),Fl=l(w(),1);function lxe({selectedCategory:e,patternCategories:t,onClickCategory:o}){let r="block-editor-block-patterns-explorer__sidebar";return(0,Fl.jsx)("div",{className:`${r}__categories-list`,children:t.map(({name:n,label:i})=>(0,Fl.jsx)(rB.Button,{__next40pxDefaultSize:!0,label:i,className:`${r}__categories-list__item`,isPressed:e===n,onClick:()=>{o(n)},children:i},n))})}function cxe({searchValue:e,setSearchValue:t}){return(0,Fl.jsx)("div",{className:"block-editor-block-patterns-explorer__search",children:(0,Fl.jsx)(rB.SearchControl,{onChange:t,value:e,label:(0,O5.__)("Search"),placeholder:(0,O5.__)("Search")})})}function uxe({selectedCategory:e,patternCategories:t,onClickCategory:o,searchValue:r,setSearchValue:n}){return(0,Fl.jsxs)("div",{className:"block-editor-block-patterns-explorer__sidebar",children:[(0,Fl.jsx)(cxe,{searchValue:r,setSearchValue:n}),!r&&(0,Fl.jsx)(lxe,{selectedCategory:e,patternCategories:t,onClickCategory:o})]})}var rK=uxe;var jl=l(R(),1),rg=l(N(),1),fK=l(Z(),1),mK=l(A(),1),pK=l(Xo(),1);var nK=l($(),1),wa=l(R(),1),zl=l(A(),1),iK=l(Z(),1),sK=l(N(),1);var yn=l(A(),1),zi=l(N(),1),Br=l(w(),1);function nB({currentPage:e,numPages:t,changePage:o,totalItems:r}){return(0,Br.jsxs)(yn.__experimentalVStack,{className:"block-editor-patterns__grid-pagination-wrapper",children:[(0,Br.jsx)(yn.__experimentalText,{variant:"muted",children:(0,zi.sprintf)((0,zi._n)("%s item","%s items",r),r)}),t>1&&(0,Br.jsxs)(yn.__experimentalHStack,{expanded:!1,spacing:3,justify:"flex-start",className:"block-editor-patterns__grid-pagination",children:[(0,Br.jsxs)(yn.__experimentalHStack,{expanded:!1,spacing:1,className:"block-editor-patterns__grid-pagination-previous",children:[(0,Br.jsx)(yn.Button,{variant:"tertiary",onClick:()=>o(1),disabled:e===1,"aria-label":(0,zi.__)("First page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:(0,Br.jsx)("span",{children:"\xAB"})}),(0,Br.jsx)(yn.Button,{variant:"tertiary",onClick:()=>o(e-1),disabled:e===1,"aria-label":(0,zi.__)("Previous page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:(0,Br.jsx)("span",{children:"\u2039"})})]}),(0,Br.jsx)(yn.__experimentalText,{variant:"muted",children:(0,zi.sprintf)((0,zi._x)("%1$s of %2$s","paging"),e,t)}),(0,Br.jsxs)(yn.__experimentalHStack,{expanded:!1,spacing:1,className:"block-editor-patterns__grid-pagination-next",children:[(0,Br.jsx)(yn.Button,{variant:"tertiary",onClick:()=>o(e+1),disabled:e===t,"aria-label":(0,zi.__)("Next page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:(0,Br.jsx)("span",{children:"\u203A"})}),(0,Br.jsx)(yn.Button,{variant:"tertiary",onClick:()=>o(t),disabled:e===t,"aria-label":(0,zi.__)("Last page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:(0,Br.jsx)("span",{children:"\xBB"})})]})]})]})}var Yt=l(w(),1),dxe=({showTooltip:e,title:t,children:o})=>e?(0,Yt.jsx)(zl.Tooltip,{text:t,children:o}):(0,Yt.jsx)(Yt.Fragment,{children:o});function aK({id:e,isDraggable:t,pattern:o,onClick:r,onHover:n,showTitlesAsTooltip:i,category:s,isSelected:a}){let[c,u]=(0,wa.useState)(!1),{blocks:d,viewportWidth:f}=o,h=`block-editor-block-patterns-list__item-description-${(0,iK.useInstanceId)(aK)}`,p=o.type===Nt.user,g=(0,wa.useMemo)(()=>!s||!t?d:(d??[]).map(b=>{let v=(0,nK.cloneBlock)(b);return v.attributes.metadata?.categories?.includes(s)&&(v.attributes.metadata.categories=[s]),v}),[d,t,s]);return(0,Yt.jsx)(Xh,{isEnabled:t,blocks:g,pattern:o,children:({draggable:b,onDragStart:v,onDragEnd:k})=>(0,Yt.jsx)("div",{className:"block-editor-block-patterns-list__list-item",draggable:b,onDragStart:y=>{u(!0),v&&(n?.(null),v(y))},onDragEnd:y=>{u(!1),k&&k(y)},children:(0,Yt.jsx)(dxe,{showTooltip:i&&!p,title:o.title,children:(0,Yt.jsxs)(zl.Composite.Item,{render:(0,Yt.jsx)("div",{role:"option","aria-label":o.title,"aria-describedby":o.description?h:void 0,className:V("block-editor-block-patterns-list__item",{"block-editor-block-patterns-list__list-item-synced":o.type===Nt.user&&!o.syncStatus,"is-selected":a})}),id:e,onClick:()=>{r(o,d),n?.(null)},onMouseEnter:()=>{c||n?.(o)},onMouseLeave:()=>n?.(null),children:[(0,Yt.jsx)(vn.Async,{placeholder:(0,Yt.jsx)(fxe,{}),children:(0,Yt.jsx)(vn,{blocks:d,viewportWidth:f})}),(!i||p)&&(0,Yt.jsxs)(zl.__experimentalHStack,{className:"block-editor-patterns__pattern-details",spacing:2,children:[p&&!o.syncStatus&&(0,Yt.jsx)("div",{className:"block-editor-patterns__pattern-icon-wrapper",children:(0,Yt.jsx)(we,{className:"block-editor-patterns__pattern-icon",icon:Ei})}),(0,Yt.jsx)("div",{className:"block-editor-block-patterns-list__item-title",children:o.title})]}),!!o.description&&(0,Yt.jsx)(zl.VisuallyHidden,{id:h,children:o.description})]})})})})}function fxe(){return(0,Yt.jsx)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}function mxe({isDraggable:e,blockPatterns:t,onHover:o,onClickPattern:r,orientation:n,label:i=(0,sK.__)("Block patterns"),category:s,showTitlesAsTooltip:a,pagingProps:c},u){let[d,f]=(0,wa.useState)(void 0),[m,h]=(0,wa.useState)(null);(0,wa.useEffect)(()=>{let g=t[0]?.name;f(g)},[t]);let p=(g,b)=>{h(g.name),r(g,b)};return(0,Yt.jsxs)(zl.Composite,{orientation:n,activeId:d,setActiveId:f,role:"listbox",className:"block-editor-block-patterns-list","aria-label":i,ref:u,children:[t.map(g=>(0,Yt.jsx)(aK,{id:g.name,pattern:g,onClick:p,onHover:o,isDraggable:e,showTitlesAsTooltip:a,category:s,isSelected:!!m&&m===g.name},g.name)),c&&(0,Yt.jsx)(nB,{...c})]})}var Ca=(0,wa.forwardRef)(mxe);var cm=l(F(),1),cK=l($(),1),iB=l(N(),1),uK=l(Xo(),1),A5=l(R(),1);function lK({destinationRootClientId:e,destinationIndex:t,rootClientId:o,registry:r}){if(o===e)return t;let n=["",...r.select(_).getBlockParents(e),e],i=n.indexOf(o);return i!==-1?r.select(_).getBlockIndex(n[i+1])+1:r.select(_).getBlockOrder(o).length}function pxe({rootClientId:e="",insertionIndex:t,clientId:o,isAppender:r,onSelect:n,shouldFocusBlock:i=!0,selectBlockOnInsert:s=!0}){let a=(0,cm.useRegistry)(),{getSelectedBlock:c,getClosestAllowedInsertionPoint:u,isBlockInsertionPointVisible:d}=M((0,cm.useSelect)(_)),{destinationRootClientId:f,destinationIndex:m}=(0,cm.useSelect)(S=>{let{getSelectedBlockClientId:x,getBlockRootClientId:C,getBlockIndex:B,getBlockOrder:I,getInsertionPoint:P}=M(S(_)),E=x(),L=e,T,O=P();return t!==void 0?T=t:O&&O.hasOwnProperty("index")?(L=O?.rootClientId?O.rootClientId:e,T=O.index):o?T=B(o):!r&&E?(L=C(E),T=B(E)+1):T=I(L).length,{destinationRootClientId:L,destinationIndex:T}},[e,t,o,r]),{replaceBlocks:h,insertBlocks:p,showInsertionPoint:g,hideInsertionPoint:b,setLastFocus:v}=M((0,cm.useDispatch)(_)),k=(0,A5.useCallback)((S,x,C=!1,B)=>{(C||i||s)&&v(null);let I=c();!r&&I&&(0,cK.isUnmodifiedDefaultBlock)(I,"content")?h(I.clientId,S,null,i||C?0:null,x):p(S,r||B===void 0?m:lK({destinationRootClientId:f,destinationIndex:m,rootClientId:B,registry:a}),r||B===void 0?f:B,s,i||C?0:null,x);let P=Array.isArray(S)?S.length:1,E=(0,iB.sprintf)((0,iB._n)("%d block added.","%d blocks added.",P),P);(0,uK.speak)(E),n&&n(S)},[r,c,h,p,f,m,n,i,s,v,a]),y=(0,A5.useCallback)(S=>{if(S&&!d()){let x=u(S.name,f);x!==null&&g(x,lK({destinationRootClientId:f,destinationIndex:m,rootClientId:x,registry:a}))}else b()},[u,d,g,b,f,m,a]);return[f,k,y]}var $u=pxe;var eg=l(R(),1),sB=l($(),1),tg=l(F(),1),aB=l(N(),1),dK=l(Un(),1);var hxe=(e,t,o,r)=>{let n=(0,eg.useMemo)(()=>({[uu]:!!r}),[r]),i=(0,tg.useSelect)(p=>{let{getSettings:g}=M(p(_));return g()[w0]??!1},[]),{patternCategories:s,patterns:a,userPatternCategories:c}=(0,tg.useSelect)(p=>{let{getSettings:g,__experimentalGetAllowedPatterns:b}=M(p(_)),{__experimentalUserPatternCategories:v,__experimentalBlockPatternCategories:k}=g();return{patterns:b(t,n),userPatternCategories:v,patternCategories:k}},[t,n]),u=(0,eg.useMemo)(()=>a.filter(p=>!(p.categories?.includes("navigation")&&!i)),[a,i]),{getClosestAllowedInsertionPointForPattern:d}=M((0,tg.useSelect)(_)),f=(0,eg.useMemo)(()=>{let p=[...s];return c?.forEach(g=>{p.find(b=>b.name===g.name)||p.push(g)}),p},[s,c]),{createSuccessNotice:m}=(0,tg.useDispatch)(dK.store),h=(0,eg.useCallback)((p,g)=>{let b=r?t:d(p,t);if(b===null)return;let v=p.type===Nt.user&&p.syncStatus!=="unsynced"?[(0,sB.createBlock)("core/block",{ref:p.id})]:g;e((v??[]).map(k=>{let y=(0,sB.cloneBlock)(k);return y.attributes.metadata?.categories?.includes(o)&&(y.attributes.metadata.categories=[o]),y}),p.name,!1,b),m((0,aB.sprintf)((0,aB.__)('Block pattern "%s" inserted.'),p.title),{type:"snackbar",id:"inserter-notice"})},[m,e,o,t,d,r]);return[u,f,h]},Ku=hxe;var og=l(R(),1),L5=l(Z(),1),N5=l(Fe(),1),lB=20;function cB(e,t,o,r=""){let[n,i]=(0,og.useState)(1),s=(0,L5.usePrevious)(t),a=(0,L5.usePrevious)(r);(s!==t||a!==r)&&n!==1&&i(1);let c=e.length,u=n-1,d=(0,og.useMemo)(()=>e.slice(u*lB,u*lB+lB),[u,e]),f=Math.ceil(e.length/lB),m=h=>{(0,N5.getScrollContainer)(o?.current)?.scrollTo(0,0),i(h)};return(0,og.useEffect)(function(){(0,N5.getScrollContainer)(o?.current)?.scrollTo(0,0)},[t,o]),{totalItems:c,categoryPatterns:d,numPages:f,changePage:m,currentPage:n}}var Ns=l(w(),1);function gxe({filterValue:e,filteredBlockPatternsLength:t}){return e?(0,Ns.jsx)(mK.__experimentalHeading,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count",children:(0,rg.sprintf)((0,rg._n)("%d pattern found","%d patterns found",t),t)}):null}function bxe({searchValue:e,selectedCategory:t,patternCategories:o,rootClientId:r,onModalClose:n}){let i=(0,jl.useRef)(),s=(0,fK.useDebounce)(pK.speak,500),[a,c]=$u({rootClientId:r,shouldFocusBlock:!0}),[u,,d]=Ku(c,a,t),f=(0,jl.useMemo)(()=>o.map(v=>v.name),[o]),m=(0,jl.useMemo)(()=>{let v=u.filter(k=>{if(t===Vf.name||t===Sl.name&&k.type===Nt.user||t===Kp.name&&k.blockTypes?.includes("core/post-content"))return!0;if(t==="uncategorized"){let y=k.categories?.some(S=>f.includes(S))??!1;return!k.categories?.length||!y}return k.categories?.includes(t)});return e?zv(v,e):v},[e,u,t,f]);(0,jl.useEffect)(()=>{if(!e)return;let v=m.length,k=(0,rg.sprintf)((0,rg._n)("%d result found.","%d results found.",v),v);s(k)},[e,s,m.length]);let h=cB(m,t,i),[p,g]=(0,jl.useState)(e);e!==p&&(g(e),h.changePage(1));let b=!!m?.length;return(0,Ns.jsxs)("div",{className:"block-editor-block-patterns-explorer__list",ref:i,children:[(0,Ns.jsx)(gxe,{filterValue:e,filteredBlockPatternsLength:m.length}),(0,Ns.jsx)(Yh,{children:b&&(0,Ns.jsxs)(Ns.Fragment,{children:[(0,Ns.jsx)(Ca,{blockPatterns:h.categoryPatterns,onClickPattern:(v,k)=>{d(v,k),n()},isDraggable:!1}),(0,Ns.jsx)(nB,{...h})]})})]})}var hK=bxe;var M5=l(R(),1),ng=l(N(),1),gK=l(Xo(),1);function kxe(e,t){return!e.categories||!e.categories.length?!1:e.categories.some(o=>t.some(r=>r.name===o))}function ig(e,t="all"){let[o,r]=Ku(void 0,e),n=(0,M5.useMemo)(()=>t==="all"?o:o.filter(s=>!Iw(s,t)),[t,o]);return(0,M5.useMemo)(()=>{let s=r.filter(a=>n.some(c=>c.categories?.includes(a.name))).sort((a,c)=>a.label.localeCompare(c.label));return n.some(a=>!kxe(a,r))&&!s.find(a=>a.name==="uncategorized")&&s.push({name:"uncategorized",label:(0,ng._x)("Uncategorized")}),n.some(a=>a.blockTypes?.includes("core/post-content"))&&s.unshift(Kp),n.some(a=>a.type===Nt.user)&&s.unshift(Sl),n.length>0&&s.unshift({name:Vf.name,label:Vf.label}),(0,gK.speak)((0,ng.sprintf)((0,ng._n)("%d category button displayed.","%d category buttons displayed.",s.length),s.length)),s},[r,n])}var um=l(w(),1);function vxe({initialCategory:e,rootClientId:t,onModalClose:o}){let[r,n]=(0,D5.useState)(""),[i,s]=(0,D5.useState)(e?.name),a=ig(t);return(0,um.jsxs)("div",{className:"block-editor-block-patterns-explorer",children:[(0,um.jsx)(rK,{selectedCategory:i,patternCategories:a,onClickCategory:s,searchValue:r,setSearchValue:n}),(0,um.jsx)(hK,{searchValue:r,selectedCategory:i,patternCategories:a,rootClientId:t,onModalClose:o})]})}function yxe({onModalClose:e,...t}){return(0,um.jsx)(bK.Modal,{title:(0,kK.__)("Patterns"),onRequestClose:e,isFullScreen:!0,children:(0,um.jsx)(vxe,{onModalClose:e,...t})})}var vK=yxe;var sg=l(N(),1),Dt=l(A(),1);var Jo=l(w(),1);function Sxe({title:e}){return(0,Jo.jsx)(Dt.__experimentalVStack,{spacing:0,children:(0,Jo.jsx)(Dt.__experimentalView,{children:(0,Jo.jsx)(Dt.__experimentalSpacer,{marginBottom:0,paddingX:4,paddingY:3,children:(0,Jo.jsxs)(Dt.__experimentalHStack,{spacing:2,children:[(0,Jo.jsx)(Dt.Navigator.BackButton,{style:{minWidth:24,padding:0},icon:(0,sg.isRTL)()?Vo:Mr,size:"small",label:(0,sg.__)("Back")}),(0,Jo.jsx)(Dt.__experimentalSpacer,{children:(0,Jo.jsx)(Dt.__experimentalHeading,{level:5,children:e})})]})})})})}function uB({categories:e,children:t}){return(0,Jo.jsxs)(Dt.Navigator,{initialPath:"/",className:"block-editor-inserter__mobile-tab-navigation",children:[(0,Jo.jsx)(Dt.Navigator.Screen,{path:"/",children:(0,Jo.jsx)(Dt.__experimentalItemGroup,{children:e.map(o=>(0,Jo.jsx)(Dt.Navigator.Button,{path:`/category/${o.name}`,as:Dt.__experimentalItem,isAction:!0,children:(0,Jo.jsxs)(Dt.__experimentalHStack,{children:[(0,Jo.jsx)(Dt.FlexBlock,{children:o.label}),(0,Jo.jsx)(we,{icon:(0,sg.isRTL)()?Mr:Vo})]})},o.name))})}),e.map(o=>(0,Jo.jsxs)(Dt.Navigator.Screen,{path:`/category/${o.name}`,children:[(0,Jo.jsx)(Sxe,{title:(0,sg.__)("Back")}),t(o)]},o.name))]})}var ji=l(R(),1),V5=l(N(),1),Ms=l(A(),1);var _n=l(A(),1),Sn=l(N(),1);var dB=l(R(),1);var hr=l(w(),1),yK=e=>e!=="all"&&e!=="user",_xe=e=>e.name===Sl.name,xxe=[{value:"all",label:(0,Sn._x)("All","patterns")},{value:Nt.directory,label:(0,Sn.__)("Pattern Directory")},{value:Nt.theme,label:(0,Sn.__)("Theme & Plugins")},{value:Nt.user,label:(0,Sn.__)("User")}];function SK({setPatternSyncFilter:e,setPatternSourceFilter:t,patternSyncFilter:o,patternSourceFilter:r,scrollContainerRef:n,category:i}){let s=i.name===Sl.name?Nt.user:r,a=yK(s),c=_xe(i),u=(0,dB.useMemo)(()=>[{value:"all",label:(0,Sn._x)("All","patterns")},{value:Tv.full,label:(0,Sn._x)("Synced","patterns"),disabled:a},{value:Tv.unsynced,label:(0,Sn._x)("Not synced","patterns"),disabled:a}],[a]);function d(f){t(f),yK(f)&&e("all")}return(0,hr.jsx)(hr.Fragment,{children:(0,hr.jsx)(_n.DropdownMenu,{popoverProps:{placement:"right-end"},label:(0,Sn.__)("Filter patterns"),toggleProps:{size:"compact"},icon:(0,hr.jsx)(we,{icon:(0,hr.jsx)(_n.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,hr.jsx)(_n.Path,{d:"M10 17.5H14V16H10V17.5ZM6 6V7.5H18V6H6ZM8 12.5H16V11H8V12.5Z",fill:"currentColor"})})}),children:()=>(0,hr.jsxs)(hr.Fragment,{children:[!c&&(0,hr.jsx)(_n.MenuGroup,{label:(0,Sn.__)("Source"),children:(0,hr.jsx)(_n.MenuItemsChoice,{choices:xxe,onSelect:f=>{d(f),n.current?.scrollTo(0,0)},value:s})}),(0,hr.jsx)(_n.MenuGroup,{label:(0,Sn.__)("Type"),children:(0,hr.jsx)(_n.MenuItemsChoice,{choices:u,onSelect:f=>{e(f),n.current?.scrollTo(0,0)},value:o})}),(0,hr.jsx)("div",{className:"block-editor-inserter__patterns-filter-help",children:(0,dB.createInterpolateElement)((0,Sn.__)("Patterns are available from theWordPress.org Pattern Directory, bundled in the active theme, or created by users on this site. Only patterns created on this site can be synced."),{Link:(0,hr.jsx)(_n.ExternalLink,{href:(0,Sn.__)("https://wordpress.org/patterns/")})})})]})})})}var $r=l(w(),1),wxe=()=>{};function fB({rootClientId:e,onInsert:t,onHover:o=wxe,category:r,showTitlesAsTooltip:n}){let[i,,s]=Ku(t,e,r?.name),[a,c]=(0,ji.useState)("all"),[u,d]=(0,ji.useState)("all"),f=ig(e,u),m=(0,ji.useRef)(),h=(0,ji.useMemo)(()=>i.filter(k=>Iw(k,u,a)?!1:r.name===Vf.name||r.name===Sl.name&&k.type===Nt.user||r.name===Kp.name&&k.blockTypes?.includes("core/post-content")?!0:r.name==="uncategorized"?k.categories?!k.categories.some(y=>f.some(S=>S.name===y)):!0:k.categories?.includes(r.name)),[i,f,r.name,u,a]),p=cB(h,r,m),{changePage:g}=p;(0,ji.useEffect)(()=>()=>o(null),[]);let b=(0,ji.useCallback)(k=>{c(k),g(1)},[c,g]),v=(0,ji.useCallback)(k=>{d(k),g(1)},[d,g]);return(0,$r.jsxs)($r.Fragment,{children:[(0,$r.jsxs)(Ms.__experimentalVStack,{spacing:2,className:"block-editor-inserter__patterns-category-panel-header",children:[(0,$r.jsxs)(Ms.__experimentalHStack,{children:[(0,$r.jsx)(Ms.FlexBlock,{children:(0,$r.jsx)(Ms.__experimentalHeading,{className:"block-editor-inserter__patterns-category-panel-title",size:13,level:4,as:"div",children:r.label})}),(0,$r.jsx)(SK,{patternSyncFilter:a,patternSourceFilter:u,setPatternSyncFilter:b,setPatternSourceFilter:v,scrollContainerRef:m,category:r})]}),!h.length&&(0,$r.jsx)(Ms.__experimentalText,{variant:"muted",className:"block-editor-inserter__patterns-category-no-results",children:(0,V5.__)("No results found")})]}),h.length>0&&(0,$r.jsxs)($r.Fragment,{children:[(0,$r.jsx)(Ms.__experimentalText,{size:"12",as:"p",className:"block-editor-inserter__help-text",children:(0,V5.__)("Drag and drop patterns into the canvas.")}),(0,$r.jsx)(Ca,{ref:m,blockPatterns:p.categoryPatterns,onClickPattern:s,onHover:o,label:r.label,orientation:"vertical",category:r.name,isDraggable:!0,showTitlesAsTooltip:n,patternFilter:u,pagingProps:p})]})]})}var pB=l(Z(),1),hB=l(A(),1),_K=l(R(),1);var dm=l(w(),1),{Tabs:mB}=M(hB.privateApis);function Cxe({categories:e,selectedCategory:t,onSelectCategory:o,children:r}){let s={type:"tween",duration:(0,pB.useReducedMotion)()?0:.25,ease:[.6,0,.4,1]},a=(0,pB.usePrevious)(t),c=t?t.name:null,[u,d]=(0,_K.useState)(),f=e?.[0]?.name;return c===null&&!u&&f&&d(f),(0,dm.jsxs)(mB,{selectOnMove:!1,selectedTabId:c,orientation:"vertical",onSelect:m=>{o(e.find(h=>h.name===m))},activeTabId:u,onActiveTabIdChange:d,children:[(0,dm.jsx)(mB.TabList,{className:"block-editor-inserter__category-tablist",children:e.map(m=>(0,dm.jsx)(mB.Tab,{tabId:m.name,"aria-current":m===t?"true":void 0,children:m.label},m.name))}),e.map(m=>(0,dm.jsx)(mB.TabPanel,{tabId:m.name,focusable:!1,children:(0,dm.jsx)(hB.__unstableMotion.div,{className:"block-editor-inserter__category-panel",initial:a?"open":"closed",animate:"open",variants:{open:{transform:"translateX( 0 )",transitionEnd:{zIndex:"1"}},closed:{transform:"translateX( -100% )",zIndex:"-1"}},transition:s,children:r})},m.name))]})}var gB=Cxe;var Kn=l(w(),1);function Bxe({onSelectCategory:e,selectedCategory:t,onInsert:o,rootClientId:r,children:n}){let[i,s]=(0,xK.useState)(!1),a=ig(r),c=(0,wK.useViewportMatch)("medium","<");return a.length?(0,Kn.jsxs)(Kn.Fragment,{children:[!c&&(0,Kn.jsxs)("div",{className:"block-editor-inserter__block-patterns-tabs-container",children:[(0,Kn.jsx)(gB,{categories:a,selectedCategory:t,onSelectCategory:e,children:n}),(0,Kn.jsx)(CK.Button,{__next40pxDefaultSize:!0,className:"block-editor-inserter__patterns-explore-button",onClick:()=>s(!0),variant:"secondary",children:(0,BK.__)("Explore all patterns")})]}),c&&(0,Kn.jsx)(uB,{categories:a,children:u=>(0,Kn.jsx)("div",{className:"block-editor-inserter__category-panel",children:(0,Kn.jsx)(fB,{onInsert:o,rootClientId:r,category:u},u.name)})}),i&&(0,Kn.jsx)(vK,{initialCategory:t||a[0],patternCategories:a,onModalClose:()=>s(!1),rootClientId:r})]}):(0,Kn.jsx)(Ls,{})}var EK=Bxe;var GK=l(N(),1),WK=l(Z(),1),$K=l(A(),1),vB=l(R(),1);var kB=l(A(),1),zK=l(N(),1),jK=l(Z(),1);var NK=l(A(),1),MK=l(N(),1);var Vt=l(A(),1),Yn=l(N(),1),Ba=l(R(),1),z5=l($(),1);var jy=l(F(),1),RK=l(Un(),1),OK=l(F5(),1),AK=l(dn(),1);var IK=l($(),1),PK=l(w(),1),Exe={image:"img",video:"video",audio:"audio"};function bB(e,t){let o={id:e.id||void 0,caption:e.caption||void 0},r=e.url,n=e.alt||void 0;t==="image"?(o.url=r,o.alt=n):["video","audio"].includes(t)&&(o.src=r);let i=Exe[t],s=(0,PK.jsx)(i,{src:e.previewUrl||r,alt:n,controls:t==="audio"?!0:void 0,inert:"true",onError:({currentTarget:a})=>{a.src===e.previewUrl&&(a.src=r)}});return[(0,IK.createBlock)(`core/${t}`,o),s]}var st=l(w(),1),Txe=["image"],Ixe={placement:"bottom-end",className:"block-editor-inserter__media-list__item-preview-options__popover"};function Pxe({category:e,media:t}){if(!e.getReportUrl)return null;let o=e.getReportUrl(t);return(0,st.jsx)(Vt.DropdownMenu,{className:"block-editor-inserter__media-list__item-preview-options",label:(0,Yn.__)("Options"),popoverProps:Ixe,icon:ks,children:()=>(0,st.jsx)(Vt.MenuGroup,{children:(0,st.jsx)(Vt.MenuItem,{onClick:()=>window.open(o,"_blank").focus(),icon:vA,children:(0,Yn.sprintf)((0,Yn.__)("Report %s"),e.mediaType)})})})}function Rxe({onClose:e,onSubmit:t}){return(0,st.jsxs)(Vt.Modal,{title:(0,Yn.__)("Insert external image"),onRequestClose:e,className:"block-editor-inserter-media-tab-media-preview-inserter-external-image-modal",children:[(0,st.jsxs)(Vt.__experimentalVStack,{spacing:3,children:[(0,st.jsx)("p",{children:(0,Yn.__)("This image cannot be uploaded to your Media Library, but it can still be inserted as an external image.")}),(0,st.jsx)("p",{children:(0,Yn.__)("External images can be removed by the external provider without warning and could even have legal compliance issues related to privacy legislation.")})]}),(0,st.jsxs)(Vt.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1,children:[(0,st.jsx)(Vt.FlexItem,{children:(0,st.jsx)(Vt.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:e,children:(0,Yn.__)("Cancel")})}),(0,st.jsx)(Vt.FlexItem,{children:(0,st.jsx)(Vt.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:t,children:(0,Yn.__)("Insert")})})]})]})}function LK({media:e,onClick:t,category:o}){let[r,n]=(0,Ba.useState)(!1),[i,s]=(0,Ba.useState)(!1),[a,c]=(0,Ba.useState)(!1),[u,d]=(0,Ba.useMemo)(()=>bB(e,o.mediaType),[e,o.mediaType]),{createErrorNotice:f,createSuccessNotice:m}=(0,jy.useDispatch)(RK.store),{getSettings:h,getBlock:p}=(0,jy.useSelect)(_),{updateBlockAttributes:g}=(0,jy.useDispatch)(_),b=(0,Ba.useCallback)(S=>{if(a)return;let x=h(),C=(0,z5.cloneBlock)(S),{id:B,url:I,caption:P}=C.attributes;if(!B&&!x.mediaUpload){n(!0);return}if(B){t(C);return}c(!0),window.fetch(I).then(E=>E.blob()).then(E=>{let L=(0,AK.getFilename)(I)||"image.jpg",T=new File([E],L,{type:E.type});x.mediaUpload({filesList:[T],additionalData:{caption:P},onFileChange([O]){(0,OK.isBlobURL)(O.url)||(p(C.clientId)?g(C.clientId,{...C.attributes,id:O.id,url:O.url}):(t({...C,attributes:{...C.attributes,id:O.id,url:O.url}}),m((0,Yn.__)("Image uploaded and inserted."),{type:"snackbar",id:"inserter-notice"})),c(!1))},allowedTypes:Txe,onError(O){f(O,{type:"snackbar",id:"inserter-notice"}),c(!1)}})}).catch(()=>{n(!0),c(!1)})},[a,h,t,m,g,f,p]),v=typeof e.title=="string"?e.title:e.title?.rendered||(0,Yn.__)("no title"),k=(0,Ba.useCallback)(()=>s(!0),[]),y=(0,Ba.useCallback)(()=>s(!1),[]);return(0,st.jsxs)(st.Fragment,{children:[(0,st.jsx)(Xh,{isEnabled:!0,blocks:[u],children:({draggable:S,onDragStart:x,onDragEnd:C})=>(0,st.jsx)("div",{className:V("block-editor-inserter__media-list__list-item",{"is-hovered":i}),draggable:S,onDragStart:x,onDragEnd:C,children:(0,st.jsxs)("div",{onMouseEnter:k,onMouseLeave:y,children:[(0,st.jsx)(Vt.Tooltip,{text:v,children:(0,st.jsx)(Vt.Composite.Item,{render:(0,st.jsx)("div",{"aria-label":v,role:"option",className:"block-editor-inserter__media-list__item"}),onClick:()=>b(u),children:(0,st.jsxs)("div",{className:"block-editor-inserter__media-list__item-preview",children:[d,a&&(0,st.jsx)("div",{className:"block-editor-inserter__media-list__item-preview-spinner",children:(0,st.jsx)(Vt.Spinner,{})})]})})}),!a&&(0,st.jsx)(Pxe,{category:o,media:e})]})})}),r&&(0,st.jsx)(Rxe,{onClose:()=>n(!1),onSubmit:()=>{t((0,z5.cloneBlock)(u)),m((0,Yn.__)("Image inserted."),{type:"snackbar",id:"inserter-notice"}),n(!1)}})]})}var j5=l(w(),1);function Oxe({mediaList:e,category:t,onClick:o,label:r=(0,MK.__)("Media List")}){return(0,j5.jsx)(NK.Composite,{role:"listbox",className:"block-editor-inserter__media-list","aria-label":r,children:e.map((n,i)=>(0,j5.jsx)(LK,{media:n,category:t,onClick:o},n.id||n.sourceId||i))})}var DK=Oxe;var Ul=l(R(),1),U5=l(F(),1);function VK(e,t={}){let[o,r]=(0,Ul.useState)(),[n,i]=(0,Ul.useState)(!1),s=(0,Ul.useRef)();return(0,Ul.useEffect)(()=>{(async()=>{let a=JSON.stringify({category:e.name,...t});s.current=a,i(!0),r([]);let c=await e.fetch?.(t);a===s.current&&(r(c),i(!1))})()},[e.name,...Object.values(t)]),{mediaList:o,isLoading:n}}function FK(e){let[t,o]=(0,Ul.useState)([]),r=(0,U5.useSelect)(a=>M(a(_)).getInserterMediaCategories(),[]),{canInsertImage:n,canInsertVideo:i,canInsertAudio:s}=(0,U5.useSelect)(a=>{let{canInsertBlockType:c}=a(_);return{canInsertImage:c("core/image",e),canInsertVideo:c("core/video",e),canInsertAudio:c("core/audio",e)}},[e]);return(0,Ul.useEffect)(()=>{(async()=>{let a=[];if(!r)return;let c=new Map(await Promise.all(r.map(async d=>{if(d.isExternalResource)return[d.name,!0];let f=[];try{f=await d.fetch({per_page:1})}catch{}return[d.name,!!f.length]}))),u={image:n,video:i,audio:s};r.forEach(d=>{u[d.mediaType]&&c.get(d.name)&&a.push(d)}),a.length&&o(a)})()},[n,i,s,r]),t}var Yu=l(w(),1),Axe=10;function Uy({rootClientId:e,onInsert:t,category:o}){let[r,n,i]=(0,jK.useDebouncedInput)(),{mediaList:s,isLoading:a}=VK(o,{per_page:i?20:Axe,search:i}),c="block-editor-inserter__media-panel",u=o.labels.search_items||(0,zK.__)("Search");return(0,Yu.jsxs)("div",{className:c,children:[(0,Yu.jsx)(kB.SearchControl,{className:`${c}-search`,onChange:n,value:r,label:u,placeholder:u}),a&&(0,Yu.jsx)("div",{className:`${c}-spinner`,children:(0,Yu.jsx)(kB.Spinner,{})}),!a&&!s?.length&&(0,Yu.jsx)(Ls,{}),!a&&!!s?.length&&(0,Yu.jsx)(DK,{rootClientId:e,onClick:t,mediaList:s,category:o})]})}var UK=l(F(),1);function Lxe({fallback:e=null,children:t}){return(0,UK.useSelect)(r=>{let{getSettings:n}=r(_);return!!n().mediaUpload},[])?t:e}var Ds=Lxe;var HK=l(A(),1),Nxe=()=>null,qu=(0,HK.withFilters)("editor.MediaUpload")(Nxe);var qn=l(w(),1),Mxe=["image","video","audio"];function Dxe({rootClientId:e,selectedCategory:t,onSelectCategory:o,onInsert:r,children:n}){let i=FK(e),s=(0,WK.useViewportMatch)("medium","<"),a="block-editor-inserter__media-tabs",c=(0,vB.useCallback)(d=>{if(!d?.url)return;let f=window.__experimentalDataViewsMediaModal&&d.mime_type?d.mime_type.split("/")[0]:d.type,[m]=bB(d,f);r(m)},[r]),u=(0,vB.useMemo)(()=>i.map(d=>({...d,label:d.labels.name})),[i]);return u.length?(0,qn.jsxs)(qn.Fragment,{children:[!s&&(0,qn.jsxs)("div",{className:`${a}-container`,children:[(0,qn.jsx)(gB,{categories:u,selectedCategory:t,onSelectCategory:o,children:n}),(0,qn.jsx)(Ds,{children:(0,qn.jsx)(qu,{multiple:!1,onSelect:c,allowedTypes:Mxe,render:({open:d})=>(0,qn.jsx)($K.Button,{__next40pxDefaultSize:!0,onClick:f=>{f.target.focus(),d()},className:"block-editor-inserter__media-library-button",variant:"secondary","data-unstable-ignore-focus-outside-for-relatedtarget":".media-modal",children:(0,GK.__)("Open Media Library")})})})]}),s&&(0,qn.jsx)(uB,{categories:u,children:d=>(0,qn.jsx)(Uy,{onInsert:r,rootClientId:e,category:d})})]}):(0,qn.jsx)(Ls,{})}var H5=Dxe;var Hy=l(R(),1),Zu=l(N(),1),G5=l(A(),1),SB=l(Z(),1),qK=l(Xo(),1),ZK=l(F(),1);var KK=l(A(),1),{Fill:YK,Slot:Vxe}=(0,KK.createSlotFill)("__unstableInserterMenuExtension");YK.Slot=Vxe;var yB=YK;var xn=l(w(),1),Fxe=9,zxe=[];function jxe({filterValue:e,onSelect:t,onHover:o,onHoverPattern:r,rootClientId:n,clientId:i,isAppender:s,__experimentalInsertionIndex:a,maxBlockPatterns:c,maxBlockTypes:u,showBlockDirectory:d=!1,isDraggable:f=!0,shouldFocusBlock:m=!0,prioritizePatterns:h,selectBlockOnInsert:p,isQuick:g}){let b=(0,SB.useDebounce)(qK.speak,500),{prioritizedBlocks:v}=(0,ZK.useSelect)(j=>({prioritizedBlocks:j(_).getBlockListSettings(n)?.prioritizedInserterBlocks||zxe}),[n]),[k,y]=$u({onSelect:t,rootClientId:n,clientId:i,isAppender:s,insertionIndex:a,shouldFocusBlock:m,selectBlockOnInsert:p}),[S,x,C,B]=ku(k,y,g),[I,,P]=Ku(y,k,void 0,g),E=(0,Hy.useMemo)(()=>{if(c===0)return[];let j=zv(I,e);return c!==void 0?j.slice(0,c):j},[e,I,c]),L=u;h&&E.length>2&&(L=0);let T=(0,Hy.useMemo)(()=>{if(L===0)return[];let j=S.filter(ee=>ee.name!=="core/block"),z=ma(j,"frecency","desc");!e&&v.length&&(z=Qw(z,v));let W=qw(z,x,C,e);return L!==void 0?W.slice(0,L):W},[e,S,x,C,L,v]);(0,Hy.useEffect)(()=>{if(!e)return;let j=T.length+E.length,z=(0,Zu.sprintf)((0,Zu._n)("%d result found.","%d results found.",j),j);b(z)},[e,b,T,E]);let O=(0,SB.useAsyncList)(T,{step:Fxe}),D=T.length>0||E.length>0,U=!!T.length&&(0,xn.jsx)(Wu,{title:(0,xn.jsx)(G5.VisuallyHidden,{children:(0,Zu.__)("Blocks")}),children:(0,xn.jsx)(lm,{items:O,onSelect:B,onHover:o,label:(0,Zu.__)("Blocks"),isDraggable:f})}),G=!!E.length&&(0,xn.jsx)(Wu,{title:(0,xn.jsx)(G5.VisuallyHidden,{children:(0,Zu.__)("Block patterns")}),children:(0,xn.jsx)("div",{className:"block-editor-inserter__quick-inserter-patterns",children:(0,xn.jsx)(Ca,{blockPatterns:E,onClickPattern:P,onHover:r,isDraggable:f})})});return(0,xn.jsxs)(Yh,{children:[!d&&!D&&(0,xn.jsx)(Ls,{}),h?G:U,!!T.length&&!!E.length&&(0,xn.jsx)("div",{className:"block-editor-inserter__quick-inserter-separator"}),h?U:G,d&&(0,xn.jsx)(yB.Slot,{fillProps:{onSelect:B,onHover:o,filterValue:e,hasItems:D,rootClientId:k},children:j=>j.length?j:D?null:(0,xn.jsx)(Ls,{})})]})}var _B=jxe;var wB=l(A(),1),XK=l(R(),1);var Hl=l(w(),1),{Tabs:xB}=M(wB.privateApis);function Uxe({defaultTabId:e,onClose:t,onSelect:o,selectedTab:r,tabs:n,closeButtonLabel:i},s){return(0,Hl.jsx)("div",{className:"block-editor-tabbed-sidebar",children:(0,Hl.jsxs)(xB,{selectOnMove:!1,defaultTabId:e,onSelect:o,selectedTabId:r,children:[(0,Hl.jsxs)("div",{className:"block-editor-tabbed-sidebar__tablist-and-close-button",children:[(0,Hl.jsx)(wB.Button,{className:"block-editor-tabbed-sidebar__close-button",icon:wf,label:i,onClick:()=>t(),size:"compact"}),(0,Hl.jsx)(xB.TabList,{className:"block-editor-tabbed-sidebar__tablist",ref:s,children:n.map(a=>(0,Hl.jsx)(xB.Tab,{tabId:a.name,className:"block-editor-tabbed-sidebar__tab",children:a.title},a.name))})]}),n.map(a=>(0,Hl.jsx)(xB.TabPanel,{tabId:a.name,focusable:!1,className:"block-editor-tabbed-sidebar__tabpanel",ref:a.panelRef,children:a.panel},a.name))]})})}var CB=(0,XK.forwardRef)(Uxe);var BB=l(F(),1),ag=l(R(),1);function Gy(e=!0){let{setZoomLevel:t,resetZoomLevel:o}=M((0,BB.useDispatch)(_)),{isZoomedOut:r,isZoomOut:n}=(0,BB.useSelect)(a=>{let{isZoomOut:c}=M(a(_));return{isZoomedOut:c(),isZoomOut:c}},[]),i=(0,ag.useRef)(!1),s=(0,ag.useRef)(e);(0,ag.useEffect)(()=>{r!==s.current&&(i.current=!1)},[r]),(0,ag.useEffect)(()=>(s.current=e,e!==n()&&(i.current=!0,e?t("auto-scaled"):o()),()=>{i.current&&n()&&o()}),[e,n,o,t])}var qe=l(w(),1),JK=()=>{};function Hxe({rootClientId:e,clientId:t,isAppender:o,__experimentalInsertionIndex:r,onSelect:n,showInserterHelpPanel:i,showMostUsedBlocks:s,__experimentalFilterValue:a="",shouldFocusBlock:c=!0,onPatternCategorySelection:u,onClose:d,__experimentalInitialTab:f,__experimentalInitialCategory:m},h){let{isZoomOutMode:p,hasSectionRootClientId:g}=(0,QK.useSelect)(he=>{let{isZoomOut:xe,getSectionRootClientId:ze}=M(he(_));return{isZoomOutMode:xe(),hasSectionRootClientId:!!ze()}},[]),[b,v,k]=(0,Wy.useDebouncedInput)(a),[y,S]=(0,Ft.useState)(null),[x,C]=(0,Ft.useState)(m),[B,I]=(0,Ft.useState)("all"),[P,E]=(0,Ft.useState)(null),L=(0,Wy.useViewportMatch)("large"),O=(0,Wy.useViewportMatch)("medium","<")?d:JK;function D(){return f||(p?"patterns":"blocks")}let[U,G]=(0,Ft.useState)(D());Gy(g&&(U==="patterns"||U==="media")&&L);let[z,W,ee]=$u({rootClientId:e,clientId:t,isAppender:o,insertionIndex:r,shouldFocusBlock:c}),se=(0,Ft.useRef)(),ce=(0,Ft.useCallback)((he,xe,ze,ot)=>{W(he,xe,ze,ot),n(he),O(),window.requestAnimationFrame(()=>{!c&&!se.current?.contains(h.current.ownerDocument.activeElement)&&se.current?.querySelector("button").focus()})},[W,O,n,h,c]),ie=(0,Ft.useCallback)((he,xe,...ze)=>{ee(!1),W(he,{patternName:xe},...ze),n(),O()},[W,O,n,ee]),re=(0,Ft.useCallback)(he=>{ee(he),S(he)},[ee,S]),Q=(0,Ft.useCallback)((he,xe)=>{C(he),I(xe),u?.()},[C,u]),Y=U==="patterns"&&!k&&!!x,J=U==="media"&&!!P,K=(0,Ft.useMemo)(()=>U==="media"?null:(0,qe.jsxs)(qe.Fragment,{children:[(0,qe.jsx)(lg.SearchControl,{className:"block-editor-inserter__search",onChange:he=>{y&&S(null),v(he)},value:b,label:(0,Xu.__)("Search"),placeholder:(0,Xu.__)("Search")}),!!k&&(0,qe.jsx)(_B,{filterValue:k,onSelect:n,onHover:re,rootClientId:e,clientId:t,isAppender:o,__experimentalInsertionIndex:r,showBlockDirectory:!0,shouldFocusBlock:c,prioritizePatterns:U==="patterns"})]}),[U,y,S,v,b,k,n,re,c,t,e,r,o]),H=(0,Ft.useMemo)(()=>(0,qe.jsxs)(qe.Fragment,{children:[(0,qe.jsx)("div",{className:"block-editor-inserter__block-list",children:(0,qe.jsx)(oK,{ref:se,rootClientId:z,onInsert:ce,onHover:re,showMostUsedBlocks:s})}),i&&(0,qe.jsxs)("div",{className:"block-editor-inserter__tips",children:[(0,qe.jsx)(lg.VisuallyHidden,{as:"h2",children:(0,Xu.__)("A tip for using the block editor")}),(0,qe.jsx)(v9,{})]})]}),[z,ce,re,s,i]),X=(0,Ft.useMemo)(()=>(0,qe.jsx)(EK,{rootClientId:z,onInsert:ie,onSelectCategory:Q,selectedCategory:x,children:Y&&(0,qe.jsx)(fB,{rootClientId:z,onInsert:ie,category:x,patternFilter:B,showTitlesAsTooltip:!0})}),[z,ie,Q,B,x,Y]),ne=(0,Ft.useMemo)(()=>(0,qe.jsx)(H5,{rootClientId:z,selectedCategory:P,onSelectCategory:E,onInsert:ce,children:J&&(0,qe.jsx)(Uy,{rootClientId:z,onInsert:ce,category:P})}),[z,ce,P,E,J]),le=he=>{he!=="patterns"&&C(null),G(he)},ve=(0,Ft.useRef)();return(0,Ft.useLayoutEffect)(()=>{ve.current&&window.requestAnimationFrame(()=>{ve.current.querySelector('[role="tab"][aria-selected="true"]')?.focus()})},[]),(0,qe.jsxs)("div",{className:V("block-editor-inserter__menu",{"show-panel":Y||J,"is-zoom-out":p}),ref:h,children:[(0,qe.jsx)("div",{className:"block-editor-inserter__main-area",children:(0,qe.jsx)(CB,{ref:ve,onSelect:le,onClose:d,selectedTab:U,closeButtonLabel:(0,Xu.__)("Close Block Inserter"),tabs:[{name:"blocks",title:(0,Xu.__)("Blocks"),panel:(0,qe.jsxs)(qe.Fragment,{children:[K,U==="blocks"&&!k&&H]})},{name:"patterns",title:(0,Xu.__)("Patterns"),panel:(0,qe.jsxs)(qe.Fragment,{children:[K,U==="patterns"&&!k&&X]})},{name:"media",title:(0,Xu.__)("Media"),panel:(0,qe.jsxs)(qe.Fragment,{children:[K,ne]})}]})}),i&&y&&(0,qe.jsx)(lg.Popover,{className:"block-editor-inserter__preview-container__popover",placement:"right-start",offset:16,focusOnMount:!1,animate:!1,children:(0,qe.jsx)(X1,{item:y})})]})}var W5=(0,Ft.forwardRef)(Hxe);function Gxe(e,t){return(0,qe.jsx)(W5,{...e,onPatternCategorySelection:JK,ref:t})}var eY=(0,Ft.forwardRef)(Gxe);var EB=l(R(),1),$y=l(N(),1),TB=l(A(),1),tY=l(F(),1);var fm=l(w(),1),Wxe=6,$xe=6,Kxe=2;function IB({onSelect:e,rootClientId:t,clientId:o,isAppender:r,selectBlockOnInsert:n,hasSearch:i=!0}){let[s,a]=(0,EB.useState)(""),[c,u]=$u({onSelect:e,rootClientId:t,clientId:o,isAppender:r,selectBlockOnInsert:n}),[d]=ku(c,u,!0),{setInserterIsOpened:f,insertionIndex:m}=(0,tY.useSelect)(g=>{let{getSettings:b,getBlockIndex:v,getBlockCount:k}=g(_),y=b(),S=v(o),x=k();return{setInserterIsOpened:y.__experimentalSetIsInserterOpened,insertionIndex:S===-1?x:S}},[o]),h=i&&d.length>Wxe;(0,EB.useEffect)(()=>{f&&f(!1)},[f]);let p=()=>{f({filterValue:s,onSelect:e,rootClientId:t,insertionIndex:m})};return(0,fm.jsxs)("div",{className:V("block-editor-inserter__quick-inserter",{"has-search":h,"has-expand":f}),children:[h&&(0,fm.jsx)(TB.SearchControl,{className:"block-editor-inserter__search",value:s,onChange:g=>{a(g)},label:(0,$y.__)("Search"),placeholder:(0,$y.__)("Search")}),(0,fm.jsx)("div",{className:"block-editor-inserter__quick-inserter-results",children:(0,fm.jsx)(_B,{filterValue:s,onSelect:e,rootClientId:t,clientId:o,isAppender:r,maxBlockPatterns:s?Kxe:0,maxBlockTypes:$xe,isDraggable:!1,selectBlockOnInsert:n,isQuick:!0})}),f&&(0,fm.jsx)(TB.Button,{__next40pxDefaultSize:!0,className:"block-editor-inserter__quick-inserter-expand",onClick:p,"aria-label":(0,$y.__)("Browse all. This will open the main inserter panel in the editor toolbar."),children:(0,$y.__)("Browse all")})]})}var Yxe=50;function oY(e,t){if(!e||!e.attributes||!t?.__experimentalLabel)return null;let o=t.__experimentalLabel(e.attributes,{context:"appender"});return typeof o=="string"&&o.length0?o:null}var Ky=l(w(),1),qxe=({onToggle:e,disabled:t,isOpen:o,blockTitle:r,hasSingleBlockType:n,appenderLabel:i,toggleProps:s={}})=>{let{as:a=PB.Button,label:c,onClick:u,...d}=s,f=c;!f&&i?f=i:!f&&n?f=(0,Gl.sprintf)((0,Gl._x)("Add %s","directly add the only allowed block"),r.toLowerCase()):f||(f=(0,Gl._x)("Add block","Generic label for block inserter button"));function m(h){e&&e(h),u&&u(h)}return(0,Ky.jsx)(a,{__next40pxDefaultSize:s.as?void 0:!0,icon:Bi,label:f,tooltipPosition:"bottom",onClick:m,className:"block-editor-inserter__toggle","aria-haspopup":n?!1:"true","aria-expanded":n?!1:o,disabled:t,...d})},Zxe=class extends nY.Component{constructor(){super(...arguments),this.onToggle=this.onToggle.bind(this),this.renderToggle=this.renderToggle.bind(this),this.renderContent=this.renderContent.bind(this)}onToggle(e){let{onToggle:t}=this.props;t&&t(e)}renderToggle({onToggle:e,isOpen:t}){let{disabled:o,blockTitle:r,hasSingleBlockType:n,appenderLabel:i,toggleProps:s,hasItems:a,renderToggle:c=qxe}=this.props;return c({onToggle:e,isOpen:t,disabled:o||!a,blockTitle:r,hasSingleBlockType:n,appenderLabel:i,toggleProps:s})}renderContent({onClose:e}){let{rootClientId:t,clientId:o,isAppender:r,showInserterHelpPanel:n,__experimentalIsQuick:i,onSelectOrClose:s,selectBlockOnInsert:a}=this.props;return i?(0,Ky.jsx)(IB,{onSelect:c=>{let u=Array.isArray(c)&&c?.length?c[0]:c;s&&typeof s=="function"&&s(u),e()},rootClientId:t,clientId:o,isAppender:r,selectBlockOnInsert:a}):(0,Ky.jsx)(eY,{onSelect:()=>{e()},onClose:e,rootClientId:t,clientId:o,isAppender:r,showInserterHelpPanel:n})}render(){let{position:e,hasSingleBlockType:t,directInsertBlock:o,insertOnlyAllowedBlock:r,__experimentalIsQuick:n,onSelectOrClose:i}=this.props;return t||o?this.renderToggle({onToggle:r}):(0,Ky.jsx)(PB.Dropdown,{className:"block-editor-inserter",contentClassName:V("block-editor-inserter__popover",{"is-quick":n}),popoverProps:{position:e,shift:!0},onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,Gl.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:i})}},Ui=(0,OB.compose)([(0,RB.withSelect)((e,{clientId:t,rootClientId:o,shouldDirectInsert:r=!0})=>{let{getBlockRootClientId:n,hasInserterItems:i,getAllowedBlocks:s,getDirectInsertBlock:a}=e(_),{getBlockVariations:c,getBlockType:u}=e(Yy.store);o=o||n(t)||void 0;let d=s(o),f=r&&a(o),m=d?.length===1&&c(d[0].name,"inserter")?.length===0,h=!1;m&&(h=d[0]);let p=f?u(f.name):null,g=oY(f,p);return{hasItems:i(o),hasSingleBlockType:m,blockTitle:h?h.title:"",allowedBlockType:h,directInsertBlock:f,appenderLabel:g,rootClientId:o}}),(0,RB.withDispatch)((e,t,{select:o})=>({insertOnlyAllowedBlock(){let{rootClientId:r,clientId:n,isAppender:i,hasSingleBlockType:s,allowedBlockType:a,directInsertBlock:c,onSelectOrClose:u,selectBlockOnInsert:d}=t;if(!s&&!c)return;function f(b){let{getBlock:v,getPreviousBlockClientId:k}=o(_);if(!b||!n&&!r)return{};let y={},S={};if(n){let x=v(n),C=v(k(n));x?.name===C?.name&&(S=C?.attributes||{})}else{let x=v(r);if(x?.innerBlocks?.length){let C=x.innerBlocks[x.innerBlocks.length-1];c&&c?.name===C.name&&(S=C.attributes)}}return b.forEach(x=>{S.hasOwnProperty(x)&&(y[x]=S[x])}),y}function m(){let{getBlockIndex:b,getBlockSelectionEnd:v,getBlockOrder:k,getBlockRootClientId:y}=o(_);if(n)return b(n);let S=v();return!i&&S&&y(S)===r?b(S)+1:k(r).length}let{insertBlock:h}=e(_),p;if(c){let b=f(c.attributesToCopy);p=(0,Yy.createBlock)(c.name,{...c.attributes||{},...b})}else p=(0,Yy.createBlock)(a.name);h(p,m(),r,d),u&&u(p);let g=(0,Gl.sprintf)((0,Gl.__)("%s block added"),a.title);(0,rY.speak)(g)}})),(0,OB.ifCondition)(({hasItems:e,isAppender:t,rootClientId:o,clientId:r})=>e||!t&&!o&&!r)])(Zxe);var qy=l(w(),1),Xxe="\uFEFF";function cg({rootClientId:e}){let{showPrompt:t,isLocked:o,placeholder:r,isManualGrid:n}=(0,AB.useSelect)(u=>{let{getBlockCount:d,getSettings:f,getTemplateLock:m,getBlockAttributes:h}=u(_),p=!d(e),{bodyPlaceholder:g}=f();return{showPrompt:p,isLocked:!!m(e),placeholder:g,isManualGrid:h(e)?.layout?.isManualPlacement}},[e]),{insertDefaultBlock:i,startTyping:s}=(0,AB.useDispatch)(_);if(o||n)return null;let a=(0,iY.decodeEntities)(r)||(0,$5.__)("Type / to choose a block"),c=()=>{i(void 0,e),s()};return(0,qy.jsxs)("div",{"data-root-client-id":e||"",className:V("block-editor-default-block-appender",{"has-visible-prompt":t}),children:[(0,qy.jsx)("p",{tabIndex:"0",role:"button","aria-label":(0,$5.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:u=>{(LB.ENTER===u.keyCode||LB.SPACE===u.keyCode)&&c()},onClick:()=>c(),onFocus:()=>{t&&c()},children:t?a:Xxe}),(0,qy.jsx)(Ui,{rootClientId:e,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0})]})}var sY=l(A(),1),K5=l(R(),1),Zy=l(N(),1);var aY=l(Re(),1);var NB=l(w(),1);function lY({rootClientId:e,className:t,onFocus:o,tabIndex:r,onSelect:n},i){return(0,NB.jsx)(Ui,{position:"bottom center",rootClientId:e,__experimentalIsQuick:!0,onSelectOrClose:(...s)=>{n&&typeof n=="function"&&n(...s)},renderToggle:({onToggle:s,disabled:a,isOpen:c,blockTitle:u,hasSingleBlockType:d,appenderLabel:f})=>{let m=!d,h;return f?h=f:d?h=(0,Zy.sprintf)((0,Zy._x)("Add %s","directly add the only allowed block"),u.toLowerCase()):h=(0,Zy._x)("Add block","Generic label for block inserter button"),(0,NB.jsx)(sY.Button,{__next40pxDefaultSize:!0,ref:i,onFocus:o,tabIndex:r,className:V(t,"block-editor-button-block-appender"),onClick:s,"aria-haspopup":m?"true":void 0,"aria-expanded":m?c:void 0,disabled:a,label:h,showTooltip:!0,children:(0,NB.jsx)(we,{icon:Bi})})},isAppender:!0})}var cY=(0,K5.forwardRef)((e,t)=>((0,aY.default)("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),lY(e,t))),Qu=(0,K5.forwardRef)(lY);var ug=l(w(),1);function Qxe({rootClientId:e}){return(0,Y5.useSelect)(o=>o(_).canInsertBlockType((0,uY.getDefaultBlockName)(),e))?(0,ug.jsx)(cg,{rootClientId:e}):(0,ug.jsx)(Qu,{rootClientId:e,className:"block-list-appender__toggle"})}function dY({rootClientId:e,CustomAppender:t,className:o,tagName:r="div"}){let n=(0,Y5.useSelect)(i=>{let{getBlockInsertionPoint:s,isBlockInsertionPointVisible:a,getBlockCount:c}=i(_),u=s();return a()&&e===u?.rootClientId&&c(e)===0},[e]);return(0,ug.jsx)(r,{tabIndex:-1,className:V("block-list-appender wp-block",o,{"is-drag-over":n}),contentEditable:!1,"data-block":!0,children:t?(0,ug.jsx)(t,{}):(0,ug.jsx)(Qxe,{rootClientId:e})})}var BY=l(Z(),1),Qy=l(F(),1),EY=l(R(),1),TY=l(N(),1);var dg=l(F(),1),ed=l(R(),1),VB=l(A(),1),wY=l(Z(),1);var pY=l(F(),1),Ju=l(R(),1),hY=l(A(),1),gY=l(N(),1);var mY=l(Z(),1),q5=l(Fe(),1),fY=new WeakMap;function Jxe(e){let t=(0,mY.useRefEffect)(o=>{function r(i){let{deltaX:s,deltaY:a,target:c}=i,u=e.current,d=fY.get(u);d||(d=(0,q5.getScrollContainer)(u),fY.set(u,d));let f=(0,q5.getScrollContainer)(c);o.contains(f)||d.scrollBy(s,a)}let n={passive:!0};return o.addEventListener("wheel",r,n),()=>{o.removeEventListener("wheel",r,n)}},[e]);return e?t:null}var mm=Jxe;var Z5=l(w(),1),ewe=Number.MAX_SAFE_INTEGER;function twe({previousClientId:e,nextClientId:t,children:o,__unstablePopoverSlot:r,__unstableContentRef:n,operation:i="insert",nearestSide:s="right",...a}){let[c,u]=(0,Ju.useReducer)(k=>(k+1)%ewe,0),{orientation:d,rootClientId:f,isVisible:m}=(0,pY.useSelect)(k=>{let{getBlockListSettings:y,getBlockRootClientId:S,isBlockVisible:x}=k(_),C=S(e??t);return{orientation:y(C)?.orientation||"vertical",rootClientId:C,isVisible:x(e)&&x(t)}},[e,t]),h=Xe(e),p=Xe(t),g=d==="vertical",b=(0,Ju.useMemo)(()=>c<0||!h&&!p||!m?void 0:{contextElement:i==="group"?p||h:h||p,getBoundingClientRect(){let y=h?h.getBoundingClientRect():null,S=p?p.getBoundingClientRect():null,x=0,C=0,B=0,I=0;if(i==="group"){let P=S||y;C=P.top,B=0,I=P.bottom-P.top,x=s==="left"?P.left-2:P.right-2}else g?(C=y?y.bottom:S.top,B=y?y.width:S.width,I=S&&y?S.top-y.bottom:0,x=y?y.left:S.left):(C=y?y.top:S.top,I=y?y.height:S.height,(0,gY.isRTL)()?(x=S?S.right:y.left,B=y&&S?y.left-S.right:0):(x=y?y.right:S.left,B=y&&S?S.left-y.right:0),B=Math.max(B,0));return new window.DOMRect(x,C,B,I)}},[h,p,c,g,m,i,s]),v=mm(n);return(0,Ju.useLayoutEffect)(()=>{if(!h)return;let k=new window.MutationObserver(u);return k.observe(h,{attributes:!0}),()=>{k.disconnect()}},[h]),(0,Ju.useLayoutEffect)(()=>{if(!p)return;let k=new window.MutationObserver(u);return k.observe(p,{attributes:!0}),()=>{k.disconnect()}},[p]),(0,Ju.useLayoutEffect)(()=>{if(h)return h.ownerDocument.defaultView.addEventListener("resize",u),()=>{h.ownerDocument.defaultView?.removeEventListener("resize",u)}},[h]),!h&&!p||!m?null:(0,Z5.jsx)(hY.Popover,{ref:v,animate:!1,anchor:b,focusOnMount:!1,__unstableSlotName:r,inline:!r,...a,className:V("block-editor-block-popover","block-editor-block-popover__inbetween",a.className),resize:!1,flip:!1,placement:"overlay",variant:"unstyled",children:(0,Z5.jsx)("div",{className:"block-editor-block-popover__inbetween-container",children:o})},t+"--"+f)}var MB=twe;var yY=l(F(),1),SY=l(Z(),1),_Y=l(A(),1);var $l=l(R(),1);var bY=l(Z(),1),kY=l(A(),1),Wl=l(R(),1);var X5=l(w(),1),owe=Number.MAX_SAFE_INTEGER;function rwe({clientId:e,bottomClientId:t,children:o,__unstablePopoverSlot:r,__unstableContentRef:n,shift:i=!0,...s},a){let c=Xe(e),u=Xe(t??e),d=(0,bY.useMergeRefs)([a,mm(n)]),[f,m]=(0,Wl.useReducer)(p=>(p+1)%owe,0);(0,Wl.useLayoutEffect)(()=>{if(!c)return;let p=new window.MutationObserver(m);return p.observe(c,{attributes:!0}),()=>{p.disconnect()}},[c]);let h=(0,Wl.useMemo)(()=>{if(!(f<0||!c||t&&!u))return{getBoundingClientRect(){return u?xD(Sh(c),Sh(u)):Sh(c)},contextElement:c}},[f,c,t,u]);return!c||t&&!u?null:(0,X5.jsx)(kY.Popover,{ref:d,animate:!1,focusOnMount:!1,anchor:h,__unstableSlotName:r,inline:!r,placement:"top-start",resize:!1,flip:!1,shift:i,...s,className:V("block-editor-block-popover",s.className),variant:"unstyled",children:o})}var pm=(0,Wl.forwardRef)(rwe),nwe=({clientId:e,bottomClientId:t,children:o,...r},n)=>(0,X5.jsx)(pm,{...r,bottomClientId:t,clientId:e,__unstableContentRef:void 0,__unstablePopoverSlot:void 0,ref:n,children:o}),vY=(0,Wl.forwardRef)(nwe);var DB=l(w(),1);function iwe({clientId:e,bottomClientId:t,children:o,shift:r=!1,additionalStyles:n,...i},s){t??=e;let a=Xe(e);return(0,DB.jsx)(pm,{ref:s,clientId:e,bottomClientId:t,shift:r,...i,children:a&&e===t?(0,DB.jsx)(swe,{selectedElement:a,additionalStyles:n,children:o}):o})}function swe({selectedElement:e,additionalStyles:t={},children:o}){let[r,n]=(0,$l.useState)(e.offsetWidth),[i,s]=(0,$l.useState)(e.offsetHeight);(0,$l.useEffect)(()=>{let c=new window.ResizeObserver(()=>{n(e.offsetWidth),s(e.offsetHeight)});return c.observe(e,{box:"border-box"}),()=>c.disconnect()},[e]);let a=(0,$l.useMemo)(()=>({position:"absolute",width:r,height:i,...t}),[r,i,t]);return(0,DB.jsx)("div",{style:a,children:o})}var Hi=(0,$l.forwardRef)(iwe);var Q5=l(w(),1),Xy={hide:{opacity:0,scaleY:.75},show:{opacity:1,scaleY:1},exit:{opacity:0,scaleY:.9}};function awe({__unstablePopoverSlot:e,__unstableContentRef:t}){let{clientId:o}=(0,yY.useSelect)(n=>{let{getBlockOrder:i,getBlockInsertionPoint:s}=n(_),a=s(),c=i(a.rootClientId);return c.length?{clientId:c[a.index]}:{}},[]),r=(0,SY.useReducedMotion)();return(0,Q5.jsx)(Hi,{clientId:o,__unstablePopoverSlot:e,__unstableContentRef:t,className:"block-editor-block-popover__drop-zone",children:(0,Q5.jsx)(_Y.__unstableMotion.div,{"data-testid":"block-popover-drop-zone",initial:r?Xy.show:Xy.hide,animate:Xy.show,exit:r?Xy.show:Xy.exit,className:"block-editor-block-popover__drop-zone-foreground"})})}var xY=awe;var Kl=l(w(),1),fg=(0,ed.createContext)();fg.displayName="InsertionPointOpenRefContext";function lwe({__unstablePopoverSlot:e,__unstableContentRef:t,operation:o="insert",nearestSide:r="right"}){let{selectBlock:n,hideInsertionPoint:i}=(0,dg.useDispatch)(_),s=(0,ed.useContext)(fg),a=(0,ed.useRef)(),{orientation:c,previousClientId:u,nextClientId:d,rootClientId:f,isInserterShown:m,isDistractionFree:h,isZoomOutMode:p}=(0,dg.useSelect)(P=>{let{getBlockOrder:E,getBlockListSettings:L,getBlockInsertionPoint:T,isBlockBeingDragged:O,getPreviousBlockClientId:D,getNextBlockClientId:U,getSettings:G,isZoomOut:j}=M(P(_)),z=T(),W=E(z.rootClientId);if(!W.length)return{};let ee=W[z.index-1],se=W[z.index];for(;O(ee);)ee=D(ee);for(;O(se);)se=U(se);let ce=G();return{previousClientId:ee,nextClientId:se,orientation:L(z.rootClientId)?.orientation||"vertical",rootClientId:z.rootClientId,isDistractionFree:ce.isDistractionFree,isInserterShown:z?.__unstableWithInserter,isZoomOutMode:j()}},[]),{getBlockEditingMode:g}=(0,dg.useSelect)(_),b=(0,wY.useReducedMotion)();function v(P){P.target===a.current&&d&&g(d)!=="disabled"&&n(d,-1)}function k(P){P.target===a.current&&!s.current&&i()}function y(P){P.target!==a.current&&(s.current=!0)}let S=(0,ed.useCallback)(P=>{!P&&s.current&&(s.current=!1)},[s]),x={start:{opacity:0,scale:0},rest:{opacity:1,scale:1,transition:{delay:m?.5:0,type:"tween"}},hover:{opacity:1,scale:1,transition:{delay:.5,type:"tween"}}},C={start:{scale:b?1:0},rest:{scale:1,transition:{delay:.4,type:"tween"}}};if(h||p&&o!=="insert")return null;let I=V("block-editor-block-list__insertion-point",c==="horizontal"||o==="group"?"is-horizontal":"is-vertical");return(0,Kl.jsx)(MB,{previousClientId:u,nextClientId:d,__unstablePopoverSlot:e,__unstableContentRef:t,operation:o,nearestSide:r,children:(0,Kl.jsxs)(VB.__unstableMotion.div,{layout:!b,initial:b?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:a,tabIndex:-1,onClick:v,onFocus:y,className:V(I,{"is-with-inserter":m}),onHoverEnd:k,children:[(0,Kl.jsx)(VB.__unstableMotion.div,{variants:x,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),m&&(0,Kl.jsx)(VB.__unstableMotion.div,{variants:C,className:V("block-editor-block-list__insertion-point-inserter"),children:(0,Kl.jsx)(Ui,{ref:S,position:"bottom center",clientId:d,rootClientId:f,__experimentalIsQuick:!0,onToggle:P=>{s.current=P},onSelectOrClose:()=>{s.current=!1}})})]})})}function CY(e){let{insertionPoint:t,isVisible:o,isBlockListEmpty:r}=(0,dg.useSelect)(n=>{let{getBlockInsertionPoint:i,isBlockInsertionPointVisible:s,getBlockCount:a}=n(_),c=i();return{insertionPoint:c,isVisible:s(),isBlockListEmpty:a(c?.rootClientId)===0}},[]);return!o||r?null:t.operation==="replace"?(0,Kl.jsx)(xY,{...e},`${t.rootClientId}-${t.index}`):(0,Kl.jsx)(lwe,{operation:t.operation,nearestSide:t.nearestSide,...e})}function IY(){let e=(0,EY.useContext)(fg),t=(0,Qy.useSelect)(g=>{let b=g(_).getSettings();return b.isDistractionFree||b.isPreviewMode||M(g(_)).isZoomOut()},[]),{getBlockListSettings:o,getBlockIndex:r,isMultiSelecting:n,getSelectedBlockClientIds:i,getSettings:s,getTemplateLock:a,__unstableIsWithinBlockOverlay:c,getBlockEditingMode:u,getBlockName:d,getBlockAttributes:f,getParentSectionBlock:m}=M((0,Qy.useSelect)(_)),{showInsertionPoint:h,hideInsertionPoint:p}=(0,Qy.useDispatch)(_);return(0,BY.useRefEffect)(g=>{if(t)return;function b(v){if(e===void 0||e.current||v.target.nodeType===v.target.TEXT_NODE||n())return;if(!v.target.classList.contains("block-editor-block-list__layout")){p();return}let k;if(v.target.classList.contains("is-root-container")||(k=(v.target.getAttribute("data-block")?v.target:v.target.closest("[data-block]")).getAttribute("data-block")),a(k)||u(k)==="disabled"||d(k)==="core/block"||k&&f(k).layout?.isManualPlacement)return;let y=o(k),S=y?.orientation||"vertical",x=!!y?.__experimentalCaptureToolbars,C=v.clientY,B=v.clientX,P=Array.from(v.target.children).find(O=>{let D=O.getBoundingClientRect();return O.classList.contains("wp-block")&&S==="vertical"&&D.top>C||O.classList.contains("wp-block")&&S==="horizontal"&&((0,TY.isRTL)()?D.rightB)});if(!P){p();return}if(!P.id&&(P=P.firstElementChild,!P)){p();return}let E=P.id.slice(6);if(!E||c(E)||m(E)||i().includes(E)&&S==="vertical"&&!x&&!s().hasFixedToolbar)return;let L=P.getBoundingClientRect();if(S==="horizontal"&&(v.clientY>L.bottom||v.clientYL.right||v.clientX{g.removeEventListener("mousemove",b)}},[e,o,r,n,h,p,i,t])}var FB=l(F(),1),PY=l(Z(),1);var RY=l(w(),1);function hm(){let{getSettings:e,hasSelectedBlock:t,hasMultiSelection:o}=(0,FB.useSelect)(_),{clearSelectedBlock:r}=(0,FB.useDispatch)(_),{clearBlockSelection:n}=e();return(0,PY.useRefEffect)(i=>{if(!n)return;function s(a){!t()&&!o()||a.target===i&&r()}return i.addEventListener("mousedown",s),()=>{i.removeEventListener("mousedown",s)}},[t,o,r,n])}function OY(e){return(0,RY.jsx)("div",{ref:hm(),...e})}var JY=l(Z(),1),pg=l(R(),1),eq=l(F(),1),vm=l($(),1);var AY=l(w(),1);function LY({showSeparator:e,isFloating:t,onAddBlock:o,isToggle:r}){let{clientId:n}=Ie();return(0,AY.jsx)(Qu,{className:V({"block-list-appender__toggle":r}),rootClientId:n,showSeparator:e,isFloating:t,onAddBlock:o})}var NY=l(w(),1);function MY(){let{clientId:e}=Ie();return(0,NY.jsx)(cg,{rootClientId:e})}var jB=l(R(),1),FY=l(F(),1),zB=l(Re(),1),zY=l(Jy(),1);var eS=new WeakMap;function cwe(){let e;return t=>((e===void 0||!(0,zY.isShallowEqual)(e,t))&&(e=t),e)}function VY(e){let[t]=(0,jB.useState)(cwe);return t(e)}function jY(e,t,o,r,n,i,s,a,c,u,d,f){let m=(0,FY.useRegistry)(),h=VY(o),p=VY(r),g=c===void 0||t==="contentOnly"?t:c;(0,jB.useLayoutEffect)(()=>{let b={allowedBlocks:h,prioritizedInserterBlocks:p,templateLock:g};if(u!==void 0&&(b.__experimentalCaptureToolbars=u),d!==void 0)b.orientation=d;else{let v=xs(f?.type);b.orientation=v.getOrientation(f)}s!==void 0&&((0,zB.default)("__experimentalDefaultBlock",{alternative:"defaultBlock",since:"6.3",version:"6.4"}),b.defaultBlock=s),n!==void 0&&(b.defaultBlock=n),a!==void 0&&((0,zB.default)("__experimentalDirectInsert",{alternative:"directInsert",since:"6.3",version:"6.4"}),b.directInsert=a),i!==void 0&&(b.directInsert=i),b.directInsert!==void 0&&typeof b.directInsert!="boolean"&&(0,zB.default)("Using `Function` as a `directInsert` argument",{alternative:"`boolean` values",since:"6.5"}),eS.get(m)||eS.set(m,{}),eS.get(m)[e]=b,window.queueMicrotask(()=>{let v=eS.get(m);if(Object.keys(v).length){let{updateBlockListSettings:k}=m.dispatch(_);k(v),eS.set(m,{})}})},[e,h,p,g,n,i,s,a,u,d,f,m])}var J5=l(yf(),1),UB=l(R(),1),UY=l(F(),1),HY=l($(),1);function GY(e,t,o,r){let n=(0,UY.useRegistry)(),i=(0,UB.useRef)(null);(0,UB.useLayoutEffect)(()=>{let s=!1,{getBlocks:a,getSelectedBlocksInitialCaretPosition:c,isBlockSelected:u}=n.select(_),{replaceInnerBlocks:d,__unstableMarkNextChangeAsNotPersistent:f}=n.dispatch(_);return window.queueMicrotask(()=>{if(s)return;let m=a(e),h=m.length===0||o==="all"||o==="contentOnly",p=!(0,J5.default)(t,i.current);if(!h||!p)return;i.current=t;let g=(0,HY.synchronizeBlocksWithTemplate)(m,t);(0,J5.default)(g,m)||(f(),d(e,g,m.length===0&&r&&g.length!==0&&u(e),c()))}),()=>{s=!0}},[t,o,e,n,r])}var WY=l($(),1),$Y=l(F(),1);function KY(e){return(0,$Y.useSelect)(t=>{let o=t(_).getBlock(e);if(!o)return;let r=t(WY.store).getBlockType(o.name);if(r&&Object.keys(r.providesContext).length!==0)return Object.fromEntries(Object.entries(r.providesContext).map(([n,i])=>[n,o.attributes[i]]))},[e])}var km=l(F(),1),WB=l(R(),1),$B=l(Z(),1),XY=l(N(),1),mg=l($(),1);var eV=l(R(),1),Zn=l($(),1),gm=l(F(),1),YY=l(Fe(),1);function tV(e){let t={srcRootClientId:null,srcClientIds:null,srcIndex:null,type:null,blocks:null};if(!e.dataTransfer)return t;try{t=Object.assign(t,JSON.parse(e.dataTransfer.getData("wp-blocks")))}catch{return t}return t}function uwe(e,t,o,r,n,i,s,a,c){return u=>{let{srcRootClientId:d,srcClientIds:f,type:m,blocks:h}=tV(u);if(m==="inserter"){s();let p=h.map(g=>(0,Zn.cloneBlock)(g));i(p,!0,null)}if(m==="block"){let p=o(f[0]);if(d===e&&p===t||f.includes(e)||r(f).some(k=>k===e))return;if(a==="group"){let k=f.map(y=>c(y));i(k,!0,null,f);return}let g=d===e,b=f.length,v=g&&p{if(!t().mediaUpload)return;let s=(0,Zn.findTransform)((0,Zn.getBlockTransforms)("from"),a=>a.type==="files"&&r(a.blockName,e)&&a.isMatch(i));if(s){let a=s.transform(i,o);n(a)}}}function fwe(e){return t=>{let o=(0,Zn.pasteHandler)({HTML:t,mode:"BLOCKS"});o.length&&e(o)}}function HB(e,t,o={}){let{operation:r="insert",nearestSide:n="right"}=o,{canInsertBlockType:i,getBlockIndex:s,getClientIdsOfDescendants:a,getBlockOrder:c,getBlocksByClientId:u,getSettings:d,getBlock:f}=(0,gm.useSelect)(_),{getGroupingBlockName:m}=(0,gm.useSelect)(Zn.store),{insertBlocks:h,moveBlocksToPosition:p,updateBlockAttributes:g,clearSelectedBlock:b,replaceBlocks:v,removeBlocks:k}=(0,gm.useDispatch)(_),y=(0,gm.useRegistry)(),S=(0,eV.useCallback)((P,E=!0,L=0,T=[])=>{Array.isArray(P)||(P=[P]);let D=c(e)[t];if(r==="replace")v(D,P,void 0,L);else if(r==="group"){let U=f(D);n==="left"?P.push(U):P.unshift(U);let G=P.map(ee=>(0,Zn.createBlock)(ee.name,ee.attributes,ee.innerBlocks)),j=P.every(ee=>ee.name==="core/image"),z=i("core/gallery",e),W=(0,Zn.createBlock)(j&&z?"core/gallery":m(),{layout:{type:"flex",flexWrap:j&&z?null:"nowrap"}},G);v([D,...T],W,void 0,L)}else h(P,t,e,E,L)},[c,e,t,r,v,f,n,i,m,h]),x=(0,eV.useCallback)((P,E,L)=>{if(r==="replace"){let T=u(P),D=c(e)[t];y.batch(()=>{k(P,!1),v(D,T,void 0,0)})}else p(P,E,e,L)},[r,c,u,p,y,k,v,t,e]),C=uwe(e,t,s,a,x,S,b,r,f),B=dwe(e,d,g,i,S),I=fwe(S);return P=>{let E=(0,YY.getFilesFromDataTransfer)(P.dataTransfer),L=P.dataTransfer.getData("text/html");L?I(L):E.length?B(E):C(P)}}function mwe(e,t,o){let r=o==="top"||o==="bottom",{x:n,y:i}=e,s=r?n:i,a=r?i:n,c=r?t.left:t.top,u=r?t.right:t.bottom,d=t[o],f;return s>=c&&s<=u?f=s:s{let s=mwe(e,t,i);(r===void 0||s=e.x&&t.top<=e.y&&t.bottom>=e.y}function qY(e,t){return t.top<=e.y&&t.bottom>=e.y}var oV=30,pwe=120,hwe=120;function gwe(e,t,o="vertical",r={}){let n=o==="horizontal"?["left","right"]:["top","bottom"],i=0,s="before",a=1/0,c=null,u="right",{dropZoneElement:d,parentBlockOrientation:f,rootBlockIndex:m=0}=r;if(d&&f!=="horizontal"){let v=d.getBoundingClientRect(),[k,y]=bm(t,v,["top","bottom"]);if(v.height>pwe&&khwe&&k{let x=k();if(!x)return;let[C,B]=bm(t,x,n),[I,P]=bm(t,x,["left","right"]),E=GB(t,x);v&&E?C=0:o==="vertical"&&S!=="horizontal"&&(E&&Ic);n=o.every(c=>a?.includes(c))}let s=o.map(a=>e(a)).every(a=>{let[c]=a?.parent||[];return c?c===r:!0});return n&&s}function ZY(e,t){let{defaultView:o}=t;return!!(o&&e instanceof o.HTMLElement&&e.closest("[data-is-insertion-point]"))}function QY({dropZoneElement:e,rootClientId:t="",parentClientId:o="",isDisabled:r=!1}={}){let n=(0,km.useRegistry)(),[i,s]=(0,WB.useState)({index:null,operation:"insert"}),{getBlockType:a,getBlockVariations:c,getGroupingBlockName:u}=(0,km.useSelect)(mg.store),{canInsertBlockType:d,getBlockListSettings:f,getBlocks:m,getBlockIndex:h,getDraggedBlockClientIds:p,getBlockNamesByClientId:g,getAllowedBlocks:b,isDragging:v,isGroupable:k,isZoomOut:y,getSectionRootClientId:S,getBlockParents:x}=M((0,km.useSelect)(_)),{showInsertionPoint:C,hideInsertionPoint:B,startDragging:I,stopDragging:P}=M((0,km.useDispatch)(_)),E=HB(i.operation==="before"||i.operation==="after"?o:t,i.index,{operation:i.operation,nearestSide:i.nearestSide}),L=(0,$B.useThrottle)((0,WB.useCallback)((T,O)=>{v()||I();let D=p(),U=[t,...x(t,!0)];if(D.some(H=>U.includes(H)))return;let j=b(t),z=g([t])[0],W=g(D);if(!KB(a,j,W,z))return;let se=S();if(y()&&se!==t)return;let ce=m(t).filter(H=>!((0,mg.hasBlockSupport)(H.name,"visibility",!0)&&H.attributes?.metadata?.blockVisibility===!1));if(ce.length===0){n.batch(()=>{s({index:0,operation:"insert"}),C(t,0,{operation:"insert"})});return}let ie=ce.map(H=>{let X=H.clientId;return{isUnmodifiedDefaultBlock:(0,mg.isUnmodifiedDefaultBlock)(H),getBoundingClientRect:()=>{let ne=O.getElementById(`block-${X}`);return ne?ne.getBoundingClientRect():null},blockIndex:h(X),blockOrientation:f(X)?.orientation}}),re=gwe(ie,{x:T.clientX,y:T.clientY},f(t)?.orientation,{dropZoneElement:e,parentBlockClientId:o,parentBlockOrientation:o?f(o)?.orientation:void 0,rootBlockIndex:h(t)}),[Q,Y,J]=re,K=ie[Q]?.isUnmodifiedDefaultBlock;if(!(y()&&!K&&Y!=="insert")){if(Y==="group"){let H=ce[Q],X=[H.name,...W].every(xe=>xe==="core/image"),ne=d("core/gallery",t),le=k([H.clientId,p()]),ve=c(u(),"block"),he=ve&&ve.find(({name:xe})=>xe==="group-row");if(X&&!ne&&(!le||!he)||!X&&(!le||!he))return}n.batch(()=>{s({index:Q,operation:Y,nearestSide:J});let H=["before","after"].includes(Y)?o:t;C(H,Q,{operation:Y,nearestSide:J})})}},[v,b,t,g,p,a,S,y,m,f,e,o,h,n,I,C,d,k,c,u]),200);return(0,$B.__experimentalUseDropZone)({dropZoneElement:e,isDisabled:r,onDrop:E,onDragOver(T){L(T,T.currentTarget.ownerDocument)},onDragLeave(T){let{ownerDocument:O}=T.currentTarget;ZY(T.relatedTarget,O)||ZY(T.target,O)||(L.cancel(),B())},onDragEnd(){L.cancel(),P(),B()}})}var Yl=l(w(),1),bwe={};function kwe({children:e,clientId:t}){let o=KY(t);return(0,Yl.jsx)(g0,{value:o,children:e})}var vwe=(0,pg.memo)(Vy);function tq(e){let{clientId:t,allowedBlocks:o,prioritizedInserterBlocks:r,defaultBlock:n,directInsert:i,__experimentalDefaultBlock:s,__experimentalDirectInsert:a,template:c,templateLock:u,wrapperRef:d,templateInsertUpdatesSelection:f,__experimentalCaptureToolbars:m,__experimentalAppenderTagName:h,renderAppender:p,orientation:g,placeholder:b,layout:v,name:k,blockType:y,parentLock:S,defaultLayout:x}=e;jY(t,S,o,r,n,i,s,a,u,m,g,v),GY(t,c,u,f);let C=(0,vm.getBlockSupport)(k,"layout")||(0,vm.getBlockSupport)(k,"__experimentalLayout")||bwe,{allowSizingOnChildren:B=!1}=C,I=v||C,P=(0,pg.useMemo)(()=>({...x,...I,...B&&{allowSizingOnChildren:!0}}),[x,I,B]),E=(0,Yl.jsx)(vwe,{rootClientId:t,renderAppender:p,__experimentalAppenderTagName:h,layout:P,wrapperRef:d,placeholder:b});return!y?.providesContext||Object.keys(y.providesContext).length===0?E:(0,Yl.jsx)(kwe,{clientId:t,children:E})}function ywe(e){return h1(e),(0,Yl.jsx)(tq,{...e})}var YB=(0,pg.forwardRef)((e,t)=>{let o=ym({ref:t},e);return(0,Yl.jsx)("div",{className:"block-editor-inner-blocks",children:(0,Yl.jsx)("div",{...o})})});function ym(e={},t={}){let{__unstableDisableLayoutClassNames:o,__unstableDisableDropZone:r,dropZoneElement:n}=t,{clientId:i,layout:s=null,__unstableLayoutClassNames:a=""}=Ie(),c=(0,eq.useSelect)(S=>{let{getBlockName:x,isZoomOut:C,getTemplateLock:B,getBlockRootClientId:I,getBlockEditingMode:P,getBlockSettings:E,getSectionRootClientId:L}=M(S(_));if(!i){let W=L();return{isDropZoneDisabled:C()&&W!==""}}let{hasBlockSupport:T,getBlockType:O}=S(vm.store),D=x(i),U=P(i),G=I(i),[j]=E(i,"layout"),z=U==="disabled";if(C()){let W=L();z=i!==W}return{__experimentalCaptureToolbars:T(D,"__experimentalExposeControlsToChildren",!1),name:D,blockType:O(D),parentLock:B(G),parentClientId:G,isDropZoneDisabled:z,defaultLayout:j}},[i]),{__experimentalCaptureToolbars:u,name:d,blockType:f,parentLock:m,parentClientId:h,isDropZoneDisabled:p,defaultLayout:g}=c,b=QY({dropZoneElement:n,rootClientId:i,parentClientId:h}),v=(0,JY.useMergeRefs)([e.ref,r||p||s?.isManualPlacement&&window.__experimentalEnableGridInteractivity?null:b]),k={__experimentalCaptureToolbars:u,layout:s,name:d,blockType:f,parentLock:m,defaultLayout:g,...t},y=k.value&&k.onChange?ywe:tq;return{...e,ref:v,className:V(e.className,"block-editor-block-list__layout",o?"":a),children:i?(0,Yl.jsx)(y,{...k,clientId:i}):(0,Yl.jsx)(Vy,{...t})}}ym.save=vm.__unstableGetInnerBlocksProps;YB.DefaultBlockAppender=MY;YB.ButtonBlockAppender=LY;YB.Content=()=>ym.save().children;var tS=YB;var oS=l(Z(),1),hg=l(F(),1),rV=l(Fe(),1),Er=l(it(),1);var oq=l(w(),1),Swe=new Set([Er.UP,Er.RIGHT,Er.DOWN,Er.LEFT,Er.ENTER,Er.BACKSPACE]);function _we(e){let{keyCode:t,shiftKey:o}=e;return!o&&Swe.has(t)}function rS(){let e=(0,hg.useSelect)(o=>o(_).isTyping(),[]),{stopTyping:t}=(0,hg.useDispatch)(_);return(0,oS.useRefEffect)(o=>{if(!e)return;let{ownerDocument:r}=o,n,i;function s(a){let{clientX:c,clientY:u}=a;n&&i&&(n!==c||i!==u)&&t(),n=c,i=u}return r.addEventListener("mousemove",s),()=>{r.removeEventListener("mousemove",s)}},[e,t])}function nS(){let{isTyping:e}=(0,hg.useSelect)(i=>{let{isTyping:s}=i(_);return{isTyping:s()}},[]),{startTyping:t,stopTyping:o}=(0,hg.useDispatch)(_),r=rS(),n=(0,oS.useRefEffect)(i=>{let{ownerDocument:s}=i,{defaultView:a}=s,c=a.getSelection();if(e){let h=function(v){let{target:k}=v;b=a.setTimeout(()=>{(0,rV.isTextField)(k)||o()})},p=function(v){let{keyCode:k}=v;(k===Er.ESCAPE||k===Er.TAB)&&o()},g=function(){c.isCollapsed||o()};var u=h,d=p,f=g;let b;return i.addEventListener("focus",h),i.addEventListener("keydown",p),s.addEventListener("selectionchange",g),()=>{a.clearTimeout(b),i.removeEventListener("focus",h),i.removeEventListener("keydown",p),s.removeEventListener("selectionchange",g)}}function m(h){let{type:p,target:g}=h;!(0,rV.isTextField)(g)||!i.contains(g)||p==="keydown"&&!_we(h)||t()}return i.addEventListener("keypress",m),i.addEventListener("keydown",m),()=>{i.removeEventListener("keypress",m),i.removeEventListener("keydown",m)}},[e,t,o]);return(0,oS.useMergeRefs)([r,n])}function xwe({children:e}){return(0,oq.jsx)("div",{ref:nS(),children:e})}var rq=xwe;var iS=l(A(),1),nq=l(Z(),1),iq=l(F(),1),sq=l(R(),1),aq=l(N(),1);var qB=l(w(),1);function nV({clientId:e,rootClientId:t="",position:o="top"}){let[r,n]=(0,sq.useState)(!1),{sectionRootClientId:i,sectionClientIds:s,insertionPoint:a,blockInsertionPointVisible:c,blockInsertionPoint:u,blocksBeingDragged:d}=(0,iq.useSelect)(x=>{let{getInsertionPoint:C,getBlockOrder:B,getSectionRootClientId:I,isBlockInsertionPointVisible:P,getBlockInsertionPoint:E,getDraggedBlockClientIds:L}=M(x(_)),T=I(),O=B(T);return{sectionRootClientId:T,sectionClientIds:O,insertionPoint:C(),blockInsertionPoint:E(),blockInsertionPointVisible:P(),blocksBeingDragged:L()}},[]),f=(0,nq.useReducedMotion)();if(!e)return;let m=!1;if(!(t===i&&s&&s.includes(e)))return null;let p=a?.index===0&&e===s[a.index],g=a&&a.hasOwnProperty("index")&&e===s[a.index-1];o==="top"&&(m=p||c&&u.index===0&&e===s[u.index]),o==="bottom"&&(m=g||c&&e===s[u.index-1]);let b=d[0],v=d.includes(e),k=s.indexOf(b),S=(k>0?s[k-1]:null)===e;return(v||S)&&(m=!1),(0,qB.jsx)(iS.__unstableAnimatePresence,{children:m&&(0,qB.jsx)(iS.__unstableMotion.div,{initial:{height:0},animate:{height:"calc(1 * var(--wp-block-editor-iframe-zoom-out-frame-size) / var(--wp-block-editor-iframe-zoom-out-scale)"},exit:{height:0},transition:{type:"tween",duration:f?0:.2,ease:[.6,0,.4,1]},className:V("block-editor-block-list__zoom-out-separator",{"is-dragged-over":r}),"data-is-insertion-point":"true",onDragOver:()=>n(!0),onDragLeave:()=>n(!1),children:(0,qB.jsx)(iS.__unstableMotion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{delay:-.125}},transition:{ease:"linear",duration:.1,delay:.125},children:(0,aq.__)("Drop pattern.")})})})}var Kr=l(w(),1),e1=(0,td.createContext)();e1.displayName="IntersectionObserverContext";var ZB=new WeakMap,wwe={trailing:!0};function Cwe({className:e,...t}){let{isOutlineMode:o,isFocusMode:r,isPreviewMode:n,editedContentOnlySection:i}=(0,Gi.useSelect)(f=>{let{getSettings:m,isTyping:h,hasBlockSpotlight:p,getEditedContentOnlySection:g}=M(f(_)),{outlineMode:b,focusMode:v,isPreviewMode:k}=m();return{isOutlineMode:b&&!h(),isFocusMode:v||p(),isPreviewMode:k,editedContentOnlySection:g()}},[]),s=(0,Gi.useRegistry)(),{setBlockVisibility:a}=(0,Gi.useDispatch)(_),c=(0,XB.useDebounce)((0,td.useCallback)(()=>{let f={};ZB.get(s).forEach(([m,h])=>{f[m]=h}),a(f)},[s]),300,wwe),u=(0,td.useMemo)(()=>{let{IntersectionObserver:f}=window;if(f)return new f(m=>{ZB.get(s)||ZB.set(s,[]);for(let h of m){let p=h.target.getAttribute("data-block");ZB.get(s).push([p,h.isIntersecting])}c()})},[]),d=ym({ref:(0,XB.useMergeRefs)([hm(),IY(),nS()]),className:V("is-root-container",e,{"is-outline-mode":o,"is-focus-mode":r,"is-preview-mode":n})},t);return(0,Kr.jsxs)(e1.Provider,{value:u,children:[(0,Kr.jsx)("div",{...d}),!!i&&(0,Kr.jsx)(Bwe,{clientId:i})]})}function Bwe({clientId:e}){let{stopEditingContentOnlySection:t}=M((0,Gi.useDispatch)(_)),o=(0,Gi.useSelect)(r=>{let{isBlockSelected:n,hasSelectedInnerBlock:i,getBlockSelectionStart:s}=r(_);return!s()||n(e)||i(e,!0)},[e]);return(0,td.useEffect)(()=>{o||t()},[o,t]),null}function Gh(e){return(0,Kr.jsx)(f0,{value:gO,children:(0,Kr.jsx)(Cwe,{...e})})}var Ewe=[],Twe=new Set;function Iwe({placeholder:e,rootClientId:t,renderAppender:o,__experimentalAppenderTagName:r,layout:n=wM}){let i=o!==!1,s=!!o,{order:a,isZoomOut:c,selectedBlocks:u,visibleBlocks:d,shouldRenderAppender:f}=(0,Gi.useSelect)(m=>{let{getSettings:h,getBlockOrder:p,getSelectedBlockClientIds:g,__unstableGetVisibleBlocks:b,getTemplateLock:v,getBlockEditingMode:k,isSectionBlock:y,isContainerInsertableToInContentOnlyMode:S,getBlockName:x,isZoomOut:C,canInsertBlockType:B}=M(m(_)),I=p(t);if(h().isPreviewMode)return{order:I,selectedBlocks:Ewe,visibleBlocks:Twe};let P=g(),E=P[0],L=!t&&!E&&(!I.length||!B((0,lq.getDefaultBlockName)(),t)),T=!!(t&&E&&t===E),O=v(t);return{order:I,selectedBlocks:P,visibleBlocks:b(),isZoomOut:C(),shouldRenderAppender:(!y(t)||S(x(E),t))&&k(t)!=="disabled"&&(!O||O==="contentOnly")&&i&&!C()&&(s||T||L)}},[t,i,s]);return(0,Kr.jsxs)(mH,{value:n,children:[a.map(m=>(0,Kr.jsxs)(Gi.AsyncModeProvider,{value:!d.has(m)&&!u.includes(m),children:[c&&(0,Kr.jsx)(nV,{clientId:m,rootClientId:t,position:"top"}),(0,Kr.jsx)(g9,{rootClientId:t,clientId:m}),c&&(0,Kr.jsx)(nV,{clientId:m,rootClientId:t,position:"bottom"})]},m)),a.length<1&&e,f&&(0,Kr.jsx)(dY,{tagName:r,rootClientId:t,CustomAppender:o})]})}function Vy(e){return(0,Kr.jsx)(Gi.AsyncModeProvider,{value:!1,children:(0,Kr.jsx)(Iwe,{...e})})}var Ug=l(F(),1),JV=l(Fe(),1),e3=l(A(),1),YQ=l(Is(),1),ST=l(R(),1),Hg=l($(),1),t3=l(Xo(),1),Gg=l(N(),1);var Mq=l(Z(),1),Dq=l(F(),1),Vq=l(Fe(),1),Ea=l(R(),1);var Xn=l(N(),1),_m=l($(),1),sE=l(A(),1),Pq=l(Z(),1),Rq=l(F(),1),aE=l(R(),1);var aS=l(A(),1),mq=l(Qv(),1),pq=l(Re(),1),oE=l(R(),1);var Tr=l(A(),1),cq=(0,Tr.createSlotFill)("InspectorControls"),Pwe=(0,Tr.createSlotFill)("InspectorAdvancedControls"),Rwe=(0,Tr.createSlotFill)("InspectorControlsBindings"),Owe=(0,Tr.createSlotFill)("InspectorControlsBackground"),Awe=(0,Tr.createSlotFill)("InspectorControlsBorder"),Lwe=(0,Tr.createSlotFill)("InspectorControlsColor"),Nwe=(0,Tr.createSlotFill)("InspectorControlsFilter"),Mwe=(0,Tr.createSlotFill)("InspectorControlsDimensions"),Dwe=(0,Tr.createSlotFill)("InspectorControlsPosition"),Vwe=(0,Tr.createSlotFill)("InspectorControlsTypography"),Fwe=(0,Tr.createSlotFill)("InspectorControlsListView"),zwe=(0,Tr.createSlotFill)("InspectorControlsStyles"),jwe=(0,Tr.createSlotFill)("InspectorControlsEffects"),Uwe=(0,Tr.createSlotFill)("InspectorControlsContent"),Hwe={default:cq,advanced:Pwe,background:Owe,bindings:Rwe,border:Awe,color:Lwe,content:Uwe,dimensions:Mwe,effects:jwe,filter:Nwe,list:Fwe,position:Dwe,settings:cq,styles:zwe,typography:Vwe},Wi=Hwe,sS=(0,Tr.createSlotFill)(Symbol("PrivateInspectorControlsAllowedBlocks"));var gg=l(A(),1),JB=l(R(),1),uq=l(Z(),1),eE=l(F(),1);var QB=l(w(),1),dq=Symbol("ListViewContentPopover"),{Fill:fq,Slot:Gwe}=(0,gg.createSlotFill)(dq);function Wwe(){return(0,uq.useViewportMatch)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:35,resize:!1}}}function tE({listViewRef:e}){let{popoverProps:t}=Wwe(),o=(0,gg.__experimentalUseSlotFills)(dq),r=!!(o&&o.length),{selectedClientId:n,isOpen:i}=(0,eE.useSelect)(u=>{let{getSelectedBlockClientId:d}=u(_),f=M(u(_));return{selectedClientId:d(),isOpen:f.isListViewContentPanelOpen()}},[]),[s,a]=(0,JB.useState)(null);(0,JB.useLayoutEffect)(()=>{if(!n||!e?.current){a(null);return}let u=e.current.querySelector(`[data-block="${n}"]`);a(u)},[n,e]);let{closeListViewContentPanel:c}=M((0,eE.useDispatch)(_));return!i||!r||!s?null:(0,QB.jsx)(gg.Popover,{...t??{},className:"block-editor-inspector-list-view-content-popover",anchor:s,onClose:c,children:(0,QB.jsx)("div",{style:{width:"280px"},children:(0,QB.jsx)(Gwe,{})})})}var od=l(w(),1),$we=["content","list"],Kwe=["default","settings","advanced"];function Sm({children:e,group:t="default",__experimentalGroup:o,resetAllFilter:r}){o&&((0,pq.default)("`__experimentalGroup` property in `InspectorControlsFill`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=o);let n=Ie(),i=Wi[t]?.Fill;if(!i)return(0,mq.default)(`Unknown InspectorControls group "${t}" provided.`),null;if(n[$c]){let s=n.name==="core/template-part",a=Kwe.includes(t),c=$we.includes(t);if(!(s&&a||c))return null}return!n[$c]&&!n[bs]?null:t==="content"&&n[Hk]&&n[$c]?n[bs]?(0,od.jsx)(aS.__experimentalStyleProvider,{document,children:(0,od.jsx)(fq,{children:e})}):null:(0,od.jsx)(aS.__experimentalStyleProvider,{document,children:(0,od.jsx)(i,{children:s=>(0,od.jsx)(qwe,{fillProps:s,children:e,resetAllFilter:r})})})}function Ywe({resetAllFilter:e,children:t}){let{registerResetAllFilter:o,deregisterResetAllFilter:r}=(0,oE.useContext)(aS.__experimentalToolsPanelContext);return(0,oE.useEffect)(()=>{if(e&&o&&r)return o(e),()=>{r(e)}},[e,o,r]),t}function qwe({children:e,resetAllFilter:t,fillProps:o}){let{forwardedContext:r=[]}=o,n=(0,od.jsx)(Ywe,{resetAllFilter:t,children:e});return r.reduce((i,[s,a])=>(0,od.jsx)(s,{...a,children:i}),n)}var _q=l(A(),1),xq=l(R(),1),wq=l(Qv(),1),Cq=l(Re(),1);var gq=l(A(),1),rE=l(F(),1),bq=l(R(),1);var hq=l(Z(),1);function Ro(){return(0,hq.useViewportMatch)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:259}}}function bg(e,t){if(!e||!t)return t;let o=e.split(","),r=t.split(","),n=[];return o.forEach(i=>{r.forEach(s=>{n.push(`${i.trim()} ${s.trim()}`)})}),n.join(", ")}var kq=l(w(),1);function vq({children:e,group:t,label:o}){let{updateBlockAttributes:r}=(0,rE.useDispatch)(_),{getBlockAttributes:n,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:s,hasMultiSelection:a}=(0,rE.useSelect)(_),c=Ro(),u=s(),d=(0,bq.useCallback)((f=[])=>{let m={},h=a()?i():[u];h.forEach(p=>{let{style:g}=n(p),b={style:g};f.forEach(v=>{b={...b,...v(b)}}),b={...b,style:Me(b.style)},m[p]=b}),r(h,m,!0)},[n,i,a,u,r]);return(0,kq.jsx)(gq.__experimentalToolsPanel,{className:`${t}-block-support-panel`,label:o,resetAll:d,panelId:u,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:c,children:e},u)}var iV=l(A(),1),nE=l(R(),1),yq=l(w(),1);function Sq({Slot:e,fillProps:t,...o}){let r=(0,nE.useContext)(iV.__experimentalToolsPanelContext),n=(0,nE.useMemo)(()=>({...t??{},forwardedContext:[...t?.forwardedContext??[],[iV.__experimentalToolsPanelContext.Provider,{value:r}]]}),[r,t]);return(0,yq.jsx)(e,{...o,fillProps:n,bubblesVirtually:!0})}var iE=l(w(),1);function Zwe({__experimentalGroup:e,group:t="default",label:o,fillProps:r,...n},i){e&&((0,Cq.default)("`__experimentalGroup` property in `InspectorControlsSlot`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=e);let s=Wi[t],a=(0,_q.__experimentalUseSlotFills)(s?.name);if(!s)return(0,wq.default)(`Unknown InspectorControls group "${t}" provided.`),null;if(!a?.length)return null;let{Slot:c}=s;return o?(0,iE.jsx)(vq,{group:t,label:o,children:(0,iE.jsx)(Sq,{...n,fillProps:r,Slot:c})}):(0,iE.jsx)(c,{...n,ref:i,fillProps:r,bubblesVirtually:!0})}var sV=(0,xq.forwardRef)(Zwe);var aV=l(w(),1),Bq=Sm;Bq.Slot=sV;var rd=e=>(0,aV.jsx)(Sm,{...e,group:"advanced"});rd.Slot=function(t){return(0,aV.jsx)(sV,{...t,group:"advanced"})};rd.slotName="InspectorAdvancedControls";var fe=Bq;var Tq=l(F(),1),nd=l($(),1),lS=l(N(),1);function Eq(e){let t=e?.style?.position?.type;return t==="sticky"?(0,lS.__)("Sticky"):t==="fixed"?(0,lS.__)("Fixed"):null}function Tt(e){return(0,Tq.useSelect)(t=>{if(!e)return null;let{getBlockName:o,getBlockAttributes:r,__experimentalGetParsedPattern:n}=t(_),{getBlockType:i,getActiveBlockVariation:s}=t(nd.store),a=o(e),c=i(a);if(!c)return null;let u=r(e),d=u?.metadata?.patternName;if(d){let v=n(d),k=Eq(u);return{isSynced:!1,title:(0,lS.__)("Pattern"),icon:Ei,description:v?.description||(0,lS.__)("A block pattern."),anchor:u?.anchor,positionLabel:k,positionType:u?.style?.position?.type,name:v?.title||u?.metadata?.name}}let f=s(a,u),m=(0,nd.isReusableBlock)(c)||(0,nd.isTemplatePart)(c),p=(m?(0,nd.__experimentalGetBlockLabel)(c,u):void 0)||c.title,g=Eq(u),b={isSynced:m,title:p,icon:c.icon,description:c.description,anchor:u?.anchor,positionLabel:g,positionType:u?.style?.position?.type,name:u?.metadata?.name};return f?{isSynced:m,title:f.title||c.title,icon:f.icon||c.icon,description:f.description||c.description,anchor:u?.anchor,positionLabel:g,positionType:u?.style?.position?.type,name:u?.metadata?.name}:b},[e])}var cS=l(w(),1),uS="position",lV={key:"default",value:"",name:(0,Xn.__)("Default")},cV={key:"sticky",value:"sticky",name:(0,Xn._x)("Sticky","Name for the value of the CSS position property"),hint:(0,Xn.__)("The block will stick to the top of the window instead of scrolling.")},Iq={key:"fixed",value:"fixed",name:(0,Xn._x)("Fixed","Name for the value of the CSS position property"),hint:(0,Xn.__)("The block will not move when the page is scrolled.")},Xwe=["top","right","bottom","left"],Qwe=["sticky","fixed"];function Jwe({selector:e,style:t}){let o="",{type:r}=t?.position||{};return Qwe.includes(r)&&(o+=`${e} {`,o+=`position: ${r};`,Xwe.forEach(n=>{t?.position?.[n]!==void 0&&(o+=`${n}: ${t.position[n]};`)}),(r==="sticky"||r==="fixed")&&(o+="z-index: 10"),o+="}"),o}function eCe(e){let t=(0,_m.getBlockSupport)(e,uS);return!!(t===!0||t?.sticky)}function tCe(e){let t=(0,_m.getBlockSupport)(e,uS);return!!(t===!0||t?.fixed)}function oCe(e){return!!(0,_m.getBlockSupport)(e,uS)}function Oq(e){let t=e?.style?.position?.type;return t==="sticky"||t==="fixed"}function Aq({name:e}={}){let[t,o]=me("position.fixed","position.sticky"),r=!t&&!o;return!oCe(e)||r}function rCe({style:e={},clientId:t,name:o,setAttributes:r}){let n=tCe(o),i=eCe(o),s=e?.position?.type,{firstParentClientId:a}=(0,Rq.useSelect)(h=>{let{getBlockParents:p}=h(_),g=p(t);return{firstParentClientId:g[g.length-1]}},[t]),c=Tt(a),u=i&&s===cV.value&&c?(0,Xn.sprintf)((0,Xn.__)("The block will stick to the scrollable area of the parent %s block."),c.title):null,d=(0,aE.useMemo)(()=>{let h=[lV];return(i||s===cV.value)&&h.push(cV),(n||s===Iq.value)&&h.push(Iq),h},[n,i,s]),f=h=>{let g={...e,position:{...e?.position,type:h,top:h==="sticky"||h==="fixed"?"0px":void 0}};r({style:Me(g)})},m=s&&d.find(h=>h.value===s)||lV;return aE.Platform.select({web:d.length>1?(0,cS.jsx)(fe,{group:"position",children:(0,cS.jsx)(sE.BaseControl,{help:u,children:(0,cS.jsx)(sE.CustomSelectControl,{__next40pxDefaultSize:!0,label:(0,Xn.__)("Position"),hideLabelFromVision:!0,describedBy:(0,Xn.sprintf)((0,Xn.__)("Currently selected position: %s"),m.name),options:d,value:m,onChange:({selectedItem:h})=>{f(h.value)},size:"__unstable-large"})})}):null,native:null})}var uV={edit:function(t){return Aq(t)?null:(0,cS.jsx)(rCe,{...t})},useBlockProps:iCe,attributeKeys:["style"],hasSupport(e){return(0,_m.hasBlockSupport)(e,uS)}},nCe={};function iCe({name:e,style:t}){let o=(0,_m.hasBlockSupport)(e,uS),r=Aq({name:e}),n=o&&!r,i=(0,Pq.useInstanceId)(nCe),s=`.wp-container-${i}.wp-container-${i}`,a;n&&(a=Jwe({selector:s,style:t})||"");let c=V({[`wp-container-${i}`]:n&&!!a,[`is-position-${t?.position?.type}`]:n&&!!a&&!!t?.position?.type});return Qn({css:a}),{className:c}}var Fq={placement:"top-start"},Lq={...Fq,flip:!1,shift:!0},sCe={...Fq,flip:!0,shift:!1};function Nq(e,t,o,r,n){if(!e||!t)return Lq;let i=o?.scrollTop||0,s=Sh(t),a=e.getBoundingClientRect(),c=i+a.top,u=e.ownerDocument.documentElement.clientHeight,d=c+r,f=s.top>d,m=s.height>u-r;return!n&&(f||m)?Lq:sCe}function lE({contentElement:e,clientId:t}){let o=Xe(t),[r,n]=(0,Ea.useState)(0),{blockIndex:i,isSticky:s}=(0,Dq.useSelect)(m=>{let{getBlockIndex:h,getBlockAttributes:p}=m(_);return{blockIndex:h(t),isSticky:Oq(p(t))}},[t]),a=(0,Ea.useMemo)(()=>{if(e)return(0,Vq.getScrollContainer)(e)},[e]),[c,u]=(0,Ea.useState)(()=>Nq(e,o,a,r,s)),d=(0,Mq.useRefEffect)(m=>{n(m.offsetHeight)},[]),f=(0,Ea.useCallback)(()=>u(Nq(e,o,a,r,s)),[e,o,a,r]);return(0,Ea.useLayoutEffect)(f,[i,f]),(0,Ea.useLayoutEffect)(()=>{if(!e||!o)return;let m=e?.ownerDocument?.defaultView;m?.addEventHandler?.("resize",f);let h,p=o?.ownerDocument?.defaultView;return p.ResizeObserver&&(h=new p.ResizeObserver(f),h.observe(o)),()=>{m?.removeEventHandler?.("resize",f),h&&h.disconnect()}},[f,e,o]),{...c,ref:d}}var zq=l(F(),1);function cE(e){return(0,zq.useSelect)(o=>{let{getBlockRootClientId:r,getBlockParents:n,__experimentalGetBlockListSettingsForBlocks:i,isBlockInsertionPointVisible:s,getBlockInsertionPoint:a,getBlockOrder:c,hasMultiSelection:u,getLastMultiSelectedBlockClientId:d}=o(_),f=n(e),m=i(f),h=f.find(g=>m[g]?.__experimentalCaptureToolbars),p=!1;if(s()){let g=a();p=c(g.rootClientId)[g.index]===e}return{capturingClientId:h,isInsertionPointVisible:p,lastClientId:u()?d():null,rootClientId:r(e)}},[e])}var uE=l(w(),1);function jq({clientId:e,__unstableContentRef:t}){let{capturingClientId:o,isInsertionPointVisible:r,lastClientId:n,rootClientId:i}=cE(e),s=lE({contentElement:t?.current,clientId:e});return(0,uE.jsx)(Hi,{clientId:o||e,bottomClientId:n,className:V("block-editor-block-list__block-side-inserter-popover",{"is-insertion-point-visible":r}),__unstableContentRef:t,...s,children:(0,uE.jsx)("div",{className:"block-editor-block-list__empty-block-inserter",children:(0,uE.jsx)(Ui,{position:"bottom right",rootClientId:i,clientId:e,__experimentalIsQuick:!0})})})}var DQ=l(F(),1),jg=l(R(),1),VQ=l(Is(),1);var OQ=l(N(),1),AQ=l(F(),1),qV=l(R(),1),LQ=l(Z(),1),nc=l($(),1),NQ=l(A(),1);var xm=l(A(),1),Qq=l(F(),1),Jq=l(N(),1);var $q=l($(),1),Kq=l(A(),1),dS=l(F(),1),fS=l(R(),1),Yq=l(Z(),1);var Hq=l(Fe(),1),Ta=l(R(),1),dE=50,Gq=25,aCe=1e3,Uq=aCe*(Gq/1e3);function Wq(){let e=(0,Ta.useRef)(null),t=(0,Ta.useRef)(null),o=(0,Ta.useRef)(null),r=(0,Ta.useRef)(null);(0,Ta.useEffect)(()=>()=>{r.current&&(clearInterval(r.current),r.current=null)},[]);let n=(0,Ta.useCallback)(a=>{e.current=a.clientY,o.current=(0,Hq.getScrollContainer)(a.target),r.current=setInterval(()=>{if(o.current&&t.current){let c=o.current.scrollTop+t.current;o.current.scroll({top:c})}},Gq)},[]),i=(0,Ta.useCallback)(a=>{if(!o.current)return;let c=o.current.offsetHeight,u=e.current-o.current.offsetTop,d=a.clientY-o.current.offsetTop;if(a.clientY>u){let f=Math.max(c-u-dE,0),m=Math.max(d-u-dE,0),h=f===0||m===0?0:m/f;t.current=Uq*h}else if(a.clientY{e.current=null,o.current=null,r.current&&(clearInterval(r.current),r.current=null)}]}var dV=l(w(),1),lCe=({appendToOwnerDocument:e,children:t,clientIds:o,cloneClassname:r,elementId:n,onDragStart:i,onDragEnd:s,fadeWhenDisabled:a=!1,dragComponent:c})=>{let{srcRootClientId:u,isDraggable:d,icon:f,visibleInserter:m,getBlockType:h}=(0,dS.useSelect)(E=>{let{canMoveBlocks:L,getBlockRootClientId:T,getBlockName:O,getBlockAttributes:D,isBlockInsertionPointVisible:U}=E(_),{getBlockType:G,getActiveBlockVariation:j}=E($q.store),z=T(o[0]),W=O(o[0]),ee=j(W,D(o[0]));return{srcRootClientId:z,isDraggable:L(o),icon:ee?.icon||G(W)?.icon,visibleInserter:U(),getBlockType:G}},[o]),p=(0,fS.useRef)(!1),[g,b,v]=Wq(),{getAllowedBlocks:k,getBlockNamesByClientId:y,getBlockRootClientId:S}=(0,dS.useSelect)(_),{startDraggingBlocks:x,stopDraggingBlocks:C}=(0,dS.useDispatch)(_);(0,fS.useEffect)(()=>()=>{p.current&&C()},[]);let I=Xe(o[0])?.closest("body");return(0,fS.useEffect)(()=>{if(!I||!a)return;let L=(0,Yq.throttle)(T=>{if(!T.target.closest("[data-block]"))return;let O=y(o),D=T.target.closest("[data-block]").getAttribute("data-block"),U=k(D),G=y([D])[0],j;if(U?.length===0){let z=S(D),W=y([z])[0],ee=k(z);j=KB(h,ee,O,W)}else j=KB(h,U,O,G);!j&&!m?window?.document?.body?.classList?.add("block-draggable-invalid-drag-token"):window?.document?.body?.classList?.remove("block-draggable-invalid-drag-token")},200);return I.addEventListener("dragover",L),()=>{I.removeEventListener("dragover",L)}},[o,I,a,k,y,S,h,m]),d?(0,dV.jsx)(Kq.Draggable,{appendToOwnerDocument:e,cloneClassname:r,__experimentalTransferDataType:"wp-blocks",transferData:{type:"block",srcClientIds:o,srcRootClientId:u},onDragStart:E=>{window.requestAnimationFrame(()=>{x(o),p.current=!0,g(E),i&&i()})},onDragOver:b,onDragEnd:()=>{C(),p.current=!1,v(),s&&s()},__experimentalDragComponent:c!==void 0?c:(0,dV.jsx)(eB,{count:o.length,icon:f,fadeWhenDisabled:!0}),elementId:n,children:({onDraggableStart:E,onDraggableEnd:L})=>t({draggable:!0,onDragStart:E,onDragEnd:L})}):t({draggable:!1})},fE=lCe;var Zq=l($(),1),mE=l(A(),1),Xq=l(Z(),1),pE=l(F(),1),hE=l(R(),1),$i=l(N(),1);var ke=l(N(),1),id=(e,t)=>e==="up"?t==="horizontal"?(0,ke.isRTL)()?"right":"left":"up":e==="down"?t==="horizontal"?(0,ke.isRTL)()?"left":"right":"down":null;function qq(e,t,o,r,n,i,s){let a=o+1;if(e>1)return cCe(e,o,r,n,i,s);if(r&&n)return(0,ke.sprintf)((0,ke.__)("Block %s is the only block, and cannot be moved"),t);if(i>0&&!n){let c=id("down",s);if(c==="down")return(0,ke.sprintf)((0,ke.__)("Move %1$s block from position %2$d down to position %3$d"),t,a,a+1);if(c==="left")return(0,ke.sprintf)((0,ke.__)("Move %1$s block from position %2$d left to position %3$d"),t,a,a+1);if(c==="right")return(0,ke.sprintf)((0,ke.__)("Move %1$s block from position %2$d right to position %3$d"),t,a,a+1)}if(i>0&&n){let c=id("down",s);if(c==="down")return(0,ke.sprintf)((0,ke.__)("Block %1$s is at the end of the content and can\u2019t be moved down"),t);if(c==="left")return(0,ke.sprintf)((0,ke.__)("Block %1$s is at the end of the content and can\u2019t be moved left"),t);if(c==="right")return(0,ke.sprintf)((0,ke.__)("Block %1$s is at the end of the content and can\u2019t be moved right"),t)}if(i<0&&!r){let c=id("up",s);if(c==="up")return(0,ke.sprintf)((0,ke.__)("Move %1$s block from position %2$d up to position %3$d"),t,a,a-1);if(c==="left")return(0,ke.sprintf)((0,ke.__)("Move %1$s block from position %2$d left to position %3$d"),t,a,a-1);if(c==="right")return(0,ke.sprintf)((0,ke.__)("Move %1$s block from position %2$d right to position %3$d"),t,a,a-1)}if(i<0&&r){let c=id("up",s);if(c==="up")return(0,ke.sprintf)((0,ke.__)("Block %1$s is at the beginning of the content and can\u2019t be moved up"),t);if(c==="left")return(0,ke.sprintf)((0,ke.__)("Block %1$s is at the beginning of the content and can\u2019t be moved left"),t);if(c==="right")return(0,ke.sprintf)((0,ke.__)("Block %1$s is at the beginning of the content and can\u2019t be moved right"),t)}}function cCe(e,t,o,r,n,i){let s=t+1;if(o&&r)return(0,ke.__)("All blocks are selected, and cannot be moved");if(n>0&&!r){let a=id("down",i);if(a==="down")return(0,ke.sprintf)((0,ke.__)("Move %1$d blocks from position %2$d down by one place"),e,s);if(a==="left")return(0,ke.sprintf)((0,ke.__)("Move %1$d blocks from position %2$d left by one place"),e,s);if(a==="right")return(0,ke.sprintf)((0,ke.__)("Move %1$d blocks from position %2$d right by one place"),e,s)}if(n>0&&r){let a=id("down",i);if(a==="down")return(0,ke.__)("Blocks cannot be moved down as they are already at the bottom");if(a==="left")return(0,ke.__)("Blocks cannot be moved left as they are already are at the leftmost position");if(a==="right")return(0,ke.__)("Blocks cannot be moved right as they are already are at the rightmost position")}if(n<0&&!o){let a=id("up",i);if(a==="up")return(0,ke.sprintf)((0,ke.__)("Move %1$d blocks from position %2$d up by one place"),e,s);if(a==="left")return(0,ke.sprintf)((0,ke.__)("Move %1$d blocks from position %2$d left by one place"),e,s);if(a==="right")return(0,ke.sprintf)((0,ke.__)("Move %1$d blocks from position %2$d right by one place"),e,s)}if(n<0&&o){let a=id("up",i);if(a==="up")return(0,ke.__)("Blocks cannot be moved up as they are already at the top");if(a==="left")return(0,ke.__)("Blocks cannot be moved left as they are already are at the leftmost position");if(a==="right")return(0,ke.__)("Blocks cannot be moved right as they are already are at the rightmost position")}}var ql=l(w(),1),uCe=(e,t)=>e==="up"?t==="horizontal"?(0,$i.isRTL)()?Vo:Mr:xf:e==="down"?t==="horizontal"?(0,$i.isRTL)()?Mr:Vo:zn:null,dCe=(e,t)=>e==="up"?t==="horizontal"?(0,$i.isRTL)()?(0,$i.__)("Move right"):(0,$i.__)("Move left"):(0,$i.__)("Move up"):e==="down"?t==="horizontal"?(0,$i.isRTL)()?(0,$i.__)("Move left"):(0,$i.__)("Move right"):(0,$i.__)("Move down"):null,fV=(0,hE.forwardRef)(({clientIds:e,direction:t,orientation:o,...r},n)=>{let i=(0,Xq.useInstanceId)(fV),s=Array.isArray(e)?e:[e],a=s.length,{disabled:c}=r,{blockType:u,isDisabled:d,rootClientId:f,isFirst:m,isLast:h,firstIndex:p,orientation:g="vertical"}=(0,pE.useSelect)(x=>{let{getBlockIndex:C,getBlockRootClientId:B,getBlockOrder:I,getBlock:P,getBlockListSettings:E}=x(_),L=s[0],T=B(L),O=C(L),D=C(s[s.length-1]),U=I(T),G=P(L),j=O===0,z=D===U.length-1,{orientation:W}=E(T)||{};return{blockType:G?(0,Zq.getBlockType)(G.name):null,isDisabled:c||(t==="up"?j:z),rootClientId:T,firstIndex:O,isFirst:j,isLast:z,orientation:o||W}},[e,t]),{moveBlocksDown:b,moveBlocksUp:v}=(0,pE.useDispatch)(_),k=t==="up"?v:b,y=x=>{k(e,f),r.onClick&&r.onClick(x)},S=`block-editor-block-mover-button__description-${i}`;return(0,ql.jsxs)(ql.Fragment,{children:[(0,ql.jsx)(mE.Button,{__next40pxDefaultSize:!0,ref:n,className:V("block-editor-block-mover-button",`is-${t}-button`),icon:uCe(t,g),label:dCe(t,g),"aria-describedby":S,...r,onClick:d?null:y,disabled:d,accessibleWhenDisabled:!0}),(0,ql.jsx)(mE.VisuallyHidden,{id:S,children:qq(a,u&&u.title,p,m,h,t==="up"?-1:1,g)})]})}),gE=(0,hE.forwardRef)((e,t)=>(0,ql.jsx)(fV,{direction:"up",ref:t,...e})),bE=(0,hE.forwardRef)((e,t)=>(0,ql.jsx)(fV,{direction:"down",ref:t,...e}));var Ia=l(w(),1);function fCe({clientIds:e,hideDragHandle:t,isBlockMoverUpButtonDisabled:o,isBlockMoverDownButtonDisabled:r}){let{canMove:n,rootClientId:i,isFirst:s,isLast:a,orientation:c,isManualGrid:u}=(0,Qq.useSelect)(d=>{let{getBlockIndex:f,getBlockListSettings:m,canMoveBlocks:h,getBlockOrder:p,getBlockRootClientId:g,getBlockAttributes:b}=d(_),v=Array.isArray(e)?e:[e],k=v[0],y=g(k),S=f(k),x=f(v[v.length-1]),C=p(y),{layout:B={}}=b(y)??{};return{canMove:h(e),rootClientId:y,isFirst:S===0,isLast:x===C.length-1,orientation:m(y)?.orientation,isManualGrid:B.type==="grid"&&B.isManualPlacement&&window.__experimentalEnableGridInteractivity}},[e]);return!n||s&&a&&!i||t&&u?null:(0,Ia.jsxs)(xm.ToolbarGroup,{className:V("block-editor-block-mover",{"is-horizontal":c==="horizontal"}),children:[!t&&(0,Ia.jsx)(fE,{clientIds:e,fadeWhenDisabled:!0,children:d=>(0,Ia.jsx)(xm.Button,{__next40pxDefaultSize:!0,icon:tv,className:"block-editor-block-mover__drag-handle",label:(0,Jq.__)("Drag"),tabIndex:"-1",...d})}),!u&&(0,Ia.jsxs)("div",{className:"block-editor-block-mover__move-button-container",children:[(0,Ia.jsx)(xm.ToolbarItem,{children:d=>(0,Ia.jsx)(gE,{disabled:o,clientIds:e,...d})}),(0,Ia.jsx)(xm.ToolbarItem,{children:d=>(0,Ia.jsx)(bE,{disabled:r,clientIds:e,...d})})]})]})}var kE=fCe;var oZ=l(A(),1),yE=l(F(),1),SE=l(N(),1),rZ=l(R(),1);var mS=l(F(),1),sd=l(R(),1);var{clearTimeout:eZ,setTimeout:mCe}=window,tZ=200;function pCe({ref:e,isFocused:t,highlightParent:o,debounceTimeout:r=tZ}){let{getSelectedBlockClientId:n,getBlockRootClientId:i}=(0,mS.useSelect)(_),{toggleBlockHighlight:s}=(0,mS.useDispatch)(_),a=(0,sd.useRef)(),c=(0,mS.useSelect)(g=>g(_).getSettings().isDistractionFree,[]),u=g=>{if(g&&c)return;let b=n(),v=o?i(b):b;s(v,g)},d=()=>e?.current&&e.current.matches(":hover"),f=()=>{let g=d();return!t&&!g},m=()=>{let g=a.current;g&&eZ&&eZ(g)},h=g=>{g&&g.stopPropagation(),m(),u(!0)},p=g=>{g&&g.stopPropagation(),m(),a.current=mCe(()=>{f()&&u(!1)},r)};return(0,sd.useEffect)(()=>()=>{u(!1),m()},[]),{debouncedShowGestures:h,debouncedHideGestures:p}}function kg({ref:e,highlightParent:t=!1,debounceTimeout:o=tZ}){let[r,n]=(0,sd.useState)(!1),{debouncedShowGestures:i,debouncedHideGestures:s}=pCe({ref:e,debounceTimeout:o,isFocused:r,highlightParent:t}),a=(0,sd.useRef)(!1),c=()=>e?.current&&e.current.contains(e.current.ownerDocument.activeElement);return(0,sd.useEffect)(()=>{let u=e.current,d=()=>{c()&&(n(!0),i())},f=()=>{c()||(n(!1),s())};return u&&!a.current&&(u.addEventListener("focus",d,!0),u.addEventListener("blur",f,!0),a.current=!0),()=>{u&&(u.removeEventListener("focus",d),u.removeEventListener("blur",f))}},[e,a,n,i,s]),{onMouseMove:i,onMouseLeave:s}}var vE=l(w(),1);function nZ(){let{selectBlock:e}=(0,yE.useDispatch)(_),{parentClientId:t}=(0,yE.useSelect)(i=>{let{getBlockParents:s,getSelectedBlockClientId:a,getParentSectionBlock:c}=M(i(_)),u=a(),d=c(u),f=s(u);return{parentClientId:d??f[f.length-1]}},[]),o=Tt(t),r=(0,rZ.useRef)(),n=kg({ref:r,highlightParent:!0});return(0,vE.jsx)("div",{className:"block-editor-block-parent-selector",ref:r,...n,children:(0,vE.jsx)(oZ.ToolbarButton,{className:"block-editor-block-parent-selector__button",onClick:()=>e(t),label:(0,SE.sprintf)((0,SE.__)("Select parent block: %s"),o?.title),showTooltip:!0,icon:(0,vE.jsx)(Ae,{icon:o?.icon})})},t)}var _E=l(A(),1);var vg=l(A(),1),hCe=(0,vg.createSlotFill)("BlockControls"),gCe=(0,vg.createSlotFill)("BlockControlsBlock"),bCe=(0,vg.createSlotFill)("BlockFormatControls"),kCe=(0,vg.createSlotFill)("BlockControlsOther"),vCe=(0,vg.createSlotFill)("BlockControlsParent"),yCe={default:hCe,block:gCe,inline:bCe,other:kCe,parent:vCe},pS=yCe;function iZ(e,t){let o=Ie();return o[bs]?pS[e]?.Fill:o[Pp]&&t?pS.parent.Fill:null}var Zl=l(w(),1);function mV({group:e="default",controls:t,children:o,__experimentalShareWithChildBlocks:r=!1}){let n=iZ(e,r);if(!n)return null;let i=(0,Zl.jsxs)(Zl.Fragment,{children:[e==="default"&&(0,Zl.jsx)(_E.ToolbarGroup,{controls:t}),o]});return(0,Zl.jsx)(_E.__experimentalStyleProvider,{document,children:(0,Zl.jsx)(n,{children:s=>{let{forwardedContext:a=[]}=s;return a.reduce((c,[u,d])=>(0,Zl.jsx)(u,{...d,children:c}),i)}})})}var hS=l(R(),1),Xl=l(A(),1),aZ=l(Qv(),1);var pV=l(w(),1),{ComponentsContext:sZ}=M(Xl.privateApis);function hV({group:e="default",...t}){let o=(0,hS.useContext)(Xl.__experimentalToolbarContext),r=(0,hS.useContext)(sZ),n=(0,hS.useMemo)(()=>({forwardedContext:[[Xl.__experimentalToolbarContext.Provider,{value:o}],[sZ.Provider,{value:r}]]}),[o,r]),i=pS[e],s=(0,Xl.__experimentalUseSlotFills)(i.name);if(!i)return(0,aZ.default)(`Unknown BlockControls group "${e}" provided.`),null;if(!s?.length)return null;let{Slot:a}=i,c=(0,pV.jsx)(a,{...t,bubblesVirtually:!0,fillProps:n});return e==="default"?c:(0,pV.jsx)(Xl.ToolbarGroup,{children:c})}var gV=l(w(),1),lZ=mV;lZ.Slot=hV;var bV=e=>(0,gV.jsx)(mV,{group:"inline",...e});bV.Slot=function(t){return(0,gV.jsx)(hV,{group:"inline",...t})};var Mt=lZ;var cZ=l(A(),1),{Fill:uZ,Slot:SCe}=(0,cZ.createSlotFill)("__unstableBlockToolbarLastItem");uZ.Slot=SCe;var xE=uZ;var HE=l(A(),1);var wg=l($(),1),ti=l(A(),1),Om=l(F(),1);var jE=l(R(),1),Pa=l(N(),1),fX=l(Is(),1),Rm=l(Z(),1);var Sg=l(F(),1),ad=l($(),1);var EZ=l(R(),1),bS=l($(),1),gS=l(F(),1),TZ=l(Un(),1),Ql=l(N(),1);var Jn=l($(),1),dZ=l(R(),1),_Ce="align";var fZ="__experimentalBorder",wE="color",xCe="customClassName",mZ="typography.__experimentalFontFamily",pZ="typography.fontSize",wCe="typography.lineHeight",CCe="typography.__experimentalFontStyle",BCe="typography.__experimentalFontWeight",hZ="typography.textAlign",ECe="typography.textColumns",TCe="typography.__experimentalTextDecoration",ICe="typography.__experimentalWritingMode",PCe="typography.__experimentalTextTransform",RCe="typography.__experimentalLetterSpacing",OCe="layout",ACe=[wCe,pZ,CCe,BCe,mZ,hZ,ECe,TCe,PCe,ICe,RCe],LCe=["shadow"],NCe="spacing",MCe=[...LCe,...ACe,fZ,wE,NCe],gZ=e=>(0,Jn.hasBlockSupport)(e,_Ce);function bZ(e,t="any"){if(dZ.Platform.OS!=="web")return!1;let o=(0,Jn.getBlockSupport)(e,fZ);return o===!0?!0:t==="any"?!!(o?.color||o?.radius||o?.width||o?.style):!!o?.[t]}var kZ=e=>{let t=(0,Jn.getBlockSupport)(e,wE);return t!==null&&typeof t=="object"&&!!t.gradients},vZ=e=>{let t=(0,Jn.getBlockSupport)(e,wE);return t&&t.background!==!1},yZ=e=>(0,Jn.hasBlockSupport)(e,hZ);var SZ=e=>{let t=(0,Jn.getBlockSupport)(e,wE);return t&&t.text!==!1};var _Z=e=>(0,Jn.hasBlockSupport)(e,xCe,!0);var xZ=e=>(0,Jn.hasBlockSupport)(e,mZ);var wZ=e=>(0,Jn.hasBlockSupport)(e,pZ);var CZ=e=>(0,Jn.hasBlockSupport)(e,OCe);var BZ=e=>MCe.some(t=>(0,Jn.hasBlockSupport)(e,t));function DCe(e){try{let t=(0,bS.parse)(e,{__unstableSkipMigrationLogs:!0,__unstableSkipAutop:!0});return!(t.length===1&&t[0].name==="core/freeform")}catch{return!1}}var VCe={align:gZ,borderColor:e=>bZ(e,"color"),backgroundColor:vZ,textAlign:yZ,textColor:SZ,gradient:kZ,className:_Z,fontFamily:xZ,fontSize:wZ,layout:CZ,style:BZ};function FCe(e,t){return Object.entries(VCe).reduce((o,[r,n])=>(n(e.name)&&n(t.name)&&(o[r]=e.attributes[r]),o),{})}function kV(e,t,o){for(let r=0;r{let s="";try{if(!window.navigator.clipboard){n((0,Ql.__)("Unable to paste styles. This feature is only available on secure (https) sites in supporting browsers."),{type:"snackbar"});return}s=await window.navigator.clipboard.readText()}catch{n((0,Ql.__)("Unable to paste styles. Please allow browser clipboard permissions before continuing."),{type:"snackbar"});return}if(!s||!DCe(s)){r((0,Ql.__)("Unable to paste styles. Block styles couldn't be found within the copied content."),{type:"snackbar"});return}let a=(0,bS.parse)(s);if(a.length===1?e.batch(()=>{kV(i,i.map(()=>a[0]),t)}):e.batch(()=>{kV(i,a,t)}),i.length===1){let c=(0,bS.getBlockType)(i[0].name)?.title;o((0,Ql.sprintf)((0,Ql.__)("Pasted styles to %s."),c),{type:"snackbar"})}else o((0,Ql.sprintf)((0,Ql.__)("Pasted styles to %d blocks."),i.length),{type:"snackbar"})},[e.batch,t,o,r,n])}function IZ({clientIds:e,children:t,__experimentalUpdateSelection:o}){let{getDefaultBlockName:r,getGroupingBlockName:n}=(0,Sg.useSelect)(ad.store),i=(0,Sg.useSelect)(y=>{let{canInsertBlockType:S,getBlockRootClientId:x,getBlocksByClientId:C,getDirectInsertBlock:B,canRemoveBlocks:I}=y(_),P=C(e),E=x(e[0]),L=S(r(),E),T=E?B(E):null;return{canRemove:I(e),canInsertBlock:P.every(O=>(L||!!T)&&S(O.name,E)),canCopyStyles:P.every(O=>!!O&&((0,ad.hasBlockSupport)(O.name,"color")||(0,ad.hasBlockSupport)(O.name,"typography"))),canDuplicate:P.every(O=>!!O&&(0,ad.hasBlockSupport)(O.name,"multiple",!0)&&S(O.name,E))}},[e,r]),{getBlocksByClientId:s,getBlocks:a}=(0,Sg.useSelect)(_),{canRemove:c,canInsertBlock:u,canCopyStyles:d,canDuplicate:f}=i,{removeBlocks:m,replaceBlocks:h,duplicateBlocks:p,insertAfterBlock:g,insertBeforeBlock:b,flashBlock:v}=(0,Sg.useDispatch)(_),k=yg();return t({canCopyStyles:d,canDuplicate:f,canInsertBlock:u,canRemove:c,onDuplicate(){return p(e,o)},onRemove(){return m(e,o)},onInsertBefore(){b(e[0])},onInsertAfter(){g(e[e.length-1])},onGroup(){if(!e.length)return;let y=n(),S=(0,ad.switchToBlockType)(s(e),y);S&&h(e,S)},onUngroup(){if(!e.length)return;let y=a(e[0]);y.length&&h(e,y)},onCopy(){e.length===1&&v(e[0])},async onPasteStyles(){await k(s(e))}})}var PZ=l(A(),1),zCe=(0,PZ.createSlotFill)(Symbol("CommentIconSlotFill")),CE=zCe;var RZ=l(N(),1),OZ=l(A(),1),BE=l($(),1),EE=l(F(),1);var AZ=l(w(),1);function jCe({clientId:e}){let t=(0,EE.useSelect)(r=>r(_).getBlock(e),[e]),{replaceBlocks:o}=(0,EE.useDispatch)(_);return!t||t.name!=="core/html"?null:(0,AZ.jsx)(OZ.MenuItem,{onClick:()=>o(e,(0,BE.rawHandler)({HTML:(0,BE.getBlockContent)(t)})),children:(0,RZ.__)("Convert to Blocks")})}var LZ=jCe;var NZ=l(A(),1),{Fill:MZ,Slot:UCe}=(0,NZ.createSlotFill)("__unstableBlockSettingsMenuFirstItem");MZ.Slot=UCe;var TE=MZ;var xg=l(A(),1),nX=l($(),1),iX=l(F(),1);var yV=l(A(),1),SV=l(N(),1),FZ=l($(),1),RE=l(F(),1),zZ=l(it(),1);var DZ=l($(),1),VZ=l(F(),1);function kS(e){return(0,VZ.useSelect)(t=>{let{getBlocksByClientId:o,getSelectedBlockClientIds:r,isUngroupable:n,isGroupable:i}=t(_),{getGroupingBlockName:s,getBlockType:a}=t(DZ.store),c=e?.length?e:r(),u=o(c),[d]=u,f=c.length===1&&n(c[0]);return{clientIds:c,isGroupable:i(c),isUngroupable:f,blocksSelection:u,groupingBlockName:s(),onUngroup:f&&a(d.name)?.transforms?.ungroup}},[e])}var IE=l(F(),1),PE=l($(),1),wm=l(A(),1);var vS=l(N(),1);var Cm=l(w(),1),HCe={group:{type:"constrained"},row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"},grid:{type:"grid"}};function GCe(){let{blocksSelection:e,clientIds:t,groupingBlockName:o,isGroupable:r}=kS(),{replaceBlocks:n}=(0,IE.useDispatch)(_),{canRemove:i,variations:s}=(0,IE.useSelect)(p=>{let{canRemoveBlocks:g}=p(_),{getBlockVariations:b}=p(PE.store);return{canRemove:g(t),variations:b(o,"transform")}},[t,o]),a=p=>{let g=(0,PE.switchToBlockType)(e,o);typeof p!="string"&&(p="group"),g&&g.length>0&&(g[0].attributes.layout=HCe[p],n(t,g))},c=()=>a("row"),u=()=>a("stack"),d=()=>a("grid");if(!r||!i)return null;let f=!!s.find(({name:p})=>p==="group-row"),m=!!s.find(({name:p})=>p==="group-stack"),h=!!s.find(({name:p})=>p==="group-grid");return(0,Cm.jsxs)(wm.ToolbarGroup,{children:[(0,Cm.jsx)(wm.ToolbarButton,{icon:nv,label:(0,vS._x)("Group","action: convert blocks to group"),onClick:a}),f&&(0,Cm.jsx)(wm.ToolbarButton,{icon:JL,label:(0,vS._x)("Row","action: convert blocks to row"),onClick:c}),m&&(0,Cm.jsx)(wm.ToolbarButton,{icon:pN,label:(0,vS._x)("Stack","action: convert blocks to stack"),onClick:u}),h&&(0,Cm.jsx)(wm.ToolbarButton,{icon:rv,label:(0,vS._x)("Grid","action: convert blocks to grid"),onClick:d})]})}var vV=GCe;var Bm=l(w(),1);function jZ({clientIds:e,isGroupable:t,isUngroupable:o,onUngroup:r,blocksSelection:n,groupingBlockName:i,onClose:s=()=>{}}){let{getSelectedBlockClientIds:a}=(0,RE.useSelect)(_),{replaceBlocks:c}=(0,RE.useDispatch)(_),u=()=>{let m=(0,FZ.switchToBlockType)(n,i);m&&c(e,m)},d=()=>{let m=n[0].innerBlocks;m.length&&(r&&(m=r(n[0].attributes,n[0].innerBlocks)),c(e,m))};if(!t&&!o)return null;let f=a();return(0,Bm.jsxs)(Bm.Fragment,{children:[t&&(0,Bm.jsx)(yV.MenuItem,{shortcut:f.length>1?zZ.displayShortcut.primary("g"):void 0,onClick:()=>{u(),s()},children:(0,SV._x)("Group","verb")}),o&&(0,Bm.jsx)(yV.MenuItem,{onClick:()=>{d(),s()},children:(0,SV._x)("Ungroup","Ungrouping blocks from within a grouping block back into individual blocks within the Editor")})]})}var _V=l(N(),1),GZ=l(R(),1),WZ=l(A(),1);var UZ=l(F(),1);function ei(e){return(0,UZ.useSelect)(t=>{let{canLockBlockType:o,getBlockName:r,isEditLockedBlock:n,isMoveLockedBlock:i,isRemoveLockedBlock:s,isLockedBlock:a}=M(t(_));return{isEditLocked:n(e),isMoveLocked:i(e),isRemoveLocked:s(e),canLock:o(r(e)),isLocked:a(e)}},[e])}var Ki=l(N(),1),yS=l(R(),1),bo=l(A(),1);var OE=l(F(),1),HZ=l($(),1);var It=l(w(),1),WCe=["core/navigation"];function $Ce(e){return e.remove&&e.move?"all":e.remove&&!e.move?"insert":!1}function AE({clientId:e,onClose:t}){let[o,r]=(0,yS.useState)({move:!1,remove:!1}),{isEditLocked:n,isMoveLocked:i,isRemoveLocked:s}=ei(e),{allowsEditLocking:a,templateLock:c,hasTemplateLock:u}=(0,OE.useSelect)(v=>{let{getBlockName:k,getBlockAttributes:y}=v(_),S=k(e),x=(0,HZ.getBlockType)(S);return{allowsEditLocking:WCe.includes(S),templateLock:y(e)?.templateLock,hasTemplateLock:!!x?.attributes?.templateLock}},[e]),[d,f]=(0,yS.useState)(!!c),{updateBlockAttributes:m}=(0,OE.useDispatch)(_),h=Tt(e);(0,yS.useEffect)(()=>{r({move:i,remove:s,...a?{edit:n}:{}})},[n,i,s,a]);let p=Object.values(o).every(Boolean),g=Object.values(o).some(Boolean)&&!p,b=o.move!==i||o.remove!==s||a&&o.edit!==n||u&&d!==!!c;return(0,It.jsx)(bo.Modal,{title:(0,Ki.sprintf)((0,Ki.__)("Lock %s"),h.title),overlayClassName:"block-editor-block-lock-modal",onRequestClose:t,size:"small",children:(0,It.jsxs)("form",{onSubmit:v=>{v.preventDefault(),b&&(m([e],{lock:o,templateLock:d?$Ce(o):void 0}),t())},children:[(0,It.jsxs)("fieldset",{className:"block-editor-block-lock-modal__options",children:[(0,It.jsx)("legend",{children:(0,Ki.__)("Select the features you want to lock")}),(0,It.jsx)("ul",{role:"list",className:"block-editor-block-lock-modal__checklist",children:(0,It.jsxs)("li",{children:[(0,It.jsx)(bo.CheckboxControl,{className:"block-editor-block-lock-modal__options-all",label:(0,Ki.__)("Lock all"),checked:p,indeterminate:g,onChange:v=>r({move:v,remove:v,...a?{edit:v}:{}})}),(0,It.jsxs)("ul",{role:"list",className:"block-editor-block-lock-modal__checklist",children:[a&&(0,It.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,It.jsx)(bo.CheckboxControl,{label:(0,Ki.__)("Lock editing"),checked:!!o.edit,onChange:v=>r(k=>({...k,edit:v}))}),(0,It.jsx)(bo.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:o.edit?Rf:vl})]}),(0,It.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,It.jsx)(bo.CheckboxControl,{label:(0,Ki.__)("Lock movement"),checked:o.move,onChange:v=>r(k=>({...k,move:v}))}),(0,It.jsx)(bo.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:o.move?Rf:vl})]}),(0,It.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,It.jsx)(bo.CheckboxControl,{label:(0,Ki.__)("Lock removal"),checked:o.remove,onChange:v=>r(k=>({...k,remove:v}))}),(0,It.jsx)(bo.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:o.remove?Rf:vl})]})]})]})}),u&&(0,It.jsx)(bo.ToggleControl,{className:"block-editor-block-lock-modal__template-lock",label:(0,Ki.__)("Apply to all blocks inside"),checked:d,disabled:o.move&&!o.remove,onChange:()=>f(!d)})]}),(0,It.jsxs)(bo.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1,children:[(0,It.jsx)(bo.FlexItem,{children:(0,It.jsx)(bo.Button,{variant:"tertiary",onClick:t,__next40pxDefaultSize:!0,children:(0,Ki.__)("Cancel")})}),(0,It.jsx)(bo.FlexItem,{children:(0,It.jsx)(bo.Button,{variant:"primary",type:"submit",disabled:!b,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,Ki.__)("Apply")})})]})]})})}var Em=l(w(),1);function xV({clientId:e}){let{canLock:t,isLocked:o}=ei(e),[r,n]=(0,GZ.useReducer)(s=>!s,!1);if(!t)return null;let i=o?(0,_V.__)("Unlock"):(0,_V.__)("Lock");return(0,Em.jsxs)(Em.Fragment,{children:[(0,Em.jsx)(WZ.MenuItem,{icon:o?vl:CL,onClick:n,"aria-expanded":r,"aria-haspopup":"dialog",children:i}),r&&(0,Em.jsx)(AE,{clientId:e,onClose:n})]})}var LE=l(N(),1),NE=l(A(),1),_g=l(R(),1);var ld=l(w(),1);function wV({clientId:e}){let{canLock:t,isLocked:o}=ei(e),[r,n]=(0,_g.useReducer)(a=>!a,!1),i=(0,_g.useRef)(!1);if((0,_g.useEffect)(()=>{o&&(i.current=!0)},[o]),!o&&!i.current)return null;let s=o?(0,LE.__)("Unlock"):(0,LE.__)("Lock");return!t&&o&&(s=(0,LE.__)("Locked")),(0,ld.jsxs)(ld.Fragment,{children:[(0,ld.jsx)(NE.ToolbarGroup,{className:"block-editor-block-lock-toolbar",children:(0,ld.jsx)(NE.ToolbarButton,{disabled:!t,icon:o?Rf:vl,label:s,onClick:n,"aria-expanded":r,"aria-haspopup":"dialog"})}),r&&(0,ld.jsx)(AE,{clientId:e,onClose:n})]})}var CV=l(N(),1),$Z=l(A(),1),ME=l($(),1),DE=l(F(),1);var KZ=l(w(),1),KCe=()=>{};function YZ({clientId:e,onToggle:t=KCe}){let{blockType:o,mode:r,enabled:n}=(0,DE.useSelect)(a=>{let{getBlock:c,getBlockMode:u,getSettings:d}=a(_),f=c(e);return{mode:u(e),blockType:f?(0,ME.getBlockType)(f.name):null,enabled:d().codeEditingEnabled&&!!f?.isValid}},[e]),{toggleBlockMode:i}=(0,DE.useDispatch)(_);if(!o||!(0,ME.hasBlockSupport)(o,"html",!0)||!n)return null;let s=r==="visual"?(0,CV.__)("Edit as HTML"):(0,CV.__)("Edit visually");return(0,KZ.jsx)($Z.MenuItem,{onClick:()=>{i(e),t()},children:s})}var QZ=l(A(),1),JZ=l(N(),1),eX=l(R(),1),tX=l(F(),1),oX=l(Is(),1);var Fs=l(A(),1),Vs=l(N(),1),ZZ=l(R(),1),XZ=l(Xo(),1),VE=l(F(),1);function qZ(e){return e?.trim()?.length===0}var Jl=l(w(),1);function Tm({clientId:e,onClose:t}){let[o,r]=(0,ZZ.useState)(),n=Tt(e),{metadata:i}=(0,VE.useSelect)(b=>{let{getBlockAttributes:v}=b(_);return{metadata:v(e)?.metadata}},[e]),{updateBlockAttributes:s}=(0,VE.useDispatch)(_),a=i?.name||"",c=n?.title,u=!!a&&!!i?.bindings&&Object.values(i.bindings).some(b=>b.source==="core/pattern-overrides"),d=o!==void 0&&o!==a,f=o===c,m=qZ(o),h=d||f,p=b=>b.target.select(),g=()=>{let b=f||m?void 0:o,v=f||m?(0,Vs.sprintf)((0,Vs.__)('Block name reset to: "%s".'),o):(0,Vs.sprintf)((0,Vs.__)('Block name changed to: "%s".'),o);(0,XZ.speak)(v,"assertive"),s([e],{metadata:Me({...i,name:b})}),t()};return(0,Jl.jsx)(Fs.Modal,{title:(0,Vs.__)("Rename"),onRequestClose:t,overlayClassName:"block-editor-block-rename-modal",focusOnMount:"firstContentElement",size:"small",children:(0,Jl.jsx)("form",{onSubmit:b=>{b.preventDefault(),h&&g()},children:(0,Jl.jsxs)(Fs.__experimentalVStack,{spacing:"3",children:[(0,Jl.jsx)(Fs.TextControl,{__next40pxDefaultSize:!0,value:o??a,label:(0,Vs.__)("Name"),help:u?(0,Vs.__)("This block allows overrides. Changing the name can cause problems with content entered into instances of this pattern."):void 0,placeholder:c,onChange:r,onFocus:p}),(0,Jl.jsxs)(Fs.__experimentalHStack,{justify:"right",children:[(0,Jl.jsx)(Fs.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,children:(0,Vs.__)("Cancel")}),(0,Jl.jsx)(Fs.Button,{__next40pxDefaultSize:!0,accessibleWhenDisabled:!0,disabled:!h,variant:"primary",type:"submit",children:(0,Vs.__)("Save")})]})]})})})}var Im=l(w(),1);function BV({clientId:e}){let[t,o]=(0,eX.useState)(!1),r=(0,tX.useSelect)(n=>n(oX.store).getShortcutRepresentation("core/block-editor/rename"),[]);return(0,Im.jsxs)(Im.Fragment,{children:[(0,Im.jsx)(QZ.MenuItem,{onClick:()=>{o(!0)},"aria-expanded":t,"aria-haspopup":"dialog",shortcut:r,children:(0,JZ.__)("Rename")}),t&&(0,Im.jsx)(Tm,{clientId:e,onClose:()=>o(!1)})]})}var rX=l($(),1);function Pm(e){return{canRename:!!e&&(0,rX.getBlockSupport)(e,"renaming",!0)}}var zs=l(w(),1),{Fill:YCe,Slot:qCe}=(0,xg.createSlotFill)("BlockSettingsMenuControls"),ZCe=({fillProps:e,clientIds:t=null})=>{let{selectedBlocks:o,selectedClientIds:r,isContentOnly:n,canToggleSelectedBlocksVisibility:i,canEdit:s}=(0,iX.useSelect)(b=>{let{getBlocksByClientId:v,getBlockNamesByClientId:k,getSelectedBlockClientIds:y,getBlockEditingMode:S,canEditBlock:x}=b(_),C=t!==null?t:y();return{selectedBlocks:k(C),selectedClientIds:C,isContentOnly:S(C[0])==="contentOnly",canToggleSelectedBlocksVisibility:v(C).every(B=>(0,nX.hasBlockSupport)(B.name,"visibility",!0)),canEdit:x(C[0])}},[t]),{canLock:a}=ei(r[0]),{canRename:c}=Pm(o[0]),u=r.length===1&&a&&!n,d=r.length===1&&c&&!n,f=i&&!n,m=kS(r),{isGroupable:h,isUngroupable:p}=m,g=(h||p)&&!n;return(0,zs.jsx)(qCe,{fillProps:{...e,canEdit:s,selectedBlocks:o,selectedClientIds:r},children:b=>!b?.length>0&&!g&&!u?null:(0,zs.jsxs)(xg.MenuGroup,{children:[g&&(0,zs.jsx)(jZ,{...m,onClose:e?.onClose}),s&&u&&(0,zs.jsx)(xV,{clientId:r[0]}),s&&d&&(0,zs.jsx)(BV,{clientId:r[0]}),s&&f&&(0,zs.jsx)(PD,{clientIds:r}),b,s&&e?.count===1&&!n&&(0,zs.jsx)(YZ,{clientId:e?.firstBlockClientId,onToggle:e?.onClose})]})})};function sX({...e}){return(0,zs.jsx)(xg.__experimentalStyleProvider,{document,children:(0,zs.jsx)(YCe,{...e})})}sX.Slot=ZCe;var FE=sX;var aX=l(R(),1),lX=l(A(),1),cX=l(Z(),1),uX=l(F(),1),zE=l(N(),1);var EV=l(w(),1);function dX({parentClientId:e,parentBlockType:t}){let o=(0,cX.useViewportMatch)("medium","<"),{selectBlock:r}=(0,uX.useDispatch)(_),n=(0,aX.useRef)(),i=kg({ref:n,highlightParent:!0});return o?(0,EV.jsx)(lX.MenuItem,{...i,ref:n,icon:(0,EV.jsx)(Ae,{icon:t.icon}),onClick:()=>r(e),children:(0,zE.sprintf)((0,zE.__)("Select parent block (%s)"),t.title)}):null}var kt=l(w(),1),XCe={className:"block-editor-block-settings-menu__popover",placement:"bottom-start"};function TV({clientIds:e,onCopy:t,label:o,shortcut:r,eventType:n="copy",__experimentalUpdateSelection:i=!1}){let{getBlocksByClientId:s}=(0,Om.useSelect)(_),{removeBlocks:a}=(0,Om.useDispatch)(_),c=Oh(),u=(0,Rm.useCopyToClipboard)(()=>(0,wg.serialize)(s(e)),()=>{switch(n){case"copy":case"copyStyles":t(),c(n,e);break;case"cut":c(n,e),a(e,i);break;default:break}}),d=o||(0,Pa.__)("Copy");return(0,kt.jsx)(ti.MenuItem,{ref:u,shortcut:r,children:d})}function IV({block:e,clientIds:t,children:o,__experimentalSelectBlock:r,...n}){let i=t.length,s=t[0],{firstParentClientId:a,parentBlockType:c,previousBlockClientId:u,selectedBlockClientIds:d,isContentOnly:f,isZoomOut:m,canEdit:h}=(0,Om.useSelect)(C=>{let{getBlockName:B,getBlockRootClientId:I,getPreviousBlockClientId:P,getSelectedBlockClientIds:E,getBlockAttributes:L,getBlockEditingMode:T,isZoomOut:O,canEditBlock:D}=M(C(_)),{getActiveBlockVariation:U}=C(wg.store),G=I(s),j=G&&B(G);return{firstParentClientId:G,parentBlockType:G&&(U(j,L(G))||(0,wg.getBlockType)(j)),previousBlockClientId:P(s),selectedBlockClientIds:E(),isContentOnly:T(s)==="contentOnly",isZoomOut:O(),canEdit:D(s)}},[s]),{getBlockOrder:p,getSelectedBlockClientIds:g}=(0,Om.useSelect)(_),b=(0,Om.useSelect)(C=>{let{getShortcutRepresentation:B}=C(fX.store);return{copy:B("core/block-editor/copy"),cut:B("core/block-editor/cut"),duplicate:B("core/block-editor/duplicate"),remove:B("core/block-editor/remove"),insertAfter:B("core/block-editor/insert-after"),insertBefore:B("core/block-editor/insert-before")}},[]),v=d.length>0;async function k(C){if(!r)return;let B=await C;B&&B[0]&&r(B[0],!1)}function y(){if(!r)return;let C=u||a;C||(C=p()[0]);let B=v&&g().length===0;r(C,B)}let x=!d?.includes(a)&&!!a;return(0,kt.jsx)(IZ,{clientIds:t,__experimentalUpdateSelection:!r,children:({canCopyStyles:C,canDuplicate:B,canInsertBlock:I,canRemove:P,onDuplicate:E,onInsertAfter:L,onInsertBefore:T,onRemove:O,onCopy:D,onPasteStyles:U})=>!P&&!B&&!I&&f?null:(0,kt.jsx)(ti.DropdownMenu,{icon:ks,label:(0,Pa.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:XCe,noIcons:!0,...n,children:({onClose:j})=>(0,kt.jsxs)(kt.Fragment,{children:[(0,kt.jsxs)(ti.MenuGroup,{children:[(0,kt.jsx)(TE.Slot,{fillProps:{onClose:j}}),x&&(0,kt.jsx)(dX,{parentClientId:a,parentBlockType:c}),h&&i===1&&(0,kt.jsx)(LZ,{clientId:s}),!f&&(0,kt.jsx)(TV,{clientIds:t,onCopy:D,shortcut:b.copy}),P&&!f&&(0,kt.jsx)(TV,{clientIds:t,label:(0,Pa.__)("Cut"),eventType:"cut",shortcut:b.cut,__experimentalUpdateSelection:!r}),B&&(0,kt.jsx)(ti.MenuItem,{onClick:(0,Rm.pipe)(j,E,k),shortcut:b.duplicate,children:(0,Pa.__)("Duplicate")}),I&&!m&&(0,kt.jsxs)(kt.Fragment,{children:[(0,kt.jsx)(ti.MenuItem,{onClick:(0,Rm.pipe)(j,T),shortcut:b.insertBefore,children:(0,Pa.__)("Add before")}),(0,kt.jsx)(ti.MenuItem,{onClick:(0,Rm.pipe)(j,L),shortcut:b.insertAfter,children:(0,Pa.__)("Add after")})]}),h&&i===1&&(0,kt.jsx)(CE.Slot,{fillProps:{clientId:s,onClose:j}})]}),C&&!f&&(0,kt.jsxs)(ti.MenuGroup,{children:[(0,kt.jsx)(TV,{clientIds:t,onCopy:D,label:(0,Pa.__)("Copy styles"),eventType:"copyStyles"}),h&&(0,kt.jsx)(ti.MenuItem,{onClick:U,children:(0,Pa.__)("Paste styles")})]}),!f&&(0,kt.jsx)(FE.Slot,{fillProps:{onClose:j,count:i,firstBlockClientId:s},clientIds:t}),typeof o=="function"?o({onClose:j}):jE.Children.map(z=>(0,jE.cloneElement)(z,{onClose:j})),P&&(0,kt.jsx)(ti.MenuGroup,{children:(0,kt.jsx)(ti.MenuItem,{onClick:(0,Rm.pipe)(j,O,y),shortcut:b.remove,children:(0,Pa.__)("Delete")})})]})})})}var mX=IV;var pX=l(A(),1),QCe=(0,pX.createSlotFill)(Symbol("CommentIconToolbarSlotFill")),UE=QCe;var Cg=l(w(),1);function JCe({clientIds:e,...t}){return(0,Cg.jsxs)(HE.ToolbarGroup,{children:[(0,Cg.jsx)(UE.Slot,{}),(0,Cg.jsx)(HE.ToolbarItem,{children:o=>(0,Cg.jsx)(mX,{clientIds:e,toggleProps:o,...t})})]})}var GE=JCe;var WE=l(A(),1),hX=l(N(),1),$E=l(F(),1);var PV=l(w(),1);function gX({clientIds:e}){let t=e.length===1?e[0]:void 0,o=(0,$E.useSelect)(n=>!!t&&n(_).getBlockMode(t)==="html",[t]),{toggleBlockMode:r}=(0,$E.useDispatch)(_);return o?(0,PV.jsx)(WE.ToolbarGroup,{children:(0,PV.jsx)(WE.ToolbarButton,{onClick:()=>{r(t)},children:(0,hX.__)("Edit visually")})}):null}var KE=l(A(),1),Yr=l(R(),1),vX=l(F(),1),yX=l(Re(),1),OV=l(Fe(),1),SX=l(Is(),1),_X=l(it(),1);var RV=l(w(),1);function e1e(e){let t="toolbarItem";return!e.some(o=>!(t in o.dataset))}function bX(e){return Array.from(e.querySelectorAll("[data-toolbar-item]:not([disabled])"))}function kX(e){return e.contains(e.ownerDocument.activeElement)}function t1e(e){let[t]=OV.focus.tabbable.find(e);t&&t.focus({preventScroll:!0})}function o1e(e){let[o,r]=(0,Yr.useState)(!0),n=(0,Yr.useCallback)(()=>{let i=OV.focus.tabbable.find(e.current),s=e1e(i);s||(0,yX.default)("Using custom components as toolbar controls",{since:"5.6",alternative:"ToolbarItem, ToolbarButton or ToolbarDropdownMenu components",link:"https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols"}),r(s)},[e]);return(0,Yr.useLayoutEffect)(()=>{let i=new window.MutationObserver(n);return i.observe(e.current,{childList:!0,subtree:!0}),()=>i.disconnect()},[n,o,e]),o}function r1e({toolbarRef:e,focusOnMount:t,isAccessibleToolbar:o,defaultIndex:r,onIndexChange:n,shouldUseKeyboardFocusShortcut:i,focusEditorOnEscape:s}){let[a]=(0,Yr.useState)(t),[c]=(0,Yr.useState)(r),u=(0,Yr.useCallback)(()=>{t1e(e.current)},[e]);(0,SX.useShortcut)("core/block-editor/focus-toolbar",()=>{i&&u()}),(0,Yr.useEffect)(()=>{a&&u()},[o,a,u]),(0,Yr.useEffect)(()=>{let m=e.current,h=0;return!a&&!kX(m)&&(h=window.requestAnimationFrame(()=>{let p=bX(m),g=c||0;p[g]&&kX(m)&&p[g].focus({preventScroll:!0})})),()=>{if(window.cancelAnimationFrame(h),!n||!m)return;let g=bX(m).findIndex(b=>b.tabIndex===0);n(g)}},[c,a,n,e]);let{getLastFocus:f}=M((0,vX.useSelect)(_));(0,Yr.useEffect)(()=>{let m=e.current;if(s){let h=p=>{let g=f();p.keyCode===_X.ESCAPE&&g?.current&&(p.preventDefault(),g.current.focus())};return m.addEventListener("keydown",h),()=>{m.removeEventListener("keydown",h)}}},[s,f,e])}function Bg({children:e,focusOnMount:t,focusEditorOnEscape:o=!1,shouldUseKeyboardFocusShortcut:r=!0,__experimentalInitialIndex:n,__experimentalOnIndexChange:i,orientation:s="horizontal",...a}){let c=(0,Yr.useRef)(),u=o1e(c);return r1e({toolbarRef:c,focusOnMount:t,defaultIndex:n,onIndexChange:i,isAccessibleToolbar:u,shouldUseKeyboardFocusShortcut:r,focusEditorOnEscape:o}),u?(0,RV.jsx)(KE.Toolbar,{label:a["aria-label"],ref:c,orientation:s,...a,children:e}):(0,RV.jsx)(KE.NavigableMenu,{orientation:s,role:"toolbar",ref:c,...a,children:e})}var xX=l(F(),1),YE=l($(),1);function qE(){return(0,xX.useSelect)(t=>{let{getBlockEditingMode:o,getBlockName:r,getBlockSelectionStart:n}=t(_),i=n(),s=i&&(0,YE.getBlockType)(r(i));return s&&(0,YE.hasBlockSupport)(s,"__experimentalToolbar",!0)&&o(i)!=="disabled"},[])}var cd=l(A(),1),wX=l(N(),1),CX=l($(),1),BX=l(R(),1),ZE=l(F(),1);var Eg=l(w(),1),AV=[],n1e=6,i1e={placement:"bottom-start"};function EX({clientId:e}){let{categories:t,currentPatternName:o,patterns:r}=(0,ZE.useSelect)(a=>{let{getBlockAttributes:c,getBlockRootClientId:u,__experimentalGetAllowedPatterns:d}=a(_),f=c(e),m=f?.metadata?.categories||AV,h=u(e),p=m.length>0?d(h):AV;return{categories:m,currentPatternName:f?.metadata?.patternName,patterns:p}},[e]),{replaceBlocks:n}=(0,ZE.useDispatch)(_),i=(0,BX.useMemo)(()=>t.length===0||!r||r.length===0?AV:r.filter(a=>{let c=a.source==="core"||a.source?.startsWith("pattern-directory")&&a.source!=="pattern-directory/theme";return a.blocks.length===1&&!c&&o!==a.name&&a.categories?.some(u=>t.includes(u))&&(a.syncStatus==="unsynced"||!a.id)}).slice(0,n1e),[t,o,r]);if(i.length<2)return null;let s=a=>{let c=(a.blocks??[]).map(u=>(0,CX.cloneBlock)(u));c[0].attributes.metadata={...c[0].attributes.metadata,categories:t},n(e,c)};return(0,Eg.jsx)(cd.Dropdown,{popoverProps:i1e,renderToggle:({onToggle:a,isOpen:c})=>(0,Eg.jsx)(cd.ToolbarGroup,{children:(0,Eg.jsx)(cd.ToolbarButton,{onClick:()=>a(!c),"aria-expanded":c,children:(0,wX.__)("Change design")})}),renderContent:()=>(0,Eg.jsx)(cd.__experimentalDropdownContentWrapper,{className:"block-editor-block-toolbar-change-design-content-wrapper",paddingSize:"none",children:(0,Eg.jsx)(Ca,{blockPatterns:i,onClickPattern:s,showTitlesAsTooltip:!0})})})}var Us=l(A(),1),XX=l(N(),1),iT=l(F(),1);var JE=l(F(),1),ud=l($(),1),OX=l(R(),1);var LV=l(XE(),1),IX=l(N(),1);function PX(e,t){for(let o of new LV.default(t).values()){if(o.indexOf("is-style-")===-1)continue;let r=o.substring(9),n=e?.find(({name:i})=>i===r);if(n)return n}return QE(e)}function Tg(e,t,o){let r=new LV.default(e);return t&&r.remove("is-style-"+t.name),r.add("is-style-"+o.name),r.value}function RX(e){return!e||e.length===0?[]:QE(e)?e:[{name:"default",label:(0,IX._x)("Default","block style"),isDefault:!0},...e]}function QE(e){return e?.find(t=>t.isDefault)}function s1e(e,t){return(0,OX.useMemo)(()=>{let o=t?.example,r=t?.name;if(o&&r)return(0,ud.getBlockFromExample)(r,{attributes:o.attributes,innerBlocks:o.innerBlocks});if(e)return(0,ud.cloneBlock)(e)},[e,t?.example,t?.name])}function Ig({clientId:e,onSwitch:t}){let o=m=>{let{getBlock:h}=m(_),p=h(e);if(!p)return{};let g=(0,ud.getBlockType)(p.name),{getBlockStyles:b}=m(ud.store);return{block:g?.example?null:p,blockType:g,styles:b(p.name),className:p.attributes.className||""}},{styles:r,block:n,blockType:i,className:s}=(0,JE.useSelect)(o,[e]),{updateBlockAttributes:a}=(0,JE.useDispatch)(_),c=RX(r),u=PX(c,s),d=s1e(n,i);return{onSelect:m=>{let h=Tg(s,u,m);a(e,{className:h}),t()},stylesToRender:c,activeStyle:u,genericPreviewBlock:d,className:s}}var Lg=l($(),1),BS=l(F(),1),nT=l(R(),1);function AX(e,t,o){t=Array.isArray(t)?[...t]:[t],e=Array.isArray(e)?[...e]:{...e};let r=t.pop(),n=e;for(let i of t){let s=n[i];n=n[i]=Array.isArray(s)?[...s]:{...s}}return n[r]=o,e}var Oo=(e,t,o)=>{let r=Array.isArray(t)?t:t.split("."),n=e;return r.forEach(i=>{n=n?.[i]}),n??o};var NX=l(Uv(),1);var a1e="1600px",l1e="320px",c1e=1,u1e=.25,d1e=.75,f1e="14px";function LX({minimumFontSize:e,maximumFontSize:t,fontSize:o,minimumViewportWidth:r=l1e,maximumViewportWidth:n=a1e,scaleFactor:i=c1e,minimumFontSizeLimit:s}){if(s=Ra(s)?s:f1e,o){let y=Ra(o);if(!y?.unit||!y?.value)return null;let S=Ra(s,{coerceTo:y.unit});if(S?.value&&!e&&!t&&y?.value<=S?.value)return null;if(t||(t=`${y.value}${y.unit}`),!e){let x=y.unit==="px"?y.value:y.value*16,C=Math.min(Math.max(1-.075*Math.log2(x),u1e),d1e),B=SS(y.value*C,3);S?.value&&B0}function m1e(e){let t=e?.typography??{},o=e?.layout,r=Ra(o?.wideSize)?o?.wideSize:null;return NV(t)&&r?{fluid:{maxViewportWidth:r,...typeof t.fluid=="object"?t.fluid:{}}}:{fluid:t?.fluid}}function ec(e,t){let{size:o}=e;if(!o||o==="0"||e?.fluid===!1||!NV(t?.typography)&&!NV(e))return o;let r=m1e(t)?.fluid??{},n=LX({minimumFontSize:typeof e?.fluid=="boolean"?void 0:e?.fluid?.min,maximumFontSize:typeof e?.fluid=="boolean"?void 0:e?.fluid?.max,fontSize:o,minimumFontSizeLimit:typeof r=="object"?r?.minFontSize:void 0,maximumViewportWidth:typeof r=="object"?r?.maxViewportWidth:void 0,minimumViewportWidth:typeof r=="object"?r?.minViewportWidth:void 0});return n||o}var Oa="body",_S=":root",eT=[{path:["color","palette"],valueKey:"color",cssVarInfix:"color",classes:[{classSuffix:"color",propertyName:"color"},{classSuffix:"background-color",propertyName:"background-color"},{classSuffix:"border-color",propertyName:"border-color"}]},{path:["color","gradients"],valueKey:"gradient",cssVarInfix:"gradient",classes:[{classSuffix:"gradient-background",propertyName:"background"}]},{path:["color","duotone"],valueKey:"colors",cssVarInfix:"duotone",valueFunc:({slug:e})=>`url( '#wp-duotone-${e}' )`,classes:[]},{path:["shadow","presets"],valueKey:"shadow",cssVarInfix:"shadow",classes:[]},{path:["typography","fontSizes"],valueFunc:(e,t)=>ec(e,t),valueKey:"size",cssVarInfix:"font-size",classes:[{classSuffix:"font-size",propertyName:"font-size"}]},{path:["typography","fontFamilies"],valueKey:"fontFamily",cssVarInfix:"font-family",classes:[{classSuffix:"font-family",propertyName:"font-family"}]},{path:["spacing","spacingSizes"],valueKey:"size",cssVarInfix:"spacing",valueFunc:({size:e})=>e,classes:[]},{path:["border","radiusSizes"],valueKey:"size",cssVarInfix:"border-radius",classes:[]},{path:["dimensions","dimensionSizes"],valueKey:"size",cssVarInfix:"dimension",classes:[]}];function js(e,t){if(!e||!t)return t;let o=e.split(","),r=t.split(","),n=[];return o.forEach(i=>{r.forEach(s=>{n.push(`${i.trim()} ${s.trim()}`)})}),n.join(", ")}function MX(e,t){if(!e||!t)return;let o={};return Object.entries(t).forEach(([r,n])=>{typeof n=="string"&&(o[r]=js(e,n)),typeof n=="object"&&(o[r]={},Object.entries(n).forEach(([i,s])=>{o[r][i]=js(e,s)}))}),o}function DX(e,t){return e.includes(",")?e.split(",").map(n=>n+t).join(","):e+t}function VX(e,t){let o=`.is-style-${e}`;if(!t)return o;let r=/((?::\([^)]+\))?\s*)([^\s:]+)/,n=(s,a,c)=>a+c+o;return t.split(",").map(s=>s.replace(r,n)).join(",")}function p1e(e,t){if(!e||!t)return e;if(typeof e=="object"&&"ref"in e&&e?.ref){let o=(0,NX.getCSSValueFromRawStyle)(Oo(t,e.ref));return typeof o=="object"&&o!==null&&"ref"in o&&o?.ref?void 0:o===void 0?e:o}return e}function h1e(e,t){if(!e||!t||!Array.isArray(t))return e;let o=t.find(r=>r?.name===e);return o?.href?o?.href:e}function Pg(e,t){if(!e||!t)return e;let o=p1e(e,t);return typeof o=="object"&&o!==null&&"url"in o&&o?.url&&(o.url=h1e(o.url,t?._links?.["wp:theme-file"])),o}function FX(e,t,o=[],r="slug",n){let i=[t?Oo(e,["blocks",t,...o]):void 0,Oo(e,o)].filter(Boolean);for(let s of i)if(s){let a=["custom","theme","default"];for(let c of a){let u=s[c];if(u){let d=u.find(f=>f[r]===n);if(d)return r==="slug"||FX(e,t,o,"slug",d.slug)[r]===d[r]?d:void 0}}}}function g1e(e,t,o,[r,n]=[]){let i=eT.find(a=>a.cssVarInfix===r);if(!i||!e.settings)return o;let s=FX(e.settings,t,i.path,"slug",n);if(s){let{valueKey:a}=i,c=s[a];return wn(e,t,c)}return o}function b1e(e,t,o,r=[]){let n=(t?Oo(e?.settings??{},["blocks",t,"custom",...r]):void 0)??Oo(e?.settings??{},["custom",...r]);return n?wn(e,t,n):o}function wn(e,t,o){if(!o||typeof o!="string")if(typeof o=="object"&&o!==null&&"ref"in o&&typeof o.ref=="string"){let u=Oo(e,o.ref);if(!u||typeof u=="object"&&"ref"in u)return u;o=u}else return o;let r="var:",n="var(--wp--",i=")",s;if(o.startsWith(r))s=o.slice(r.length).split("|");else if(o.startsWith(n)&&o.endsWith(i))s=o.slice(n.length,-i.length).split("--");else return o;let[a,...c]=s;return a==="preset"?g1e(e,t,o,c):a==="custom"?b1e(e,t,o,c):o}var qr=l($(),1),wS=l(Uv(),1),YX=l(F(),1);function oi(e,t="root",o={}){if(!t)return null;let{fallback:r=!1}=o,{name:n,selectors:i,supports:s}=e,a=i&&Object.keys(i).length>0,c=Array.isArray(t)?t.join("."):t,u=null;if(a&&i.root?u=i?.root:s?.__experimentalSelector?u=s.__experimentalSelector:u=".wp-block-"+n.replace("core/","").replace("/","-"),c==="root")return u;let d=Array.isArray(t)?t:t.split(".");if(d.length===1){let m=r?u:null;if(a)return Oo(i,`${c}.root`,null)||Oo(i,c,null)||m;let h=s?Oo(s,`${c}.__experimentalSelector`,null):void 0;return h?js(u,h):m}let f;return a&&(f=Oo(i,c,null)),f||(r?oi(e,d[0],o):null)}function Og(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/([0-9])([a-zA-Z])/g,"$1-$2").replace(/([a-zA-Z])([0-9])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function DV(e){if(!e)return;let t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function R1e(e){if(!e)return null;let t=typeof e=="string";return{top:t?e:e?.top,left:t?e:e?.left}}function VV(e,t="0"){let o=R1e(e);if(!o)return null;let r=DV(o?.top)||t,n=DV(o?.left)||t;return r===n?r:`${r} ${n}`}var HX={backgroundSize:"cover",backgroundPosition:"50% 50%"};function GX(e){if(!e||!e?.backgroundImage?.url)return;let t;return e?.backgroundSize||(t={backgroundSize:HX.backgroundSize}),e?.backgroundSize==="contain"&&!e?.backgroundPosition&&(t={backgroundPosition:HX.backgroundPosition}),t}var WX={default:{name:"default",slug:"flow",className:"is-layout-flow",baseStyles:[{selector:" > .alignleft",rules:{float:"left","margin-inline-start":"0","margin-inline-end":"2em"}},{selector:" > .alignright",rules:{float:"right","margin-inline-start":"2em","margin-inline-end":"0"}},{selector:" > .aligncenter",rules:{"margin-left":"auto !important","margin-right":"auto !important"}}],spacingStyles:[{selector:" > :first-child",rules:{"margin-block-start":"0"}},{selector:" > :last-child",rules:{"margin-block-end":"0"}},{selector:" > *",rules:{"margin-block-start":null,"margin-block-end":"0"}}]},constrained:{name:"constrained",slug:"constrained",className:"is-layout-constrained",baseStyles:[{selector:" > .alignleft",rules:{float:"left","margin-inline-start":"0","margin-inline-end":"2em"}},{selector:" > .alignright",rules:{float:"right","margin-inline-start":"2em","margin-inline-end":"0"}},{selector:" > .aligncenter",rules:{"margin-left":"auto !important","margin-right":"auto !important"}},{selector:" > :where(:not(.alignleft):not(.alignright):not(.alignfull))",rules:{"max-width":"var(--wp--style--global--content-size)","margin-left":"auto !important","margin-right":"auto !important"}},{selector:" > .alignwide",rules:{"max-width":"var(--wp--style--global--wide-size)"}}],spacingStyles:[{selector:" > :first-child",rules:{"margin-block-start":"0"}},{selector:" > :last-child",rules:{"margin-block-end":"0"}},{selector:" > *",rules:{"margin-block-start":null,"margin-block-end":"0"}}]},flex:{name:"flex",slug:"flex",className:"is-layout-flex",displayMode:"flex",baseStyles:[{selector:"",rules:{"flex-wrap":"wrap","align-items":"center"}},{selector:" > :is(*, div)",rules:{margin:"0"}}],spacingStyles:[{selector:"",rules:{gap:null}}]},grid:{name:"grid",slug:"grid",className:"is-layout-grid",displayMode:"grid",baseStyles:[{selector:" > :is(*, div)",rules:{margin:"0"}}],spacingStyles:[{selector:"",rules:{gap:null}}]}};var O1e={button:"wp-element-button",caption:"wp-element-caption"},A1e={__experimentalBorder:"border",color:"color",dimensions:"dimensions",spacing:"spacing",typography:"typography"};function L1e(e="*",t={}){return eT.reduce((o,{path:r,cssVarInfix:n,classes:i})=>{if(!i)return o;let s=Oo(t,r,[]);return["default","theme","custom"].forEach(a=>{s[a]&&s[a].forEach(({slug:c})=>{i.forEach(({classSuffix:u,propertyName:d})=>{let f=`.has-${Og(c)}-${u}`,m=e.split(",").map(p=>`${p}${f}`).join(","),h=`var(--wp--preset--${n}--${Og(c)})`;o+=`${m}{${d}: ${h} !important;}`})})}),o},"")}function N1e(e,t){let o=e.split(","),r=[];return o.forEach(n=>{r.push(`${t.trim()}${n.trim()}`)}),r.join(", ")}var $X=(e,t,o)=>{if(o!=="core/paragraph"||(t?.blocks?.["core/paragraph"]?.typography?.textIndent??t?.typography?.textIndent??"subsequent")!=="all")return e;let i=".wp-block-paragraph + .wp-block-paragraph",s=".wp-block-paragraph";if(i in e){let a=e[i],c={...e};return delete c[i],c[s]=a,c}return e},KX=(e,t)=>{let o={};return Object.entries(e).forEach(([r,n])=>{if(r==="root"||!t?.[r])return;let i=typeof n=="string";if(!i&&typeof n=="object"&&n!==null&&Object.entries(n).forEach(([s,a])=>{if(s==="root"||!t?.[r][s])return;let c={[r]:{[s]:t[r][s]}},u=Ag(c);o[a]=[...o[a]||[],...u],delete t[r][s]}),i||typeof n=="object"&&n!==null&&"root"in n){let s=i?n:n.root,a={[r]:t[r]},c=Ag(a);o[s]=[...o[s]||[],...c],delete t[r]}}),o};function Ag(e={},t="",o,r={},n=!1){let i=Oa===t,s=Object.entries(qr.__EXPERIMENTAL_STYLE_PROPERTY).reduce((c,[u,{value:d,properties:f,useEngine:m,rootOnly:h}])=>{if(h&&!i)return c;let p=d;if(p[0]==="elements"||m)return c;let g=Oo(e,p);if(u==="--wp--style--root--padding"&&(typeof g=="string"||!o))return c;if(f&&typeof g!="string")Object.entries(f).forEach(b=>{let[v,k]=b;if(!Oo(g,[k],!1))return;let y=v.startsWith("--")?v:Og(v);c.push(`${y}: ${(0,wS.getCSSValueFromRawStyle)(Oo(g,[k]))}`)});else if(Oo(e,p,!1)){let b=u.startsWith("--")?u:Og(u);c.push(`${b}: ${(0,wS.getCSSValueFromRawStyle)(Oo(e,p))}`)}return c},[]);return e.background&&(e.background?.backgroundImage&&(e.background.backgroundImage=Pg(e.background.backgroundImage,r)),!i&&e.background?.backgroundImage?.id&&(e={...e,background:{...e.background,...GX(e.background)}})),(0,wS.getCSSRules)(e).forEach(c=>{if(i&&(o||n)&&c.key.startsWith("padding"))return;let u=c.key.startsWith("--")?c.key:Og(c.key),d=Pg(c.value,r);u==="font-size"&&(d=ec({name:"",slug:"",size:d},r?.settings)),u==="aspect-ratio"&&s.push("min-height: unset"),s.push(`${u}: ${d}`)}),s}function FV({layoutDefinitions:e=WX,style:t,selector:o,hasBlockGapSupport:r,hasFallbackGapSupport:n,fallbackGapValue:i}){let s="",a=r?VV(t?.spacing?.blockGap):"";if(n&&(o===Oa?a=a||"0.5em":!r&&i&&(a=i)),a&&e&&(Object.values(e).forEach(({className:c,name:u,spacingStyles:d})=>{!r&&u!=="flex"&&u!=="grid"||d?.length&&d.forEach(f=>{let m=[];if(f.rules&&Object.entries(f.rules).forEach(([h,p])=>{m.push(`${h}: ${p||a}`)}),m.length){let h="";r?h=o===Oa?`:root :where(.${c})${f?.selector||""}`:`:root :where(${o}-${c})${f?.selector||""}`:h=o===Oa?`:where(.${c}${f?.selector||""})`:`:where(${o}.${c}${f?.selector||""})`,s+=`${h} { ${m.join("; ")}; }`}})}),o===Oa&&r&&(s+=`${_S} { --wp--style--block-gap: ${a}; }`)),o===Oa&&e){let c=["block","flex","grid"];Object.values(e).forEach(({className:u,displayMode:d,baseStyles:f})=>{d&&c.includes(d)&&(s+=`${o} .${u} { display:${d}; }`),f?.length&&f.forEach(m=>{let h=[];if(m.rules&&Object.entries(m.rules).forEach(([p,g])=>{h.push(`${p}: ${g}`)}),h.length){let p=`.${u}${m?.selector||""}`;s+=`${p} { ${h.join("; ")}; }`}})})}return s}var M1e=["border","color","dimensions","spacing","typography","filter","outline","shadow","background"];function tT(e){if(!e)return{};let r=Object.entries(e).filter(([n])=>M1e.includes(n)).map(([n,i])=>[n,JSON.parse(JSON.stringify(i))]);return Object.fromEntries(r)}var D1e=(e,t)=>{let o=[];if(!e?.styles)return o;let r=tT(e.styles);return r&&o.push({styles:r,selector:Oa,skipSelectorWrapper:!0}),Object.entries(qr.__EXPERIMENTAL_ELEMENTS).forEach(([n,i])=>{e.styles?.elements?.[n]&&o.push({styles:e.styles?.elements?.[n]??{},selector:i,skipSelectorWrapper:!O1e[n]})}),Object.entries(e.styles?.blocks??{}).forEach(([n,i])=>{let s=tT(i),a=i,c=[];if(a?.variations){let u={};Object.entries(a.variations).forEach(([d,f])=>{let m=f;u[d]=tT(m),m?.css&&(u[d].css=m.css);let h=typeof t!="string"?t[n]?.styleVariationSelectors?.[d]:void 0;Object.entries(m?.elements??{}).forEach(([p,g])=>{g&&qr.__EXPERIMENTAL_ELEMENTS[p]&&c.push({styles:g,selector:js(h,qr.__EXPERIMENTAL_ELEMENTS[p])})}),Object.entries(m?.blocks??{}).forEach(([p,g])=>{let b=typeof t!="string"?js(h,t[p]?.selector):void 0,v=typeof t!="string"?js(h,t[p]?.duotoneSelector):void 0,k=typeof t!="string"?MX(h,t[p]?.featureSelectors??{}):void 0,y=tT(g);g?.css&&(y.css=g.css),!(!b||typeof t=="string")&&(c.push({selector:b,duotoneSelector:v,featureSelectors:k,fallbackGapValue:t[p]?.fallbackGapValue,hasLayoutSupport:t[p]?.hasLayoutSupport,styles:y}),Object.entries(g.elements??{}).forEach(([S,x])=>{x&&qr.__EXPERIMENTAL_ELEMENTS[S]&&c.push({styles:x,selector:js(b,qr.__EXPERIMENTAL_ELEMENTS[S])})}))})}),s.variations=u}typeof t!="string"&&t?.[n]?.selector&&o.push({duotoneSelector:t[n].duotoneSelector,fallbackGapValue:t[n].fallbackGapValue,hasLayoutSupport:t[n].hasLayoutSupport,selector:t[n].selector,styles:s,featureSelectors:t[n].featureSelectors,styleVariationSelectors:t[n].styleVariationSelectors,name:n}),Object.entries(a?.elements??{}).forEach(([u,d])=>{typeof t!="string"&&d&&t?.[n]&&qr.__EXPERIMENTAL_ELEMENTS[u]&&o.push({styles:d,selector:t[n]?.selector.split(",").map(f=>qr.__EXPERIMENTAL_ELEMENTS[u].split(",").map(h=>f+" "+h)).join(",")})}),o.push(...c)}),o},V1e=(e,t)=>{let o=[];if(!e?.settings)return o;let r=s=>{let a={};return eT.forEach(({path:c})=>{let u=Oo(s,c,!1);u!==!1&&(a=AX(a,c,u))}),a},n=r(e.settings),i=e.settings?.custom;return(Object.keys(n).length>0||i)&&o.push({presets:n,custom:i,selector:_S}),Object.entries(e.settings?.blocks??{}).forEach(([s,a])=>{let c=a.custom;if(typeof t=="string"||!t[s])return;let u=r(a);(Object.keys(u).length>0||c)&&o.push({presets:u,custom:c,selector:t[s]?.selector})}),o};var oT=(e,t,o,r,n=!1,i=!1,s={})=>{let a={blockGap:!0,blockStyles:!0,layoutStyles:!0,marginReset:!0,presets:!0,rootPadding:!0,variationStyles:!1,...s},c=D1e(e,t),u=V1e(e,t),d=e?.settings?.useRootPaddingAwareAlignments,{contentSize:f,wideSize:m}=e?.settings?.layout||{},h=a.marginReset||a.rootPadding||a.layoutStyles,p="";if(a.presets&&(f||m)&&(p+=`${_S} {`,p=f?p+` --wp--style--global--content-size: ${f};`:p,p=m?p+` --wp--style--global--wide-size: ${m};`:p,p+="}"),h&&(p+=":where(body) {margin: 0;",a.rootPadding&&d&&(p+=`padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) } .has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); } .has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); } .has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) { padding-right: 0; padding-left: 0; } .has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) > .alignfull { margin-left: 0; margin-right: 0; `),p+="}"),a.blockStyles&&c.forEach(({selector:g,duotoneSelector:b,styles:v,fallbackGapValue:k,hasLayoutSupport:y,featureSelectors:S,styleVariationSelectors:x,skipSelectorWrapper:C,name:B})=>{if(S){let E=KX(S,v);E=$X(E,e.settings,B),Object.entries(E).forEach(([L,T])=>{if(T.length){let O=T.join(";");p+=`:root :where(${L}){${O};}`}})}if(b){let E={};v?.filter&&(E.filter=v.filter,delete v.filter);let L=Ag(E);L.length&&(p+=`${b}{${L.join(";")};}`)}!n&&(Oa===g||y)&&(p+=FV({style:v,selector:g,hasBlockGapSupport:o,hasFallbackGapSupport:r,fallbackGapValue:k}));let I=Ag(v,g,d,e,i);if(I?.length){let E=C?g:`:root :where(${g})`;p+=`${E}{${I.join(";")};}`}v?.css&&(p+=CS(v.css,`:root :where(${g})`)),a.variationStyles&&x&&Object.entries(x).forEach(([E,L])=>{let T=v?.variations?.[E];if(T){if(S){let D=KX(S,T);D=$X(D,e.settings,B),Object.entries(D).forEach(([U,G])=>{if(G.length){let j=N1e(U,L),z=G.join(";");p+=`:root :where(${j}){${z};}`}})}let O=Ag(T,L,d,e);if(O.length&&(p+=`:root :where(${L}){${O.join(";")};}`),T?.css&&(p+=CS(T.css,`:root :where(${L})`)),y&&T?.spacing?.blockGap){let D=L+g;p+=FV({style:T,selector:D,hasBlockGapSupport:!0,hasFallbackGapSupport:r,fallbackGapValue:k})}}});let P=Object.entries(v).filter(([E])=>E.startsWith(":"));P?.length&&P.forEach(([E,L])=>{let T=Ag(L);if(!T?.length)return;let D=`:root :where(${g.split(",").map(U=>U+E).join(",")}){${T.join(";")};}`;p+=D})}),a.layoutStyles&&(p=p+".wp-site-blocks > .alignleft { float: left; margin-right: 2em; }",p=p+".wp-site-blocks > .alignright { float: right; margin-left: 2em; }",p=p+".wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }"),a.blockGap&&o){let g=VV(e?.styles?.spacing?.blockGap)||"0.5em";p=p+`:root :where(.wp-site-blocks) > * { margin-block-start: ${g}; margin-block-end: 0; }`,p=p+":root :where(.wp-site-blocks) > :first-child { margin-block-start: 0; }",p=p+":root :where(.wp-site-blocks) > :last-child { margin-block-end: 0; }"}return a.presets&&u.forEach(({selector:g,presets:b})=>{(Oa===g||_S===g)&&(g="");let v=L1e(g,b);v.length>0&&(p+=v)}),p};var F1e=(e,t)=>{if(e?.selectors&&Object.keys(e.selectors).length>0)return e.selectors;let o={root:t};return Object.entries(A1e).forEach(([r,n])=>{let i=oi(e,r);i&&(o[n]=i)}),o},rT=(e,t)=>{let{getBlockStyles:o}=(0,YX.select)(qr.store),r={};return e.forEach(n=>{let i=n.name,s=oi(n);if(!s)return;let a=oi(n,"filter.duotone");if(!a){let h=oi(n),p=(0,qr.getBlockSupport)(n,"color.__experimentalDuotone",!1);a=p&&h&&js(h,p)}let c=!!n?.supports?.layout||!!n?.supports?.__experimentalLayout,u=n?.supports?.spacing?.blockGap?.__experimentalDefault,d=o(i),f={};d?.forEach(h=>{let p=t?`-${t}`:"",g=`${h.name}${p}`,b=VX(g,s);f[g]=b});let m=F1e(n,s);r[i]={duotoneSelector:a??void 0,fallbackGapValue:u,featureSelectors:Object.keys(m).length?m:void 0,hasLayoutSupport:c,name:i,selector:s,styleVariationSelectors:d?.length?f:void 0}}),r};function CS(e,t){let o="";return!e||e.trim()===""||e.split("&").forEach(n=>{if(!n||n.trim()==="")return;if(!n.includes("{"))o+=`:root :where(${t}){${n.trim()}}`;else{let s=n.replace("}","").split("{");if(s.length!==2)return;let[a,c]=s,u=a.match(/([>+~\s]*::[a-zA-Z-]+)/),d=u?u[1]:"",f=u?a.replace(d,"").trim():a.trim(),m;f===""?m=t:m=a.startsWith(" ")?js(t,f):DX(t,f),o+=`:root :where(${m})${d}{${c.trim()}}`}}),o}var ES=l(w(),1),zV="is-style-";function qX(e){return e?e.split(/\s+/).reduce((t,o)=>{if(o.startsWith(zV)){let r=o.slice(zV.length);r!=="default"&&t.push(r)}return t},[]):[]}function jV(e,t=[]){let o=qX(e);if(!o)return null;for(let r of o)if(t.some(n=>n.name===r))return r;return null}function z1e({override:e}){tc(e)}function UV({config:e}){let{getBlockStyles:t,overrides:o}=(0,BS.useSelect)(i=>({getBlockStyles:i(Lg.store).getBlockStyles,overrides:M(i(_)).getStyleOverrides()}),[]),{getBlockName:r}=(0,BS.useSelect)(_),n=(0,nT.useMemo)(()=>{if(!o?.length)return;let i=[],s=[];for(let[,a]of o)if(a?.variation&&a?.clientId&&!s.includes(a.clientId)){let c=r(a.clientId),u=e?.styles?.blocks?.[c]?.variations?.[a.variation];if(u){let d={settings:e?.settings,styles:{blocks:{[c]:{variations:{[`${a.variation}-${a.clientId}`]:u}}}}},f=rT((0,Lg.getBlockTypes)(),a.clientId),b=oT(d,f,!1,!0,!0,!0,{blockGap:!1,blockStyles:!0,layoutStyles:!1,marginReset:!1,presets:!1,rootPadding:!1,variationStyles:!0});i.push({id:`${a.variation}-${a.clientId}`,css:b,__unstableType:"variation",variation:a.variation,clientId:a.clientId}),s.push(a.clientId)}}return i},[e,o,t,r]);return!n||!n.length?null:(0,ES.jsx)(ES.Fragment,{children:n.map(i=>(0,ES.jsx)(z1e,{override:i},i.id))})}function HV(e,t,o){if(!e?.styles?.blocks?.[t]?.variations?.[o])return;let r=i=>{Object.keys(i).forEach(s=>{let a=i[s];if(typeof a=="object"&&a!==null)if(a.ref!==void 0)if(typeof a.ref!="string"||a.ref.trim()==="")delete i[s];else{let c=yl(e,a.ref);c?i[s]=c:delete i[s]}else r(a),Object.keys(a).length===0&&delete i[s]})},n=JSON.parse(JSON.stringify(e.styles.blocks[t].variations[o]));return r(n),n}function j1e(e,t,o){let{globalSettings:r,globalStyles:n}=(0,BS.useSelect)(i=>{let s=i(_).getSettings();return{globalSettings:s.__experimentalFeatures,globalStyles:s[xi]}},[]);return(0,nT.useMemo)(()=>{let i=HV({settings:r,styles:n},e,t);return{settings:r,styles:{blocks:{[e]:{variations:{[`${t}-${o}`]:i}}}}}},[r,n,t,o,e])}function U1e({name:e,className:t,clientId:o}){let{getBlockStyles:r}=(0,BS.useSelect)(Lg.store),n=r(e),i=jV(t,n),s=`${zV}${i}-${o}`,{settings:a,styles:c}=j1e(e,i,o),u=(0,nT.useMemo)(()=>{if(!i)return;let d={settings:a,styles:c},f=rT((0,Lg.getBlockTypes)(),o);return oT(d,f,!1,!0,!0,!0,{blockGap:!1,blockStyles:!0,layoutStyles:!1,marginReset:!1,presets:!1,rootPadding:!1,variationStyles:!0})},[i,a,c,o]);return tc({id:`variation-${o}`,css:u,__unstableType:"variation",variation:i,clientId:o}),i?{className:s}:{}}var ZX={hasSupport:()=>!0,attributeKeys:["className"],isMatch:({className:e})=>qX(e).length>0,useBlockProps:U1e};var dd=l(w(),1),H1e=(0,dd.jsxs)(Us.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24","aria-hidden":"true",focusable:"false",children:[(0,dd.jsx)(Us.Path,{d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3z"}),(0,dd.jsx)(Us.Path,{stroke:"currentColor",strokeWidth:"1.5",d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3z"})]});function G1e({clientId:e}){let{stylesToRender:t,activeStyle:o,className:r}=Ig({clientId:e}),{updateBlockAttributes:n}=(0,iT.useDispatch)(_),{globalSettings:i,globalStyles:s,blockName:a}=(0,iT.useSelect)(d=>{let f=d(_).getSettings();return{globalSettings:f.__experimentalFeatures,globalStyles:f[xi],blockName:d(_).getBlockName(e)}},[e]),c=o?.name?HV({settings:i,styles:s},a,o.name)?.color?.background:void 0;return!t||t.length===0?null:(0,dd.jsx)(Us.ToolbarGroup,{children:(0,dd.jsx)(Us.ToolbarButton,{onClick:()=>{let f=(t.findIndex(p=>p.name===o.name)+1)%t.length,m=t[f],h=Tg(r,o,m);n(e,{className:h})},label:(0,XX.__)("Shuffle styles"),children:(0,dd.jsx)(Us.Icon,{icon:H1e,style:{fill:c||"transparent"}})})})}var QX=G1e;var lT=l(A(),1),GV=l(N(),1),JX=l(F(),1),cT=l($(),1);var sT=l(F(),1);function aT(e){let{isSectionBlock:t,isWithinSection:o,isWithinEditedSection:r,isEditingContentOnlySection:n,editedContentOnlySection:i}=(0,sT.useSelect)(u=>{let{isSectionBlock:d,getParentSectionBlock:f,getEditedContentOnlySection:m,isWithinEditedContentOnlySection:h}=M(u(_)),p=m();return{isSectionBlock:d(e),isWithinSection:d(e)||!!f(e),isWithinEditedSection:h(e),isEditingContentOnlySection:p===e,editedContentOnlySection:p}},[e]),s=(0,sT.useDispatch)(_),{editContentOnlySection:a,stopEditingContentOnlySection:c}=M(s);return{isSectionBlock:t,isWithinSection:o,isWithinEditedSection:r,isEditingContentOnlySection:n,editedContentOnlySection:i,editContentOnlySection:a,stopEditingContentOnlySection:c}}var WV=l(w(),1);function eQ({clientId:e}){let{isSectionBlock:t,isEditingContentOnlySection:o,editContentOnlySection:r,stopEditingContentOnlySection:n}=aT(e),i=(0,JX.useSelect)(c=>{if(!e)return null;let{getBlockName:u}=c(_),d=u(e);return d?{name:d}:null},[e]);if(!e||!t&&!o||(0,cT.isReusableBlock)(i)||(0,cT.isTemplatePart)(i))return null;let s=o;return(0,WV.jsx)(lT.ToolbarGroup,{children:(0,WV.jsx)(lT.ToolbarButton,{onClick:()=>{s?n():r(e)},children:s?(0,GV.__)("Exit pattern"):(0,GV.__)("Edit pattern")})})}var EQ=l(A(),1),TQ=l(N(),1),IQ=l(F(),1);var PS=l($(),1),PQ=l(Zp(),1);var Aa=l(N(),1),La=l(A(),1),fd=l($(),1),bT=l(F(),1);var lQ=l(N(),1),TS=l(A(),1),fT=l($(),1),mT=l(R(),1);var tQ=l(N(),1),oQ=l(A(),1),rQ=l(Z(),1);var Am=l(w(),1);function uT({blocks:e}){return(0,rQ.useViewportMatch)("medium","<")?null:(0,Am.jsx)("div",{className:"block-editor-block-switcher__popover-preview-container",children:(0,Am.jsx)(oQ.Popover,{className:"block-editor-block-switcher__popover-preview",placement:"right-start",focusOnMount:!1,offset:16,children:(0,Am.jsxs)("div",{className:"block-editor-block-switcher__preview",children:[(0,Am.jsx)("div",{className:"block-editor-block-switcher__preview-title",children:(0,tQ.__)("Preview")}),(0,Am.jsx)(vn,{viewportWidth:601,blocks:e})]})})})}var nQ=l(A(),1),Ng=l($(),1),iQ=l(F(),1),dT=l(R(),1);var oc=l(w(),1),W1e={};function sQ({clientIds:e,blocks:t}){let{activeBlockVariation:o,blockVariationTransformations:r}=(0,iQ.useSelect)(i=>{let{getBlockAttributes:s,canRemoveBlocks:a}=i(_),{getActiveBlockVariation:c,getBlockVariations:u}=i(Ng.store),d=a(e);if(t.length!==1||!d)return W1e;let[f]=t;return{blockVariationTransformations:u(f.name,"transform"),activeBlockVariation:c(f.name,s(f.clientId))}},[e,t]);return(0,dT.useMemo)(()=>r?.filter(({name:i})=>i!==o?.name),[r,o])}var $1e=({transformations:e,onSelect:t,blocks:o})=>{let[r,n]=(0,dT.useState)();return(0,oc.jsxs)(oc.Fragment,{children:[r&&(0,oc.jsx)(uT,{blocks:(0,Ng.cloneBlock)(o[0],e.find(({name:i})=>i===r).attributes)}),e?.map(i=>(0,oc.jsx)(K1e,{item:i,onSelect:t,setHoveredTransformItemName:n},i.name))]})};function K1e({item:e,onSelect:t,setHoveredTransformItemName:o}){let{name:r,icon:n,title:i}=e;return(0,oc.jsxs)(nQ.MenuItem,{className:(0,Ng.getBlockMenuDefaultClassName)(r),onClick:s=>{s.preventDefault(),t(r)},onMouseLeave:()=>o(null),onMouseEnter:()=>o(r),onFocus:()=>o(r),onBlur:()=>o(null),children:[(0,oc.jsx)(Ae,{icon:n,showColors:!0}),i]})}var aQ=$1e;var Cn=l(w(),1);function Y1e(e){let t={"core/paragraph":1,"core/heading":2,"core/list":3,"core/quote":4},o=(0,mT.useMemo)(()=>{let r=Object.keys(t),n=e.reduce((i,s)=>{let{name:a}=s;return r.includes(a)?i.priorityTextTransformations.push(s):i.restTransformations.push(s),i},{priorityTextTransformations:[],restTransformations:[]});if(n.priorityTextTransformations.length===1&&n.priorityTextTransformations[0].name==="core/quote"){let i=n.priorityTextTransformations.pop();n.restTransformations.push(i)}return n},[e]);return o.priorityTextTransformations.sort(({name:r},{name:n})=>t[r]{let[s,a]=(0,mT.useState)(),{priorityTextTransformations:c,restTransformations:u}=Y1e(t),d=c.length&&u.length,f=!!u.length&&(0,Cn.jsx)(Z1e,{restTransformations:u,onSelect:r,setHoveredTransformItemName:a});return(0,Cn.jsxs)(Cn.Fragment,{children:[(0,Cn.jsxs)(TS.MenuGroup,{label:(0,lQ.__)("Transform to"),className:e,children:[s&&(0,Cn.jsx)(uT,{blocks:(0,fT.switchToBlockType)(i,s)}),!!o?.length&&(0,Cn.jsx)(aQ,{transformations:o,blocks:i,onSelect:n}),c.map(m=>(0,Cn.jsx)(cQ,{item:m,onSelect:r,setHoveredTransformItemName:a},m.name)),!d&&f]}),!!d&&(0,Cn.jsx)(TS.MenuGroup,{className:e,children:f})]})};function Z1e({restTransformations:e,onSelect:t,setHoveredTransformItemName:o}){return e.map(r=>(0,Cn.jsx)(cQ,{item:r,onSelect:t,setHoveredTransformItemName:o},r.name))}function cQ({item:e,onSelect:t,setHoveredTransformItemName:o}){let{name:r,icon:n,title:i,isDisabled:s}=e;return(0,Cn.jsxs)(TS.MenuItem,{className:(0,fT.getBlockMenuDefaultClassName)(r),onClick:a=>{a.preventDefault(),t(r)},disabled:s,onMouseLeave:()=>o(null),onMouseEnter:()=>o(r),onFocus:()=>o(r),onBlur:()=>o(null),children:[(0,Cn.jsx)(Ae,{icon:n,showColors:!0}),i]})}var uQ=q1e;var fQ=l(N(),1),mQ=l(A(),1);var pT=l(A(),1);var Mg=l(w(),1),X1e=()=>{};function dQ({clientId:e,onSwitch:t=X1e}){let{onSelect:o,stylesToRender:r,activeStyle:n}=Ig({clientId:e,onSwitch:t});return!r||r.length===0?null:(0,Mg.jsx)(Mg.Fragment,{children:r.map(i=>{let s=i.label||i.name;return(0,Mg.jsx)(pT.MenuItem,{icon:n.name===i.name?gl:null,onClick:()=>o(i),children:(0,Mg.jsx)(pT.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0,children:s})},i.name)})})}var $V=l(w(),1);function hT({hoveredBlock:e,onSwitch:t}){let{clientId:o}=e;return(0,$V.jsx)(mQ.MenuGroup,{label:(0,fQ.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup",children:(0,$V.jsx)(dQ,{clientId:o,onSwitch:t})})}var YV=l(N(),1),vQ=l(R(),1),gT=l(Z(),1);var Hs=l(A(),1);var gQ=l(R(),1),bQ=l($(),1);var pQ=l($(),1),KV=(e,t,o=new Set)=>{let{clientId:r,name:n,innerBlocks:i=[]}=e;if(!o.has(r)){if(n===t)return e;for(let s of i){let a=KV(s,t,o);if(a)return a}}},hQ=(e,t)=>{let o=(0,pQ.getBlockAttributesNamesByRole)(e,"content");return o?.length?o.reduce((r,n)=>(t[n]&&(r[n]=t[n]),r),{}):t};var Q1e=(e,t)=>{let o=hQ(t.name,t.attributes);e.attributes={...e.attributes,...o}},J1e=(e,t)=>{let o=t.map(n=>(0,bQ.cloneBlock)(n)),r=new Set;for(let n of e){let i=!1;for(let s of o){let a=KV(s,n.name,r);if(a){i=!0,r.add(a.clientId),Q1e(a,n);break}}if(!i)return}return o},eBe=(e,t)=>(0,gQ.useMemo)(()=>e.reduce((o,r)=>{let n=J1e(t,r.blocks);return n&&o.push({...r,transformedBlocks:n}),o},[]),[e,t]),kQ=eBe;var gr=l(w(),1);function tBe({blocks:e,patterns:t,onSelect:o}){let[r,n]=(0,vQ.useState)(!1),i=kQ(t,e);return i.length?(0,gr.jsxs)(Hs.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup",children:[r&&(0,gr.jsx)(oBe,{patterns:i,onSelect:o}),(0,gr.jsx)(Hs.MenuItem,{onClick:s=>{s.preventDefault(),n(!r)},icon:Vo,children:(0,YV.__)("Patterns")})]}):null}function oBe({patterns:e,onSelect:t}){let o=(0,gT.useViewportMatch)("medium","<");return(0,gr.jsx)("div",{className:"block-editor-block-switcher__popover-preview-container",children:(0,gr.jsx)(Hs.Popover,{className:"block-editor-block-switcher__popover-preview",placement:o?"bottom":"right-start",offset:16,children:(0,gr.jsx)("div",{className:"block-editor-block-switcher__preview is-pattern-list-preview",children:(0,gr.jsx)(rBe,{patterns:e,onSelect:t})})})})}function rBe({patterns:e,onSelect:t}){return(0,gr.jsx)(Hs.Composite,{role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,YV.__)("Patterns list"),children:e.map(o=>(0,gr.jsx)(yQ,{pattern:o,onSelect:t},o.name))})}function yQ({pattern:e,onSelect:t}){let o="block-editor-block-switcher__preview-patterns-container",r=(0,gT.useInstanceId)(yQ,`${o}-list__item-description`);return(0,gr.jsxs)("div",{className:`${o}-list__list-item`,children:[(0,gr.jsxs)(Hs.Composite.Item,{render:(0,gr.jsx)("div",{role:"option","aria-label":e.title,"aria-describedby":e.description?r:void 0,className:`${o}-list__item`}),onClick:()=>t(e.transformedBlocks),children:[(0,gr.jsx)(vn,{blocks:e.transformedBlocks,viewportWidth:e.viewportWidth||500}),(0,gr.jsx)("div",{className:`${o}-list__item-title`,children:e.title})]}),!!e.description&&(0,gr.jsx)(Hs.VisuallyHidden,{id:r,children:e.description})]})}var SQ=tBe;var ri=l(w(),1);function nBe({onClose:e,clientIds:t}){let{replaceBlocks:o,multiSelect:r,updateBlockAttributes:n}=(0,bT.useDispatch)(_),{possibleBlockTransformations:i,patterns:s,blocks:a,isUsingBindings:c,canRemove:u,hasBlockStyles:d}=(0,bT.useSelect)(I=>{let{getBlockAttributes:P,getBlocksByClientId:E,getBlockRootClientId:L,getBlockTransformItems:T,__experimentalGetPatternTransformItems:O,canRemoveBlocks:D,getBlockName:U}=I(_),{getBlockStyles:G}=I(fd.store),j=L(t[0]),z=E(t),W=t.length===1,ee=W&&U(t[0]),se=W&&!!G(ee)?.length;return{blocks:z,possibleBlockTransformations:T(z,j),patterns:O(z,j),isUsingBindings:t.every(ce=>!!P(ce)?.metadata?.bindings),canRemove:D(t),hasBlockStyles:se}},[t]),f=sQ({clientIds:t,blocks:a});function m(I){I.length>1&&r(I[0].clientId,I[I.length-1].clientId)}function h(I){let P=(0,fd.switchToBlockType)(a,I);o(t,P),m(P)}function p(I){n(a[0].clientId,{...f.find(({name:P})=>P===I).attributes})}function g(I){o(t,I),m(I)}let b=a.length===1,v=b&&((0,fd.isTemplatePart)(a[0])||(0,fd.isReusableBlock)(a[0])),k=!!i?.length&&u&&!v,y=!!f?.length,S=!!s?.length&&u,x=k||y;if(!(d||x||S))return(0,ri.jsx)("p",{className:"block-editor-block-switcher__no-transforms",children:(0,Aa.__)("No transforms.")});let B=b?(0,Aa._x)("This block is connected.","block toolbar button label and description"):(0,Aa._x)("These blocks are connected.","block toolbar button label and description");return(0,ri.jsxs)("div",{className:"block-editor-block-switcher__container",children:[S&&(0,ri.jsx)(SQ,{blocks:a,patterns:s,onSelect:I=>{g(I),e()}}),x&&(0,ri.jsx)(uQ,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:i,possibleBlockVariationTransformations:f,blocks:a,onSelect:I=>{h(I),e()},onSelectVariation:I=>{p(I),e()}}),d&&(0,ri.jsx)(hT,{hoveredBlock:a[0],onSwitch:e}),c&&(0,ri.jsx)(La.MenuGroup,{children:(0,ri.jsx)(La.__experimentalText,{className:"block-editor-block-switcher__binding-indicator",children:B})})]})}var iBe=({children:e,clientIds:t,label:o,text:r})=>{let i=t.length===1?(0,Aa.__)("Change block type or style"):(0,Aa.sprintf)((0,Aa._n)("Change type of %d block","Change type of %d blocks",t.length),t.length);return(0,ri.jsx)(La.ToolbarGroup,{children:(0,ri.jsx)(La.ToolbarItem,{children:s=>(0,ri.jsx)(La.DropdownMenu,{className:"block-editor-block-switcher",label:o,popoverProps:{placement:"bottom-start",className:"block-editor-block-switcher__popover"},icon:e,text:r,toggleProps:{description:i,...s},menuProps:{orientation:"both"},children:({onClose:a})=>(0,ri.jsx)(nBe,{onClose:a,clientIds:t})})})})},_Q=iBe;var xQ=l(N(),1),Vg=l(A(),1);var Dg=l(w(),1);function wQ({clientIds:e,children:t,label:o,text:r}){return(0,Dg.jsx)(Vg.ToolbarGroup,{children:(0,Dg.jsx)(Vg.ToolbarItem,{children:n=>(0,Dg.jsx)(Vg.DropdownMenu,{className:"block-editor-block-switcher",label:o,popoverProps:{placement:"bottom-start",className:"block-editor-block-switcher__popover"},icon:t,text:r,toggleProps:{description:(0,xQ.__)("Change block style"),...n},menuProps:{orientation:"both"},children:({onClose:i})=>(0,Dg.jsx)("div",{className:"block-editor-block-switcher__container",children:(0,Dg.jsx)(hT,{hoveredBlock:{clientId:e[0]},onSwitch:i})})})})})}var Fg=l(A(),1),IS=l(N(),1),kT=l(R(),1),CQ=l(F(),1);var rc=l(w(),1);function sBe({clientIds:e,blockTitle:t}){let o=(0,CQ.useSelect)(i=>{let{getBlockAttributes:s}=i(_);return s(e?.[0])?.metadata?.name},[e]),r=e.length===1,n;return r&&o?n=(0,IS.sprintf)((0,IS.__)('This %1$s is editable using the "%2$s" override.'),t.toLowerCase(),o):n=(0,IS.__)("These blocks are editable using overrides."),(0,rc.jsx)(Fg.__experimentalText,{children:n})}function BQ({icon:e,clientIds:t,blockTitle:o,label:r}){let[n,i]=(0,kT.useState)(!1),s=(0,kT.useRef)();return(0,rc.jsxs)(rc.Fragment,{children:[(0,rc.jsx)(Fg.ToolbarButton,{ref:s,className:"block-editor-block-toolbar__pattern-overrides-indicator",icon:e,label:r,onClick:()=>i(!n),"aria-expanded":n}),n&&(0,rc.jsx)(Fg.Popover,{anchor:s.current,onClose:()=>i(!1),placement:"bottom-start",offset:16,className:"block-editor-block-toolbar__pattern-overrides-popover",children:(0,rc.jsx)(sBe,{clientIds:t,blockTitle:o})})]})}var zg=l(w(),1);function aBe({select:e,clientIds:t}){let{getBlockName:o,getBlockAttributes:r,getBlockParentsByBlockName:n,canRemoveBlocks:i,getTemplateLock:s,getBlockEditingMode:a,canEditBlock:c}=M(e(_)),{getBlockStyles:u}=e(PS.store),d=t.some(P=>s(P)==="contentOnly"),f=t.length===1,m=f&&o(t[0]),h=f&&!!u(m)?.length,p=t.some(P=>!!r(P)?.metadata?.patternName),g=t.every(P=>Wk(r(P)?.metadata?.bindings)),b=t.every(P=>n(P,"core/block",!0).length>0),v=i(t),k=t.every(P=>c(P)),y=a(t[0]),S=y==="default",x=y==="contentOnly",B=!p&&S&&(h||v)&&!d&&k,I=g&&b;return B?"switcher":x&&h&&!g&&k?"styles-only":I?"pattern-overrides":"default"}function lBe({select:e,clientIds:t}){let{getBlockName:o,getBlockAttributes:r}=M(e(_)),n=t.length===1,i=t[0],s=r(i);if(n&&s?.metadata?.patternName)return Ei;let a=o(i),c=(0,PS.getBlockType)(a);if(n){let{getActiveBlockVariation:f}=e(PS.store);return f(a,s)?.icon||c?.icon}let u=t.map(f=>o(f));return new Set(u).size===1?c?.icon:Cf}function RQ({clientIds:e,isSynced:t}){let{icon:o,showIconLabels:r,variant:n}=(0,IQ.useSelect)(f=>({icon:lBe({select:f,clientIds:e}),showIconLabels:f(PQ.store).get("core","showIconLabels"),variant:aBe({select:f,clientIds:e})}),[e]),i=zr({clientId:e?.[0],maximumLength:35}),s=e.length===1,a=s&&t&&!r,c=s?i:(0,TQ.__)("Multiple blocks selected"),u=a&&i?i:void 0,d=(0,zg.jsx)(Ae,{className:"block-editor-block-toolbar__block-icon",icon:o});return n==="switcher"?(0,zg.jsx)(_Q,{clientIds:e,label:c,text:u,children:d}):n==="styles-only"?(0,zg.jsx)(wQ,{clientIds:e,label:c,text:u,children:d}):n==="pattern-overrides"?(0,zg.jsx)(BQ,{icon:d,clientIds:e,blockTitle:i,label:c}):(0,zg.jsx)(EQ.ToolbarButton,{disabled:!0,className:"block-editor-block-toolbar__block-icon-button",title:c,icon:d,text:u})}var Qe=l(w(),1);function ZV({hideDragHandle:e,focusOnMount:t,__experimentalInitialIndex:o,__experimentalOnIndexChange:r,variant:n="unstyled"}){let{blockClientId:i,blockClientIds:s,isDefaultEditingMode:a,blockType:c,toolbarKey:u,shouldShowVisualToolbar:d,showParentSelector:f,isUsingBindings:m,isSectionContainer:h,hasContentOnlyLocking:p,showShuffleButton:g,showSlots:b,showGroupButtons:v,showLockButtons:k,showBlockVisibilityButton:y,showSwitchSectionStyleButton:S,areSelectedBlocksHiddenOnViewport:x,canEdit:C}=(0,AQ.useSelect)(G=>{let{canEditBlock:j}=G(_),{getBlockName:z,getBlockMode:W,getBlockParents:ee,getSelectedBlockClientIds:se,isBlockValid:ce,getBlockEditingMode:ie,getBlockAttributes:re,getSettings:Q,getTemplateLock:Y,getParentSectionBlock:J,isZoomOut:K,isSectionBlock:H,isBlockHiddenAtViewport:X}=M(G(_)),ne=se(),le=ne[0],ve=ee(le),xe=J(le)??ve[ve.length-1],ze=z(xe),ot=(0,nc.getBlockType)(ze),Wt=ie(le),fo=Wt==="default",Do=z(le),rt=ne.every(je=>ce(je)),ar=ne.every(je=>W(je)==="visual"),xt=ne.every(je=>!!re(je)?.metadata?.bindings),At=ne.some(je=>Y(je)==="contentOnly"),Pe=K(),wt=H(le),qo=j(le),$t=qo&&(Pe||wt),lr=Q()?.[wi]?.toLowerCase()||"desktop",ln=ne.length>0&&ne.every(je=>X(je,lr));return{blockClientId:le,blockClientIds:ne,isDefaultEditingMode:fo,blockType:le&&(0,nc.getBlockType)(Do),shouldShowVisualToolbar:rt&&ar,toolbarKey:`${le}${xe}`,showParentSelector:!Pe&&ot&&Wt!=="contentOnly"&&ie(xe)!=="disabled"&&(0,nc.hasBlockSupport)(ot,"__experimentalParentSelector",!0)&&ne.length===1,isUsingBindings:xt,isSectionContainer:wt,hasContentOnlyLocking:At,showShuffleButton:Pe,showSlots:!Pe,showGroupButtons:!Pe,showLockButtons:!Pe,showBlockVisibilityButton:!Pe,showSwitchSectionStyleButton:$t,areSelectedBlocksHiddenOnViewport:ln,canEdit:qo}},[]),B=(0,qV.useRef)(null),I=(0,qV.useRef)(),P=kg({ref:I}),E=!(0,LQ.useViewportMatch)("medium","<");if(!qE())return null;let T=s.length>1,O=(0,nc.isReusableBlock)(c)||(0,nc.isTemplatePart)(c),D=V("block-editor-block-contextual-toolbar",{"has-parent":f}),U=V("block-editor-block-toolbar",{"is-synced":O,"is-connected":m});return(0,Qe.jsx)(Bg,{focusEditorOnEscape:!0,className:D,"aria-label":(0,OQ.__)("Block tools"),variant:n==="toolbar"?void 0:n,focusOnMount:t,__experimentalInitialIndex:o,__experimentalOnIndexChange:r,children:(0,Qe.jsxs)("div",{ref:B,className:U,children:[f&&!T&&E&&(0,Qe.jsx)(nZ,{}),(d||T)&&(0,Qe.jsx)("div",{ref:I,...P,children:(0,Qe.jsxs)(NQ.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls",children:[(0,Qe.jsx)(RQ,{clientIds:s,isSynced:O}),a&&y&&(0,Qe.jsx)(TD,{clientIds:s}),!T&&a&&k&&(0,Qe.jsx)(wV,{clientId:i}),(0,Qe.jsx)(kE,{clientIds:s,hideDragHandle:e})]})}),!x&&!p&&d&&T&&v&&(0,Qe.jsx)(vV,{}),!T&&C&&(0,Qe.jsx)(eQ,{clientId:s[0]}),!x&&g&&(0,Qe.jsx)(EX,{clientId:s[0]}),!x&&S&&(0,Qe.jsx)(QX,{clientId:s[0]}),!x&&d&&b&&(0,Qe.jsxs)(Qe.Fragment,{children:[!h&&(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(Mt.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,Qe.jsx)(Mt.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,Qe.jsx)(Mt.Slot,{className:"block-editor-block-toolbar__slot"}),(0,Qe.jsx)(Mt.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"})]}),(0,Qe.jsx)(Mt.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,Qe.jsx)(xE.Slot,{})]}),(0,Qe.jsx)(gX,{clientIds:s}),(0,Qe.jsx)(GE,{clientIds:s})]})},u)}function MQ({hideDragHandle:e,variant:t}){return(0,Qe.jsx)(ZV,{hideDragHandle:e,variant:t,focusOnMount:void 0,__experimentalInitialIndex:void 0,__experimentalOnIndexChange:void 0})}var XV=l(w(),1);function FQ({clientId:e,isTyping:t,__unstableContentRef:o}){let{capturingClientId:r,isInsertionPointVisible:n,lastClientId:i}=cE(e),s=(0,jg.useRef)();(0,jg.useEffect)(()=>{s.current=void 0},[e]);let{stopTyping:a}=(0,DQ.useDispatch)(_),c=(0,jg.useRef)(!1);(0,VQ.useShortcut)("core/block-editor/focus-toolbar",()=>{c.current=!0,a(!0)}),(0,jg.useEffect)(()=>{c.current=!1});let u=r||e,d=lE({contentElement:o?.current,clientId:u});return!t&&(0,XV.jsx)(pm,{clientId:u,bottomClientId:i,className:V("block-editor-block-list__block-popover",{"is-insertion-point-visible":n}),resize:!1,...d,__unstableContentRef:o,children:(0,XV.jsx)(ZV,{focusOnMount:c.current,__experimentalInitialIndex:s.current,__experimentalOnIndexChange:f=>{s.current=f},variant:"toolbar"})})}var vT=l(F(),1),yT=l(R(),1);var zQ=l(A(),1);var jQ=l(N(),1),UQ=l(w(),1);function cBe({onClick:e}){return(0,UQ.jsx)(zQ.Button,{variant:"primary",icon:Bi,size:"compact",className:V("block-editor-button-pattern-inserter__button","block-editor-block-tools__zoom-out-mode-inserter-button"),onClick:e,label:(0,jQ._x)("Add pattern","Generic label for pattern inserter button")})}var HQ=cBe;var QV=l(w(),1);function uBe(){let[e,t]=(0,yT.useState)(!1),{hasSelection:o,blockOrder:r,setInserterIsOpened:n,sectionRootClientId:i,selectedBlockClientId:s,blockInsertionPoint:a,insertionPointVisible:c}=(0,vT.useSelect)(p=>{let{getSettings:g,getBlockOrder:b,getSelectionStart:v,getSelectedBlockClientId:k,getSectionRootClientId:y,getBlockInsertionPoint:S,isBlockInsertionPointVisible:x}=M(p(_)),C=y();return{hasSelection:!!v().clientId,blockOrder:b(C),sectionRootClientId:C,setInserterIsOpened:g().__experimentalSetIsInserterOpened,selectedBlockClientId:k(),blockInsertionPoint:S(),insertionPointVisible:x()}},[]),{showInsertionPoint:u}=M((0,vT.useDispatch)(_));if((0,yT.useEffect)(()=>{let p=setTimeout(()=>{t(!0)},500);return()=>{clearTimeout(p)}},[]),!e||!o)return null;let d=s,m=r.findIndex(p=>s===p)+1,h=r[m];return c&&a?.index===m?null:(0,QV.jsx)(MB,{previousClientId:d,nextClientId:h,children:(0,QV.jsx)(HQ,{onClick:()=>{n({rootClientId:i,insertionIndex:m,tab:"patterns",category:"all"}),u(i,m,{operation:"insert"})}})})}var GQ=uBe;var WQ=l(F(),1),$Q=l($(),1);function KQ(){return(0,WQ.useSelect)(e=>{let{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:o,getBlock:r,getBlockMode:n,getSettings:i,isTyping:s,isBlockInterfaceHidden:a}=M(e(_)),c=t()||o(),u=r(c),d=!!c&&!!u,f=d&&(0,$Q.isUnmodifiedDefaultBlock)(u,"content")&&n(c)!=="html",m=c&&!s()&&f,h=!a()&&!i().hasFixedToolbar&&!m&&d&&!f;return{showEmptyBlockSideInserter:m,showBlockToolbarPopover:h}},[])}var Yi=l(w(),1);function dBe(e){let{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:o,getSettings:r,isTyping:n,isDragging:i,isZoomOut:s,getViewportModalClientIds:a}=M(e(_));return{clientId:t()||o(),hasFixedToolbar:r().hasFixedToolbar,isTyping:n(),isZoomOutMode:s(),isDragging:i(),viewportModalClientIds:a()}}function RS({children:e,__unstableContentRef:t,...o}){let{clientId:r,hasFixedToolbar:n,isTyping:i,isZoomOutMode:s,isDragging:a,viewportModalClientIds:c}=(0,Ug.useSelect)(dBe,[]),u=(0,YQ.__unstableUseShortcutEventMatch)(),{getBlocksByClientId:d,getSelectedBlockClientIds:f,getBlockRootClientId:m,getBlockEditingMode:h,getBlockName:p,isGroupable:g,getEditedContentOnlySection:b,canEditBlock:v}=M((0,Ug.useSelect)(_)),{getGroupingBlockName:k}=(0,Ug.useSelect)(Hg.store),{showEmptyBlockSideInserter:y,showBlockToolbarPopover:S}=KQ(),x=yg(),[C,B]=(0,ST.useState)(null),{canRename:I}=Pm(p(f()[0])),{duplicateBlocks:P,removeBlocks:E,replaceBlocks:L,insertAfterBlock:T,insertBeforeBlock:O,selectBlock:D,moveBlocksUp:U,moveBlocksDown:G,expandBlock:j,stopEditingContentOnlySection:z,showViewportModal:W,hideViewportModal:ee}=M((0,Ug.useDispatch)(_));function se(re){if(!re.defaultPrevented){if(u("core/block-editor/move-up",re)||u("core/block-editor/move-down",re)){let Q=f();if(Q.length){re.preventDefault();let Y=m(Q[0]);(u("core/block-editor/move-up",re)?"up":"down")==="up"?U(Q,Y):G(Q,Y);let K=Array.isArray(Q)?Q.length:1,H=(0,Gg.sprintf)((0,Gg._n)("%d block moved.","%d blocks moved.",Q.length),K);(0,t3.speak)(H)}}else if(u("core/block-editor/duplicate",re)){let Q=f();Q.length&&(re.preventDefault(),P(Q))}else if(u("core/block-editor/remove",re)){let Q=f();Q.length&&(re.preventDefault(),E(Q))}else if(u("core/block-editor/paste-styles",re)){let Q=f();if(Q.length){re.preventDefault();let Y=d(Q);x(Y)}}else if(u("core/block-editor/insert-after",re)){let Q=f();Q.length&&(re.preventDefault(),T(Q[Q.length-1]))}else if(u("core/block-editor/insert-before",re)){let Q=f();Q.length&&(re.preventDefault(),O(Q[0]))}else if(u("core/block-editor/unselect",re)){if(re.target.closest("[role=toolbar]"))return;let Q=f();Q.length>1&&(re.preventDefault(),D(Q[0]))}else if(u("core/block-editor/collapse-list-view",re)){if((0,JV.isTextField)(re.target)||(0,JV.isTextField)(re.target?.contentWindow?.document?.activeElement))return;re.preventDefault(),j(r)}else if(u("core/block-editor/group",re)){let Q=f();if(Q.length>1&&g(Q)){re.preventDefault();let Y=d(Q),J=k(),K=(0,Hg.switchToBlockType)(Y,J);L(Q,K),(0,t3.speak)((0,Gg.__)("Selected blocks are grouped."))}}else if(u("core/block-editor/rename",re)){let Q=f();if(Q.length===1){let Y=h(Q[0])==="contentOnly";I&&!Y&&v(Q[0])&&(re.preventDefault(),B(Q[0]))}}else if(u("core/block-editor/toggle-block-visibility",re)){let Q=f();if(Q.length){if(re.preventDefault(),!d(Q).every(K=>(0,Hg.hasBlockSupport)(K.name,"visibility",!0))||Q.some(K=>h(K)!=="default"||!v(K)))return;W(Q)}}u("core/block-editor/stop-editing-as-blocks",re)&&b()&&z()}}let ce=mm(t),ie=mm(t);return(0,Yi.jsxs)("div",{...o,onKeyDown:se,className:V(o.className,{"block-editor-block-tools--is-dragging":a}),children:[(0,Yi.jsxs)(fg.Provider,{value:(0,ST.useRef)(!1),children:[!i&&!s&&(0,Yi.jsx)(CY,{__unstableContentRef:t}),y&&(0,Yi.jsx)(jq,{__unstableContentRef:t,clientId:r}),S&&(0,Yi.jsx)(FQ,{__unstableContentRef:t,clientId:r,isTyping:i}),!s&&!n&&(0,Yi.jsx)(e3.Popover.Slot,{name:"block-toolbar",ref:ce}),e,(0,Yi.jsx)(e3.Popover.Slot,{name:"__unstable-block-tools-after",ref:ie}),s&&!a&&(0,Yi.jsx)(GQ,{__unstableContentRef:t})]}),C&&(0,Yi.jsx)(Tm,{clientId:C,onClose:()=>B(null)}),c&&(0,Yi.jsx)(wD,{clientIds:c,onClose:ee})]})}var qi=l(N(),1),Na=l($(),1),ic=l(F(),1),o3=l(ZQ(),1);var fBe=()=>function(){let{replaceBlocks:t,multiSelect:o}=(0,ic.useDispatch)(_),{blocks:r,clientIds:n,canRemove:i,possibleBlockTransformations:s,invalidSelection:a}=(0,ic.useSelect)(h=>{let{getBlockRootClientId:p,getBlockTransformItems:g,getSelectedBlockClientIds:b,getBlocksByClientId:v,canRemoveBlocks:k}=h(_),y=b(),S=v(y);if(S.filter(C=>!C).length>0)return{invalidSelection:!0};let x=p(y[0]);return{blocks:S,clientIds:y,possibleBlockTransformations:g(S,x),canRemove:k(y),invalidSelection:!1}},[]);if(a)return{isLoading:!1,commands:[]};let c=r.length===1&&(0,Na.isTemplatePart)(r[0]);function u(h){h.length>1&&o(h[0].clientId,h[h.length-1].clientId)}function d(h){let p=(0,Na.switchToBlockType)(r,h);t(n,p),u(p)}let f=!!s.length&&i&&!c;return!n||n.length<1||!f?{isLoading:!1,commands:[]}:{isLoading:!1,commands:s.map(h=>{let{name:p,title:g,icon:b}=h,v=!b?.src||b?.src==="block-default"?{src:Jk}:b;return{name:"core/block-editor/transform-to-"+p.replace("/","-"),label:(0,qi.sprintf)((0,qi.__)("Transform to %s"),g),icon:v?.src,category:"command",callback:({close:k})=>{d(p),k()}}})}},mBe=()=>function(){let{clientIds:t,isUngroupable:o,isGroupable:r}=(0,ic.useSelect)(O=>{let{getSelectedBlockClientIds:D,isUngroupable:U,isGroupable:G}=O(_);return{clientIds:D(),isUngroupable:U(),isGroupable:G()}},[]),{canInsertBlockType:n,getBlockRootClientId:i,getBlocksByClientId:s,canRemoveBlocks:a,isBlockHiddenAnywhere:c}=M((0,ic.useSelect)(_)),{getBlockEditingMode:u}=(0,ic.useSelect)(_),{getDefaultBlockName:d,getGroupingBlockName:f}=(0,ic.useSelect)(Na.store),m=s(t),h=(0,ic.useDispatch)(_),{removeBlocks:p,replaceBlocks:g,duplicateBlocks:b,insertAfterBlock:v,insertBeforeBlock:k}=h,y=()=>{if(!m.length)return;let O=f(),D=(0,Na.switchToBlockType)(m,O);D&&g(t,D)},S=()=>{if(!m.length)return;let O=m[0].innerBlocks;O.length&&g(t,O)};if(!t||t.length<1)return{isLoading:!1,commands:[]};let{showViewportModal:x}=M(h),C=i(t[0]),B=n(d(),C),I=m.every(O=>!!O&&(0,Na.hasBlockSupport)(O.name,"multiple",!0)&&n(O.name,C)),P=a(t),E=[];I&&E.push({name:"duplicate",label:(0,qi.__)("Duplicate"),callback:()=>b(t,!0),icon:Cf}),B&&E.push({name:"add-before",label:(0,qi.__)("Add before"),callback:()=>{let O=Array.isArray(t)?t[0]:O;k(O)},icon:Bi},{name:"add-after",label:(0,qi.__)("Add after"),callback:()=>{let O=Array.isArray(t)?t[t.length-1]:O;v(O)},icon:Bi}),r&&E.push({name:"Group",label:(0,qi.__)("Group"),callback:y,icon:nv}),o&&E.push({name:"ungroup",label:(0,qi.__)("Ungroup"),callback:S,icon:RN}),P&&E.push({name:"remove",label:(0,qi.__)("Delete"),callback:()=>p(t,!0),icon:IN});let L=m.every(O=>!!O&&(0,Na.hasBlockSupport)(O.name,"visibility",!0)),T=t.every(O=>u(O)==="default");if(L&&T){let O=t.some(D=>c(D));E.push({name:"toggle-visibility",label:O?(0,qi.__)("Show"):(0,qi.__)("Hide"),callback:()=>x(t),icon:O?Af:vs})}return{isLoading:!1,commands:E.map(O=>({...O,name:"core/block-editor/action-"+O.name,category:"command",callback:({close:D})=>{O.callback(),D()}}))}},_T=()=>{(0,o3.useCommandLoader)({name:"core/block-editor/blockTransforms",hook:fBe()}),(0,o3.useCommandLoader)({name:"core/block-editor/blockQuickActions",hook:mBe(),context:"block-selection-edit"})};var Zr=l(w(),1),xT=(0,eJ.createSlotFill)(Symbol("BlockCanvasCover"));function XQ({children:e}){return(0,Zr.jsx)("div",{className:"block-canvas-cover",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none"},children:e})}var pBe={ignoredSelectors:[/\.editor-styles-wrapper/gi]};function r3({shouldIframe:e=!0,height:t="300px",children:o=(0,Zr.jsx)(Gh,{}),styles:r,contentRef:n,iframeProps:i}){_T();let s=(0,wT.useViewportMatch)("medium","<"),a=rS(),c=hm(),u=(0,QQ.useRef)(),d=(0,wT.useMergeRefs)([n,c,u]),f=(0,JQ.useSelect)(h=>M(h(_)).getZoomLevel(),[]),m=f!==100&&!s?{scale:f,frameSize:"40px"}:{};return e?(0,Zr.jsx)(RS,{__unstableContentRef:u,style:{height:t,display:"flex"},children:(0,Zr.jsxs)(Mh,{...i,...m,ref:a,contentRef:d,style:{...i?.style},name:"editor-canvas",children:[(0,Zr.jsx)(xT.Slot,{fillProps:{containerRef:u},children:h=>h.map((p,g)=>(0,Zr.jsx)(XQ,{children:p},g))}),(0,Zr.jsx)(Nl,{styles:r}),o]})}):(0,Zr.jsxs)(RS,{__unstableContentRef:u,style:{height:t,display:"flex"},children:[(0,Zr.jsx)(xT.Slot,{fillProps:{containerRef:u},children:h=>h.map((p,g)=>(0,Zr.jsx)(XQ,{children:p},g))}),(0,Zr.jsx)(Nl,{styles:r,scope:":where(.editor-styles-wrapper)",transformOptions:pBe}),(0,Zr.jsx)(E1,{ref:d,className:"editor-styles-wrapper",tabIndex:-1,style:{height:"100%",width:"100%",overflow:"auto"},children:o})]})}function hBe({children:e,height:t,styles:o}){return(0,Zr.jsx)(r3,{height:t,styles:o,children:e})}var tJ=hBe;var Ma=l(A(),1),oJ=l(N(),1),rJ=l(it(),1),nJ=l(Re(),1),Zi=l(w(),1),gBe=()=>(0,Zi.jsx)(Ma.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:(0,Zi.jsx)(Ma.Path,{d:"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z"})}),bBe=({style:e,className:t})=>(0,Zi.jsx)("div",{className:"block-library-colors-selector__icon-container",children:(0,Zi.jsx)("div",{className:`${t} block-library-colors-selector__state-selection`,style:e,children:(0,Zi.jsx)(gBe,{})})}),kBe=({TextColor:e,BackgroundColor:t})=>function({onToggle:r,isOpen:n}){let i=s=>{!n&&s.keyCode===rJ.DOWN&&(s.preventDefault(),r())};return(0,Zi.jsx)(Ma.ToolbarGroup,{children:(0,Zi.jsx)(Ma.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,oJ.__)("Open Colors Selector"),onClick:r,onKeyDown:i,icon:(0,Zi.jsx)(t,{children:(0,Zi.jsx)(e,{children:(0,Zi.jsx)(bBe,{})})})})})},vBe=({children:e,...t})=>((0,nJ.default)("wp.blockEditor.BlockColorsStyleSelector",{alternative:"block supports API",since:"6.1",version:"6.3"}),(0,Zi.jsx)(Ma.Dropdown,{popoverProps:{placement:"bottom-start"},className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:kBe(t),renderContent:()=>e})),iJ=vBe;var dee=l(Re(),1),jT=l(A(),1),c3=l(N(),1),fee=l(F(),1),mee=l(R(),1);var Xg=l(Z(),1),FT=l(A(),1),LS=l(F(),1),cee=l(Re(),1),vo=l(R(),1),l3=l(N(),1);var LT=l(A(),1),NT=l(R(),1),MT=l(F(),1);var aJ=l(Z(),1),lJ=l(Xo(),1),cJ=l(F(),1),IT=l(R(),1),Wg=l(N(),1);var CT=l(R(),1),BT=(0,CT.createContext)({});BT.displayName="ListViewContext";var md=()=>(0,CT.useContext)(BT);var ET=l(R(),1),sJ=l(w(),1);function TT({children:e,...t}){let o=(0,ET.useRef)();return(0,ET.useEffect)(()=>{o.current&&(o.current.textContent=o.current.textContent)},[e]),(0,sJ.jsx)("div",{hidden:!0,...t,ref:o,children:e})}var OS=l(w(),1),n3=(0,IT.forwardRef)(({nestingLevel:e,blockCount:t,clientId:o,...r},n)=>{let{insertedBlock:i,setInsertedBlock:s}=md(),a=(0,aJ.useInstanceId)(n3),{directInsert:c,hideInserter:u}=(0,cJ.useSelect)(p=>{let{getBlockListSettings:g,getTemplateLock:b,isZoomOut:v}=M(p(_)),y=g(o)?.directInsert||!1,S=!!b(o)||v();return{directInsert:y,hideInserter:S}},[o]),d=zr({clientId:o,context:"list-view"}),f=zr({clientId:i?.clientId,context:"list-view"});if((0,IT.useEffect)(()=>{f?.length&&(0,lJ.speak)((0,Wg.sprintf)((0,Wg.__)("%s block inserted"),f),"assertive")},[f]),u)return null;let m=`list-view-appender__${a}`,h=(0,Wg.sprintf)((0,Wg.__)("Append to %1$s block at position %2$d, Level %3$d"),d,t+1,e);return(0,OS.jsxs)("div",{className:"list-view-appender",children:[(0,OS.jsx)(Ui,{ref:n,rootClientId:o,position:"bottom right",isAppender:!0,selectBlockOnInsert:!1,shouldDirectInsert:c,__experimentalIsQuick:!0,...r,toggleProps:{"aria-describedby":m},onSelectOrClose:p=>{p?.clientId&&s(p)}}),(0,OS.jsx)(TT,{id:m,children:h})]})});var gd=l($(),1),Nm=l(A(),1),OT=l(Z(),1);var ko=l(R(),1),Kg=l(F(),1),s3=l(N(),1),AT=l(it(),1),LJ=l(Jy(),1),NJ=l(Is(),1),MJ=l(Xo(),1);var uJ=l(A(),1),dJ=l(Z(),1),fJ=l(R(),1);var mJ=l(w(),1),yBe=P7(uJ.__experimentalTreeGridRow),SBe=(0,fJ.forwardRef)(({isDragged:e,isSelected:t,position:o,level:r,rowCount:n,children:i,className:s,path:a,...c},u)=>{let d=YC({clientId:c["data-block"],enableAnimation:!0,triggerAnimationOnChange:a}),f=(0,dJ.useMergeRefs)([u,d]);return(0,mJ.jsx)(yBe,{ref:f,className:V("block-editor-list-view-leaf",s),level:r,positionInSet:o,setSize:n,isExpanded:void 0,...c,children:i})}),pJ=SBe;var hJ=l(Fe(),1),gJ=l(R(),1);function bJ({isSelected:e,selectedClientIds:t,rowItemRef:o}){let r=t.length===1;(0,gJ.useLayoutEffect)(()=>{if(!e||!r||!o.current)return;let n=(0,hJ.getScrollContainer)(o.current),{ownerDocument:i}=o.current;if(n===i.body||n===i.documentElement||!n)return;let a=o.current.getBoundingClientRect(),c=n.getBoundingClientRect();(a.topc.bottom)&&o.current.scrollIntoView()},[e,r,o])}var BJ=l(R(),1);var pd=l(A(),1),xJ=l(R(),1);var RT=l(it(),1),wJ=l(F(),1);var kJ=l(N(),1),i3=l(w(),1);function PT({onClick:e}){return(0,i3.jsx)("span",{className:"block-editor-list-view__expander",onClick:t=>e(t,{forceToggle:!0}),"aria-hidden":"true","data-testid":"list-view-expander",children:(0,i3.jsx)(we,{icon:(0,kJ.isRTL)()?ev:tu})})}var vJ=l(R(),1),yJ=l(F(),1);var _Be=3,SJ={"core/image":({clientId:e,attributes:t})=>{if(t.url)return{url:t.url,alt:t.alt||"",clientId:e}},"core/cover":({clientId:e,attributes:t})=>{if(t.backgroundType==="image"&&t.url)return{url:t.url,alt:t.alt||"",clientId:e}},"core/media-text":({clientId:e,attributes:t})=>{if(t.mediaType==="image"&&t.mediaUrl)return{url:t.mediaUrl,alt:t.mediaAlt||"",clientId:e}},"core/gallery":({innerBlocks:e})=>{let t=[],o=e?.length?SJ[e[0].name]:void 0;if(!o)return t;for(let r of e){let n=o(r);if(n&&t.push(n),t.length>=_Be)return t}return t}};function xBe(e,t){let o=SJ[e.name],r=o?o(e):void 0;return r?Array.isArray(r)?t?[]:r:[r]:[]}function _J({clientId:e,isExpanded:t}){let{block:o}=(0,yJ.useSelect)(n=>({block:n(_).getBlock(e)}),[e]);return(0,vJ.useMemo)(()=>xBe(o,t),[o,t])}var jo=l(w(),1),{Badge:wBe}=M(pd.privateApis);function CBe({className:e,block:{clientId:t},onClick:o,onContextMenu:r,onMouseDown:n,onToggleExpanded:i,tabIndex:s,onFocus:a,onDragStart:c,onDragEnd:u,draggable:d,isExpanded:f,ariaDescribedBy:m},h){let p=Tt(t),g=zr({clientId:t,context:"list-view"}),{isLocked:b}=ei(t),{hasPatternName:v,blockVisibility:k}=(0,wJ.useSelect)(P=>{let{getBlockAttributes:E}=M(P(_)),L=E(t);return{hasPatternName:!!L?.metadata?.patternName,blockVisibility:L?.metadata?.blockVisibility}},[t]),y=b,S=p?.positionType==="sticky",x=_J({clientId:t,isExpanded:f}),C=by(k),B=P=>{P.dataTransfer.clearData(),c?.(P)};function I(P){(P.keyCode===RT.ENTER||P.keyCode===RT.SPACE)&&o(P)}return(0,jo.jsxs)("a",{className:V("block-editor-list-view-block-select-button",e),onClick:o,onContextMenu:r,onKeyDown:I,onMouseDown:n,ref:h,tabIndex:s,onFocus:a,onDragStart:B,onDragEnd:u,draggable:d,href:`#block-${t}`,"aria-describedby":m,"aria-expanded":f,children:[(0,jo.jsx)(PT,{onClick:i}),(0,jo.jsx)(Ae,{icon:v?Ei:p?.icon,showColors:!0,context:"list-view"}),(0,jo.jsxs)(pd.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1,children:[(0,jo.jsx)("span",{className:"block-editor-list-view-block-select-button__title",children:(0,jo.jsx)(pd.__experimentalTruncate,{ellipsizeMode:"auto",children:g})}),p?.anchor&&(0,jo.jsx)("span",{className:"block-editor-list-view-block-select-button__anchor-wrapper",children:(0,jo.jsx)(wBe,{className:"block-editor-list-view-block-select-button__anchor",children:p.anchor})}),S&&(0,jo.jsx)("span",{className:"block-editor-list-view-block-select-button__sticky",children:(0,jo.jsx)(we,{icon:NL})}),x.length?(0,jo.jsx)("span",{className:"block-editor-list-view-block-select-button__images","aria-hidden":!0,children:x.map((P,E)=>(0,jo.jsx)("span",{className:"block-editor-list-view-block-select-button__image",style:{backgroundImage:`url(${P.url})`,zIndex:x.length-E}},P.clientId))}):null,!!C&&(0,jo.jsx)(pd.Tooltip,{text:C,children:(0,jo.jsx)("span",{className:"block-editor-list-view-block-select-button__block-visibility","aria-hidden":"true",children:(0,jo.jsx)(we,{icon:vs})})}),y&&(0,jo.jsx)("span",{className:"block-editor-list-view-block-select-button__lock",children:(0,jo.jsx)(we,{icon:EL})})]})]})}var CJ=(0,xJ.forwardRef)(CBe);var hd=l(w(),1),BBe=(0,BJ.forwardRef)(({onClick:e,onToggleExpanded:t,block:o,isSelected:r,position:n,siblingBlockCount:i,level:s,isExpanded:a,selectedClientIds:c,...u},d)=>{let{clientId:f}=o,{AdditionalBlockContent:m,insertedBlock:h,setInsertedBlock:p}=md(),g=c.includes(f)?c:[f];return(0,hd.jsxs)(hd.Fragment,{children:[m&&(0,hd.jsx)(m,{block:o,insertedBlock:h,setInsertedBlock:p}),(0,hd.jsx)(fE,{appendToOwnerDocument:!0,clientIds:g,cloneClassname:"block-editor-list-view-draggable-chip",children:({draggable:b,onDragStart:v,onDragEnd:k})=>(0,hd.jsx)(CJ,{ref:d,className:"block-editor-list-view-block-contents",block:o,onClick:e,onToggleExpanded:t,isSelected:r,position:n,siblingBlockCount:i,level:s,draggable:b,onDragStart:v,onDragEnd:k,isExpanded:a,...u})})]})}),EJ=BBe;var Lm=l(N(),1),TJ=l(Fe(),1),IJ=(e,t,o)=>(0,Lm.sprintf)((0,Lm.__)("Block %1$d of %2$d, Level %3$d."),e,t,o),PJ=(e,t)=>[e?.positionLabel?`${(0,Lm.sprintf)((0,Lm.__)("Position: %s"),e.positionLabel)}.`:void 0,t?(0,Lm.__)("This block is locked."):void 0].filter(Boolean).join(" "),RJ=(e,t)=>Array.isArray(t)&&t.length?t.indexOf(e)!==-1:t===e;function OJ(e,t,o,r){let n=[...o,e],i=[...r,t],s=Math.min(n.length,i.length)-1,a=n[s],c=i[s];return{start:a,end:c}}function $g(e,t){if(!t)return;let o=`[role=row][data-block="${e}"]`;return new Promise(r=>{if(t.querySelector(o))return r(t.querySelector(o));let n=null,i=new window.MutationObserver(()=>{t.querySelector(o)&&(clearTimeout(n),i.disconnect(),r(t.querySelector(o)))});i.observe(t,{childList:!0,subtree:!0}),n=setTimeout(()=>{i.disconnect(),r(null)},3e3)}).then(r=>{r&&r.isConnected&&TJ.focus.focusable.find(r)?.[0]?.focus()})}function AJ({blockIndexes:e,blockDropTargetIndex:t,blockDropPosition:o,clientId:r,firstDraggedBlockIndex:n,isDragged:i}){let s,a,c;if(!i){a=!1;let u=e[r];c=u>n,t!=null&&n!==void 0?u!==void 0&&(u>=n&&u=t?s="down":s="normal",a=typeof t=="number"&&t-1===u&&o==="inside"):t===null&&n!==void 0?u!==void 0&&u>=n?s="up":s="normal":t!=null&&n===void 0?u!==void 0&&(u{let{getBlock:to,getBlockName:ye,getSettings:Lt}=M(ue(_));return{block:to(e),blockName:ye(e),allowRightClickOverrides:Lt().allowRightClickOverrides}},[e]),{canRename:Do}=Pm(Wt),rt=(0,gd.hasBlockSupport)(Wt,"__experimentalToolbar",!0),xt=`list-view-block-select-button__description-${(0,OT.useInstanceId)(DJ)}`,{expand:At,collapse:Pe,collapseAll:wt,BlockSettingsMenu:qo,listViewInstanceId:$t,expandedState:lr,setInsertedBlock:ln,treeGridElementRef:je,rootClientId:Eo}=md(),Ze=(0,NJ.__unstableUseShortcutEventMatch)();function Ve(){let ue=ie(),to=ue.includes(e),ye=to?ue[0]:e,Lt=Q(ye);return{blocksToUpdate:to?ue:[e],firstBlockClientId:ye,firstBlockRootClientId:Lt,selectedBlockClientIds:ue}}async function gt(ue){if(ue.defaultPrevented||ue.target.closest("[role=dialog]"))return;let to=[AT.BACKSPACE,AT.DELETE].includes(ue.keyCode);if(Ze("core/block-editor/unselect",ue)&&g.length>0)ue.stopPropagation(),ue.preventDefault(),a(ue,void 0);else if(to||Ze("core/block-editor/remove",ue)){let{blocksToUpdate:ye,firstBlockClientId:Lt,firstBlockRootClientId:un,selectedBlockClientIds:_r}=Ve();if(!le(ye))return;let Wc=re(Lt)??un;j(ye,!1);let mO=_r.length>0&&ie().length===0;Wc||(Wc=Y()[0]),Ct(Wc,mO)}else if(Ze("core/block-editor/paste-styles",ue)){ue.preventDefault();let{blocksToUpdate:ye}=Ve(),Lt=H(ye);ze(Lt)}else if(Ze("core/block-editor/duplicate",ue)){ue.preventDefault();let{blocksToUpdate:ye,firstBlockRootClientId:Lt}=Ve();if(H(ye).every(_r=>!!_r&&(0,gd.hasBlockSupport)(_r.name,"multiple",!0)&&ce(_r.name,Lt))){let _r=await D(ye,!1);_r?.length&&Ct(_r[0],!1)}}else if(Ze("core/block-editor/insert-before",ue)){ue.preventDefault();let{blocksToUpdate:ye}=Ve();await W(ye[0]);let Lt=ie();Ct(Lt[0],!1)}else if(Ze("core/block-editor/insert-after",ue)){ue.preventDefault();let{blocksToUpdate:ye}=Ve();await z(ye.at(-1));let Lt=ie();Ct(Lt[0],!1)}else if(Ze("core/block-editor/select-all",ue)){ue.preventDefault();let{firstBlockRootClientId:ye,selectedBlockClientIds:Lt}=Ve(),un=Y(ye);if(!un.length)return;if((0,LJ.isShallowEqual)(Lt,un)&&ye&&ye!==Eo){Ct(ye,!0);return}U(un[0],un[un.length-1],null)}else if(Ze("core/block-editor/collapse-list-view",ue)){ue.preventDefault();let{firstBlockClientId:ye}=Ve(),Lt=J(ye,!1);wt(),At(Lt)}else if(Ze("core/block-editor/group",ue)){let{blocksToUpdate:ye}=Ve();if(ye.length>1&&ve(ye)){ue.preventDefault();let Lt=H(ye),un=he(),_r=(0,gd.switchToBlockType)(Lt,un);G(ye,_r),(0,MJ.speak)((0,s3.__)("Selected blocks are grouped."));let Wc=ie();Ct(Wc[0],!1)}}else if(Ze("core/block-editor/toggle-block-visibility",ue)){ue.preventDefault();let{blocksToUpdate:ye}=Ve();if(!H(ye).every(_r=>(0,gd.hasBlockSupport)(_r.name,"visibility",!0))||ye.some(_r=>K(_r)!=="default"))return;ee(ye)}else if(Ze("core/block-editor/rename",ue)){let{blocksToUpdate:ye}=Ve(),Lt=K(ye[0])==="contentOnly";ye.length===1&&Do&&!Lt&&(ue.preventDefault(),P(!0))}}let To=(0,ko.useCallback)(()=>{x(!0),se(e,!0)},[e,x,se]),cr=(0,ko.useCallback)(()=>{x(!1),se(e,!1)},[e,x,se]),ge=(0,ko.useCallback)(ue=>{a(ue,e),ue.preventDefault()},[e,a]),Ct=(0,ko.useCallback)((ue,to)=>{to&&a(void 0,ue,null,null),$g(ue,je?.current)},[a,je]),Io=(0,ko.useCallback)(ue=>{ue.preventDefault(),ue.stopPropagation(),p===!0?Pe(e):p===!1&&At(e)},[e,At,Pe,p]),Ke=(0,ko.useCallback)(ue=>{let{ownerDocument:to}=y?.current||{};!to||!to.hasFocus()||rt&&fo&&(y.current?.click(),B(new window.DOMRect(ue.clientX,ue.clientY,0,0)),ue.preventDefault())},[fo,y,rt]),te=(0,ko.useCallback)(ue=>{fo&&ue.button===2&&ue.preventDefault()},[fo]),Le=(0,ko.useMemo)(()=>{let{ownerDocument:ue}=k?.current||{};if(!(!C||!ue))return{ownerDocument:ue,getBoundingClientRect(){return C}}},[C]),ct=(0,ko.useCallback)(()=>{B(void 0)},[B]);if(bJ({isSelected:i,rowItemRef:k,selectedClientIds:g}),!ot)return null;let Gc=IJ(c,f,u),ua=PJ(xe,E),Bp=by(ot?.attributes?.metadata?.blockVisibility),jk=f>0,hf=m&&jk,cn=V("block-editor-list-view-block__mover-cell",{"is-visible":S||i}),Ep=V("block-editor-list-view-block__menu-cell",{"is-visible":S||L}),Tp;hf?Tp=2:rt||(Tp=3);let s0=V({"is-selected":i,"is-first-selected":L,"is-last-selected":T,"is-branch-selected":s,"is-synced-branch":b,"is-dragging":r,"has-single-cell":!rt,"is-synced":xe?.isSynced,"is-draggable":ne,"is-displacement-normal":t==="normal","is-displacement-up":t==="up","is-displacement-down":t==="down","is-after-dragged-blocks":o,"is-nesting":n}),a0=g.includes(e)?g:[e],Uk=i&&g.length===1;return(0,er.jsxs)(pJ,{className:s0,isDragged:r,onKeyDown:gt,onMouseEnter:To,onMouseLeave:cr,onFocus:To,onBlur:cr,level:u,position:c,rowCount:d,path:h,id:`list-view-${$t}-block-${e}`,"data-block":e,"data-expanded":X?p:void 0,ref:k,children:[(0,er.jsx)(Nm.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:Tp,ref:v,"aria-selected":!!i,children:({ref:ue,tabIndex:to,onFocus:ye})=>(0,er.jsxs)("div",{className:"block-editor-list-view-block__contents-container",children:[(0,er.jsx)(EJ,{block:ot,onClick:ge,onContextMenu:Ke,onMouseDown:te,onToggleExpanded:Io,isSelected:i,position:c,siblingBlockCount:f,level:u,ref:ue,tabIndex:Uk?0:to,onFocus:ye,isExpanded:X?p:void 0,selectedClientIds:g,ariaDescribedBy:xt}),(0,er.jsx)(TT,{id:xt,children:[Gc,ua,Bp].filter(Boolean).join(" ")})]})}),hf&&(0,er.jsx)(er.Fragment,{children:(0,er.jsxs)(Nm.__experimentalTreeGridCell,{className:cn,withoutGridItem:!0,children:[(0,er.jsx)(Nm.__experimentalTreeGridItem,{children:({ref:ue,tabIndex:to,onFocus:ye})=>(0,er.jsx)(gE,{orientation:"vertical",clientIds:[e],ref:ue,tabIndex:to,onFocus:ye})}),(0,er.jsx)(Nm.__experimentalTreeGridItem,{children:({ref:ue,tabIndex:to,onFocus:ye})=>(0,er.jsx)(bE,{orientation:"vertical",clientIds:[e],ref:ue,tabIndex:to,onFocus:ye})})]})}),rt&&qo&&(0,er.jsx)(Nm.__experimentalTreeGridCell,{className:Ep,"aria-selected":!!i,ref:y,children:({ref:ue,tabIndex:to,onFocus:ye})=>(0,er.jsx)(qo,{clientIds:a0,block:ot,icon:ks,label:(0,s3.__)("Options"),popoverProps:{anchor:Le},toggleProps:{ref:ue,className:"block-editor-list-view-block__menu",tabIndex:to,onClick:ct,onFocus:ye,size:"small"},disableOpenOnArrowDown:!0,expand:At,expandedState:lr,setInsertedBlock:ln,__experimentalSelectBlock:Ct})}),I&&(0,er.jsx)(Tm,{clientId:e,onClose:()=>P(!1)})]})}var VJ=(0,ko.memo)(DJ);var ni=l(w(),1);function FJ(e,t,o,r){return o?.includes(e.clientId)?0:t[e.clientId]??r?1+e.innerBlocks.reduce(EBe(t,o,r),0):1}var EBe=(e,t,o)=>(r,n)=>t?.includes(n.clientId)?r:(e[n.clientId]??o)&&n.innerBlocks.length>0?r+FJ(n,e,t,o):r+1,TBe=()=>{};function zJ(e){let{blocks:t,selectBlock:o=TBe,showBlockMovers:r,selectedClientIds:n,level:i=1,path:s="",isBranchSelected:a=!1,listPosition:c=0,fixedListWindow:u,isExpanded:d,parentId:f,shouldShowInnerBlocks:m=!0,isSyncedBranch:h=!1,showAppender:p=!0}=e,g=Tt(f),b=h||!!g?.isSynced,v=(0,MT.useSelect)(O=>f?O(_).canEditBlock(f):!0,[f]),{blockDropPosition:k,blockDropTargetIndex:y,firstDraggedBlockIndex:S,blockIndexes:x,expandedState:C,draggedClientIds:B}=md(),I=(0,NT.useRef)();if(!v)return null;let P=p&&i===1,E=t.filter(Boolean),L=E.length,T=P?L+1:L;return I.current=c,(0,ni.jsxs)(ni.Fragment,{children:[E.map((O,D)=>{let{clientId:U,innerBlocks:G}=O;D>0&&(I.current+=FJ(E[D-1],C,B,d));let j=!!B?.includes(U),{displacement:z,isAfterDraggedBlocks:W,isNesting:ee}=AJ({blockIndexes:x,blockDropTargetIndex:y,blockDropPosition:k,clientId:U,firstDraggedBlockIndex:S,isDragged:j}),{itemInView:se}=u,ce=se(I.current),ie=D+1,re=s.length>0?`${s}_${ie}`:`${ie}`,Q=!!G?.length,Y=Q&&m?C[U]??d:void 0,J=RJ(U,n),K=a||J&&Q,H=j||ce||J&&U===n[0]||D===0||D===L-1;return(0,ni.jsxs)(MT.AsyncModeProvider,{value:!J,children:[H&&(0,ni.jsx)(VJ,{block:O,selectBlock:o,isSelected:J,isBranchSelected:K,isDragged:j,level:i,position:ie,rowCount:T,siblingBlockCount:L,showBlockMovers:r,path:re,isExpanded:j?!1:Y,listPosition:I.current,selectedClientIds:n,isSyncedBranch:b,displacement:z,isAfterDraggedBlocks:W,isNesting:ee}),!H&&(0,ni.jsx)("tr",{children:(0,ni.jsx)("td",{className:"block-editor-list-view-placeholder"})}),Q&&Y&&!j&&(0,ni.jsx)(zJ,{parentId:U,blocks:G,selectBlock:o,showBlockMovers:r,level:i+1,path:re,listPosition:I.current+1,fixedListWindow:u,isBranchSelected:K,selectedClientIds:n,isExpanded:d,isSyncedBranch:b})]},U)}),P&&(0,ni.jsx)(LT.__experimentalTreeGridRow,{level:i,setSize:T,positionInSet:T,isExpanded:!0,children:(0,ni.jsx)(LT.__experimentalTreeGridCell,{children:O=>(0,ni.jsx)(n3,{clientId:f,nestingLevel:i,blockCount:L,...O})})})]})}var jJ=(0,NT.memo)(zJ);var Yg=l(A(),1),DT=l(Fe(),1),sc=l(R(),1),a3=l(N(),1);var Xi=l(w(),1);function UJ({draggedBlockClientId:e,listViewRef:t,blockDropTarget:o}){let r=Tt(e),n=zr({clientId:e,context:"list-view"}),{rootClientId:i,clientId:s,dropPosition:a}=o||{},[c,u]=(0,sc.useMemo)(()=>{if(!t.current)return[];let k=i?t.current.querySelector(`[data-block="${i}"]`):void 0,y=s?t.current.querySelector(`[data-block="${s}"]`):void 0;return[k,y]},[t,i,s]),d=u||c,f=(0,a3.isRTL)(),m=(0,sc.useCallback)((k,y)=>{if(!d)return 0;let S=d.offsetWidth,x=(0,DT.getScrollContainer)(d,"horizontal"),C=d.ownerDocument,B=x===C.body||x===C.documentElement;if(x&&!B){let I=x.getBoundingClientRect(),P=(0,a3.isRTL)()?I.right-k.right:k.left-I.left,E=x.clientWidth;if(EI.right)return S-=k.right-I.right,S}return S-y},[f,d]),h=(0,sc.useMemo)(()=>{if(!d)return{};let k=d.getBoundingClientRect();return{width:m(k,0)}},[m,d]),p=(0,sc.useMemo)(()=>{if(!d)return{};let k=(0,DT.getScrollContainer)(d),y=d.ownerDocument,S=k===y.body||k===y.documentElement;if(k&&!S){let x=k.getBoundingClientRect(),C=d.getBoundingClientRect(),B=f?x.right-C.right:C.left-x.left;if(!f&&x.left>C.left)return{transform:`translateX( ${B}px )`};if(f&&x.right{if(!c)return 1;let k=parseInt(c.getAttribute("aria-level"),10);return k?k+1:1},[c]),b=(0,sc.useMemo)(()=>d?d.classList.contains("is-branch-selected"):!1,[d]),v=(0,sc.useMemo)(()=>{if(!(!d||!(a==="top"||a==="bottom"||a==="inside")))return{contextElement:d,getBoundingClientRect(){let y=d.getBoundingClientRect(),S=y.left,x=0,C=(0,DT.getScrollContainer)(d,"horizontal"),B=d.ownerDocument,I=C===B.body||C===B.documentElement;if(C&&!I){let L=C.getBoundingClientRect(),T=f?C.offsetWidth-C.clientWidth:0;S{}}),(0,Xi.jsx)(Ae,{icon:r?.icon,showColors:!0,context:"list-view"}),(0,Xi.jsx)(Yg.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1,children:(0,Xi.jsx)("span",{className:"block-editor-list-view-block-select-button__title",children:(0,Xi.jsx)(Yg.__experimentalTruncate,{ellipsizeMode:"auto",children:n})})})]}),(0,Xi.jsx)("div",{className:"block-editor-list-view-block__menu-cell"})]})})}):null}var HJ=l(Xo(),1),qg=l(N(),1),AS=l(F(),1),GJ=l(R(),1),ii=l(it(),1),WJ=l($(),1);function $J(){let{clearSelectedBlock:e,multiSelect:t,selectBlock:o}=(0,AS.useDispatch)(_),{getBlockName:r,getBlockParents:n,getBlockSelectionStart:i,getSelectedBlockClientIds:s,hasMultiSelection:a,hasSelectedBlock:c}=(0,AS.useSelect)(_),{getBlockType:u}=(0,AS.useSelect)(WJ.store);return{updateBlockSelection:(0,GJ.useCallback)(async(f,m,h,p)=>{if(!f?.shiftKey&&f?.keyCode!==ii.ESCAPE){o(m,p);return}f.preventDefault();let g=f.type==="keydown"&&f.keyCode===ii.ESCAPE,b=f.type==="keydown"&&(f.keyCode===ii.UP||f.keyCode===ii.DOWN||f.keyCode===ii.HOME||f.keyCode===ii.END);if(!b&&!c()&&!a()){o(m,null);return}let v=s(),k=[...n(m),m];if((g||b&&!v.some(C=>k.includes(C)))&&await e(),!g){let C=i(),B=m;b&&(!c()&&!a()&&(C=m),h&&(B=h));let I=n(C),P=n(B),{start:E,end:L}=OJ(C,B,I,P);await t(E,L,null)}let y=s();if((f.keyCode===ii.HOME||f.keyCode===ii.END)&&y.length>1)return;let S=v.filter(C=>!y.includes(C)),x;if(S.length===1){let C=u(r(S[0]))?.title;C&&(x=(0,qg.sprintf)((0,qg.__)("%s deselected."),C))}else S.length>1&&(x=(0,qg.sprintf)((0,qg.__)("%s blocks deselected."),S.length));x&&(0,HJ.speak)(x,"assertive")},[e,r,u,n,i,s,a,c,t,o])}}var KJ=l(R(),1);function YJ(e){return(0,KJ.useMemo)(()=>{let o={},r=0,n=i=>{i.forEach(s=>{o[s.clientId]=r,r++,s.innerBlocks.length>0&&n(s.innerBlocks)})};return n(e),o},[e])}var qJ=l(F(),1);function ZJ({blocks:e,rootClientId:t}){return(0,qJ.useSelect)(o=>{let{getDraggedBlockClientIds:r,getSelectedBlockClientIds:n,getEnabledClientIdsTree:i}=M(o(_));return{selectedClientIds:n(),draggedClientIds:r(),clientIdsTree:e??i(t)}},[e,t])}var XJ=l(R(),1),QJ=l(F(),1);function JJ({collapseAll:e,expand:t}){let{expandedBlock:o,getBlockParents:r}=(0,QJ.useSelect)(n=>{let{getBlockParents:i,getExpandedBlock:s}=M(n(_));return{expandedBlock:s(),getBlockParents:i}},[]);(0,XJ.useEffect)(()=>{if(o){let n=r(o,!1);e(),t(n)}},[e,t,o,r])}var eee=l(F(),1),Mm=l(R(),1),Dm=l(Z(),1),tee=l(N(),1);var ac=24;function IBe(e,t,o=1,r=!1){let n=r?t.right-o*ac:t.left+o*ac;return r?e.x>n:e.xn.clientId===r.rootClientId);return o}function oee(e,t){let o=e[t+1];return o&&o.isDraggedBlock?oee(e,t+1):o}function OBe(e,t,o=1,r=!1){let n=r?t.right-o*ac:t.left+o*ac;return(r?e.xn+ac)&&e.y0&&n.isExpanded||OBe(t,s,c.length,o))){let f=n.isExpanded?0:n.innerBlockCount||0;return{rootClientId:n.clientId,clientId:n.clientId,blockIndex:f,dropPosition:"inside"}}if(u&&n.rootClientId&&IBe(t,s,c.length,o)){let f=oee(e,a),m=n.nestingLevel,h=f?f.nestingLevel:1;if(m&&h){let p=PBe(t,s,c.length,o),g=Math.max(Math.min(p,m-h),0);if(c[g]){let b=n.blockIndex;if(c[g].nestingLevel===f?.nestingLevel)b=f?.blockIndex;else for(let v=a;v>=0;v--){let k=e[v];if(k.rootClientId===c[g].rootClientId){b=k.blockIndex+1;break}}return{rootClientId:c[g].rootClientId,clientId:n.clientId,blockIndex:b,dropPosition:r}}}}if(!n.canInsertDraggedBlocksAsSibling)return;let d=u?1:0;return{rootClientId:n.rootClientId,clientId:n.clientId,blockIndex:n.blockIndex+d,dropPosition:r}}var NBe={leading:!1,trailing:!0};function ree({dropZoneElement:e,expandedState:t,setExpandedState:o}){let{getBlockRootClientId:r,getBlockIndex:n,getBlockCount:i,getDraggedBlockClientIds:s,canInsertBlocks:a}=(0,eee.useSelect)(_),[c,u]=(0,Mm.useState)(),{rootClientId:d,blockIndex:f}=c||{},m=HB(d,f),h=(0,tee.isRTL)(),p=(0,Dm.usePrevious)(d),g=(0,Mm.useCallback)((S,x)=>{let{rootClientId:C}=x||{};C&&x?.dropPosition==="inside"&&!S[C]&&o({type:"expand",clientIds:[C]})},[o]),b=(0,Dm.useThrottle)(g,500,NBe);(0,Mm.useEffect)(()=>{if(c?.dropPosition!=="inside"||p!==c?.rootClientId){b.cancel();return}b(t,c)},[t,p,c,b]);let v=s(),k=(0,Dm.useThrottle)((0,Mm.useCallback)((S,x)=>{let C={x:S.clientX,y:S.clientY},B=!!v?.length,P=Array.from(x.querySelectorAll("[data-block]")).map(L=>{let T=L.dataset.block,O=L.dataset.expanded==="true",D=L.classList.contains("is-dragging"),U=parseInt(L.getAttribute("aria-level"),10),G=r(T);return{clientId:T,isExpanded:O,rootClientId:G,blockIndex:n(T),element:L,nestingLevel:U||void 0,isDraggedBlock:B?D:!1,innerBlockCount:i(T),canInsertDraggedBlocksAsSibling:B?a(v,G):!0,canInsertDraggedBlocksAsChild:B?a(v,T):!0}}),E=LBe(P,C,h);E&&u(E)},[a,v,i,n,r,h]),50);return{ref:(0,Dm.__experimentalUseDropZone)({dropZoneElement:e,onDrop(S){k.cancel(),c&&m(S),u(void 0)},onDragLeave(){k.cancel(),u(null)},onDragOver(S){k(S,S.currentTarget)},onDragEnd(){k.cancel(),u(void 0)}}),target:c}}var VT=l(R(),1),nee=l(F(),1);function iee({firstSelectedBlockClientId:e,setExpandedState:t}){let[o,r]=(0,VT.useState)(null),{selectedBlockParentClientIds:n}=(0,nee.useSelect)(i=>{let{getBlockParents:s}=i(_);return{selectedBlockParentClientIds:s(e,!1)}},[e]);return(0,VT.useEffect)(()=>{o!==e&&n?.length&&t({type:"expand",clientIds:n})},[e,n,o,t]),{setSelectedTreeId:r}}var Zg=l(F(),1),see=l(Z(),1);function aee({selectBlock:e}){let t=(0,Zg.useRegistry)(),{getBlockOrder:o,getBlockRootClientId:r,getBlocksByClientId:n,getPreviousBlockClientId:i,getSelectedBlockClientIds:s,getSettings:a,canInsertBlockType:c,canRemoveBlocks:u}=(0,Zg.useSelect)(_),{flashBlock:d,removeBlocks:f,replaceBlocks:m,insertBlocks:h}=(0,Zg.useDispatch)(_),p=Oh();return(0,see.useRefEffect)(g=>{function b(y,S){S&&e(void 0,y,null,null),$g(y,g)}function v(y){let S=s(),x=S.includes(y),C=x?S[0]:y,B=r(C);return{blocksToUpdate:x?S:[y],firstBlockClientId:C,firstBlockRootClientId:B,originallySelectedBlockClientIds:S}}function k(y){if(y.defaultPrevented||!g.contains(y.target.ownerDocument.activeElement))return;let x=y.target.ownerDocument.activeElement?.closest("[role=row]")?.dataset?.block;if(!x)return;let{blocksToUpdate:C,firstBlockClientId:B,firstBlockRootClientId:I,originallySelectedBlockClientIds:P}=v(x);if(C.length!==0){if(y.preventDefault(),y.type==="copy"||y.type==="cut"){C.length===1&&d(C[0]),p(y.type,C);let E=n(C);C1(y,E,t)}if(y.type==="cut"){if(!u(C))return;let E=i(B)??I;f(C,!1);let L=P.length>0&&s().length===0;E||(E=o()[0]),b(E,L)}else if(y.type==="paste"){let{__experimentalCanUserUseUnfilteredHTML:E}=a(),L=vG(y,E);if(C.length===1){let[T]=C;if(L.every(O=>c(O.name,T))){h(L,void 0,T),b(L[0]?.clientId,!1);return}}m(C,L,L.length-1,-1),b(L[0]?.clientId,!1)}}}return g.ownerDocument.addEventListener("copy",k),g.ownerDocument.addEventListener("cut",k),g.ownerDocument.addEventListener("paste",k),()=>{g.ownerDocument.removeEventListener("copy",k),g.ownerDocument.removeEventListener("cut",k),g.ownerDocument.removeEventListener("paste",k)}},[])}var lc=l(w(),1),MBe=(e,t)=>t.type==="clear"?{}:Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce((o,r)=>({...o,[r]:t.type==="expand"}),{})}:e,lee=32;function uee({id:e,blocks:t,dropZoneElement:o,showBlockMovers:r=!1,isExpanded:n=!1,showAppender:i=!1,blockSettingsMenu:s=IV,rootClientId:a,description:c,onSelect:u,additionalBlockContent:d},f){t&&(0,cee.default)("`blocks` property in `wp.blockEditor.__experimentalListView`",{since:"6.3",alternative:"`rootClientId` property"});let m=(0,Xg.useInstanceId)(uee),{clientIdsTree:h,draggedClientIds:p,selectedClientIds:g}=ZJ({blocks:t,rootClientId:a}),b=YJ(h),{getBlock:v,getSelectedBlockClientIds:k}=(0,LS.useSelect)(_),{visibleBlockCount:y}=(0,LS.useSelect)(X=>{let{getGlobalBlockCount:ne,getClientIdsOfDescendants:le}=X(_),ve=p?.length>0?le(p).length+1:0;return{visibleBlockCount:ne()-ve}},[p]),{updateBlockSelection:S}=$J(),[x,C]=(0,vo.useReducer)(MBe,{}),[B,I]=(0,vo.useState)(null),{setSelectedTreeId:P}=iee({firstSelectedBlockClientId:g[0],setExpandedState:C}),E=(0,vo.useCallback)((X,ne,le)=>{S(X,ne,null,le),P(ne),u&&u(v(ne))},[P,S,u,v]),{ref:L,target:T}=ree({dropZoneElement:o,expandedState:x,setExpandedState:C}),O=(0,vo.useRef)(),D=aee({selectBlock:E}),U=(0,vo.useCallback)(X=>{let[ne]=k();ne&&X&&$g(ne,X)},[k]),G=(0,Xg.useMergeRefs)([D,U,O,L,f]),j=(0,vo.useCallback)(X=>{if(!X)return;let ne=Array.isArray(X)?X:[X];C({type:"expand",clientIds:ne})},[C]),z=(0,vo.useCallback)(X=>{X&&C({type:"collapse",clientIds:[X]})},[C]),W=(0,vo.useCallback)(()=>{C({type:"clear"})},[C]),ee=(0,vo.useCallback)(X=>{j(X?.dataset?.block)},[j]),se=(0,vo.useCallback)(X=>{z(X?.dataset?.block)},[z]),ce=(0,vo.useCallback)((X,ne,le)=>{X.shiftKey&&S(X,ne?.dataset?.block,le?.dataset?.block)},[S]);JJ({collapseAll:W,expand:j});let ie=p?.[0],{blockDropTargetIndex:re,blockDropPosition:Q,firstDraggedBlockIndex:Y}=(0,vo.useMemo)(()=>{let X,ne;if(T?.clientId){let le=b[T.clientId];X=le===void 0||T?.dropPosition==="top"?le:le+1}else T===null&&(X=null);if(ie){let le=b[ie];ne=le===void 0||T?.dropPosition==="top"?le:le+1}return{blockDropTargetIndex:X,blockDropPosition:T?.dropPosition,firstDraggedBlockIndex:ne}},[T,b,ie]),J=(0,vo.useMemo)(()=>({blockDropPosition:Q,blockDropTargetIndex:re,blockIndexes:b,draggedClientIds:p,expandedState:x,expand:j,firstDraggedBlockIndex:Y,collapse:z,collapseAll:W,BlockSettingsMenu:s,listViewInstanceId:m,AdditionalBlockContent:d,insertedBlock:B,setInsertedBlock:I,treeGridElementRef:O,rootClientId:a}),[Q,re,b,p,x,j,Y,z,W,s,m,d,B,I,a]),[K]=(0,Xg.__experimentalUseFixedWindowList)(O,lee,y,{expandedState:x,useWindowing:!0,windowOverscan:40});if(!h.length&&!i)return null;let H=c&&`block-editor-list-view-description-${m}`;return(0,lc.jsxs)(LS.AsyncModeProvider,{value:!0,children:[(0,lc.jsx)(UJ,{draggedBlockClientId:ie,listViewRef:O,blockDropTarget:T}),c&&(0,lc.jsx)(FT.VisuallyHidden,{id:H,children:c}),(0,lc.jsx)(FT.__experimentalTreeGrid,{id:e,className:V("block-editor-list-view-tree",{"is-dragging":p?.length>0&&re!==void 0}),"aria-label":(0,l3.__)("Block navigation structure"),ref:G,onCollapseRow:se,onExpandRow:ee,onFocusRow:ce,applicationAriaLabel:(0,l3.__)("Block navigation structure"),"aria-describedby":H,style:{"--wp-admin--list-view-dragged-items-height":p?.length?`${lee*(p.length-1)}px`:null},children:(0,lc.jsx)(BT.Provider,{value:J,children:(0,lc.jsx)(jJ,{blocks:h,parentId:a,selectBlock:E,showBlockMovers:r,fixedListWindow:K,selectedClientIds:g,isExpanded:n,showAppender:i})})})]})}var NS=(0,vo.forwardRef)(uee),zT=(0,vo.forwardRef)((e,t)=>(0,lc.jsx)(NS,{ref:t,...e,showAppender:!1,rootClientId:null,onSelect:null,additionalBlockContent:null,blockSettingsMenu:void 0}));var bd=l(w(),1);function DBe({isEnabled:e,onToggle:t,isOpen:o,innerRef:r,...n}){return(0,bd.jsx)(jT.Button,{__next40pxDefaultSize:!0,...n,ref:r,icon:sv,"aria-expanded":o,"aria-haspopup":"true",onClick:e?t:void 0,label:(0,c3.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!e})}function VBe({isDisabled:e,...t},o){(0,dee.default)("wp.blockEditor.BlockNavigationDropdown",{since:"6.1",alternative:"wp.components.Dropdown and wp.blockEditor.ListView"});let n=(0,fee.useSelect)(i=>!!i(_).getBlockCount(),[])&&!e;return(0,bd.jsx)(jT.Dropdown,{contentClassName:"block-editor-block-navigation__popover",popoverProps:{placement:"bottom-start"},renderToggle:({isOpen:i,onToggle:s})=>(0,bd.jsx)(DBe,{...t,innerRef:o,isOpen:i,onToggle:s,isEnabled:n}),renderContent:()=>(0,bd.jsxs)("div",{className:"block-editor-block-navigation__container",children:[(0,bd.jsx)("p",{className:"block-editor-block-navigation__label",children:(0,c3.__)("List view")}),(0,bd.jsx)(zT,{})]})})}var pee=(0,mee.forwardRef)(VBe);var vee=l(R(),1),yee=l(F(),1),UT=l(Z(),1),Da=l(A(),1),u3=l(N(),1);var hee=l(R(),1);var gee=l(w(),1);function bee({genericPreviewBlock:e,style:t,className:o,activeStyle:r}){let n=Tg(o,r,t),i=(0,hee.useMemo)(()=>({name:e.name,title:t.label||t.name,description:t.description,initialAttributes:{...e.attributes,className:n+" block-editor-block-styles__block-preview-container"},example:e}),[e,t,n]);return(0,gee.jsx)(X1,{item:i})}var Gs=l(w(),1),kee=()=>{};function FBe({clientId:e,onSwitch:t=kee,onHoverClassName:o=kee}){let r=(0,yee.useSelect)(y=>y(_).canEditBlock(e),[e]),{onSelect:n,stylesToRender:i,activeStyle:s,genericPreviewBlock:a,className:c}=Ig({clientId:e,onSwitch:t}),[u,d]=(0,vee.useState)(null),f=(0,UT.useViewportMatch)("medium","<"),m=Ro();if(!r||!i||i.length===0)return null;let h=(0,UT.debounce)(d,250),p=y=>{n(y),o(null),d(null),h.cancel()},g=y=>{if(u===y){h.cancel();return}h(y),o(y?.name??null)},b=QE(i),v=()=>s?.name!==b?.name,k=()=>{p(b)};return(0,Gs.jsx)(Da.__experimentalToolsPanel,{label:(0,u3.__)("Styles"),resetAll:k,panelId:e,hasInnerWrapper:!0,dropdownMenuProps:m,children:(0,Gs.jsx)(Da.__experimentalToolsPanelItem,{hasValue:v,label:(0,u3.__)("Variation"),onDeselect:k,isShownByDefault:!0,panelId:e,children:(0,Gs.jsxs)("div",{className:"block-editor-block-styles",children:[(0,Gs.jsx)("div",{className:"block-editor-block-styles__variants",children:i.map(y=>{let S=y.label||y.name;return(0,Gs.jsx)(Da.Button,{__next40pxDefaultSize:!0,className:V("block-editor-block-styles__item",{"is-active":s.name===y.name}),variant:"secondary",label:S,onMouseEnter:()=>g(y),onFocus:()=>g(y),onMouseLeave:()=>g(null),onBlur:()=>g(null),onClick:()=>p(y),"aria-current":s.name===y.name,children:(0,Gs.jsx)(Da.__experimentalTruncate,{numberOfLines:1,className:"block-editor-block-styles__item-text",children:S})},y.name)})}),u&&!f&&(0,Gs.jsx)(Da.Popover,{placement:"left-start",offset:34,focusOnMount:!1,children:(0,Gs.jsx)("div",{className:"block-editor-block-styles__preview-panel",onMouseLeave:()=>g(null),children:(0,Gs.jsx)(bee,{activeStyle:s,className:c,genericPreviewBlock:a,style:u})})})]})})})}var Qg=FBe;var Cee=l(A(),1),Jg=l(N(),1);var _ee=l(A(),1),xee=l(w(),1),See={0:OL,1:jA,2:HA,3:WA,4:KA,5:qA,6:XA};function d3({level:e}){return See[e]?(0,xee.jsx)(_ee.Icon,{icon:See[e]}):null}var HT=l(w(),1),wee=[1,2,3,4,5,6],zBe={className:"block-library-heading-level-dropdown"};function Bee({options:e=wee,value:t,onChange:o}){let r=e.filter(n=>n===0||wee.includes(n)).sort((n,i)=>n-i);return(0,HT.jsx)(Cee.ToolbarDropdownMenu,{popoverProps:zBe,icon:(0,HT.jsx)(d3,{level:t}),label:(0,Jg.__)("Change level"),controls:r.map(n=>{let i=n===t;return{icon:(0,HT.jsx)(d3,{level:n}),title:n===0?(0,Jg.__)("Paragraph"):(0,Jg.sprintf)((0,Jg.__)("Heading %d"),n),isActive:i,onClick(){o(n)},role:"menuitemradio"}})})}var MS=l(N(),1),DS=l(A(),1);var cc=l(w(),1);function jBe({icon:e=yL,label:t=(0,MS.__)("Choose variation"),instructions:o=(0,MS.__)("Select a variation to start with:"),variations:r,onSelect:n,allowSkip:i}){let s=V("block-editor-block-variation-picker",{"has-many-variations":r.length>4});return(0,cc.jsxs)(DS.Placeholder,{icon:e,label:t,instructions:o,className:s,children:[(0,cc.jsx)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,MS.__)("Block variations"),children:r.map(a=>(0,cc.jsxs)("li",{children:[(0,cc.jsx)(DS.Button,{__next40pxDefaultSize:!0,variant:"tertiary",icon:a.icon&&a.icon.src?a.icon.src:a.icon,iconSize:48,onClick:()=>n(a),className:"block-editor-block-variation-picker__variation",label:a.description||a.title}),(0,cc.jsx)("span",{className:"block-editor-block-variation-picker__variation-label",children:a.title})]},a.name))}),i&&(0,cc.jsx)("div",{className:"block-editor-block-variation-picker__skip",children:(0,cc.jsx)(DS.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>n(),children:(0,MS.__)("Skip")})})]})}var Eee=jBe;var Ree=l(F(),1),Oee=l($(),1),tb=l(A(),1),f3=l(R(),1),m3=l(Z(),1),Aee=l(N(),1);var uc=l(N(),1),eb=l(A(),1);var kd={carousel:"carousel",grid:"grid"};var si=l(w(),1),UBe=({onBlockPatternSelect:e})=>(0,si.jsx)("div",{className:"block-editor-block-pattern-setup__actions",children:(0,si.jsx)(eb.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:e,children:(0,uc.__)("Choose")})}),HBe=({handlePrevious:e,handleNext:t,activeSlide:o,totalSlides:r})=>(0,si.jsxs)("div",{className:"block-editor-block-pattern-setup__navigation",children:[(0,si.jsx)(eb.Button,{size:"compact",icon:(0,uc.isRTL)()?Vo:Mr,label:(0,uc.__)("Previous pattern"),onClick:e,disabled:o===0,accessibleWhenDisabled:!0}),(0,si.jsx)(eb.Button,{size:"compact",icon:(0,uc.isRTL)()?Mr:Vo,label:(0,uc.__)("Next pattern"),onClick:t,disabled:o===r-1,accessibleWhenDisabled:!0})]}),GBe=({viewMode:e,setViewMode:t,handlePrevious:o,handleNext:r,activeSlide:n,totalSlides:i,onBlockPatternSelect:s})=>{let a=e===kd.carousel,c=(0,si.jsxs)("div",{className:"block-editor-block-pattern-setup__display-controls",children:[(0,si.jsx)(eb.Button,{size:"compact",icon:_v,label:(0,uc.__)("Carousel view"),onClick:()=>t(kd.carousel),isPressed:a}),(0,si.jsx)(eb.Button,{size:"compact",icon:rv,label:(0,uc.__)("Grid view"),onClick:()=>t(kd.grid),isPressed:e===kd.grid})]});return(0,si.jsxs)("div",{className:"block-editor-block-pattern-setup__toolbar",children:[a&&(0,si.jsx)(HBe,{handlePrevious:o,handleNext:r,activeSlide:n,totalSlides:i}),c,a&&(0,si.jsx)(UBe,{onBlockPatternSelect:s})]})},Tee=GBe;var Iee=l(F(),1);function WBe(e,t,o){return(0,Iee.useSelect)(r=>{let{getBlockRootClientId:n,getPatternsByBlockTypes:i,__experimentalGetAllowedPatterns:s}=r(_),a=n(e);return o?s(a).filter(o):i(t,a)},[e,t,o])}var Pee=WBe;var zt=l(w(),1),$Be=({viewMode:e,activeSlide:t,patterns:o,onBlockPatternSelect:r,showTitles:n})=>{let i="block-editor-block-pattern-setup__container";if(e===kd.carousel){let s=new Map([[t,"active-slide"],[t-1,"previous-slide"],[t+1,"next-slide"]]);return(0,zt.jsx)("div",{className:"block-editor-block-pattern-setup__carousel",children:(0,zt.jsx)("div",{className:i,children:(0,zt.jsx)("div",{className:"carousel-container",children:o.map((a,c)=>(0,zt.jsx)(Nee,{active:c===t,className:s.get(c)||"",pattern:a},a.name))})})})}return(0,zt.jsx)("div",{className:"block-editor-block-pattern-setup__grid",children:(0,zt.jsx)(tb.Composite,{role:"listbox",className:i,"aria-label":(0,Aee.__)("Patterns list"),children:o.map(s=>(0,zt.jsx)(Lee,{pattern:s,onSelect:r,showTitles:n},s.name))})})};function Lee({pattern:e,onSelect:t,showTitles:o}){let r="block-editor-block-pattern-setup-list",{blocks:n,description:i,viewportWidth:s=700}=e,a=(0,m3.useInstanceId)(Lee,`${r}__item-description`);return(0,zt.jsx)("div",{className:`${r}__list-item`,children:(0,zt.jsxs)(tb.Composite.Item,{render:(0,zt.jsx)("div",{"aria-describedby":i?a:void 0,"aria-label":e.title,className:`${r}__item`}),id:`${r}__pattern__${e.name}`,role:"option",onClick:()=>t(n),children:[(0,zt.jsx)(vn,{blocks:n,viewportWidth:s}),o&&(0,zt.jsx)("div",{className:`${r}__item-title`,children:e.title}),!!i&&(0,zt.jsx)(tb.VisuallyHidden,{id:a,children:i})]})})}function Nee({active:e,className:t,pattern:o,minHeight:r}){let{blocks:n,title:i,description:s}=o,a=(0,m3.useInstanceId)(Nee,"block-editor-block-pattern-setup-list__item-description");return(0,zt.jsxs)("div",{"aria-hidden":!e,role:"img",className:`pattern-slide ${t}`,"aria-label":i,"aria-describedby":s?a:void 0,children:[(0,zt.jsx)(vn,{blocks:n,minHeight:r}),!!s&&(0,zt.jsx)(tb.VisuallyHidden,{id:a,children:s})]})}var KBe=({clientId:e,blockName:t,filterPatternsFn:o,onBlockPatternSelect:r,initialViewMode:n=kd.carousel,showTitles:i=!1})=>{let[s,a]=(0,f3.useState)(n),[c,u]=(0,f3.useState)(0),{replaceBlock:d}=(0,Ree.useDispatch)(_),f=Pee(e,t,o);if(!f?.length)return null;let h=r||(p=>{let g=p.map(b=>(0,Oee.cloneBlock)(b));d(e,g)});return(0,zt.jsx)(zt.Fragment,{children:(0,zt.jsxs)("div",{className:`block-editor-block-pattern-setup view-mode-${s}`,children:[(0,zt.jsx)($Be,{viewMode:s,activeSlide:c,patterns:f,onBlockPatternSelect:h,showTitles:i}),(0,zt.jsx)(Tee,{viewMode:s,setViewMode:a,activeSlide:c,totalSlides:f.length,handleNext:()=>{u(p=>Math.min(p+1,f.length-1))},handlePrevious:()=>{u(p=>Math.max(p-1,0))},onBlockPatternSelect:()=>{h(f[c].blocks)}})]})})},Mee=KBe;var p3=l($(),1),dc=l(N(),1),Ws=l(A(),1),GT=l(F(),1),Dee=l(R(),1);var Ao=l(w(),1),{Menu:Vm}=M(Ws.privateApis);function YBe({className:e,onSelectVariation:t,selectedValue:o,variations:r}){return(0,Ao.jsxs)("fieldset",{className:e,children:[(0,Ao.jsx)(Ws.VisuallyHidden,{as:"legend",children:(0,dc.__)("Transform to variation")}),r.map(n=>(0,Ao.jsx)(Ws.Button,{__next40pxDefaultSize:!0,size:"compact",icon:(0,Ao.jsx)(Ae,{icon:n.icon,showColors:!0}),isPressed:o===n.name,label:o===n.name?n.title:(0,dc.sprintf)((0,dc.__)("Transform to %s"),n.title),onClick:()=>t(n.name),"aria-label":n.title,showTooltip:!0},n.name))]})}function qBe({className:e,onSelectVariation:t,selectedValue:o,variations:r}){return(0,Ao.jsx)("div",{className:e,children:(0,Ao.jsxs)(Vm,{children:[(0,Ao.jsx)(Vm.TriggerButton,{render:(0,Ao.jsx)(Ws.Button,{className:"block-editor-block-variation-transforms__button",__next40pxDefaultSize:!0,variant:"secondary",children:(0,dc.__)("Transform to variation")})}),(0,Ao.jsx)(Vm.Popover,{position:"bottom",children:(0,Ao.jsx)(Vm.Group,{children:r.map(n=>(0,Ao.jsxs)(Vm.RadioItem,{value:n.name,checked:o===n.name,onChange:()=>t(n.name),children:[(0,Ao.jsx)(Vm.ItemLabel,{children:n.title}),n.description&&(0,Ao.jsx)(Vm.ItemHelpText,{children:n.description})]},n.name))})})]})})}function ZBe({className:e,onSelectVariation:t,selectedValue:o,variations:r}){return(0,Ao.jsx)("div",{className:e,children:(0,Ao.jsx)(Ws.__experimentalToggleGroupControl,{label:(0,dc.__)("Transform to variation"),value:o,hideLabelFromVision:!0,onChange:t,__next40pxDefaultSize:!0,children:r.map(n=>(0,Ao.jsx)(Ws.__experimentalToggleGroupControlOptionIcon,{icon:(0,Ao.jsx)(Ae,{icon:n.icon,showColors:!0}),value:n.name,label:o===n.name?n.title:(0,dc.sprintf)((0,dc.__)("Transform to %s"),n.title)},n.name))})})}function XBe({blockClientId:e}){let{updateBlockAttributes:t}=(0,GT.useDispatch)(_),{activeBlockVariation:o,variations:r,canEdit:n,isContentOnly:i,isSection:s}=(0,GT.useSelect)(p=>{let{getActiveBlockVariation:g,getBlockVariations:b}=p(p3.store),{getBlockName:v,getBlockAttributes:k,getBlockEditingMode:y,isSectionBlock:S}=M(p(_)),{canEditBlock:x}=p(_),C=e&&v(e),{hasContentRoleAttribute:B}=M(p(p3.store)),I=B(C);return{activeBlockVariation:g(C,k(e),"transform"),variations:C&&b(C,"transform"),canEdit:x(e),isContentOnly:y(e)==="contentOnly"&&!I,isSection:S(e)}},[e]),a=o?.name,c=(0,Dee.useMemo)(()=>{let p=new Set;return r?(r.forEach(g=>{g.icon&&p.add(g.icon?.src||g.icon)}),p.size===r.length):!1},[r]),u=p=>{t(e,{...r.find(({name:g})=>g===p).attributes})};if(!r?.length||!n||i||s)return null;let d="block-editor-block-variation-transforms",m=r.length>6?YBe:ZBe;return(0,Ao.jsx)(c?m:qBe,{className:d,onSelectVariation:u,selectedValue:a,variations:r})}var WT=XBe;var Fm=l(N(),1),$T=l(A(),1);var Vee=l(w(),1),h3={top:{icon:bL,title:(0,Fm._x)("Align top","Block vertical alignment setting")},center:{icon:sL,title:(0,Fm._x)("Align middle","Block vertical alignment setting")},bottom:{icon:nL,title:(0,Fm._x)("Align bottom","Block vertical alignment setting")},stretch:{icon:pL,title:(0,Fm._x)("Stretch to fill","Block vertical alignment setting")},"space-between":{icon:dL,title:(0,Fm._x)("Space between","Block vertical alignment setting")}},QBe=["top","center","bottom"],JBe="top";function eEe({value:e,onChange:t,controls:o=QBe,isCollapsed:r=!0,isToolbar:n}){function i(d){return()=>t(e===d?void 0:d)}let s=h3[e],a=h3[JBe],c=n?$T.ToolbarGroup:$T.ToolbarDropdownMenu,u=n?{isCollapsed:r}:{};return(0,Vee.jsx)(c,{icon:s?s.icon:a.icon,label:(0,Fm._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map(d=>({...h3[d],isActive:e===d,role:r?"menuitemradio":void 0,onClick:i(d)})),...u})}var g3=eEe;var b3=l(w(),1),iC=e=>(0,b3.jsx)(g3,{...e,isToolbar:!1}),Fee=e=>(0,b3.jsx)(g3,{...e,isToolbar:!0});var Bn=l(A(),1),VS=l(R(),1),qT=l(N(),1);var zee=l(A(),1);var k3=l(N(),1),jee=l(w(),1);function Uee({isLinked:e,...t}){let o=e?(0,k3.__)("Unlink radii"):(0,k3.__)("Link radii");return(0,jee.jsx)(zee.Button,{...t,className:"components-border-radius-control__linked-button",size:"small",icon:e?fn:Ci,iconSize:24,label:o})}var Hee=l(A(),1);function tEe(e){return[...e].sort((o,r)=>e.filter(n=>n===r).length-e.filter(n=>n===o).length).shift()}function Gee(e={}){if(typeof e=="string")return e;let t=Object.values(e).map(a=>{let c=(0,Hee.__experimentalParseQuantityAndUnitFromRawValue)(a);return typeof a=="string"&&c[0]===void 0?[a,""]:c}),o=t.map(a=>a[0]??""),r=t.map(a=>a[1]),n=o.every(a=>a===o[0])?o[0]:"",i=tEe(r);return n===0||n?`${n}${i||""}`:void 0}function Wee(e={}){if(typeof e=="string"||!e||typeof e!="object")return!1;let t=Object.values(e);if(t.length===0)return!1;let o=t[0];return!t.every(n=>n===o)}function $ee(e){return e?typeof e=="string"?!0:!!Object.values(e).filter(o=>!!o||o===0).length:!1}var Qi=l(A(),1),Qee=l(Z(),1),yd=l(N(),1);var zm=l(R(),1);var v3=24,Kee=8,KT={px:{max:300,steps:1},"%":{max:100,steps:1},vw:{max:100,steps:1},vh:{max:100,steps:1},em:{max:10,steps:.1},rem:{max:10,steps:.1},svw:{max:100,steps:1},lvw:{max:100,steps:1},dvw:{max:100,steps:1},svh:{max:100,steps:1},lvh:{max:100,steps:1},dvh:{max:100,steps:1},vi:{max:100,steps:1},svi:{max:100,steps:1},lvi:{max:100,steps:1},dvi:{max:100,steps:1},vb:{max:100,steps:1},svb:{max:100,steps:1},lvb:{max:100,steps:1},dvb:{max:100,steps:1},vmin:{max:100,steps:1},svmin:{max:100,steps:1},lvmin:{max:100,steps:1},dvmin:{max:100,steps:1},vmax:{max:100,steps:1},svmax:{max:100,steps:1},lvmax:{max:100,steps:1},dvmax:{max:100,steps:1}};var vd=(e,t)=>e?.includes?e==="0"||e.includes(`var:preset|${t}|`):!1;function Yee(e,t){if(!e)return;if(e==="0"||e==="default")return e;let o=e.match(new RegExp(`var:preset\\|${t}\\|(.+)`));return o?o[1]:void 0}function qee(e,t,o){if(e===void 0)return 0;let r=parseFloat(e,10)===0?"0":Yee(e,o),n=t.findIndex(i=>String(i.slug)===r);return n!==-1?n:NaN}function y3(e,t,o){if(!vd(e,o))return e;let r=parseFloat(e,10)===0?"0":Yee(e,o);return t.find(i=>String(i.slug)===r)?.size}function Zee(e,t,o){if(!e||vd(e,o)||e==="0")return e;let r=t.find(n=>String(n.size)===String(e));return r?.slug?`var:preset|${o}|${r.slug}`:e}var ob=l(A(),1),fc=l(w(),1);function Xee({allowNegativeOnDrag:e,ariaLabel:t,allPlaceholder:o,minValue:r,parsedQuantity:n,computedUnit:i,units:s,isMixed:a,step:c,max:u,showTooltip:d,value:f,minimumCustomValue:m,onCustomValueChange:h,onCustomValueSliderChange:p,onUnitChange:g,onMouseOut:b,onMouseOver:v,setMinValue:k}){let y=(0,fc.jsx)(ob.__experimentalUnitControl,{className:"preset-input-control__unit-control",disableUnits:a,hideLabelFromVision:!0,label:t,min:r,onChange:h,onUnitChange:g,onBlur:b,onFocus:v,onMouseOut:b,onMouseOver:v,size:"__unstable-large",units:s,value:[n,i].join(""),placeholder:o,onDragStart:()=>{e&&f?.charAt(0)==="-"&&k(0)},onDrag:()=>{e&&f?.charAt(0)==="-"&&k(0)},onDragEnd:()=>{e&&k(m)}});return(0,fc.jsxs)(fc.Fragment,{children:[d?(0,fc.jsx)(ob.Tooltip,{text:t,placement:"top",children:(0,fc.jsx)("div",{className:"preset-input-control__tooltip-wrapper",children:y})}):y,(0,fc.jsx)(ob.RangeControl,{className:"preset-input-control__custom-value-range",hideLabelFromVision:!0,initialPosition:0,label:t,max:u,min:0,onBlur:b,onChange:p,onFocus:v,onMouseOut:b,onMouseOver:v,step:c,value:n,withInputField:!1,__next40pxDefaultSize:!0})]})}var Sd=l(w(),1);function jm({allowNegativeOnDrag:e=!1,ariaLabel:t,className:o,customValueSettings:r=KT,disableCustomValues:n,icon:i,isMixed:s,value:a,minimumCustomValue:c,onChange:u,onMouseOut:d,onMouseOver:f,onUnitChange:m,presets:h=[],presetType:p,selectedUnit:g,showTooltip:b,units:v}){let k=(0,zm.useMemo)(()=>Zee(a,h,p),[a,h,p]),y=o??"preset-input-control",S=h.slice(1,h.length-1).map((K,H)=>({value:H+1,label:void 0})),x=S.length>0,C=h.length<=Kee,B=s?(0,yd.__)("Mixed"):null,[I,P]=(0,zm.useState)(c),[E,L]=(0,zm.useState)(!n&&k!==void 0&&!vd(k,p)),T=null,O=(0,Qee.usePrevious)(k);(0,zm.useEffect)(()=>{k&&O!==k&&!vd(k,p)&&E!==!0&&L(!0)},[k,O,p,E]);let D=!C&&!E&&k!==void 0&&(!vd(k,p)||vd(k,p)&&s),U=h;D?(U=[...h,{name:s?(0,yd.__)("Mixed"):(0,yd.sprintf)((0,yd.__)("Custom (%s)"),k),slug:"custom",size:k}],T=U.length-1):s||(T=E?y3(k,h,p):qee(k,h,p));let G=U.map((K,H)=>({key:H,name:K.name})),j=vd(k,p)?y3(k,h,p):k,[z,W]=(0,Qi.__experimentalParseQuantityAndUnitFromRawValue)(j),ee=W||g||"px",se=v?.find(K=>K.value===ee),ce=se?.step??r[ee]?.steps??.1,ie=se?.max??r[ee]?.max??10,re=K=>{let X=!isNaN(parseFloat(K))?K:void 0;X!==void 0&&u(X)},Q=K=>{u([K,ee].join(""))},Y=K=>k===void 0?void 0:h[K]?.name,J=(K,H)=>{let X=parseInt(K,10);if(H==="selectList"){if(X===0&&h[0]?.slug==="0")return"0";if(X===0)return}else if(X===0)return"0";return`var:preset|${p}|${h[K]?.slug}`};return(0,Sd.jsxs)(Qi.__experimentalHStack,{className:`preset-input-control__wrapper ${y}__wrapper`,children:[i&&(0,Sd.jsx)(Qi.Icon,{className:"preset-input-control__icon",icon:i,size:v3}),(!x||E)&&(0,Sd.jsx)(Xee,{allowNegativeOnDrag:e,ariaLabel:t,allPlaceholder:B,minValue:I,parsedQuantity:z,computedUnit:ee,units:v,isMixed:s,step:ce,max:ie,showTooltip:b,value:k,minimumCustomValue:c,onCustomValueChange:re,onCustomValueSliderChange:Q,onUnitChange:m,onMouseOut:d,onMouseOver:f,setMinValue:P}),x&&C&&!E&&(0,Sd.jsx)(Qi.RangeControl,{"aria-valuenow":T,"aria-valuetext":h[T]?.name,className:"preset-input-control__preset-range",hideLabelFromVision:!0,initialPosition:0,label:t,max:h.length-1,marks:S,min:0,onBlur:d,onChange:K=>u(J(K)),onFocus:f,onMouseDown:K=>{K?.nativeEvent?.offsetX<35&&k===void 0&&u("0")},onMouseOut:d,onMouseOver:f,renderTooltipContent:Y,step:1,value:T,withInputField:!1,__next40pxDefaultSize:!0}),x&&!C&&!E&&(0,Sd.jsx)(Qi.CustomSelectControl,{className:"preset-input-control__custom-select-control",hideLabelFromVision:!0,label:t,onBlur:d,onChange:K=>{D&&K.selectedItem.key===G.length-1?L(!0):u(J(K.selectedItem.key,"selectList"))},onFocus:f,onMouseOut:d,onMouseOver:f,options:G,size:"__unstable-large",value:G.find(K=>K.key===T)||""}),x&&!n&&(0,Sd.jsx)(Qi.Button,{className:"preset-input-control__custom-toggle",icon:rN,iconSize:v3,isPressed:E,label:E?(0,yd.__)("Use preset"):(0,yd.__)("Set custom value"),onClick:()=>{L(!E)},size:"small"})]})}var rb=l(N(),1);var Jee=8,YT=[],S3={all:(0,rb.__)("Border radius"),topLeft:(0,rb.__)("Top left"),topRight:(0,rb.__)("Top right"),bottomLeft:(0,rb.__)("Bottom left"),bottomRight:(0,rb.__)("Bottom right")},_3={all:aA,topLeft:uA,topRight:dA,bottomLeft:lA,bottomRight:cA},x3=0;var mc=l(w(),1);function oEe(e){let t=e?.default??YT,o=e?.custom??YT,r=e?.theme??YT;return(0,VS.useMemo)(()=>{let n=[{name:(0,qT.__)("None"),slug:"0",size:0},...o,...r,...t];return n.length>Jee?[{name:(0,qT.__)("Default"),slug:"default",size:void 0},...n]:n},[o,r,t])}function ete(e,t){return t==="all"?Gee(e):typeof e=="string"?e:e?.[t]}function tte(e,t){return t==="all"?e.flat:e[t]}function ote(e,t,o){return r=>{o(e==="all"?{topLeft:r,topRight:r,bottomLeft:r,bottomRight:r}:{...typeof t!="string"?t||{}:{topLeft:t,topRight:t,bottomLeft:t,bottomRight:t},[e]:r})}}function rte(e,t,o){return r=>{let n={...t};e==="all"?(n.flat=r,n.topLeft=r,n.topRight=r,n.bottomLeft=r,n.bottomRight=r):n[e]=r,o(n)}}function ZT({onChange:e,values:t,presets:o}){let[r,n]=(0,VS.useState)(!$ee(t)||!Wee(t)),i=oEe(o),[s,a]=(0,VS.useState)({flat:typeof t=="string"?(0,Bn.__experimentalParseQuantityAndUnitFromRawValue)(t)[1]:void 0,topLeft:(0,Bn.__experimentalParseQuantityAndUnitFromRawValue)(t?.topLeft)[1],topRight:(0,Bn.__experimentalParseQuantityAndUnitFromRawValue)(t?.topRight)[1],bottomLeft:(0,Bn.__experimentalParseQuantityAndUnitFromRawValue)(t?.bottomLeft)[1],bottomRight:(0,Bn.__experimentalParseQuantityAndUnitFromRawValue)(t?.bottomRight)[1]}),[c]=me("spacing.units"),u=(0,Bn.__experimentalUseCustomUnits)({availableUnits:c||["px","em","rem"]}),d=()=>n(!r);return(0,mc.jsxs)("fieldset",{className:"components-border-radius-control",children:[(0,mc.jsxs)(Bn.__experimentalHStack,{className:"components-border-radius-control__header",children:[(0,mc.jsx)(Bn.BaseControl.VisualLabel,{as:"legend",children:(0,qT.__)("Radius")}),(0,mc.jsx)(Uee,{onClick:d,isLinked:r})]}),r?(0,mc.jsx)(jm,{ariaLabel:S3.all,className:"components-border-radius-control",icon:_3.all,minimumCustomValue:x3,onChange:ote("all",t,e),onUnitChange:rte("all",s,a),presets:i,presetType:"border-radius",selectedUnit:tte(s,"all"),showTooltip:!0,units:u,value:ete(t,"all")}):(0,mc.jsx)(Bn.__experimentalVStack,{children:["topLeft","topRight","bottomLeft","bottomRight"].map(f=>(0,mc.jsx)(jm,{ariaLabel:S3[f],className:"components-border-radius-control",icon:_3[f],minimumCustomValue:x3,onChange:ote(f,t,e),onUnitChange:rte(f,s,a),presets:i,presetType:"border-radius",selectedUnit:tte(s,f),showTooltip:!0,units:u,value:ete(t,f)},f))})]})}var ste=l(A(),1);var nte=l(Z(),1);var ite=l(w(),1),XT=(0,nte.createHigherOrderComponent)(e=>function(o){let[r,n,i,s,a]=me("color.palette.default","color.palette.theme","color.palette.custom","color.custom","color.defaultPalette"),c=a?[...n||[],...r||[],...i||[]]:[...n||[],...i||[]],{colors:u=c,disableCustomColors:d=!s}=o,f=u&&u.length>0||!d;return(0,ite.jsx)(e,{...o,colors:u,disableCustomColors:d,hasColorsToChoose:f})},"withColorContext");var ate=XT(ste.ColorPalette);var w3=l(N(),1),$s=l(A(),1);var yo=l(w(),1),{Tabs:nb}=M($s.privateApis),rEe=["colors","disableCustomColors","gradients","disableCustomGradients"],Va={color:"color",gradient:"gradient"};function lte({colors:e,gradients:t,disableCustomColors:o,disableCustomGradients:r,__experimentalIsRenderedInSidebar:n,className:i,label:s,onColorChange:a,onGradientChange:c,colorValue:u,gradientValue:d,clearable:f,showTitle:m=!0,enableAlpha:h,headingLevel:p}){let g=a&&(e&&e.length>0||!o),b=c&&(t&&t.length>0||!r);if(!g&&!b)return null;let v={[Va.color]:(0,yo.jsx)($s.ColorPalette,{value:u,onChange:b?y=>{a(y),c()}:a,colors:e,disableCustomColors:o,__experimentalIsRenderedInSidebar:n,clearable:f,enableAlpha:h,headingLevel:p}),[Va.gradient]:(0,yo.jsx)($s.GradientPicker,{value:d,onChange:g?y=>{c(y),a()}:c,gradients:t,disableCustomGradients:r,__experimentalIsRenderedInSidebar:n,clearable:f,headingLevel:p})},k=y=>(0,yo.jsx)("div",{className:"block-editor-color-gradient-control__panel",children:v[y]});return(0,yo.jsx)($s.BaseControl,{className:V("block-editor-color-gradient-control",i),children:(0,yo.jsx)("fieldset",{className:"block-editor-color-gradient-control__fieldset",children:(0,yo.jsxs)($s.__experimentalVStack,{spacing:1,children:[m&&(0,yo.jsx)("legend",{children:(0,yo.jsx)("div",{className:"block-editor-color-gradient-control__color-indicator",children:(0,yo.jsx)($s.BaseControl.VisualLabel,{children:s})})}),g&&b&&(0,yo.jsx)("div",{children:(0,yo.jsxs)(nb,{defaultTabId:d?Va.gradient:!!g&&Va.color,children:[(0,yo.jsxs)(nb.TabList,{children:[(0,yo.jsx)(nb.Tab,{tabId:Va.color,children:(0,w3.__)("Color")}),(0,yo.jsx)(nb.Tab,{tabId:Va.gradient,children:(0,w3.__)("Gradient")})]}),(0,yo.jsx)(nb.TabPanel,{tabId:Va.color,className:"block-editor-color-gradient-control__panel",focusable:!1,children:v.color}),(0,yo.jsx)(nb.TabPanel,{tabId:Va.gradient,className:"block-editor-color-gradient-control__panel",focusable:!1,children:v.gradient})]})}),!b&&k(Va.color),!g&&k(Va.gradient)]})})})}function nEe(e){let[t,o,r,n]=me("color.palette","color.gradients","color.custom","color.customGradient");return(0,yo.jsx)(lte,{colors:t,gradients:o,disableCustomColors:!r,disableCustomGradients:!n,...e})}function iEe(e){return rEe.every(t=>e.hasOwnProperty(t))?(0,yo.jsx)(lte,{...e}):(0,yo.jsx)(nEe,{...e})}var _d=iEe;var cte=l(w(),1);function ute({onChange:e,value:t,...o}){return(0,cte.jsx)(_d,{...o,onColorChange:e,colorValue:t,gradients:[],disableCustomGradients:!0})}var Ks=l(N(),1),dte=l(A(),1),fte=l(Xo(),1),C3=l(w(),1);Kc([Yc,Op]);function sEe({backgroundColor:e,fallbackBackgroundColor:t,fallbackTextColor:o,fallbackLinkColor:r,fontSize:n,isLargeText:i,textColor:s,linkColor:a,enableAlphaChecker:c=!1}){let u=e||t;if(!u)return null;let d=s||o,f=a||r;if(!d&&!f)return null;let m=[{color:d,description:(0,Ks.__)("text color")},{color:f,description:(0,Ks.__)("link color")}],h=Bt(u),p=h.alpha()<1,g=h.brightness(),b={level:"AA",size:i||i!==!1&&n>=24?"large":"small"},v="",k="";for(let y of m){if(!y.color)continue;let S=Bt(y.color),x=S.isReadable(h,b),C=S.alpha()<1;if(!x){if(p||C)continue;v=go(r?null:t)}),e&&(0,Fa.jsx)(aEe,{format:e,onChange:o})]})}function aEe({format:e,onChange:t}){let r=[...[...new Set(["Y-m-d",(0,br._x)("n/j/Y","short date format"),(0,br._x)("n/j/Y g:i A","short date format with time"),(0,br._x)("M j, Y","medium date format"),(0,br._x)("M j, Y g:i A","medium date format with time"),(0,br._x)("F j, Y","long date format"),(0,br._x)("M j","short date format without the year")])].map((a,c)=>({key:`suggested-${c}`,name:(0,FS.dateI18n)(a,xd),format:a})),{key:"human-diff",name:(0,FS.humanTimeDiff)(xd),format:"human-diff"}],n={key:"custom",name:(0,br.__)("Custom"),className:"block-editor-date-format-picker__custom-format-select-control__custom-option",hint:(0,br.__)("Enter your own date format")},[i,s]=(0,JT.useState)(()=>!!e&&!r.some(a=>a.format===e));return(0,Fa.jsxs)(ai.__experimentalVStack,{children:[(0,Fa.jsx)(ai.CustomSelectControl,{__next40pxDefaultSize:!0,label:(0,br.__)("Choose a format"),options:[...r,n],value:i?n:r.find(a=>a.format===e)??n,onChange:({selectedItem:a})=>{a===n?s(!0):(s(!1),t(a.format))}}),i&&(0,Fa.jsx)(ai.TextControl,{__next40pxDefaultSize:!0,label:(0,br.__)("Custom format"),hideLabelFromVision:!0,help:(0,JT.createInterpolateElement)((0,br.__)("Enter a date or timeformat string."),{Link:(0,Fa.jsx)(ai.ExternalLink,{href:(0,br.__)("https://wordpress.org/documentation/article/customize-date-and-time-format/")})}),value:e,onChange:a=>t(a)})]})}var Ji=l(A(),1),zS=l(N(),1),hte=l(it(),1);var gte=l(Z(),1),za=l(w(),1);function bte({id:e,colorPalette:t,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:n,value:i,onChange:s}){let a;i==="unset"?a=(0,za.jsx)(Ji.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}):i?a=(0,za.jsx)(Ji.DuotoneSwatch,{values:i}):a=(0,za.jsx)(we,{icon:xA});let c=(0,zS.__)("Apply duotone filter"),d=`${(0,gte.useInstanceId)(bte,"duotone-control",e)}__description`;return(0,za.jsx)(Ji.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,zS.__)("Duotone")},renderToggle:({isOpen:f,onToggle:m})=>(0,za.jsx)(Ji.ToolbarButton,{showTooltip:!0,onClick:m,"aria-haspopup":"true","aria-expanded":f,onKeyDown:p=>{!f&&p.keyCode===hte.DOWN&&(p.preventDefault(),m())},label:c,icon:a}),renderContent:()=>(0,za.jsxs)(Ji.MenuGroup,{label:(0,zS.__)("Duotone"),children:[(0,za.jsx)("p",{children:(0,zS.__)("Create a two-tone color effect without losing your original image.")}),(0,za.jsx)(Ji.DuotonePicker,{"aria-label":c,"aria-describedby":d,colorPalette:t,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:n,value:i,onChange:s})]})})}var eI=bte;var Ste=l(A(),1),_te=l(Re(),1),xte=l(R(),1),li=l(N(),1);var tr=l(N(),1);var tI=l(N(),1);function kte(e){if(!e)return{};if(typeof e=="object")return e;let t;switch(e){case"normal":t=(0,tI._x)("Regular","font style");break;case"italic":t=(0,tI._x)("Italic","font style");break;case"oblique":t=(0,tI._x)("Oblique","font style");break;default:t=e;break}return{name:t,value:e}}var Ys=l(N(),1);function B3(e){if(!e)return{};if(typeof e=="object")return e;let t;switch(e){case"normal":case"400":t=(0,Ys._x)("Regular","font weight");break;case"bold":case"700":t=(0,Ys._x)("Bold","font weight");break;case"100":t=(0,Ys._x)("Thin","font weight");break;case"200":t=(0,Ys._x)("Extra Light","font weight");break;case"300":t=(0,Ys._x)("Light","font weight");break;case"500":t=(0,Ys._x)("Medium","font weight");break;case"600":t=(0,Ys._x)("Semi Bold","font weight");break;case"800":t=(0,Ys._x)("Extra Bold","font weight");break;case"900":t=(0,Ys._x)("Black","font weight");break;case"1000":t=(0,Ys._x)("Extra Black","font weight");break;default:t=e;break}return{name:t,value:e}}var vte=[{name:(0,tr._x)("Regular","font style"),value:"normal"},{name:(0,tr._x)("Italic","font style"),value:"italic"}],yte=[{name:(0,tr._x)("Thin","font weight"),value:"100"},{name:(0,tr._x)("Extra Light","font weight"),value:"200"},{name:(0,tr._x)("Light","font weight"),value:"300"},{name:(0,tr._x)("Regular","font weight"),value:"400"},{name:(0,tr._x)("Medium","font weight"),value:"500"},{name:(0,tr._x)("Semi Bold","font weight"),value:"600"},{name:(0,tr._x)("Bold","font weight"),value:"700"},{name:(0,tr._x)("Extra Bold","font weight"),value:"800"},{name:(0,tr._x)("Black","font weight"),value:"900"},{name:(0,tr._x)("Extra Black","font weight"),value:"1000"}];function ib(e){let t=[],o=[],r=[],n=!e||e?.length===0,i=!1;return e?.forEach(s=>{if(typeof s.fontWeight=="string"&&/\s/.test(s.fontWeight.trim())){i=!0;let[u,d]=s.fontWeight.split(" ");u=parseInt(u.slice(0,1)),d==="1000"?d=10:d=parseInt(d.slice(0,1));for(let f=u;f<=d;f++){let m=`${f.toString()}00`;o.some(h=>h.value===m)||o.push(B3(m))}}let a=B3(typeof s.fontWeight=="number"?s.fontWeight.toString():s.fontWeight),c=kte(s.fontStyle);c&&Object.keys(c).length&&(t.some(u=>u.value===c.value)||t.push(c)),a&&Object.keys(a).length&&(o.some(u=>u.value===a.value)||i||o.push(a))}),o.some(s=>s.value>="600")||o.push({name:(0,tr._x)("Bold","font weight"),value:"700"}),t.some(s=>s.value==="italic")||t.push({name:(0,tr._x)("Italic","font style"),value:"italic"}),n&&(t=vte,o=yte),t=t.length===0?vte:t,o=o.length===0?yte:o,t.forEach(({name:s,value:a})=>{o.forEach(({name:c,value:u})=>{let d=a==="normal"?c:(0,tr.sprintf)((0,tr._x)("%1$s %2$s","font"),c,s);r.push({key:`${a}-${u}`,name:d,style:{fontStyle:a,fontWeight:u}})})}),{fontStyles:t,fontWeights:o,combinedStyleAndWeightOptions:r,isSystemFont:n,isVariableFont:i}}var wte=l(w(),1),lEe=(e,t)=>e?t?(0,li.__)("Appearance"):(0,li.__)("Font style"):(0,li.__)("Font weight");function oI(e){let{__next40pxDefaultSize:t=!1,onChange:o,hasFontStyles:r=!0,hasFontWeights:n=!0,fontFamilyFaces:i,value:{fontStyle:s,fontWeight:a},...c}=e,u=r||n,d=lEe(r,n),f={key:"default",name:(0,li.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},{fontStyles:m,fontWeights:h,combinedStyleAndWeightOptions:p}=ib(i),g=()=>{let x=[f];return p&&x.push(...p),x},b=()=>{let x=[f];return m.forEach(({name:C,value:B})=>{x.push({key:B,name:C,style:{fontStyle:B,fontWeight:void 0}})}),x},v=()=>{let x=[f];return h.forEach(({name:C,value:B})=>{x.push({key:B,name:C,style:{fontStyle:void 0,fontWeight:B}})}),x},k=(0,xte.useMemo)(()=>r&&n?g():r?b():v(),[e.options,m,h,p]),y=k.find(x=>x.style.fontStyle===s&&x.style.fontWeight===a)||k[0],S=()=>y?r?n?(0,li.sprintf)((0,li.__)("Currently selected font appearance: %s"),y.name):(0,li.sprintf)((0,li.__)("Currently selected font style: %s"),y.name):(0,li.sprintf)((0,li.__)("Currently selected font weight: %s"),y.name):(0,li.__)("No selected font appearance");return!t&&(c.size===void 0||c.size==="default")&&(0,_te.default)("36px default size for wp.blockEditor.__experimentalFontAppearanceControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."}),u&&(0,wte.jsx)(Ste.CustomSelectControl,{...c,className:"components-font-appearance-control",__next40pxDefaultSize:t,__shouldNotWarnDeprecated36pxSize:!0,label:d,describedBy:S(),options:k,value:y,onChange:({selectedItem:x})=>o(x.style)})}var Cte=l(A(),1),Bte=l(Re(),1),E3=l(N(),1);var Ete=l(w(),1);function rI({__next40pxDefaultSize:e=!1,value:t="",onChange:o,fontFamilies:r,className:n,...i}){let[s]=me("typography.fontFamilies");if(r||(r=s),!r||r.length===0)return null;let a=[{key:"",name:(0,E3.__)("Default")},...r.map(({fontFamily:u,name:d})=>({key:u,name:d||u,style:{fontFamily:u}}))];!e&&(i.size===void 0||i.size==="default")&&(0,Bte.default)("36px default size for wp.blockEditor.__experimentalFontFamilyControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."});let c=a.find(u=>u.key===t)??"";return(0,Ete.jsx)(Cte.CustomSelectControl,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,label:(0,E3.__)("Font"),value:c,onChange:({selectedItem:u})=>o(u.key),options:a,className:V("block-editor-font-family-control",n),...i})}var nI=l(A(),1),Tte=l(Re(),1),Ite=l(N(),1);var Pte=l(w(),1);function iI({__next40pxDefaultSize:e=!1,value:t,onChange:o,__unstableInputWidth:r="60px",...n}){let[i]=me("spacing.units"),s=(0,nI.__experimentalUseCustomUnits)({availableUnits:i||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return!e&&(n.size===void 0||n.size==="default")&&(0,Tte.default)("36px default size for wp.blockEditor.__experimentalLetterSpacingControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."}),(0,Pte.jsx)(nI.__experimentalUnitControl,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,...n,label:(0,Ite.__)("Letter spacing"),value:t,__unstableInputWidth:r,units:s,onChange:o})}var jS=l(N(),1),sI=l(A(),1),T3=l(w(),1),cEe=[{label:(0,jS.__)("None"),value:"none",icon:Dr},{label:(0,jS.__)("Underline"),value:"underline",icon:RA},{label:(0,jS.__)("Strikethrough"),value:"line-through",icon:IA}];function aI({value:e,onChange:t,className:o}){return(0,T3.jsx)(sI.__experimentalToggleGroupControl,{isDeselectable:!0,__next40pxDefaultSize:!0,label:(0,jS.__)("Decoration"),className:V("block-editor-text-decoration-control",o),value:e,onChange:r=>{t(r===e?void 0:r)},children:cEe.map(r=>(0,T3.jsx)(sI.__experimentalToggleGroupControlOptionIcon,{value:r.value,icon:r.icon,label:r.label},r.value))})}var sb=l(N(),1);var lI=l(A(),1),I3=l(w(),1),uEe=[{label:(0,sb.__)("None"),value:"none",icon:Dr},{label:(0,sb.__)("Uppercase"),value:"uppercase",icon:AA},{label:(0,sb.__)("Lowercase"),value:"lowercase",icon:EA},{label:(0,sb.__)("Capitalize"),value:"capitalize",icon:CA}];function cI({className:e,value:t,onChange:o}){return(0,I3.jsx)(lI.__experimentalToggleGroupControl,{isDeselectable:!0,__next40pxDefaultSize:!0,label:(0,sb.__)("Letter case"),className:V("block-editor-text-transform-control",e),value:t,onChange:r=>{o(r===t?void 0:r)},children:uEe.map(r=>(0,I3.jsx)(lI.__experimentalToggleGroupControlOptionIcon,{value:r.value,icon:r.icon,label:r.label},r.value))})}var ab=l(N(),1);var uI=l(A(),1),P3=l(w(),1),dEe=[{label:(0,ab.__)("Horizontal"),value:"horizontal-tb",icon:CN},{label:(0,ab.__)("Vertical"),value:(0,ab.isRTL)()?"vertical-lr":"vertical-rl",icon:EN}];function dI({className:e,value:t,onChange:o}){return(0,P3.jsx)(uI.__experimentalToggleGroupControl,{isDeselectable:!0,__next40pxDefaultSize:!0,label:(0,ab.__)("Orientation"),className:V("block-editor-writing-mode-control",e),value:t,onChange:r=>{o(r===t?void 0:r)},children:dEe.map(r=>(0,P3.jsx)(uI.__experimentalToggleGroupControlOptionIcon,{value:r.value,icon:r.icon,label:r.label},r.value))})}var Xr=l(A(),1),Rte=l(R(),1),Ote=l(N(),1);var Uo=l(w(),1),fEe=({setting:e,children:t,panelId:o,...r})=>{let n=()=>{e.colorValue?e.onColorChange():e.gradientValue&&e.onGradientChange()};return(0,Uo.jsx)(Xr.__experimentalToolsPanelItem,{hasValue:()=>!!e.colorValue||!!e.gradientValue,label:e.label,onDeselect:n,isShownByDefault:e.isShownByDefault!==void 0?e.isShownByDefault:!0,...r,className:"block-editor-tools-panel-color-gradient-settings__item",panelId:o,resetAllFilter:e.resetAllFilter,children:t})},mEe=({colorValue:e,label:t})=>(0,Uo.jsxs)(Xr.__experimentalHStack,{justify:"flex-start",children:[(0,Uo.jsx)(Xr.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:e}),(0,Uo.jsx)(Xr.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:t,children:t})]}),pEe=e=>function({onToggle:o,isOpen:r}){let{clearable:n,colorValue:i,gradientValue:s,onColorChange:a,onGradientChange:c,label:u}=e,d=(0,Rte.useRef)(void 0),f={onClick:o,className:V("block-editor-panel-color-gradient-settings__dropdown",{"is-open":r}),"aria-expanded":r,ref:d},m=()=>{i?a():s&&c()},h=i??s;return(0,Uo.jsxs)(Uo.Fragment,{children:[(0,Uo.jsx)(Xr.Button,{__next40pxDefaultSize:!0,...f,children:(0,Uo.jsx)(mEe,{colorValue:h,label:u})}),n&&h&&(0,Uo.jsx)(Xr.Button,{__next40pxDefaultSize:!0,label:(0,Ote.__)("Reset"),className:"block-editor-panel-color-gradient-settings__reset",size:"small",icon:Dr,onClick:()=>{m(),r&&o(),d.current?.focus()}})]})};function fI({colors:e,disableCustomColors:t,disableCustomGradients:o,enableAlpha:r,gradients:n,settings:i,__experimentalIsRenderedInSidebar:s,...a}){let c;return s&&(c={placement:"left-start",offset:36,shift:!0}),(0,Uo.jsx)(Uo.Fragment,{children:i.map((u,d)=>{let f={clearable:!1,colorValue:u.colorValue,colors:e,disableCustomColors:t,disableCustomGradients:o,enableAlpha:r,gradientValue:u.gradientValue,gradients:n,label:u.label,onColorChange:u.onColorChange,onGradientChange:u.onGradientChange,showTitle:!1,__experimentalIsRenderedInSidebar:s,...u},m={clearable:u.clearable,label:u.label,colorValue:u.colorValue,gradientValue:u.gradientValue,onColorChange:u.onColorChange,onGradientChange:u.onGradientChange};return u&&(0,Uo.jsx)(fEe,{setting:u,...a,children:(0,Uo.jsx)(Xr.Dropdown,{popoverProps:c,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:pEe(m),renderContent:()=>(0,Uo.jsx)(Xr.__experimentalDropdownContentWrapper,{paddingSize:"none",children:(0,Uo.jsx)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:(0,Uo.jsx)(_d,{...f})})})})},d)})})}var mI=l(A(),1),Ate=l(F(),1),Lte=l(Z(),1);var R3=l(R(),1),Um=l(N(),1);function wd(){let[e,t,o,r,n,i,s,a,c,u]=me("color.custom","color.palette.custom","color.palette.theme","color.palette.default","color.defaultPalette","color.customGradient","color.gradients.custom","color.gradients.theme","color.gradients.default","color.defaultGradients"),d={disableCustomColors:!e,disableCustomGradients:!i};return d.colors=(0,R3.useMemo)(()=>{let f=[];return o&&o.length&&f.push({name:(0,Um._x)("Theme","Indicates this palette comes from the theme."),slug:"theme",colors:o}),n&&r&&r.length&&f.push({name:(0,Um._x)("Default","Indicates this palette comes from WordPress."),slug:"default",colors:r}),t&&t.length&&f.push({name:(0,Um._x)("Custom","Indicates this palette is created by the user."),slug:"custom",colors:t}),f},[t,o,r,n]),d.gradients=(0,R3.useMemo)(()=>{let f=[];return a&&a.length&&f.push({name:(0,Um._x)("Theme","Indicates this palette comes from the theme."),slug:"theme",gradients:a}),u&&c&&c.length&&f.push({name:(0,Um._x)("Default","Indicates this palette comes from WordPress."),slug:"default",gradients:c}),s&&s.length&&f.push({name:(0,Um._x)("Custom","Indicates this palette is created by the user."),slug:"custom",gradients:s}),f},[s,a,c,u]),d.hasColorsOrGradients=!!d.colors.length||!!d.gradients.length,d}var qs=l(w(),1),hEe=["colors","disableCustomColors","gradients","disableCustomGradients"],O3=({className:e,colors:t,gradients:o,disableCustomColors:r,disableCustomGradients:n,children:i,settings:s,title:a,showTitle:c=!0,__experimentalIsRenderedInSidebar:u,enableAlpha:d})=>{let f=(0,Lte.useInstanceId)(O3),{batch:m}=(0,Ate.useRegistry)();return(!t||t.length===0)&&(!o||o.length===0)&&r&&n&&s?.every(h=>(!h.colors||h.colors.length===0)&&(!h.gradients||h.gradients.length===0)&&(h.disableCustomColors===void 0||h.disableCustomColors)&&(h.disableCustomGradients===void 0||h.disableCustomGradients))?null:(0,qs.jsxs)(mI.__experimentalToolsPanel,{className:V("block-editor-panel-color-gradient-settings",e),label:c?a:void 0,resetAll:()=>{m(()=>{s.forEach(({colorValue:h,gradientValue:p,onColorChange:g,onGradientChange:b})=>{h?g():p&&b()})})},panelId:f,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",children:[(0,qs.jsx)(fI,{settings:s,panelId:f,colors:t,gradients:o,disableCustomColors:r,disableCustomGradients:n,__experimentalIsRenderedInSidebar:u,enableAlpha:d}),!!i&&(0,qs.jsxs)(qs.Fragment,{children:[(0,qs.jsx)(mI.__experimentalSpacer,{marginY:4})," ",i]})]})},gEe=e=>{let t=wd();return(0,qs.jsx)(O3,{...t,...e})},bEe=e=>hEe.every(t=>e.hasOwnProperty(t))?(0,qs.jsx)(O3,{...e}):(0,qs.jsx)(gEe,{...e}),pI=bEe;var hI=l(R(),1),Hm=l(A(),1),L3=l(N(),1);var US=l(w(),1),A3=[],kEe={...KT,px:{max:1e3,steps:1},em:{max:50,steps:.1},rem:{max:50,steps:.1}};function vEe(e){let t=e?.default??A3,o=e?.custom??A3,r=e?.theme??A3;return(0,hI.useMemo)(()=>[{name:(0,L3.__)("None"),slug:"0",size:0},...o,...r,...t],[o,r,t])}function lb({label:e=(0,L3.__)("Dimension"),onChange:t,value:o}){let[r,n]=me("dimensions.dimensionSizes","spacing.units"),i=(0,Hm.__experimentalUseCustomUnits)({availableUnits:n||["%","px","em","rem","vh","vw"]}),s=vEe(r),[a,c]=(0,hI.useState)(()=>{let[,d]=(0,Hm.__experimentalParseQuantityAndUnitFromRawValue)(o);return d||i[0]?.value||"px"}),u=d=>{let[f,m]=(0,Hm.__experimentalParseQuantityAndUnitFromRawValue)(o);["em","rem"].includes(d)&&m==="px"?t((f/16).toFixed(2)+d):["em","rem"].includes(m)&&d==="px"?t(Math.round(f*16)+d):["%","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax"].includes(d)&&f>100&&t(100+d),c(d)};return(0,US.jsxs)("fieldset",{className:"block-editor-dimension-control",children:[(0,US.jsx)(Hm.BaseControl.VisualLabel,{as:"legend",children:e}),(0,US.jsx)(jm,{ariaLabel:e,className:"block-editor-dimension-control",customValueSettings:kEe,minimumCustomValue:0,onChange:t,onUnitChange:u,presets:s,presetType:"dimension",selectedUnit:a,showTooltip:!0,units:i,value:o})]})}var Mte=l(R(),1),or=l(A(),1),Dte=l(N(),1),Vte=l(Re(),1);var ja=l(w(),1),Nte={px:{max:1e3,step:1},"%":{max:100,step:1},vw:{max:100,step:1},vh:{max:100,step:1},em:{max:50,step:.1},rem:{max:50,step:.1},svw:{max:100,step:1},lvw:{max:100,step:1},dvw:{max:100,step:1},svh:{max:100,step:1},lvh:{max:100,step:1},dvh:{max:100,step:1},vi:{max:100,step:1},svi:{max:100,step:1},lvi:{max:100,step:1},dvi:{max:100,step:1},vb:{max:100,step:1},svb:{max:100,step:1},lvb:{max:100,step:1},dvb:{max:100,step:1},vmin:{max:100,step:1},svmin:{max:100,step:1},lvmin:{max:100,step:1},dvmin:{max:100,step:1},vmax:{max:100,step:1},svmax:{max:100,step:1},lvmax:{max:100,step:1},dvmax:{max:100,step:1}};function Fte({label:e=(0,Dte.__)("Height"),onChange:t,value:o}){(0,Vte.default)("wp.blockEditor.HeightControl",{since:"7.0",version:"7.2",alternative:"wp.blockEditor.DimensionControl"});let r=parseFloat(o),[n]=me("spacing.units"),i=(0,or.__experimentalUseCustomUnits)({availableUnits:n||["%","px","em","rem","vh","vw"]}),s=(0,Mte.useMemo)(()=>(0,or.__experimentalParseQuantityAndUnitFromRawValue)(o),[o])[1]||i[0]?.value||"px",a=u=>{t([u,s].join(""))},c=u=>{let[d,f]=(0,or.__experimentalParseQuantityAndUnitFromRawValue)(o);["em","rem"].includes(u)&&f==="px"?t((d/16).toFixed(2)+u):["em","rem"].includes(f)&&u==="px"?t(Math.round(d*16)+u):["%","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax"].includes(u)&&d>100&&t(100+u)};return(0,ja.jsxs)("fieldset",{className:"block-editor-height-control",children:[(0,ja.jsx)(or.BaseControl.VisualLabel,{as:"legend",children:e}),(0,ja.jsxs)(or.Flex,{children:[(0,ja.jsx)(or.FlexItem,{isBlock:!0,children:(0,ja.jsx)(or.__experimentalUnitControl,{value:o,units:i,onChange:t,onUnitChange:c,min:0,size:"__unstable-large",label:e,hideLabelFromVision:!0})}),(0,ja.jsx)(or.FlexItem,{isBlock:!0,children:(0,ja.jsx)(or.__experimentalSpacer,{marginX:2,marginBottom:0,children:(0,ja.jsx)(or.RangeControl,{__next40pxDefaultSize:!0,value:r,min:0,max:Nte[s]?.max??100,step:Nte[s]?.step??.1,withInputField:!1,onChange:a,label:e,hideLabelFromVision:!0})})})]})]})}var $S=l(A(),1);var es=l(jr()),doe=l(soe());function wEe(e,t,o,r,n,i){i===void 0&&(i=0);var s=cb(e,t,i),a=s.width,c=s.height,u=Math.min(a,o),d=Math.min(c,r);return u>d*n?{width:d*n,height:d}:{width:u,height:u/n}}function CEe(e){return e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight}function HS(e,t,o,r,n){n===void 0&&(n=0);var i=cb(t.width,t.height,n),s=i.width,a=i.height;return{x:aoe(e.x,s,o.width,r),y:aoe(e.y,a,o.height,r)}}function aoe(e,t,o,r){var n=t*r/2-o/2;return SI(e,-n,n)}function loe(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function coe(e,t){return Math.atan2(t.y-e.y,t.x-e.x)*180/Math.PI}function BEe(e,t,o,r,n,i,s){i===void 0&&(i=0),s===void 0&&(s=!0);var a=s?EEe:TEe,c=cb(t.width,t.height,i),u=cb(t.naturalWidth,t.naturalHeight,i),d={x:a(100,((c.width-o.width/n)/2-e.x/n)/c.width*100),y:a(100,((c.height-o.height/n)/2-e.y/n)/c.height*100),width:a(100,o.width/c.width*100/n),height:a(100,o.height/c.height*100/n)},f=Math.round(a(u.width,d.width*u.width/100)),m=Math.round(a(u.height,d.height*u.height/100)),h=u.width>=u.height*r,p=h?{width:Math.round(m*r),height:m}:{width:f,height:Math.round(f/r)},g=Fo(Fo({},p),{x:Math.round(a(u.width-p.width,d.x*u.width/100)),y:Math.round(a(u.height-p.height,d.y*u.height/100))});return{croppedAreaPercentages:d,croppedAreaPixels:g}}function EEe(e,t){return Math.min(e,Math.max(0,t))}function TEe(e,t){return t}function IEe(e,t,o,r,n,i){var s=cb(t.width,t.height,o),a=SI(r.width/s.width*(100/e.width),n,i),c={x:a*s.width/2-r.width/2-s.width*a*(e.x/100),y:a*s.height/2-r.height/2-s.height*a*(e.y/100)};return{crop:c,zoom:a}}function PEe(e,t,o){var r=CEe(t);return o.height>o.width?o.height/(e.height*r):o.width/(e.width*r)}function REe(e,t,o,r,n,i){o===void 0&&(o=0);var s=cb(t.naturalWidth,t.naturalHeight,o),a=SI(PEe(e,t,r),n,i),c=r.height>r.width?r.height/e.height:r.width/e.width,u={x:((s.width-e.width)/2-e.x)*c,y:((s.height-e.height)/2-e.y)*c};return{crop:u,zoom:a}}function uoe(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function OEe(e){return e*Math.PI/180}function cb(e,t,o){var r=OEe(o);return{width:Math.abs(Math.cos(r)*e)+Math.abs(Math.sin(r)*t),height:Math.abs(Math.sin(r)*e)+Math.abs(Math.cos(r)*t)}}function SI(e,t,o){return Math.min(Math.max(e,t),o)}function yI(){for(var e=[],t=0;t0}).join(" ").trim()}var AEe=`.reactEasyCrop_Container { position: absolute; top: 0; left: 0; right: 0; bottom: 0; overflow: hidden; user-select: none; touch-action: none; cursor: move; display: flex; justify-content: center; align-items: center; }.reactEasyCrop_Image, .reactEasyCrop_Video { will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */ }.reactEasyCrop_Contain { max-width: 100%; max-height: 100%; margin: auto; position: absolute; top: 0; bottom: 0; left: 0; right: 0; } .reactEasyCrop_Cover_Horizontal { width: 100%; height: auto; } .reactEasyCrop_Cover_Vertical { width: auto; height: 100%; }.reactEasyCrop_CropArea { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); border: 1px solid rgba(255, 255, 255, 0.5); box-sizing: border-box; box-shadow: 0 0 0 9999em; color: rgba(0, 0, 0, 0.5); overflow: hidden; }.reactEasyCrop_CropAreaRound { border-radius: 50%; }.reactEasyCrop_CropAreaGrid::before { content: ' '; box-sizing: border-box; position: absolute; border: 1px solid rgba(255, 255, 255, 0.5); top: 0; bottom: 0; left: 33.33%; right: 33.33%; border-top: 0; border-bottom: 0; }.reactEasyCrop_CropAreaGrid::after { content: ' '; box-sizing: border-box; position: absolute; border: 1px solid rgba(255, 255, 255, 0.5); top: 33.33%; bottom: 33.33%; left: 0; right: 0; border-left: 0; border-right: 0; } `,LEe=1,NEe=3,MEe=1,foe=(function(e){IU(t,e);function t(){var o=e!==null&&e.apply(this,arguments)||this;return o.cropperRef=es.createRef(),o.imageRef=es.createRef(),o.videoRef=es.createRef(),o.containerPosition={x:0,y:0},o.containerRef=null,o.styleRef=null,o.containerRect=null,o.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},o.dragStartPosition={x:0,y:0},o.dragStartCrop={x:0,y:0},o.gestureZoomStart=0,o.gestureRotationStart=0,o.isTouching=!1,o.lastPinchDistance=0,o.lastPinchRotation=0,o.rafDragTimeout=null,o.rafPinchTimeout=null,o.wheelTimer=null,o.currentDoc=typeof document<"u"?document:null,o.currentWindow=typeof window<"u"?window:null,o.resizeObserver=null,o.previousCropSize=null,o.isInitialized=!1,o.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},o.initResizeObserver=function(){if(!(typeof window.ResizeObserver>"u"||!o.containerRef)){var r=!0;o.resizeObserver=new window.ResizeObserver(function(n){if(r){r=!1;return}o.computeSizes()}),o.resizeObserver.observe(o.containerRef)}},o.preventZoomSafari=function(r){return r.preventDefault()},o.cleanEvents=function(){o.currentDoc&&(o.currentDoc.removeEventListener("mousemove",o.onMouseMove),o.currentDoc.removeEventListener("mouseup",o.onDragStopped),o.currentDoc.removeEventListener("touchmove",o.onTouchMove),o.currentDoc.removeEventListener("touchend",o.onDragStopped),o.currentDoc.removeEventListener("gesturechange",o.onGestureChange),o.currentDoc.removeEventListener("gestureend",o.onGestureEnd),o.currentDoc.removeEventListener("scroll",o.onScroll))},o.clearScrollEvent=function(){o.containerRef&&o.containerRef.removeEventListener("wheel",o.onWheel),o.wheelTimer&&clearTimeout(o.wheelTimer)},o.onMediaLoad=function(){var r=o.computeSizes();r&&(o.previousCropSize=r,o.emitCropData(),o.setInitialCrop(r),o.isInitialized=!0),o.props.onMediaLoaded&&o.props.onMediaLoaded(o.mediaSize)},o.setInitialCrop=function(r){if(o.props.initialCroppedAreaPercentages){var n=IEe(o.props.initialCroppedAreaPercentages,o.mediaSize,o.props.rotation,r,o.props.minZoom,o.props.maxZoom),i=n.crop,s=n.zoom;o.props.onCropChange(i),o.props.onZoomChange&&o.props.onZoomChange(s)}else if(o.props.initialCroppedAreaPixels){var a=REe(o.props.initialCroppedAreaPixels,o.mediaSize,o.props.rotation,r,o.props.minZoom,o.props.maxZoom),i=a.crop,s=a.zoom;o.props.onCropChange(i),o.props.onZoomChange&&o.props.onZoomChange(s)}},o.computeSizes=function(){var r,n,i,s,a,c,u=o.imageRef.current||o.videoRef.current;if(u&&o.containerRef){o.containerRect=o.containerRef.getBoundingClientRect(),o.saveContainerPosition();var d=o.containerRect.width/o.containerRect.height,f=((r=o.imageRef.current)===null||r===void 0?void 0:r.naturalWidth)||((n=o.videoRef.current)===null||n===void 0?void 0:n.videoWidth)||0,m=((i=o.imageRef.current)===null||i===void 0?void 0:i.naturalHeight)||((s=o.videoRef.current)===null||s===void 0?void 0:s.videoHeight)||0,h=u.offsetWidthp?{width:o.containerRect.height*p,height:o.containerRect.height}:{width:o.containerRect.width,height:o.containerRect.width/p};break;case"horizontal-cover":g={width:o.containerRect.width,height:o.containerRect.width/p};break;case"vertical-cover":g={width:o.containerRect.height*p,height:o.containerRect.height};break}else g={width:u.offsetWidth,height:u.offsetHeight};o.mediaSize=Fo(Fo({},g),{naturalWidth:f,naturalHeight:m}),o.props.setMediaSize&&o.props.setMediaSize(o.mediaSize);var b=o.props.cropSize?o.props.cropSize:wEe(o.mediaSize.width,o.mediaSize.height,o.containerRect.width,o.containerRect.height,o.props.aspect,o.props.rotation);return(((a=o.state.cropSize)===null||a===void 0?void 0:a.height)!==b.height||((c=o.state.cropSize)===null||c===void 0?void 0:c.width)!==b.width)&&o.props.onCropSizeChange&&o.props.onCropSizeChange(b),o.setState({cropSize:b},o.recomputeCropPosition),o.props.setCropSize&&o.props.setCropSize(b),b}},o.saveContainerPosition=function(){if(o.containerRef){var r=o.containerRef.getBoundingClientRect();o.containerPosition={x:r.left,y:r.top}}},o.onMouseDown=function(r){o.currentDoc&&(r.preventDefault(),o.currentDoc.addEventListener("mousemove",o.onMouseMove),o.currentDoc.addEventListener("mouseup",o.onDragStopped),o.saveContainerPosition(),o.onDragStart(t.getMousePoint(r)))},o.onMouseMove=function(r){return o.onDrag(t.getMousePoint(r))},o.onScroll=function(r){o.currentDoc&&(r.preventDefault(),o.saveContainerPosition())},o.onTouchStart=function(r){o.currentDoc&&(o.isTouching=!0,!(o.props.onTouchRequest&&!o.props.onTouchRequest(r))&&(o.currentDoc.addEventListener("touchmove",o.onTouchMove,{passive:!1}),o.currentDoc.addEventListener("touchend",o.onDragStopped),o.saveContainerPosition(),r.touches.length===2?o.onPinchStart(r):r.touches.length===1&&o.onDragStart(t.getTouchPoint(r.touches[0]))))},o.onTouchMove=function(r){r.preventDefault(),r.touches.length===2?o.onPinchMove(r):r.touches.length===1&&o.onDrag(t.getTouchPoint(r.touches[0]))},o.onGestureStart=function(r){o.currentDoc&&(r.preventDefault(),o.currentDoc.addEventListener("gesturechange",o.onGestureChange),o.currentDoc.addEventListener("gestureend",o.onGestureEnd),o.gestureZoomStart=o.props.zoom,o.gestureRotationStart=o.props.rotation)},o.onGestureChange=function(r){if(r.preventDefault(),!o.isTouching){var n=t.getMousePoint(r),i=o.gestureZoomStart-1+r.scale;if(o.setNewZoom(i,n,{shouldUpdatePosition:!0}),o.props.onRotationChange){var s=o.gestureRotationStart+r.rotation;o.props.onRotationChange(s)}}},o.onGestureEnd=function(r){o.cleanEvents()},o.onDragStart=function(r){var n,i,s=r.x,a=r.y;o.dragStartPosition={x:s,y:a},o.dragStartCrop=Fo({},o.props.crop),(i=(n=o.props).onInteractionStart)===null||i===void 0||i.call(n)},o.onDrag=function(r){var n=r.x,i=r.y;o.currentWindow&&(o.rafDragTimeout&&o.currentWindow.cancelAnimationFrame(o.rafDragTimeout),o.rafDragTimeout=o.currentWindow.requestAnimationFrame(function(){if(o.state.cropSize&&!(n===void 0||i===void 0)){var s=n-o.dragStartPosition.x,a=i-o.dragStartPosition.y,c={x:o.dragStartCrop.x+s,y:o.dragStartCrop.y+a},u=o.props.restrictPosition?HS(c,o.mediaSize,o.state.cropSize,o.props.zoom,o.props.rotation):c;o.props.onCropChange(u)}}))},o.onDragStopped=function(){var r,n;o.isTouching=!1,o.cleanEvents(),o.emitCropData(),(n=(r=o.props).onInteractionEnd)===null||n===void 0||n.call(r)},o.onWheel=function(r){if(o.currentWindow&&!(o.props.onWheelRequest&&!o.props.onWheelRequest(r))){r.preventDefault();var n=t.getMousePoint(r),i=(0,doe.default)(r).pixelY,s=o.props.zoom-i*o.props.zoomSpeed/200;o.setNewZoom(s,n,{shouldUpdatePosition:!0}),o.state.hasWheelJustStarted||o.setState({hasWheelJustStarted:!0},function(){var a,c;return(c=(a=o.props).onInteractionStart)===null||c===void 0?void 0:c.call(a)}),o.wheelTimer&&clearTimeout(o.wheelTimer),o.wheelTimer=o.currentWindow.setTimeout(function(){return o.setState({hasWheelJustStarted:!1},function(){var a,c;return(c=(a=o.props).onInteractionEnd)===null||c===void 0?void 0:c.call(a)})},250)}},o.getPointOnContainer=function(r,n){var i=r.x,s=r.y;if(!o.containerRect)throw new Error("The Cropper is not mounted");return{x:o.containerRect.width/2-(i-n.x),y:o.containerRect.height/2-(s-n.y)}},o.getPointOnMedia=function(r){var n=r.x,i=r.y,s=o.props,a=s.crop,c=s.zoom;return{x:(n+a.x)/c,y:(i+a.y)/c}},o.setNewZoom=function(r,n,i){var s=i===void 0?{}:i,a=s.shouldUpdatePosition,c=a===void 0?!0:a;if(!(!o.state.cropSize||!o.props.onZoomChange)){var u=SI(r,o.props.minZoom,o.props.maxZoom);if(c){var d=o.getPointOnContainer(n,o.containerPosition),f=o.getPointOnMedia(d),m={x:f.x*u-d.x,y:f.y*u-d.y},h=o.props.restrictPosition?HS(m,o.mediaSize,o.state.cropSize,u,o.props.rotation):m;o.props.onCropChange(h)}o.props.onZoomChange(u)}},o.getCropData=function(){if(!o.state.cropSize)return null;var r=o.props.restrictPosition?HS(o.props.crop,o.mediaSize,o.state.cropSize,o.props.zoom,o.props.rotation):o.props.crop;return BEe(r,o.mediaSize,o.state.cropSize,o.getAspect(),o.props.zoom,o.props.rotation,o.props.restrictPosition)},o.emitCropData=function(){var r=o.getCropData();if(r){var n=r.croppedAreaPercentages,i=r.croppedAreaPixels;o.props.onCropComplete&&o.props.onCropComplete(n,i),o.props.onCropAreaChange&&o.props.onCropAreaChange(n,i)}},o.emitCropAreaChange=function(){var r=o.getCropData();if(r){var n=r.croppedAreaPercentages,i=r.croppedAreaPixels;o.props.onCropAreaChange&&o.props.onCropAreaChange(n,i)}},o.recomputeCropPosition=function(){if(o.state.cropSize){var r=o.props.crop;if(o.isInitialized&&o.previousCropSize){var n=Math.abs(o.previousCropSize.width-o.state.cropSize.width)>1e-6||Math.abs(o.previousCropSize.height-o.state.cropSize.height)>1e-6;if(n){var i=o.state.cropSize.width/o.previousCropSize.width,s=o.state.cropSize.height/o.previousCropSize.height;r={x:o.props.crop.x*i,y:o.props.crop.y*s}}}var a=o.props.restrictPosition?HS(r,o.mediaSize,o.state.cropSize,o.props.zoom,o.props.rotation):r;o.previousCropSize=o.state.cropSize,o.props.onCropChange(a),o.emitCropData()}},o.onKeyDown=function(r){var n,i,s=o.props,a=s.crop,c=s.onCropChange,u=s.keyboardStep,d=s.zoom,f=s.rotation,m=u;if(o.state.cropSize){r.shiftKey&&(m*=.2);var h=Fo({},a);switch(r.key){case"ArrowUp":h.y-=m,r.preventDefault();break;case"ArrowDown":h.y+=m,r.preventDefault();break;case"ArrowLeft":h.x-=m,r.preventDefault();break;case"ArrowRight":h.x+=m,r.preventDefault();break;default:return}o.props.restrictPosition&&(h=HS(h,o.mediaSize,o.state.cropSize,d,f)),r.repeat||(i=(n=o.props).onInteractionStart)===null||i===void 0||i.call(n),c(h)}},o.onKeyUp=function(r){var n,i;switch(r.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":r.preventDefault();break;default:return}o.emitCropData(),(i=(n=o.props).onInteractionEnd)===null||i===void 0||i.call(n)},o}return t.prototype.componentDidMount=function(){!this.currentDoc||!this.currentWindow||(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),typeof window.ResizeObserver>"u"&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=AEe,this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef),this.props.setCropperRef&&this.props.setCropperRef(this.cropperRef))},t.prototype.componentWillUnmount=function(){var o,r;!this.currentDoc||!this.currentWindow||(typeof window.ResizeObserver>"u"&&this.currentWindow.removeEventListener("resize",this.computeSizes),(o=this.resizeObserver)===null||o===void 0||o.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&((r=this.styleRef.parentNode)===null||r===void 0||r.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},t.prototype.componentDidUpdate=function(o){var r,n,i,s,a,c,u,d,f;o.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):o.aspect!==this.props.aspect?this.computeSizes():o.objectFit!==this.props.objectFit?this.computeSizes():o.zoom!==this.props.zoom?this.recomputeCropPosition():((r=o.cropSize)===null||r===void 0?void 0:r.height)!==((n=this.props.cropSize)===null||n===void 0?void 0:n.height)||((i=o.cropSize)===null||i===void 0?void 0:i.width)!==((s=this.props.cropSize)===null||s===void 0?void 0:s.width)?this.computeSizes():(((a=o.crop)===null||a===void 0?void 0:a.x)!==((c=this.props.crop)===null||c===void 0?void 0:c.x)||((u=o.crop)===null||u===void 0?void 0:u.y)!==((d=this.props.crop)===null||d===void 0?void 0:d.y))&&this.emitCropAreaChange(),o.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),o.video!==this.props.video&&((f=this.videoRef.current)===null||f===void 0||f.load());var m=this.getObjectFit();m!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:m},this.computeSizes)},t.prototype.getAspect=function(){var o=this.props,r=o.cropSize,n=o.aspect;return r?r.width/r.height:n},t.prototype.getObjectFit=function(){var o,r,n,i;if(this.props.objectFit==="cover"){var s=this.imageRef.current||this.videoRef.current;if(s&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var a=this.containerRect.width/this.containerRect.height,c=((o=this.imageRef.current)===null||o===void 0?void 0:o.naturalWidth)||((r=this.videoRef.current)===null||r===void 0?void 0:r.videoWidth)||0,u=((n=this.imageRef.current)===null||n===void 0?void 0:n.naturalHeight)||((i=this.videoRef.current)===null||i===void 0?void 0:i.videoHeight)||0,d=c/u;return de>=0?e%360:(360+e%360)%360,DEe=e=>new Promise((t,o)=>{let r=new Image;r.addEventListener("load",()=>t(r)),r.addEventListener("error",n=>o(n)),r.setAttribute("crossOrigin","anonymous"),r.src=e});function goe(e){return e*Math.PI/180}function VEe(e,t,o){let r=goe(o);return{width:Math.abs(Math.cos(r)*e)+Math.abs(Math.sin(r)*t),height:Math.abs(Math.sin(r)*e)+Math.abs(Math.cos(r)*t)}}async function boe(e,t,o=0,r={horizontal:!1,vertical:!1}){try{let n=await DEe(e),i=document.createElement("canvas"),s=i.getContext("2d");if(!s)return null;let a=goe(o),{width:c,height:u}=VEe(n.width,n.height,o);i.width=c,i.height=u,s.translate(c/2,u/2),s.rotate(a),s.scale(r.horizontal?-1:1,r.vertical?-1:1),s.translate(-n.width/2,-n.height/2),s.drawImage(n,0,0);let d=document.createElement("canvas"),f=d.getContext("2d");return f?(d.width=t.width,d.height=t.height,f.drawImage(i,t.x,t.y,t.width,t.height,0,0,t.width,t.height),new Promise(m=>{d.toBlob(h=>{h&&m(URL.createObjectURL(h))},"image/jpeg")})):null}catch{return null}}var $m={crop:{x:0,y:0,width:100,height:100},zoom:ub,rotation:0,aspectRatio:1,flip:{horizontal:!1,vertical:!1}},FEe={x:0,y:0},H3={crop:FEe,croppedArea:$m.crop,croppedAreaPixels:null,zoom:$m.zoom,rotation:$m.rotation,flip:$m.flip,aspectRatio:$m.aspectRatio,mediaSize:null};function koe(){let[e,t]=(0,Zs.useState)(H3),[o,r]=(0,Zs.useState)(null),n=(0,Zs.useCallback)(u=>{t(d=>{let m={...typeof u=="function"?u(d):u};return"rotation"in m&&m.rotation!==void 0&&(m.rotation=_I(m.rotation)),{...d,...m}})},[]),i=(0,Zs.useCallback)((u=null)=>{if(!u){r(null),n(H3);return}if(typeof u=="object"){let d={...$m,...u};r(d),n(d)}},[n,r]),s=(0,Zs.useCallback)(()=>{if(o){let u={crop:{x:0,y:0},croppedAreaPixels:null};o.crop&&(u.croppedArea=o.crop),o.zoom!==void 0&&(u.zoom=o.zoom),o.rotation!==void 0&&(u.rotation=o.rotation),o.aspectRatio!==void 0&&(u.aspectRatio=o.aspectRatio),o.flip!==void 0&&(u.flip=o.flip),n(u)}else n({...H3})},[o,n]),a=(0,Zs.useMemo)(()=>{if(o){let d={crop:e.croppedAreaPixels||e.croppedArea,zoom:e.zoom,rotation:_I(e.rotation),aspectRatio:e.aspectRatio,flip:e.flip};return Wm(d,o)===!1}let u={crop:e.croppedArea,zoom:e.zoom,rotation:_I(e.rotation),aspectRatio:e.aspectRatio,flip:e.flip};return Wm(u,$m)===!1},[e,o]),c=(0,Zs.useCallback)(async u=>e.croppedAreaPixels?boe(u,e.croppedAreaPixels,e.rotation,e.flip):null,[e.croppedAreaPixels,e.rotation,e.flip]);return(0,Zs.useMemo)(()=>({cropperState:e,setCropperState:n,resetState:o,setResetState:i,isDirty:a,reset:s,getCroppedImage:c}),[e,n,o,i,a,s,c])}var voe=l(w(),1),yoe=(0,db.createContext)({cropperState:{crop:{x:0,y:0},croppedArea:{x:0,y:0,width:100,height:100},croppedAreaPixels:null,zoom:ub,rotation:0,aspectRatio:1,flip:{horizontal:!1,vertical:!1},mediaSize:null},setCropperState:()=>{},resetState:null,setResetState:()=>{},isDirty:!1,reset:()=>{},getCroppedImage:()=>Promise.resolve(null)});function G3({children:e}){let t=koe(),o=(0,db.useMemo)(()=>({...t}),[t]);return(0,voe.jsx)(yoe.Provider,{value:o,children:e})}var GS=()=>{let e=(0,db.useContext)(yoe);if(!e)throw new Error("Missing ImageCropperContext");return e};var _oe=l(w(),1);function W3({src:e,onLoad:t,minZoom:o=ub,maxZoom:r=hoe,...n}){let{cropperState:i,setCropperState:s}=GS(),{crop:a,zoom:c,rotation:u,aspectRatio:d,flip:f}=i,m=v=>s({crop:v}),h=v=>s({zoom:v}),p=v=>s({rotation:v}),g=v=>s({mediaSize:v}),b=(0,Soe.useCallback)((v,k)=>{s({croppedArea:v,croppedAreaPixels:k})},[s]);return(0,_oe.jsx)(foe,{classes:{containerClassName:"image-cropper__container",cropAreaClassName:"image-cropper__crop-area",mediaClassName:"image-cropper__image"},minZoom:o,maxZoom:r,rotation:u,image:e,setMediaSize:g,crop:a,zoom:c,aspect:d,onCropChange:m,onZoomChange:h,onCropComplete:b,onMediaLoaded:v=>{t?.(v)},onRotationChange:p,transform:[`translate(${a.x}px, ${a.y}px)`,`rotateZ(${u}deg)`,`rotateY(${f.horizontal?180:0}deg)`,`rotateX(${f.vertical?180:0}deg)`,`scale(${c})`].join(" "),...n})}var pb=l(A(),1),mb=l(N(),1);var xoe=100,woe=300,xI={placement:"bottom-start"};var fb=l(R(),1);var wI=l(F(),1),Km=l(R(),1),hc=l(N(),1),Coe=l(Un(),1),Boe=l(Fe(),1);var zEe={crop:(0,hc.__)("Image cropped."),rotate:(0,hc.__)("Image rotated."),cropAndRotate:(0,hc.__)("Image cropped and rotated.")};function Eoe({crop:e,rotation:t,url:o,id:r,onSaveImage:n,onFinishEditing:i}){let{createErrorNotice:s,createSuccessNotice:a}=(0,wI.useDispatch)(Coe.store),[c,u]=(0,Km.useState)(!1),{editMediaEntity:d}=(0,wI.useSelect)(h=>({editMediaEntity:h(_).getSettings()?.[_0]}),[]),f=(0,Km.useCallback)(()=>{u(!1),i()},[i]),m=(0,Km.useCallback)(async()=>{if(!d){i(),s((0,hc.__)("Sorry, you are not allowed to edit images on this site."),{id:"image-editing-error",type:"snackbar"});return}u(!0);let h=[];if(t>0&&h.push({type:"rotate",args:{angle:t}}),(e.width<99.9||e.height<99.9)&&h.push({type:"crop",args:{left:e.x,top:e.y,width:e.width,height:e.height}}),h.length===0){u(!1),i();return}let p=h.length===1?h[0].type:"cropAndRotate";try{let g=await d(r,{src:o,modifiers:h},{throwOnError:!0});g&&(n({id:g.id,url:g.source_url}),a(zEe[p],{type:"snackbar",actions:[{label:(0,hc.__)("Undo"),onClick:()=>{n({id:r,url:o})}}]}))}catch(g){s((0,hc.sprintf)((0,hc.__)("Could not edit image. %s"),(0,Boe.__unstableStripHTML)(g.message)),{id:"image-editing-error",type:"snackbar"})}finally{u(!1),i()}},[e,t,r,o,n,s,a,i,d]);return(0,Km.useMemo)(()=>({isInProgress:c,apply:m,cancel:f}),[c,m,f])}var Xs=l(R(),1),Toe=l(ut(),1);function Ioe({url:e,naturalWidth:t,naturalHeight:o}){let[r,n]=(0,Xs.useState)(),{cropperState:i,setCropperState:s}=GS(),{zoom:a,aspectRatio:c,crop:u,croppedArea:d}=i,f=(0,Xs.useCallback)(k=>{s({zoom:k})},[s]),m=(0,Xs.useCallback)(k=>{s({aspectRatio:k})},[s]),h=t/o,p=o/t;(0,Xs.useEffect)(()=>{m(h)},[]);let[g,b]=(0,Xs.useState)(0),v=(0,Xs.useCallback)(()=>{let k=(g+90)%360,y=h,x=a!==1||!(h===c||p===c);if(g%180===90&&(y=1/h),k===0){n(),b(k),s({aspectRatio:x?c:h,crop:{x:-(u.y*y),y:u.x*y}});return}function C(P){let E=document.createElement("canvas"),L=0,T=0;k%180?(E.width=P.target.height,E.height=P.target.width):(E.width=P.target.width,E.height=P.target.height),(k===90||k===180)&&(L=E.width),(k===270||k===180)&&(T=E.height);let O=E.getContext("2d");O.translate(L,T),O.rotate(k*Math.PI/180),O.drawImage(P.target,0,0),E.toBlob(D=>{n(URL.createObjectURL(D)),b(k);let U=x?c:E.width/E.height;s({aspectRatio:U,crop:{x:-(u.y*y),y:u.x*y}})})}let B=new window.Image;B.src=e,B.onload=C;let I=(0,Toe.applyFilters)("media.crossOrigin",void 0,e);typeof I=="string"&&(B.crossOrigin=I)},[g,h,e,s,u,a,c,p,b]);return(0,Xs.useMemo)(()=>({editedUrl:r,setEditedUrl:n,crop:d,zoom:a,setZoom:f,rotation:g,rotateClockwise:v,aspect:c,setAspect:m,defaultAspect:h}),[r,d,a,f,g,v,c,m,h])}var Poe=l(w(),1),$3=(0,fb.createContext)({});$3.displayName="ImageEditingContext";var Ua=()=>(0,fb.useContext)($3);function Roe({id:e,url:t,naturalWidth:o,naturalHeight:r,onFinishEditing:n,onSaveImage:i,children:s}){let a=Ioe({url:t,naturalWidth:o,naturalHeight:r}),c=Eoe({id:e,url:t,onSaveImage:i,onFinishEditing:n,...a}),u=(0,fb.useMemo)(()=>({...a,...c}),[a,c]);return(0,Poe.jsx)($3.Provider,{value:u,children:s})}var ts=l(w(),1);function CI({aspectRatios:e,isDisabled:t,label:o,onClick:r,value:n}){return(0,ts.jsx)(pb.MenuGroup,{label:o,children:e.map(({name:i,slug:s,ratio:a})=>(0,ts.jsx)(pb.MenuItem,{disabled:t,onClick:()=>{r(a)},role:"menuitemradio",isSelected:a===n,icon:a===n?gl:void 0,children:i},s))})}function jEe(e){let[t,o,...r]=e.split("/").map(Number);return t<=0||o<=0||Number.isNaN(t)||Number.isNaN(o)||r.length?NaN:o?t/o:t}function K3({ratio:e,...t}){return{ratio:jEe(e),...t}}function Ooe({toggleProps:e}){let{isInProgress:t,aspect:o,setAspect:r,defaultAspect:n}=Ua(),[i,s,a]=me("dimensions.aspectRatios.default","dimensions.aspectRatios.theme","dimensions.defaultAspectRatios");return(0,ts.jsx)(pb.DropdownMenu,{icon:jO,label:(0,mb.__)("Aspect Ratio"),popoverProps:xI,toggleProps:e,children:({onClose:c})=>(0,ts.jsxs)(ts.Fragment,{children:[(0,ts.jsx)(CI,{isDisabled:t,onClick:u=>{r(u),c()},value:o,aspectRatios:[{slug:"original",name:(0,mb.__)("Original"),ratio:n},...a?i.map(K3).filter(({ratio:u})=>u===1):[]]}),s?.length>0&&(0,ts.jsx)(CI,{label:(0,mb.__)("Theme"),isDisabled:t,onClick:u=>{r(u),c()},value:o,aspectRatios:s}),a&&(0,ts.jsx)(CI,{label:(0,mb.__)("Landscape"),isDisabled:t,onClick:u=>{r(u),c()},value:o,aspectRatios:i.map(K3).filter(({ratio:u})=>u>1)}),a&&(0,ts.jsx)(CI,{label:(0,mb.__)("Portrait"),isDisabled:t,onClick:u=>{r(u),c()},value:o,aspectRatios:i.map(K3).filter(({ratio:u})=>u<1)})]})})}var Aoe=l(A(),1),Loe=l(Z(),1);var Cd=l(w(),1);function Noe({url:e,width:t,height:o,naturalHeight:r,naturalWidth:n,borderProps:i}){let{isInProgress:s,editedUrl:a,rotation:c}=Ua(),[u,{width:d}]=(0,Loe.useResizeObserver)(),f=o||d*r/n;c%180===90&&(f=d*n/r);let m=(0,Cd.jsxs)("div",{className:V("wp-block-image__crop-area",i?.className,{"is-applying":s}),style:{...i?.style,width:t||d,height:f},children:[(0,Cd.jsx)(W3,{src:a||e}),s&&(0,Cd.jsx)(Aoe.Spinner,{})]});return(0,Cd.jsxs)(Cd.Fragment,{children:[u,m]})}var Bd=l(A(),1),Y3=l(N(),1);var WS=l(w(),1);function Moe(){let{isInProgress:e,zoom:t,setZoom:o}=Ua();return(0,WS.jsx)(Bd.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:xI,renderToggle:({isOpen:r,onToggle:n})=>(0,WS.jsx)(Bd.ToolbarButton,{icon:tN,label:(0,Y3.__)("Zoom"),onClick:n,"aria-expanded":r,disabled:e}),renderContent:()=>(0,WS.jsx)(Bd.__experimentalDropdownContentWrapper,{paddingSize:"medium",children:(0,WS.jsx)(Bd.RangeControl,{__next40pxDefaultSize:!0,label:(0,Y3.__)("Zoom"),min:xoe,max:woe,value:Math.round(t*100),onChange:r=>o(r/100)})})})}var Doe=l(A(),1),Voe=l(N(),1);var Foe=l(w(),1);function zoe(){let{isInProgress:e,rotateClockwise:t}=Ua();return(0,Foe.jsx)(Doe.ToolbarButton,{icon:XL,label:(0,Voe.__)("Rotate"),onClick:t,disabled:e})}var q3=l(A(),1),Z3=l(N(),1);var Ym=l(w(),1);function joe(){let{isInProgress:e,apply:t,cancel:o}=Ua();return(0,Ym.jsxs)(Ym.Fragment,{children:[(0,Ym.jsx)(q3.ToolbarButton,{onClick:t,disabled:e,children:(0,Z3.__)("Apply")}),(0,Ym.jsx)(q3.ToolbarButton,{onClick:o,children:(0,Z3.__)("Cancel")})]})}var ci=l(w(),1);function Uoe({id:e,url:t,width:o,height:r,naturalHeight:n,naturalWidth:i,onSaveImage:s,onFinishEditing:a,borderProps:c}){return(0,ci.jsx)(G3,{children:(0,ci.jsxs)(Roe,{id:e,url:t,naturalWidth:i,naturalHeight:n,onSaveImage:s,onFinishEditing:a,children:[(0,ci.jsx)(Noe,{borderProps:c,url:t,width:o,height:r,naturalHeight:n,naturalWidth:i}),(0,ci.jsxs)(Mt,{children:[(0,ci.jsxs)($S.ToolbarGroup,{children:[(0,ci.jsx)(Moe,{}),(0,ci.jsx)($S.ToolbarItem,{children:u=>(0,ci.jsx)(Ooe,{toggleProps:u})}),(0,ci.jsx)(zoe,{})]}),(0,ci.jsx)($S.ToolbarGroup,{children:(0,ci.jsx)(joe,{})})]})]})})}var ui=l(A(),1),Ed=l(N(),1);var hb=l(R(),1);function Hoe(e,t,o,r,n){let[i,s]=(0,hb.useState)(t??r??""),[a,c]=(0,hb.useState)(e??o??"");return(0,hb.useEffect)(()=>{t===void 0&&r!==void 0&&s(r),e===void 0&&o!==void 0&&c(o)},[r,o]),(0,hb.useEffect)(()=>{t!==void 0&&Number.parseInt(t)!==Number.parseInt(i)&&s(t),e!==void 0&&Number.parseInt(e)!==Number.parseInt(a)&&c(e)},[t,e]),{currentHeight:a,currentWidth:i,updateDimension:(f,m)=>{let h=m===""?void 0:parseInt(m,10);f==="width"?s(h):c(h),n({[f]:h})},updateDimensions:(f,m)=>{c(f??o),s(m??r),n({height:f,width:m})}}}var os=l(w(),1),Goe=[25,50,75,100],UEe=()=>{};function Woe(e,t,o){let r=Math.round(t*(e/100)),n=Math.round(o*(e/100));return{scaledWidth:r,scaledHeight:n}}function $oe({imageSizeHelp:e,imageWidth:t,imageHeight:o,imageSizeOptions:r=[],isResizable:n=!0,slug:i,width:s,height:a,onChange:c,onChangeImage:u=UEe}){let{currentHeight:d,currentWidth:f,updateDimension:m,updateDimensions:h}=Hoe(a,s,o,t,c),p=b=>{if(b===void 0){h();return}let{scaledWidth:v,scaledHeight:k}=Woe(b,t,o);h(k,v)},g=Goe.find(b=>{let{scaledWidth:v,scaledHeight:k}=Woe(b,t,o);return f===v&&d===k});return(0,os.jsxs)(ui.__experimentalVStack,{className:"block-editor-image-size-control",spacing:"4",children:[r&&r.length>0&&(0,os.jsx)(ui.SelectControl,{label:(0,Ed.__)("Resolution"),value:i,options:r,onChange:u,help:e,size:"__unstable-large"}),n&&(0,os.jsxs)(os.Fragment,{children:[(0,os.jsxs)(ui.__experimentalHStack,{align:"baseline",spacing:"4",children:[(0,os.jsx)(ui.__experimentalNumberControl,{label:(0,Ed.__)("Width"),value:f,min:1,onChange:b=>m("width",b),size:"__unstable-large"}),(0,os.jsx)(ui.__experimentalNumberControl,{label:(0,Ed.__)("Height"),value:d,min:1,onChange:b=>m("height",b),size:"__unstable-large"})]}),(0,os.jsx)(ui.__experimentalToggleGroupControl,{label:(0,Ed.__)("Image size presets"),hideLabelFromVision:!0,onChange:p,value:g,isBlock:!0,__next40pxDefaultSize:!0,children:Goe.map(b=>(0,os.jsx)(ui.__experimentalToggleGroupControlOption,{value:b,label:(0,Ed.sprintf)((0,Ed.__)("%d%%"),b)},b))})]})]})}var BI=l(A(),1);var qm=l(N(),1),Yoe=l(w(),1),Koe={left:ru,center:ou,right:nu,"space-between":Fp,stretch:zp};function HEe({allowedControls:e=["left","center","right","space-between"],isCollapsed:t=!0,onChange:o,value:r,popoverProps:n,isToolbar:i}){let s=f=>{o(f===r?void 0:f)},a=r?Koe[r]:Koe.left,c=[{name:"left",icon:ru,title:(0,qm.__)("Justify items left"),isActive:r==="left",onClick:()=>s("left")},{name:"center",icon:ou,title:(0,qm.__)("Justify items center"),isActive:r==="center",onClick:()=>s("center")},{name:"right",icon:nu,title:(0,qm.__)("Justify items right"),isActive:r==="right",onClick:()=>s("right")},{name:"space-between",icon:Fp,title:(0,qm.__)("Space between items"),isActive:r==="space-between",onClick:()=>s("space-between")},{name:"stretch",icon:zp,title:(0,qm.__)("Stretch items"),isActive:r==="stretch",onClick:()=>s("stretch")}],u=i?BI.ToolbarGroup:BI.ToolbarDropdownMenu,d=i?{isCollapsed:t}:{};return(0,Yoe.jsx)(u,{icon:a,popoverProps:n,label:(0,qm.__)("Change items justification"),controls:c.filter(f=>e.includes(f.name)),...d})}var X3=HEe;var Q3=l(w(),1),ah=e=>(0,Q3.jsx)(X3,{...e,isToolbar:!1}),qoe=e=>(0,Q3.jsx)(X3,{...e,isToolbar:!0});var Qr=l(A(),1),Qs=l(N(),1),no=l(R(),1),zre=l(Z(),1),jre=l(Fe(),1),Ure=l(it(),1),Hre=l(Jy(),1),zI=l(F(),1),aF=l(Zp(),1);var Gre=l(Re(),1),jI=l(dn(),1);var gb=l(A(),1);var EI=l(Z(),1),TI=l(N(),1),Zoe=l(R(),1),gc=l(w(),1);function Xoe({children:e,settingsOpen:t,setSettingsOpen:o}){let r=(0,EI.useReducedMotion)(),n=r?Zoe.Fragment:gb.__unstableAnimatePresence,i=r?"div":gb.__unstableMotion.div,a=`link-control-settings-drawer-${(0,EI.useInstanceId)(Xoe)}`;return(0,gc.jsxs)(gc.Fragment,{children:[(0,gc.jsx)(gb.Button,{__next40pxDefaultSize:!0,className:"block-editor-link-control__drawer-toggle","aria-expanded":t,onClick:()=>o(!t),icon:(0,TI.isRTL)()?ev:tu,"aria-controls":a,children:(0,TI._x)("Advanced","Additional link settings")}),(0,gc.jsx)(n,{children:t&&(0,gc.jsx)(i,{className:"block-editor-link-control__drawer",hidden:!t,id:a,initial:"collapsed",animate:"open",exit:"collapsed",variants:{open:{opacity:1,height:"auto"},collapsed:{opacity:0,height:0}},transition:{duration:.1},children:(0,gc.jsx)("div",{className:"block-editor-link-control__drawer-inner",children:e})})})]})}var Qoe=Xoe;var LI=l(R(),1),iF=l(N(),1),bre=l(Re(),1);var KS=l(N(),1),cre=l(A(),1);var II=l(N(),1),Joe=l(A(),1),ere=l(R(),1);var J3=l(w(),1),GEe=({searchTerm:e,onClick:t,itemProps:o,buttonText:r})=>{if(!e)return null;let n;return r?n=typeof r=="function"?r(e):r:n=(0,ere.createInterpolateElement)((0,II.sprintf)((0,II.__)("Create: %s"),e),{mark:(0,J3.jsx)("mark",{})}),(0,J3.jsx)(Joe.MenuItem,{...o,iconPosition:"left",icon:Bi,className:"block-editor-link-control__search-item",onClick:t,children:n})},tre=GEe;var bc=l(N(),1),RI=l(A(),1);var ore=l(Fe(),1),kb=l(dn(),1),rre=l(Z(),1),nre=l(Re(),1),bb=l(w(),1),PI={post:{icon:$L,label:(0,bc.__)("Post")},page:{icon:kl,label:(0,bc.__)("Page")},post_tag:{icon:xN,label:(0,bc.__)("Tag")},category:{icon:$O,label:(0,bc.__)("Category")},attachment:{icon:SA,label:(0,bc.__)("Attachment")}};function WEe({isURL:e,suggestion:t}){let o=null;return e?o=ov:t.type in PI&&(o=PI[t.type].icon,t.type==="page"&&(t.isFrontPage&&(o=JA),t.isBlogHome&&(o=DN))),o?(0,bb.jsx)(we,{className:"block-editor-link-control__search-item-icon",icon:o}):null}function $Ee(e){return e?.trim()?.length?e?.replace(/^\/?/,"/"):e}function KEe(e){return e?.trim()?.length?e?.replace(/\/$/,""):e}var YEe=(e,...t)=>(...o)=>e(...o,...t),qEe=e=>t=>t==null||t!==t?e:t;function ZEe(e){return e&&(0,rre.pipe)(kb.safeDecodeURI,kb.getPath,qEe(""),YEe(kb.filterURLForDisplay,24),KEe,$Ee)(e)}var ire=({itemProps:e,suggestion:t,searchTerm:o,onClick:r,isURL:n=!1,shouldShowType:i=!1})=>{let s=n?(0,bc.__)("Press ENTER to add this link"):ZEe(t.url);return(0,bb.jsx)(RI.MenuItem,{...e,info:s,iconPosition:"left",icon:(0,bb.jsx)(WEe,{suggestion:t,isURL:n}),onClick:r,shortcut:i&&XEe(t),className:"block-editor-link-control__search-item",children:(0,bb.jsx)(RI.TextHighlight,{text:(0,ore.__unstableStripHTML)(t.title),highlight:o})})};function XEe(e){return e.isFrontPage?(0,bc.__)("Front page"):e.isBlogHome?(0,bc.__)("Blog home"):e.type in PI?PI[e.type].label:e.type}var sre=ire,are=e=>((0,nre.default)("wp.blockEditor.__experimentalLinkControlSearchItem",{since:"6.8"}),(0,bb.jsx)(ire,{...e}));var lre=l(N(),1),Zm="__CREATE__",eF="tel",OI="link",tF="mailto",oF="internal",vb=[OI,tF,eF,oF],rF=[{id:"opensInNewTab",title:(0,lre.__)("Open in new tab")}];var ure=l(Re(),1),Xm=l(w(),1);function dre({withCreateSuggestion:e,currentInputValue:t,handleSuggestionClick:o,suggestionsListProps:r,buildSuggestionItemProps:n,suggestions:i,selectedSuggestion:s,isLoading:a,isInitialSuggestions:c,createSuggestionButtonText:u,suggestionsQuery:d}){let f=V("block-editor-link-control__search-results",{"is-loading":a}),m=i.length===1&&vb.includes(i[0].type),h=e&&!m&&!c,p=!d?.type,g=c?(0,KS.__)("Suggestions"):(0,KS.sprintf)((0,KS.__)('Search results for "%s"'),t);return(0,Xm.jsx)("div",{className:"block-editor-link-control__search-results-wrapper",children:(0,Xm.jsx)("div",{...r,className:f,"aria-label":g,children:(0,Xm.jsx)(cre.MenuGroup,{children:i.map((b,v)=>h&&Zm===b.type?(0,Xm.jsx)(tre,{searchTerm:t,buttonText:u,onClick:()=>o(b),itemProps:n(b,v),isSelected:v===s},b.type):Zm===b.type?null:(0,Xm.jsx)(sre,{itemProps:n(b,v),suggestion:b,index:v,onClick:()=>{o(b)},isSelected:v===s,isURL:vb.includes(b.type),searchTerm:t,shouldShowType:p,isFrontPage:b?.isFrontPage,isBlogHome:b?.isBlogHome},`${b.id}-${b.type}`))})})})}var fre=dre,mre=e=>((0,ure.default)("wp.blockEditor.__experimentalLinkControlSearchResults",{since:"6.8"}),(0,Xm.jsx)(dre,{...e}));var pre=l(R(),1),hre=l(F(),1);var AI=l(dn(),1);function YS(e){let t=e?.trim();if(!t)return{url:t,type:OI};let o=OI,r=(0,AI.getProtocol)(t)||"";return r.includes("mailto")?o=tF:r.includes("tel")?o=eF:t?.startsWith("#")&&(o=oF),gf(t)||bf(t)||t.startsWith("?")||r?{url:t,type:o}:{url:(0,AI.prependHTTPS)(t),type:o}}var QEe=()=>Promise.resolve([]),JEe=e=>{let{url:t,type:o}=YS(e);return Promise.resolve([{id:e,title:e,url:t,type:o}])},eTe=async(e,t,o,r,n,i)=>{let{isInitialSuggestions:s}=t,a=await o(e,t);return a.map(c=>Number(c.id)===n?(c.isFrontPage=!0,c):(Number(c.id)===i&&(c.isBlogHome=!0),c)),s||kf(e)||!r?a:a.concat({title:e,url:e,type:Zm})};function gre(e,t,o){let{fetchSearchSuggestions:r,pageOnFront:n,pageForPosts:i}=(0,hre.useSelect)(a=>{let{getSettings:c}=a(_);return{pageOnFront:c().pageOnFront,pageForPosts:c().pageForPosts,fetchSearchSuggestions:c().__experimentalFetchLinkSuggestions}},[]),s=t?JEe:QEe;return(0,pre.useCallback)((a,{isInitialSuggestions:c})=>kf(a)?s(a,{isInitialSuggestions:c}):eTe(a,{...e,isInitialSuggestions:c},r,o,n,i),[s,r,n,i,e,o])}var yb=l(w(),1),tTe=()=>Promise.resolve([]),nF=()=>{},kre=(0,LI.forwardRef)(({value:e,children:t,currentLink:o={},className:r=null,placeholder:n=null,withCreateSuggestion:i=!1,onCreateSuggestion:s=nF,onChange:a=nF,onSelect:c=nF,showSuggestions:u=!0,renderSuggestions:d=C=>(0,yb.jsx)(fre,{...C}),fetchSuggestions:f=null,allowDirectEntry:m=!0,showInitialSuggestions:h=!1,suggestionsQuery:p={},withURLSuggestion:g=!0,createSuggestionButtonText:b,hideLabelFromVision:v=!1,suffix:k,isEntity:y=!1,customValidity:S},x)=>{let C=gre(p,m,i,g),B=u?f||C:tTe,[I,P]=(0,LI.useState)(),E=(U,G)=>{a(U),P(G)},L=U=>d({...U,withCreateSuggestion:i,createSuggestionButtonText:b,suggestionsQuery:p,handleSuggestionClick:G=>{U.handleSuggestionClick&&U.handleSuggestionClick(G),T(G)}}),T=async U=>{let G=U;if(Zm===U.type){try{G=await s(U.title),G?.url&&c(G)}catch{}return}if(m||G&&Object.keys(G).length>=1){let{id:j,url:z,kind:W,type:ee,...se}=o??{};c({...se,...G},G)}},O=n??(0,iF.__)("Search or type URL"),D=v&&n!==""?O:(0,iF.__)("Link");return(0,yb.jsxs)("div",{className:"block-editor-link-control__search-input-container",children:[(0,yb.jsx)(Td,{disableSuggestions:o?.url===e,label:D,hideLabelFromVision:v,className:r,value:e,onChange:E,placeholder:O,__experimentalRenderSuggestions:u?L:null,__experimentalFetchLinkSuggestions:B,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:h,customValidity:S,required:!1,onSubmit:(U,G)=>{let j=U||I;!j&&!e?.trim()?.length?G.preventDefault():T(j||{url:e})},inputRef:x,suffix:k,disabled:y}),t]})}),vre=kre,yre=e=>((0,bre.default)("wp.blockEditor.__experimentalLinkControlSearchInput",{since:"6.8"}),(0,yb.jsx)(kre,{...e}));var Id=l(N(),1),Lo=l(A(),1),Cre=l(Z(),1),DI=l(dn(),1);var Bre=l(Fe(),1),VI=l(F(),1),Ere=l(Un(),1),Tre=l(Zp(),1);var Sre=l(A(),1),{Slot:_re,Fill:xre}=(0,Sre.createSlotFill)("BlockEditorLinkControlViewer");var wre=l(F(),1),NI=l(R(),1);function oTe(e,t){switch(t.type){case"RESOLVED":return{...e,isFetching:!1,richData:t.richData};case"ERROR":return{...e,isFetching:!1,richData:null};case"LOADING":return{...e,isFetching:!0};default:throw new Error(`Unexpected action type ${t.type}`)}}function rTe(e){let[t,o]=(0,NI.useReducer)(oTe,{richData:null,isFetching:!1}),{fetchRichUrlData:r}=(0,wre.useSelect)(n=>{let{getSettings:i}=n(_);return{fetchRichUrlData:i().__experimentalFetchRichUrlData}},[]);return(0,NI.useEffect)(()=>{if(e?.length&&r&&typeof AbortController<"u"){o({type:"LOADING"});let n=new window.AbortController,i=n.signal;return r(e,{signal:i}).then(s=>{o({type:"RESOLVED",richData:s})}).catch(()=>{i.aborted||o({type:"ERROR"})}),()=>{n.abort()}}},[e]),t}var MI=rTe;var vt=l(w(),1),{Badge:nTe}=M(Lo.privateApis);function Ire({value:e,onEditClick:t,hasRichPreviews:o=!1,hasUnlinkControl:r=!1,onRemove:n}){let i=(0,VI.useSelect)(b=>b(Tre.store).get("core","showIconLabels"),[]),s=o?e?.url:null,{richData:a,isFetching:c}=MI(s),u=a&&Object.keys(a).length,d=e&&(0,DI.filterURLForDisplay)((0,DI.safeDecodeURI)(e.url),24)||"",f=!e?.url?.length,m=!f&&(0,Bre.__unstableStripHTML)(a?.title||e?.title||d),h;a?.icon?h=(0,vt.jsx)("img",{src:a?.icon,alt:""}):f?h=(0,vt.jsx)(we,{icon:oL,size:32}):h=(0,vt.jsx)(we,{icon:ov});let{createNotice:p}=(0,VI.useDispatch)(Ere.store),g=(0,Cre.useCopyToClipboard)(e.url,()=>{p("info",(0,Id.__)("Link copied to clipboard."),{isDismissible:!0,type:"snackbar"})});return(0,vt.jsx)(Lo.Flex,{role:"group","aria-label":(0,Id.__)("Manage link"),className:V("block-editor-link-control__preview",{"is-current":!0,"is-rich":u,"is-fetching":!!c,"is-preview":!0,"is-error":f,"is-url-title":m===d}),children:(0,vt.jsxs)(Lo.Flex,{gap:0,align:"flex-start",children:[(0,vt.jsxs)(Lo.Flex,{className:"block-editor-link-control__link-information",role:"figure","aria-label":(0,Id.__)("Link information"),justify:"start",align:"flex-start",children:[e?.image?(0,vt.jsx)(Lo.Flex,{className:"block-editor-link-control__preview-image",justify:"center",children:(0,vt.jsx)("img",{src:e?.image,alt:""})}):(0,vt.jsx)(Lo.Flex,{className:V("block-editor-link-control__preview-icon",{"is-image":a?.icon}),justify:"center",children:h}),(0,vt.jsx)(Lo.Flex,{className:"block-editor-link-control__preview-details",direction:"column",gap:2,children:f?(0,vt.jsx)("span",{className:"block-editor-link-control__preview-error-notice",children:(0,Id.__)("Link is empty")}):(0,vt.jsxs)(vt.Fragment,{children:[(0,vt.jsx)(Lo.ExternalLink,{className:"block-editor-link-control__preview-title",href:e.url,children:(0,vt.jsx)(Lo.__experimentalTruncate,{numberOfLines:1,children:m})}),(0,vt.jsx)("span",{className:"block-editor-link-control__preview-info",children:(0,vt.jsx)(Lo.__experimentalTruncate,{numberOfLines:1,children:d})}),e?.badges?.length>0&&(0,vt.jsx)(Lo.__experimentalHStack,{className:"block-editor-link-control__preview-badges",alignment:"left",gap:1,children:e.badges.map((b,v)=>(0,vt.jsx)(nTe,{intent:b.intent,children:b.label},`${b.label}|${b.intent}|${v}`))})]})})]}),(0,vt.jsx)(Lo.Button,{icon:Of,label:(0,Id.__)("Edit link"),onClick:t,size:"compact",showTooltip:!i}),r&&(0,vt.jsx)(Lo.Button,{icon:Ci,label:(0,Id.__)("Remove link"),onClick:n,size:"compact",showTooltip:!i}),(0,vt.jsx)(Lo.Button,{icon:nA,label:(0,Id.__)("Copy link"),ref:g,accessibleWhenDisabled:!0,disabled:f,size:"compact",showTooltip:!i}),(0,vt.jsx)(_re,{fillProps:e})]})})}var Pre=l(N(),1),FI=l(A(),1),Sb=l(w(),1),iTe=()=>{},sTe=({value:e,onChange:t=iTe,settings:o})=>{if(!o||!o.length)return null;let r=i=>s=>{t({...e,[i.id]:s})},n=o.map(i=>{if("render"in i){if(typeof i.render=="function"){let s=i.render(i,e,t);return(0,Sb.jsx)("div",{className:"block-editor-link-control__setting",children:s},i.id)}return null}return(0,Sb.jsx)(FI.CheckboxControl,{className:"block-editor-link-control__setting",label:i.title,onChange:r(i),checked:e?!!e[i.id]:!1,help:i?.help},i.id)}).filter(Boolean);return(0,Sb.jsxs)("fieldset",{className:"block-editor-link-control__settings",children:[(0,Sb.jsx)(FI.VisuallyHidden,{as:"legend",children:(0,Pre.__)("Currently selected link settings")}),n]})},Rre=sTe;var Ore=l(N(),1),Qm=l(R(),1);function Are(e){let t=(0,Qm.useRef)(),[o,r]=(0,Qm.useState)(!1),[n,i]=(0,Qm.useState)(null),s=async function(a){r(!0),i(null);try{return t.current=aTe(Promise.resolve(e(a))),await t.current.promise}catch(c){if(c&&c.isCanceled)return;throw i(c.message||(0,Ore.__)("An unknown error occurred during creation. Please try again.")),c}finally{r(!1)}};return(0,Qm.useEffect)(()=>()=>{t.current&&t.current.cancel()},[]),{createPage:s,isCreatingPage:o,errorMessage:n}}var aTe=e=>{let t=!1;return{promise:new Promise((r,n)=>{e.then(i=>t?n({isCanceled:!0}):r(i),i=>n(t?{isCanceled:!0}:i))}),cancel(){t=!0}}};var sF=l(R(),1),Mre=l(Nre(),1);function Dre(e){let[t,o]=(0,sF.useState)(e||{}),[r,n]=(0,sF.useState)(e);return(0,Mre.default)(e,r)||(n(e),o(e)),[t,o,c=>{o({...t,url:c})},c=>{o({...t,title:c})},c=>u=>{let d=Object.keys(u).reduce((f,m)=>(c.includes(m)&&(f[m]=u[m]),f),{});o({...t,...d})}]}var Pt=l(w(),1),lF=()=>{},Vre="core/block-editor",Fre="linkControlSettingsDrawer";function Jm({searchInputPlaceholder:e,value:t,settings:o=rF,onChange:r=lF,onInputChange:n,onRemove:i,onCancel:s,noDirectEntry:a=!1,showSuggestions:c=!0,showInitialSuggestions:u,forceIsEditingLink:d,createSuggestion:f,withCreateSuggestion:m,inputValue:h="",suggestionsQuery:p={},noURLSuggestion:g=!1,createSuggestionButtonText:b,hasRichPreviews:v=!1,hasTextControl:k=!1,renderControlBottom:y=null,handleEntities:S=!1}){m===void 0&&f&&(m=!0);let[x,C]=(0,no.useState)(!1),[B,I]=(0,no.useState)(void 0),{advancedSettingsPreference:P}=(0,zI.useSelect)(ge=>({advancedSettingsPreference:ge(aF.store).get(Vre,Fre)??!1}),[]),{set:E}=(0,zI.useDispatch)(aF.store),L=ge=>{E&&E(Vre,Fre,ge),C(ge)},T=P||x,O=(0,no.useRef)(!0),D=(0,no.useRef)(),U=(0,no.useRef)(),G=(0,no.useRef)(),j=(0,no.useRef)(),z=o.map(({id:ge})=>ge),[W,ee,se,ce,ie]=Dre(t),re=ge=>{se(ge),n?.(ge)},Q=S&&!!W?.id,Y=(0,zre.useInstanceId)(Jm,"link-control"),J=Q?`${Y}__help`:null,K=t&&!(0,Hre.isShallowEqualObjects)(W,t),[H,X]=(0,no.useState)(d!==void 0?d:!t||!t.url),{createPage:ne,isCreatingPage:le,errorMessage:ve}=Are(f);(0,no.useEffect)(()=>{d!==void 0&&X(d)},[d]),(0,no.useEffect)(()=>{if(O.current)return;(jre.focus.focusable.find(D.current)[0]||D.current).focus()},[H,le]),(0,no.useEffect)(()=>(O.current=!1,()=>{O.current=!0}),[]);let he=(0,no.useRef)();(0,no.useEffect)(()=>{if(he.current===void 0){he.current=h;return}he.current!==h&&(console.warn("LinkControl: The inputValue prop is uncontrolled and only sets the initial value. onInputChange is an observer for the input value. Changes to inputValue from the parent will not update the search input."),he.current=h)},[h]),(0,no.useEffect)(()=>{if(B?.type==="invalid"){let ge=G.current;ge&&typeof ge.reportValidity=="function"&&ge.reportValidity()}},[B]);let xe=t?.url?.trim()?.length>0,ze=()=>{X(!1)},ot=ge=>{let Ct={type:"invalid",message:(0,Qs.__)("Please enter a valid URL.")},Io={type:"valid"},Ke=ge?.trim();if(!Ke?.length||!kf(Ke))return Ct;if(gf(Ke)||bf(Ke))return Io;let te=(0,jI.prependHTTPS)(Ke);return(0,jI.isURL)(te)?Io:Ct},Wt=ge=>{if(!(ge&&ge.id&&ge.type&&!vb.includes(ge.type))){let Ke=ge?.url||$t,te=ot(Ke);if(te.type==="invalid"){I(te);return}let{url:Le}=YS(Ke);ge={...ge,url:Le}}ge?.kind==="taxonomy"&&ge?.url&&(j.current=ge.url);let Io=Object.keys(ge).reduce((Ke,te)=>(z.includes(te)||(Ke[te]=ge[te]),Ke),{});r({...W,...Io,title:W?.title||ge?.title}),I(void 0),ze()},fo=()=>{if(lr)return!1;let ge=$t.trim(),Ct=W&&W.id&&W.type&&!vb.includes(W.type),Io=t?.url===ge;if(Ct&&Io)return I(void 0),!0;let Ke=ot($t);return Ke.type==="invalid"?(I(Ke),!1):(I(void 0),!0)},Do=()=>{K&&r({...t,...W,url:YS($t).url}),ze(),I(void 0)},rt=()=>{fo()&&Do()},ar=ge=>{let{keyCode:Ct}=ge;Ct===Ure.ENTER&&!lr&&(ge.preventDefault(),rt())},xt=()=>{ee(t)},At=ge=>{ge.preventDefault(),ge.stopPropagation(),xt(),I(void 0),xe?ze():i?.(),s?.()},[Pe,wt]=(0,no.useState)(!1),qo=()=>{let{id:ge,kind:Ct,type:Io,...Ke}=W;ee({...Ke,id:void 0,kind:void 0,type:void 0,url:void 0}),wt(!0)};(0,no.useEffect)(()=>{Pe&&(G.current?.focus(),wt(!1))},[Pe]);let $t=W?.url!==void 0?W.url:h||"",lr=!$t?.trim()?.length;(0,no.useEffect)(()=>{I(void 0)},[$t]);let ln=!B,je=i&&t&&!H&&!le,Eo=H&&xe,Ze=xe&&k,Ve=(H||!t)&&!le,gt=lr||!ln||t&&!K,To=!!o?.length&&H&&xe,cr=(0,no.useMemo)(()=>t?.kind==="taxonomy"&&!t?.url&&j.current?{...t,url:j.current}:t,[t]);return(0,Pt.jsxs)("div",{tabIndex:-1,ref:D,className:"block-editor-link-control",children:[le&&(0,Pt.jsxs)("div",{className:"block-editor-link-control__loading",children:[(0,Pt.jsx)(Qr.Spinner,{})," ",(0,Qs.__)("Creating"),"\u2026"]}),Ve&&(0,Pt.jsxs)(Pt.Fragment,{children:[(0,Pt.jsxs)("div",{className:V({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":Ze,"has-actions":Eo}),children:[Ze&&(0,Pt.jsx)(Qr.TextControl,{ref:U,className:"block-editor-link-control__field block-editor-link-control__text-content",label:(0,Qs.__)("Text"),value:W?.title,onChange:ce,onKeyDown:ar,__next40pxDefaultSize:!0}),(0,Pt.jsx)(vre,{ref:G,currentLink:t,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:e,value:$t,withCreateSuggestion:m,onCreateSuggestion:ne,onChange:re,onSelect:Wt,showInitialSuggestions:u,allowDirectEntry:!a,showSuggestions:c,suggestionsQuery:p,withURLSuggestion:!g,createSuggestionButtonText:b,hideLabelFromVision:!Ze,isEntity:Q,customValidity:B,suffix:(0,Pt.jsx)(lTe,{isEntity:Q,showActions:Eo,isDisabled:gt,onUnlink:qo,onSubmit:rt,helpTextId:J})}),Q&&J&&(0,Pt.jsx)("p",{id:J,className:"block-editor-link-control__help",children:(0,Qs.sprintf)((0,Qs.__)("Synced with the selected %s."),W?.type||"item")})]}),ve&&(0,Pt.jsx)(Qr.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1,children:ve})]}),t&&!H&&!le&&(0,Pt.jsx)(Ire,{value:cr,onEditClick:()=>X(!0),hasRichPreviews:v,hasUnlinkControl:je,onRemove:()=>{i(),X(!0)}},cr?.url),To&&(0,Pt.jsx)("div",{className:"block-editor-link-control__tools",children:!lr&&(0,Pt.jsx)(Qoe,{settingsOpen:T,setSettingsOpen:L,children:(0,Pt.jsx)(Rre,{value:W,settings:o,onChange:ie(z)})})}),Eo&&(0,Pt.jsxs)(Qr.__experimentalHStack,{justify:"right",className:"block-editor-link-control__search-actions",children:[(0,Pt.jsx)(Qr.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:At,children:(0,Qs.__)("Cancel")}),(0,Pt.jsx)(Qr.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:gt?lF:rt,className:"block-editor-link-control__search-submit","aria-disabled":gt,children:(0,Qs.__)("Apply")})]}),!le&&y&&y()]})}function lTe({isEntity:e,showActions:t,isDisabled:o,onUnlink:r,onSubmit:n,helpTextId:i}){if(e)return(0,Pt.jsx)(Qr.Button,{icon:Ci,onClick:r,"aria-describedby":i,showTooltip:!0,label:(0,Qs.__)("Unsync and edit"),__next40pxDefaultSize:!0});if(!t)return(0,Pt.jsx)(Qr.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,Pt.jsx)(Qr.Button,{onClick:o?lF:n,label:(0,Qs.__)("Submit"),icon:bl,className:"block-editor-link-control__search-submit","aria-disabled":o,size:"small"})})}Jm.ViewerFill=xre;Jm.DEFAULT_LINK_SETTINGS=rF;var UI=e=>((0,Gre.default)("wp.blockEditor.__experimentalLinkControl",{since:"6.8",alternative:"wp.blockEditor.LinkControl"}),(0,Pt.jsx)(Jm,{...e}));UI.ViewerFill=Jm.ViewerFill;UI.DEFAULT_LINK_SETTINGS=Jm.DEFAULT_LINK_SETTINGS;var Pd=Jm;var $re=l(N(),1),Kre=l(A(),1),Yre=l(Re(),1);var qS=1.5,cF=.01,uF=10,dF="";function Wre(e){return e!==void 0&&e!==dF}var fF=l(w(),1),cTe=({__next40pxDefaultSize:e=!1,value:t,onChange:o,__unstableInputWidth:r="60px",...n})=>{let i=Wre(t),s=(d,f)=>{if(i)return d;let m=cF*uF;switch(`${d}`){case`${m}`:return qS+m;case"0":return f?d:qS-m;case"":return qS;default:return d}},a=(d,f)=>{let m=["insertText","insertFromPaste"].includes(f.payload.event.nativeEvent?.inputType),h=s(d.value,m);return{...d,value:h}},c=i?t:dF,u=(d,{event:f})=>{if(d===""){o();return}if(f.type==="click"){o(s(`${d}`,!1));return}o(`${d}`)};return!e&&(n.size===void 0||n.size==="default")&&(0,Yre.default)("36px default size for wp.blockEditor.LineHeightControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."}),(0,fF.jsx)("div",{className:"block-editor-line-height-control",children:(0,fF.jsx)(Kre.__experimentalNumberControl,{...n,__shouldNotWarnDeprecated36pxSize:!0,__next40pxDefaultSize:e,__unstableInputWidth:r,__unstableStateReducer:a,onChange:u,label:(0,$re.__)("Line height"),placeholder:qS,step:cF,spinFactor:uF,value:c,min:0,spinControls:"custom"})})},HI=cTe;var Ha=l(N(),1),qre=l(Xo(),1),Jr=l(A(),1),WI=l(F(),1),Zre=l(it(),1);var Xre=l(Z(),1),Qre=l(Fe(),1),Jre=l(Un(),1),ene=l(R(),1);function GI(e,t,o){if(o)return o;if(!t||typeof t!="object"||Object.keys(t).length===0)return e&&e.length>0?e.map(n=>`${n}/*`).join(","):void 0;if(!e||e.length===0)return;let r=[];for(let[,n]of Object.entries(t))e.some(s=>s.includes("/")?n===s:n.startsWith(`${s}/`))&&r.push(n);return r.length>0?r.join(","):e.map(n=>`${n}/*`).join(",")}var rr=l(w(),1),uTe=()=>{},dTe=0,fTe=({mediaURL:e,mediaId:t,mediaIds:o,allowedTypes:r,accept:n,onError:i,onSelect:s,onSelectURL:a,onReset:c,onToggleFeaturedImage:u,useFeaturedImage:d,onFilesUpload:f=uTe,name:m=(0,Ha.__)("Replace"),createNotice:h,removeNotice:p,children:g,multiple:b=!1,addToGallery:v,handleUpload:k=!0,variant:y,popoverProps:S,renderToggle:x,className:C})=>{let{mediaUpload:B,allowedMimeTypes:I}=(0,WI.useSelect)(z=>{let{getSettings:W}=z(_),ee=W();return{mediaUpload:ee.mediaUpload,allowedMimeTypes:ee.allowedMimeTypes}},[]),P=`block-editor/media-replace-flow/error-notice/${++dTe}`,E=(0,ene.useMemo)(()=>GI(r,I,n),[r,I,n]),L=z=>{let W=(0,Qre.__unstableStripHTML)(z);if(i){i(W);return}setTimeout(()=>{h("error",W,{speak:!0,id:P,isDismissible:!0})},1e3)},T=(z,W)=>{d&&u&&u(),W(),s(z),(0,qre.speak)((0,Ha.__)("The media file has been replaced")),p(P)},O=(z,W)=>{let ee=z.target.files;if(!k)return W(),s(ee);f(ee),B({allowedTypes:r,filesList:ee,onFileChange:([se])=>{T(se,W)},onError:L})},D=z=>{z.keyCode===Zre.DOWN&&(z.preventDefault(),z.target.click())},G=b&&(!r||r.length===0?!1:r.every(z=>z==="image"||z.startsWith("image/"))),j={...S,variant:y};return(0,rr.jsx)(Jr.Dropdown,{popoverProps:j,className:C,contentClassName:V("block-editor-media-replace-flow__options",y&&`is-variant-${y}`),renderToggle:({isOpen:z,onToggle:W})=>x?x({"aria-expanded":z,"aria-haspopup":"true",onClick:W,onKeyDown:D,children:m}):(0,rr.jsx)(Jr.ToolbarButton,{"aria-expanded":z,"aria-haspopup":"true",onClick:W,onKeyDown:D,children:m}),renderContent:({onClose:z})=>(0,rr.jsxs)(rr.Fragment,{children:[(0,rr.jsxs)(Jr.NavigableMenu,{className:"block-editor-media-replace-flow__media-upload-menu",children:[(0,rr.jsxs)(Ds,{children:[(0,rr.jsx)(qu,{gallery:G,addToGallery:v,multiple:b,value:b?o:t,onSelect:W=>T(W,z),allowedTypes:r,render:({open:W})=>(0,rr.jsx)(Jr.MenuItem,{icon:jp,onClick:W,children:(0,Ha.__)("Open Media Library")})}),(0,rr.jsx)(Jr.FormFileUpload,{onChange:W=>{O(W,z)},accept:E,multiple:!!b,render:({openFileDialog:W})=>(0,rr.jsx)(Jr.MenuItem,{icon:NN,onClick:()=>{W()},children:(0,Ha._x)("Upload","verb")})})]}),u&&(0,rr.jsx)(Jr.MenuItem,{icon:GL,onClick:u,isPressed:d,children:(0,Ha.__)("Use featured image")}),typeof g=="function"?g({onClose:z}):g,e&&c&&(0,rr.jsx)(Jr.MenuItem,{onClick:()=>{c(),z()},children:(0,Ha.__)("Reset")})]}),a&&(0,rr.jsxs)("form",{className:"block-editor-media-flow__url-input",children:[(0,rr.jsx)("span",{className:"block-editor-media-replace-flow__image-url-label",children:(0,Ha.__)("Current media URL:")}),(0,rr.jsx)(Pd,{value:{url:e},settings:[],showSuggestions:!1,onChange:({url:W})=>{a(W)},searchInputPlaceholder:(0,Ha.__)("Paste or type URL")})]})]})})},_b=(0,Xre.compose)([(0,WI.withDispatch)(e=>{let{createNotice:t,removeNotice:o}=e(Jre.store);return{createNotice:t,removeNotice:o}}),(0,Jr.withFilters)("editor.MediaReplaceFlow")])(fTe);var _o=l(A(),1),So=l(N(),1),Ld=l(R(),1),pne=l(F(),1);var hne=l(Re(),1);var pF=l(N(),1),KI=l(R(),1),xb=l(A(),1);var mne=l(Re(),1);var rne=l(N(),1),nne=l(A(),1);var tne=l(A(),1),$I=l(dn(),1),mF=l(w(),1);function one({url:e,urlLabel:t,className:o}){let r=V(o,"block-editor-url-popover__link-viewer-url");return e?(0,mF.jsx)(tne.ExternalLink,{className:r,href:e,children:t||(0,$I.filterURLForDisplay)((0,$I.safeDecodeURI)(e))}):(0,mF.jsx)("span",{className:r})}var ZS=l(w(),1);function ine({className:e,linkClassName:t,onEditLinkClick:o,url:r,urlLabel:n,...i}){return(0,ZS.jsxs)("div",{className:V("block-editor-url-popover__link-viewer",e),...i,children:[(0,ZS.jsx)(one,{url:r,urlLabel:n,className:t}),o&&(0,ZS.jsx)(nne.Button,{icon:Of,label:(0,rne.__)("Edit"),onClick:o,size:"compact"})]})}var une=l(N(),1),dne=l(A(),1);var kc=l(N(),1),XS=l(R(),1),Js=l(it(),1),Tn=l(A(),1),Rd=l(Z(),1),sne=l(F(),1),ane=l(dn(),1);var Ga=l(w(),1),lne=l(jr(),1),{ValidatedInputControl:mTe}=M(Tn.privateApis);function cne(e){return typeof e=="function"}var pTe=class extends XS.Component{constructor(e){super(e),this.onChange=this.onChange.bind(this),this.onFocus=this.onFocus.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.selectLink=this.selectLink.bind(this),this.handleOnClick=this.handleOnClick.bind(this),this.bindSuggestionNode=this.bindSuggestionNode.bind(this),this.autocompleteRef=e.autocompleteRef||(0,XS.createRef)(),this.inputRef=e.inputRef||(0,XS.createRef)(),this.hasRenderedValidation={current:!1},this.updateSuggestions=(0,Rd.debounce)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.suggestionsRequest=null,this.state={suggestions:[],showSuggestions:!1,suggestionsValue:null,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:""}}componentDidUpdate(e){let{showSuggestions:t,selectedSuggestion:o}=this.state,{value:r,__experimentalShowInitialSuggestions:n=!1}=this.props;t&&o!==null&&this.suggestionNodes[o]&&this.suggestionNodes[o].scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"}),e.value!==r&&!this.props.disableSuggestions&&(r?.length?this.updateSuggestions(r):n&&this.updateSuggestions())}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){this.suggestionsRequest?.cancel?.(),this.suggestionsRequest=null}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){let{__experimentalShowInitialSuggestions:e=!1,value:t}=this.props;return e&&!(t&&t.length)}updateSuggestions(e=""){let{__experimentalFetchLinkSuggestions:t,__experimentalHandleURLSuggestions:o}=this.props;if(!t)return;let r=!e?.length;if(e=e.trim(),!r&&(e.length<2||!o&&(0,ane.isURL)(e))){this.suggestionsRequest?.cancel?.(),this.suggestionsRequest=null,this.setState({suggestions:[],showSuggestions:!1,suggestionsValue:e,selectedSuggestion:null,loading:!1});return}this.setState({selectedSuggestion:null,loading:!0});let n=t(e,{isInitialSuggestions:r});n.then(i=>{this.suggestionsRequest===n&&(this.setState({suggestions:i,suggestionsValue:e,loading:!1,showSuggestions:!!i.length}),i.length?this.props.debouncedSpeak((0,kc.sprintf)((0,kc._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",i.length),i.length),"assertive"):this.props.debouncedSpeak((0,kc.__)("No results."),"assertive"))}).catch(()=>{this.suggestionsRequest===n&&this.setState({loading:!1})}).finally(()=>{this.suggestionsRequest===n&&(this.suggestionsRequest=null)}),this.suggestionsRequest=n}onChange(e){this.props.onChange(e)}onFocus(){let{suggestions:e}=this.state,{disableSuggestions:t,value:o}=this.props;o&&!t&&!(e&&e.length)&&this.suggestionsRequest===null&&this.updateSuggestions(o)}onKeyDown(e){this.props.onKeyDown?.(e);let{showSuggestions:t,selectedSuggestion:o,suggestions:r,loading:n}=this.state;if(!t||!r.length||n){switch(e.keyCode){case Js.UP:{e.target.selectionStart!==0&&(e.preventDefault(),e.target.setSelectionRange(0,0));break}case Js.DOWN:{this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break}case Js.ENTER:{this.props.onSubmit&&(e.preventDefault(),this.props.onSubmit(null,e));break}}return}let i=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case Js.UP:{e.preventDefault();let s=o?o-1:r.length-1;this.setState({selectedSuggestion:s});break}case Js.DOWN:{e.preventDefault();let s=o===null||o===r.length-1?0:o+1;this.setState({selectedSuggestion:s});break}case Js.TAB:{this.state.selectedSuggestion!==null&&(this.selectLink(i),this.props.speak((0,kc.__)("Link selected.")));break}case Js.ENTER:{e.preventDefault(),this.state.selectedSuggestion!==null?(this.selectLink(i),this.props.onSubmit&&this.props.onSubmit(i,e)):this.props.onSubmit&&this.props.onSubmit(null,e);break}}}selectLink(e){this.props.onChange(e.url,e),this.setState({selectedSuggestion:null,showSuggestions:!1})}handleOnClick(e){this.selectLink(e),this.inputRef.current.focus()}static getDerivedStateFromProps({value:e,instanceId:t,disableSuggestions:o,__experimentalShowInitialSuggestions:r=!1},{showSuggestions:n}){let i=n,s=e&&e.length;return!r&&!s&&(i=!1),o===!0&&(i=!1),{showSuggestions:i,suggestionsListboxId:`block-editor-url-input-suggestions-${t}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${t}`}}render(){return(0,Ga.jsxs)(Ga.Fragment,{children:[this.renderControl(),this.renderSuggestions()]})}renderControl(){let{label:e=null,className:t,isFullWidth:o,instanceId:r,placeholder:n=(0,kc.__)("Paste URL or type to search"),__experimentalRenderControl:i,value:s="",hideLabelFromVision:a=!1,help:c=null,disabled:u=!1,customValidity:d,markWhenOptional:f}=this.props,{loading:m,showSuggestions:h,selectedSuggestion:p,suggestionsListboxId:g,suggestionOptionIdPrefix:b}=this.state,v=`url-input-control-${r}`,k={id:v,label:e,className:V("block-editor-url-input",t,{"is-full-width":o}),hideLabelFromVision:a},y={id:v,value:s,required:this.props.required??!0,type:"text",name:v,autoComplete:"off",onChange:u?()=>{}:this.onChange,onFocus:u?()=>{}:this.onFocus,placeholder:n,onKeyDown:u?()=>{}:this.onKeyDown,role:"combobox","aria-label":e?void 0:(0,kc.__)("URL"),"aria-expanded":h,"aria-autocomplete":"list","aria-owns":g,"aria-activedescendant":p!==null?`${b}-${p}`:void 0,ref:this.inputRef,disabled:u,suffix:this.props.suffix,help:c},S={customValidity:d,...f!==void 0&&{markWhenOptional:f}};if(i)return i(k,y,m);d!==void 0&&(this.hasRenderedValidation.current=!0);let x=this.hasRenderedValidation.current?mTe:Tn.__experimentalInputControl;return(0,Ga.jsxs)(Tn.BaseControl,{...k,children:[(0,Ga.jsx)(x,{...y,...this.hasRenderedValidation.current?S:{},__next40pxDefaultSize:!0}),m&&(0,Ga.jsx)(Tn.Spinner,{})]})}renderSuggestions(){let{className:e,__experimentalRenderSuggestions:t}=this.props,{showSuggestions:o,suggestions:r,suggestionsValue:n,selectedSuggestion:i,suggestionsListboxId:s,suggestionOptionIdPrefix:a,loading:c}=this.state;if(!o||r.length===0)return null;let u={id:s,ref:this.autocompleteRef,role:"listbox"},d=(f,m)=>({role:"option",tabIndex:"-1",id:`${a}-${m}`,ref:this.bindSuggestionNode(m),"aria-selected":m===i?!0:void 0});return cne(t)?t({suggestions:r,selectedSuggestion:i,suggestionsListProps:u,buildSuggestionItemProps:d,isLoading:c,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:!n?.length,currentInputValue:n}):(0,Ga.jsx)(Tn.Popover,{placement:"bottom",focusOnMount:!1,children:(0,Ga.jsx)("div",{...u,className:V("block-editor-url-input__suggestions",{[`${e}__suggestions`]:e}),children:r.map((f,m)=>(0,lne.createElement)(Tn.Button,{__next40pxDefaultSize:!0,...d(f,m),key:f.id,className:V("block-editor-url-input__suggestion",{"is-selected":m===i}),onClick:()=>this.handleOnClick(f)},f.title))})})}},Td=(0,Rd.compose)(Rd.withSafeTimeout,Tn.withSpokenMessages,Rd.withInstanceId,(0,sne.withSelect)((e,t)=>{if(cne(t.__experimentalFetchLinkSuggestions))return;let{getSettings:o}=e(_);return{__experimentalFetchLinkSuggestions:o().__experimentalFetchLinkSuggestions}}))(pTe);var QS=l(w(),1);function fne({autocompleteRef:e,className:t,onChangeInputValue:o,value:r,...n}){return(0,QS.jsxs)("form",{className:V("block-editor-url-popover__link-editor",t),...n,children:[(0,QS.jsx)(Td,{value:r,onChange:o,autocompleteRef:e}),(0,QS.jsx)(dne.Button,{icon:bl,label:(0,une.__)("Apply"),type:"submit",size:"compact"})]})}var Od=l(w(),1),{__experimentalPopoverLegacyPositionToPlacement:hTe}=M(xb.privateApis),gTe="bottom",hF=(0,KI.forwardRef)(({additionalControls:e,children:t,renderSettings:o,placement:r,focusOnMount:n="firstElement",position:i,...s},a)=>{i!==void 0&&(0,mne.default)("`position` prop in wp.blockEditor.URLPopover",{since:"6.2",alternative:"`placement` prop"});let c;r!==void 0?c=r:i!==void 0&&(c=hTe(i)),c=c||gTe;let[u,d]=(0,KI.useState)(!1),f=!!o&&u,m=()=>{d(!u)};return(0,Od.jsxs)(xb.Popover,{ref:a,role:"dialog","aria-modal":"true","aria-label":(0,pF.__)("Edit URL"),className:"block-editor-url-popover",focusOnMount:n,placement:c,shift:!0,variant:"toolbar",...s,children:[(0,Od.jsx)("div",{className:"block-editor-url-popover__input-container",children:(0,Od.jsxs)("div",{className:"block-editor-url-popover__row",children:[t,!!o&&(0,Od.jsx)(xb.Button,{className:"block-editor-url-popover__settings-toggle",icon:zn,label:(0,pF.__)("Link settings"),onClick:m,"aria-expanded":u,size:"compact"})]})}),f&&(0,Od.jsx)("div",{className:"block-editor-url-popover__settings",children:o()}),e&&!f&&(0,Od.jsx)("div",{className:"block-editor-url-popover__additional-controls",children:e})]})});hF.LinkEditor=fne;hF.LinkViewer=ine;var Ad=hF;var Ge=l(w(),1),bTe=()=>{},kTe=({src:e,onChange:t,onSubmit:o,onClose:r,popoverAnchor:n})=>(0,Ge.jsx)(Ad,{anchor:n,onClose:r,children:(0,Ge.jsx)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:o,children:(0,Ge.jsx)(_o.__experimentalInputControl,{__next40pxDefaultSize:!0,label:(0,So.__)("URL"),type:"text",hideLabelFromVision:!0,placeholder:(0,So.__)("Paste or type URL"),onChange:t,value:e,suffix:(0,Ge.jsx)(_o.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,Ge.jsx)(_o.Button,{size:"small",icon:bl,label:(0,So.__)("Apply"),type:"submit"})})})})}),vTe=({src:e,onChangeSrc:t,onSelectURL:o})=>{let[r,n]=(0,Ld.useState)(null),[i,s]=(0,Ld.useState)(!1),a=()=>{s(!0)},c=()=>{s(!1),r?.focus()},u=d=>{d.preventDefault(),e&&o&&(o(e),c())};return(0,Ge.jsxs)("div",{className:"block-editor-media-placeholder__url-input-container",children:[(0,Ge.jsx)(_o.Button,{__next40pxDefaultSize:!0,className:"block-editor-media-placeholder__button",onClick:a,isPressed:i,variant:"secondary","aria-haspopup":"dialog",ref:n,children:(0,So.__)("Insert from URL")}),i&&(0,Ge.jsx)(kTe,{src:e,onChange:t,onSubmit:u,onClose:c,popoverAnchor:r})]})};function yTe({value:e={},allowedTypes:t,className:o,icon:r,labels:n={},mediaPreview:i,notices:s,isAppender:a,accept:c,addToGallery:u,multiple:d=!1,handleUpload:f=!0,disableDropZone:m,disableMediaButtons:h,onError:p,onSelect:g,onCancel:b,onSelectURL:v,onToggleFeaturedImage:k,onDoubleClick:y,onFilesPreUpload:S=bTe,onHTMLDrop:x,children:C,mediaLibraryButton:B,placeholder:I,style:P}){x&&(0,hne.default)("wp.blockEditor.MediaPlaceholder onHTMLDrop prop",{since:"6.2",version:"6.4"});let{mediaUpload:E,allowedMimeTypes:L}=(0,pne.useSelect)(Y=>{let{getSettings:J}=Y(_),K=J();return{mediaUpload:K.mediaUpload,allowedMimeTypes:K.allowedMimeTypes}},[]),[T,O]=(0,Ld.useState)("");(0,Ld.useEffect)(()=>{O(e?.src??"")},[e?.src]);let D=(0,Ld.useMemo)(()=>GI(t,L,c),[t,L,c]),U=()=>!t||t.length===0?!1:t.every(Y=>Y==="image"||Y.startsWith("image/")),G=Y=>{if(!f||typeof f=="function"&&!f(Y))return g(Y);S(Y);let J;if(d)if(u){let K=[];J=H=>{let X=(e??[]).filter(ne=>ne.id?!K.some(({id:le})=>Number(le)===Number(ne.id)):!K.some(({urlSlug:le})=>ne.url.includes(le)));g(X.concat(H)),K=H.map(ne=>{let le=ne.url.lastIndexOf("."),ve=ne.url.slice(0,le);return{id:ne.id,urlSlug:ve}})}}else J=g;else J=([K])=>g(K);E({allowedTypes:t,filesList:Y,onFileChange:J,onError:p,multiple:d})};async function j(Y){let{blocks:J}=tV(Y);if(!J?.length)return;let K=await Promise.all(J.map(H=>{let X=H.name.split("/")[1];return H.attributes.id?(H.attributes.type=X,H.attributes):new Promise((ne,le)=>{window.fetch(H.attributes.url).then(ve=>ve.blob()).then(ve=>E({filesList:[ve],additionalData:{title:H.attributes.title,alt_text:H.attributes.alt,caption:H.attributes.caption,type:X},onFileChange:([he])=>{he.id&&ne(he)},allowedTypes:t,onError:le})).catch(()=>ne(H.attributes.url))})})).catch(H=>p(H));K?.length&&g(d?K:K[0])}let z=Y=>{G(Y.target.files)},ee=I??(Y=>{let{instructions:J,title:K}=n;if(!E&&!v&&(J=(0,So.__)("To edit this block, you need permission to upload media.")),J===void 0||K===void 0){let X=t??[],[ne]=X,le=X.length===1,ve=le&&ne==="audio",he=le&&ne==="image",xe=le&&ne==="video";J===void 0&&E&&(J=(0,So.__)("Drag and drop an image or video, upload, or choose from your library."),ve?J=(0,So.__)("Drag and drop an audio file, upload, or choose from your library."):he?J=(0,So.__)("Drag and drop an image, upload, or choose from your library."):xe&&(J=(0,So.__)("Drag and drop a video, upload, or choose from your library."))),K===void 0&&(K=(0,So.__)("Media"),ve?K=(0,So.__)("Audio"):he?K=(0,So.__)("Image"):xe&&(K=(0,So.__)("Video")))}let H=V("block-editor-media-placeholder",o,{"is-appender":a});return(0,Ge.jsxs)(_o.Placeholder,{icon:r,label:K,instructions:J,className:H,notices:s,onDoubleClick:y,preview:i,style:P,children:[Y,C]})}),se=()=>m?null:(0,Ge.jsx)(_o.DropZone,{onFilesDrop:G,onDrop:j,isEligible:Y=>{let J="wp-block:core/",K=[];for(let H of Y.types)H.startsWith(J)&&K.push(H.slice(J.length));return K.every(H=>t.includes(H))&&(d?!0:K.length===1)}}),ce=()=>b&&(0,Ge.jsx)(_o.Button,{__next40pxDefaultSize:!0,className:"block-editor-media-placeholder__cancel-button",title:(0,So.__)("Cancel"),variant:"link",onClick:b,children:(0,So.__)("Cancel")}),ie=()=>v&&(0,Ge.jsx)(vTe,{src:T,onChangeSrc:O,onSelectURL:v}),re=()=>k&&(0,Ge.jsx)("div",{className:"block-editor-media-placeholder__url-input-container",children:(0,Ge.jsx)(_o.Button,{__next40pxDefaultSize:!0,className:"block-editor-media-placeholder__button",onClick:k,variant:"secondary",children:(0,So.__)("Use featured image")})}),Q=()=>{let J=B??(({open:H})=>(0,Ge.jsx)(_o.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{H()},children:(0,So.__)("Media Library")})),K=(0,Ge.jsx)(qu,{addToGallery:u,gallery:d&&U(),multiple:d,onSelect:g,allowedTypes:t,mode:"browse",value:Array.isArray(e)?e.map(({id:H})=>H):e.id,render:J});if(E&&a)return(0,Ge.jsxs)(Ge.Fragment,{children:[se(),(0,Ge.jsx)(_o.FormFileUpload,{onChange:z,accept:D,multiple:!!d,render:({openFileDialog:H})=>{let X=(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)(_o.Button,{__next40pxDefaultSize:!0,variant:"primary",className:V("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:H,children:(0,So._x)("Upload","verb")}),K,ie(),re(),ce()]});return ee(X)}})]});if(E){let H=(0,Ge.jsxs)(Ge.Fragment,{children:[se(),(0,Ge.jsx)(_o.FormFileUpload,{render:({openFileDialog:X})=>(0,Ge.jsx)(_o.Button,{__next40pxDefaultSize:!0,onClick:X,variant:"primary",className:V("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),children:(0,So._x)("Upload","verb")}),onChange:z,accept:D,multiple:!!d}),K,ie(),re(),ce()]});return ee(H)}return ee(K)};return h?(0,Ge.jsx)(Ds,{children:se()}):(0,Ge.jsx)(Ds,{fallback:ee(ie()),children:Q()})}var gne=(0,_o.withFilters)("editor.MediaPlaceholder")(yTe);var bne=l(w(),1),STe=({colorSettings:e,...t})=>{let o=e.map(r=>{if(!r)return r;let{value:n,onChange:i,...s}=r;return{...s,colorValue:n,onColorChange:i}});return(0,bne.jsx)(pI,{settings:o,gradients:[],disableCustomGradients:!0,...t})},kne=STe;var pie=l(FM(),1);var hie=l(R(),1);var die=l(R(),1);var iie=l(yf(),1),nr=l(R(),1),Md=l(F(),1),lP=l(Z(),1),sie=l(dr(),1),aie=l(A(),1),lie=l($(),1),cie=l(Re(),1),Ab=l(N(),1);var vne=l(N(),1),YI=l(A(),1);var gF=l(N(),1),ep=l(A(),1);var vc=l(w(),1),_Te={placement:"bottom-start"},xTe=()=>(0,vc.jsxs)(vc.Fragment,{children:[["bold","italic","link","unknown"].map(e=>(0,vc.jsx)(ep.Slot,{name:`RichText.ToolbarControls.${e}`},e)),(0,vc.jsx)(ep.Slot,{name:"RichText.ToolbarControls",children:e=>{if(!e.length)return null;let o=e.map(([{props:r}])=>r).some(({isActive:r})=>r);return(0,vc.jsx)(ep.ToolbarItem,{children:r=>(0,vc.jsx)(ep.DropdownMenu,{icon:zn,label:(0,gF.__)("More"),toggleProps:{...r,className:V(r.className,{"is-pressed":o}),description:(0,gF.__)("Displays more block tools")},controls:ma(e.map(([{props:n}])=>n),"title"),popoverProps:_Te})})}})]}),bF=xTe;var Nd=l(w(),1);function wTe({popoverAnchor:e}){return(0,Nd.jsx)(YI.Popover,{placement:"top",focusOnMount:!1,anchor:e,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar",children:(0,Nd.jsx)(Bg,{className:"block-editor-rich-text__inline-format-toolbar-group","aria-label":(0,vne.__)("Format tools"),children:(0,Nd.jsx)(YI.ToolbarGroup,{children:(0,Nd.jsx)(bF,{})})})})}var CTe=({inline:e,editableContentElement:t})=>e?(0,Nd.jsx)(wTe,{popoverAnchor:t}):(0,Nd.jsx)(Mt,{group:"inline",children:(0,Nd.jsx)(bF,{})}),yne=CTe;var qI=l(R(),1),Sne=l(F(),1);function _ne({html:e,value:t}){let o=(0,qI.useRef)(),r=!!t.activeFormats?.length,{__unstableMarkLastChangeAsPersistent:n}=(0,Sne.useDispatch)(_);(0,qI.useLayoutEffect)(()=>{if(!o.current){o.current=t.text;return}if(o.current!==t.text){let i=window.setTimeout(()=>{n()},1e3);return o.current=t.text,()=>{window.clearTimeout(i)}}n()},[e,r])}var Bb=l(R(),1),jne=l(Z(),1);var JS=l(dr(),1),xne=l(ut(),1);var BTe=["`",'"',"'","\u201C\u201D","\u2018\u2019"],wne=e=>t=>{function o(r){let{inputType:n,data:i}=r,{value:s,onChange:a,registry:c}=e.current;if(n!=="insertText"||(0,JS.isCollapsed)(s))return;let u=(0,xne.applyFilters)("blockEditor.wrapSelectionSettings",BTe).find(([x,C])=>x===i||C===i);if(!u)return;let[d,f=d]=u,m=s.start,h=s.end+d.length,p=(0,JS.insert)(s,d,m,m);p=(0,JS.insert)(p,f,h,h);let{__unstableMarkLastChangeAsPersistent:g,__unstableMarkAutomaticChange:b}=c.dispatch(_);g(),a(p),b();let v={};for(let x in r)v[x]=r[x];v.data=f;let{ownerDocument:k}=t,{defaultView:y}=k,S=new y.InputEvent("input",v);window.queueMicrotask(()=>{r.target.dispatchEvent(S)}),r.preventDefault()}return t.addEventListener("beforeinput",o),()=>{t.removeEventListener("beforeinput",o)}};var ZI=l(dr(),1),wb=l($(),1);var Cne=l(dr(),1);function Bne(e){let t="tales of gutenberg",o=" \u{1F421}\u{1F422}\u{1F980}\u{1F424}\u{1F98B}\u{1F418}\u{1F427}\u{1F439}\u{1F981}\u{1F984}\u{1F98D}\u{1F43C}\u{1F43F}\u{1F383}\u{1F434}\u{1F41D}\u{1F406}\u{1F995}\u{1F994}\u{1F331}\u{1F347}\u03C0\u{1F34C}\u{1F409}\u{1F4A7}\u{1F968}\u{1F30C}\u{1F342}\u{1F360}\u{1F966}\u{1F95A}\u{1F95D}\u{1F39F}\u{1F965}\u{1F952}\u{1F6F5}\u{1F956}\u{1F352}\u{1F36F}\u{1F3BE}\u{1F3B2}\u{1F43A}\u{1F41A}\u{1F42E}\u231B\uFE0F",{start:r,text:n}=e;return rt=>{function o(){let{getValue:n,onReplace:i,selectionChange:s,registry:a}=e.current;if(!i)return;let c=n(),{start:u,text:d}=c;if(d.slice(u-1,u)!==" ")return;let m=d.slice(0,u).trim(),h=(0,wb.getBlockTransforms)("from").filter(({type:v})=>v==="prefix"),p=(0,wb.findTransform)(h,({prefix:v})=>m===v);if(!p)return;let g=(0,ZI.toHTMLString)({value:(0,ZI.insert)(c,wl,0,u)}),b=p.transform(g);return s(...Ene([b])),i([b]),a.dispatch(_).__unstableMarkAutomaticChange(),!0}function r(n){let{inputType:i,type:s}=n,{getValue:a,onChange:c,__unstableAllowPrefixTransformations:u,formatTypes:d,registry:f,onReplace:m}=e.current;if(i!=="insertText"&&s!=="compositionend"||u&&o())return;let h=a(),p=(0,wb.getBlockTransforms)("from").filter(y=>y.type==="input"),g=(0,wb.findTransform)(p,y=>y.regExp.test(h.text));if(g){m(g.transform()),f.dispatch(_).__unstableMarkAutomaticChange();return}let b=d.reduce((y,{__unstableInputRule:S})=>(S&&(y=S(y)),y),Bne(h)),{__unstableMarkLastChangeAsPersistent:v,__unstableMarkAutomaticChange:k}=f.dispatch(_);b!==h&&(v(),c({...b,activeFormats:h.activeFormats}),k())}return t.addEventListener("input",r),t.addEventListener("compositionend",r),()=>{t.removeEventListener("input",r),t.removeEventListener("compositionend",r)}};var Ine=e=>t=>{function o(r){if(r.inputType!=="insertReplacementText")return;let{registry:n}=e.current;n.dispatch(_).__unstableMarkLastChangeAsPersistent()}return t.addEventListener("beforeinput",o),()=>{t.removeEventListener("beforeinput",o)}};var XI=l(it(),1),Pne=()=>e=>{function t(o){(XI.isKeyboardEvent.primary(o,"z")||XI.isKeyboardEvent.primary(o,"y")||XI.isKeyboardEvent.primaryShift(o,"z"))&&o.preventDefault()}return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}};var Rne=e=>t=>{let{keyboardShortcuts:o}=e.current;function r(n){for(let i of o.current)i(n)}return t.addEventListener("keydown",r),()=>{t.removeEventListener("keydown",r)}};var One=e=>t=>{let{inputEvents:o}=e.current;function r(n){for(let i of o.current)i(n)}return t.addEventListener("input",r),()=>{t.removeEventListener("input",r)}};var QI=l(it(),1);var Ane=e=>t=>{function o(r){let{keyCode:n}=r;if(r.defaultPrevented||n!==QI.BACKSPACE&&n!==QI.ESCAPE)return;let{registry:i}=e.current,{didAutomaticChange:s,getSettings:a}=i.select(_),{__experimentalUndo:c}=a();c&&s()&&(r.preventDefault(),c())}return t.addEventListener("keydown",o),()=>{t.removeEventListener("keydown",o)}};var Nne=l($(),1),Wa=l(dr(),1),Mne=l(dn(),1);var ETe=l(R(),1),TTe=l($(),1),ITe=l(w(),1);function Lne(e,t){if(t?.length){let o=e.formats.length;for(;o--;)e.formats[o]=[...t,...e.formats[o]||[]]}}function JI(e){if(!(e!==!0&&e!=="p"&&e!=="li"))return e===!0?"p":e}function Cb({allowedFormats:e,disableFormats:t}){return t?Cb.EMPTY_ARRAY:e}Cb.EMPTY_ARRAY=[];var Dne=e=>t=>{function o(n){let{disableFormats:i,onChange:s,value:a,formatTypes:c,tagName:u,onReplace:d,__unstableEmbedURLOnPaste:f,preserveWhiteSpace:m,pastePlainText:h}=e.current;if(!t.contains(n.target)||n.defaultPrevented)return;let{plainText:p,html:g}=Ah(n);if(n.preventDefault(),window.console.log(`Received HTML (RichText):`,g),window.console.log(`Received plain text (RichText):`,p),i){s((0,Wa.insert)(a,p));return}let b=n.clipboardData.getData("rich-text")==="true";function v(x){let C=c.reduce((B,{__unstablePasteRule:I})=>(I&&B===a&&(B=I(a,{html:g,plainText:p})),B),a);if(C!==a)s(C);else{let B=(0,Wa.create)({html:x});Lne(B,a.activeFormats),s((0,Wa.insert)(a,B))}}if(b){v(g);return}if(h){s((0,Wa.insert)(a,(0,Wa.create)({text:p})));return}let k="INLINE",y=p.trim();f&&(0,Wa.isEmpty)(a)&&(0,Mne.isURL)(y)&&/^https?:/.test(y)&&(k="BLOCKS");let S=(0,Nne.pasteHandler)({HTML:g,plainText:p,mode:k,tagName:u,preserveWhiteSpace:m});typeof S=="string"?v(S):S.length>0&&d&&(0,Wa.isEmpty)(a)&&d(S,S.length-1,-1)}let{defaultView:r}=t.ownerDocument;return r.addEventListener("paste",o),()=>{r.removeEventListener("paste",o)}};var e_=l(it(),1),eP=l(dr(),1),Vne=e=>t=>{function o(r){let{keyCode:n}=r;if(r.defaultPrevented)return;let{value:i,onMerge:s,onRemove:a}=e.current;if(n===e_.DELETE||n===e_.BACKSPACE){let{start:c,end:u,text:d}=i,f=n===e_.BACKSPACE,m=i.activeFormats&&!!i.activeFormats.length;if(!(0,eP.isCollapsed)(i)||m||f&&c!==0||!f&&u!==d.length)return;s?s(!f):a&&(0,eP.isEmpty)(i)&&f&&a(!f),r.preventDefault()}}return t.addEventListener("keydown",o),()=>{t.removeEventListener("keydown",o)}};var kF=l(it(),1),t_=l(dr(),1),Fne=e=>t=>{function o(i){if(i.keyCode!==kF.ENTER)return;let{onReplace:s,onSplit:a}=e.current;s&&a&&(i.__deprecatedOnSplit=!0)}function r(i){if(i.defaultPrevented||i.target!==t||i.keyCode!==kF.ENTER)return;let{value:s,onChange:a,disableLineBreaks:c,onSplitAtEnd:u,onSplitAtDoubleLineEnd:d,registry:f}=e.current;i.preventDefault();let{text:m,start:h,end:p}=s;i.shiftKey?c||a((0,t_.insert)(s,` `)):u&&h===p&&p===m.length?u():d&&h===p&&p===m.length&&m.slice(-2)===``?f.batch(()=>{let g={...s};g.start=g.end-2,a((0,t_.remove)(g)),d()}):c||a((0,t_.insert)(s,` `))}let{defaultView:n}=t.ownerDocument;return n.addEventListener("keydown",r),t.addEventListener("keydown",o),()=>{n.removeEventListener("keydown",r),t.removeEventListener("keydown",o)}};var zne=e=>t=>{function o(){let{registry:r}=e.current;if(!r.select(_).isMultiSelecting())return;let n=t.parentElement.closest('[contenteditable="true"]');n&&n.focus()}return t.addEventListener("focus",o),()=>{t.removeEventListener("focus",o)}};var PTe=[wne,Tne,Ine,Pne,Rne,One,Ane,Dne,Vne,Fne,zne];function tP(e){let t=(0,Bb.useRef)(e);(0,Bb.useInsertionEffect)(()=>{t.current=e});let o=(0,Bb.useMemo)(()=>PTe.map(r=>r(t)),[t]);return(0,jne.useRefEffect)(r=>{if(!e.isSelected)return;let n=o.map(i=>i(r));return()=>{n.forEach(i=>i())}},[o,e.isSelected])}var oP=l(dr(),1),rP=l(R(),1);var Une=l(w(),1),Hne=l(jr(),1),RTe={},vF=Symbol("usesContext");function OTe({onChange:e,onFocus:t,value:o,forwardedRef:r,settings:n,isVisible:i}){let{name:s,edit:a,[vF]:c}=n,u=(0,rP.useContext)(xr),d=(0,rP.useMemo)(()=>c?Object.fromEntries(Object.entries(u).filter(([g])=>c.includes(g))):RTe,[c,u]);if(!a)return null;let f=(0,oP.getActiveFormat)(o,s),m=f!==void 0,h=(0,oP.getActiveObject)(o),p=h!==void 0&&h.type===s;return(0,Une.jsx)(a,{isActive:m,isVisible:i,activeAttributes:m?f.attributes||{}:{},isObjectActive:p,activeObjectAttributes:p?h.attributes||{}:{},value:o,onChange:e,onFocus:t,contentRef:r,context:d},s)}function nP({formatTypes:e,...t}){return e.map(o=>(0,Hne.createElement)(OTe,{settings:o,...t,key:o.name}))}var Gne=l(R(),1),Wne=l($(),1),$ne=l(Re(),1);var yF=l(w(),1);function SF(e,t){if(Eb.isEmpty(e)){let o=JI(t);return o?`<${o}>`:""}return Array.isArray(e)?((0,$ne.default)("wp.blockEditor.RichText value prop as children type",{since:"6.1",version:"6.3",alternative:"value prop as string",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),Wne.children.toHTML(e)):typeof e=="string"?e:e.toHTMLString()}function o_({value:e,tagName:t,multiline:o,format:r,...n}){return e=(0,yF.jsx)(Gne.RawHTML,{children:SF(e,o)}),t?(0,yF.jsx)(t,{...n,children:e}):e}var Xne=l(R(),1),xF=l($(),1),Qne=l(dr(),1),Jne=l(Re(),1);var Kne=l(R(),1),Yne=l(Re(),1),iP=l(F(),1),qne=l(it(),1),Tb=l(dr(),1);var _F=l(w(),1);function ATe({children:e,identifier:t,tagName:o="div",value:r="",onChange:n,multiline:i,...s},a){(0,Yne.default)("wp.blockEditor.RichText multiline prop",{since:"6.1",version:"6.3",alternative:"nested blocks (InnerBlocks)",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/nested-blocks-inner-blocks/"});let{clientId:c}=Ie(),{getSelectionStart:u,getSelectionEnd:d}=(0,iP.useSelect)(_),{selectionChange:f}=(0,iP.useDispatch)(_),m=JI(i);r=r||`<${m}>`;let p=`${r}<${m}>`.split(`<${m}>`);p.shift(),p.pop();function g(b){n(`<${m}>${b.join(`<${m}>`)}`)}return(0,_F.jsx)(o,{ref:a,children:p.map((b,v)=>(0,_F.jsx)(sP,{identifier:`${t}-${v}`,tagName:m,value:b,onChange:k=>{let y=p.slice();y[v]=k,g(y)},isSelected:void 0,onKeyDown:k=>{if(k.keyCode!==qne.ENTER)return;k.preventDefault();let{offset:y}=u(),{offset:S}=d();if(typeof y!="number"||typeof S!="number")return;let x=(0,Tb.create)({html:b});x.start=y,x.end=S;let C=(0,Tb.split)(x).map(I=>(0,Tb.toHTMLString)({value:I})),B=p.slice();B.splice(v,1,...C),g(B),f(c,`${t}-${v+1}`,0,0)},onMerge:k=>{let y=p.slice(),S=0;if(k){if(!y[v+1])return;y.splice(v,2,y[v]+y[v+1]),S=y[v].length-1}else{if(!y[v-1])return;y.splice(v-1,2,y[v-1]+y[v]),S=y[v-1].length-1}g(y),f(c,`${t}-${v-(k?0:1)}`,S,S)},...s},v))})}var Zne=(0,Kne.forwardRef)(ATe);var eie=l(w(),1);function tie(e){return(0,Xne.forwardRef)((t,o)=>{let r=t.value,n=t.onChange;Array.isArray(r)&&((0,Jne.default)("wp.blockEditor.RichText value prop as children type",{since:"6.1",version:"6.3",alternative:"value prop as string",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),r=xF.children.toHTML(t.value),n=s=>t.onChange(xF.children.fromDOM((0,Qne.__unstableCreateElement)(document,s).childNodes)));let i=t.multiline?Zne:e;return(0,eie.jsx)(i,{...t,value:r,onChange:n,ref:o})})}var oie=l(it(),1),Ib=l(R(),1);function wF({character:e,type:t,onUse:o}){let r=(0,Ib.useContext)(Pb),n=(0,Ib.useRef)();return n.current=o,(0,Ib.useEffect)(()=>{function i(s){oie.isKeyboardEvent[t](s,e)&&(n.current(),s.preventDefault())}return r.current.add(i),()=>{r.current.delete(i)}},[e,t]),null}var aP=l(A(),1),rie=l(it(),1),CF=l(w(),1);function BF({name:e,shortcutType:t,shortcutCharacter:o,...r}){let n,i="RichText.ToolbarControls";return e&&(i+=`.${e}`),t&&o&&(n=rie.displayShortcut[t](o)),(0,CF.jsx)(aP.Fill,{name:i,children:(0,CF.jsx)(aP.ToolbarButton,{...r,shortcut:n})})}var Rb=l(R(),1);function EF({inputType:e,onInput:t}){let o=(0,Rb.useContext)(Ob),r=(0,Rb.useRef)();return r.current=t,(0,Rb.useEffect)(()=>{function n(i){i.inputType===e&&(r.current(),i.preventDefault())}return o.current.add(n),()=>{o.current.delete(n)}},[e]),null}var di=l(w(),1),{useRichText:LTe}=M(sie.privateApis),Pb=(0,nr.createContext)();Pb.displayName="keyboardShortcutContext";var Ob=(0,nr.createContext)();Ob.displayName="inputEventContext";var nie=Symbol("instanceId");function uie(e){let{__unstableMobileNoFocusOnMount:t,deleteEnter:o,placeholderTextColor:r,textAlign:n,selectionColor:i,tagsToEliminate:s,disableEditingMenu:a,fontSize:c,fontFamily:u,fontWeight:d,fontStyle:f,minWidth:m,maxWidth:h,disableSuggestions:p,disableAutocorrection:g,...b}=e;return b}function sP({children:e,tagName:t="div",value:o="",onChange:r,isSelected:n,multiline:i,inlineToolbar:s,wrapperClassName:a,autocompleters:c,onReplace:u,placeholder:d,allowedFormats:f,withoutInteractiveFormatting:m,onRemove:h,onMerge:p,onSplit:g,__unstableOnSplitAtEnd:b,__unstableOnSplitAtDoubleLineEnd:v,identifier:k,preserveWhiteSpace:y,__unstablePastePlainText:S,__unstableEmbedURLOnPaste:x,__unstableDisableFormats:C,disableLineBreaks:B,__unstableAllowPrefixTransformations:I,readOnly:P,...E},L){E=uie(E),g&&(0,cie.default)("wp.blockEditor.RichText onSplit prop",{since:"6.4",alternative:'block.json support key: "splitting"'});let T=(0,lP.useInstanceId)(sP),O=(0,nr.useRef)(),[D,U]=(0,nr.useState)(null),G=Ie(),{clientId:j,isSelected:z,name:W}=G,ee=G[Rp],se=(0,nr.useContext)(xr),ce=(0,Md.useRegistry)(),ie=je=>{if(!z)return{isSelected:!1};let{getSelectionStart:Eo,getSelectionEnd:Ze}=je(_),Ve=Eo(),gt=Ze(),To;return n===void 0?To=Ve.clientId===j&>.clientId===j&&(k?Ve.attributeKey===k:Ve[nie]===T):n&&(To=Ve.clientId===j),{selectionStart:To?Ve.offset:void 0,selectionEnd:To?gt.offset:void 0,isSelected:To}},{selectionStart:re,selectionEnd:Q,isSelected:Y}=(0,Md.useSelect)(ie,[j,k,T,n,z]),{disableBoundBlock:J,bindingsPlaceholder:K,bindingsLabel:H}=(0,Md.useSelect)(je=>{if(!ee?.[k])return{};let{__experimentalBlockBindingsSupportedAttributes:Eo}=je(_).getSettings();if(!Eo?.[W])return{};let Ve=ee[k],gt=(0,lie.getBlockBindingsSource)(Ve.source),To={};if(gt?.usesContext?.length)for(let ct of gt.usesContext)To[ct]=se[ct];let cr=!gt?.canUserEditValue?.({select:je,context:To,args:Ve.args});if(o.length>0)return{disableBoundBlock:cr,bindingsPlaceholder:null,bindingsLabel:null};let{getBlockAttributes:ge}=je(_),Ct=ge(j),Io=null;gt?.getFieldsList&&(Io=gt.getFieldsList({select:je,context:To})?.find(Gc=>(0,iie.default)(Gc.args,Ve?.args))?.label);let Ke=Io??gt?.label,te=cr?Ke:(0,Ab.sprintf)((0,Ab.__)("Add %s"),Ke),Le=cr?Ve?.args?.key||gt?.label:(0,Ab.sprintf)((0,Ab.__)("Empty %s; start writing to edit its value"),Ve?.args?.key||gt?.label);return{disableBoundBlock:cr,bindingsPlaceholder:Ct?.placeholder||te,bindingsLabel:Le}},[ee,k,W,o,j,se]),X=!!se?.["pattern/overrides"],ne=ee?.__default?.source==="core/pattern-overrides",ve=P||J||X&&!ne,{getSelectionStart:he,getSelectionEnd:xe,getBlockRootClientId:ze}=(0,Md.useSelect)(_),{selectionChange:ot}=(0,Md.useDispatch)(_),Wt=Cb({allowedFormats:f,disableFormats:C}),fo=!Wt||Wt.length>0,Do=(0,nr.useCallback)((je,Eo)=>{let Ze={},Ve=je===void 0&&Eo===void 0,gt={clientId:j,[k?"attributeKey":nie]:k||T};if(typeof je=="number"||Ve){if(Eo===void 0&&ze(j)!==ze(xe().clientId))return;Ze.start={...gt,offset:je}}if(typeof Eo=="number"||Ve){if(je===void 0&&ze(j)!==ze(he().clientId))return;Ze.end={...gt,offset:Eo}}ot(Ze)},[j,ze,xe,he,k,T,ot]),{value:rt,getValue:ar,onChange:xt,ref:At,formatTypes:Pe}=LTe({value:o,onChange:r,selectionStart:re,selectionEnd:Q,onSelectionChange:Do,placeholder:K||d,__unstableIsSelected:Y,__unstableDisableFormats:C,preserveWhiteSpace:y,__unstableDependencies:[t],allowedFormats:Wt,withoutInteractiveFormatting:m,__unstableFormatTypeHandlerContext:(0,nr.useMemo)(()=>({richTextIdentifier:k,blockClientId:j}),[k,j])}),wt=qU({onReplace:u,completers:c,record:rt,onChange:xt});_ne({html:o,value:rt});let qo=(0,nr.useRef)(new Set),$t=(0,nr.useRef)(new Set);function lr(){O.current?.focus()}let ln=t;return(0,di.jsxs)(di.Fragment,{children:[Y&&(0,di.jsx)(Pb.Provider,{value:qo,children:(0,di.jsx)(Ob.Provider,{value:$t,children:(0,di.jsxs)(aie.Popover.__unstableSlotNameProvider,{value:"__unstable-block-tools-after",children:[e&&e({value:rt,onChange:xt,onFocus:lr}),(0,di.jsx)(nP,{value:rt,onChange:xt,onFocus:lr,formatTypes:Pe,forwardedRef:O})]})})}),Y&&fo&&(0,di.jsx)(yne,{inline:s,editableContentElement:D}),(0,di.jsx)(ln,{role:"textbox","aria-multiline":!B,"aria-readonly":ve,...E,draggable:void 0,"aria-label":H||E["aria-label"]||d,...wt,ref:(0,lP.useMergeRefs)([At,L,wt.ref,E.ref,tP({registry:ce,getValue:ar,onChange:xt,__unstableAllowPrefixTransformations:I,formatTypes:Pe,onReplace:u,selectionChange:ot,isSelected:Y,disableFormats:C,value:rt,tagName:t,onSplit:g,__unstableEmbedURLOnPaste:x,pastePlainText:S,onMerge:p,onRemove:h,disableLineBreaks:B,onSplitAtEnd:b,onSplitAtDoubleLineEnd:v,keyboardShortcuts:qo,inputEvents:$t}),O,U]),contentEditable:!ve,suppressContentEditableWarning:!0,className:V("block-editor-rich-text__editable",E.className,"rich-text"),tabIndex:E.tabIndex===0&&!ve?null:E.tabIndex,"data-wp-block-attribute-key":k})]})}var r_=tie((0,nr.forwardRef)(sP));r_.Content=o_;r_.isEmpty=e=>!e||e.length===0;var TF=(0,nr.forwardRef)((e,t)=>{if(Ie()[d0]){let{children:n,tagName:i="div",value:s,onChange:a,isSelected:c,multiline:u,inlineToolbar:d,wrapperClassName:f,autocompleters:m,onReplace:h,placeholder:p,allowedFormats:g,withoutInteractiveFormatting:b,onRemove:v,onMerge:k,onSplit:y,__unstableOnSplitAtEnd:S,__unstableOnSplitAtDoubleLineEnd:x,identifier:C,preserveWhiteSpace:B,__unstablePastePlainText:I,__unstableEmbedURLOnPaste:P,__unstableDisableFormats:E,disableLineBreaks:L,__unstableAllowPrefixTransformations:T,readOnly:O,...D}=uie(e);return(0,di.jsx)(i,{ref:t,...D,dangerouslySetInnerHTML:{__html:SF(s,u)||"
"}})}return(0,di.jsx)(r_,{ref:t,...e,readOnly:!1})});TF.Content=o_;TF.isEmpty=e=>!e||e.length===0;var Eb=TF;var IF=l(w(),1),fie=(0,die.forwardRef)((e,t)=>(0,IF.jsx)(Eb,{ref:t,...e,__unstableDisableFormats:!0}));fie.Content=function({value:t="",tagName:o="div",...r}){return(0,IF.jsx)(o,{...r,children:t})};var mie=fie;var PF=l(w(),1),NTe=(0,hie.forwardRef)(({__experimentalVersion:e,...t},o)=>{if(e===2)return(0,PF.jsx)(mie,{ref:o,...t});let{className:r,onChange:n,...i}=t;return(0,PF.jsx)(pie.default,{ref:o,className:V("block-editor-plain-text",r),onChange:s=>n(s.target.value),...i})}),gie=NTe;var $a=l(N(),1),vie=l(R(),1),yie=l(A(),1);var bie=l(Z(),1),kie=l(A(),1),cP=l(N(),1),tp=l(w(),1);function uP({property:e,viewport:t,desc:o}){let r=(0,bie.useInstanceId)(uP),n=o||(0,cP.sprintf)((0,cP._x)("Controls the %1$s property for %2$s viewports.","Text labelling a interface as controlling a given layout property (eg: margin) for a given screen size."),e,t.label);return(0,tp.jsxs)(tp.Fragment,{children:[(0,tp.jsx)("span",{"aria-describedby":`rbc-desc-${r}`,children:t.label}),(0,tp.jsx)(kie.VisuallyHidden,{as:"span",id:`rbc-desc-${r}`,children:n})]})}var Ka=l(w(),1);function MTe(e){let{title:t,property:o,toggleLabel:r,onIsResponsiveChange:n,renderDefaultControl:i,renderResponsiveControls:s,isResponsive:a=!1,defaultLabel:c={id:"all",label:(0,$a._x)("All","screen sizes")},viewports:u=[{id:"small",label:(0,$a.__)("Small screens")},{id:"medium",label:(0,$a.__)("Medium screens")},{id:"large",label:(0,$a.__)("Large screens")}]}=e;if(!t||!o||!i)return null;let d=r||(0,$a.sprintf)((0,$a.__)("Use the same %s on all screen sizes."),o),f=(0,$a.__)("Choose whether to use the same value for all screen sizes or a unique value for each screen size."),m=i((0,Ka.jsx)(uP,{property:o,viewport:c}),c),h=()=>u.map(p=>(0,Ka.jsx)(vie.Fragment,{children:i((0,Ka.jsx)(uP,{property:o,viewport:p}),p)},p.id));return(0,Ka.jsxs)("fieldset",{className:"block-editor-responsive-block-control",children:[(0,Ka.jsx)("legend",{className:"block-editor-responsive-block-control__title",children:t}),(0,Ka.jsxs)("div",{className:"block-editor-responsive-block-control__inner",children:[(0,Ka.jsx)(yie.ToggleControl,{className:"block-editor-responsive-block-control__toggle",label:d,checked:!a,onChange:n,help:f}),(0,Ka.jsxs)("div",{className:V("block-editor-responsive-block-control__group",{"is-responsive":a}),children:[!a&&m,a&&(s?s(u):h())]})]})]})}var Sie=MTe;var dP=l(A(),1);var _ie=l(w(),1);function xie({units:e,...t}){let[o]=me("spacing.units"),r=(0,dP.__experimentalUseCustomUnits)({availableUnits:o||["%","px","em","rem","vw"],units:e});return(0,_ie.jsx)(dP.__experimentalUnitControl,{units:r,...t})}var n_=l(N(),1),wie=l(R(),1),Lb=l(A(),1);var Ya=l(w(),1);function DTe({url:e,onChange:t}){let[o,r]=(0,wie.useReducer)(i=>!i,!1),n=i=>{i.preventDefault(),r()};return(0,Ya.jsxs)("div",{className:"block-editor-url-input__button",children:[(0,Ya.jsx)(Lb.Button,{size:"compact",icon:fn,label:e?(0,n_.__)("Edit link"):(0,n_.__)("Insert link"),onClick:r,className:"components-toolbar__control",isPressed:!!e}),o&&(0,Ya.jsx)("form",{className:"block-editor-url-input__button-modal",onSubmit:n,children:(0,Ya.jsxs)("div",{className:"block-editor-url-input__button-modal-line",children:[(0,Ya.jsx)(Lb.Button,{__next40pxDefaultSize:!0,className:"block-editor-url-input__back",icon:Xk,label:(0,n_.__)("Close"),onClick:r}),(0,Ya.jsx)(Td,{value:e||"",onChange:t,suffix:(0,Ya.jsx)(Lb.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,Ya.jsx)(Lb.Button,{size:"small",icon:bl,label:(0,n_.__)("Submit"),type:"submit"})})})]})})]})}var Cie=DTe;var In=l(N(),1),rs=l(R(),1),Pie=l(Fe(),1),Ho=l(A(),1);var Rie=l(dn(),1);var yt=l(w(),1),RF="none",Bie="custom",Eie="media",Tie="attachment",Iie=["noreferrer","noopener"],Oie=({linkDestination:e,onChangeUrl:t,url:o,mediaType:r="image",mediaUrl:n,mediaLink:i,linkTarget:s,linkClass:a,rel:c,showLightboxSetting:u,lightboxEnabled:d,onSetLightbox:f,resetLightbox:m})=>{let[h,p]=(0,rs.useState)(!1),[g,b]=(0,rs.useState)(null),v=()=>{p(!0)},[k,y]=(0,rs.useState)(!1),[S,x]=(0,rs.useState)(null),C=(0,rs.useRef)(null),B=(0,rs.useRef)();(0,rs.useEffect)(()=>{if(!B.current)return;(Pie.focus.focusable.find(B.current)[0]||B.current).focus()},[k,o,d]);let I=()=>{(e===Eie||e===Tie)&&x(""),y(!0)},P=()=>{y(!1)},E=()=>{x(null),P(),p(!1)},L=Y=>{let J=Y?"_blank":void 0,K;if(J){let H=(c??"").split(" ");Iie.forEach(X=>{H.includes(X)||H.push(X)}),K=H.join(" ")}else{let H=(c??"").split(" ").filter(X=>Iie.includes(X)===!1);K=H.length?H.join(" "):void 0}return{linkTarget:J,rel:K}},T=()=>Y=>{let J=C.current;J&&J.contains(Y.target)||(p(!1),x(null),P())},O=()=>Y=>{if(S){let J=U().find(K=>K.url===S)?.linkDestination||Bie;t({href:(0,Rie.prependHTTPS)(S),linkDestination:J,lightbox:{enabled:!1}})}P(),x(null),Y.preventDefault()},D=()=>{t({linkDestination:RF,href:""})},U=()=>{let Y=[{linkDestination:Eie,title:(0,In.__)("Link to image file"),url:r==="image"?n:void 0,icon:iv}];return r==="image"&&i&&Y.push({linkDestination:Tie,title:(0,In.__)("Link to attachment page"),url:r==="image"?i:void 0,icon:kl}),Y},G=Y=>{let J=U(),K;Y?K=(J.find(H=>H.url===Y)||{linkDestination:Bie}).linkDestination:K=RF,t({linkDestination:K,href:Y})},j=Y=>{let J=L(Y);t(J)},z=Y=>{t({rel:Y})},W=Y=>{t({linkClass:Y})},ee=(0,yt.jsxs)(Ho.__experimentalVStack,{spacing:"3",children:[(0,yt.jsx)(Ho.ToggleControl,{label:(0,In.__)("Open in new tab"),onChange:j,checked:s==="_blank"}),(0,yt.jsx)(Ho.TextControl,{__next40pxDefaultSize:!0,label:(0,In.__)("Link relation"),value:c??"",onChange:z,help:(0,rs.createInterpolateElement)((0,In.__)("The Link Relation attribute defines the relationship between a linked resource and the current document."),{a:(0,yt.jsx)(Ho.ExternalLink,{href:"https://developer.mozilla.org/docs/Web/HTML/Attributes/rel"})})}),(0,yt.jsx)(Ho.TextControl,{__next40pxDefaultSize:!0,label:(0,In.__)("Link CSS class"),value:a||"",onChange:W})]}),se=S!==null?S:o,ce=!d||d&&!u,ie=!se&&ce,re=(U().find(Y=>Y.linkDestination===e)||{}).title,Q=()=>{if(d&&u&&!o&&!k)return(0,yt.jsxs)("div",{className:"block-editor-url-popover__expand-on-click",children:[(0,yt.jsx)(we,{icon:mx}),(0,yt.jsxs)("div",{className:"text",children:[(0,yt.jsx)("p",{children:(0,In.__)("Enlarge on click")}),(0,yt.jsx)("p",{className:"description",children:(0,In.__)("Scales the image with a lightbox effect")})]}),(0,yt.jsx)(Ho.Button,{icon:Ci,label:(0,In.__)("Disable enlarge on click"),onClick:()=>{f?.(!1)},size:"compact"})]});if(!o||k)return(0,yt.jsx)(Ad.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:se,onChangeInputValue:x,onSubmit:O(),autocompleteRef:C});if(o&&!k)return(0,yt.jsxs)(yt.Fragment,{children:[(0,yt.jsx)(Ad.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:o,onEditLinkClick:I,urlLabel:re}),(0,yt.jsx)(Ho.Button,{icon:Ci,label:(0,In.__)("Remove link"),onClick:()=>{D(),m?.()},size:"compact"})]})};return(0,yt.jsxs)(yt.Fragment,{children:[(0,yt.jsx)(Ho.ToolbarButton,{icon:fn,className:"components-toolbar__control",label:(0,In.__)("Link"),"aria-expanded":h,onClick:v,ref:b,isActive:!!o||d&&u}),h&&(0,yt.jsx)(Ad,{ref:B,anchor:g,onFocusOutside:T(),onClose:E,renderSettings:ce?()=>ee:null,additionalControls:ie&&(0,yt.jsxs)(Ho.NavigableMenu,{children:[U().map(Y=>(0,yt.jsx)(Ho.MenuItem,{icon:Y.icon,iconPosition:"left",onClick:()=>{x(null),G(Y.url),P()},children:Y.title},Y.linkDestination)),u&&(0,yt.jsx)(Ho.MenuItem,{className:"block-editor-url-popover__expand-on-click",icon:mx,info:(0,In.__)("Scale the image with a lightbox effect."),iconPosition:"left",onClick:()=>{x(null),t({linkDestination:RF,href:""}),f?.(!0),P()},children:(0,In.__)("Enlarge on click")},"expand-on-click")]}),offset:13,children:Q()})]})};var Mb=l(A(),1),$ie=l(R(),1),pP=l(N(),1);var Aie=l(R(),1),AF=l(N(),1);var OF=[],VTe=new Intl.Collator("und",{numeric:!0}).compare;function fP(){let[e,t,o,r]=me("spacing.spacingSizes.custom","spacing.spacingSizes.theme","spacing.spacingSizes.default","spacing.defaultSpacingSizes"),n=e??OF,i=t??OF,s=o&&r!==!1?o:OF;return(0,Aie.useMemo)(()=>{let a=[{name:(0,AF.__)("None"),slug:"0",size:0},...n,...i,...s];return a.every(({slug:c})=>/^[0-9]/.test(c))&&a.sort((c,u)=>VTe(c.slug,u.slug)),a.length>XU?[{name:(0,AF.__)("Default"),slug:"default",size:void 0},...a]:a},[n,i,s])}var Lie=l(R(),1),Nie=l(F(),1),mP=l(N(),1),Mie=l(A(),1);var Die=l(w(),1),FTe={px:{max:300,steps:1},"%":{max:100,steps:1},vw:{max:100,steps:1},vh:{max:100,steps:1},em:{max:10,steps:.1},rm:{max:10,steps:.1},svw:{max:100,steps:1},lvw:{max:100,steps:1},dvw:{max:100,steps:1},svh:{max:100,steps:1},lvh:{max:100,steps:1},dvh:{max:100,steps:1},vi:{max:100,steps:1},svi:{max:100,steps:1},lvi:{max:100,steps:1},dvi:{max:100,steps:1},vb:{max:100,steps:1},svb:{max:100,steps:1},lvb:{max:100,steps:1},dvb:{max:100,steps:1},vmin:{max:100,steps:1},svmin:{max:100,steps:1},lvmin:{max:100,steps:1},dvmin:{max:100,steps:1},vmax:{max:100,steps:1},svmax:{max:100,steps:1},lvmax:{max:100,steps:1},dvmax:{max:100,steps:1}};function Nb({icon:e,isMixed:t=!1,minimumCustomValue:o,onChange:r,onMouseOut:n,onMouseOver:i,showSideInLabel:s=!0,side:a,spacingSizes:c,type:u,value:d,...f}){let m=(0,Nie.useSelect)(S=>S(_).getSettings()?.disableCustomSpacingSizes),[h]=me("spacing.units"),p=(0,Mie.__experimentalUseCustomUnits)({availableUnits:h||["px","em","rem"]}),g=(0,Lie.useMemo)(()=>c?.map(S=>({name:S.name,slug:S.slug,size:S.size}))||[],[c]),b=(Su.includes(a)||["vertical","horizontal"].includes(a))&&s?ha[a]:"",v=s?u?.toLowerCase():u,k=(0,mP.sprintf)((0,mP._x)("%1$s %2$s","spacing"),b,v).trim(),y=p[0]?.value||"px";return(0,Die.jsx)(jm,{allowNegativeOnDrag:o<0,ariaLabel:k,className:"spacing-sizes-control",customValueSettings:FTe,disableCustomValues:m,icon:e,isMixed:t,minimumCustomValue:o,onChange:r,onMouseOut:n,onMouseOver:i,presets:g,presetType:"spacing",selectedUnit:y,units:p,value:d,...f})}var i_=l(w(),1),Vie=["vertical","horizontal"];function Fie({minimumCustomValue:e,onChange:t,onMouseOut:o,onMouseOver:r,sides:n,spacingSizes:i,type:s,values:a}){let c=d=>f=>{if(!t)return;let m={...Object.keys(a).reduce((h,p)=>(h[p]=sh(a[p],i),h),{})};d==="vertical"&&(m.top=f,m.bottom=f),d==="horizontal"&&(m.left=f,m.right=f),t(m)},u=n?.length?Vie.filter(d=>_M(n,d)):Vie;return(0,i_.jsx)(i_.Fragment,{children:u.map(d=>{let f=d==="vertical"?a.top:a.left;return(0,i_.jsx)(Nb,{icon:rC[d],label:ha[d],minimumCustomValue:e,onChange:c(d),onMouseOut:o,onMouseOver:r,side:d,spacingSizes:i,type:s,value:f,withInputField:!1},`spacing-sizes-control-${d}`)})})}var s_=l(w(),1);function zie({minimumCustomValue:e,onChange:t,onMouseOut:o,onMouseOver:r,sides:n,spacingSizes:i,type:s,values:a}){let c=n?.length?Su.filter(d=>n.includes(d)):Su,u=d=>f=>{let m={...Object.keys(a).reduce((h,p)=>(h[p]=sh(a[p],i),h),{})};m[d]=f,t(m)};return(0,s_.jsx)(s_.Fragment,{children:c.map(d=>(0,s_.jsx)(Nb,{icon:rC[d],label:ha[d],minimumCustomValue:e,onChange:u(d),onMouseOut:o,onMouseOver:r,side:d,spacingSizes:i,type:s,value:a[d],withInputField:!1},`spacing-sizes-control-${d}`))})}var jie=l(w(),1);function Uie({minimumCustomValue:e,onChange:t,onMouseOut:o,onMouseOver:r,showSideInLabel:n,side:i,spacingSizes:s,type:a,values:c}){let u=d=>f=>{let m={...Object.keys(c).reduce((h,p)=>(h[p]=sh(c[p],s),h),{})};m[d]=f,t(m)};return(0,jie.jsx)(Nb,{label:ha[i],minimumCustomValue:e,onChange:u(i),onMouseOut:o,onMouseOver:r,showSideInLabel:n,side:i,spacingSizes:s,type:a,value:c[i],withInputField:!1})}var Hie=l(A(),1);var LF=l(N(),1),Gie=l(w(),1);function Wie({isLinked:e,...t}){let o=e?(0,LF.__)("Unlink sides"):(0,LF.__)("Link sides");return(0,Gie.jsx)(Hie.Button,{...t,size:"small",icon:e?fn:Ci,iconSize:24,label:o})}var qa=l(w(),1);function Db({inputProps:e,label:t,minimumCustomValue:o=0,onChange:r,onMouseOut:n,onMouseOver:i,showSideInLabel:s=!0,sides:a=Su,useSelect:c,values:u}){let d=fP(),f=u||QU,m=a?.length===1,h=a?.includes("horizontal")&&a?.includes("vertical")&&a?.length===2,[p,g]=(0,$ie.useState)(eH(f,a)),b=()=>{g(p===Cl.axial?Cl.custom:Cl.axial)},k={...e,minimumCustomValue:o,onChange:C=>{let B={...u,...C};r(B)},onMouseOut:n,onMouseOver:i,sides:a,spacingSizes:d,type:t,useSelect:c,values:f},y=()=>p===Cl.axial?(0,qa.jsx)(Fie,{...k}):p===Cl.custom?(0,qa.jsx)(zie,{...k}):(0,qa.jsx)(Uie,{side:p,...k,showSideInLabel:s}),S=Su.includes(p)&&s?ha[p]:"",x=(0,pP.sprintf)((0,pP._x)("%1$s %2$s","spacing"),t,S).trim();return(0,qa.jsxs)("fieldset",{className:"spacing-sizes-control",children:[(0,qa.jsxs)(Mb.__experimentalHStack,{className:"spacing-sizes-control__header",children:[(0,qa.jsx)(Mb.BaseControl.VisualLabel,{as:"legend",className:"spacing-sizes-control__label",children:x}),!m&&!h&&(0,qa.jsx)(Wie,{label:t,onClick:b,isLinked:p===Cl.axial})]}),(0,qa.jsx)(Mb.__experimentalVStack,{spacing:.5,children:y()})]})}var Kie=l(Re(),1);function Yie(){return(0,Kie.default)("wp.blockEditor.PreviewOptions",{version:"6.5"}),null}var hP=l(R(),1);function qie(e){let[t,o]=(0,hP.useState)(window.innerWidth);(0,hP.useEffect)(()=>{if(e==="Desktop")return;let i=()=>o(window.innerWidth);return window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}},[e]);let r=i=>{let s;switch(i){case"Tablet":s=781;break;case"Mobile":s=479;break;default:return null}return s{let s=i==="Mobile"?"768px":"1024px",a="40px",c="auto";switch(i){case"Tablet":case"Mobile":return{width:r(i),marginTop:a,marginBottom:a,marginLeft:c,marginRight:c,height:s,overflowY:"auto"};default:return{marginLeft:c,marginRight:c}}})(e)}var tk=l(N(),1),zd=l($(),1),zae=l(A(),1),n4=l(F(),1),jae=l(R(),1);var Vb=l(A(),1),gP=l(N(),1),Zie=l(F(),1),bP=l($(),1);var op=l(w(),1);function zTe({block:e,onNavigateToEntityRecord:t,isSyncedPattern:o,isTemplatePartBlock:r}){let n=e?.attributes||{};return(0,op.jsx)(Vb.__experimentalVStack,{className:"block-editor-block-inspector-edit-contents",expanded:!0,children:(0,op.jsx)(Vb.Button,{className:"block-editor-block-inspector-edit-contents__button",__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{if(o)t({postId:n.ref,postType:"wp_block"});else if(r){let{theme:s,slug:a}=n,c=s&&a?`${s}//${a}`:null;c&&t({postId:c,postType:"wp_template_part"})}},children:(0,gP.__)("Edit original")})})}function jTe({clientId:e,editedContentOnlySection:t,editContentOnlySection:o,stopEditingContentOnlySection:r}){return(0,op.jsx)(Vb.__experimentalVStack,{className:"block-editor-block-inspector-edit-contents",expanded:!0,children:(0,op.jsx)(Vb.Button,{className:"block-editor-block-inspector-edit-contents__button",__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{t?r():o(e)},children:t?(0,gP.__)("Exit pattern"):(0,gP.__)("Edit pattern")})})}function Xie({clientId:e}){let{isWithinSection:t,isWithinEditedSection:o,editedContentOnlySection:r,editContentOnlySection:n,stopEditingContentOnlySection:i}=aT(e),{block:s,onNavigateToEntityRecord:a,canEdit:c}=(0,Zie.useSelect)(m=>{let{getBlock:h,getSettings:p,canEditBlock:g}=m(_);return{block:h(e),onNavigateToEntityRecord:p().onNavigateToEntityRecord,canEdit:g(e)}},[e]);if(!c||!t&&!o)return null;let u=(0,bP.isReusableBlock)(s),d=(0,bP.isTemplatePart)(s);return(u||d)&&a?(0,op.jsx)(zTe,{block:s,onNavigateToEntityRecord:a,isSyncedPattern:u,isTemplatePartBlock:d}):(0,op.jsx)(jTe,{clientId:e,editedContentOnlySection:r,editContentOnlySection:n,stopEditingContentOnlySection:i})}var Qie=l(F(),1),Jie=l(N(),1),ese=l(A(),1),tse=l(R(),1);var ose=l(w(),1);function kP(){let e=(0,Qie.useSelect)(r=>r(_).getBlockSelectionStart(),[]),t=(0,tse.useRef)();return $f(e,t),e?(0,ose.jsx)(ese.Button,{__next40pxDefaultSize:!0,variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{t.current?.focus()},children:(0,Jie.__)("Skip to the selected block")}):null}var vP=l(N(),1),rse=l(F(),1);var nse=l(A(),1);var a_=l(w(),1);function NF(){let e=(0,rse.useSelect)(t=>t(_).getSelectedBlockCount(),[]);return(0,a_.jsxs)(nse.__experimentalHStack,{justify:"flex-start",spacing:2,className:"block-editor-multi-selection-inspector__card",children:[(0,a_.jsx)(Ae,{icon:Cf,showColors:!0}),(0,a_.jsx)("div",{className:"block-editor-multi-selection-inspector__card-title",children:(0,vP.sprintf)((0,vP._n)("%d Block","%d Blocks",e),e)})]})}var ek=l(A(),1),oa=l(R(),1),Aae=l(Zp(),1),Jb=l(F(),1);var l_=l(N(),1),yP={name:"settings",title:(0,l_.__)("Settings"),value:"settings",icon:oA},SP={name:"styles",title:(0,l_.__)("Styles"),value:"styles",icon:kN},_P={name:"content",title:(0,l_.__)("Content"),value:"content",icon:kl},yc={name:"list",title:(0,l_.__)("List View"),value:"list-view",icon:sv};var BP=l(A(),1);var c_=l(A(),1),ise=l(N(),1);var u_=l(w(),1),UTe=({initialOpen:e=!1})=>{let t=(0,c_.__experimentalUseSlotFills)(rd.slotName),o=(0,c_.__experimentalUseSlotFills)(sS.name),r=!!(t&&t.length),n=!!(o&&o.length);return!r&&!n?null:(0,u_.jsxs)(c_.PanelBody,{className:"block-editor-block-inspector__advanced",title:(0,ise.__)("Advanced"),initialOpen:e,children:[(0,u_.jsx)(fe.Slot,{group:"advanced"}),(0,u_.jsx)(sS.Slot,{})]})},xP=UTe;var Fb=l(A(),1),wP=l(F(),1),MF=l(N(),1);var d_=l(w(),1),HTe=()=>{let{selectedClientIds:e,selectedBlocks:t,hasPositionAttribute:o}=(0,wP.useSelect)(s=>{let{getBlocksByClientId:a,getSelectedBlockClientIds:c}=s(_),u=c(),d=a(u);return{selectedClientIds:u,selectedBlocks:d,hasPositionAttribute:d?.some(({attributes:f})=>!!f?.style?.position?.type)}},[]),{updateBlockAttributes:r}=(0,wP.useDispatch)(_),n=Ro();function i(){if(!e?.length||!t?.length)return;let s=Object.fromEntries(t?.map(({clientId:a,attributes:c})=>[a,{style:Me({...c?.style,position:{...c?.style?.position,type:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0}})}]));r(e,s,!0)}return(0,d_.jsx)(Fb.__experimentalToolsPanel,{className:"block-editor-block-inspector__position",label:(0,MF.__)("Position"),resetAll:i,dropdownMenuProps:n,children:(0,d_.jsx)(Fb.__experimentalToolsPanelItem,{isShownByDefault:o,label:(0,MF.__)("Position"),hasValue:()=>o,onDeselect:i,children:(0,d_.jsx)(fe.Slot,{group:"position"})})})},GTe=()=>{let e=(0,Fb.__experimentalUseSlotFills)(Wi.position.name);return!(e&&e.length)?null:(0,d_.jsx)(HTe,{})},CP=GTe;var Za=l(w(),1),WTe=({showAdvancedControls:e=!1})=>{let t=(0,BP.__experimentalUseSlotFills)(Wi.default.name),o=(0,BP.__experimentalUseSlotFills)(Wi.position.name),r=(0,BP.__experimentalUseSlotFills)(Wi.bindings.name),n=!!t?.length||!!o?.length||!!r?.length;return(0,Za.jsxs)(Za.Fragment,{children:[(0,Za.jsx)(fe.Slot,{}),(0,Za.jsx)(CP,{}),(0,Za.jsx)(fe.Slot,{group:"bindings"}),e&&(0,Za.jsx)("div",{children:(0,Za.jsx)(xP,{initialOpen:!n})})]})},sse=WTe;var Xb=l(N(),1),m2=l(F(),1);var y_=l($(),1),$F=l(A(),1),Zb=l(R(),1),uae=l(ut(),1),dae=l(F(),1);var WF={};Ip(WF,{AdvancedPanel:()=>ZP,BackgroundPanel:()=>o2,BorderPanel:()=>jP,ColorPanel:()=>WP,DimensionsPanel:()=>DP,FiltersPanel:()=>KP,ImageSettingsPanel:()=>tae,TypographyPanel:()=>OP,useHasBackgroundPanel:()=>v_,useHasBorderPanel:()=>zP,useHasBorderPanelControls:()=>p_,useHasColorPanel:()=>GP,useHasDimensionsPanel:()=>MP,useHasFiltersPanel:()=>Qse,useHasImageSettingsPanel:()=>eae,useHasTypographyPanel:()=>RP,useSettingsForBlockElement:()=>TP});var EP=l(R(),1),ase=l(F(),1),DF=l($(),1),rp=l(N(),1);function TP(e,t,o){let{supportedStyles:r,supports:n}=(0,ase.useSelect)(i=>({supportedStyles:M(i(DF.store)).getSupportedStyles(t,o),supports:i(DF.store).getBlockType(t)?.supports}),[t,o]);return(0,EP.useMemo)(()=>{let i={...e};return r.includes("fontSize")||(i.typography={...i.typography,fontSizes:{},customFontSize:!1,defaultFontSizes:!1}),r.includes("fontFamily")||(i.typography={...i.typography,fontFamilies:{}}),i.color={...i.color,text:i.color?.text&&r.includes("color"),background:i.color?.background&&(r.includes("background")||r.includes("backgroundColor")),button:i.color?.button&&r.includes("buttonColor"),heading:i.color?.heading&&r.includes("headingColor"),link:i.color?.link&&r.includes("linkColor"),caption:i.color?.caption&&r.includes("captionColor")},r.includes("background")||(i.color.gradients=[],i.color.customGradient=!1),r.includes("filter")||(i.color.defaultDuotone=!1,i.color.customDuotone=!1),["lineHeight","fontStyle","fontWeight","letterSpacing","textAlign","textTransform","textDecoration","textIndent","writingMode"].forEach(s=>{r.includes(s)||(i.typography={...i.typography,[s]:!1})}),r.includes("textIndent")&&(i.typography={...i.typography,textIndent:i.typography?.textIndent??"subsequent"}),r.includes("columnCount")||(i.typography={...i.typography,textColumns:!1}),["contentSize","wideSize"].forEach(s=>{r.includes(s)||(i.layout={...i.layout,[s]:!1})}),["padding","margin","blockGap"].forEach(s=>{r.includes(s)||(i.spacing={...i.spacing,[s]:!1});let a=Array.isArray(n?.spacing?.[s])?n?.spacing?.[s]:n?.spacing?.[s]?.sides;a?.length&&i.spacing?.[s]&&(i.spacing={...i.spacing,[s]:{...i.spacing?.[s],sides:a}})}),["aspectRatio","height","minHeight","width"].forEach(s=>{r.includes(s)||(i.dimensions={...i.dimensions,[s]:!1})}),["radius","color","style","width"].forEach(s=>{r.includes("border"+s.charAt(0).toUpperCase()+s.slice(1))||(i.border={...i.border,[s]:!1})}),["backgroundImage","backgroundSize"].forEach(s=>{r.includes(s)||(i.background={...i.background,[s]:!1})}),i.shadow=r.includes("shadow")?i.shadow:!1,i},[e,r,n])}function Xa(e){let t=e?.color?.palette?.custom,o=e?.color?.palette?.theme,r=e?.color?.palette?.default,n=e?.color?.defaultPalette;return(0,EP.useMemo)(()=>{let i=[];return o&&o.length&&i.push({name:(0,rp._x)("Theme","Indicates this palette comes from the theme."),colors:o}),n&&r&&r.length&&i.push({name:(0,rp._x)("Default","Indicates this palette comes from WordPress."),colors:r}),t&&t.length&&i.push({name:(0,rp._x)("Custom","Indicates this palette is created by the user."),colors:t}),i},[t,o,r,n])}function f_(e){let t=e?.color?.gradients?.custom,o=e?.color?.gradients?.theme,r=e?.color?.gradients?.default,n=e?.color?.defaultGradients;return(0,EP.useMemo)(()=>{let i=[];return o&&o.length&&i.push({name:(0,rp._x)("Theme","Indicates this palette comes from the theme."),gradients:o}),n&&r&&r.length&&i.push({name:(0,rp._x)("Default","Indicates this palette comes from WordPress."),gradients:r}),t&&t.length&&i.push({name:(0,rp._x)("Custom","Indicates this palette is created by the user."),gradients:t}),i},[t,o,r,n])}var io=l(A(),1),Mo=l(N(),1),jb=l(R(),1);var zb=l(N(),1);var lse=l(R(),1),IP=l(A(),1),VF=l(w(),1),$Te=[{label:(0,zb.__)("Align text left"),value:"left",icon:Jc},{label:(0,zb.__)("Align text center"),value:"center",icon:Sf},{label:(0,zb.__)("Align text right"),value:"right",icon:eu},{label:(0,zb.__)("Justify text"),value:"justify",icon:OO}],KTe=["left","center","right"];function PP({className:e,value:t,onChange:o,options:r=KTe}){let n=(0,lse.useMemo)(()=>$Te.filter(i=>r.includes(i.value)),[r]);return n.length?(0,VF.jsx)(IP.__experimentalToggleGroupControl,{isDeselectable:!0,__next40pxDefaultSize:!0,label:(0,zb.__)("Text alignment"),className:V("block-editor-text-alignment-control",e),value:t,onChange:i=>{o(i===t?void 0:i)},children:n.map(i=>(0,VF.jsx)(IP.__experimentalToggleGroupControlOptionIcon,{value:i.value,icon:i.icon,label:i.label},i.value))}):null}var No=l(A(),1),m_=l(N(),1);var ns=l(w(),1);function cse({__next40pxDefaultSize:e=!1,value:t,onChange:o,__unstableInputWidth:r="60px",withSlider:n=!1,hasBottomMargin:i=!1,help:s,...a}){let[c]=me("spacing.units"),u=(0,No.__experimentalUseCustomUnits)({availableUnits:c||["px","em","rem","ch","%","vw","vh"],defaultValues:{px:16,em:2,rem:2,ch:2}}),[d,f]=(0,No.__experimentalParseQuantityAndUnitFromRawValue)(t,u),m=!!f&&["em","rem","%","ch","vw","vh"].includes(f);return n?(0,ns.jsxs)(No.__experimentalView,{style:i?{marginBottom:12}:void 0,children:[(0,ns.jsx)(No.BaseControl.VisualLabel,{children:(0,m_.__)("Line indent")}),(0,ns.jsxs)(No.Flex,{children:[(0,ns.jsx)(No.FlexItem,{isBlock:!0,children:(0,ns.jsx)(No.__experimentalUnitControl,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,label:(0,m_.__)("Line indent"),labelPosition:"top",hideLabelFromVision:!0,value:t,onChange:o,size:a.size,units:u,__unstableInputWidth:r,min:0})}),n&&(0,ns.jsx)(No.FlexItem,{isBlock:!0,children:(0,ns.jsx)(No.__experimentalSpacer,{marginX:2,marginBottom:0,children:(0,ns.jsx)(No.RangeControl,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,label:(0,m_.__)("Line indent"),hideLabelFromVision:!0,value:d,withInputField:!1,onChange:h=>{o?.(h===void 0?void 0:h+(f??"px"))},min:0,max:m?10:100,step:m?.1:1,initialPosition:0})})})]}),s&&(0,ns.jsx)("p",{className:"components-base-control__help",children:s})]}):(0,ns.jsx)(No.__experimentalUnitControl,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,...a,label:(0,m_.__)("Line indent"),value:t,__unstableInputWidth:r,units:u,onChange:o,help:s})}function dse(e,t){let o=e?.typography?.fontFamilies,r=["default","theme","custom"].flatMap(i=>o?.[i]??[]),n=r.find(i=>i.fontFamily===t)?.fontFace??[];return{fontFamilies:r,fontFamilyFaces:n}}function use(e,t){return t=typeof t=="number"?t.toString():t,!t||typeof t!="string"?"":!e||e.length===0?t:e?.reduce((r,{value:n})=>{let i=Math.abs(parseInt(n)-parseInt(t)),s=Math.abs(parseInt(r)-parseInt(t));return ir.value===t)?t:t==="oblique"&&!e.find(r=>r.value==="oblique")?"italic":""}function fse(e,t,o){let r=t,n=o,{fontStyles:i,fontWeights:s,combinedStyleAndWeightOptions:a}=ib(e),c=i?.some(({value:d})=>d===t),u=s?.some(({value:d})=>d?.toString()===o?.toString());return c||(r=t?YTe(i,t):a?.find(d=>d.style.fontWeight===use(s,o))?.style?.fontStyle),u||(n=o?use(s,o):a?.find(d=>d.style.fontStyle===(r||t))?.style?.fontWeight),{nearestFontStyle:r,nearestFontWeight:n}}var Je=l(w(),1),qTe=1,ZTe=6;function RP(e){let t=pse(e),o=hse(e),r=gse(e),n=bse(e),i=vse(e),s=kse(e),a=yse(e),c=xse(e),u=Sse(e),d=_se(e),f=mse(e);return t||o||r||n||i||s||f||a||c||u||d}function mse(e){return e?.typography?.defaultFontSizes!==!1&&e?.typography?.fontSizes?.default?.length||e?.typography?.fontSizes?.theme?.length||e?.typography?.fontSizes?.custom?.length||e?.typography?.customFontSize}function pse(e){return["default","theme","custom"].some(t=>e?.typography?.fontFamilies?.[t]?.length)}function hse(e){return e?.typography?.lineHeight}function gse(e){return e?.typography?.fontStyle||e?.typography?.fontWeight}function XTe(e){return e?.typography?.fontStyle?e?.typography?.fontWeight?(0,Mo.__)("Appearance"):(0,Mo.__)("Font style"):(0,Mo.__)("Font weight")}function bse(e){return e?.typography?.letterSpacing}function kse(e){return e?.typography?.textTransform}function vse(e){return e?.typography?.textAlign}function yse(e){return e?.typography?.textDecoration}function Sse(e){return e?.typography?.writingMode}function _se(e){return e?.typography?.textColumns}function xse(e){return e?.typography?.textIndent}function QTe(e){let t=e?.typography?.fontSizes,o=!!e?.typography?.defaultFontSizes;return[...t?.custom??[],...t?.theme??[],...o?t?.default??[]:[]]}function JTe({resetAllFilter:e,onChange:t,value:o,panelId:r,children:n}){let i=Ro(),s=()=>{let a=e(o);t(a)};return(0,Je.jsx)(io.__experimentalToolsPanel,{label:(0,Mo.__)("Typography"),resetAll:s,panelId:r,dropdownMenuProps:i,children:n})}var eIe={fontFamily:!0,fontSize:!0,fontAppearance:!0,lineHeight:!0,letterSpacing:!0,textAlign:!0,textTransform:!0,textDecoration:!0,textIndent:!0,writingMode:!0,textColumns:!0};function OP({as:e=JTe,value:t,onChange:o,inheritedValue:r=t,settings:n,panelId:i,defaultControls:s=eIe,isGlobalStyles:a=!1}){let c=te=>wn({settings:n},"",te),u=pse(n),d=c(r?.typography?.fontFamily),{fontFamilies:f,fontFamilyFaces:m}=(0,jb.useMemo)(()=>dse(n,d),[n,d]),h=te=>{let Le=f?.find(({fontFamily:cn})=>cn===te)?.slug,ct=pe(t,["typography","fontFamily"],Le?`var:preset|font-family|${Le}`:te||void 0),Gc=f?.find(({fontFamily:cn})=>cn===te)?.fontFace??[],{fontStyles:ua,fontWeights:Bp}=ib(Gc),jk=ua?.some(({value:cn})=>cn===T),hf=Bp?.some(({value:cn})=>cn?.toString()===O?.toString());if(!jk||!hf){let{nearestFontStyle:cn,nearestFontWeight:Ep}=fse(Gc,T,O);cn||Ep?ct={...ct,typography:{...ct?.typography,fontStyle:cn||void 0,fontWeight:Ep||void 0}}:(T||O)&&(ct={...ct,typography:{...ct?.typography,fontStyle:void 0,fontWeight:void 0}})}o(ct)},p=()=>!!t?.typography?.fontFamily,g=()=>h(void 0),b=mse(n),v=!n?.typography?.customFontSize,k=QTe(n),y=c(r?.typography?.fontSize),S=(()=>{let te=r?.typography?.fontSize;if(!te||typeof te!="string")return;if(te.startsWith("var:preset|font-size|"))return te.replace("var:preset|font-size|","");let Le=te.match(/^var\(--wp--preset--font-size--([^)]+)\)$/);if(Le)return Le[1]})(),x=(te,Le)=>{let ct=Le?.slug?`var:preset|font-size|${Le?.slug}`:te;o(pe(t,["typography","fontSize"],ct||void 0))},C=()=>!!t?.typography?.fontSize,B=()=>x(void 0),I=gse(n),P=XTe(n),E=n?.typography?.fontStyle,L=n?.typography?.fontWeight,T=c(r?.typography?.fontStyle),O=c(r?.typography?.fontWeight),D=(0,jb.useCallback)(({fontStyle:te,fontWeight:Le})=>{(te!==T||Le!==O)&&o({...t,typography:{...t?.typography,fontStyle:te||void 0,fontWeight:Le||void 0}})},[T,O,o,t]),U=()=>!!t?.typography?.fontStyle||!!t?.typography?.fontWeight,G=(0,jb.useCallback)(()=>{D({})},[D]),j=hse(n),z=c(r?.typography?.lineHeight),W=te=>{o(pe(t,["typography","lineHeight"],te||void 0))},ee=()=>t?.typography?.lineHeight!==void 0,se=()=>W(void 0),ce=bse(n),ie=c(r?.typography?.letterSpacing),re=te=>{o(pe(t,["typography","letterSpacing"],te||void 0))},Q=()=>!!t?.typography?.letterSpacing,Y=()=>re(void 0),J=xse(n),K=c(r?.typography?.textIndent),X=(n?.typography?.textIndent??"subsequent")==="all",ne=te=>{o(pe(t,["typography","textIndent"],te||void 0))},le=te=>{o({...t,settings:{typography:{textIndent:te?"all":"subsequent"}}})},ve=()=>!!t?.typography?.textIndent,he=()=>{o(pe(t,["typography","textIndent"],void 0))},xe=X?(0,Mo.__)("Indents the first line of all paragraphs."):(0,Mo.__)("Indents the first line of each paragraph after the first one."),ze=_se(n),ot=c(r?.typography?.textColumns),Wt=te=>{o(pe(t,["typography","textColumns"],te||void 0))},fo=()=>!!t?.typography?.textColumns,Do=()=>Wt(void 0),rt=kse(n),ar=c(r?.typography?.textTransform),xt=te=>{o(pe(t,["typography","textTransform"],te||void 0))},At=()=>!!t?.typography?.textTransform,Pe=()=>xt(void 0),wt=yse(n),qo=c(r?.typography?.textDecoration),$t=te=>{o(pe(t,["typography","textDecoration"],te||void 0))},lr=()=>!!t?.typography?.textDecoration,ln=()=>$t(void 0),je=Sse(n),Eo=c(r?.typography?.writingMode),Ze=te=>{o(pe(t,["typography","writingMode"],te||void 0))},Ve=()=>!!t?.typography?.writingMode,gt=()=>Ze(void 0),To=vse(n),cr=c(r?.typography?.textAlign),ge=te=>{o(pe(t,["typography","textAlign"],te||void 0))},Ct=()=>!!t?.typography?.textAlign,Io=()=>ge(void 0),Ke=(0,jb.useCallback)(te=>({...te,typography:{}}),[]);return(0,Je.jsxs)(e,{resetAllFilter:Ke,value:t,onChange:o,panelId:i,children:[u&&(0,Je.jsx)(io.__experimentalToolsPanelItem,{label:(0,Mo.__)("Font"),hasValue:p,onDeselect:g,isShownByDefault:s.fontFamily,panelId:i,children:(0,Je.jsx)(rI,{fontFamilies:f,value:d,onChange:h,size:"__unstable-large"})}),b&&(0,Je.jsx)(io.__experimentalToolsPanelItem,{label:(0,Mo.__)("Size"),hasValue:C,onDeselect:B,isShownByDefault:s.fontSize,panelId:i,children:(0,Je.jsx)(io.FontSizePicker,{value:S||y,valueMode:S?"slug":"literal",onChange:x,fontSizes:k,disableCustomFontSizes:v,withReset:!1,withSlider:!0,size:"__unstable-large"})}),I&&(0,Je.jsx)(io.__experimentalToolsPanelItem,{label:P,hasValue:U,onDeselect:G,isShownByDefault:s.fontAppearance,panelId:i,children:(0,Je.jsx)(oI,{value:{fontStyle:T,fontWeight:O},onChange:D,hasFontStyles:E,hasFontWeights:L,fontFamilyFaces:m,size:"__unstable-large"})}),j&&(0,Je.jsx)(io.__experimentalToolsPanelItem,{className:"single-column",label:(0,Mo.__)("Line height"),hasValue:ee,onDeselect:se,isShownByDefault:s.lineHeight,panelId:i,children:(0,Je.jsx)(HI,{__unstableInputWidth:"auto",value:z,onChange:W,size:"__unstable-large"})}),ce&&(0,Je.jsx)(io.__experimentalToolsPanelItem,{className:"single-column",label:(0,Mo.__)("Letter spacing"),hasValue:Q,onDeselect:Y,isShownByDefault:s.letterSpacing,panelId:i,children:(0,Je.jsx)(iI,{value:ie,onChange:re,size:"__unstable-large",__unstableInputWidth:"auto"})}),J&&(0,Je.jsxs)(io.__experimentalToolsPanelItem,{label:(0,Mo.__)("Line indent"),hasValue:ve,onDeselect:he,isShownByDefault:s.textIndent,panelId:i,children:[(0,Je.jsx)(cse,{value:K,onChange:ne,size:"__unstable-large",__unstableInputWidth:"auto",withSlider:!0,hasBottomMargin:a}),a&&(0,Je.jsx)(io.ToggleControl,{label:(0,Mo.__)("Indent all paragraphs"),checked:X,onChange:le,help:xe})]}),ze&&(0,Je.jsx)(io.__experimentalToolsPanelItem,{className:"single-column",label:(0,Mo.__)("Columns"),hasValue:fo,onDeselect:Do,isShownByDefault:s.textColumns,panelId:i,children:(0,Je.jsx)(io.__experimentalNumberControl,{label:(0,Mo.__)("Columns"),max:ZTe,min:qTe,onChange:Wt,size:"__unstable-large",spinControls:"custom",value:ot,initialPosition:1})}),wt&&(0,Je.jsx)(io.__experimentalToolsPanelItem,{className:"single-column",label:(0,Mo.__)("Decoration"),hasValue:lr,onDeselect:ln,isShownByDefault:s.textDecoration,panelId:i,children:(0,Je.jsx)(aI,{value:qo,onChange:$t,size:"__unstable-large",__unstableInputWidth:"auto"})}),je&&(0,Je.jsx)(io.__experimentalToolsPanelItem,{className:"single-column",label:(0,Mo.__)("Orientation"),hasValue:Ve,onDeselect:gt,isShownByDefault:s.writingMode,panelId:i,children:(0,Je.jsx)(dI,{value:Eo,onChange:Ze,size:"__unstable-large"})}),rt&&(0,Je.jsx)(io.__experimentalToolsPanelItem,{label:(0,Mo.__)("Letter case"),hasValue:At,onDeselect:Pe,isShownByDefault:s.textTransform,panelId:i,children:(0,Je.jsx)(cI,{value:ar,onChange:xt,showNone:!0,isBlock:!0,size:"__unstable-large"})}),To&&(0,Je.jsxs)(io.__experimentalToolsPanelItem,{label:(0,Mo.__)("Text alignment"),hasValue:Ct,onDeselect:Io,isShownByDefault:s.textAlign,panelId:i,children:[(0,Je.jsx)(PP,{value:cr,onChange:ge,options:["left","center","right","justify"],size:"__unstable-large"}),cr==="justify"&&(0,Je.jsx)("div",{children:(0,Je.jsx)(io.Notice,{status:"warning",isDismissible:!1,children:(0,Mo.__)("Justified text can reduce readability. For better accessibility, use left-aligned text instead.")})})]})]})}var Zt=l(N(),1),jt=l(A(),1);var Hb=l(R(),1);var et=l(A(),1),Go=l(N(),1),Cse=l(R(),1),AP=l(F(),1);var wse=l(F(),1);function np(e,t){let{getBlockOrder:o,getBlockAttributes:r}=(0,wse.useSelect)(_);return(i,s)=>{let a=(s-1)*t+i-1,c=0;for(let u of o(e)){let{columnStart:d,rowStart:f}=r(u).style?.layout??{};(f-1)*t+d-1!!i,u=a==="horizontal"?(0,Go.__)("Width"):(0,Go.__)("Height"),[d]=me("spacing.units"),f=(0,et.__experimentalUseCustomUnits)({availableUnits:d||["%","px","em","rem","vh","vw"]}),m=()=>{t({selfStretch:void 0,flexSize:void 0})};return(0,Cse.useEffect)(()=>{i==="fixed"&&!s&&t({...e,selfStretch:"fit"})},[]),(0,qt.jsxs)(et.__experimentalVStack,{as:et.__experimentalToolsPanelItem,spacing:2,hasValue:c,label:u,onDeselect:m,isShownByDefault:r,panelId:n,children:[(0,qt.jsxs)(et.__experimentalToggleGroupControl,{size:"__unstable-large",label:rIe(o),value:i||"fit",help:tIe(i,o),onChange:h=>{t({selfStretch:h,flexSize:h!=="fixed"?null:s})},isBlock:!0,children:[(0,qt.jsx)(et.__experimentalToggleGroupControlOption,{value:"fit",label:(0,Go._x)("Fit","Intrinsic block width in flex layout")},"fit"),(0,qt.jsx)(et.__experimentalToggleGroupControlOption,{value:"fill",label:(0,Go._x)("Grow","Block with expanding width in flex layout")},"fill"),(0,qt.jsx)(et.__experimentalToggleGroupControlOption,{value:"fixed",label:(0,Go._x)("Fixed","Block with fixed width in flex layout")},"fixed")]}),i==="fixed"&&(0,qt.jsx)(et.__experimentalUnitControl,{size:"__unstable-large",units:f,onChange:h=>{t({selfStretch:i,flexSize:h})},value:s,min:0,label:u,hideLabelFromVision:!0})]})}function rIe(e){let{orientation:t="horizontal"}=e;return t==="horizontal"?(0,Go.__)("Width"):(0,Go.__)("Height")}function nIe({childLayout:e,onChange:t,parentLayout:o,isShownByDefault:r,panelId:n}){let{columnStart:i,rowStart:s,columnSpan:a,rowSpan:c}=e,{columnCount:u,rowCount:d}=o??{},f=(0,AP.useSelect)(x=>x(_).getBlockRootClientId(n)),{moveBlocksToPosition:m,__unstableMarkNextChangeAsNotPersistent:h}=(0,AP.useDispatch)(_),p=np(f,u||3),g=()=>!!i||!!s,b=()=>!!a||!!c,v=()=>{t({columnStart:void 0,rowStart:void 0})},k=()=>{t({columnSpan:void 0,rowSpan:void 0})},y=u?u-(i??1)+1:void 0,S=window.__experimentalEnableGridInteractivity&&d?d-(s??1)+1:void 0;return(0,qt.jsxs)(qt.Fragment,{children:[(0,qt.jsxs)(et.Flex,{as:et.__experimentalToolsPanelItem,hasValue:b,label:(0,Go.__)("Grid span"),onDeselect:k,isShownByDefault:r,panelId:n,children:[(0,qt.jsx)(et.FlexItem,{style:{width:"50%"},children:(0,qt.jsx)(et.__experimentalInputControl,{size:"__unstable-large",label:(0,Go.__)("Column span"),type:"number",onChange:x=>{let C=x===""?1:parseInt(x,10),B=y?Math.min(C,y):C;t({columnStart:i,rowStart:s,rowSpan:c,columnSpan:B})},value:a??1,min:1,max:y})}),(0,qt.jsx)(et.FlexItem,{style:{width:"50%"},children:(0,qt.jsx)(et.__experimentalInputControl,{size:"__unstable-large",label:(0,Go.__)("Row span"),type:"number",onChange:x=>{let C=x===""?1:parseInt(x,10),B=S?Math.min(C,S):C;t({columnStart:i,rowStart:s,columnSpan:a,rowSpan:B})},value:c??1,min:1,max:S})})]}),window.__experimentalEnableGridInteractivity&&(0,qt.jsxs)(et.Flex,{as:et.__experimentalToolsPanelItem,hasValue:g,label:(0,Go.__)("Grid placement"),onDeselect:v,isShownByDefault:!1,panelId:n,children:[(0,qt.jsx)(et.FlexItem,{style:{width:"50%"},children:(0,qt.jsx)(et.__experimentalInputControl,{size:"__unstable-large",label:(0,Go.__)("Column"),type:"number",onChange:x=>{let C=x===""?1:parseInt(x,10);t({columnStart:C,rowStart:s,columnSpan:a,rowSpan:c}),h(),m([n],f,f,p(C,s))},value:i??1,min:1,max:u?u-(a??1)+1:void 0})}),(0,qt.jsx)(et.FlexItem,{style:{width:"50%"},children:(0,qt.jsx)(et.__experimentalInputControl,{size:"__unstable-large",label:(0,Go.__)("Row"),type:"number",onChange:x=>{let C=x===""?1:parseInt(x,10);t({columnStart:i,rowStart:C,columnSpan:a,rowSpan:c}),h(),m([n],f,f,p(i,C))},value:s??1,min:1,max:d?d-(c??1)+1:void 0})})]})]})}var LP=l(A(),1),Ub=l(N(),1);var FF=l(w(),1);function NP({panelId:e,value:t,onChange:o=()=>{},options:r,defaultValue:n="auto",hasValue:i,isShownByDefault:s=!0}){let a=t??"auto",[c,u,d]=me("dimensions.aspectRatios.default","dimensions.aspectRatios.theme","dimensions.defaultAspectRatios"),f=u?.map(({name:p,ratio:g})=>({label:p,value:g})),m=c?.map(({name:p,ratio:g})=>({label:p,value:g})),h=[{label:(0,Ub._x)("Original","Aspect ratio option for dimensions control"),value:"auto"},...d?m:[],...f||[],{label:(0,Ub._x)("Custom","Aspect ratio option for dimensions control"),value:"custom",disabled:!0,hidden:!0}];return(0,FF.jsx)(LP.__experimentalToolsPanelItem,{hasValue:i||(()=>a!==n),label:(0,Ub.__)("Aspect ratio"),onDeselect:()=>o(void 0),isShownByDefault:s,panelId:e,children:(0,FF.jsx)(LP.SelectControl,{label:(0,Ub.__)("Aspect ratio"),value:a,options:r??h,onChange:o,size:"__unstable-large"})})}var We=l(w(),1),zF=["horizontal","vertical"];function MP(e){let t=Ise(e),o=Pse(e),r=Rse(e),n=Ose(e),i=Ase(e),s=Lse(e),a=Nse(e),c=Mse(e),u=Dse(e),d=Vse(e);return Hb.Platform.OS==="web"&&(t||o||r||n||i||s||a||c||u||d)}function Ise(e){return e?.layout?.contentSize}function Pse(e){return e?.layout?.wideSize}function Rse(e){return e?.spacing?.padding}function Ose(e){return e?.spacing?.margin}function Ase(e){return e?.spacing?.blockGap}function Lse(e){return e?.dimensions?.height}function Nse(e){return e?.dimensions?.minHeight}function Mse(e){return e?.dimensions?.width}function Dse(e){return e?.dimensions?.aspectRatio}function Vse(e){let{type:t="default",default:{type:o="default"}={},allowSizingOnChildren:r=!1}=e?.parentLayout??{},n=(o==="flex"||t==="flex"||o==="grid"||t==="grid")&&r;return!!e?.layout&&n}function iIe(e){let{defaultSpacingSizes:t,spacingSizes:o}=e?.spacing||{};return t!==!1&&o?.default?.length>0||o?.theme?.length>0||o?.custom?.length>0}function Ese(e,t){if(!t||!e)return e;let o={};return t.forEach(r=>{r==="vertical"&&(o.top=e.top,o.bottom=e.bottom),r==="horizontal"&&(o.left=e.left,o.right=e.right),o[r]=e?.[r]}),o}function Tse(e){return e&&typeof e=="string"?{top:e,right:e,bottom:e,left:e}:e}function sIe(e,t){return e&&(typeof e=="string"?t?{top:e,right:e,bottom:e,left:e}:{top:e}:{...e,right:e?.left,bottom:e?.top})}function aIe({resetAllFilter:e,onChange:t,value:o,panelId:r,children:n}){let i=Ro(),s=()=>{let a=e(o);t(a)};return(0,We.jsx)(jt.__experimentalToolsPanel,{label:(0,Zt.__)("Dimensions"),resetAll:s,panelId:r,dropdownMenuProps:i,children:n})}var ea={contentSize:!0,wideSize:!0,padding:!0,margin:!0,blockGap:!0,height:!0,minHeight:!0,width:!0,aspectRatio:!0,childLayout:!0};function DP({as:e=aIe,value:t,onChange:o,inheritedValue:r=t,settings:n,panelId:i,defaultControls:s=ea,onVisualize:a=()=>{},includeLayoutControls:c=!1}){let{dimensions:u,spacing:d}=n,f=te=>te&&typeof te=="object"?Object.keys(te).reduce((Le,ct)=>(Le[ct]=wn({settings:{dimensions:u,spacing:d}},"",te[ct]),Le),{}):wn({settings:{dimensions:u,spacing:d}},"",te),m=iIe(n),h=(0,jt.__experimentalUseCustomUnits)({availableUnits:n?.spacing?.units||["%","px","em","rem","vw"]}),p=-1/0,[g,b]=(0,Hb.useState)(p),v=Ise(n)&&c,k=f(r?.layout?.contentSize),y=te=>{o(pe(t,["layout","contentSize"],te||void 0))},S=()=>!!t?.layout?.contentSize,x=()=>y(void 0),C=Pse(n)&&c,B=f(r?.layout?.wideSize),I=te=>{o(pe(t,["layout","wideSize"],te||void 0))},P=()=>!!t?.layout?.wideSize,E=()=>I(void 0),L=Rse(n),T=f(r?.spacing?.padding),O=Tse(T),D=Array.isArray(n?.spacing?.padding)?n?.spacing?.padding:n?.spacing?.padding?.sides,U=D&&D.some(te=>zF.includes(te)),G=te=>{let Le=Ese(te,D);o(pe(t,["spacing","padding"],Le))},j=()=>!!t?.spacing?.padding&&Object.keys(t?.spacing?.padding).length,z=()=>G(void 0),W=()=>a("padding"),ee=Ose(n),se=f(r?.spacing?.margin),ce=Tse(se),ie=Array.isArray(n?.spacing?.margin)?n?.spacing?.margin:n?.spacing?.margin?.sides,re=ie&&ie.some(te=>zF.includes(te)),Q=te=>{let Le=Ese(te,ie);o(pe(t,["spacing","margin"],Le))},Y=()=>!!t?.spacing?.margin&&Object.keys(t?.spacing?.margin).length,J=()=>Q(void 0),K=()=>a("margin"),H=Ase(n),X=Array.isArray(n?.spacing?.blockGap)?n?.spacing?.blockGap:n?.spacing?.blockGap?.sides,ne=X&&X.some(te=>zF.includes(te)),le=f(r?.spacing?.blockGap),ve=sIe(le,ne),he=te=>{o(pe(t,["spacing","blockGap"],te))},xe=te=>{te||he(null),!ne&&te?.hasOwnProperty("top")?he(te.top):he({top:te?.top,left:te?.left})},ze=()=>he(void 0),ot=()=>!!t?.spacing?.blockGap,Wt=Nse(n),fo=f(r?.dimensions?.minHeight),Do=te=>{let Le=pe(t,["dimensions","minHeight"],te);o(pe(Le,["dimensions","aspectRatio"],void 0))},rt=()=>{Do(void 0)},ar=()=>!!t?.dimensions?.minHeight,xt=Lse(n),At=f(r?.dimensions?.height),Pe=te=>{let Le=pe(t,["dimensions","height"],te);o(pe(Le,["dimensions","aspectRatio"],void 0))},wt=()=>{Pe(void 0)},qo=()=>!!t?.dimensions?.height,$t=Mse(n),lr=f(r?.dimensions?.width),ln=te=>{o(pe(t,["dimensions","width"],te))},je=()=>{ln(void 0)},Eo=()=>!!t?.dimensions?.width,Ze=Dse(n),Ve=f(r?.dimensions?.aspectRatio),gt=te=>{let Le=pe(t,["dimensions","aspectRatio"],te);o(pe(Le,["dimensions","minHeight"],void 0))},To=()=>!!t?.dimensions?.aspectRatio,cr=Vse(n),ge=r?.layout,Ct=te=>{o({...t,layout:{...te}})},Io=(0,Hb.useCallback)(te=>({...te,layout:Me({...te?.layout,contentSize:void 0,wideSize:void 0,selfStretch:void 0,flexSize:void 0,columnStart:void 0,rowStart:void 0,columnSpan:void 0,rowSpan:void 0}),spacing:{...te?.spacing,padding:void 0,margin:void 0,blockGap:void 0},dimensions:{...te?.dimensions,height:void 0,minHeight:void 0,aspectRatio:void 0,width:void 0}}),[]),Ke=()=>a(!1);return(0,We.jsxs)(e,{resetAllFilter:Io,value:t,onChange:o,panelId:i,children:[(v||C)&&(0,We.jsx)("span",{className:"span-columns",children:(0,Zt.__)("Set the width of the main content area.")}),v&&(0,We.jsx)(jt.__experimentalToolsPanelItem,{label:(0,Zt.__)("Content width"),hasValue:S,onDeselect:x,isShownByDefault:s.contentSize??ea.contentSize,panelId:i,children:(0,We.jsx)(jt.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,Zt.__)("Content width"),labelPosition:"top",value:k||"",onChange:te=>{y(te)},units:h,prefix:(0,We.jsx)(jt.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,We.jsx)(we,{icon:_f})})})}),C&&(0,We.jsx)(jt.__experimentalToolsPanelItem,{label:(0,Zt.__)("Wide width"),hasValue:P,onDeselect:E,isShownByDefault:s.wideSize??ea.wideSize,panelId:i,children:(0,We.jsx)(jt.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,Zt.__)("Wide width"),labelPosition:"top",value:B||"",onChange:te=>{I(te)},units:h,prefix:(0,We.jsx)(jt.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,We.jsx)(we,{icon:Lf})})})}),L&&(0,We.jsxs)(jt.__experimentalToolsPanelItem,{hasValue:j,label:(0,Zt.__)("Padding"),onDeselect:z,isShownByDefault:s.padding??ea.padding,className:V({"tools-panel-item-spacing":m}),panelId:i,children:[!m&&(0,We.jsx)(jt.BoxControl,{__next40pxDefaultSize:!0,values:O,onChange:G,label:(0,Zt.__)("Padding"),sides:D,units:h,allowReset:!1,splitOnAxis:U,inputProps:{onMouseOver:W,onMouseOut:Ke}}),m&&(0,We.jsx)(Db,{values:O,onChange:G,label:(0,Zt.__)("Padding"),sides:D,units:h,allowReset:!1,onMouseOver:W,onMouseOut:Ke})]}),ee&&(0,We.jsxs)(jt.__experimentalToolsPanelItem,{hasValue:Y,label:(0,Zt.__)("Margin"),onDeselect:J,isShownByDefault:s.margin??ea.margin,className:V({"tools-panel-item-spacing":m}),panelId:i,children:[!m&&(0,We.jsx)(jt.BoxControl,{__next40pxDefaultSize:!0,values:ce,onChange:Q,inputProps:{min:g,onDragStart:()=>{b(0)},onDragEnd:()=>{b(p)},onMouseOver:K,onMouseOut:Ke},label:(0,Zt.__)("Margin"),sides:ie,units:h,allowReset:!1,splitOnAxis:re}),m&&(0,We.jsx)(Db,{values:ce,onChange:Q,minimumCustomValue:-1/0,label:(0,Zt.__)("Margin"),sides:ie,units:h,allowReset:!1,onMouseOver:K,onMouseOut:Ke})]}),H&&(0,We.jsxs)(jt.__experimentalToolsPanelItem,{hasValue:ot,label:(0,Zt.__)("Block spacing"),onDeselect:ze,isShownByDefault:s.blockGap??ea.blockGap,className:V({"tools-panel-item-spacing":m,"single-column":!m&&!ne}),panelId:i,children:[!m&&(ne?(0,We.jsx)(jt.BoxControl,{__next40pxDefaultSize:!0,label:(0,Zt.__)("Block spacing"),min:0,onChange:xe,units:h,sides:X,values:ve,allowReset:!1,splitOnAxis:ne}):(0,We.jsx)(jt.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,Zt.__)("Block spacing"),min:0,onChange:he,units:h,value:le})),m&&(0,We.jsx)(Db,{label:(0,Zt.__)("Block spacing"),min:0,onChange:xe,showSideInLabel:!1,sides:ne?X:["top"],values:ve,allowReset:!1})]}),cr&&(0,We.jsx)(Bse,{value:ge,onChange:Ct,parentLayout:n?.parentLayout,panelId:i,isShownByDefault:s.childLayout??ea.childLayout}),Wt&&(0,We.jsx)(jt.__experimentalToolsPanelItem,{hasValue:ar,label:(0,Zt.__)("Minimum height"),onDeselect:rt,isShownByDefault:s.minHeight??ea.minHeight,panelId:i,children:(0,We.jsx)(lb,{label:(0,Zt.__)("Minimum height"),value:fo,onChange:Do})}),xt&&(0,We.jsx)(jt.__experimentalToolsPanelItem,{hasValue:qo,label:(0,Zt.__)("Height"),onDeselect:wt,isShownByDefault:s.height??ea.height,panelId:i,children:(0,We.jsx)(lb,{label:(0,Zt.__)("Height"),value:At,onChange:Pe})}),$t&&(0,We.jsx)(jt.__experimentalToolsPanelItem,{hasValue:Eo,label:(0,Zt.__)("Width"),onDeselect:je,isShownByDefault:s.width??ea.width,panelId:i,children:(0,We.jsx)(lb,{label:(0,Zt.__)("Width"),value:lr,onChange:ln})}),Ze&&(0,We.jsx)(NP,{hasValue:To,value:Ve,onChange:gt,panelId:i,isShownByDefault:s.aspectRatio??ea.aspectRatio})]})}var en=l(A(),1),Wb=l(R(),1),Gb=l(N(),1);var ip=l(N(),1),xo=l(A(),1),FP=l(R(),1);var Rt=l(w(),1),VP=[];function lIe({shadow:e,onShadowChange:t,settings:o}){let r=jF(o);return(0,Rt.jsx)("div",{className:"block-editor-global-styles__shadow-popover-container",children:(0,Rt.jsxs)(xo.__experimentalVStack,{spacing:4,children:[(0,Rt.jsx)(xo.__experimentalHeading,{level:5,children:(0,ip.__)("Drop shadow")}),(0,Rt.jsx)(cIe,{presets:r,activeShadow:e,onSelect:t}),(0,Rt.jsx)("div",{className:"block-editor-global-styles__clear-shadow",children:(0,Rt.jsx)(xo.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>t(void 0),disabled:!e,accessibleWhenDisabled:!0,children:(0,ip.__)("Clear")})})]})})}function cIe({presets:e,activeShadow:t,onSelect:o}){return e?(0,Rt.jsx)(xo.Composite,{role:"listbox",className:"block-editor-global-styles__shadow__list","aria-label":(0,ip.__)("Drop shadows"),children:e.map(({name:r,slug:n,shadow:i})=>(0,Rt.jsx)(uIe,{label:r,isActive:i===t,type:n==="unset"?"unset":"preset",onSelect:()=>o(i===t?void 0:i),shadow:i},n))}):null}function uIe({type:e,label:t,isActive:o,onSelect:r,shadow:n}){return(0,Rt.jsx)(xo.Tooltip,{text:t,children:(0,Rt.jsx)(xo.Composite.Item,{role:"option","aria-label":t,"aria-selected":o,className:V("block-editor-global-styles__shadow__item",{"is-active":o}),render:(0,Rt.jsx)("button",{className:V("block-editor-global-styles__shadow-indicator",{unset:e==="unset"}),onClick:r,style:{boxShadow:n},"aria-label":t,children:o&&(0,Rt.jsx)(we,{icon:gl})})})})}function Fse({shadow:e,onShadowChange:t,settings:o}){return(0,Rt.jsx)(xo.Dropdown,{popoverProps:{placement:"left-start",offset:36,shift:!0},className:"block-editor-global-styles__shadow-dropdown",renderToggle:dIe(e,t),renderContent:()=>(0,Rt.jsx)(xo.__experimentalDropdownContentWrapper,{paddingSize:"medium",children:(0,Rt.jsx)(lIe,{shadow:e,onShadowChange:t,settings:o})})})}function dIe(e,t){return function({onToggle:r,isOpen:n}){let i=(0,FP.useRef)(void 0),s={onClick:r,className:V("block-editor-global-styles__shadow-dropdown-toggle",{"is-open":n}),"aria-expanded":n,ref:i},a={onClick:()=>{n&&r(),t(void 0),i.current?.focus()},className:V("block-editor-global-styles__shadow-editor__remove-button",{"is-open":n}),label:(0,ip.__)("Remove")};return(0,Rt.jsxs)(Rt.Fragment,{children:[(0,Rt.jsx)(xo.Button,{__next40pxDefaultSize:!0,...s,children:(0,Rt.jsxs)(xo.__experimentalHStack,{justify:"flex-start",children:[(0,Rt.jsx)(we,{className:"block-editor-global-styles__toggle-icon",icon:iN,size:24}),(0,Rt.jsx)(xo.FlexItem,{children:(0,ip.__)("Drop shadow")})]})}),!!e&&(0,Rt.jsx)(xo.Button,{__next40pxDefaultSize:!0,size:"small",icon:Dr,...a})]})}}function jF(e){return(0,FP.useMemo)(()=>{if(!e?.shadow)return VP;let t=e?.shadow?.defaultPresets,{default:o,theme:r,custom:n}=e?.shadow?.presets??{},i={name:(0,ip.__)("Unset"),slug:"unset",shadow:"none"},s=[...t&&o||VP,...r||VP,...n||VP];return s.length&&s.unshift(i),s},[e])}var ta=l(w(),1);function zP(e){return Object.values(p_(e)).some(Boolean)}function p_(e){return{hasBorderColor:zse(e),hasBorderRadius:jse(e),hasBorderStyle:Use(e),hasBorderWidth:Hse(e),hasShadow:Gse(e)}}function zse(e){return e?.border?.color}function jse(e){return e?.border?.radius}function Use(e){return e?.border?.style}function Hse(e){return e?.border?.width}function Gse(e){let t=jF(e);return!!e?.shadow&&t.length>0}function fIe({resetAllFilter:e,onChange:t,value:o,panelId:r,children:n,label:i}){let s=Ro();return(0,ta.jsx)(en.__experimentalToolsPanel,{label:i,resetAll:()=>{let c=e(o);t(c)},panelId:r,dropdownMenuProps:s,children:n})}var mIe={radius:!0,color:!0,width:!0,shadow:!0};function jP({as:e=fIe,value:t,onChange:o,inheritedValue:r=t,settings:n,panelId:i,name:s,defaultControls:a=mIe}){let c=Xa(n),u=(0,Wb.useCallback)(j=>wn({settings:n},"",j),[n]),d=j=>{let W=c.flatMap(({colors:ee})=>ee).find(({color:ee})=>ee===j);return W?"var:preset|color|"+W.slug:j},f=(0,Wb.useMemo)(()=>{if((0,en.__experimentalHasSplitBorders)(r?.border)){let j={...r?.border};return["top","right","bottom","left"].forEach(z=>{j[z]={...j[z],color:u(j[z]?.color)}}),j}return{...r?.border,color:r?.border?.color?u(r?.border?.color):void 0}},[r?.border,u]),m=j=>o({...t,border:j}),h=zse(n),p=Use(n),g=Hse(n),b=jse(n),v=(0,Wb.useMemo)(()=>typeof r?.border?.radius!="object"?u(r?.border?.radius):{topLeft:u(r?.border?.radius?.topLeft),topRight:u(r?.border?.radius?.topRight),bottomLeft:u(r?.border?.radius?.bottomLeft),bottomRight:u(r?.border?.radius?.bottomRight)},[r?.border?.radius,u]),k=j=>m({...f,radius:j}),y=()=>{let j=t?.border?.radius;return typeof j=="object"?Object.entries(j).some(Boolean):!!j},S=Gse(n),x=u(r?.shadow),C=n?.shadow?.presets??{},B=C.custom??C.theme??C.default??[],I=j=>{let z=B?.find(({shadow:W})=>W===j)?.slug;o(pe(t,["shadow"],z?`var:preset|shadow|${z}`:j||void 0))},P=()=>!!t?.shadow,E=()=>I(void 0),L=()=>{if(y())return m({radius:t?.border?.radius});m(void 0)},T=j=>{let z={...j};(0,en.__experimentalHasSplitBorders)(z)?["top","right","bottom","left"].forEach(W=>{z[W]&&(z[W]={...z[W],color:d(z[W]?.color)})}):z&&(z.color=d(z.color)),m({radius:f?.radius,...z})},O=(0,Wb.useCallback)(j=>({...j,border:void 0,shadow:void 0}),[]),D=a?.color||a?.width,U=h||p||g||b,G=$b({blockName:s,hasShadowControl:S,hasBorderControl:U});return(0,ta.jsxs)(e,{resetAllFilter:O,value:t,onChange:o,panelId:i,label:G,children:[(g||h)&&(0,ta.jsx)(en.__experimentalToolsPanelItem,{hasValue:()=>(0,en.__experimentalIsDefinedBorder)(t?.border),label:(0,Gb.__)("Border"),onDeselect:()=>L(),isShownByDefault:D,panelId:i,children:(0,ta.jsx)(en.BorderBoxControl,{colors:c,enableAlpha:!0,enableStyle:p,onChange:T,popoverOffset:40,popoverPlacement:"left-start",value:f,__experimentalIsRenderedInSidebar:!0,size:"__unstable-large",hideLabelFromVision:!S,label:(0,Gb.__)("Border")})}),b&&(0,ta.jsx)(en.__experimentalToolsPanelItem,{hasValue:y,label:(0,Gb.__)("Radius"),onDeselect:()=>k(void 0),isShownByDefault:a.radius,panelId:i,children:(0,ta.jsx)(ZT,{presets:n?.border?.radiusSizes,values:v,onChange:j=>{k(j||void 0)}})}),S&&(0,ta.jsxs)(en.__experimentalToolsPanelItem,{label:(0,Gb.__)("Shadow"),hasValue:P,onDeselect:E,isShownByDefault:a.shadow,panelId:i,children:[U?(0,ta.jsx)(en.BaseControl.VisualLabel,{as:"legend",children:(0,Gb.__)("Shadow")}):null,(0,ta.jsx)(Fse,{shadow:x,onShadowChange:I,settings:n})]})]})}var Qt=l(A(),1),HP=l(R(),1),Xt=l(N(),1);var at=l(w(),1);function GP(e){let t=$se(e),o=Zse(e),r=Kse(e),n=Dd(e),i=qse(e),s=Yse(e);return t||o||r||n||i||s}function $se(e){let t=Xa(e);return e?.color?.text&&(t?.length>0||e?.color?.custom)}function Kse(e){let t=Xa(e);return e?.color?.link&&(t?.length>0||e?.color?.custom)}function Yse(e){let t=Xa(e);return e?.color?.caption&&(t?.length>0||e?.color?.custom)}function Dd(e){let t=Xa(e),o=f_(e);return e?.color?.heading&&(t?.length>0||e?.color?.custom||o?.length>0||e?.color?.customGradient)}function qse(e){let t=Xa(e),o=f_(e);return e?.color?.button&&(t?.length>0||e?.color?.custom||o?.length>0||e?.color?.customGradient)}function Zse(e){let t=Xa(e),o=f_(e);return e?.color?.background&&(t?.length>0||e?.color?.custom||o?.length>0||e?.color?.customGradient)}function UF({resetAllFilter:e,onChange:t,value:o,panelId:r,children:n,label:i}){let s=Ro(),a=()=>{let c=e(o);t(c)};return(0,at.jsx)(Qt.__experimentalToolsPanel,{label:i||(0,Xt.__)("Elements"),resetAll:a,panelId:r,hasInnerWrapper:!0,headingLevel:3,className:"color-block-support-panel",__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:s,children:(0,at.jsx)("div",{className:"color-block-support-panel__inner-wrapper",children:n})})}var pIe={text:!0,background:!0,link:!0,heading:!0,button:!0,caption:!0},hIe={placement:"left-start",offset:36,shift:!0},{Tabs:UP}=M(Qt.privateApis),gIe=({indicators:e,label:t})=>(0,at.jsxs)(Qt.__experimentalHStack,{justify:"flex-start",children:[(0,at.jsx)(Qt.__experimentalZStack,{isLayered:!1,offset:-8,children:e.map((o,r)=>(0,at.jsx)(Qt.Flex,{expanded:!1,children:(0,at.jsx)(Qt.ColorIndicator,{colorValue:o})},r))}),(0,at.jsx)(Qt.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",children:t})]});function Wse({isGradient:e,inheritedValue:t,userValue:o,setValue:r,colorGradientControlSettings:n}){return(0,at.jsx)(_d,{...n,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:e?void 0:t,gradientValue:e?t:void 0,onColorChange:e?void 0:r,onGradientChange:e?r:void 0,clearable:t===o,headingLevel:3})}function bIe({label:e,hasValue:t,resetValue:o,isShownByDefault:r,indicators:n,tabs:i,colorGradientControlSettings:s,panelId:a}){let c=i.find(m=>m.userValue!==void 0),{key:u,...d}=i[0]??{},f=(0,HP.useRef)(void 0);return(0,at.jsx)(Qt.__experimentalToolsPanelItem,{className:"block-editor-tools-panel-color-gradient-settings__item",hasValue:t,label:e,onDeselect:o,isShownByDefault:r,panelId:a,children:(0,at.jsx)(Qt.Dropdown,{popoverProps:hIe,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:({onToggle:m,isOpen:h})=>{let p={onClick:m,className:V("block-editor-panel-color-gradient-settings__dropdown",{"is-open":h}),"aria-expanded":h,ref:f};return(0,at.jsxs)(at.Fragment,{children:[(0,at.jsx)(Qt.Button,{...p,__next40pxDefaultSize:!0,children:(0,at.jsx)(gIe,{indicators:n,label:e})}),t()&&(0,at.jsx)(Qt.Button,{__next40pxDefaultSize:!0,label:(0,Xt.__)("Reset"),className:"block-editor-panel-color-gradient-settings__reset",size:"small",icon:Dr,onClick:()=>{o(),h&&m(),f.current?.focus()}})]})},renderContent:()=>(0,at.jsx)(Qt.__experimentalDropdownContentWrapper,{paddingSize:"none",children:(0,at.jsxs)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:[i.length===1&&(0,at.jsx)(Wse,{...d,colorGradientControlSettings:s},u),i.length>1&&(0,at.jsxs)(UP,{defaultTabId:c?.key,children:[(0,at.jsx)(UP.TabList,{children:i.map(m=>(0,at.jsx)(UP.Tab,{tabId:m.key,children:m.label},m.key))}),i.map(m=>{let{key:h,...p}=m;return(0,at.jsx)(UP.TabPanel,{tabId:h,focusable:!1,children:(0,at.jsx)(Wse,{...p,colorGradientControlSettings:s},h)},h)})]})]})})})})}function WP({as:e=UF,value:t,onChange:o,inheritedValue:r=t,settings:n,panelId:i,defaultControls:s=pIe,label:a,children:c}){let u=Xa(n),d=f_(n),f=n?.color?.custom,m=n?.color?.customGradient,h=u.length>0||f,p=d.length>0||m,g=H=>wn({settings:n},"",H),b=H=>{let ne=u.flatMap(({colors:le})=>le).find(({color:le})=>le===H);return ne?"var:preset|color|"+ne.slug:H},v=H=>{let ne=d.flatMap(({gradients:le})=>le).find(({gradient:le})=>le===H);return ne?"var:preset|gradient|"+ne.slug:H},k=Zse(n),y=g(r?.color?.background),S=g(t?.color?.background),x=g(r?.color?.gradient),C=g(t?.color?.gradient),B=()=>!!S||!!C,I=H=>{let X=pe(t,["color","background"],b(H));X.color.gradient=void 0,o(X)},P=H=>{let X=pe(t,["color","gradient"],v(H));X.color.background=void 0,o(X)},E=()=>{let H=pe(t,["color","background"],void 0);H.color.gradient=void 0,o(H)},L=Kse(n),T=g(r?.elements?.link?.color?.text),O=g(t?.elements?.link?.color?.text),D=H=>{o(pe(t,["elements","link","color","text"],b(H)))},U=g(r?.elements?.link?.[":hover"]?.color?.text),G=g(t?.elements?.link?.[":hover"]?.color?.text),j=H=>{o(pe(t,["elements","link",":hover","color","text"],b(H)))},z=()=>!!O||!!G,W=()=>{let H=pe(t,["elements","link",":hover","color","text"],void 0);H=pe(H,["elements","link","color","text"],void 0),o(H)},ee=$se(n),se=g(r?.color?.text),ce=g(t?.color?.text),ie=()=>!!ce,re=H=>{let X=pe(t,["color","text"],b(H));se===T&&(X=pe(X,["elements","link","color","text"],b(H))),o(X)},Q=()=>re(void 0),Y=[{name:"caption",label:(0,Xt.__)("Captions"),showPanel:Yse(n)},{name:"button",label:(0,Xt.__)("Button"),showPanel:qse(n)},{name:"heading",label:(0,Xt.__)("Heading"),showPanel:Dd(n)},{name:"h1",label:(0,Xt.__)("H1"),showPanel:Dd(n)},{name:"h2",label:(0,Xt.__)("H2"),showPanel:Dd(n)},{name:"h3",label:(0,Xt.__)("H3"),showPanel:Dd(n)},{name:"h4",label:(0,Xt.__)("H4"),showPanel:Dd(n)},{name:"h5",label:(0,Xt.__)("H5"),showPanel:Dd(n)},{name:"h6",label:(0,Xt.__)("H6"),showPanel:Dd(n)}],J=(0,HP.useCallback)(H=>({...H,color:void 0,elements:{...H?.elements,link:{...H?.elements?.link,color:void 0,":hover":{color:void 0}},...Y.reduce((X,ne)=>({...X,[ne.name]:{...H?.elements?.[ne.name],color:void 0}}),{})}}),[Y]),K=[ee&&{key:"text",label:(0,Xt.__)("Text"),hasValue:ie,resetValue:Q,isShownByDefault:s.text,indicators:[se],tabs:[{key:"text",label:(0,Xt.__)("Text"),inheritedValue:se,setValue:re,userValue:ce}]},k&&{key:"background",label:(0,Xt.__)("Background"),hasValue:B,resetValue:E,isShownByDefault:s.background,indicators:[x??y],tabs:[h&&{key:"background",label:(0,Xt.__)("Color"),inheritedValue:y,setValue:I,userValue:S},p&&{key:"gradient",label:(0,Xt.__)("Gradient"),inheritedValue:x,setValue:P,userValue:C,isGradient:!0}].filter(Boolean)},L&&{key:"link",label:(0,Xt.__)("Link"),hasValue:z,resetValue:W,isShownByDefault:s.link,indicators:[T,U],tabs:[{key:"link",label:(0,Xt.__)("Default"),inheritedValue:T,setValue:D,userValue:O},{key:"hover",label:(0,Xt.__)("Hover"),inheritedValue:U,setValue:j,userValue:G}]}].filter(Boolean);return Y.forEach(({name:H,label:X,showPanel:ne})=>{if(!ne)return;let le=g(r?.elements?.[H]?.color?.background),ve=g(r?.elements?.[H]?.color?.gradient),he=g(r?.elements?.[H]?.color?.text),xe=g(t?.elements?.[H]?.color?.background),ze=g(t?.elements?.[H]?.color?.gradient),ot=g(t?.elements?.[H]?.color?.text),Wt=()=>!!(ot||xe||ze),fo=()=>{let Pe=pe(t,["elements",H,"color","background"],void 0);Pe.elements[H].color.gradient=void 0,Pe.elements[H].color.text=void 0,o(Pe)},Do=Pe=>{o(pe(t,["elements",H,"color","text"],b(Pe)))},rt=Pe=>{let wt=pe(t,["elements",H,"color","background"],b(Pe));wt.elements[H].color.gradient=void 0,o(wt)},ar=Pe=>{let wt=pe(t,["elements",H,"color","gradient"],v(Pe));wt.elements[H].color.background=void 0,o(wt)},xt=!0,At=H!=="caption";K.push({key:H,label:X,hasValue:Wt,resetValue:fo,isShownByDefault:s[H],indicators:xt&&At?[he,ve??le]:[xt?he:ve??le],tabs:[h&&xt&&{key:"text",label:(0,Xt.__)("Text"),inheritedValue:he,setValue:Do,userValue:ot},h&&At&&{key:"background",label:(0,Xt.__)("Background"),inheritedValue:le,setValue:rt,userValue:xe},p&&At&&{key:"gradient",label:(0,Xt.__)("Gradient"),inheritedValue:ve,setValue:ar,userValue:ze,isGradient:!0}].filter(Boolean)})}),(0,at.jsxs)(e,{resetAllFilter:J,value:t,onChange:o,panelId:i,label:a,children:[K.map(H=>{let{key:X,...ne}=H;return(0,at.jsx)(bIe,{...ne,colorGradientControlSettings:{colors:u,disableCustomColors:!f,gradients:d,disableCustomGradients:!m},panelId:i},X)}),c]})}var mt=l(A(),1),Sc=l(N(),1),Kb=l(R(),1);var so=l(w(),1),$P=[];function Xse(e,{presetSetting:t,defaultSetting:o}){let r=!e?.color?.[o],n=e?.color?.[t]?.custom||$P,i=e?.color?.[t]?.theme||$P,s=e?.color?.[t]?.default||$P;return(0,Kb.useMemo)(()=>[...n,...i,...r?$P:s],[r,n,i,s])}function Qse(e){return Jse(e)}function Jse(e){return e.color.customDuotone||e.color.defaultDuotone||e.color.duotone.length>0}function kIe({resetAllFilter:e,onChange:t,value:o,panelId:r,children:n}){let i=Ro(),s=()=>{let a=e(o);t(a)};return(0,so.jsx)(mt.__experimentalToolsPanel,{label:(0,Sc._x)("Filters","Name for applying graphical effects"),resetAll:s,panelId:r,dropdownMenuProps:i,children:n})}var vIe={duotone:!0},yIe={placement:"left-start",offset:36,shift:!0,className:"block-editor-duotone-control__popover",headerTitle:(0,Sc.__)("Duotone")},SIe=({indicator:e,label:t})=>(0,so.jsxs)(mt.__experimentalHStack,{justify:"flex-start",children:[(0,so.jsx)(mt.__experimentalZStack,{isLayered:!1,offset:-8,children:(0,so.jsx)(mt.Flex,{expanded:!1,children:e==="unset"||!e?(0,so.jsx)(mt.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}):(0,so.jsx)(mt.DuotoneSwatch,{values:e})})}),(0,so.jsx)(mt.FlexItem,{title:t,children:t})]}),_Ie=(e,t)=>function({onToggle:r,isOpen:n}){let i=(0,Kb.useRef)(void 0),s={onClick:r,className:V("block-editor-global-styles-filters-panel__dropdown-toggle",{"is-open":n}),"aria-expanded":n,ref:i},a={onClick:()=>{n&&r(),t(),i.current?.focus()},className:"block-editor-panel-duotone-settings__reset",label:(0,Sc.__)("Reset")};return(0,so.jsxs)(so.Fragment,{children:[(0,so.jsx)(mt.Button,{__next40pxDefaultSize:!0,...s,children:(0,so.jsx)(SIe,{indicator:e,label:(0,Sc.__)("Duotone")})}),e&&(0,so.jsx)(mt.Button,{size:"small",icon:Dr,...a})]})};function KP({as:e=kIe,value:t,onChange:o,inheritedValue:r=t,settings:n,panelId:i,defaultControls:s=vIe}){let a=b=>wn({settings:n},"",b),c=Jse(n),u=Xse(n,{presetSetting:"duotone",defaultSetting:"defaultDuotone"}),d=Xse(n,{presetSetting:"palette",defaultSetting:"defaultPalette"}),f=a(r?.filter?.duotone),m=b=>{let v=u.find(({colors:y})=>y===b),k=v?`var:preset|duotone|${v.slug}`:b;o(pe(t,["filter","duotone"],k))},h=()=>!!t?.filter?.duotone,p=()=>m(void 0),g=(0,Kb.useCallback)(b=>({...b,filter:{...b.filter,duotone:void 0}}),[]);return(0,so.jsx)(e,{resetAllFilter:g,value:t,onChange:o,panelId:i,children:c&&(0,so.jsx)(mt.__experimentalToolsPanelItem,{label:(0,Sc.__)("Duotone"),hasValue:h,onDeselect:p,isShownByDefault:s.duotone,panelId:i,children:(0,so.jsx)(mt.Dropdown,{popoverProps:yIe,className:"block-editor-global-styles-filters-panel__dropdown",renderToggle:_Ie(f,p),renderContent:()=>(0,so.jsx)(mt.__experimentalDropdownContentWrapper,{paddingSize:"small",children:(0,so.jsxs)(mt.MenuGroup,{label:(0,Sc.__)("Duotone"),children:[(0,so.jsx)("p",{children:(0,Sc.__)("Create a two-tone color effect without losing your original image.")}),(0,so.jsx)(mt.DuotonePicker,{colorPalette:d,duotonePalette:u,disableCustomColors:!0,disableCustomDuotone:!0,value:f,onChange:m})]})})})})})}var Yb=l(A(),1),h_=l(N(),1);var sp=l(w(),1);function eae(e,t,o){return e==="core/image"&&o?.lightbox?.allowEditing||!!t?.lightbox}function tae({onChange:e,value:t,inheritedValue:o,panelId:r}){let n=Ro(),i=()=>{e(void 0)},s=c=>{e({enabled:c})},a=!1;return o?.lightbox?.enabled&&(a=o.lightbox.enabled),(0,sp.jsx)(sp.Fragment,{children:(0,sp.jsx)(Yb.__experimentalToolsPanel,{label:(0,h_._x)("Settings","Image settings"),resetAll:i,panelId:r,dropdownMenuProps:n,children:(0,sp.jsx)(Yb.__experimentalToolsPanelItem,{hasValue:()=>!!t?.lightbox,label:(0,h_.__)("Enlarge on click"),onDeselect:i,isShownByDefault:!0,panelId:r,children:(0,sp.jsx)(Yb.ToggleControl,{label:(0,h_.__)("Enlarge on click"),checked:a,onChange:s})})})})}var qb=l(A(),1),oae=l(R(),1),YP=l(N(),1);var g_=l(w(),1);function qP(e){return!(typeof e=="string"&&/<\/?\w/.test(e))}function ZP({value:e,onChange:t,inheritedValue:o=e,help:r}){let[n,i]=(0,oae.useState)(null),s=o?.css;function a(u){if(t({...e,css:u}),!qP(u)){i((0,YP.__)("The custom CSS is invalid. Do not use <> markup."));return}n&&i(null)}function c(u){let d=u?.target?.value;if(!d||!qP(d))return;let[f]=Uh([{css:d}],".for-validation-only");i(f===null?(0,YP.__)("There is an error with your CSS structure."):null)}return(0,g_.jsxs)(qb.__experimentalVStack,{spacing:3,children:[n&&(0,g_.jsx)(qb.Notice,{status:"error",onRemove:()=>i(null),children:n}),(0,g_.jsx)(qb.TextareaControl,{label:(0,YP.__)("Additional CSS"),value:s,onChange:u=>a(u),onBlur:c,className:"block-editor-global-styles-advanced-panel__custom-css-input",spellCheck:!1,help:r})]})}var e2=l(A(),1),t2=l(R(),1),GF=l(N(),1);var Be=l(A(),1);var Ot=l(N(),1),nae=l(Un(),1),HF=l(dn(),1),_c=l(R(),1),b_=l(F(),1),iae=l(Fe(),1),sae=l(F5(),1);var Te=l(w(),1),XP="image",xIe={placement:"left-start",offset:36,shift:!0,className:"block-editor-global-styles-background-panel__popover"},JP=()=>{},QP=e=>{window.requestAnimationFrame(()=>{let[t]=iae.focus.tabbable.find(e?.current);t&&t.focus()})};function wIe(e){return e==="cover"||e===void 0?(0,Ot.__)("Image covers the space evenly."):e==="contain"?(0,Ot.__)("Image is contained without distortion."):(0,Ot.__)("Image has a fixed width.")}var CIe=e=>{if(!e||isNaN(e.x)&&isNaN(e.y))return;let t=isNaN(e.x)?.5:e.x,o=isNaN(e.y)?.5:e.y;return`${t*100}% ${o*100}%`},BIe=e=>{if(!e)return{x:void 0,y:void 0};let[t,o]=e.split(" ").map(r=>parseFloat(r)/100);return t=isNaN(t)?void 0:t,o=isNaN(o)?t:o,{x:t,y:o}};function aae({as:e="span",imgUrl:t,toggleProps:o={},filename:r,label:n,onToggleCallback:i=JP}){let{isOpen:s,...a}=o;(0,_c.useEffect)(()=>{typeof s<"u"&&i(s)},[s,i]);let c=()=>(0,Te.jsxs)(Be.__experimentalHStack,{className:"block-editor-global-styles-background-panel__inspector-preview-inner",children:[(0,Te.jsx)("span",{className:"block-editor-global-styles-background-panel__inspector-image-indicator",style:{backgroundImage:t?`url(${t})`:void 0}}),(0,Te.jsxs)(Be.FlexBlock,{children:[(0,Te.jsx)(Be.__experimentalTruncate,{numberOfLines:1,className:"block-editor-global-styles-background-panel__inspector-media-replace-title",children:n}),(0,Te.jsx)(Be.VisuallyHidden,{as:"span",children:t?(0,Ot.sprintf)((0,Ot.__)("Background image: %s"),r||n):(0,Ot.__)("No background image selected")})]})]});return e==="button"?(0,Te.jsx)(Be.Button,{__next40pxDefaultSize:!0,...a,children:c()}):c()}function EIe({label:e,filename:t,url:o,children:r,onToggle:n=JP,hasImageValue:i,onReset:s,containerRef:a}){if(!i)return;let c=e||(0,HF.getFilename)(o)||(0,Ot.__)("Image");return(0,Te.jsx)(Be.Dropdown,{popoverProps:xIe,renderToggle:({onToggle:u,isOpen:d})=>{let f={onClick:u,className:"block-editor-global-styles-background-panel__dropdown-toggle","aria-expanded":d,"aria-label":(0,Ot.__)("Background size, position and repeat options."),isOpen:d};return(0,Te.jsxs)(Te.Fragment,{children:[(0,Te.jsx)(aae,{imgUrl:o,filename:t,label:c,toggleProps:f,as:"button",onToggleCallback:n}),s&&(0,Te.jsx)(Be.Button,{__next40pxDefaultSize:!0,label:(0,Ot.__)("Reset"),className:"block-editor-global-styles-background-panel__reset",size:"small",icon:Dr,onClick:()=>{s(),d&&u(),QP(a)}})]})},renderContent:()=>(0,Te.jsx)(Be.__experimentalDropdownContentWrapper,{className:"block-editor-global-styles-background-panel__dropdown-content-wrapper",paddingSize:"medium",children:r})})}function TIe(){return(0,Te.jsx)(Be.Placeholder,{className:"block-editor-global-styles-background-panel__loading",children:(0,Te.jsx)(Be.Spinner,{})})}function rae({onChange:e,style:t,inheritedValue:o,onRemoveImage:r=JP,onResetImage:n=JP,displayInPanel:i,defaultValues:s,containerRef:a}){let[c,u]=(0,_c.useState)(!1),{getSettings:d}=(0,b_.useSelect)(_),{id:f,title:m,url:h}=t?.background?.backgroundImage||{...o?.background?.backgroundImage},{createErrorNotice:p}=(0,b_.useDispatch)(nae.store),g=B=>{p(B,{type:"snackbar"}),u(!1)},b=()=>e(pe(t,["background","backgroundImage"],void 0)),v=B=>{if(!B||!B.url){b(),u(!1);return}if((0,sae.isBlobURL)(B.url)){u(!0);return}if(B.media_type&&B.media_type!==XP||!B.media_type&&B.type&&B.type!==XP){g((0,Ot.__)("Only images can be used as a background image."));return}let I=t?.background?.backgroundSize||s?.backgroundSize,P=t?.background?.backgroundPosition;e(pe(t,["background"],{...t?.background,backgroundImage:{url:B.url,id:B.id,source:"file",title:B.title||void 0},backgroundPosition:!P&&(I==="auto"||!I)?"50% 0":P,backgroundSize:I})),u(!1),QP(a)},k=B=>{d().mediaUpload({allowedTypes:[XP],filesList:B,onFileChange([I]){v(I)},onError:g,multiple:!1})},y=ap(t),S=()=>e(pe(t,["background"],{backgroundImage:"none"})),x=!y&&ap(o),C=m||(0,HF.getFilename)(h)||(0,Ot.__)("Image");return(0,Te.jsxs)("div",{className:"block-editor-global-styles-background-panel__image-tools-panel-item",children:[c&&(0,Te.jsx)(TIe,{}),(0,Te.jsx)(_b,{mediaId:f,mediaURL:h,allowedTypes:[XP],accept:"image/*",onSelect:v,popoverProps:{className:V({"block-editor-global-styles-background-panel__media-replace-popover":i})},name:(0,Te.jsx)(aae,{imgUrl:h,filename:m,label:C}),renderToggle:B=>(0,Te.jsx)(Be.Button,{...B,__next40pxDefaultSize:!0}),onError:g,onReset:()=>{QP(a),n()},children:x&&(0,Te.jsx)(Be.MenuItem,{onClick:()=>{QP(a),S(),r()},children:(0,Ot.__)("Remove")})}),(0,Te.jsx)(Be.DropZone,{onFilesDrop:k,label:(0,Ot.__)("Drop to upload")})]})}function IIe({onChange:e,style:t,inheritedValue:o,defaultValues:r}){let n=t?.background?.backgroundSize||o?.background?.backgroundSize,i=t?.background?.backgroundRepeat||o?.background?.backgroundRepeat,s=t?.background?.backgroundImage?.url||o?.background?.backgroundImage?.url,a=t?.background?.backgroundImage?.id,c=t?.background?.backgroundPosition||o?.background?.backgroundPosition,u=t?.background?.backgroundAttachment||o?.background?.backgroundAttachment,d=!n&&a?r?.backgroundSize:n||"auto";d=["cover","contain","auto"].includes(d)?d:"auto";let f=!(i==="no-repeat"||d==="cover"&&i===void 0),m=v=>{let k=i,y=c;v==="contain"&&(k="no-repeat",y=void 0),v==="cover"&&(k=void 0,y=void 0),(d==="cover"||d==="contain")&&v==="auto"&&(k=void 0,t?.background?.backgroundImage?.id&&(y="50% 0")),!v&&d==="auto"&&(v="auto"),e(pe(t,["background"],{...t?.background,backgroundPosition:y,backgroundRepeat:k,backgroundSize:v}))},h=v=>{e(pe(t,["background","backgroundPosition"],CIe(v)))},p=()=>e(pe(t,["background","backgroundRepeat"],f===!0?"no-repeat":"repeat")),g=()=>e(pe(t,["background","backgroundAttachment"],u==="fixed"?"scroll":"fixed")),b=!c&&a&&n==="contain"?r?.backgroundPosition:c;return(0,Te.jsxs)(Be.__experimentalVStack,{spacing:3,className:"single-column",children:[(0,Te.jsx)(Be.FocalPointPicker,{label:(0,Ot.__)("Focal point"),url:s,value:BIe(b),onChange:h}),(0,Te.jsx)(Be.ToggleControl,{label:(0,Ot.__)("Fixed background"),checked:u==="fixed",onChange:g}),(0,Te.jsxs)(Be.__experimentalToggleGroupControl,{size:"__unstable-large",label:(0,Ot.__)("Size"),value:d,onChange:m,isBlock:!0,help:wIe(n||r?.backgroundSize),children:[(0,Te.jsx)(Be.__experimentalToggleGroupControlOption,{value:"cover",label:(0,Ot._x)("Cover","Size option for background image control")},"cover"),(0,Te.jsx)(Be.__experimentalToggleGroupControlOption,{value:"contain",label:(0,Ot._x)("Contain","Size option for background image control")},"contain"),(0,Te.jsx)(Be.__experimentalToggleGroupControlOption,{value:"auto",label:(0,Ot._x)("Tile","Size option for background image control")},"tile")]}),(0,Te.jsxs)(Be.__experimentalHStack,{justify:"flex-start",spacing:2,as:"span",children:[(0,Te.jsx)(Be.__experimentalUnitControl,{"aria-label":(0,Ot.__)("Background image width"),onChange:m,value:n,size:"__unstable-large",__unstableInputWidth:"100px",min:0,placeholder:(0,Ot.__)("Auto"),disabled:d!=="auto"||d===void 0}),(0,Te.jsx)(Be.ToggleControl,{label:(0,Ot.__)("Repeat"),checked:f,onChange:p,disabled:d==="cover"})]})]})}function lae({value:e,onChange:t,inheritedValue:o=e,settings:r,defaultValues:n={}}){let{globalStyles:i,_links:s}=(0,b_.useSelect)(v=>{let{getSettings:k}=v(_),y=k();return{globalStyles:y[xi],_links:y[y0]}},[]),a=(0,_c.useMemo)(()=>{let v={background:{}};return o?.background?(Object.entries(o?.background).forEach(([k,y])=>{v.background[k]=Pg(y,{styles:i,_links:s})}),v):o},[i,s,o]),c=()=>t(pe(e,["background"],{})),{title:u,url:d}=e?.background?.backgroundImage||{...a?.background?.backgroundImage},f=ap(e)||ap(a),m=e?.background?.backgroundImage||o?.background?.backgroundImage,h=f&&m!=="none"&&(r?.background?.backgroundSize||r?.background?.backgroundPosition||r?.background?.backgroundRepeat),[p,g]=(0,_c.useState)(!1),b=(0,_c.useRef)();return(0,Te.jsx)("div",{ref:b,className:V("block-editor-global-styles-background-panel__inspector-media-replace-container",{"is-open":p}),children:h?(0,Te.jsx)(EIe,{label:u,filename:u,url:d,onToggle:g,hasImageValue:f,onReset:c,containerRef:b,children:(0,Te.jsxs)(Be.__experimentalVStack,{spacing:3,className:"single-column",children:[(0,Te.jsx)(rae,{onChange:t,style:e,inheritedValue:a,displayInPanel:!0,onResetImage:()=>{g(!1),c()},onRemoveImage:()=>g(!1),defaultValues:n,containerRef:b}),(0,Te.jsx)(IIe,{onChange:t,style:e,defaultValues:n,inheritedValue:a})]})}):(0,Te.jsx)(rae,{onChange:t,style:e,inheritedValue:a,defaultValues:n,onResetImage:()=>{g(!1),c()},onRemoveImage:()=>g(!1),containerRef:b})})}var k_=l(w(),1),PIe={backgroundImage:!0};function v_(e){return t2.Platform.OS==="web"&&e?.background?.backgroundImage}function ap(e){return!!e?.background?.backgroundImage?.id||typeof e?.background?.backgroundImage=="string"||!!e?.background?.backgroundImage?.url}function RIe({resetAllFilter:e,onChange:t,value:o,panelId:r,children:n,headerLabel:i}){let s=Ro();return(0,k_.jsx)(e2.__experimentalToolsPanel,{label:i,resetAll:()=>{let c=e(o);t(c)},panelId:r,dropdownMenuProps:s,children:n})}function o2({as:e=RIe,value:t,onChange:o,inheritedValue:r,settings:n,panelId:i,defaultControls:s=PIe,defaultValues:a={},headerLabel:c=(0,GF.__)("Background")}){let u=v_(n),d=()=>o(pe(t,["background"],{})),f=(0,t2.useCallback)(m=>({...m,background:{}}),[]);return(0,k_.jsx)(e,{resetAllFilter:f,value:t,onChange:o,panelId:i,headerLabel:c,children:u&&(0,k_.jsx)(e2.__experimentalToolsPanelItem,{hasValue:()=>!!t?.background,label:(0,GF.__)("Image"),onDeselect:d,isShownByDefault:s.backgroundImage,panelId:i,children:(0,k_.jsx)(lae,{value:t,onChange:o,settings:n,inheritedValue:r,defaultControls:s,defaultValues:a})})})}var n2=l(N(),1),KF=l(w(),1),cp="__experimentalBorder",S_="shadow",cae=(e,t,o)=>{let r;return e.some(n=>n.colors.some(i=>i[t]===o?(r=i,!0):!1)),r},lp=({colors:e,namedColor:t,customColor:o})=>{if(t){let n=cae(e,"slug",t);if(n)return n}if(!o)return{color:void 0};let r=cae(e,"color",o);return r||{color:o}};function r2(e){let t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function fae(e){if((0,$F.__experimentalHasSplitBorders)(e?.border))return{style:e,borderColor:void 0};let t=e?.border?.color,o=t?.startsWith("var:preset|color|")?t.substring(17):void 0,r={...e};return r.border={...r.border,color:o?void 0:t},{style:Me(r),borderColor:o}}function mae(e){return(0,$F.__experimentalHasSplitBorders)(e.style?.border)?e.style:{...e.style,border:{...e.style?.border,color:e.borderColor?"var:preset|color|"+e.borderColor:e.style?.border?.color}}}function OIe({label:e,children:t,resetAllFilter:o}){let r=(0,Zb.useCallback)(n=>{let i=mae(n),s=o(i);return{...n,...fae(s)}},[o]);return(0,KF.jsx)(fe,{group:"border",resetAllFilter:r,label:e,children:t})}function pae({clientId:e,name:t,setAttributes:o,settings:r}){let n=zP(r),{style:i,borderColor:s}=(0,dae.useSelect)(d=>{if(!n)return{};let{style:f,borderColor:m}=d(_).getBlockAttributes(e)||{};return{style:f,borderColor:m}},[e,n]),a=(0,Zb.useMemo)(()=>mae({style:i,borderColor:s}),[i,s]),c=d=>{o(fae(d))};if(!n)return null;let u={...(0,y_.getBlockSupport)(t,[cp,"__experimentalDefaultControls"]),...(0,y_.getBlockSupport)(t,[S_,"__experimentalDefaultControls"])};return(0,KF.jsx)(jP,{as:OIe,panelId:e,settings:r,value:a,onChange:c,defaultControls:u})}function i2(e,t="any"){if(Zb.Platform.OS!=="web")return!1;let o=(0,y_.getBlockSupport)(e,cp);return o===!0?!0:t==="any"?!!(o?.color||o?.radius||o?.width||o?.style):!!o?.[t]}function $b({blockName:e,hasBorderControl:t,hasShadowControl:o}={}){let r=is(e),n=p_(r);return!t&&!o&&e&&(t=n?.hasBorderColor||n?.hasBorderStyle||n?.hasBorderWidth||n?.hasBorderRadius,o=n?.hasShadow),t&&o?(0,n2.__)("Border & Shadow"):o?(0,n2.__)("Shadow"):(0,n2.__)("Border")}function AIe(e){return!i2(e,"color")||e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}}function hae(e,t,o){if(!i2(t,"color")||Ue(t,cp,"color"))return e;let r=YF(o),n=V(e.className,r);return e.className=n||void 0,e}function YF(e){let{borderColor:t,style:o}=e,r=_i("border-color",t);return V({"has-border-color":t||o?.border?.color,[r]:!!r})}function LIe({name:e,borderColor:t,style:o}){let{colors:r}=wd();if(!i2(e,"color")||Ue(e,cp,"color"))return{};let{color:n}=lp({colors:r,namedColor:t}),{color:i}=lp({colors:r,namedColor:r2(o?.border?.top?.color)}),{color:s}=lp({colors:r,namedColor:r2(o?.border?.right?.color)}),{color:a}=lp({colors:r,namedColor:r2(o?.border?.bottom?.color)}),{color:c}=lp({colors:r,namedColor:r2(o?.border?.left?.color)});return hae({style:Me({borderTopColor:i||n,borderRightColor:s||n,borderBottomColor:a||n,borderLeftColor:c||n})||{}},e,{borderColor:t,style:o})}var qF={useBlockProps:LIe,addSaveProps:hae,attributeKeys:["borderColor","style"],hasSupport(e){return i2(e,"color")}};(0,uae.addFilter)("blocks.registerBlockType","core/border/addAttributes",AIe);var JF=l(ut(),1),xc=l($(),1),Vd=l(R(),1),Bae=l(F(),1);var XF=l($(),1),gae=l(F(),1),bae=l(R(),1);var QF=l(w(),1),up="background",ZF={backgroundSize:"cover",backgroundPosition:"50% 50%"};function s2(e,t="any"){let o=(0,XF.getBlockSupport)(e,up);return o===!0?!0:t==="any"?!!o?.backgroundImage||!!o?.backgroundSize||!!o?.backgroundRepeat:!!o?.[t]}function a2(e){if(!e||!e?.backgroundImage?.url)return;let t;return e?.backgroundSize||(t={backgroundSize:ZF.backgroundSize}),e?.backgroundSize==="contain"&&!e?.backgroundPosition&&(t={backgroundPosition:ZF.backgroundPosition}),t}function NIe({name:e,style:t}){if(!s2(e)||!t?.background?.backgroundImage)return;let o=a2(t?.background);if(o)return{style:{...o}}}function kae(e){return ap(e)?"has-background":""}function MIe({children:e}){let t=(0,bae.useCallback)(o=>({...o,style:{...o.style,background:void 0}}),[]);return(0,QF.jsx)(fe,{group:"background",resetAllFilter:t,children:e})}function vae({clientId:e,name:t,setAttributes:o,settings:r}){let{style:n,inheritedValue:i}=(0,gae.useSelect)(u=>{let{getBlockAttributes:d,getSettings:f}=u(_),m=f();return{style:d(e)?.style,inheritedValue:m[xi]?.blocks?.[t]}},[e,t]);if(!v_(r)||!s2(t,"backgroundImage"))return null;let s=u=>{o({style:Me(u)})},a={...r,background:{...r.background,backgroundSize:r?.background?.backgroundSize&&s2(t,"backgroundSize")}},c=(0,XF.getBlockSupport)(t,[up,"defaultControls"]);return(0,QF.jsx)(o2,{inheritedValue:i,as:MIe,panelId:e,defaultValues:ZF,settings:a,onChange:s,defaultControls:c,value:n})}var yae={useBlockProps:NIe,attributeKeys:["style"],hasSupport:s2};var __=l(R(),1),_ae=l(F(),1),xae=l($(),1);var wae=l(w(),1);function l2(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function Sae(e,t){if(!e||!t)return{};let o=oi(t,"color.text",{fallback:!0}),r=oi(t,"color.background",{fallback:!0}),n=e.querySelector(o)||e,i=e.querySelector(r)||e,s=e.querySelector("a"),a=l2(n,"color"),c=s&&s.textContent?l2(s,"color"):void 0,u=i,d=l2(u,"background-color");for(;d==="rgba(0, 0, 0, 0)"&&u.parentNode&&u.parentNode.nodeType===u.parentNode.ELEMENT_NODE;)u=u.parentNode,d=l2(u,"background-color");return{textColor:a,backgroundColor:d,linkColor:c}}function DIe(e,t){return Object.keys(t).some(r=>e[r]!==t[r])?t:e}function Cae({clientId:e,name:t}){let o=Xe(e),[r,n]=(0,__.useReducer)(DIe,{}),i=(0,_ae.useSelect)(s=>t?s(xae.store).getBlockType(t):void 0,[t]);return(0,__.useLayoutEffect)(()=>{!o||!i||window.requestAnimationFrame(()=>window.requestAnimationFrame(()=>n(Sae(o,i))))}),(0,__.useLayoutEffect)(()=>{if(!o||!i)return;let s=new window.MutationObserver(()=>{n(Sae(o,i))});return s.observe(o,{attributes:!0,attributeFilter:["class","style"]}),()=>{s.disconnect()}},[o,i]),(0,wae.jsx)(QT,{backgroundColor:r.backgroundColor,textColor:r.textColor,linkColor:r.linkColor,enableAlphaChecker:!0})}var c2=l(w(),1),ir="color",u2=e=>{let t=(0,xc.getBlockSupport)(e,ir);return t&&(t.link===!0||t.gradient===!0||t.background!==!1||t.text!==!1)},VIe=e=>{if(Vd.Platform.OS!=="web")return!1;let t=(0,xc.getBlockSupport)(e,ir);return t!==null&&typeof t=="object"&&!!t.link},e4=e=>{let t=(0,xc.getBlockSupport)(e,ir);return t!==null&&typeof t=="object"&&!!t.gradients},FIe=e=>{let t=(0,xc.getBlockSupport)(e,ir);return t&&t.background!==!1},zIe=e=>{let t=(0,xc.getBlockSupport)(e,ir);return t&&t.text!==!1};function jIe(e){return u2(e)&&(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),e4(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}})),e}function Eae(e,t,o){if(!u2(t)||Ue(t,ir))return e;let r=e4(t),{backgroundColor:n,textColor:i,gradient:s,style:a}=o,c=g=>!Ue(t,ir,g),u=c("text")?_i("color",i):void 0,d=c("gradients")?th(s):void 0,f=c("background")?_i("background-color",n):void 0,m=c("background")||c("gradients"),h=n||a?.color?.background||r&&(s||a?.color?.gradient),p=V(e.className,u,d,{[f]:(!r||!a?.color?.gradient)&&!!f,"has-text-color":c("text")&&(i||a?.color?.text),"has-background":m&&h,"has-link-color":c("link")&&a?.elements?.link?.color});return e.className=p||void 0,e}function Tae(e){let t=e?.color?.text,o=t?.startsWith("var:preset|color|")?t.substring(17):void 0,r=e?.color?.background,n=r?.startsWith("var:preset|color|")?r.substring(17):void 0,i=e?.color?.gradient,s=i?.startsWith("var:preset|gradient|")?i.substring(20):void 0,a={...e};return a.color={...a.color,text:o?void 0:t,background:n?void 0:r,gradient:s?void 0:i},{style:Me(a),textColor:o,backgroundColor:n,gradient:s}}function Iae(e){return{...e.style,color:{...e.style?.color,text:e.textColor?"var:preset|color|"+e.textColor:e.style?.color?.text,background:e.backgroundColor?"var:preset|color|"+e.backgroundColor:e.style?.color?.background,gradient:e.gradient?"var:preset|gradient|"+e.gradient:e.style?.color?.gradient}}}function UIe({children:e,resetAllFilter:t}){let o=(0,Vd.useCallback)(r=>{let n=Iae(r),i=t(n);return{...r,...Tae(i)}},[t]);return(0,c2.jsx)(fe,{group:"color",resetAllFilter:o,children:e})}function d2({clientId:e,name:t,setAttributes:o,settings:r,asWrapper:n,label:i,defaultControls:s}){let a=GP(r),{style:c,textColor:u,backgroundColor:d,gradient:f}=(0,Bae.useSelect)(b=>{if(!a)return{};let{style:v,textColor:k,backgroundColor:y,gradient:S}=b(_).getBlockAttributes(e)||{};return{style:v,textColor:k,backgroundColor:y,gradient:S}},[e,a]),m=(0,Vd.useMemo)(()=>Iae({style:c,textColor:u,backgroundColor:d,gradient:f}),[c,u,d,f]),h=b=>{o(Tae(b))};if(!a)return null;s=s||(0,xc.getBlockSupport)(t,[ir,"__experimentalDefaultControls"]);let p=Vd.Platform.OS==="web"&&!m?.color?.gradient&&(r?.color?.text||r?.color?.link)&&(0,xc.getBlockSupport)(t,[ir,"enableContrastChecker"])!==!1;return(0,c2.jsx)(WP,{as:n||UIe,panelId:e,settings:r,value:m,onChange:h,defaultControls:s,label:i,enableContrastChecker:(0,xc.getBlockSupport)(t,[ir,"enableContrastChecker"])!==!1,children:p&&(0,c2.jsx)(Cae,{clientId:e,name:t})})}function HIe({name:e,backgroundColor:t,textColor:o,gradient:r,style:n}){let[i,s,a]=me("color.palette.custom","color.palette.theme","color.palette.default"),c=(0,Vd.useMemo)(()=>[...i||[],...s||[],...a||[]],[i,s,a]);if(!u2(e)||Ue(e,ir))return{};let u={};o&&!Ue(e,ir,"text")&&(u.color=da(c,o)?.color),t&&!Ue(e,ir,"background")&&(u.backgroundColor=da(c,t)?.color);let d=Eae({style:u},e,{textColor:o,backgroundColor:t,gradient:r,style:n}),f=t||n?.color?.background||r||n?.color?.gradient;return{...d,className:V(d.className,!f&&kae(n))}}var t4={useBlockProps:HIe,addSaveProps:Eae,attributeKeys:["backgroundColor","textColor","gradient","style"],hasSupport:u2},GIe={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};function WIe(e,t,o,r){let n=e.name,i={linkColor:VIe(n),textColor:zIe(n),backgroundColor:FIe(n),gradient:e4(n)};return f2(i,GIe,e,t,o,r)}(0,JF.addFilter)("blocks.registerBlockType","core/color/addAttribute",jIe);(0,JF.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",WIe);var kr=l(w(),1);function $Ie({blockName:e,clientId:t,contentClientIds:o}){let r=is(e),{updateBlockAttributes:n}=(0,m2.useDispatch)(_),{hasButtons:i,hasHeading:s}=(0,m2.useSelect)(c=>{let u=c(_).getBlockNamesByClientId(o);return{hasButtons:u.includes("core/buttons"),hasHeading:u.includes("core/heading")}},[o]);return(0,kr.jsx)(d2,{clientId:t,name:e,settings:r,setAttributes:c=>{n(t,c)},asWrapper:UF,label:(0,Xb.__)("Color"),defaultControls:{text:!0,background:!0,button:i,heading:s}})}var KIe=({blockName:e,clientId:t,hasBlockStyles:o,isSectionBlock:r,contentClientIds:n})=>{let i=$b({blockName:e});return(0,kr.jsxs)(kr.Fragment,{children:[o&&(0,kr.jsx)(Qg,{clientId:t}),r&&(0,kr.jsx)($Ie,{blockName:e,clientId:t,contentClientIds:n}),!r&&(0,kr.jsxs)(kr.Fragment,{children:[(0,kr.jsx)(fe.Slot,{group:"color",label:(0,Xb.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,kr.jsx)(fe.Slot,{group:"background",label:(0,Xb.__)("Background image")}),(0,kr.jsx)(fe.Slot,{group:"filter"}),(0,kr.jsx)(fe.Slot,{group:"typography",label:(0,Xb.__)("Typography")}),(0,kr.jsx)(fe.Slot,{group:"dimensions",label:(0,Xb.__)("Dimensions")}),(0,kr.jsx)(fe.Slot,{group:"border",label:i}),(0,kr.jsx)(fe.Slot,{group:"styles"})]})]})},Pae=KIe;var Rae=l(A(),1),Oae=l(N(),1);var p2=l($(),1),h2=l(F(),1),fi=l(A(),1);var ss=l(w(),1);function g2({clientIds:e,onSelect:t,onSwitchToListView:o,hasListViewTab:r}){return e.length?(0,ss.jsx)(fi.__experimentalVStack,{spacing:1,children:e.map(n=>(0,ss.jsx)(YIe,{onSelect:t,onSwitchToListView:o,hasListViewTab:r,clientId:n},n))}):null}function YIe({clientId:e,onSelect:t,onSwitchToListView:o,hasListViewTab:r}){let n=Tt(e),{isSelected:i,childBlocks:s,hasListViewSupport:a,blockName:c}=(0,h2.useSelect)(p=>{let{isBlockSelected:g,hasSelectedInnerBlock:b,getBlockOrder:v,getBlockName:k}=p(_),y=k(e);return{isSelected:g(e)||b(e,!0),childBlocks:v(e),hasListViewSupport:y==="core/navigation"||(0,p2.hasBlockSupport)(y,"listView"),blockName:y}},[e]),d=(0,p2.getBlockType)(c)?.title||c,{selectBlock:f}=(0,h2.useDispatch)(_),h=s&&s.length>0&&r&&a;return(0,ss.jsx)(fi.Button,{__next40pxDefaultSize:!0,className:"block-editor-block-quick-navigation__item",isPressed:i,onClick:async()=>{await f(e),h&&o&&o(e),t&&t(e)},children:(0,ss.jsxs)(fi.Flex,{children:[(0,ss.jsx)(fi.FlexItem,{children:(0,ss.jsx)(Ae,{icon:n?.icon})}),(0,ss.jsx)(fi.FlexBlock,{style:{textAlign:"left"},children:(0,ss.jsx)(fi.__experimentalTruncate,{children:d})}),h&&(0,ss.jsx)(fi.FlexItem,{children:(0,ss.jsx)(we,{icon:Vo,size:24})})]})})}var Qb=l(w(),1),qIe=({contentClientIds:e,onSwitchToListView:t,hasListViewTab:o})=>{if(!e||e.length===0)return null;let r=window?.__experimentalContentOnlyInspectorFields;return(0,Qb.jsx)(Qb.Fragment,{children:!r&&(0,Qb.jsx)(Rae.PanelBody,{title:(0,Oae.__)("Content"),children:(0,Qb.jsx)(g2,{clientIds:e,onSwitchToListView:t,hasListViewTab:o})})})},b2=qIe;var Wo=l(w(),1),{Tabs:Fd}=M(ek.privateApis);function o4({blockName:e,clientId:t,hasBlockStyles:o,tabs:r,isSectionBlock:n,contentClientIds:i}){let s=(0,oa.useRef)(null),a=(0,Jb.useSelect)(S=>S(Aae.store).get("core","showIconLabels"),[]),{requestedTab:c}=(0,Jb.useSelect)(S=>({requestedTab:M(S(_)).getRequestedInspectorTab()})),[u,d]=(0,oa.useState)(()=>c?.tabName??r[0]?.name),f=(0,oa.useRef)(!1),m=(0,oa.useRef)(!1),{__unstableSetOpenListViewPanel:h,__unstableIncrementListViewExpandRevision:p,__unstableSetAllListViewPanelsOpen:g}=(0,Jb.useDispatch)(_),{clearRequestedInspectorTab:b}=M((0,Jb.useDispatch)(_));(0,oa.useEffect)(()=>{f.current=!1},[t]),(0,oa.useEffect)(()=>{c&&(d(c.tabName),c.tabName===yc.name&&c.options?.openPanel&&(h(c.options.openPanel),p()),m.current=!0,f.current=!0,b())},[c,h,p,b]),(0,oa.useEffect)(()=>{u===yc.name&&!f.current&&(g(),p())},[t,u,g,p]),(0,oa.useEffect)(()=>{if(!r?.length||f.current&&r.some(x=>x.name===u))return;let S=r[0]?.name;u!==S&&d(S)},[r,u]);let v=S=>{d(S),f.current=!0,S===yc.name&&!m.current&&(g(),p()),m.current=!1},k=r.some(S=>S.name===yc.name),y=S=>{k&&(h(S),p(),m.current=!0,v(yc.name))};return(0,Wo.jsx)("div",{className:"block-editor-block-inspector__tabs",children:(0,Wo.jsxs)(Fd,{selectedTabId:u,onSelect:v,children:[(0,Wo.jsx)(Fd.TabList,{children:r.map(S=>a?(0,Wo.jsx)(Fd.Tab,{tabId:S.name,children:S.title},S.name):(0,Wo.jsx)(ek.Tooltip,{text:S.title,children:(0,Wo.jsx)(Fd.Tab,{tabId:S.name,"aria-label":S.title,children:(0,Wo.jsx)(ek.Icon,{icon:S.icon})})},S.name))}),(0,Wo.jsxs)(Fd.TabPanel,{tabId:_P.name,focusable:!1,children:[(0,Wo.jsx)(b2,{contentClientIds:i,onSwitchToListView:y,hasListViewTab:k}),(0,Wo.jsx)(fe.Slot,{group:"content"})]}),(0,Wo.jsxs)(Fd.TabPanel,{tabId:yc.name,focusable:!1,children:[(0,Wo.jsx)(fe.Slot,{group:"list",ref:s}),(0,Wo.jsx)(tE,{listViewRef:s})]}),(0,Wo.jsx)(Fd.TabPanel,{tabId:yP.name,focusable:!1,children:(0,Wo.jsx)(sse,{showAdvancedControls:!!e})}),(0,Wo.jsx)(Fd.TabPanel,{tabId:SP.name,focusable:!1,children:(0,Wo.jsx)(Pae,{blockName:e,clientId:t,hasBlockStyles:o,isSectionBlock:n,contentClientIds:i})})]},t)})}var mi=l(A(),1),Lae=l(F(),1);var ZIe=[];function XIe(e,t={}){return t[e]!==void 0?t[e]:t.default!==void 0?t.default:!0}function Nae(e,t,o,r){let n=[],{bindings:i,border:s,color:a,content:c,default:u,dimensions:d,list:f,position:m,styles:h,typography:p,effects:g}=Wi,b=(0,mi.__experimentalUseSlotFills)(f.name),v=!!b&&b.length,k=(0,mi.__experimentalUseSlotFills)(c.name),y=!!k&&k.length,x=[...(0,mi.__experimentalUseSlotFills)(s.name)||[],...(0,mi.__experimentalUseSlotFills)(a.name)||[],...(0,mi.__experimentalUseSlotFills)(d.name)||[],...(0,mi.__experimentalUseSlotFills)(h.name)||[],...(0,mi.__experimentalUseSlotFills)(p.name)||[],...(0,mi.__experimentalUseSlotFills)(g.name)||[]].length,C=[...(0,mi.__experimentalUseSlotFills)(rd.slotName)||[],...(0,mi.__experimentalUseSlotFills)(i.name)||[]],B=[...(0,mi.__experimentalUseSlotFills)(u.name)||[],...(0,mi.__experimentalUseSlotFills)(m.name)||[],...v&&x>1?C:[]],I=window?.__experimentalContentOnlyInspectorFields,P=y||!I&&t?.length;P&&n.push(_P),v&&n.push(yc),(B.length||C.length&&(P||v))&&n.push(yP);let{tabSettings:E,isPreviewMode:L}=(0,Lae.useSelect)(O=>{let D=O(_).getSettings();return{tabSettings:D.blockInspectorTabs,isPreviewMode:D.isPreviewMode}},[]);return!L&&(r||x)&&n.push(SP),XIe(e,E)?n:ZIe}var Mae=l(A(),1);var r4=l(w(),1),{Fill:QIe,Slot:JIe}=(0,Mae.createSlotFill)(Symbol("InspectorControlsLastItem")),Dae=e=>Ie()[bs]?(0,r4.jsx)(QIe,{...e}):null;Dae.Slot=function(t){return(0,r4.jsx)(JIe,{...t})};var k2=Dae;var Vae=l(F(),1);function Fae(e){return(0,Vae.useSelect)(t=>{if(e){let o=t(_).getSettings().blockInspectorAnimation,r=o?.animationParent,{getSelectedBlockClientId:n,getBlockParentsByBlockName:i}=t(_),s=n();return!i(s,r,!0)[0]&&e.name!==r?null:o?.[e.name]}return null},[e])}var _e=l(w(),1);function Uae({blockName:e,showAdvancedControls:t=!0,showPositionControls:o=!0,showBindingsControls:r=!0}){let n=$b({blockName:e});return(0,_e.jsxs)(_e.Fragment,{children:[(0,_e.jsx)(fe.Slot,{}),(0,_e.jsx)(fe.Slot,{group:"color",label:(0,tk.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,_e.jsx)(fe.Slot,{group:"background",label:(0,tk.__)("Background image")}),(0,_e.jsx)(fe.Slot,{group:"typography",label:(0,tk.__)("Typography")}),(0,_e.jsx)(fe.Slot,{group:"dimensions",label:(0,tk.__)("Dimensions")}),(0,_e.jsx)(fe.Slot,{group:"border",label:n}),(0,_e.jsx)(fe.Slot,{group:"styles"}),o&&(0,_e.jsx)(CP,{}),r&&(0,_e.jsx)(fe.Slot,{group:"bindings"}),t&&(0,_e.jsx)("div",{children:(0,_e.jsx)(xP,{})})]})}function ePe(){let{selectedBlockCount:e,renderedBlockName:t,renderedBlockClientId:o,blockType:r,isSectionBlock:n,isSectionBlockInSelection:i,hasBlockStyles:s,editedContentOnlySection:a}=(0,n4.useSelect)(g=>{let{getSelectedBlockClientId:b,getSelectedBlockClientIds:v,getSelectedBlockCount:k,getBlockName:y,getParentSectionBlock:S,isSectionBlock:x,getEditedContentOnlySection:C,isWithinEditedContentOnlySection:B}=M(g(_)),{getBlockStyles:I}=g(zd.store),P=b(),L=B(P)?P:S(P)||P,T=L&&y(L),O=T&&(0,zd.getBlockType)(T),U=v().some(z=>x(z)),G=T&&I(T),j=G&&G.length>0;return{selectedBlockCount:k(),renderedBlockClientId:L,renderedBlockName:T,blockType:O,isSectionBlockInSelection:U,isSectionBlock:x(L),hasBlockStyles:j,editedContentOnlySection:C()}},[]),c=(0,n4.useSelect)(g=>{if(!n||!o)return[];let{getClientIdsOfDescendants:b,getBlockName:v,getBlockEditingMode:k}=M(g(_)),y=b(o),S=new Set;return y.forEach(x=>{let C=v(x);(C==="core/navigation"||(0,zd.hasBlockSupport)(C,"listView"))&&b(x).forEach(I=>S.add(I))}),y.filter(x=>!S.has(x)&&k(x)==="contentOnly")},[n,o]),u=Nae(r?.name,c,n,s),d=u?.length>1,f=Fae(r),m=e>1;if(m&&!i)return(0,_e.jsxs)("div",{className:"block-editor-block-inspector",children:[(0,_e.jsx)(NF,{}),d?(0,_e.jsx)(o4,{tabs:u}):(0,_e.jsx)(Uae,{blockName:t,showAdvancedControls:!1,showPositionControls:!1,showBindingsControls:!1})]});if(m&&i)return(0,_e.jsx)("div",{className:"block-editor-block-inspector",children:(0,_e.jsx)(NF,{})});let h=t===(0,zd.getUnregisteredTypeHandlerName)();return!r||!o||h?(0,_e.jsx)("span",{className:"block-editor-block-inspector__no-blocks",children:(0,tk.__)("No block selected.")}):(0,_e.jsx)(tPe,{animate:f,wrapper:g=>(0,_e.jsx)(oPe,{blockInspectorAnimationSettings:f,renderedBlockClientId:o,children:g}),children:(0,_e.jsx)(rPe,{renderedBlockClientId:o,blockName:r.name,isSectionBlock:n,availableTabs:u,contentClientIds:c,hasBlockStyles:s,editedContentOnlySection:a})})}var tPe=({animate:e,wrapper:t,children:o})=>e?t(o):o,oPe=({blockInspectorAnimationSettings:e,renderedBlockClientId:t,children:o})=>{let r=e&&e.enterDirection==="leftToRight"?-50:50;return(0,_e.jsx)(zae.__unstableMotion.div,{animate:{x:0,opacity:1,transition:{ease:"easeInOut",duration:.14}},initial:{x:r,opacity:0},children:o},t)},rPe=({renderedBlockClientId:e,blockName:t,isSectionBlock:o,availableTabs:r,contentClientIds:n,hasBlockStyles:i,editedContentOnlySection:s})=>{let a=(0,jae.useRef)(null),c=r?.length>1,u=s&&s!==e,d=Tt(s),f=Tt(e),m=f.isSynced;return(0,_e.jsxs)("div",{className:"block-editor-block-inspector",children:[u&&(0,_e.jsx)(yy,{...d,className:d?.isSynced&&"is-synced",parentClientId:s}),(0,_e.jsx)(yy,{...f,allowParentNavigation:!0,className:m&&"is-synced",isChild:u,clientId:e}),(0,_e.jsx)(u9,{clientId:e}),(0,_e.jsx)(Xie,{clientId:e}),(0,_e.jsx)(WT,{blockClientId:e}),c&&(0,_e.jsx)(_e.Fragment,{children:(0,_e.jsx)(o4,{hasBlockStyles:i,clientId:e,blockName:t,tabs:r,isSectionBlock:o,contentClientIds:n})}),!c&&(0,_e.jsxs)(_e.Fragment,{children:[i&&(0,_e.jsx)(Qg,{clientId:e}),(0,_e.jsx)(b2,{contentClientIds:n}),(0,_e.jsx)(fe.Slot,{group:"content"}),(0,_e.jsx)(fe.Slot,{group:"list",ref:a}),(0,_e.jsx)(tE,{listViewRef:a}),!o&&(0,_e.jsx)(Uae,{blockName:t})]}),(0,_e.jsx)(k2.Slot,{}),(0,_e.jsx)(kP,{},"back")]})},Hae=ePe;var i4=l(Re(),1);var Gae=l(w(),1),Wae=()=>((0,i4.default)("__unstableUseClipboardHandler",{alternative:"BlockCanvas or WritingFlow",since:"6.4",version:"6.7"}),xy());function $ae(e){return(0,i4.default)("CopyHandler",{alternative:"BlockCanvas or WritingFlow",since:"6.4",version:"6.7"}),(0,Gae.jsx)("div",{...e,ref:xy()})}var Kae=l(F(),1),s4=l(R(),1);var a4=l(w(),1),nPe=()=>{};function iPe({rootClientId:e,clientId:t,isAppender:o,showInserterHelpPanel:r,showMostUsedBlocks:n=!1,__experimentalInsertionIndex:i,__experimentalInitialTab:s,__experimentalInitialCategory:a,__experimentalFilterValue:c,onPatternCategorySelection:u,onSelect:d=nPe,shouldFocusBlock:f=!1,onClose:m},h){let{destinationRootClientId:p}=(0,Kae.useSelect)(g=>{let{getBlockRootClientId:b}=g(_);return{destinationRootClientId:e||b(t)||void 0}},[t,e]);return(0,a4.jsx)(W5,{onSelect:d,rootClientId:p,clientId:t,isAppender:o,showInserterHelpPanel:r,showMostUsedBlocks:n,__experimentalInsertionIndex:i,__experimentalFilterValue:c,onPatternCategorySelection:u,__experimentalInitialTab:s,__experimentalInitialCategory:a,shouldFocusBlock:f,ref:h,onClose:m})}var l4=(0,s4.forwardRef)(iPe);function sPe(e,t){return(0,a4.jsx)(l4,{...e,onPatternCategorySelection:void 0,ref:t})}var Yae=(0,s4.forwardRef)(sPe);var qae=l(Re(),1);function Zae(){return(0,qae.default)("wp.blockEditor.MultiSelectScrollIntoView",{hint:"This behaviour is now built-in.",since:"5.8"}),null}var Xae=l(Z(),1),x_=l(Fe(),1),Qae=l(F(),1),jd=l(it(),1);var Jae=l(w(),1),aPe=window.navigator.userAgent.indexOf("Trident")!==-1,lPe=new Set([jd.UP,jd.DOWN,jd.LEFT,jd.RIGHT]),cPe=.75;function c4(){let e=(0,Qae.useSelect)(t=>t(_).hasSelectedBlock(),[]);return(0,Xae.useRefEffect)(t=>{if(!e)return;let{ownerDocument:o}=t,{defaultView:r}=o,n,i,s;function a(){n||(n=r.requestAnimationFrame(()=>{m(),n=null}))}function c(g){i&&r.cancelAnimationFrame(i),i=r.requestAnimationFrame(()=>{u(g),i=null})}function u({keyCode:g}){if(!h())return;let b=(0,x_.computeCaretRect)(r);if(!b)return;if(!s){s=b;return}if(lPe.has(g)){s=b;return}let v=b.top-s.top;if(v===0)return;let k=(0,x_.getScrollContainer)(t);if(!k)return;let y=k===o.body||k===o.documentElement,S=y?r.scrollY:k.scrollTop,x=y?0:k.getBoundingClientRect().top,C=y?s.top/r.innerHeight:(s.top-x)/(r.innerHeight-x);if(S===0&&Cx+B||s.top{r.removeEventListener("scroll",a,!0),r.removeEventListener("resize",a,!0),t.removeEventListener("keydown",c),t.removeEventListener("keyup",u),t.removeEventListener("mousedown",d),t.removeEventListener("touchstart",d),o.removeEventListener("selectionchange",f),r.cancelAnimationFrame(n),r.cancelAnimationFrame(i)}},[e])}function uPe({children:e}){return(0,Jae.jsx)("div",{ref:c4(),className:"block-editor__typewriter",children:e})}var dPe=aPe?e=>e.children:uPe,ele=dPe;var dp=l(R(),1),u4=l(Re(),1);var d4=l(w(),1),v2=(0,dp.createContext)({});v2.displayName="RenderedRefsContext";function fPe(e,t,o){let r={...e,[t]:e[t]?new Set(e[t]):new Set};return r[t].add(o),r}function f4({children:e,uniqueId:t,blockName:o=""}){let r=(0,dp.useContext)(v2),{name:n}=Ie();o=o||n;let i=(0,dp.useMemo)(()=>fPe(r,o,t),[r,o,t]);return(0,d4.jsx)(v2.Provider,{value:i,children:e})}function m4(e,t=""){let o=(0,dp.useContext)(v2),{name:r}=Ie();return t=t||r,!!o[t]?.has(e)}var tle=e=>((0,u4.default)("wp.blockEditor.__experimentalRecursionProvider",{since:"6.5",alternative:"wp.blockEditor.RecursionProvider"}),(0,d4.jsx)(f4,{...e})),ole=(...e)=>((0,u4.default)("wp.blockEditor.__experimentalUseHasRecursion",{since:"6.5",alternative:"wp.blockEditor.useHasRecursion"}),m4(...e));var S2=l(A(),1),p4=l(N(),1),h4=l(R(),1),nle=l(pc(),1);var pi=l(A(),1);var rle=l(N(),1),wc=l(w(),1);function y2({title:e,help:t,actions:o=[],onClose:r}){return(0,wc.jsxs)(pi.__experimentalVStack,{className:"block-editor-inspector-popover-header",spacing:4,children:[(0,wc.jsxs)(pi.__experimentalHStack,{alignment:"center",children:[(0,wc.jsx)(pi.__experimentalHeading,{className:"block-editor-inspector-popover-header__heading",level:2,size:13,children:e}),(0,wc.jsx)(pi.__experimentalSpacer,{}),o.map(({label:n,icon:i,onClick:s})=>(0,wc.jsx)(pi.Button,{size:"small",className:"block-editor-inspector-popover-header__action",label:n,icon:i,variant:!i&&"tertiary",onClick:s,children:!i&&n},n)),r&&(0,wc.jsx)(pi.Button,{size:"small",className:"block-editor-inspector-popover-header__action",label:(0,rle.__)("Close"),icon:wf,onClick:r})]}),t&&(0,wc.jsx)(pi.__experimentalText,{children:t})]})}var ok=l(w(),1);function mPe({onClose:e,onChange:t,showPopoverHeaderActions:o,isCompact:r,currentDate:n,title:i,...s},a){let c={startOfWeek:(0,nle.getSettings)().l10n.startOfWeek,onChange:t,currentDate:r?void 0:n,currentTime:r?n:void 0,...s},u=r?S2.TimePicker:S2.DateTimePicker;return(0,ok.jsxs)("div",{ref:a,className:"block-editor-publish-date-time-picker",children:[(0,ok.jsx)(y2,{title:i||(0,p4.__)("Publish"),actions:o?[{label:(0,p4.__)("Now"),onClick:()=>t?.(null)}]:void 0,onClose:e}),(0,ok.jsx)(u,{...c})]})}var g4=(0,h4.forwardRef)(mPe);function pPe(e,t){return(0,ok.jsx)(g4,{...e,showPopoverHeaderActions:!0,isCompact:!1,ref:t})}var ile=(0,h4.forwardRef)(pPe);var _2=l(F(),1),sle=l(R(),1);function ao(e){let t=Ie(),{clientId:o=""}=t,{setBlockEditingMode:r,unsetBlockEditingMode:n}=(0,_2.useDispatch)(_),i=(0,_2.useSelect)(s=>o?null:s(_).getBlockEditingMode(),[o]);return(0,sle.useEffect)(()=>(e&&r(o,e),()=>{e&&n(o)}),[o,e,r,n]),o?t[u0]:i}var ale=l(Re(),1),lle=l(R(),1);function hPe(){return(0,ale.default)("wp.blockEditor.ToolSelector",{since:"6.9",hint:"The ToolSelector component no longer renders anything."}),null}var cle=(0,lle.forwardRef)(hPe);var C_=l(w(),1),Me=e=>{if(e===null||typeof e!="object"||Array.isArray(e))return e;let t=Object.entries(e).map(([o,r])=>[o,Me(r)]).filter(([,o])=>o!==void 0);return t.length?Object.fromEntries(t):void 0};function f2(e,t,o,r,n,i){if(Object.values(e??{}).every(c=>!c)||i.length===1&&o.innerBlocks.length===r.length)return o;let s=r[0]?.attributes;if(i.length>1&&r.length>1)if(r[n])s=r[n]?.attributes;else return o;let a=o;return Object.entries(e).forEach(([c,u])=>{u&&t[c].forEach(d=>{let f=yl(s,d);f&&(a={...a,attributes:pe(a.attributes,d,f)})})}),a}function Ue(e,t,o){let n=(0,ule.getBlockSupport)(e,t)?.__experimentalSkipSerialization;return Array.isArray(n)?n.includes(o):n}var Cc=new WeakMap;function Qn({id:e,css:t}){return tc({id:e,css:t})}function tc({id:e,css:t,assets:o,__unstableType:r,variation:n,clientId:i}={}){let{setStyleOverride:s,deleteStyleOverride:a}=M((0,x2.useDispatch)(_)),c=(0,x2.useRegistry)(),u=(0,as.useId)();(0,as.useEffect)(()=>{if(!t&&!o)return;let d=e||u,f={id:e,css:t,assets:o,__unstableType:r,variation:n,clientId:i};return Cc.get(c)||Cc.set(c,[]),Cc.get(c).push([d,f]),window.queueMicrotask(()=>{Cc.get(c)?.length&&c.batch(()=>{Cc.get(c).forEach(m=>{s(...m)}),Cc.set(c,[])})}),()=>{Cc.get(c)?.find(([h])=>h===d)?Cc.set(c,Cc.get(c).filter(([h])=>h!==d)):a(d)}},[e,t,i,o,r,u,s,a,c,n])}function is(e,t){let[o,r,n,i,s,a,c,u,d,f,m,h,p,g,b,v,k,y,S,x,C,B,I,P,E,L,T,O,D,U,G,j,z,W,ee,se,ce,ie,re,Q,Y,J,K,H,X,ne,le,ve,he,xe,ze,ot,Wt,fo,Do,rt,ar,xt,At,Pe,wt]=me("background.backgroundImage","background.backgroundSize","typography.fontFamilies.custom","typography.fontFamilies.default","typography.fontFamilies.theme","typography.defaultFontSizes","typography.fontSizes.custom","typography.fontSizes.default","typography.fontSizes.theme","typography.customFontSize","typography.fontStyle","typography.fontWeight","typography.lineHeight","typography.textAlign","typography.textColumns","typography.textDecoration","typography.textIndent","typography.writingMode","typography.textTransform","typography.letterSpacing","spacing.padding","spacing.margin","spacing.blockGap","spacing.defaultSpacingSizes","spacing.customSpacingSize","spacing.spacingSizes.custom","spacing.spacingSizes.default","spacing.spacingSizes.theme","spacing.units","dimensions.aspectRatio","dimensions.height","dimensions.minHeight","dimensions.width","dimensions.dimensionSizes","layout","border.color","border.radius","border.style","border.width","border.radiusSizes","color.custom","color.palette.custom","color.customDuotone","color.palette.theme","color.palette.default","color.defaultPalette","color.defaultDuotone","color.duotone.custom","color.duotone.theme","color.duotone.default","color.gradients.custom","color.gradients.theme","color.gradients.default","color.defaultGradients","color.customGradient","color.background","color.link","color.text","color.heading","color.button","shadow"),qo=(0,as.useMemo)(()=>({background:{backgroundImage:o,backgroundSize:r},color:{palette:{custom:J,theme:H,default:X},gradients:{custom:ze,theme:ot,default:Wt},duotone:{custom:ve,theme:he,default:xe},defaultGradients:fo,defaultPalette:ne,defaultDuotone:le,custom:Y,customGradient:Do,customDuotone:K,background:rt,link:ar,heading:At,button:Pe,text:xt},typography:{fontFamilies:{custom:n,default:i,theme:s},fontSizes:{custom:c,default:u,theme:d},customFontSize:f,defaultFontSizes:a,fontStyle:m,fontWeight:h,lineHeight:p,textAlign:g,textColumns:b,textDecoration:v,textIndent:k,textTransform:S,letterSpacing:x,writingMode:y},spacing:{spacingSizes:{custom:L,default:T,theme:O},customSpacingSize:E,defaultSpacingSizes:P,padding:C,margin:B,blockGap:I,units:D},border:{color:se,radius:ce,style:ie,width:re,radiusSizes:Q},dimensions:{aspectRatio:U,height:G,minHeight:j,width:z,dimensionSizes:W},layout:ee,parentLayout:t,shadow:wt}),[o,r,n,i,s,a,c,u,d,f,m,h,p,g,b,v,k,S,x,y,C,B,I,P,E,L,T,O,D,U,G,j,z,W,ee,t,se,ce,ie,re,Q,Y,J,K,H,X,ne,le,ve,he,xe,ze,ot,Wt,fo,Do,rt,ar,xt,At,Pe,wt]);return TP(qo,e)}function dle(e){e=e.map(o=>({...o,Edit:(0,as.memo)(o.edit)}));let t=(0,b4.createHigherOrderComponent)(o=>function(n){let i=Ie();return[...e.map((s,a)=>{let{Edit:c,hasSupport:u,attributeKeys:d=[],shareWithChildBlocks:f,supportsPatternEditing:m}=s;if(!(m&&i[$c]||i[bs]||i[Pp]&&f)||!u(n.name))return null;let p={};for(let g of d)n.attributes[g]&&(p[g]=n.attributes[g]);return(0,C_.jsx)(c,{name:n.name,isSelected:n.isSelected,clientId:n.clientId,setAttributes:n.setAttributes,__unstableParentLayout:n.__unstableParentLayout,...p},a)}),(0,C_.jsx)(o,{...n},"edit")]},"withBlockEditHooks");(0,w_.addFilter)("editor.BlockEdit","core/editor/hooks",t)}function gPe({index:e,useBlockProps:t,setAllWrapperProps:o,...r}){let n=t(r),i=s=>o(a=>{let c=[...a];return c[e]=s,c});return(0,as.useEffect)(()=>(i(n),()=>{i(void 0)})),null}var bPe=(0,as.memo)(gPe);function fle(e){let t=(0,b4.createHigherOrderComponent)(o=>function(n){let[i,s]=(0,as.useState)(Array(e.length).fill(void 0));return[...e.map((a,c)=>{let{hasSupport:u,attributeKeys:d=[],useBlockProps:f,isMatch:m}=a,h={};for(let p of d)n.attributes[p]&&(h[p]=n.attributes[p]);return!Object.keys(h).length||!u(n.name)||m&&!m(h)?null:(0,C_.jsx)(bPe,{index:c,useBlockProps:f,setAllWrapperProps:s,name:n.name,clientId:n.clientId,...h},c)}),(0,C_.jsx)(o,{...n,wrapperProps:i.filter(Boolean).reduce((a,c)=>({...a,...c,className:V(a.className,c.className),style:{...a.style,...c.style}}),n.wrapperProps||{})},"edit")]},"withBlockListBlockHooks");(0,w_.addFilter)("editor.BlockListBlock","core/editor/hooks",t)}function mle(e){function t(o,r,n){return e.reduce((i,s)=>{let{hasSupport:a,attributeKeys:c=[],addSaveProps:u}=s,d={};for(let f of c)n[f]&&(d[f]=n[f]);return!Object.keys(d).length||!a(r)?i:u(i,r,d)},o)}(0,w_.addFilter)("blocks.getSaveContent.extraProps","core/editor/hooks",t,0),(0,w_.addFilter)("blocks.getSaveContent.extraProps","core/editor/hooks",o=>(o.hasOwnProperty("className")&&!o.className&&delete o.className,o))}var ple=l($(),1),hle=l(ut(),1);function kPe(e){let{apiVersion:t=1}=e;return t<2&&(0,ple.hasBlockSupport)(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}(0,hle.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",kPe);function gle(e){e.hasAttribute("crossorigin")||e.setAttribute("crossorigin","anonymous")}if(window.crossOriginIsolated){let e=function(){document.body?t.observe(document.body,{childList:!0,attributes:!0,subtree:!0}):document.readyState==="loading"&&document.addEventListener("DOMContentLoaded",()=>{document.body&&t.observe(document.body,{childList:!0,attributes:!0,subtree:!0})})};vPe=e;let t=new window.MutationObserver(o=>{o.forEach(r=>{[r.addedNodes,r.target].forEach(n=>{(n instanceof window.NodeList?n:[n]).forEach(s=>{let a=s;a.querySelectorAll&&(a.querySelectorAll("source,script,video,link").forEach(c=>{gle(c)}),["SOURCE","SCRIPT","VIDEO","LINK"].includes(a.nodeName)&&gle(a))})})})});e()}var vPe;var ble=l(ut(),1),ls=l($(),1);var k4=l(w(),1),v4=["left","center","right","wide","full"],yPe=["wide","full"];function y4(e,t=!0,o=!0){let r;return Array.isArray(e)?r=v4.filter(n=>e.includes(n)):e===!0?r=[...v4]:r=[],!o||e===!0&&!t?r.filter(n=>!yPe.includes(n)):r}function SPe(e){return"type"in(e.attributes?.align??{})||(0,ls.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...v4,""]}}),e}function _Pe({name:e,align:t,setAttributes:o}){let r=y4((0,ls.getBlockSupport)(e,"align"),(0,ls.hasBlockSupport)(e,"alignWide",!0)),n=Hv(r).map(({name:a})=>a),i=ao();return!n.length||i!=="default"?null:(0,k4.jsx)(Mt,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,k4.jsx)(cC,{value:t,onChange:a=>{a||(0,ls.getBlockType)(e)?.attributes?.align?.default&&(a=""),o({align:a})},controls:n})})}var w2={shareWithChildBlocks:!0,edit:_Pe,useBlockProps:xPe,addSaveProps:wPe,attributeKeys:["align"],hasSupport(e){return(0,ls.hasBlockSupport)(e,"align",!1)}};function xPe({name:e,align:t}){let o=y4((0,ls.getBlockSupport)(e,"align"),(0,ls.hasBlockSupport)(e,"alignWide",!0));return Hv(o).some(n=>n.name===t)?{"data-align":t}:{}}function wPe(e,t,o){let{align:r}=o,n=(0,ls.getBlockSupport)(t,"align"),i=(0,ls.hasBlockSupport)(t,"alignWide",!0);return y4(n,i).includes(r)&&(e.className=V(`align${r}`,e.className)),e}(0,ble.addFilter)("blocks.registerBlockType","core/editor/align/addAttribute",SPe);var kle=l(ut(),1);function CPe(e){return"type"in(e.attributes?.lock??{})||(e.attributes={...e.attributes,lock:{type:"object"}}),e}(0,kle.addFilter)("blocks.registerBlockType","core/lock/addAttribute",CPe);var C4=l(ut(),1),ak=l($(),1);var B_=l(A(),1),E2=l(N(),1),Ple=l(R(),1),Rle=l(F(),1),T2=l($(),1);var Pn=l(A(),1),Ele=l(R(),1),sk=l(N(),1),Tle=l(F(),1);var x4=l($(),1),wle=l(F(),1),ik=l(A(),1),ra=l(N(),1),C2=l(R(),1),Cle=l(Z(),1),Ble=l(Xo(),1);var S4=l(R(),1),Sle=l(Z(),1),_le=l(A(),1);var vle=l(A(),1);var rk=l(w(),1);function BPe({blockTypes:e,value:t,onItemChange:o}){return(0,rk.jsx)("ul",{className:"block-editor-block-manager__checklist",children:e.map(r=>(0,rk.jsxs)("li",{className:"block-editor-block-manager__checklist-item",children:[(0,rk.jsx)(vle.CheckboxControl,{label:r.title,checked:t.includes(r.name),onChange:(...n)=>o(r,...n)}),(0,rk.jsx)(Ae,{icon:r.icon})]},r.name))})}var yle=BPe;var nk=l(w(),1);function xle({title:e,blockTypes:t,selectedBlockTypes:o,onChange:r}){let n=(0,Sle.useInstanceId)(xle),i=(0,S4.useCallback)((f,m)=>{r(m?[...o,f]:o.filter(({name:h})=>h!==f.name))},[o,r]),s=(0,S4.useCallback)(f=>{r(f?[...o,...t.filter(m=>!o.find(({name:h})=>h===m.name))]:o.filter(m=>!t.find(({name:h})=>h===m.name)))},[t,o,r]);if(!t.length)return null;let a=t.map(({name:f})=>f).filter(f=>(o??[]).some(m=>m.name===f)),c="block-editor-block-manager__category-title-"+n,u=a.length===t.length,d=!u&&a.length>0;return(0,nk.jsxs)("div",{role:"group","aria-labelledby":c,className:"block-editor-block-manager__category",children:[(0,nk.jsx)(_le.CheckboxControl,{checked:u,onChange:s,className:"block-editor-block-manager__category-title",indeterminate:d,label:(0,nk.jsx)("span",{id:c,children:e})}),(0,nk.jsx)(yle,{blockTypes:t,value:a,onItemChange:i})]})}var _4=xle;var Bc=l(w(),1);function B2({blockTypes:e,selectedBlockTypes:t,onChange:o,showSelectAll:r=!0}){let n=(0,Cle.useDebounce)(Ble.speak,500),[i,s]=(0,C2.useState)(""),{categories:a,isMatchingSearchTerm:c}=(0,wle.useSelect)(m=>({categories:m(x4.store).getCategories(),isMatchingSearchTerm:m(x4.store).isMatchingSearchTerm}),[]),u=e.filter(m=>!i||c(m,i)),d=t.length>0&&t.length!==e.length,f=e.length>0&&t.length===e.length;return(0,C2.useEffect)(()=>{if(!i)return;let m=u.length,h=(0,ra.sprintf)((0,ra._n)("%d result found.","%d results found.",m),m);n(h)},[u?.length,i,n]),(0,Bc.jsxs)(ik.__experimentalVStack,{className:"block-editor-block-manager__content",spacing:4,children:[(0,Bc.jsx)(ik.SearchControl,{label:(0,ra.__)("Search for a block"),placeholder:(0,ra.__)("Search for a block"),value:i,onChange:m=>s(m),className:"block-editor-block-manager__search"}),r&&(0,Bc.jsx)(ik.CheckboxControl,{className:"block-editor-block-manager__select-all",label:(0,ra.__)("Select all"),checked:f,onChange:()=>{o(f?[]:e)},indeterminate:d}),(0,Bc.jsxs)("div",{tabIndex:"0",role:"region","aria-label":(0,ra.__)("Available block types"),className:"block-editor-block-manager__results",children:[u.length===0&&(0,Bc.jsx)("p",{className:"block-editor-block-manager__no-results",children:(0,ra.__)("No blocks found.")}),a.map(m=>(0,Bc.jsx)(_4,{title:m.title,blockTypes:u.filter(h=>h.category===m.slug),selectedBlockTypes:t,onChange:o},m.slug)),(0,Bc.jsx)(_4,{title:(0,ra.__)("Uncategorized"),blockTypes:u.filter(({category:m})=>!m),selectedBlockTypes:t,onChange:o})]})]})}var na=l(w(),1);function Ile({clientId:e,blockTypes:t,selectedBlockTypes:o,onClose:r}){let[n,i]=(0,Ele.useState)(o),{updateBlockAttributes:s}=(0,Tle.useDispatch)(_),a=()=>{let c=n.length===t.length,u=n.map(({name:d})=>d);s(e,{allowedBlocks:c?void 0:u}),r()};return(0,na.jsx)(Pn.Modal,{title:(0,sk._x)("Manage allowed blocks","modal title"),onRequestClose:r,overlayClassName:"block-editor-block-allowed-blocks-modal",focusOnMount:"firstContentElement",size:"medium",children:(0,na.jsxs)(Pn.__experimentalVStack,{as:"form",onSubmit:c=>{c.preventDefault(),a()},spacing:"4",children:[(0,na.jsx)(Pn.__experimentalText,{children:(0,sk.__)("Select which blocks can be added inside this container.")}),(0,na.jsx)(B2,{blockTypes:t,selectedBlockTypes:n,onChange:c=>{i(c)}}),(0,na.jsxs)(Pn.Flex,{className:"block-editor-block-allowed-blocks-modal__actions",justify:"flex-end",expanded:!1,children:[(0,na.jsx)(Pn.FlexItem,{children:(0,na.jsx)(Pn.Button,{variant:"tertiary",onClick:r,__next40pxDefaultSize:!0,children:(0,sk.__)("Cancel")})}),(0,na.jsx)(Pn.FlexItem,{children:(0,na.jsx)(Pn.Button,{variant:"primary",type:"submit",__next40pxDefaultSize:!0,children:(0,sk.__)("Apply")})})]})]})})}var fp=l(w(),1);function Ole({clientId:e}){let[t,o]=(0,Ple.useState)(!1),{blockTypes:r,selectedBlockNames:n}=(0,Rle.useSelect)(a=>{let{getBlockAttributes:c}=a(_);return{blockTypes:a(T2.store).getBlockTypes(),selectedBlockNames:c(e)?.allowedBlocks}},[e]),i=r.filter(a=>(0,T2.hasBlockSupport)(a,"inserter",!0)&&(!a.parent||a.parent.includes("core/post-content")));if(!i)return null;let s=n===void 0?i:i.filter(a=>n.includes(a.name));return(0,fp.jsxs)("div",{className:"block-editor-block-allowed-blocks-control",children:[(0,fp.jsxs)(B_.BaseControl,{help:(0,E2.__)("Specify which blocks are allowed inside this container."),children:[(0,fp.jsx)(B_.BaseControl.VisualLabel,{children:(0,E2.__)("Allowed Blocks")}),(0,fp.jsx)(B_.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{o(!0)},className:"block-editor-block-allowed-blocks-control__button",children:(0,E2.__)("Manage allowed blocks")})]}),t&&(0,fp.jsx)(Ile,{clientId:e,blockTypes:i,selectedBlockTypes:s,onClose:()=>o(!1)})]})}var w4=l(w(),1);function EPe({clientId:e}){return ao()==="contentOnly"?null:(0,w4.jsx)(sS.Fill,{children:(0,w4.jsx)(Ole,{clientId:e})})}var Ale={edit:EPe,attributeKeys:["allowedBlocks"],hasSupport(e){return(0,ak.hasBlockSupport)(e,"allowedBlocks")}};function TPe(e){return e?.attributes?.allowedBlocks?.type||(0,ak.hasBlockSupport)(e,"allowedBlocks")&&(e.attributes={...e.attributes,allowedBlocks:{type:"array"}}),e}(0,C4.addFilter)("blocks.registerBlockType","core/allowedBlocks/attribute",TPe);function IPe(e,t,o,r){if(!(0,ak.hasBlockSupport)(e.name,"allowedBlocks")||t.length!==1&&r.length===1&&e.innerBlocks.length===t.length||r.length===1&&t.length>1||r.length>1&&t.length===1||r.length>1&&t.length>1&&r.length!==t.length||e.attributes.allowedBlocks)return e;let n=t[o]?.attributes?.allowedBlocks;if(!n)return e;let s=(0,ak.getBlockType)(e.name)?.allowedBlocks||[];if(!s.length)return{...e,attributes:{...e.attributes,allowedBlocks:n}};let a=n.filter(c=>s.includes(c));return{...e,attributes:{...e.attributes,allowedBlocks:a}}}(0,C4.addFilter)("blocks.switchToBlockType.transformedBlock","core/allowedBlocks/addTransforms",IPe);var Lle=l(ut(),1),I2=l(A(),1),lk=l(N(),1),P2=l($(),1),Nle=l(R(),1);var Qa=l(w(),1),PPe=/[\s#]/g;function RPe(e){return"type"in(e.attributes?.anchor??{})||(0,P2.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:{type:"string"}}),e}function OPe({anchor:e,setAttributes:t}){if(ao()!=="default")return null;let r=Nle.Platform.OS==="web";return(0,Qa.jsx)(fe,{group:"advanced",children:(0,Qa.jsx)(I2.TextControl,{__next40pxDefaultSize:!0,className:"html-anchor-control",label:(0,lk.__)("HTML anchor"),help:(0,Qa.jsxs)(Qa.Fragment,{children:[(0,lk.__)("Enter a word or two\u2014without spaces\u2014to make a unique web address just for this block, called an \u201Canchor\u201D. Then, you\u2019ll be able to link directly to this section of your page."),r&&(0,Qa.jsxs)(Qa.Fragment,{children:[" ",(0,Qa.jsx)(I2.ExternalLink,{href:(0,lk.__)("https://wordpress.org/documentation/article/page-jumps/"),children:(0,lk.__)("Learn more about anchors")})]})]}),value:e||"",placeholder:r?null:(0,lk.__)("Add an anchor"),onChange:n=>{n=n.replace(PPe,"-"),t({anchor:n!==""?n:void 0})},autoCapitalize:"none",autoComplete:"off"})})}var B4={addSaveProps:APe,edit:OPe,attributeKeys:["anchor"],hasSupport(e){return(0,P2.hasBlockSupport)(e,"anchor")}};function APe(e,t,o){return(0,P2.hasBlockSupport)(t,"anchor")&&(e.id=o.anchor===""?null:o.anchor),e}(0,Lle.addFilter)("blocks.registerBlockType","core/anchor/attribute",RPe);var Mle=l(ut(),1),R2=l($(),1);function LPe(e){return e?.attributes?.ariaLabel?.type||(0,R2.hasBlockSupport)(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:{type:"string"}}),e}function NPe(e,t,o){return(0,R2.hasBlockSupport)(t,"ariaLabel")&&!Ue(t,"ariaLabel","ariaLabel")&&(e["aria-label"]=o.ariaLabel===""?null:o.ariaLabel),e}var Dle={addSaveProps:NPe,attributeKeys:["ariaLabel"],hasSupport(e){return(0,R2.hasBlockSupport)(e,"ariaLabel")}};(0,Mle.addFilter)("blocks.registerBlockType","core/ariaLabel/attribute",LPe);var Bk=l($(),1),OR=l(A(),1),$de=l(F(),1);var Fle=l(jr(),1),Vle={};function E4(e,t){let o=Fle.useRef(Vle);return o.current===Vle&&(o.current=e(t)),o}function T4(e,...t){let o=new URL(`https://base-ui.com/production-error/${e}`);return t.forEach(r=>o.searchParams.append("args[]",r)),`Base UI error #${e}; visit ${o} for the full message.`}var O2=l(jr(),1);function I4(e,t,o,r){let n=E4(jle).current;return MPe(n,e,t,o,r)&&Ule(n,[e,t,o,r]),n.callback}function zle(e){let t=E4(jle).current;return DPe(t,e)&&Ule(t,e),t.callback}function jle(){return{callback:null,cleanup:null,refs:[]}}function MPe(e,t,o,r,n){return e.refs[0]!==t||e.refs[1]!==o||e.refs[2]!==r||e.refs[3]!==n}function DPe(e,t){return e.refs.length!==t.length||e.refs.some((o,r)=>o!==t[r])}function Ule(e,t){if(e.refs=t,t.every(o=>o==null)){e.callback=null;return}e.callback=o=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),o!=null){let r=Array(t.length).fill(null);for(let n=0;n{for(let n=0;n=e}function P4(e){if(!Wle.isValidElement(e))return null;let t=e,o=t.props;return(Gle(19)?o?.ref:t.ref)??null}function E_(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function $le(e,t){let o={};for(let r in e){let n=e[r];if(t?.hasOwnProperty(r)){let i=t[r](n);i!=null&&Object.assign(o,i);continue}n===!0?o[`data-${r.toLowerCase()}`]="":n&&(o[`data-${r.toLowerCase()}`]=n.toString())}return o}function Kle(e,t){return typeof e=="function"?e(t):e}function Yle(e,t){return typeof e=="function"?e(t):e}var I_={};function ck(e,t,o,r,n){let i={...R4(e,I_)};return t&&(i=T_(i,t)),o&&(i=T_(i,o)),r&&(i=T_(i,r)),n&&(i=T_(i,n)),i}function qle(e){if(e.length===0)return I_;if(e.length===1)return R4(e[0],I_);let t={...R4(e[0],I_)};for(let o=1;o=65&&n<=90&&(typeof t=="function"||typeof t>"u")}function Zle(e){return typeof e=="function"}function R4(e,t){return Zle(e)?e(t):e??I_}function jPe(e,t){return t?e?o=>{if(HPe(o)){let n=o;UPe(n);let i=t(n);return n.baseUIHandlerPrevented||e?.(n),i}let r=t(o);return e?.(o),r}:t:e}function UPe(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function O4(e,t){return t?e?t+" "+e:t:e}function HPe(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}var GPe=Object.freeze([]),Ud=Object.freeze({});var A4=l(jr(),1);function Xle(e,t,o={}){let r=t.render,n=WPe(t,o);if(o.enabled===!1)return null;let i=o.state??Ud;return $Pe(e,r,n,i)}function WPe(e,t={}){let{className:o,style:r,render:n}=e,{state:i=Ud,ref:s,props:a,stateAttributesMapping:c,enabled:u=!0}=t,d=u?Kle(o,i):void 0,f=u?Yle(r,i):void 0,m=u?$le(i,c):Ud,h=u?E_(m,Array.isArray(a)?qle(a):a)??Ud:Ud;return typeof document<"u"&&(u?Array.isArray(s)?h.ref=zle([h.ref,P4(n),...s]):h.ref=I4(h.ref,P4(n),s):I4(null,null)),u?(d!==void 0&&(h.className=O4(h.className,d)),f!==void 0&&(h.style=E_(h.style,f)),h):Ud}function $Pe(e,t,o,r){if(t){if(typeof t=="function")return t(o,r);let n=ck(o,t.props);return n.ref=o.ref,O2.cloneElement(t,n)}if(e&&typeof e=="string")return KPe(e,o);throw new Error(T4(8))}function KPe(e,t){return e==="button"?(0,A4.createElement)("button",{type:"button",...t,key:t.key}):e==="img"?(0,A4.createElement)("img",{alt:"",...t,key:t.key}):O2.createElement(e,t)}function A2(e){return Xle(e.defaultTagName??"div",e,e)}var Jle=l(R(),1);if(typeof document<"u"&&!document.head.querySelector("style[data-wp-hash='244b5c59c0']")){let e=document.createElement("style");e.setAttribute("data-wp-hash","244b5c59c0"),e.appendChild(document.createTextNode('@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._96e6251aad1a6136__badge{border-radius:var(--wpds-border-radius-lg,8px);font-family:var(--wpds-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-font-size-sm,12px);font-weight:var(--wpds-font-weight-regular,400);line-height:var(--wpds-font-line-height-xs,16px);padding-block:var(--wpds-dimension-padding-xs,4px);padding-inline:var(--wpds-dimension-padding-sm,8px)}._99f7158cb520f750__is-high-intent{background-color:var(--wpds-color-bg-surface-error,#f6e6e3);color:var(--wpds-color-fg-content-error,#470000)}.c20ebef2365bc8b7__is-medium-intent{background-color:var(--wpds-color-bg-surface-warning,#fde6bd);color:var(--wpds-color-fg-content-warning,#2e1900)}._365e1626c6202e52__is-low-intent{background-color:var(--wpds-color-bg-surface-caution,#fee994);color:var(--wpds-color-fg-content-caution,#281d00)}._33f8198127ddf4ef__is-stable-intent{background-color:var(--wpds-color-bg-surface-success,#c5f7cc);color:var(--wpds-color-fg-content-success,#002900)}._04c1aca8fc449412__is-informational-intent{background-color:var(--wpds-color-bg-surface-info,#deebfa);color:var(--wpds-color-fg-content-info,#001b4f)}._90726e69d495ec19__is-draft-intent{background-color:var(--wpds-color-bg-surface-neutral-weak,#f0f0f0);color:var(--wpds-color-fg-content-neutral,#1e1e1e)}._898f4a544993bd39__is-none-intent{background-color:var(--wpds-color-bg-surface-neutral,#f8f8f8);color:var(--wpds-color-fg-content-neutral-weak,#6d6d6d)}}')),document.head.appendChild(e)}var Qle={badge:"_96e6251aad1a6136__badge","is-high-intent":"_99f7158cb520f750__is-high-intent","is-medium-intent":"c20ebef2365bc8b7__is-medium-intent","is-low-intent":"_365e1626c6202e52__is-low-intent","is-stable-intent":"_33f8198127ddf4ef__is-stable-intent","is-informational-intent":"_04c1aca8fc449412__is-informational-intent","is-draft-intent":"_90726e69d495ec19__is-draft-intent","is-none-intent":"_898f4a544993bd39__is-none-intent"},L4=(0,Jle.forwardRef)(function({children:t,intent:o="none",render:r,className:n,...i},s){return A2({render:r,defaultTagName:"span",ref:s,props:ck(i,{className:V(Qle.badge,Qle[`is-${o}-intent`],n),children:t})})});var ece=l(R(),1);if(typeof document<"u"&&!document.head.querySelector("style[data-wp-hash='71d20935c2']")){let e=document.createElement("style");e.setAttribute("data-wp-hash","71d20935c2"),e.appendChild(document.createTextNode("@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._19ce0419607e1896__stack{display:flex}}")),document.head.appendChild(e)}var YPe={stack:"_19ce0419607e1896__stack"},qPe={xs:"var(--wpds-dimension-gap-xs, 4px)",sm:"var(--wpds-dimension-gap-sm, 8px)",md:"var(--wpds-dimension-gap-md, 12px)",lg:"var(--wpds-dimension-gap-lg, 16px)",xl:"var(--wpds-dimension-gap-xl, 24px)","2xl":"var(--wpds-dimension-gap-2xl, 32px)","3xl":"var(--wpds-dimension-gap-3xl, 40px)"},De=(0,ece.forwardRef)(function({direction:t,gap:o,align:r,justify:n,wrap:i,render:s,...a},c){let u={gap:o&&qPe[o],alignItems:r,justifyContent:n,flexDirection:t,flexWrap:i};return A2({render:s,ref:c,props:ck(a,{style:u,className:YPe.stack})})});var N4=l(N(),1);var Ut="isAny",Ht="isNone",Ir="isAll",Pr="isNotAll",tn="between",on="inThePast",Rn="over",Jt="is",eo="isNot",Hd="lessThan",Gd="greaterThan",Wd="lessThanOrEqual",$d="greaterThanOrEqual",Kd="before",Yd="after",qd="beforeInc",Zd="afterInc",Ja="contains",el="notContains",tl="startsWith",Xd="on",Qd="notOn";var Hht={asc:(0,N4.__)("Sort ascending"),desc:(0,N4.__)("Sort descending")};var tce=l(CO(),1),{lock:Wht,unlock:St}=(0,tce.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/dataviews");var P_=l(R(),1),ZPe=[];function On({elements:e,getElements:t}){let o=Array.isArray(e)&&e.length>0?e:ZPe,[r,n]=(0,P_.useState)(o),[i,s]=(0,P_.useState)(!1);return(0,P_.useEffect)(()=>{if(!t){n(o);return}let a=!1;return s(!0),t().then(c=>{if(!a){let u=Array.isArray(c)&&c.length>0?c:o;n(u)}}).catch(()=>{a||n(o)}).finally(()=>{a||s(!1)}),()=>{a=!0}},[t,o]),{elements:r,isLoading:i}}var XPe=Math.pow(10,8)*24*60*60*1e3,Yht=-XPe,L2=6048e5,oce=864e5;var QPe=3600;var rce=QPe*24,qht=rce*7,JPe=rce*365.2425,e2e=JPe/12,Zht=e2e*3,M4=Symbol.for("constructDateFrom");function $o(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&M4 in e?e[M4](t):e instanceof Date?new e.constructor(t):new Date(t)}function lt(e,t){return $o(t||e,e)}function N2(e,t,o){let r=lt(e,o?.in);return isNaN(t)?$o(o?.in||e,NaN):(t&&r.setDate(r.getDate()+t),r)}function M2(e,t,o){let r=lt(e,o?.in);if(isNaN(t))return $o(o?.in||e,NaN);if(!t)return r;let n=r.getDate(),i=$o(o?.in||e,r.getTime());i.setMonth(r.getMonth()+t+1,0);let s=i.getDate();return n>=s?i:(r.setFullYear(i.getFullYear(),i.getMonth(),n),r)}var t2e={};function Jd(){return t2e}function Ec(e,t){let o=Jd(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0,n=lt(e,t?.in),i=n.getDay(),s=(i=i.getTime()?r+1:o.getTime()>=a.getTime()?r:r-1}function D4(e){let t=lt(e),o=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return o.setUTCFullYear(t.getFullYear()),+e-+o}function nce(e,...t){let o=$o.bind(null,e||t.find(r=>typeof r=="object"));return t.map(o)}function V4(e,t){let o=lt(e,t?.in);return o.setHours(0,0,0,0),o}function ice(e,t,o){let[r,n]=nce(o?.in,e,t),i=V4(r),s=V4(n),a=+i-D4(i),c=+s-D4(s);return Math.round((a-c)/oce)}function sce(e,t){let o=D2(e,t),r=$o(t?.in||e,0);return r.setFullYear(o,0,4),r.setHours(0,0,0,0),mp(r)}function ace(e,t,o){return N2(e,t*7,o)}function lce(e,t,o){return M2(e,t*12,o)}function cce(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function uk(e){return!(!cce(e)&&typeof e!="number"||isNaN(+lt(e)))}function uce(e,t){let o=lt(e,t?.in);return o.setDate(1),o.setHours(0,0,0,0),o}function V2(e,t){let o=lt(e,t?.in);return o.setFullYear(o.getFullYear(),0,1),o.setHours(0,0,0,0),o}var o2e={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},dce=(e,t,o)=>{let r,n=o2e[e];return typeof n=="string"?r=n:t===1?r=n.one:r=n.other.replace("{{count}}",t.toString()),o?.addSuffix?o.comparison&&o.comparison>0?"in "+r:r+" ago":r};function F2(e){return(t={})=>{let o=t.width?String(t.width):e.defaultWidth;return e.formats[o]||e.formats[e.defaultWidth]}}var r2e={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},n2e={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},i2e={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},fce={date:F2({formats:r2e,defaultWidth:"full"}),time:F2({formats:n2e,defaultWidth:"full"}),dateTime:F2({formats:i2e,defaultWidth:"full"})};var s2e={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},mce=(e,t,o,r)=>s2e[e];function dk(e){return(t,o)=>{let r=o?.context?String(o.context):"standalone",n;if(r==="formatting"&&e.formattingValues){let s=e.defaultFormattingWidth||e.defaultWidth,a=o?.width?String(o.width):s;n=e.formattingValues[a]||e.formattingValues[s]}else{let s=e.defaultWidth,a=o?.width?String(o.width):e.defaultWidth;n=e.values[a]||e.values[s]}let i=e.argumentCallback?e.argumentCallback(t):t;return n[i]}}var a2e={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},l2e={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},c2e={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},u2e={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},d2e={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},f2e={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},m2e=(e,t)=>{let o=Number(e),r=o%100;if(r>20||r<10)switch(r%10){case 1:return o+"st";case 2:return o+"nd";case 3:return o+"rd"}return o+"th"},pce={ordinalNumber:m2e,era:dk({values:a2e,defaultWidth:"wide"}),quarter:dk({values:l2e,defaultWidth:"wide",argumentCallback:e=>e-1}),month:dk({values:c2e,defaultWidth:"wide"}),day:dk({values:u2e,defaultWidth:"wide"}),dayPeriod:dk({values:d2e,defaultWidth:"wide",formattingValues:f2e,defaultFormattingWidth:"wide"})};function fk(e){return(t,o={})=>{let r=o.width,n=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(n);if(!i)return null;let s=i[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(a)?h2e(a,f=>f.test(s)):p2e(a,f=>f.test(s)),u;u=e.valueCallback?e.valueCallback(c):c,u=o.valueCallback?o.valueCallback(u):u;let d=t.slice(s.length);return{value:u,rest:d}}}function p2e(e,t){for(let o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&t(e[o]))return o}function h2e(e,t){for(let o=0;o{let r=t.match(e.matchPattern);if(!r)return null;let n=r[0],i=t.match(e.parsePattern);if(!i)return null;let s=e.valueCallback?e.valueCallback(i[0]):i[0];s=o.valueCallback?o.valueCallback(s):s;let a=t.slice(n.length);return{value:s,rest:a}}}var g2e=/^(\d+)(th|st|nd|rd)?/i,b2e=/\d+/i,k2e={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},v2e={any:[/^b/i,/^(a|c)/i]},y2e={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},S2e={any:[/1/i,/2/i,/3/i,/4/i]},_2e={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},x2e={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},w2e={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},C2e={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},B2e={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},E2e={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},gce={ordinalNumber:hce({matchPattern:g2e,parsePattern:b2e,valueCallback:e=>parseInt(e,10)}),era:fk({matchPatterns:k2e,defaultMatchWidth:"wide",parsePatterns:v2e,defaultParseWidth:"any"}),quarter:fk({matchPatterns:y2e,defaultMatchWidth:"wide",parsePatterns:S2e,defaultParseWidth:"any",valueCallback:e=>e+1}),month:fk({matchPatterns:_2e,defaultMatchWidth:"wide",parsePatterns:x2e,defaultParseWidth:"any"}),day:fk({matchPatterns:w2e,defaultMatchWidth:"wide",parsePatterns:C2e,defaultParseWidth:"any"}),dayPeriod:fk({matchPatterns:B2e,defaultMatchWidth:"any",parsePatterns:E2e,defaultParseWidth:"any"})};var F4={code:"en-US",formatDistance:dce,formatLong:fce,formatRelative:mce,localize:pce,match:gce,options:{weekStartsOn:0,firstWeekContainsDate:1}};function bce(e,t){let o=lt(e,t?.in);return ice(o,V2(o))+1}function kce(e,t){let o=lt(e,t?.in),r=+mp(o)-+sce(o);return Math.round(r/L2)+1}function z2(e,t){let o=lt(e,t?.in),r=o.getFullYear(),n=Jd(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=$o(t?.in||e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);let a=Ec(s,t),c=$o(t?.in||e,0);c.setFullYear(r,0,i),c.setHours(0,0,0,0);let u=Ec(c,t);return+o>=+a?r+1:+o>=+u?r:r-1}function vce(e,t){let o=Jd(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,n=z2(e,t),i=$o(t?.in||e,0);return i.setFullYear(n,0,r),i.setHours(0,0,0,0),Ec(i,t)}function yce(e,t){let o=lt(e,t?.in),r=+Ec(o,t)-+vce(o,t);return Math.round(r/L2)+1}function $e(e,t){let o=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return o+r}var Tc={y(e,t){let o=e.getFullYear(),r=o>0?o:1-o;return $e(t==="yy"?r%100:r,t.length)},M(e,t){let o=e.getMonth();return t==="M"?String(o+1):$e(o+1,2)},d(e,t){return $e(e.getDate(),t.length)},a(e,t){let o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return o.toUpperCase();case"aaa":return o;case"aaaaa":return o[0];default:return o==="am"?"a.m.":"p.m."}},h(e,t){return $e(e.getHours()%12||12,t.length)},H(e,t){return $e(e.getHours(),t.length)},m(e,t){return $e(e.getMinutes(),t.length)},s(e,t){return $e(e.getSeconds(),t.length)},S(e,t){let o=t.length,r=e.getMilliseconds(),n=Math.trunc(r*Math.pow(10,o-3));return $e(n,t.length)}};var mk={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},z4={G:function(e,t,o){let r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return o.era(r,{width:"abbreviated"});case"GGGGG":return o.era(r,{width:"narrow"});default:return o.era(r,{width:"wide"})}},y:function(e,t,o){if(t==="yo"){let r=e.getFullYear(),n=r>0?r:1-r;return o.ordinalNumber(n,{unit:"year"})}return Tc.y(e,t)},Y:function(e,t,o,r){let n=z2(e,r),i=n>0?n:1-n;if(t==="YY"){let s=i%100;return $e(s,2)}return t==="Yo"?o.ordinalNumber(i,{unit:"year"}):$e(i,t.length)},R:function(e,t){let o=D2(e);return $e(o,t.length)},u:function(e,t){let o=e.getFullYear();return $e(o,t.length)},Q:function(e,t,o){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return $e(r,2);case"Qo":return o.ordinalNumber(r,{unit:"quarter"});case"QQQ":return o.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return o.quarter(r,{width:"narrow",context:"formatting"});default:return o.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,o){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return $e(r,2);case"qo":return o.ordinalNumber(r,{unit:"quarter"});case"qqq":return o.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return o.quarter(r,{width:"narrow",context:"standalone"});default:return o.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,o){let r=e.getMonth();switch(t){case"M":case"MM":return Tc.M(e,t);case"Mo":return o.ordinalNumber(r+1,{unit:"month"});case"MMM":return o.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return o.month(r,{width:"narrow",context:"formatting"});default:return o.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,o){let r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return $e(r+1,2);case"Lo":return o.ordinalNumber(r+1,{unit:"month"});case"LLL":return o.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return o.month(r,{width:"narrow",context:"standalone"});default:return o.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,o,r){let n=yce(e,r);return t==="wo"?o.ordinalNumber(n,{unit:"week"}):$e(n,t.length)},I:function(e,t,o){let r=kce(e);return t==="Io"?o.ordinalNumber(r,{unit:"week"}):$e(r,t.length)},d:function(e,t,o){return t==="do"?o.ordinalNumber(e.getDate(),{unit:"date"}):Tc.d(e,t)},D:function(e,t,o){let r=bce(e);return t==="Do"?o.ordinalNumber(r,{unit:"dayOfYear"}):$e(r,t.length)},E:function(e,t,o){let r=e.getDay();switch(t){case"E":case"EE":case"EEE":return o.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return o.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(r,{width:"short",context:"formatting"});default:return o.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,o,r){let n=e.getDay(),i=(n-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return $e(i,2);case"eo":return o.ordinalNumber(i,{unit:"day"});case"eee":return o.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return o.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(n,{width:"short",context:"formatting"});default:return o.day(n,{width:"wide",context:"formatting"})}},c:function(e,t,o,r){let n=e.getDay(),i=(n-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return $e(i,t.length);case"co":return o.ordinalNumber(i,{unit:"day"});case"ccc":return o.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return o.day(n,{width:"narrow",context:"standalone"});case"cccccc":return o.day(n,{width:"short",context:"standalone"});default:return o.day(n,{width:"wide",context:"standalone"})}},i:function(e,t,o){let r=e.getDay(),n=r===0?7:r;switch(t){case"i":return String(n);case"ii":return $e(n,t.length);case"io":return o.ordinalNumber(n,{unit:"day"});case"iii":return o.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return o.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return o.day(r,{width:"short",context:"formatting"});default:return o.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,o){let n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return o.dayPeriod(n,{width:"narrow",context:"formatting"});default:return o.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,o){let r=e.getHours(),n;switch(r===12?n=mk.noon:r===0?n=mk.midnight:n=r/12>=1?"pm":"am",t){case"b":case"bb":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return o.dayPeriod(n,{width:"narrow",context:"formatting"});default:return o.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(e,t,o){let r=e.getHours(),n;switch(r>=17?n=mk.evening:r>=12?n=mk.afternoon:r>=4?n=mk.morning:n=mk.night,t){case"B":case"BB":case"BBB":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return o.dayPeriod(n,{width:"narrow",context:"formatting"});default:return o.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(e,t,o){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),o.ordinalNumber(r,{unit:"hour"})}return Tc.h(e,t)},H:function(e,t,o){return t==="Ho"?o.ordinalNumber(e.getHours(),{unit:"hour"}):Tc.H(e,t)},K:function(e,t,o){let r=e.getHours()%12;return t==="Ko"?o.ordinalNumber(r,{unit:"hour"}):$e(r,t.length)},k:function(e,t,o){let r=e.getHours();return r===0&&(r=24),t==="ko"?o.ordinalNumber(r,{unit:"hour"}):$e(r,t.length)},m:function(e,t,o){return t==="mo"?o.ordinalNumber(e.getMinutes(),{unit:"minute"}):Tc.m(e,t)},s:function(e,t,o){return t==="so"?o.ordinalNumber(e.getSeconds(),{unit:"second"}):Tc.s(e,t)},S:function(e,t){return Tc.S(e,t)},X:function(e,t,o){let r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return _ce(r);case"XXXX":case"XX":return pp(r);default:return pp(r,":")}},x:function(e,t,o){let r=e.getTimezoneOffset();switch(t){case"x":return _ce(r);case"xxxx":case"xx":return pp(r);default:return pp(r,":")}},O:function(e,t,o){let r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Sce(r,":");default:return"GMT"+pp(r,":")}},z:function(e,t,o){let r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Sce(r,":");default:return"GMT"+pp(r,":")}},t:function(e,t,o){let r=Math.trunc(+e/1e3);return $e(r,t.length)},T:function(e,t,o){return $e(+e,t.length)}};function Sce(e,t=""){let o=e>0?"-":"+",r=Math.abs(e),n=Math.trunc(r/60),i=r%60;return i===0?o+String(n):o+String(n)+t+$e(i,2)}function _ce(e,t){return e%60===0?(e>0?"-":"+")+$e(Math.abs(e)/60,2):pp(e,t)}function pp(e,t=""){let o=e>0?"-":"+",r=Math.abs(e),n=$e(Math.trunc(r/60),2),i=$e(r%60,2);return o+n+t+i}var xce=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},wce=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},T2e=(e,t)=>{let o=e.match(/(P+)(p+)?/)||[],r=o[1],n=o[2];if(!n)return xce(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",xce(r,t)).replace("{{time}}",wce(n,t))},Cce={p:wce,P:T2e};var I2e=/^D+$/,P2e=/^Y+$/,R2e=["D","DD","YY","YYYY"];function Bce(e){return I2e.test(e)}function Ece(e){return P2e.test(e)}function Tce(e,t,o){let r=O2e(e,t,o);if(console.warn(r),R2e.includes(e))throw new RangeError(r)}function O2e(e,t,o){let r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${o}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var A2e=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,L2e=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,N2e=/^'([^]*?)'?$/,M2e=/''/g,D2e=/[a-zA-Z]/;function j4(e,t,o){let r=Jd(),n=o?.locale??r.locale??F4,i=o?.firstWeekContainsDate??o?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,s=o?.weekStartsOn??o?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=lt(e,o?.in);if(!uk(a))throw new RangeError("Invalid time value");let c=t.match(L2e).map(d=>{let f=d[0];if(f==="p"||f==="P"){let m=Cce[f];return m(d,n.formatLong)}return d}).join("").match(A2e).map(d=>{if(d==="''")return{isToken:!1,value:"'"};let f=d[0];if(f==="'")return{isToken:!1,value:V2e(d)};if(z4[f])return{isToken:!0,value:d};if(f.match(D2e))throw new RangeError("Format string contains an unescaped latin alphabet character `"+f+"`");return{isToken:!1,value:d}});n.localize.preprocessor&&(c=n.localize.preprocessor(a,c));let u={firstWeekContainsDate:i,weekStartsOn:s,locale:n};return c.map(d=>{if(!d.isToken)return d.value;let f=d.value;(!o?.useAdditionalWeekYearTokens&&Ece(f)||!o?.useAdditionalDayOfYearTokens&&Bce(f))&&Tce(f,t,String(e));let m=z4[f[0]];return m(a,f,n.localize,u)}).join("")}function V2e(e){let t=e.match(N2e);return t?t[1].replace(M2e,"'"):e}function hp(e,t,o){return N2(e,-t,o)}function j2(e,t,o){return M2(e,-t,o)}function Ice(e,t,o){return ace(e,-t,o)}function U2(e,t,o){return lce(e,-t,o)}var de=l(N(),1),lo=l(R(),1),rn=l(pc(),1);var U4=l(w(),1),wo={Name:(0,U4.jsx)("span",{className:"dataviews-filters__summary-filter-text-name"}),Value:(0,U4.jsx)("span",{className:"dataviews-filters__summary-filter-text-value"})};function Pce(e,t){switch(t){case"days":return hp(new Date,e);case"weeks":return Ice(new Date,e);case"months":return j2(new Date,e);case"years":return U2(new Date,e);default:return new Date}}var Rce={label:(0,de.__)("Is none of"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s is none of: %2$s"),e.name,t.map(o=>o.label).join(", ")),wo),filter:((e,t,o)=>{if(!o?.length)return!0;let r=t.getValue({item:e});return Array.isArray(r)?!o.some(n=>r.includes(n)):typeof r=="string"?!o.includes(r):!1}),selection:"multi"},Oce=[{name:Ut,label:(0,de.__)("Includes"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s includes: %2$s"),e.name,t.map(o=>o.label).join(", ")),wo),filter(e,t,o){if(!o?.length)return!0;let r=t.getValue({item:e});return Array.isArray(r)?o.some(n=>r.includes(n)):typeof r=="string"?o.includes(r):!1},selection:"multi"},{name:Ht,...Rce},{name:Ir,label:(0,de.__)("Includes all"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s includes all: %2$s"),e.name,t.map(o=>o.label).join(", ")),wo),filter(e,t,o){return o?.length?o.every(r=>t.getValue({item:e})?.includes(r)):!0},selection:"multi"},{name:Pr,...Rce},{name:tn,label:(0,de.__)("Between (inc)"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s between (inc): %2$s and %3$s"),e.name,t[0].label[0],t[0].label[1]),wo),filter(e,t,o){if(!Array.isArray(o)||o.length!==2||o[0]===void 0||o[1]===void 0)return!0;let r=t.getValue({item:e});return typeof r=="number"||r instanceof Date||typeof r=="string"?r>=o[0]&&r<=o[1]:!1},selection:"custom"},{name:on,label:(0,de.__)("In the past"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s is in the past: %2$s"),e.name,`${t[0].value.value} ${t[0].value.unit}`),wo),filter(e,t,o){if(o?.value===void 0||o?.unit===void 0)return!0;let r=Pce(o.value,o.unit),n=(0,rn.getDate)(t.getValue({item:e}));return n>=r&&n<=new Date},selection:"custom"},{name:Rn,label:(0,de.__)("Over"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s is over: %2$s"),e.name,`${t[0].value.value} ${t[0].value.unit}`),wo),filter(e,t,o){if(o?.value===void 0||o?.unit===void 0)return!0;let r=Pce(o.value,o.unit);return(0,rn.getDate)(t.getValue({item:e}))(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s is: %2$s"),e.name,t[0].label),wo),filter(e,t,o){return o===t.getValue({item:e})||o===void 0},selection:"single"},{name:eo,label:(0,de.__)("Is not"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s is not: %2$s"),e.name,t[0].label),wo),filter(e,t,o){return o!==t.getValue({item:e})},selection:"single"},{name:Hd,label:(0,de.__)("Less than"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s is less than: %2$s"),e.name,t[0].label),wo),filter(e,t,o){return o===void 0?!0:t.getValue({item:e})(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s is greater than: %2$s"),e.name,t[0].label),wo),filter(e,t,o){return o===void 0?!0:t.getValue({item:e})>o},selection:"single"},{name:Wd,label:(0,de.__)("Less than or equal"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s is less than or equal to: %2$s"),e.name,t[0].label),wo),filter(e,t,o){return o===void 0?!0:t.getValue({item:e})<=o},selection:"single"},{name:$d,label:(0,de.__)("Greater than or equal"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s is greater than or equal to: %2$s"),e.name,t[0].label),wo),filter(e,t,o){return o===void 0?!0:t.getValue({item:e})>=o},selection:"single"},{name:Kd,label:(0,de.__)("Before"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s is before: %2$s"),e.name,t[0].label),wo),filter(e,t,o){if(o===void 0)return!0;let r=(0,rn.getDate)(o);return(0,rn.getDate)(t.getValue({item:e}))(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s is after: %2$s"),e.name,t[0].label),wo),filter(e,t,o){if(o===void 0)return!0;let r=(0,rn.getDate)(o);return(0,rn.getDate)(t.getValue({item:e}))>r},selection:"single"},{name:qd,label:(0,de.__)("Before (inc)"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s is on or before: %2$s"),e.name,t[0].label),wo),filter(e,t,o){if(o===void 0)return!0;let r=(0,rn.getDate)(o);return(0,rn.getDate)(t.getValue({item:e}))<=r},selection:"single"},{name:Zd,label:(0,de.__)("After (inc)"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s is on or after: %2$s"),e.name,t[0].label),wo),filter(e,t,o){if(o===void 0)return!0;let r=(0,rn.getDate)(o);return(0,rn.getDate)(t.getValue({item:e}))>=r},selection:"single"},{name:Ja,label:(0,de.__)("Contains"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s contains: %2$s"),e.name,t[0].label),wo),filter(e,t,o){if(o===void 0)return!0;let r=t.getValue({item:e});return typeof r=="string"&&o&&r.toLowerCase().includes(String(o).toLowerCase())},selection:"single"},{name:el,label:(0,de.__)("Doesn't contain"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s doesn't contain: %2$s"),e.name,t[0].label),wo),filter(e,t,o){if(o===void 0)return!0;let r=t.getValue({item:e});return typeof r=="string"&&o&&!r.toLowerCase().includes(String(o).toLowerCase())},selection:"single"},{name:tl,label:(0,de.__)("Starts with"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s starts with: %2$s"),e.name,t[0].label),wo),filter(e,t,o){if(o===void 0)return!0;let r=t.getValue({item:e});return typeof r=="string"&&o&&r.toLowerCase().startsWith(String(o).toLowerCase())},selection:"single"},{name:Xd,label:(0,de.__)("On"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s is: %2$s"),e.name,t[0].label),wo),filter(e,t,o){if(o===void 0)return!0;let r=(0,rn.getDate)(o),n=(0,rn.getDate)(t.getValue({item:e}));return r.getTime()===n.getTime()},selection:"single"},{name:Qd,label:(0,de.__)("Not on"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s is not: %2$s"),e.name,t[0].label),wo),filter(e,t,o){if(o===void 0)return!0;let r=(0,rn.getDate)(o),n=(0,rn.getDate)(t.getValue({item:e}));return r.getTime()!==n.getTime()},selection:"single"}],Ace=e=>Oce.find(t=>t.name===e),Lce=()=>Oce.map(e=>e.name);var Nce=l(A(),1),Mce=l(R(),1);function pt(e,t){let o;return e?.required&&t?.required?o=t?.required?.message?t.required:void 0:e?.pattern&&t?.pattern?o=t.pattern:e?.min&&t?.min?o=t.min:e?.max&&t?.max?o=t.max:e?.minLength&&t?.minLength?o=t.minLength:e?.maxLength&&t?.maxLength?o=t.maxLength:e?.elements&&t?.elements?o=t.elements:t?.custom&&(o=t.custom),o}var Dce=l(w(),1),{ValidatedCheckboxControl:F2e}=St(Nce.privateApis);function Vce({field:e,onChange:t,data:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{getValue:s,setValue:a,label:c,description:u,isValid:d}=e,f=(0,Mce.useCallback)(()=>{t(a({item:o,value:!s({item:o})}))},[o,s,t,a]);return(0,Dce.jsx)(F2e,{required:!!e.isValid?.required,markWhenOptional:n,customValidity:pt(d,i),hidden:r,label:c,help:u,checked:s({item:o}),onChange:f})}var H2=l(A(),1),Fce=l(R(),1);var H4=l(w(),1),{ValidatedComboboxControl:z2e}=St(H2.privateApis);function G2({data:e,field:t,onChange:o,hideLabelFromVision:r,validity:n}){let{label:i,description:s,placeholder:a,getValue:c,setValue:u,isValid:d}=t,f=c({item:e})??"",m=(0,Fce.useCallback)(g=>o(u({item:e,value:g??""})),[e,o,u]),{elements:h,isLoading:p}=On({elements:t.elements,getElements:t.getElements});return p?(0,H4.jsx)(H2.Spinner,{}):(0,H4.jsx)(z2e,{required:!!t.isValid?.required,customValidity:pt(d,n),label:i,value:f,help:s,placeholder:a,options:h,onChange:m,hideLabelFromVision:r,allowReset:!0,expandOnFocus:!0})}var Y2=l(A(),1),cs=l(R(),1),K2=l(N(),1),hi=l(pc(),1);var hk=l(A(),1),G4=l(R(),1),ol=l(N(),1);var pk=l(w(),1),j2e={[on]:[{value:"days",label:(0,ol.__)("Days")},{value:"weeks",label:(0,ol.__)("Weeks")},{value:"months",label:(0,ol.__)("Months")},{value:"years",label:(0,ol.__)("Years")}],[Rn]:[{value:"days",label:(0,ol.__)("Days ago")},{value:"weeks",label:(0,ol.__)("Weeks ago")},{value:"months",label:(0,ol.__)("Months ago")},{value:"years",label:(0,ol.__)("Years ago")}]};function W2({className:e,data:t,field:o,onChange:r,hideLabelFromVision:n,operator:i}){let s=j2e[i===on?"inThePast":"over"],{id:a,label:c,getValue:u,setValue:d}=o,f=u({item:t}),{value:m="",unit:h=s[0].value}=f&&typeof f=="object"?f:{},p=(0,G4.useCallback)(b=>r(d({item:t,value:{value:Number(b),unit:h}})),[r,d,t,h]),g=(0,G4.useCallback)(b=>r(d({item:t,value:{value:m,unit:b}})),[r,d,t,m]);return(0,pk.jsx)(hk.BaseControl,{id:a,className:V(e,"dataviews-controls__relative-date"),label:c,hideLabelFromVision:n,children:(0,pk.jsxs)(De,{direction:"row",gap:"sm",children:[(0,pk.jsx)(hk.__experimentalNumberControl,{__next40pxDefaultSize:!0,className:"dataviews-controls__relative-date-number",spinControls:"none",min:1,step:1,value:m,onChange:p}),(0,pk.jsx)(hk.SelectControl,{className:"dataviews-controls__relative-date-unit",__next40pxDefaultSize:!0,label:(0,ol.__)("Unit"),value:h,options:s,onChange:g,hideLabelFromVision:!0})]})})}var zce=l(pc(),1);function $2(e){if(!e)return null;let t=(0,zce.getDate)(e);return t&&uk(t)?t:null}var ef=l(w(),1),{DateCalendar:U2e,ValidatedInputControl:H2e}=St(Y2.privateApis),G2e=e=>e?(0,hi.dateI18n)("Y-m-d\\TH:i",(0,hi.getDate)(e)):"";function W2e({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{id:s,label:a,description:c,setValue:u,getValue:d,isValid:f}=t,m=d({item:e}),h=typeof m=="string"?m:void 0,[p,g]=(0,cs.useState)(()=>$2(h)||new Date),b=(0,cs.useRef)(null),v=(0,cs.useRef)(void 0),k=(0,cs.useRef)(null),y=(0,cs.useCallback)(E=>o(u({item:e,value:E})),[e,o,u]);(0,cs.useEffect)(()=>()=>{v.current&&clearTimeout(v.current)},[]);let S=(0,cs.useCallback)(E=>{let L;if(E){let T=(0,hi.dateI18n)("Y-m-d",E),O;h?O=(0,hi.dateI18n)("H:i",(0,hi.getDate)(h)):O=(0,hi.dateI18n)("H:i",E),L=(0,hi.getDate)(`${T}T${O}`).toISOString(),y(L),v.current&&clearTimeout(v.current)}else y(void 0);k.current=b.current&&b.current.ownerDocument.activeElement,v.current=setTimeout(()=>{b.current&&(b.current.focus(),b.current.blur(),y(L),k.current&&k.current instanceof HTMLElement&&k.current.focus())},0)},[y,h]),x=(0,cs.useCallback)(E=>{if(E){let L=(0,hi.getDate)(E);y(L.toISOString());let T=$2(L.toISOString());T&&g(T)}else y(void 0)},[y]),{format:C}=t,B=C.weekStartsOn??(0,hi.getSettings)().l10n.startOfWeek,{timezone:{string:I}}=(0,hi.getSettings)(),P=a;return f?.required&&!n&&!r?P=`${a} (${(0,K2.__)("Required")})`:!f?.required&&n&&!r&&(P=`${a} (${(0,K2.__)("Optional")})`),(0,ef.jsx)(Y2.BaseControl,{id:s,label:P,help:c,hideLabelFromVision:r,children:(0,ef.jsxs)(De,{direction:"column",gap:"lg",children:[(0,ef.jsx)(U2e,{style:{width:"100%"},selected:h&&$2(h)||void 0,onSelect:S,month:p,onMonthChange:g,timeZone:I||void 0,weekStartsOn:B}),(0,ef.jsx)(H2e,{ref:b,__next40pxDefaultSize:!0,required:!!f?.required,customValidity:pt(f,i),type:"datetime-local",label:(0,K2.__)("Date time"),hideLabelFromVision:!0,value:G2e(h),onChange:x})]})})}function jce({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,operator:i,validity:s}){return i===on||i===Rn?(0,ef.jsx)(W2,{className:"dataviews-controls__datetime",data:e,field:t,onChange:o,hideLabelFromVision:r,operator:i}):(0,ef.jsx)(W2e,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:s})}var Or=l(A(),1),tt=l(R(),1),Ko=l(N(),1),Rr=l(pc(),1);var ht=l(w(),1),{DateCalendar:$2e,DateRangeCalendar:K2e}=St(Or.privateApis),Y2e=[{id:"today",label:(0,Ko.__)("Today"),getValue:()=>(0,Rr.getDate)(null)},{id:"yesterday",label:(0,Ko.__)("Yesterday"),getValue:()=>{let e=(0,Rr.getDate)(null);return hp(e,1)}},{id:"past-week",label:(0,Ko.__)("Past week"),getValue:()=>{let e=(0,Rr.getDate)(null);return hp(e,7)}},{id:"past-month",label:(0,Ko.__)("Past month"),getValue:()=>{let e=(0,Rr.getDate)(null);return j2(e,1)}}],q2e=[{id:"last-7-days",label:(0,Ko.__)("Last 7 days"),getValue:()=>{let e=(0,Rr.getDate)(null);return[hp(e,7),e]}},{id:"last-30-days",label:(0,Ko.__)("Last 30 days"),getValue:()=>{let e=(0,Rr.getDate)(null);return[hp(e,30),e]}},{id:"month-to-date",label:(0,Ko.__)("Month to date"),getValue:()=>{let e=(0,Rr.getDate)(null);return[uce(e),e]}},{id:"last-year",label:(0,Ko.__)("Last year"),getValue:()=>{let e=(0,Rr.getDate)(null);return[U2(e,1),e]}},{id:"year-to-date",label:(0,Ko.__)("Year to date"),getValue:()=>{let e=(0,Rr.getDate)(null);return[V2(e),e]}}],gk=e=>{if(!e)return null;let t=(0,Rr.getDate)(e);return t&&uk(t)?t:null},W4=e=>e?typeof e=="string"?e:j4(e,"yyyy-MM-dd"):"";function Uce({field:e,validity:t,inputRefs:o,isTouched:r,setIsTouched:n,children:i}){let{isValid:s}=e,[a,c]=(0,tt.useState)(void 0),u=(0,tt.useCallback)(()=>{let f=Array.isArray(o)?o:[o];for(let m of f){let h=m.current;if(h&&!h.validity.valid){c({type:"invalid",message:h.validationMessage});return}}c(void 0)},[o]);return(0,tt.useEffect)(()=>{let f=Array.isArray(o)?o:[o],m=t?pt(s,t):void 0;for(let h of f){let p=h.current;p&&p.setCustomValidity(m?.type==="invalid"&&m.message?m.message:"")}},[o,s,t]),(0,tt.useEffect)(()=>{let f=Array.isArray(o)?o:[o],m=h=>{h.preventDefault(),n(!0)};for(let h of f)h.current?.addEventListener("invalid",m);return()=>{for(let h of f)h.current?.removeEventListener("invalid",m)}},[o,n]),(0,tt.useEffect)(()=>{if(!r)return;let f=t?pt(s,t):void 0;f?c(f):u()},[r,s,t,u]),(0,ht.jsxs)("div",{onBlur:f=>{r||(!f.relatedTarget||!f.currentTarget.contains(f.relatedTarget))&&n(!0)},children:[i,(0,ht.jsx)("div",{"aria-live":"polite",children:a&&(0,ht.jsxs)("p",{className:V("components-validated-control__indicator",a.type==="invalid"?"is-invalid":void 0),children:[(0,ht.jsx)(Or.Icon,{className:"components-validated-control__indicator-icon",icon:Pf,size:16,fill:"currentColor"}),a.message]})})]})}function Z2e({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{id:s,label:a,setValue:c,getValue:u,isValid:d,format:f}=t,[m,h]=(0,tt.useState)(null),p=f.weekStartsOn??(0,Rr.getSettings)().l10n.startOfWeek,g=u({item:e}),b=typeof g=="string"?g:void 0,[v,k]=(0,tt.useState)(()=>gk(b)||new Date),[y,S]=(0,tt.useState)(!1),x=(0,tt.useRef)(null),C=(0,tt.useCallback)(T=>o(c({item:e,value:T})),[e,o,c]),B=(0,tt.useCallback)(T=>{let O=T?j4(T,"yyyy-MM-dd"):void 0;C(O),h(null),S(!0)},[C]),I=(0,tt.useCallback)(T=>{let O=T.getValue(),D=W4(O);k(O),C(D),h(T.id),S(!0)},[C]),P=(0,tt.useCallback)(T=>{if(C(T),T){let O=gk(T);O&&k(O)}h(null),S(!0)},[C]),{timezone:{string:E}}=(0,Rr.getSettings)(),L=a;return d?.required&&!n?L=`${a} (${(0,Ko.__)("Required")})`:!d?.required&&n&&(L=`${a} (${(0,Ko.__)("Optional")})`),(0,ht.jsx)(Uce,{field:t,validity:i,inputRefs:x,isTouched:y,setIsTouched:S,children:(0,ht.jsx)(Or.BaseControl,{id:s,className:"dataviews-controls__date",label:L,hideLabelFromVision:r,children:(0,ht.jsxs)(De,{direction:"column",gap:"lg",children:[(0,ht.jsxs)(De,{direction:"row",gap:"sm",wrap:"wrap",justify:"flex-start",children:[Y2e.map(T=>{let O=m===T.id;return(0,ht.jsx)(Or.Button,{className:"dataviews-controls__date-preset",variant:"tertiary",isPressed:O,size:"small",onClick:()=>I(T),children:T.label},T.id)}),(0,ht.jsx)(Or.Button,{className:"dataviews-controls__date-preset",variant:"tertiary",isPressed:!m,size:"small",disabled:!!m,accessibleWhenDisabled:!1,children:(0,Ko.__)("Custom")})]}),(0,ht.jsx)(Or.__experimentalInputControl,{__next40pxDefaultSize:!0,ref:x,type:"date",label:(0,Ko.__)("Date"),hideLabelFromVision:!0,value:b,onChange:P,required:!!t.isValid?.required}),(0,ht.jsx)($2e,{style:{width:"100%"},selected:b&&gk(b)||void 0,onSelect:B,month:v,onMonthChange:k,timeZone:E||void 0,weekStartsOn:p})]})})})}function X2e({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{id:s,label:a,getValue:c,setValue:u,format:d}=t,f,m=c({item:e});Array.isArray(m)&&m.length===2&&m.every(D=>typeof D=="string")&&(f=m);let h=d.weekStartsOn??(0,Rr.getSettings)().l10n.startOfWeek,p=(0,tt.useCallback)(D=>{o(u({item:e,value:D}))},[e,o,u]),[g,b]=(0,tt.useState)(null),v=(0,tt.useMemo)(()=>{if(!f)return{from:void 0,to:void 0};let[D,U]=f;return{from:gk(D)||void 0,to:gk(U)||void 0}},[f]),[k,y]=(0,tt.useState)(()=>v.from||new Date),[S,x]=(0,tt.useState)(!1),C=(0,tt.useRef)(null),B=(0,tt.useRef)(null),I=(0,tt.useCallback)((D,U)=>{D&&U?p([W4(D),W4(U)]):!D&&!U&&p(void 0)},[p]),P=(0,tt.useCallback)(D=>{I(D?.from,D?.to),b(null),x(!0)},[I]),E=(0,tt.useCallback)(D=>{let[U,G]=D.getValue();y(U),I(U,G),b(D.id),x(!0)},[I]),L=(0,tt.useCallback)((D,U)=>{let[G,j]=f||[void 0,void 0];if(I(D==="from"?U:G,D==="to"?U:j),U){let ee=gk(U);ee&&y(ee)}b(null),x(!0)},[f,I]),{timezone:T}=(0,Rr.getSettings)(),O=a;return t.isValid?.required&&!n?O=`${a} (${(0,Ko.__)("Required")})`:!t.isValid?.required&&n&&(O=`${a} (${(0,Ko.__)("Optional")})`),(0,ht.jsx)(Uce,{field:t,validity:i,inputRefs:[C,B],isTouched:S,setIsTouched:x,children:(0,ht.jsx)(Or.BaseControl,{id:s,className:"dataviews-controls__date",label:O,hideLabelFromVision:r,children:(0,ht.jsxs)(De,{direction:"column",gap:"lg",children:[(0,ht.jsxs)(De,{direction:"row",gap:"sm",wrap:"wrap",justify:"flex-start",children:[q2e.map(D=>{let U=g===D.id;return(0,ht.jsx)(Or.Button,{className:"dataviews-controls__date-preset",variant:"tertiary",isPressed:U,size:"small",onClick:()=>E(D),children:D.label},D.id)}),(0,ht.jsx)(Or.Button,{className:"dataviews-controls__date-preset",variant:"tertiary",isPressed:!g,size:"small",accessibleWhenDisabled:!1,disabled:!!g,children:(0,Ko.__)("Custom")})]}),(0,ht.jsxs)(De,{direction:"row",gap:"sm",justify:"space-between",className:"dataviews-controls__date-range-inputs",children:[(0,ht.jsx)(Or.__experimentalInputControl,{__next40pxDefaultSize:!0,ref:C,type:"date",label:(0,Ko.__)("From"),hideLabelFromVision:!0,value:f?.[0],onChange:D=>L("from",D),required:!!t.isValid?.required}),(0,ht.jsx)(Or.__experimentalInputControl,{__next40pxDefaultSize:!0,ref:B,type:"date",label:(0,Ko.__)("To"),hideLabelFromVision:!0,value:f?.[1],onChange:D=>L("to",D),required:!!t.isValid?.required})]}),(0,ht.jsx)(K2e,{style:{width:"100%"},selected:v,onSelect:P,month:k,onMonthChange:y,timeZone:T.string||void 0,weekStartsOn:h})]})})})}function Hce({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,operator:i,validity:s}){return i===on||i===Rn?(0,ht.jsx)(W2,{className:"dataviews-controls__date",data:e,field:t,onChange:o,hideLabelFromVision:r,operator:i}):i===tn?(0,ht.jsx)(X2e,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:s}):(0,ht.jsx)(Z2e,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:s})}var q2=l(A(),1),Gce=l(R(),1);var $4=l(w(),1),{ValidatedSelectControl:Q2e}=St(q2.privateApis);function Z2({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{type:s,label:a,description:c,getValue:u,setValue:d,isValid:f}=t,m=s==="array",h=u({item:e})??(m?[]:""),p=(0,Gce.useCallback)(v=>o(d({item:e,value:v})),[e,o,d]),{elements:g,isLoading:b}=On({elements:t.elements,getElements:t.getElements});return b?(0,$4.jsx)(q2.Spinner,{}):(0,$4.jsx)(Q2e,{required:!!t.isValid?.required,markWhenOptional:n,customValidity:pt(f,i),label:a,value:h,help:c,options:g,onChange:p,__next40pxDefaultSize:!0,hideLabelFromVision:r,multiple:m})}var K4=l(w(),1),J2e=10;function Wce(e){let{field:t}=e,{elements:o}=On({elements:t.elements,getElements:t.getElements});return o.length>=J2e?(0,K4.jsx)(G2,{...e}):(0,K4.jsx)(Z2,{...e})}var Q2=l(A(),1);var $ce=l(A(),1),Kce=l(R(),1);var Yce=l(w(),1),{ValidatedInputControl:eRe}=St($ce.privateApis);function rl({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,type:i,prefix:s,suffix:a,validity:c}){let{label:u,placeholder:d,description:f,getValue:m,setValue:h,isValid:p}=t,g=m({item:e}),b=(0,Kce.useCallback)(v=>o(h({item:e,value:v})),[e,h,o]);return(0,Yce.jsx)(eRe,{required:!!p.required,markWhenOptional:n,customValidity:pt(p,c),label:u,placeholder:d,value:g??"",help:f,onChange:b,hideLabelFromVision:r,type:i,prefix:s,suffix:a,pattern:p.pattern?p.pattern.constraint:void 0,minLength:p.minLength?p.minLength.constraint:void 0,maxLength:p.maxLength?p.maxLength.constraint:void 0,__next40pxDefaultSize:!0})}var X2=l(w(),1);function qce({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){return(0,X2.jsx)(rl,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i,type:"email",prefix:(0,X2.jsx)(Q2.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,X2.jsx)(Q2.Icon,{icon:gA})})})}var eR=l(A(),1);var J2=l(w(),1);function Zce({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){return(0,J2.jsx)(rl,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i,type:"tel",prefix:(0,J2.jsx)(eR.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,J2.jsx)(eR.Icon,{icon:cv})})})}var oR=l(A(),1);var tR=l(w(),1);function Xce({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){return(0,tR.jsx)(rl,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i,type:"url",prefix:(0,tR.jsx)(oR.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,tR.jsx)(oR.Icon,{icon:fn})})})}var Ic=l(A(),1),R_=l(R(),1),rR=l(N(),1);var tf=l(w(),1),{ValidatedNumberControl:tRe}=St(Ic.privateApis);function Qce(e){if(e===""||e===void 0)return"";let t=Number(e);return Number.isFinite(t)?t:""}function oRe({value:e,onChange:t,hideLabelFromVision:o,step:r}){let[n="",i=""]=e,s=(0,R_.useCallback)(c=>t([Qce(c),i]),[t,i]),a=(0,R_.useCallback)(c=>t([n,Qce(c)]),[t,n]);return(0,tf.jsx)(Ic.BaseControl,{help:(0,rR.__)("The max. value must be greater than the min. value."),children:(0,tf.jsxs)(Ic.Flex,{direction:"row",gap:4,children:[(0,tf.jsx)(Ic.__experimentalNumberControl,{label:(0,rR.__)("Min."),value:n,max:i?Number(i)-r:void 0,onChange:s,__next40pxDefaultSize:!0,hideLabelFromVision:o,step:r}),(0,tf.jsx)(Ic.__experimentalNumberControl,{label:(0,rR.__)("Max."),value:i,min:n?Number(n)+r:void 0,onChange:a,__next40pxDefaultSize:!0,hideLabelFromVision:o,step:r})]})})}function nR({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,operator:i,validity:s}){let a=t.format?.decimals??0,c=Math.pow(10,Math.abs(a)*-1),{label:u,description:d,getValue:f,setValue:m,isValid:h}=t,p=f({item:e})??"",g=(0,R_.useCallback)(v=>{o(m({item:e,value:["",void 0].includes(v)?void 0:Number(v)}))},[e,o,m]),b=(0,R_.useCallback)(v=>{o(m({item:e,value:v}))},[e,o,m]);if(i===tn){let v=["",""];return Array.isArray(p)&&p.length===2&&p.every(k=>typeof k=="number"||k==="")&&(v=p),(0,tf.jsx)(oRe,{value:v,onChange:b,hideLabelFromVision:r,step:c})}return(0,tf.jsx)(tRe,{required:!!h.required,markWhenOptional:n,customValidity:pt(h,s),label:u,help:d,value:p,onChange:g,__next40pxDefaultSize:!0,hideLabelFromVision:r,step:c,min:h.min?h.min.constraint:void 0,max:h.max?h.max.constraint:void 0})}var Jce=l(w(),1);function eue(e){return(0,Jce.jsx)(nR,{...e})}var tue=l(w(),1);function oue(e){return(0,tue.jsx)(nR,{...e})}var iR=l(A(),1),rue=l(R(),1);var Y4=l(w(),1),{ValidatedRadioControl:rRe}=St(iR.privateApis);function nue({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{label:s,description:a,getValue:c,setValue:u,isValid:d}=t,{elements:f,isLoading:m}=On({elements:t.elements,getElements:t.getElements}),h=c({item:e}),p=(0,rue.useCallback)(g=>o(u({item:e,value:g})),[e,o,u]);return m?(0,Y4.jsx)(iR.Spinner,{}):(0,Y4.jsx)(rRe,{required:!!t.isValid?.required,markWhenOptional:n,customValidity:pt(d,i),label:s,help:a,onChange:p,options:f,selected:h,hideLabelFromVision:r})}var q4=l(R(),1);var iue=l(w(),1);function sue({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,config:i,validity:s}){let{prefix:a,suffix:c}=i||{};return(0,iue.jsx)(rl,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:s,prefix:a?(0,q4.createElement)(a):void 0,suffix:c?(0,q4.createElement)(c):void 0})}var aue=l(A(),1),lue=l(R(),1);var cue=l(w(),1),{ValidatedToggleControl:nRe}=St(aue.privateApis);function uue({field:e,onChange:t,data:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{label:s,description:a,getValue:c,setValue:u,isValid:d}=e,f=(0,lue.useCallback)(()=>{t(u({item:o,value:!c({item:o})}))},[t,u,o,c]);return(0,cue.jsx)(nRe,{required:!!d.required,markWhenOptional:n,customValidity:pt(d,i),hidden:r,label:s,help:a,checked:c({item:o}),onChange:f})}var due=l(A(),1),fue=l(R(),1);var mue=l(w(),1),{ValidatedTextareaControl:iRe}=St(due.privateApis);function pue({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,config:i,validity:s}){let{rows:a=4}=i||{},{label:c,placeholder:u,description:d,setValue:f,isValid:m}=t,h=t.getValue({item:e}),p=(0,fue.useCallback)(g=>o(f({item:e,value:g})),[e,o,f]);return(0,mue.jsx)(iRe,{required:!!m.required,markWhenOptional:n,customValidity:pt(m,s),label:c,placeholder:u,value:h??"",help:d,onChange:p,rows:a,minLength:m.minLength?m.minLength.constraint:void 0,maxLength:m.maxLength?m.maxLength.constraint:void 0,__next40pxDefaultSize:!0,hideLabelFromVision:r})}var bk=l(A(),1),hue=l(R(),1);var sR=l(w(),1),{ValidatedToggleGroupControl:sRe}=St(bk.privateApis);function gue({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{getValue:s,setValue:a,isValid:c}=t,u=s({item:e}),d=(0,hue.useCallback)(p=>o(a({item:e,value:p})),[e,o,a]),{elements:f,isLoading:m}=On({elements:t.elements,getElements:t.getElements});if(m)return(0,sR.jsx)(bk.Spinner,{});if(f.length===0)return null;let h=f.find(p=>p.value===u);return(0,sR.jsx)(sRe,{required:!!t.isValid?.required,markWhenOptional:n,customValidity:pt(c,i),__next40pxDefaultSize:!0,isBlock:!0,label:t.label,help:h?.description||t.description,onChange:d,value:u,hideLabelFromVision:r,children:f.map(p=>(0,sR.jsx)(bk.__experimentalToggleGroupControlOption,{label:p.label,value:p.value},p.value))})}var aR=l(A(),1),lR=l(R(),1);var O_=l(w(),1),{ValidatedFormTokenField:aRe}=St(aR.privateApis);function bue({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{label:s,placeholder:a,getValue:c,setValue:u,isValid:d}=t,f=c({item:e}),{elements:m,isLoading:h}=On({elements:t.elements,getElements:t.getElements}),p=(0,lR.useMemo)(()=>Array.isArray(f)?f.map(b=>m?.find(k=>k.value===b)||{value:b,label:b}):[],[f,m]),g=(0,lR.useCallback)(b=>{let v=b.map(k=>typeof k=="object"&&"value"in k?k.value:k);o(u({item:e,value:v}))},[o,u,e]);return h?(0,O_.jsx)(aR.Spinner,{}):(0,O_.jsx)(aRe,{required:!!d?.required,markWhenOptional:n,customValidity:pt(d,i),label:r?void 0:s,value:p,onChange:g,placeholder:a,suggestions:m?.map(b=>b.value),__experimentalValidateInput:b=>t.isValid?.elements&&m?m.some(v=>v.value===b||v.label===b):!0,__experimentalExpandOnFocus:m&&m.length>0,__experimentalShowHowTo:!t.isValid?.elements,displayTransform:b=>typeof b=="object"&&"label"in b?b.label:typeof b=="string"&&m&&m.find(k=>k.value===b)?.label||b,__experimentalRenderItem:({item:b})=>{if(typeof b=="string"&&m){let v=m.find(k=>k.value===b);return(0,O_.jsx)("span",{children:v?.label||b})}return(0,O_.jsx)("span",{children:b})}})}var An=l(A(),1),Z4=l(R(),1),kue=l(N(),1);var Pc=l(w(),1),{ValidatedInputControl:lRe}=St(An.privateApis),cRe=({color:e,onColorChange:t})=>{let o=e&&Bt(e).isValid()?e:"#ffffff";return(0,Pc.jsx)(An.Dropdown,{className:"dataviews-controls__color-picker-dropdown",popoverProps:{resize:!1},renderToggle:({onToggle:r})=>(0,Pc.jsx)(An.Button,{onClick:r,"aria-label":(0,kue.__)("Open color picker"),size:"small",icon:()=>(0,Pc.jsx)(An.ColorIndicator,{colorValue:o})}),renderContent:()=>(0,Pc.jsx)(An.__experimentalDropdownContentWrapper,{paddingSize:"none",children:(0,Pc.jsx)(An.ColorPicker,{color:o,onChange:t,enableAlpha:!0})})})};function vue({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{label:s,placeholder:a,description:c,setValue:u,isValid:d}=t,f=t.getValue({item:e})||"",m=(0,Z4.useCallback)(p=>{o(u({item:e,value:p}))},[e,o,u]),h=(0,Z4.useCallback)(p=>{o(u({item:e,value:p||""}))},[e,o,u]);return(0,Pc.jsx)(lRe,{required:!!t.isValid?.required,markWhenOptional:n,customValidity:pt(d,i),label:s,placeholder:a,value:f,help:c,onChange:h,hideLabelFromVision:r,type:"text",prefix:(0,Pc.jsx)(An.__experimentalInputControlPrefixWrapper,{variant:"control",children:(0,Pc.jsx)(cRe,{color:f,onColorChange:m})})})}var uR=l(A(),1),dR=l(R(),1),X4=l(N(),1);var cR=l(w(),1);function yue({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let[s,a]=(0,dR.useState)(!1),c=(0,dR.useCallback)(()=>{a(u=>!u)},[]);return(0,cR.jsx)(rl,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i,type:s?"text":"password",suffix:(0,cR.jsx)(uR.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,cR.jsx)(uR.Button,{icon:s?vs:Af,onClick:c,size:"small",label:s?(0,X4.__)("Hide password"):(0,X4.__)("Show password")})})})}function fR(e){return Array.isArray(e.elements)&&e.elements.length>0||typeof e.getElements=="function"}var _ue=l(w(),1),Sue={adaptiveSelect:Wce,array:bue,checkbox:Vce,color:vue,combobox:G2,datetime:jce,date:Hce,email:qce,telephone:Zce,url:Xce,integer:eue,number:oue,password:yue,radio:nue,select:Z2,text:sue,toggle:uue,textarea:pue,toggleGroup:gue};function uRe(e){return e&&typeof e=="object"&&typeof e.control=="string"}function dRe(e){let{control:t,...o}=e,r=mR(t);return r===null?null:function(i){return(0,_ue.jsx)(r,{...i,config:o})}}function xue(e,t){return typeof e.Edit=="function"?e.Edit:typeof e.Edit=="string"?mR(e.Edit):uRe(e.Edit)?dRe(e.Edit):fR(e)&&e.type!=="array"?mR("adaptiveSelect"):t===null?null:mR(t)}function mR(e){return Object.keys(Sue).includes(e)?Sue[e]:null}function fRe(e,t,o){if(e.filterBy===!1)return!1;let r=e.filterBy?.operators?.filter(n=>o.includes(n))??t;return r.length===0?!1:{isPrimary:!!e.filterBy?.isPrimary,operators:r}}var wue=fRe;var mRe=e=>({item:t})=>{let o=e.split("."),r=t;for(let n of o)r.hasOwnProperty(n)?r=r[n]:r=void 0;return r},Cue=mRe;var pRe=e=>({value:t})=>{let o=e.split("."),r={},n=r;for(let i of o.slice(0,-1))n[i]={},n=n[i];return n[o.at(-1)]=t,r},Bue=pRe;var Tue=l(N(),1);function pR({item:e,field:t}){let{elements:o,isLoading:r}=On({elements:t.elements,getElements:t.getElements}),n=t.getValue({item:e});return r||o.length===0?n:o?.find(i=>i.value===n)?.label||t.getValue({item:e})}var Eue=l(w(),1);function co({item:e,field:t}){return t.hasElements?(0,Eue.jsx)(pR,{item:e,field:t}):t.getValueFormatted({item:e,field:t})}var nl=(e,t,o)=>o==="asc"?e.localeCompare(t):t.localeCompare(e);function uo(e,t){let o=t.getValue({item:e});return![void 0,"",null].includes(o)}function il(e,t){if(typeof t.isValid.minLength?.constraint!="number")return!1;let o=t.getValue({item:e});return[void 0,"",null].includes(o)?!0:String(o).length>=t.isValid.minLength.constraint}function sl(e,t){if(typeof t.isValid.maxLength?.constraint!="number")return!1;let o=t.getValue({item:e});return[void 0,"",null].includes(o)?!0:String(o).length<=t.isValid.maxLength.constraint}function al(e,t){if(t.isValid.pattern?.constraint===void 0)return!0;try{let o=new RegExp(t.isValid.pattern.constraint),r=t.getValue({item:e});return[void 0,"",null].includes(r)?!0:o.test(String(r))}catch{return!1}}function _t(e,t){let r=(t.elements??[]).map(i=>i.value);if(r.length===0)return!0;let n=t.getValue({item:e});return[].concat(n).every(i=>r.includes(i))}function hRe({item:e,field:t}){return t.getValue({item:e})}var nn=hRe;var gRe=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;function bRe(e,t){let o=t.getValue({item:e});return![void 0,"",null].includes(o)&&!gRe.test(o)?(0,Tue.__)("Value must be a valid email address."):null}var Iue={type:"email",render:co,Edit:"email",sort:nl,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[Ut,Ht],validOperators:[Jt,eo,Ja,el,tl,Ut,Ht,Ir,Pr],format:{},getValueFormatted:nn,validate:{required:uo,pattern:al,minLength:il,maxLength:sl,elements:_t,custom:bRe}};var Pue=l(N(),1);var kk=(e,t,o)=>o==="asc"?e-t:t-e;function hR(e,t){if(typeof t.isValid.min?.constraint!="number")return!1;let o=t.getValue({item:e});return[void 0,"",null].includes(o)?!0:Number(o)>=t.isValid.min.constraint}function gR(e,t){if(typeof t.isValid.max?.constraint!="number")return!1;let o=t.getValue({item:e});return[void 0,"",null].includes(o)?!0:Number(o)<=t.isValid.max.constraint}var Rue={separatorThousand:","};function kRe({item:e,field:t}){let o=t.getValue({item:e});if(o==null)return"";if(o=Number(o),!Number.isFinite(o))return String(o);let r;t.type!=="integer"?r=Rue:r=t.format;let{separatorThousand:n}=r,i=Math.trunc(o);return n?String(i).replace(/\B(?=(\d{3})+(?!\d))/g,n):String(i)}function vRe(e,t){let o=t.getValue({item:e});return![void 0,"",null].includes(o)&&!Number.isInteger(o)?(0,Pue.__)("Value must be an integer."):null}var Oue={type:"integer",render:co,Edit:"integer",sort:kk,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[Jt,eo,Hd,Gd,Wd,$d,tn],validOperators:[Jt,eo,Hd,Gd,Wd,$d,tn,Ut,Ht,Ir,Pr],format:Rue,getValueFormatted:kRe,validate:{required:uo,min:hR,max:gR,elements:_t,custom:vRe}};var Aue=l(N(),1);var Lue={separatorThousand:",",separatorDecimal:".",decimals:2};function yRe({item:e,field:t}){let o=t.getValue({item:e});if(o==null)return"";if(o=Number(o),!Number.isFinite(o))return String(o);let r;t.type!=="number"?r=Lue:r=t.format;let{separatorThousand:n,separatorDecimal:i,decimals:s}=r,a=o.toFixed(s),[c,u]=a.split("."),d=n?c.replace(/\B(?=(\d{3})+(?!\d))/g,n):c;return s===0?d:d+i+u}function SRe(e){return e===""||e===void 0||e===null}function _Re(e,t){let o=t.getValue({item:e});return!SRe(o)&&!Number.isFinite(o)?(0,Aue.__)("Value must be a number."):null}var Nue={type:"number",render:co,Edit:"number",sort:kk,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[Jt,eo,Hd,Gd,Wd,$d,tn],validOperators:[Jt,eo,Hd,Gd,Wd,$d,tn,Ut,Ht,Ir,Pr],format:Lue,getValueFormatted:yRe,validate:{required:uo,min:hR,max:gR,elements:_t,custom:_Re}};var Mue={type:"text",render:co,Edit:"text",sort:nl,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[Ut,Ht],validOperators:[Jt,eo,Ja,el,tl,Ut,Ht,Ir,Pr],format:{},getValueFormatted:nn,validate:{required:uo,pattern:al,minLength:il,maxLength:sl,elements:_t}};var gp=l(pc(),1);var Due={datetime:(0,gp.getSettings)().formats.datetime,weekStartsOn:(0,gp.getSettings)().l10n.startOfWeek};function xRe({item:e,field:t}){let o=t.getValue({item:e});if(["",void 0,null].includes(o))return"";let r;return t.type!=="datetime"?r=Due:r=t.format,(0,gp.dateI18n)(r.datetime,(0,gp.getDate)(o))}var wRe=(e,t,o)=>{let r=new Date(e).getTime(),n=new Date(t).getTime();return o==="asc"?r-n:n-r},Vue={type:"datetime",render:co,Edit:"datetime",sort:wRe,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[Xd,Qd,Kd,Yd,qd,Zd,on,Rn],validOperators:[Xd,Qd,Kd,Yd,qd,Zd,on,Rn],format:Due,getValueFormatted:xRe,validate:{required:uo,elements:_t}};var bp=l(pc(),1);var Fue={date:(0,bp.getSettings)().formats.date,weekStartsOn:(0,bp.getSettings)().l10n.startOfWeek};function CRe({item:e,field:t}){let o=t.getValue({item:e});if(["",void 0,null].includes(o))return"";let r;return t.type!=="date"?r=Fue:r=t.format,(0,bp.dateI18n)(r.date,(0,bp.getDate)(o))}var BRe=(e,t,o)=>{let r=new Date(e).getTime(),n=new Date(t).getTime();return o==="asc"?r-n:n-r},zue={type:"date",render:co,Edit:"date",sort:BRe,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[Xd,Qd,Kd,Yd,qd,Zd,on,Rn,tn],validOperators:[Xd,Qd,Kd,Yd,qd,Zd,on,Rn,tn],format:Fue,getValueFormatted:CRe,validate:{required:uo,elements:_t}};var bR=l(N(),1);function jue(e,t){return t.getValue({item:e})===!0}function ERe({item:e,field:t}){let o=t.getValue({item:e});return o===!0?(0,bR.__)("True"):o===!1?(0,bR.__)("False"):""}function TRe(e,t){let o=t.getValue({item:e});return![void 0,"",null].includes(o)&&![!0,!1].includes(o)?(0,bR.__)("Value must be true, false, or undefined"):null}var IRe=(e,t,o)=>{let r=!!e;return r===!!t?0:o==="asc"?r?1:-1:r?-1:1},Uue={type:"boolean",render:co,Edit:"checkbox",sort:IRe,validate:{required:jue,elements:_t,custom:TRe},enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[Jt,eo],validOperators:[Jt,eo],format:{},getValueFormatted:ERe};var Hue={type:"media",render:()=>null,Edit:null,sort:()=>0,enableSorting:!1,enableGlobalSearch:!1,defaultOperators:[],validOperators:[],format:{},getValueFormatted:nn,validate:{}};var Q4=l(N(),1);function Gue(e,t){let o=t.getValue({item:e});return Array.isArray(o)&&o.length>0&&o.every(r=>![void 0,"",null].includes(r))}function Wue({item:e,field:t}){let o=t.getValue({item:e});return(Array.isArray(o)?o:[]).join(", ")}function PRe({item:e,field:t}){return Wue({item:e,field:t})}function RRe(e,t){let o=t.getValue({item:e});return![void 0,"",null].includes(o)&&!Array.isArray(o)?(0,Q4.__)("Value must be an array."):o.every(r=>typeof r=="string")?null:(0,Q4.__)("Every value must be a string.")}var ORe=(e,t,o)=>{let r=Array.isArray(e)?e:[],n=Array.isArray(t)?t:[];if(r.length!==n.length)return o==="asc"?r.length-n.length:n.length-r.length;let i=r.join(","),s=n.join(",");return o==="asc"?i.localeCompare(s):s.localeCompare(i)},$ue={type:"array",render:PRe,Edit:"array",sort:ORe,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[Ut,Ht],validOperators:[Ut,Ht,Ir,Pr],format:{},getValueFormatted:Wue,validate:{required:Gue,elements:_t,custom:RRe}};function ARe({item:e,field:t}){return t.getValue({item:e})?"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022":""}var Kue={type:"password",render:co,Edit:"password",sort:()=>0,enableSorting:!1,enableGlobalSearch:!1,defaultOperators:[],validOperators:[],format:{},getValueFormatted:ARe,validate:{required:uo,pattern:al,minLength:il,maxLength:sl,elements:_t}};var Yue={type:"telephone",render:co,Edit:"telephone",sort:nl,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[Ut,Ht],validOperators:[Jt,eo,Ja,el,tl,Ut,Ht,Ir,Pr],format:{},getValueFormatted:nn,validate:{required:uo,pattern:al,minLength:il,maxLength:sl,elements:_t}};var que=l(N(),1);var vk=l(w(),1);function LRe({item:e,field:t}){if(t.hasElements)return(0,vk.jsx)(pR,{item:e,field:t});let o=nn({item:e,field:t});return!o||!Bt(o).isValid()?o:(0,vk.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,vk.jsx)("div",{style:{width:"16px",height:"16px",borderRadius:"50%",backgroundColor:o,border:"1px solid #ddd",flexShrink:0}}),(0,vk.jsx)("span",{children:o})]})}function NRe(e,t){let o=t.getValue({item:e});return![void 0,"",null].includes(o)&&!Bt(o).isValid()?(0,que.__)("Value must be a valid color."):null}var MRe=(e,t,o)=>{let r=Bt(e),n=Bt(t);if(!r.isValid()&&!n.isValid())return 0;if(!r.isValid())return o==="asc"?1:-1;if(!n.isValid())return o==="asc"?-1:1;let i=r.toHsl(),s=n.toHsl();return i.h!==s.h?o==="asc"?i.h-s.h:s.h-i.h:i.s!==s.s?o==="asc"?i.s-s.s:s.s-i.s:o==="asc"?i.l-s.l:s.l-i.l},Zue={type:"color",render:LRe,Edit:"color",sort:MRe,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[Ut,Ht],validOperators:[Jt,eo,Ut,Ht],format:{},getValueFormatted:nn,validate:{required:uo,elements:_t,custom:NRe}};var Xue={type:"url",render:co,Edit:"url",sort:nl,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[Ut,Ht],validOperators:[Jt,eo,Ja,el,tl,Ut,Ht,Ir,Pr],format:{},getValueFormatted:nn,validate:{required:uo,pattern:al,minLength:il,maxLength:sl,elements:_t}};var DRe=(e,t,o)=>typeof e=="number"&&typeof t=="number"?kk(e,t,o):nl(e,t,o),Que={render:co,Edit:null,sort:DRe,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[Jt,eo],validOperators:Lce(),format:{},getValueFormatted:nn,validate:{required:uo,elements:_t}};function Jue(e,t){let o;e.isValid?.required===!0&&t.validate.required!==void 0&&(o={constraint:!0,validate:t.validate.required});let r;(e.isValid?.elements===!0||e.isValid?.elements===void 0&&(e.elements||e.getElements))&&t.validate.elements!==void 0&&(r={constraint:!0,validate:t.validate.elements});let n;typeof e.isValid?.min=="number"&&t.validate.min!==void 0&&(n={constraint:e.isValid.min,validate:t.validate.min});let i;typeof e.isValid?.max=="number"&&t.validate.max!==void 0&&(i={constraint:e.isValid.max,validate:t.validate.max});let s;typeof e.isValid?.minLength=="number"&&t.validate.minLength!==void 0&&(s={constraint:e.isValid.minLength,validate:t.validate.minLength});let a;typeof e.isValid?.maxLength=="number"&&t.validate.maxLength!==void 0&&(a={constraint:e.isValid.maxLength,validate:t.validate.maxLength});let c;e.isValid?.pattern!==void 0&&t.validate.pattern!==void 0&&(c={constraint:e.isValid?.pattern,validate:t.validate.pattern});let u=e.isValid?.custom??t.validate.custom;return{required:o,elements:r,min:n,max:i,minLength:s,maxLength:a,pattern:c,custom:u}}function ede(e){return e.validOperators.reduce((t,o)=>{let r=Ace(o);return r?.filter&&(t[o]=r.filter),t},{})}function VRe(e,t){return{...t.format,...e.format}}var tde=VRe;function FRe(e){let t=[Iue,Oue,Nue,Mue,Vue,zue,Uue,Hue,$ue,Kue,Yue,Zue,Xue].find(o=>o?.type===e);return t||Que}function A_(e){return e.map(t=>{let o=FRe(t.type),r=t.getValue||Cue(t.id),n=function(i,s,a){let c=r({item:i}),u=r({item:s});return t.sort?t.sort(c,u,a):o.sort(c,u,a)};return{id:t.id,label:t.label||t.id,header:t.header||t.label||t.id,description:t.description,placeholder:t.placeholder,getValue:r,setValue:t.setValue||Bue(t.id),elements:t.elements,getElements:t.getElements,hasElements:fR(t),isVisible:t.isVisible,enableHiding:t.enableHiding??!0,readOnly:t.readOnly??!1,type:o.type,render:t.render??o.render,Edit:xue(t,o.Edit),sort:n,enableSorting:t.enableSorting??o.enableSorting,enableGlobalSearch:t.enableGlobalSearch??o.enableGlobalSearch,isValid:Jue(t,o),filterBy:wue(t,o.defaultOperators,o.validOperators),filter:ede(o),format:tde(t,o),getValueFormatted:t.getValueFormatted??o.getValueFormatted}})}var sz=l(R(),1);var ode=l(R(),1),rde=l(w(),1),J4=(0,ode.createContext)({fields:[]});J4.displayName="DataFormContext";function nde({fields:e,children:t}){return(0,rde.jsx)(J4.Provider,{value:{fields:e},children:t})}var us=J4;var ER=l(R(),1);var vR=l(R(),1),L_=l(A(),1);var Ar={type:"regular",labelPosition:"top"},zRe=e=>typeof e=="string"?[{id:e,visibility:"when-collapsed"}]:e.map(t=>typeof t=="string"?{id:t,visibility:"when-collapsed"}:{id:t.id,visibility:t.visibility});function ide(e){let t=Ar;if(e?.type==="regular")t={type:"regular",labelPosition:e?.labelPosition??"top"};else if(e?.type==="panel"){let o=e.summary??[],r=Array.isArray(o)?o:[o];t={type:"panel",labelPosition:e?.labelPosition??"side",openAs:e?.openAs??"dropdown",summary:r,editVisibility:e?.editVisibility??"on-hover"}}else if(e?.type==="card")if(e.withHeader===!1)t={type:"card",withHeader:!1,isOpened:!0,summary:[],isCollapsible:!1};else{let o=e.summary??[];t={type:"card",withHeader:!0,isOpened:typeof e.isOpened=="boolean"?e.isOpened:!0,summary:zRe(o),isCollapsible:e.isCollapsible===void 0?!0:e.isCollapsible}}else e?.type==="row"?t={type:"row",alignment:e?.alignment??"center",styles:e?.styles??{}}:e?.type==="details"&&(t={type:"details",summary:e?.summary??""});return t}function sde(e){let t=ide(e?.layout),o=(e.fields??[]).map(r=>{if(typeof r=="string")return{id:r,layout:t};let n=r.layout?ide(r.layout):t;return{id:r.id,layout:n,...!!r.label&&{label:r.label},...!!r.description&&{description:r.description},..."children"in r&&Array.isArray(r.children)&&{children:sde({fields:r.children,layout:Ar}).fields}}});return{layout:t,fields:o}}var kR=sde;var Gt=l(w(),1);function jRe({title:e}){return(0,Gt.jsx)(De,{direction:"column",className:"dataforms-layouts-regular__header",gap:"lg",children:(0,Gt.jsx)(De,{direction:"row",align:"center",children:(0,Gt.jsx)(L_.__experimentalHeading,{level:2,size:13,children:e})})})}function ade({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{fields:s}=(0,vR.useContext)(us),a=t.layout,c=(0,vR.useMemo)(()=>({layout:Ar,fields:t.children?t.children:[]}),[t]);if(t.children)return(0,Gt.jsxs)(Gt.Fragment,{children:[!r&&t.label&&(0,Gt.jsx)(jRe,{title:t.label}),(0,Gt.jsx)(Ln,{data:e,form:c,onChange:o,validity:i?.children})]});let u=a.labelPosition,d=s.find(f=>f.id===t.id);return!d||!d.Edit?null:u==="side"?(0,Gt.jsxs)(De,{direction:"row",className:"dataforms-layouts-regular__field",gap:"sm",children:[(0,Gt.jsx)("div",{className:V("dataforms-layouts-regular__field-label",`dataforms-layouts-regular__field-label--label-position-${u}`),children:(0,Gt.jsx)(L_.BaseControl.VisualLabel,{children:d.label})}),(0,Gt.jsx)("div",{className:"dataforms-layouts-regular__field-control",children:d.readOnly===!0?(0,Gt.jsx)(d.render,{item:e,field:d}):(0,Gt.jsx)(d.Edit,{data:e,field:d,onChange:o,hideLabelFromVision:!0,markWhenOptional:n,validity:i},d.id)})]}):(0,Gt.jsx)("div",{className:"dataforms-layouts-regular__field",children:d.readOnly===!0?(0,Gt.jsx)(Gt.Fragment,{children:(0,Gt.jsxs)(Gt.Fragment,{children:[!r&&u!=="none"&&(0,Gt.jsx)(L_.BaseControl.VisualLabel,{children:d.label}),(0,Gt.jsx)(d.render,{item:e,field:d})]})}):(0,Gt.jsx)(d.Edit,{data:e,field:d,onChange:o,hideLabelFromVision:u==="none"?!0:r,markWhenOptional:n,validity:i})})}var tz=l(MV(),1),kp=l(A(),1),oz=l(N(),1),ia=l(R(),1),xR=l(Z(),1);var Sk=l(A(),1),yk=l(N(),1);var fde=l(Z(),1),mde=l(R(),1);function URe(e,t){return V("dataforms-layouts-panel__field-label",`dataforms-layouts-panel__field-label--label-position-${e}`,{"has-error":t})}var lde=URe;var yR=l(A(),1);var N_=l(w(),1);function HRe(e,t,o){return e?(0,N_.jsx)(yR.Tooltip,{text:t,placement:"top",children:(0,N_.jsxs)("span",{className:"dataforms-layouts-panel__field-label-error-content",children:[(0,N_.jsx)(yR.Icon,{icon:Pf,size:16}),o]})}):o}var cde=HRe;function ude(e){if(!e)return;let t=Object.keys(e).filter(o=>o!=="children");for(let o of t){let r=e[o];if(r!==void 0&&r.type==="invalid")return r.message?r.message:o==="required"?"A required field is empty":"Unidentified validation error"}if(e.children)for(let o of Object.values(e.children)){let r=ude(o);if(r)return r}}var dde=ude;var gi=l(w(),1);function M_({data:e,field:t,fieldLabel:o,summaryFields:r,validity:n,touched:i,disabled:s,onClick:a,"aria-expanded":c}){let{labelPosition:u,editVisibility:d}=t.layout,f=dde(n),m=i&&!!f,h=lde(u,m),p=cde(m,f,o),g=V("dataforms-layouts-panel__field-trigger",`dataforms-layouts-panel__field-trigger--label-${u}`,{"is-disabled":s,"dataforms-layouts-panel__field-trigger--edit-always":d==="always"}),b=(0,fde.useInstanceId)(M_,"dataforms-layouts-panel__field-control"),v=m?(0,yk.sprintf)((0,yk._x)("Edit %s (has errors)","field"),o||""):(0,yk.sprintf)((0,yk._x)("Edit %s","field"),o||""),k=(0,mde.useRef)(null);return(0,gi.jsxs)("div",{ref:k,className:g,onClick:s?void 0:()=>{let x=k.current?.ownerDocument.defaultView?.getSelection();x&&x.toString().length>0||a()},onKeyDown:s?void 0:x=>{x.target===x.currentTarget&&(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),a())},children:[u!=="none"&&(0,gi.jsx)("span",{className:h,children:p}),u==="none"&&m&&(0,gi.jsx)(Sk.Tooltip,{text:f,placement:"top",children:(0,gi.jsx)("span",{className:"dataforms-layouts-panel__field-label-error-content",children:(0,gi.jsx)(Sk.Icon,{icon:Pf,size:16})})}),(0,gi.jsx)("span",{id:`${b}`,className:"dataforms-layouts-panel__field-control",children:r.length>1?(0,gi.jsx)("span",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",width:"100%",gap:"2px"},children:r.map(x=>(0,gi.jsx)("span",{style:{width:"100%"},children:(0,gi.jsx)(x.render,{item:e,field:x})},x.id))}):r.map(x=>(0,gi.jsx)(x.render,{item:e,field:x},x.id))}),!s&&(0,gi.jsx)(Sk.Button,{className:"dataforms-layouts-panel__field-trigger-icon",label:v,showTooltip:!1,icon:Of,size:"small","aria-expanded":c,"aria-haspopup":"dialog","aria-describedby":`${b}`})]})}var pde=l(MV(),1),ez=l(yf(),1),ll=l(R(),1),sn=l(N(),1);function hde(e){return e?Object.values(e).every(t=>Object.entries(t).every(([o,r])=>o==="children"&&r&&typeof r=="object"?hde(r):r.type!=="invalid"&&r.type!=="validating")):!0}function GRe(e,t){let o=kR(e);if(o.fields.length===0)return[];let r=new Map;t.forEach(s=>{r.set(s.id,s)});function n(s){if("children"in s&&Array.isArray(s.children)){let u=s.children.map(n).filter(f=>f!==null);if(u.length===0)return null;let d=r.get(s.id);if(d){let[f]=A_([d]);return{id:s.id,children:u,field:f}}return{id:s.id,children:u}}let a=r.get(s.id);if(!a)return null;let[c]=A_([a]);return{id:s.id,children:[],field:c}}return o.fields.map(n).filter(s=>s!==null)}function _k(e,t,o){if(e||(e={}),o.length===0)return e;let r={...e},n=r;for(let s=0;s{if(a===r.current[t.id]){if(!Array.isArray(c)){n(u=>_k(u,{elements:{type:"invalid",message:(0,sn.__)("Could not validate elements.")}},[...i,t.id]));return}t.field?.isValid.elements&&!t.field.isValid.elements.validate(s,{...t.field,elements:c})?n(u=>_k(u,{elements:{type:"invalid",message:(0,sn.__)("Value must be one of the elements.")}},[...i,t.id])):n(u=>gde(u,[...i,t.id],"elements"))}}).catch(c=>{if(a!==r.current[t.id])return;let u;c instanceof Error?u=c.message:u=String(c)||(0,sn.__)("Unknown error when running elements validation asynchronously."),n(d=>_k(d,{elements:{type:"invalid",message:u}},[...i,t.id]))})}function $Re(e,t,o){let{customCounterRef:r,setFormValidity:n,path:i}=o,s=(r.current[t.id]||0)+1;r.current[t.id]=s,e.then(a=>{if(s===r.current[t.id]){if(a===null){n(c=>gde(c,[...i,t.id],"custom"));return}if(typeof a=="string"){n(c=>_k(c,{custom:{type:"invalid",message:a}},[...i,t.id]));return}n(c=>_k(c,{custom:{type:"invalid",message:(0,sn.__)("Validation could not be processed.")}},[...i,t.id]))}}).catch(a=>{if(s!==r.current[t.id])return;let c;a instanceof Error?c=a.message:c=String(a)||(0,sn.__)("Unknown error when running custom validation asynchronously."),n(u=>_k(u,{custom:{type:"invalid",message:c}},[...i,t.id]))})}function bde(e,t,o){if(t.field?.isValid.required&&!t.field.isValid.required.validate(e,t.field))return{required:{type:"invalid"}};if(t.field?.isValid.pattern&&!t.field.isValid.pattern.validate(e,t.field))return{pattern:{type:"invalid",message:(0,sn.__)("Value does not match the required pattern.")}};if(t.field?.isValid.min&&!t.field.isValid.min.validate(e,t.field))return{min:{type:"invalid",message:(0,sn.__)("Value is below the minimum.")}};if(t.field?.isValid.max&&!t.field.isValid.max.validate(e,t.field))return{max:{type:"invalid",message:(0,sn.__)("Value is above the maximum.")}};if(t.field?.isValid.minLength&&!t.field.isValid.minLength.validate(e,t.field))return{minLength:{type:"invalid",message:(0,sn.__)("Value is too short.")}};if(t.field?.isValid.maxLength&&!t.field.isValid.maxLength.validate(e,t.field))return{maxLength:{type:"invalid",message:(0,sn.__)("Value is too long.")}};if(t.field?.isValid.elements&&t.field.hasElements&&!t.field.getElements&&Array.isArray(t.field.elements)&&!t.field.isValid.elements.validate(e,t.field))return{elements:{type:"invalid",message:(0,sn.__)("Value must be one of the elements.")}};let r;if(t.field&&t.field.isValid.custom)try{let i=t.field.getValue({item:e});r=t.field.isValid.custom((0,pde.default)(e,t.field.setValue({item:e,value:i})),t.field)}catch(i){let s;return i instanceof Error?s=i.message:s=String(i)||(0,sn.__)("Unknown error when running custom validation."),{custom:{type:"invalid",message:s}}}if(typeof r=="string")return{custom:{type:"invalid",message:r}};let n={};if(t.field&&t.field.isValid.elements&&t.field.hasElements&&typeof t.field.getElements=="function"&&(WRe(t.field.getElements(),t,o),n.elements={type:"validating",message:(0,sn.__)("Validating\u2026")}),r instanceof Promise&&($Re(r,t,o),n.custom={type:"validating",message:(0,sn.__)("Validating\u2026")}),Object.keys(n).length>0)return n;if(t.children.length>0){let i={};t.children.forEach(a=>{i[a.id]=bde(e,a,{...o,path:[...o.path,t.id,"children"]})});let s={};return Object.entries(i).forEach(([a,c])=>{c!==void 0&&(s[a]=c)}),Object.keys(s).length===0?void 0:{children:s}}}function kde(e,t){let o=e?.field?.getValue({item:t});if(e.children.length===0)return o;let r=e.children.map(n=>kde(n,t));return r?{value:o,children:r}:o}function KRe(e,t,o){let[r,n]=(0,ll.useState)(),i=(0,ll.useRef)({}),s=(0,ll.useRef)({}),a=(0,ll.useRef)({}),c=(0,ll.useCallback)(()=>{let u={customCounterRef:i,elementsCounterRef:s,setFormValidity:n,path:[],item:e},d=GRe(o,t);if(d.length===0){n(void 0);return}let f={},m=[];d.forEach(h=>{let p=kde(h,e);if(a.current.hasOwnProperty(h.id)&&(0,ez.default)(a.current[h.id],p)){m.push(h.id);return}a.current[h.id]=p;let g=bde(e,h,u);g!==void 0&&(f[h.id]=g)}),n(h=>{let p={...h,...f},g=[...m,...Object.keys(f)];return Object.keys(p).forEach(v=>{p&&!g.includes(v)&&delete p[v]}),Object.keys(p).length===0&&(p=void 0),(0,ez.default)(h,p)?h:p})},[e,t,o]);return(0,ll.useEffect)(()=>{c()},[c]),{validity:r,isValid:hde(r)}}var vde=KRe;var yde=l(R(),1);function of(e,t){(0,yde.useEffect)(()=>{t&&e.current&&e.current.querySelectorAll("input, textarea, select").forEach(r=>{r.reportValidity()})},[t,e])}var Sde=l(R(),1);function YRe(e){return Array.isArray(e)?e.map(t=>typeof t=="string"?t:t.id):[]}var SR=(e,t)=>Array.isArray(e)&&e.length>0?YRe(e).map(r=>t.find(n=>n.id===r)).filter(r=>r!==void 0):[];var qRe=(e,t)=>{let o=t.find(r=>r.id===e.id);return o||t.find(r=>{if(e.children){let n=e.children.filter(i=>!i.children);return n.length===0?!1:r.id===n[0].id}return r.id===e.id})};function ZRe(e){let{fields:t}=(0,Sde.useContext)(us),o=e.layout,r=SR(o.summary,t),n=qRe(e,t),i=e.children?e.label:n?.label;return r.length===0?{summaryFields:n?[n]:[],fieldDefinition:n,fieldLabel:i}:{summaryFields:r,fieldDefinition:n,fieldLabel:i}}var _R=ZRe;var an=l(w(),1);function XRe({data:e,field:t,onChange:o,fieldLabel:r,onClose:n,touched:i}){let{fields:s}=(0,ia.useContext)(us),[a,c]=(0,ia.useState)({}),u=(0,ia.useMemo)(()=>(0,tz.default)(e,a,{arrayMerge:(k,y)=>y}),[e,a]),d=(0,ia.useMemo)(()=>({layout:Ar,fields:t.children?t.children:[{id:t.id,layout:Ar}]}),[t]),f=s.map(k=>({...k,Edit:k.Edit===null?void 0:k.Edit,isValid:{required:k.isValid.required?.constraint,elements:k.isValid.elements?.constraint,min:k.isValid.min?.constraint,max:k.isValid.max?.constraint,pattern:k.isValid.pattern?.constraint,minLength:k.isValid.minLength?.constraint,maxLength:k.isValid.maxLength?.constraint}})),{validity:m}=vde(u,f,d),h=()=>{o(a),n()},p=k=>{c(y=>(0,tz.default)(y,k,{arrayMerge:(S,x)=>x}))},g=(0,xR.useFocusOnMount)("firstInputElement"),b=(0,ia.useRef)(null),v=(0,xR.useMergeRefs)([g,b]);return of(b,i),(0,an.jsxs)(kp.Modal,{className:"dataforms-layouts-panel__modal",onRequestClose:n,isFullScreen:!1,title:r,size:"medium",children:[(0,an.jsx)("div",{ref:v,children:(0,an.jsx)(Ln,{data:u,form:d,onChange:p,validity:m,children:(k,y,S,x)=>(0,an.jsx)(k,{data:u,field:y,onChange:p,hideLabelFromVision:d.fields.length<2,markWhenOptional:x,validity:S},y.id)})}),(0,an.jsxs)(De,{direction:"row",className:"dataforms-layouts-panel__modal-footer",gap:"md",children:[(0,an.jsx)(kp.__experimentalSpacer,{style:{flex:1}}),(0,an.jsx)(kp.Button,{variant:"tertiary",onClick:n,__next40pxDefaultSize:!0,children:(0,oz.__)("Cancel")}),(0,an.jsx)(kp.Button,{variant:"primary",onClick:h,__next40pxDefaultSize:!0,children:(0,oz.__)("Apply")})]})]})}function QRe({data:e,field:t,onChange:o,validity:r}){let[n,i]=(0,ia.useState)(!1),[s,a]=(0,ia.useState)(!1),{fieldDefinition:c,fieldLabel:u,summaryFields:d}=_R(t);if(!c)return null;let f=()=>{a(!1),i(!0)};return(0,an.jsxs)(an.Fragment,{children:[(0,an.jsx)(M_,{data:e,field:t,fieldLabel:u,summaryFields:d,validity:r,touched:n,disabled:c.readOnly===!0,onClick:()=>a(!0),"aria-expanded":s}),s&&(0,an.jsx)(XRe,{data:e,field:t,onChange:o,fieldLabel:u??"",onClose:f,touched:n})]})}var _de=QRe;var rf=l(A(),1),xde=l(N(),1),Rc=l(R(),1);var wde=l(Z(),1);var Lr=l(w(),1);function JRe({title:e,onClose:t}){return(0,Lr.jsx)(De,{direction:"column",className:"dataforms-layouts-panel__dropdown-header",gap:"lg",children:(0,Lr.jsxs)(De,{direction:"row",gap:"sm",align:"center",children:[e&&(0,Lr.jsx)(rf.__experimentalHeading,{level:2,size:13,children:e}),(0,Lr.jsx)(rf.__experimentalSpacer,{style:{flex:1}}),t&&(0,Lr.jsx)(rf.Button,{label:(0,xde.__)("Close"),icon:wf,onClick:t,size:"small"})]})})}function eOe({touched:e,children:t}){let o=(0,Rc.useRef)(null);return of(o,e),(0,Lr.jsx)("div",{ref:o,children:t})}function tOe({data:e,field:t,onChange:o,validity:r}){let[n,i]=(0,Rc.useState)(!1),[s,a]=(0,Rc.useState)(null),c=(0,Rc.useMemo)(()=>({anchor:s,placement:"left-start",offset:36,shift:!0}),[s]),[u,d]=(0,wde.__experimentalUseDialog)({focusOnMount:"firstInputElement"}),f=(0,Rc.useMemo)(()=>({layout:Ar,fields:t.children?t.children:[{id:t.id,layout:Ar}]}),[t]),m=(0,Rc.useMemo)(()=>{if(r!==void 0)return t.children?r?.children:{[t.id]:r}},[r,t]),{fieldDefinition:h,fieldLabel:p,summaryFields:g}=_R(t);return h?(0,Lr.jsx)("div",{ref:a,className:"dataforms-layouts-panel__field-dropdown-anchor",children:(0,Lr.jsx)(rf.Dropdown,{contentClassName:"dataforms-layouts-panel__field-dropdown",popoverProps:c,focusOnMount:!1,onToggle:b=>{b||i(!0)},renderToggle:({isOpen:b,onToggle:v})=>(0,Lr.jsx)(M_,{data:e,field:t,fieldLabel:p,summaryFields:g,validity:r,touched:n,disabled:h.readOnly===!0,onClick:v,"aria-expanded":b}),renderContent:({onClose:b})=>(0,Lr.jsx)(eOe,{touched:n,children:(0,Lr.jsxs)("div",{ref:u,...d,children:[(0,Lr.jsx)(JRe,{title:p,onClose:b}),(0,Lr.jsx)(Ln,{data:e,form:f,onChange:o,validity:m,children:(v,k,y,S)=>(0,Lr.jsx)(v,{data:e,field:k,onChange:o,hideLabelFromVision:(f?.fields??[]).length<2,markWhenOptional:S,validity:y},k.id)})]})})})}):null}var Cde=tOe;var rz=l(w(),1);function Bde({data:e,field:t,onChange:o,validity:r}){return t.layout.openAs==="modal"?(0,rz.jsx)(_de,{data:e,field:t,onChange:o,validity:r}):(0,rz.jsx)(Cde,{data:e,field:t,onChange:o,validity:r})}var nf=l(A(),1),Ide=l(Z(),1),Nn=l(R(),1),nz=l(N(),1);var wR=l(N(),1),Ede=l(w(),1);function Tde(e){if(!e)return 0;let t=0,o=Object.keys(e).filter(r=>r!=="children");for(let r of o)e[r]?.type==="invalid"&&t++;if(e.children)for(let r of Object.values(e.children))t+=Tde(r);return t}function CR({validity:e}){let t=Tde(e);return t===0?null:(0,Ede.jsx)(L4,{intent:"high",children:(0,wR.sprintf)((0,wR._n)("%d field needs attention","%d fields need attention",t),t)})}var vr=l(w(),1);function oOe(e,t,o){if(!t||Array.isArray(t)&&t.length===0)return!1;let n=(Array.isArray(t)?t:[t]).find(i=>typeof i=="string"?i===e.id:typeof i=="object"&&"id"in i?i.id===e.id:!1);return n?typeof n=="string"?!0:typeof n=="object"&&"visibility"in n?n.visibility==="always"||n.visibility==="when-collapsed"&&!o:!0:!1}function iz({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{fields:s}=(0,Nn.useContext)(us),a=t.layout,c=(0,Nn.useRef)(null),u=(0,Ide.useInstanceId)(iz,"dataforms-layouts-card-card-body"),d=(0,Nn.useMemo)(()=>({layout:Ar,fields:t.children??[]}),[t]),{isOpened:f,isCollapsible:m}=a,[h,p]=(0,Nn.useState)(f),[g,b]=(0,Nn.useState)(!1);(0,Nn.useEffect)(()=>{p(f)},[f]);let v=(0,Nn.useCallback)(()=>{p(T=>(T&&b(!0),!T))},[]),k=m?h:!0,y=(0,Nn.useCallback)(()=>{b(!0)},[b]);of(c,k&&g);let x=SR(a.summary,s).filter(T=>oOe(T,a.summary,k)),C=g&&a.isCollapsible?(0,vr.jsx)(CR,{validity:i}):null,B={blockStart:"medium",blockEnd:"medium",inlineStart:"medium",inlineEnd:"medium"},I=t.label,P,E;if(t.children)P=!!I&&a.withHeader,E=(0,vr.jsxs)(vr.Fragment,{children:[t.description&&(0,vr.jsx)("div",{className:"dataforms-layouts-card__field-description",children:t.description}),(0,vr.jsx)(Ln,{data:e,form:d,onChange:o,validity:i?.children})]});else{let T=s.find(D=>D.id===t.id);if(!T||!T.Edit)return null;let O=vp("regular")?.component;if(!O)return null;I=T.label,P=!!I&&a.withHeader,E=(0,vr.jsx)(O,{data:e,field:t,onChange:o,hideLabelFromVision:r||P,markWhenOptional:n,validity:i})}let L={blockStart:P?"none":"medium",blockEnd:"medium",inlineStart:"medium",inlineEnd:"medium"};return(0,vr.jsxs)(nf.Card,{className:"dataforms-layouts-card__field",size:B,children:[P&&(0,vr.jsxs)(nf.CardHeader,{className:"dataforms-layouts-card__field-header",onClick:m?v:void 0,style:{cursor:m?"pointer":void 0},isBorderless:!0,children:[(0,vr.jsxs)("div",{style:{height:m?void 0:"40px",width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,vr.jsx)("span",{className:"dataforms-layouts-card__field-header-label",children:I}),C,x.length>0&&a.withHeader&&(0,vr.jsx)("div",{className:"dataforms-layouts-card__field-summary",children:x.map(T=>(0,vr.jsx)(T.render,{item:e,field:T},T.id))})]}),m&&(0,vr.jsx)(nf.Button,{__next40pxDefaultSize:!0,variant:"tertiary",icon:k?xf:zn,"aria-expanded":k,"aria-controls":u,"aria-label":k?(0,nz.__)("Collapse"):(0,nz.__)("Expand")})]}),(k||!P)&&(0,vr.jsx)(nf.CardBody,{id:u,size:L,className:"dataforms-layouts-card__field-control",ref:c,onBlur:y,children:E})]})}var Pde=l(A(),1);var sr=l(w(),1);function rOe({title:e}){return(0,sr.jsx)(De,{direction:"column",className:"dataforms-layouts-row__header",gap:"lg",children:(0,sr.jsx)(De,{direction:"row",align:"center",children:(0,sr.jsx)(Pde.__experimentalHeading,{level:2,size:13,children:e})})})}var nOe=({children:e})=>(0,sr.jsx)(sr.Fragment,{children:e});function Rde({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let s=t.layout;if(t.children){let c={layout:Ar,fields:t.children};return(0,sr.jsxs)("div",{className:"dataforms-layouts-row__field",children:[!r&&t.label&&(0,sr.jsx)(rOe,{title:t.label}),(0,sr.jsx)(De,{direction:"row",align:s.alignment,gap:"lg",children:(0,sr.jsx)(Ln,{data:e,form:c,onChange:o,validity:i?.children,as:nOe,children:(u,d,f)=>(0,sr.jsx)("div",{className:"dataforms-layouts-row__field-control",style:s.styles[d.id],children:(0,sr.jsx)(u,{data:e,field:d,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:f})},d.id)})})]})}let a=vp("regular")?.component;return a?(0,sr.jsx)(sr.Fragment,{children:(0,sr.jsx)("div",{className:"dataforms-layouts-row__field-control",children:(0,sr.jsx)(a,{data:e,field:t,onChange:o,markWhenOptional:n,validity:i})})}):null}var Mn=l(R(),1),Ode=l(N(),1);var Oc=l(w(),1);function Ade({data:e,field:t,onChange:o,validity:r}){let{fields:n}=(0,Mn.useContext)(us),i=(0,Mn.useRef)(null),s=(0,Mn.useRef)(null),[a,c]=(0,Mn.useState)(!1),[u,d]=(0,Mn.useState)(!1),f=(0,Mn.useMemo)(()=>({layout:Ar,fields:t.children??[]}),[t]);(0,Mn.useEffect)(()=>{let b=i.current;if(!b)return;let v=()=>{let k=b.open;k||c(!0),d(k)};return b.addEventListener("toggle",v),()=>{b.removeEventListener("toggle",v)}},[]),of(s,u&&a);let m=(0,Mn.useCallback)(()=>{c(!0)},[]);if(!t.children)return null;let h=t.layout.summary??"",p=h?n.find(b=>b.id===h):void 0,g;return p&&p.render?g=(0,Oc.jsx)(p.render,{item:e,field:p}):g=t.label||(0,Ode.__)("More details"),(0,Oc.jsxs)("details",{ref:i,className:"dataforms-layouts-details__details",children:[(0,Oc.jsx)("summary",{className:"dataforms-layouts-details__summary",children:(0,Oc.jsxs)(De,{direction:"row",align:"center",gap:"md",className:"dataforms-layouts-details__summary-content",children:[g,a&&(0,Oc.jsx)(CR,{validity:r})]})}),(0,Oc.jsx)("div",{ref:s,className:"dataforms-layouts-details__content",onBlur:m,children:(0,Oc.jsx)(Ln,{data:e,form:f,onChange:o,validity:r?.children})})]})}var yp=l(w(),1),iOe=[{type:"regular",component:ade,wrapper:({children:e})=>(0,yp.jsx)(De,{direction:"column",className:"dataforms-layouts__wrapper",gap:"lg",children:e})},{type:"panel",component:Bde,wrapper:({children:e})=>(0,yp.jsx)(De,{direction:"column",className:"dataforms-layouts__wrapper",gap:"md",children:e})},{type:"card",component:iz,wrapper:({children:e})=>(0,yp.jsx)(De,{direction:"column",className:"dataforms-layouts__wrapper",gap:"xl",children:e})},{type:"row",component:Rde,wrapper:({children:e,layout:t})=>(0,yp.jsx)(De,{direction:"column",className:"dataforms-layouts__wrapper",gap:"lg",children:(0,yp.jsx)("div",{className:"dataforms-layouts-row__field",children:(0,yp.jsx)(De,{direction:"row",gap:"lg",align:t.alignment,children:e})})})},{type:"details",component:Ade}];function vp(e){return iOe.find(t=>t.type===e)}var BR=l(w(),1),sOe=({children:e})=>(0,BR.jsx)(De,{direction:"column",className:"dataforms-layouts__wrapper",gap:"lg",children:e});function Ln({data:e,form:t,onChange:o,validity:r,children:n,as:i}){let{fields:s}=(0,ER.useContext)(us),a=(0,ER.useMemo)(()=>{let d=s.filter(m=>!!m.isValid?.required).length,f=s.length-d;return d>f},[s]);function c(d){return s.find(f=>f.id===d.id)}let u=i??vp(t.layout.type)?.wrapper??sOe;return(0,BR.jsx)(u,{layout:t.layout,children:t.fields.map(d=>{let f=vp(d.layout.type)?.component;if(!f)return null;let m=d.children?void 0:c(d);return m&&m.isVisible&&!m.isVisible(e)?null:n?n(f,d,r?.[d.id],a):(0,BR.jsx)(f,{data:e,field:d,onChange:o,markWhenOptional:a,validity:r?.[d.id]},d.id)})})}var az=l(w(),1);function D_({data:e,form:t,fields:o,onChange:r,validity:n}){let i=(0,sz.useMemo)(()=>kR(t),[t]),s=(0,sz.useMemo)(()=>A_(o),[o]);return t.fields?(0,az.jsx)(nde,{fields:s,children:(0,az.jsx)(Ln,{data:e,form:i,onChange:r,validity:n})}):null}var sf=l(R(),1),Kde=l(N(),1);var wk=l(A(),1);var lz=l(N(),1);var Lde=l(Z(),1);function xk({isControl:e}={isControl:!1}){return(0,Lde.useViewportMatch)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:e?35:259}}}var TR=l(w(),1);function Nde({fields:e,visibleFields:t,onToggleField:o}){let{popoverProps:r}=xk();return!e||e.length===0?null:(0,TR.jsx)(wk.DropdownMenu,{icon:ks,label:(0,lz.__)("Options"),popoverProps:r,toggleProps:{size:"small"},children:({onClose:n})=>(0,TR.jsx)(wk.MenuGroup,{label:(0,lz.__)("Show / Hide"),children:e.map(i=>{let s=t.includes(i.id);return(0,TR.jsx)(wk.MenuItem,{isSelected:s,onClick:()=>{o(i.id),n()},role:"menuitemcheckbox",icon:s?gl:null,children:i.label},i.id)})})})}var IR=l(A(),1),Mde=l(Z(),1),Dde=l(F(),1),Ac=l(R(),1),Vde=l(dr(),1);var sa=l(w(),1),{useRichText:aOe}=M(Vde.privateApis);function Fde({data:e,field:t,hideLabelFromVision:o,onChange:r,config:n={}}){let i=(0,Dde.useRegistry)(),s=t.getValue({item:e}),a=t.config||{},{clientId:c}=n,[u,d]=(0,Ac.useState)({start:void 0,end:void 0}),[f,m]=(0,Ac.useState)(!1),h=(0,Ac.useRef)(),p=(0,Ac.useRef)(new Set),g=(0,Ac.useRef)(new Set),b=Cb({allowedFormats:a?.allowedFormats,disableFormats:a?.disableFormats});function v(){h.current?.focus()}let{value:k,getValue:y,onChange:S,ref:x,formatTypes:C}=aOe({value:s,onChange(P){r(t.setValue({item:e,value:P}))},selectionStart:u.start,selectionEnd:u.end,onSelectionChange:(P,E)=>d({start:P,end:E}),__unstableIsSelected:f,preserveWhiteSpace:!!a?.preserveWhiteSpace,placeholder:a?.placeholder,__unstableDisableFormats:a?.disableFormats,allowedFormats:b,withoutInteractiveFormatting:a?.withoutInteractiveFormatting,__unstableFormatTypeHandlerContext:(0,Ac.useMemo)(()=>({richTextIdentifier:t.id,blockClientId:c}),[t.id,c])}),{baseControlProps:B,controlProps:I}=(0,IR.useBaseControlProps)({hideLabelFromVision:o??t.hideLabelFromVision,label:t.label});return(0,sa.jsxs)(sa.Fragment,{children:[f&&(0,sa.jsx)(Pb.Provider,{value:g,children:(0,sa.jsx)(Ob.Provider,{value:p,children:(0,sa.jsx)("div",{children:(0,sa.jsx)(nP,{value:k,onChange:S,onFocus:v,formatTypes:C,forwardedRef:h,isVisible:!1})})})}),(0,sa.jsx)(IR.BaseControl,{...B,children:(0,sa.jsx)("div",{className:"block-editor-content-only-controls__rich-text",role:"textbox","aria-multiline":!a?.disableLineBreaks,ref:(0,Mde.useMergeRefs)([x,tP({registry:i,getValue:y,onChange:S,formatTypes:C,selectionChange:d,isSelected:f,disableFormats:a?.disableFormats,value:k,tagName:"div",disableLineBreaks:a?.disableLineBreaks,keyboardShortcuts:g,inputEvents:p}),h]),onFocus:()=>m(!0),onBlur:()=>m(!1),contentEditable:!0,...I})})]})}var Sp=l(A(),1),zde=l(F(),1),Ck=l(N(),1);var Co=l(w(),1);function lOe({data:e,field:t,attachment:o,config:r}){let{allowedTypes:n=[],multiple:i=!1}=r||{};if(i)return"todo multiple";if(o?.media_type==="image"||o?.poster)return(0,Co.jsx)("div",{className:"block-editor-content-only-controls__media-thumbnail",children:(0,Co.jsx)("img",{alt:"",width:24,height:24,src:o.media_type==="image"?o.source_url:o.poster})});if(n.length===1){let a=t.getValue({item:e})?.url;if(n[0]==="image"&&a)return(0,Co.jsx)("div",{className:"block-editor-content-only-controls__media-thumbnail",children:(0,Co.jsx)("img",{alt:"",width:24,height:24,src:a})});let c;if(n[0]==="image"?c=iv:n[0]==="video"?c=FN:n[0]==="audio"?c=HO:c=jp,c)return(0,Co.jsx)(Sp.Icon,{icon:c,size:24})}return(0,Co.jsx)(Sp.Icon,{icon:jp,size:24})}function jde({data:e,field:t,onChange:o,config:r={}}){let{popoverProps:n}=xk({isControl:!0}),i=t.getValue({item:e}),{allowedTypes:s=[],multiple:a=!1,useFeaturedImage:c=!1}=r,u=i?.id,d=i?.url,f=(0,zde.useSelect)(h=>{if(!u)return;let g=h(_).getSettings()[x0];if(g)return g(h,u)},[u]),m;if(s.length===1){let h=s[0];h==="image"?m=(0,Ck.__)("Choose an image\u2026"):h==="video"?m=(0,Ck.__)("Choose a video\u2026"):h==="application"?m=(0,Ck.__)("Choose a file\u2026"):m=(0,Ck.__)("Choose a media item\u2026")}else m=(0,Ck.__)("Choose a media item\u2026");return(0,Co.jsx)(Ds,{children:(0,Co.jsx)(_b,{className:"block-editor-content-only-controls__media-replace-flow",allowedTypes:s,mediaId:u,mediaURL:d,multiple:a,popoverProps:n,onReset:()=>{o(t.setValue({item:e,value:{}}))},...c&&{useFeaturedImage:!!i?.featuredImage,onToggleFeaturedImage:()=>{o(t.setValue({item:e,value:{featuredImage:!i?.featuredImage}}))}},onSelect:h=>{if(h.id&&h.url){let p={...h,mediaType:h.media_type};c&&(p.featuredImage=!1),o(t.setValue({item:e,value:p}))}},renderToggle:h=>(0,Co.jsx)(Sp.Button,{__next40pxDefaultSize:!0,className:"block-editor-content-only-controls__media",...h,children:(0,Co.jsxs)(Sp.__experimentalGrid,{rowGap:0,columnGap:8,templateColumns:"24px 1fr",className:"block-editor-content-only-controls__media-row",children:[d&&(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsx)(lOe,{attachment:f,field:t,data:e,config:r}),(0,Co.jsx)("span",{className:"block-editor-content-only-controls__media-title",children:f?.title?.raw&&f?.title?.raw!==""?f?.title?.raw:d})]}),!d&&(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsx)("span",{className:"block-editor-content-only-controls__media-placeholder",style:{width:"24px",height:"24px"}}),(0,Co.jsx)("span",{className:"block-editor-content-only-controls__media-title",children:m})]})]})})})})}var Lc=l(A(),1),RR=l(R(),1),Ude=l(N(),1);var Hde=l(dn(),1);var yr=l(w(),1),cz="noreferrer noopener",Gde="_blank",PR="nofollow";function cOe({rel:e="",url:t="",opensInNewTab:o,nofollow:r}){let n,i=e;if(o)n=Gde,i=i?.includes(cz)?i:i+` ${cz}`;else{let s=new RegExp(`\\b${cz}\\s*`,"g");i=i?.replace(s,"").trim()}if(r)i=i?.includes(PR)?i:(i+` ${PR}`).trim();else{let s=new RegExp(`\\b${PR}\\s*`,"g");i=i?.replace(s,"").trim()}return{url:(0,Hde.prependHTTP)(t),linkTarget:n,rel:i||void 0}}function Wde({data:e,field:t,onChange:o}){let[r,n]=(0,RR.useState)(!1),{popoverProps:i}=xk({isControl:!0}),s=t.getValue({item:e}),a=s?.url,c=s?.rel||"",d=s?.linkTarget===Gde,f=c===PR,m=(0,RR.useMemo)(()=>({url:a,opensInNewTab:d,nofollow:f}),[a,d,f]);return(0,yr.jsxs)(yr.Fragment,{children:[(0,yr.jsx)(Lc.Button,{__next40pxDefaultSize:!0,className:"block-editor-content-only-controls__link",onClick:()=>{n(!0)},children:(0,yr.jsxs)(Lc.__experimentalGrid,{rowGap:0,columnGap:8,templateColumns:"24px 1fr",className:"block-editor-content-only-controls__link-row",children:[a&&(0,yr.jsxs)(yr.Fragment,{children:[(0,yr.jsx)(Lc.Icon,{icon:fn,size:24}),(0,yr.jsx)("span",{className:"block-editor-content-only-controls__link-title",children:a})]}),!a&&(0,yr.jsxs)(yr.Fragment,{children:[(0,yr.jsx)(Lc.Icon,{icon:fn,size:24,style:{opacity:.3}}),(0,yr.jsx)("span",{className:"block-editor-content-only-controls__link-title",children:(0,Ude.__)("Link")})]})]})}),r&&(0,yr.jsx)(Lc.Popover,{onClose:()=>{n(!1)},...i??{},children:(0,yr.jsx)(Pd,{value:m,onChange:h=>{let p=cOe({rel:c,...h});o(t.setValue({item:e,value:p}))},onRemove:()=>{o(t.setValue({item:e,value:{}}))}})})]})}var Sr=l(w(),1),{fieldsKey:Yde,formKey:uz}=M(Bk.privateApis);function dz(e,t={}){return function(r){return(0,Sr.jsx)(e,{...r,config:t})}}function uOe({clientId:e,blockType:t,setAttributes:o,isCollapsed:r=!1}){let n=zr({clientId:e,context:"list-view"}),i=Tt(e),s=t?.[Yde],a=(0,sf.useContext)(xr),c=(0,$de.useSelect)(p=>{let g=p(_).getBlockAttributes(e);if(!g?.metadata?.bindings)return g;let{getBlockBindingsSource:b}=M(p(Bk.store));return Object.entries(g.metadata.bindings).reduce((v,[k,y])=>{let S=b(y.source);if(!S)return v;let x=S.getValues({select:p,context:a,bindings:{[k]:y}});return{...v,...x}},g)},[a,e]),u=(0,sf.useMemo)(()=>r?{...t?.[uz],fields:[t?.[uz]?.fields?.[0]]}:t?.[uz],[t,r]),[d,f]=(0,sf.useState)(u),m=(0,sf.useMemo)(()=>s?.length?s.map(p=>{let g={...p};return typeof p.Edit=="string"&&p.Edit==="rich-text"?g.Edit=dz(Fde,{clientId:e}):typeof p.Edit=="string"&&p.Edit==="link"?g.Edit=dz(Wde):typeof p.Edit=="object"&&p.Edit.control==="media"&&(g.Edit=dz(jde,{...p.Edit})),g}):[],[s,e]);if(!s?.length)return null;let h=p=>{f(g=>g.fields?.includes(p)?{...g,fields:g.fields.filter(b=>b!==p)}:{...g,fields:[...g.fields||[],p]})};return(0,Sr.jsxs)("div",{className:"block-editor-block-fields__container",children:[(0,Sr.jsx)("div",{className:"block-editor-block-fields__header",children:(0,Sr.jsxs)(OR.__experimentalHStack,{spacing:1,children:[r&&(0,Sr.jsxs)(Sr.Fragment,{children:[(0,Sr.jsx)(Ae,{className:"block-editor-block-fields__header-icon",icon:i?.icon}),(0,Sr.jsx)("h2",{className:"block-editor-block-fields__header-title",children:(0,Sr.jsx)(OR.__experimentalTruncate,{numberOfLines:1,children:n})}),(0,Sr.jsx)(Nde,{fields:m,visibleFields:d.fields,onToggleField:h})]}),!r&&(0,Sr.jsx)("h2",{className:"block-editor-block-fields__header-title",children:(0,Kde.__)("Content")})]})}),(0,Sr.jsx)(D_,{data:c,fields:m,form:d,onChange:o})]})}function dOe(e){return!!(window?.__experimentalContentOnlyInspectorFields&&(0,Bk.getBlockType)(e)?.[Yde])}function fOe(e){let{blockType:t,isSelectionWithinCurrentSection:o}=(0,sf.useContext)(ur);return(0,Sr.jsx)(Sm,{group:"content",children:(0,Sr.jsx)(uOe,{...e,blockType:t,isCollapsed:o})})}var qde={edit:fOe,hasSupport:dOe,attributeKeys:[],supportsPatternEditing:!0};var pz=l(ut(),1),Zde=l(A(),1),fz=l(N(),1),V_=l($(),1);var mz=l(w(),1);function mOe(e){return(0,V_.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e}function pOe({className:e,setAttributes:t}){return ao()!=="default"?null:(0,mz.jsx)(fe,{group:"advanced",children:(0,mz.jsx)(Zde.TextControl,{__next40pxDefaultSize:!0,autoComplete:"off",label:(0,fz.__)("Additional CSS class(es)"),value:e||"",onChange:r=>{t({className:r!==""?r:void 0})},help:(0,fz.__)("Separate multiple classes with spaces.")})})}var hz={edit:pOe,addSaveProps:hOe,attributeKeys:["className"],hasSupport(e){return(0,V_.hasBlockSupport)(e,"customClassName",!0)}};function hOe(e,t,o){return(0,V_.hasBlockSupport)(t,"customClassName",!0)&&o.className&&(e.className=V(e.className,o.className)),e}function gOe(e,t,o,r){if(!(0,V_.hasBlockSupport)(e.name,"customClassName",!0)||r.length===1&&e.innerBlocks.length===t.length||r.length===1&&t.length>1||r.length>1&&t.length===1)return e;if(t[o]){let n=t[o]?.attributes.className;if(n&&e.attributes.className===void 0)return{...e,attributes:{...e.attributes,className:n}}}return e}(0,pz.addFilter)("blocks.registerBlockType","core/editor/custom-class-name/attribute",mOe);(0,pz.addFilter)("blocks.switchToBlockType.transformedBlock","core/customClassName/addTransforms",gOe);var Xde=l(ut(),1),F_=l($(),1);function bOe(e,t){return(0,F_.hasBlockSupport)(t,"className",!0)&&(typeof e.className=="string"?e.className=[...new Set([(0,F_.getBlockDefaultClassName)(t.name),...e.className.split(" ")])].join(" ").trim():e.className=(0,F_.getBlockDefaultClassName)(t.name)),e}(0,Xde.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",bOe);var Ife=l(R(),1),Pfe=l(ut(),1),Dc=l($(),1),Rfe=l(Z(),1),Pk=l(Uv(),1);var xz=l($(),1),VR=l(R(),1),gfe=l(F(),1);var kOe=l($(),1);var vOe=l(w(),1),Qde="typography.lineHeight";var Jde=l(ut(),1),AR=l($(),1),efe=l(XE(),1),tfe=l(A(),1);var z_="typography.__experimentalFontFamily",{kebabCase:yOe}=M(tfe.privateApis);function SOe(e){return(0,AR.hasBlockSupport)(e,z_)&&(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}})),e}function ofe(e,t,o){if(!(0,AR.hasBlockSupport)(t,z_)||Ue(t,ds,"fontFamily")||!o?.fontFamily)return e;let r=new efe.default(e.className);r.add(`has-${yOe(o?.fontFamily)}-font-family`);let n=r.value;return e.className=n||void 0,e}function _Oe({name:e,fontFamily:t}){return ofe({},e,{fontFamily:t})}var gz={useBlockProps:_Oe,addSaveProps:ofe,attributeKeys:["fontFamily"],hasSupport(e){return(0,AR.hasBlockSupport)(e,z_)}};(0,Jde.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",SOe);var bz=l(ut(),1),Ek=l($(),1),rfe=l(XE(),1);var xOe=l(w(),1),_p="typography.fontSize";function wOe(e){return(0,Ek.hasBlockSupport)(e,_p)&&(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}})),e}function nfe(e,t,o){if(!(0,Ek.hasBlockSupport)(t,_p)||Ue(t,ds,"fontSize"))return e;let r=new rfe.default(e.className);r.add(hu(o.fontSize));let n=r.value;return e.className=n||void 0,e}function COe({name:e,fontSize:t,style:o}){let[r,n,i]=me("typography.fontSizes","typography.fluid","layout");if(!(0,Ek.hasBlockSupport)(e,_p)||Ue(e,ds,"fontSize")||!t&&!o?.typography?.fontSize)return;let s;if(o?.typography?.fontSize&&(s={style:{fontSize:ec({size:o.typography.fontSize},{typography:{fluid:n},layout:i})}}),t&&(s={style:{fontSize:oh(r,t,o?.typography?.fontSize).size}}),!!s)return nfe(s,e,{fontSize:t})}var kz={useBlockProps:COe,addSaveProps:nfe,attributeKeys:["fontSize","style"],hasSupport(e){return(0,Ek.hasBlockSupport)(e,_p)}},BOe={fontSize:[["fontSize"],["style","typography","fontSize"]]};function EOe(e,t,o,r){let n=e.name,i={fontSize:(0,Ek.hasBlockSupport)(n,_p)};return f2(i,BOe,e,t,o,r)}(0,bz.addFilter)("blocks.registerBlockType","core/font/addAttribute",wOe);(0,bz.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",EOe);var LR=l(N(),1),Tk=l($(),1);var vz=l(w(),1),Ik="typography.textAlign",TOe=[{icon:Jc,title:(0,LR.__)("Align text left"),align:"left"},{icon:Sf,title:(0,LR.__)("Align text center"),align:"center"},{icon:eu,title:(0,LR.__)("Align text right"),align:"right"}],ife=["left","center","right"],IOe=[];function yz(e){return Array.isArray(e)?ife.filter(t=>e.includes(t)):e===!0?ife:IOe}function POe({style:e,name:t,setAttributes:o}){let n=is(t)?.typography?.textAlign,i=ao();if(!n||i!=="default")return null;let s=yz((0,Tk.getBlockSupport)(t,Ik));if(!s.length)return null;let a=TOe.filter(u=>s.includes(u.align)),c=u=>{let d={...e,typography:{...e?.typography,textAlign:u}};o({style:Me(d)})};return(0,vz.jsx)(Mt,{group:"block",children:(0,vz.jsx)($w,{value:e?.typography?.textAlign,onChange:c,alignmentControls:a})})}var NR={edit:POe,useBlockProps:ROe,addSaveProps:OOe,attributeKeys:["style"],hasSupport(e){return(0,Tk.hasBlockSupport)(e,Ik,!1)}};function ROe({name:e,style:t}){if(!t?.typography?.textAlign||!yz((0,Tk.getBlockSupport)(e,Ik)).length||Ue(e,ds,"textAlign"))return null;let r=t.typography.textAlign;return{className:V({[`has-text-align-${r}`]:r})}}function OOe(e,t,o){if(!o?.style?.typography?.textAlign)return e;let{textAlign:r}=o.style.typography,n=(0,Tk.getBlockSupport)(t,Ik);return yz(n).includes(r)&&!Ue(t,ds,"textAlign")&&(e.className=V(`has-text-align-${r}`,e.className)),e}var _z=l(ut(),1),af=l($(),1),xp=l(R(),1),mfe=l(F(),1),j_=l(N(),1),MR=l(A(),1),pfe=l(Z(),1);function AOe(e,t){let o=e.scrollHeight>e.clientHeight,r=0,n=2400,i=r,s=window.getComputedStyle(e),a=parseFloat(s.paddingLeft)||0,c=parseFloat(s.paddingRight)||0,u=document.createRange();u.selectNodeContents(e);let d=e,f=e.parentElement;if(f){let h=window.getComputedStyle(f);h?.display==="flex"&&(d=f,a+=parseFloat(h.paddingLeft)||0,c+=parseFloat(h.paddingRight)||0)}let m=d.clientHeight;for(;r<=n;){let h=Math.floor((r+n)/2);t(h);let g=u.getBoundingClientRect().width,b=e.scrollWidth<=d.clientWidth&&g<=d.clientWidth-a-c,v=o||e.scrollHeight<=d.clientHeight||e.scrollHeight<=m;d.clientHeight>m&&(m=d.clientHeight),b&&v?(i=h,r=h+1):n=h-1}return u.detach(),i}function sfe(e,t){if(!e)return;t(0);let o=AOe(e,t);return t(o),o}var afe=l(R(),1),lfe=l(N(),1),cfe=l(A(),1),ufe=l(Xo(),1),Sz=l(w(),1);function dfe(){let e=(0,lfe.__)("The text may be too small to read. Consider using a larger container or less text.");return(0,afe.useEffect)(()=>{(0,ufe.speak)(e)},[e]),(0,Sz.jsx)("div",{className:"block-editor-fit-text-size-warning",children:(0,Sz.jsx)(cfe.Notice,{spokenMessage:null,status:"warning",isDismissible:!1,children:e})})}var Dn=l(w(),1),LOe={},NOe=12,Nc="typography.fitText";function MOe(e){return!(0,af.hasBlockSupport)(e,Nc)||e.attributes?.fitText?e:{...e,attributes:{...e.attributes,fitText:{type:"boolean"}}}}function DOe({fitText:e,name:t,clientId:o}){let[r,n]=(0,xp.useState)(null),i=(0,af.hasBlockSupport)(t,Nc),s=Xe(o),{blockAttributes:a,parentId:c,blockMode:u}=(0,mfe.useSelect)(f=>{if(!o||!i||!e)return LOe;let m=f(_).getBlockMode(o);return m==="html"?{blockMode:m}:{blockAttributes:f(_).getBlockAttributes(o),parentId:f(_).getBlockRootClientId(o),blockMode:m}},[o,i,e]),d=(0,xp.useCallback)(()=>{if(!s||!i||!e)return;let f=`fit-text-${o}`,m=s.ownerDocument.getElementById(f);m||(m=s.ownerDocument.createElement("style"),m.id=f,s.ownerDocument.head.appendChild(m));let h=`#block-${o}`,g=sfe(s,b=>{b===0?m.textContent="":m.textContent=`${h} { font-size: ${b}px !important; }`});n(g)},[s,o,i,e]);return(0,xp.useEffect)(()=>{if(!e||!s||!o||!i||u==="html")return;let f=s,m=f.style.visibility,h=null,p=null,g=null;h=window.requestAnimationFrame(()=>{f.style.visibility="hidden",p=window.requestAnimationFrame(()=>{d(),g=setTimeout(()=>{f.style.visibility=m},10)})});let b;return window.ResizeObserver&&f.parentElement&&(b=new window.ResizeObserver(d),b.observe(f.parentElement),b.observe(f)),()=>{h!==null&&window.cancelAnimationFrame(h),p!==null&&window.cancelAnimationFrame(p),g!==null&&clearTimeout(g),b&&b.disconnect();let v=`fit-text-${o}`,k=f.ownerDocument.getElementById(v);k&&k.remove()}},[e,o,c,d,s,i,u]),(0,xp.useEffect)(()=>{if(e&&s&&i&&u!=="html"){let f=window.requestAnimationFrame(()=>{s&&d()});return()=>window.cancelAnimationFrame(f)}},[a,e,d,s,i,u]),{fontSize:r}}function ffe({clientId:e,fitText:t=!1,setAttributes:o,name:r,fontSize:n,style:i,warning:s}){return(0,af.hasBlockSupport)(r,Nc)?(0,Dn.jsx)(fe,{group:"typography",children:(0,Dn.jsxs)(MR.__experimentalToolsPanelItem,{hasValue:()=>t,label:(0,j_.__)("Fit text"),onDeselect:()=>o({fitText:void 0}),resetAllFilter:()=>({fitText:void 0}),panelId:e,children:[(0,Dn.jsx)(MR.ToggleControl,{label:(0,j_.__)("Fit text"),checked:t,onChange:()=>{let a=!t||void 0,c={fitText:a};a&&(n&&(c.fontSize=void 0),i?.typography?.fontSize&&(c.style={...i,typography:{...i?.typography,fontSize:void 0}})),o(c)},help:t?(0,j_.__)("Text will resize to fit its container."):(0,j_.__)("The text will resize to fit its container, resetting other font size settings.")}),s]})}):null}function VOe(e,t,o){if(!(0,af.hasBlockSupport)(t,Nc))return e;let{fitText:r}=o;if(!r)return e;let n=e.className?`${e.className} has-fit-text`:"has-fit-text";return{...e,className:n}}function FOe({name:e,fitText:t}){return t&&(0,af.hasBlockSupport)(e,Nc)?{className:"has-fit-text"}:{}}(0,_z.addFilter)("blocks.registerBlockType","core/fit-text/addAttribute",MOe);var zOe=e=>(0,af.hasBlockSupport)(e,Nc);function jOe({fitText:e,name:t,clientId:o,children:r}){let{fontSize:n}=DOe({fitText:e,name:t,clientId:o});return r(n)}var UOe=(0,pfe.createHigherOrderComponent)(e=>function(o){let{name:r,attributes:n,clientId:i,isSelected:s,setAttributes:a}=o,{fitText:c}=n;return(0,af.hasBlockSupport)(r,Nc)?(0,Dn.jsxs)(Dn.Fragment,{children:[(0,Dn.jsx)(e,{...o}),c&&(0,Dn.jsx)(jOe,{fitText:c,name:r,clientId:i,children:d=>s&&(0,Dn.jsx)(ffe,{clientId:i,fitText:c,setAttributes:a,name:r,fontSize:n.fontSize,style:n.style,warning:dnull};var wz=l(w(),1);function hfe(e,t){return Object.fromEntries(Object.entries(e).filter(([o])=>!t.includes(o)))}var HOe="typography.__experimentalLetterSpacing",GOe="typography.__experimentalTextTransform",WOe="typography.__experimentalTextDecoration",$Oe="typography.textIndent",KOe="typography.textColumns",YOe="typography.__experimentalFontStyle",qOe="typography.__experimentalFontWeight",ZOe="typography.__experimentalWritingMode",ds="typography",bfe=[Qde,_p,YOe,qOe,z_,Ik,KOe,WOe,$Oe,ZOe,GOe,HOe,Nc];function kfe(e){let t={...hfe(e,["fontFamily"])},o=e?.typography?.fontSize,r=e?.typography?.fontFamily,n=typeof o=="string"&&o?.startsWith("var:preset|font-size|")?o.substring(21):void 0,i=r?.startsWith("var:preset|font-family|")?r.substring(23):void 0;return t.typography={...hfe(t.typography,["fontFamily"]),fontSize:n?void 0:o},{style:Me(t),fontFamily:i,fontSize:n}}function vfe(e){return{...e.style,typography:{...e.style?.typography,fontFamily:e.fontFamily?"var:preset|font-family|"+e.fontFamily:void 0,fontSize:e.fontSize?"var:preset|font-size|"+e.fontSize:e.style?.typography?.fontSize}}}function XOe({children:e,resetAllFilter:t}){let o=(0,VR.useCallback)(r=>{let n=vfe(r),i=t(n);return{...r,...kfe(i)}},[t]);return(0,wz.jsx)(fe,{group:"typography",resetAllFilter:o,children:e})}function yfe({clientId:e,name:t,setAttributes:o,settings:r}){let n=RP(r),{style:i,fontFamily:s,fontSize:a,fitText:c}=(0,gfe.useSelect)(m=>{if(!n)return{};let{style:h,fontFamily:p,fontSize:g,fitText:b}=m(_).getBlockAttributes(e)||{};return{style:h,fontFamily:p,fontSize:g,fitText:b}},[e,n]),u=(0,VR.useMemo)(()=>vfe({style:i,fontFamily:s,fontSize:a}),[i,a,s]),d=m=>{let h=kfe(m);(h.fontSize||h.style?.typography?.fontSize)&&c&&(h.fitText=void 0),o(h)};if(!n)return null;let f=(0,xz.getBlockSupport)(t,[ds,"__experimentalDefaultControls"]);return(0,wz.jsx)(OP,{as:XOe,panelId:e,settings:r,value:u,onChange:d,defaultControls:f})}var cf=l(R(),1),zR=l(F(),1),FR=l($(),1),Cfe=l(Re(),1);var cl=l(R(),1),Sfe=l(Jy(),1);var U_=l(w(),1);function _fe({clientId:e,value:t,computeStyle:o,forceShow:r}){let n=Xe(e),[i,s]=(0,cl.useReducer)(()=>o(n));(0,cl.useEffect)(()=>{n&&r&&s()},[n,r]),(0,cl.useEffect)(()=>{if(!n)return;let d=new window.MutationObserver(s);return d.observe(n,{attributes:!0,attributeFilter:["style","class"]}),()=>{d.disconnect()}},[n]);let a=(0,cl.useRef)(t),[c,u]=(0,cl.useState)(!1);return(0,cl.useEffect)(()=>{if((0,Sfe.isShallowEqual)(t,a.current)||r)return;u(!0),a.current=t;let d=setTimeout(()=>{u(!1)},400);return()=>{u(!1),clearTimeout(d)}},[t,r]),!c&&!r?null:(0,U_.jsx)(Hi,{clientId:e,__unstablePopoverSlot:"block-toolbar",children:(0,U_.jsx)("div",{className:"block-editor__spacing-visualizer",style:i})})}function lf(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function xfe({clientId:e,value:t,forceShow:o}){return(0,U_.jsx)(_fe,{clientId:e,value:t?.spacing?.margin,computeStyle:r=>{let n=lf(r,"margin-top"),i=lf(r,"margin-right"),s=lf(r,"margin-bottom"),a=lf(r,"margin-left");return{borderTopWidth:n,borderRightWidth:i,borderBottomWidth:s,borderLeftWidth:a,top:n?`-${n}`:0,right:i?`-${i}`:0,bottom:s?`-${s}`:0,left:a?`-${a}`:0}},forceShow:o})}function wfe({clientId:e,value:t,forceShow:o}){return(0,U_.jsx)(_fe,{clientId:e,value:t?.spacing?.padding,computeStyle:r=>({borderTopWidth:lf(r,"padding-top"),borderRightWidth:lf(r,"padding-right"),borderBottomWidth:lf(r,"padding-bottom"),borderLeftWidth:lf(r,"padding-left")}),forceShow:o})}var Mc=l(w(),1),ul="dimensions",H_="spacing";function QOe(){let[e,t]=(0,cf.useState)(!1),{hideBlockInterface:o,showBlockInterface:r}=M((0,zR.useDispatch)(_));return(0,cf.useEffect)(()=>{e?o():r()},[e,r,o]),[e,t]}function JOe({children:e,resetAllFilter:t}){let o=(0,cf.useCallback)(r=>{let n=r.style,i=t(n);return{...r,style:i}},[t]);return(0,Mc.jsx)(fe,{group:"dimensions",resetAllFilter:o,children:e})}function Bfe({clientId:e,name:t,setAttributes:o,settings:r}){let n=MP(r),i=(0,zR.useSelect)(m=>{if(n)return m(_).getBlockAttributes(e)?.style},[e,n]),[s,a]=QOe(),c=m=>{o({style:Me(m)})};if(!n)return null;let u=(0,FR.getBlockSupport)(t,[ul,"__experimentalDefaultControls"]),d=(0,FR.getBlockSupport)(t,[H_,"__experimentalDefaultControls"]),f={...u,...d};return(0,Mc.jsxs)(Mc.Fragment,{children:[(0,Mc.jsx)(DP,{as:JOe,panelId:e,settings:r,value:i,onChange:c,defaultControls:f,onVisualize:a}),!!r?.spacing?.padding&&s==="padding"&&(0,Mc.jsx)(wfe,{forceShow:s==="padding",clientId:e,value:i}),!!r?.spacing?.margin&&s==="margin"&&(0,Mc.jsx)(xfe,{forceShow:s==="margin",clientId:e,value:i})]})}function Efe(e,t="any"){if(cf.Platform.OS!=="web")return!1;let o=(0,FR.getBlockSupport)(e,ul);return o===!0?!0:t==="any"?!!(o?.aspectRatio||o?.height||o?.minHeight||o?.width):!!o?.[t]}var Tfe={useBlockProps:eAe,attributeKeys:["height","minHeight","width","style"],hasSupport(e){return Efe(e)}};function eAe({name:e,height:t,minHeight:o,style:r}){if(!Efe(e,"aspectRatio")||Ue(e,ul,"aspectRatio"))return{};let n=V({"has-aspect-ratio":!!r?.dimensions?.aspectRatio}),i={};return r?.dimensions?.aspectRatio?(i.minHeight="unset",i.height="unset"):(o||r?.dimensions?.minHeight||t||r?.dimensions?.height)&&(i.aspectRatio="unset"),{className:n,style:i}}function Cz(){(0,Cfe.default)("wp.blockEditor.__experimentalUseCustomSides",{since:"6.3",version:"6.4"})}var dl=l(w(),1),tAe=[...bfe,cp,ir,ul,up,H_,S_],Ez=e=>tAe.some(t=>(0,Dc.hasBlockSupport)(e,t));function bi(e={}){let t={};return(0,Pk.getCSSRules)(e).forEach(o=>{t[o.key]=o.value}),t}function oAe(e){return!Ez(e)&&!(0,Dc.hasBlockSupport)(e,"customCSS",!0)||e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e}var Ofe={[`${cp}.__experimentalSkipSerialization`]:["border"],[`${ir}.__experimentalSkipSerialization`]:[ir],[`${ds}.__experimentalSkipSerialization`]:[ds],[`${ul}.__experimentalSkipSerialization`]:[ul],[`${H_}.__experimentalSkipSerialization`]:[H_],[`${S_}.__experimentalSkipSerialization`]:[S_]},rAe={...Ofe,[`${ul}.aspectRatio`]:[`${ul}.aspectRatio`],[`${up}`]:[up]},nAe={[`${ul}.aspectRatio`]:!0,[`${up}`]:!0},iAe={gradients:"gradient"};function Bz(e,t,o=!1){if(!e)return e;let r=e;return o||(r=JSON.parse(JSON.stringify(e))),Array.isArray(t)||(t=[t]),t.forEach(n=>{if(Array.isArray(n)||(n=n.split(".")),n.length>1){let[i,...s]=n;Bz(r[i],[s],!0)}else n.length===1&&delete r[n[0]]}),r}function Afe(e,t,o,r=rAe){if(!Ez(t))return e;let{style:n}=o;return Object.entries(r).forEach(([i,s])=>{let a=nAe[i]||(0,Dc.getBlockSupport)(t,i);a===!0&&(n=Bz(n,s)),Array.isArray(a)&&a.forEach(c=>{let u=iAe[c]||c;n=Bz(n,[[...s,u]])})}),e.style={...bi(n),...e.style},e}function sAe({clientId:e,name:t,setAttributes:o,__unstableParentLayout:r}){let n=is(t,r),i=ao(),s={clientId:e,name:t,setAttributes:o,settings:{...n,typography:{...n.typography,textAlign:!1}}};return i!=="default"?null:(0,dl.jsxs)(dl.Fragment,{children:[(0,dl.jsx)(d2,{...s}),(0,dl.jsx)(vae,{...s}),(0,dl.jsx)(yfe,{...s}),(0,dl.jsx)(pae,{...s}),(0,dl.jsx)(Bfe,{...s})]})}var jR={edit:sAe,hasSupport:Ez,addSaveProps:Afe,attributeKeys:["style"],useBlockProps:cAe},aAe=[{elementType:"button"},{elementType:"link",pseudo:[":hover"]},{elementType:"heading",elements:["h1","h2","h3","h4","h5","h6"]}],lAe={};function cAe({name:e,style:t}){let o=(0,Rfe.useInstanceId)(lAe,"wp-elements"),r=`.${o}`,n=t?.elements,i=(0,Ife.useMemo)(()=>{if(!n)return;let s=[];return aAe.forEach(({elementType:a,pseudo:c,elements:u})=>{if(Ue(e,ir,a))return;let f=n?.[a];if(f){let m=bg(r,Dc.__EXPERIMENTAL_ELEMENTS[a]);s.push((0,Pk.compileCSS)(f,{selector:m})),c&&c.forEach(h=>{f[h]&&s.push((0,Pk.compileCSS)(f[h],{selector:bg(r,`${Dc.__EXPERIMENTAL_ELEMENTS[a]}${h}`)}))})}u&&u.forEach(m=>{n[m]&&s.push((0,Pk.compileCSS)(n[m],{selector:bg(r,Dc.__EXPERIMENTAL_ELEMENTS[m])}))})}),s.length>0?s.join(""):void 0},[r,n,e]);return Qn({css:i}),Afe({className:o},e,{style:t},Ofe)}(0,Pfe.addFilter)("blocks.registerBlockType","core/style/addAttribute",oAe);var Lfe=l(ut(),1),Nfe=l($(),1),uAe=e=>(0,Nfe.hasBlockSupport)(e,"__experimentalSettings",!1);function dAe(e){return uAe(e)&&(e?.attributes?.settings||(e.attributes={...e.attributes,settings:{type:"object"}})),e}(0,Lfe.addFilter)("blocks.registerBlockType","core/settings/addAttribute",dAe);var uf=l($(),1),Vfe=l(Z(),1),Ffe=l(ut(),1),G_=l(R(),1);function fAe(e=[]){let t={r:[],g:[],b:[],a:[]};return e.forEach(o=>{let r=Bt(o).toRgb();t.r.push(r.r/255),t.g.push(r.g/255),t.b.push(r.b/255),t.a.push(r.a)}),t}function Mfe(e){return`${e}{filter:none}`}function Dfe(e,t){return`${e}{filter:url(#${t})}`}function UR(e,t){let o=fAe(t);return` `}var Vc=l(w(),1),Tz=[],mAe=window?.navigator.userAgent&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&!window.navigator.userAgent.includes("Chromium");Kc([Yc]);function Iz({presetSetting:e,defaultSetting:t}){let[o,r,n,i]=me(t,`${e}.custom`,`${e}.theme`,`${e}.default`);return(0,G_.useMemo)(()=>[...r||Tz,...n||Tz,...o&&i||Tz],[o,r,n,i])}function zfe(e,t){if(!e)return;let o=t?.find(({slug:r})=>e===`var:preset|duotone|${r}`);return o?o.colors:void 0}function pAe(e,t){if(!e||!Array.isArray(e))return;let o=t?.find(r=>r?.colors?.every((n,i)=>n===e[i]));return o?`var:preset|duotone|${o.slug}`:void 0}function hAe({style:e,setAttributes:t,name:o}){let r=e?.color?.duotone,n=is(o),i=ao(),s=Iz({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=Iz({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),[c,u]=me("color.custom","color.customDuotone"),d=!c,f=!u||a?.length===0&&d;if(s?.length===0&&f||i!=="default")return null;let m=r==="unset"||Array.isArray(r)?r:zfe(r,s);return(0,Vc.jsxs)(Vc.Fragment,{children:[(0,Vc.jsx)(fe,{group:"filter",children:(0,Vc.jsx)(KP,{value:{filter:{duotone:m}},onChange:h=>{let p={...e,color:{...h?.filter}};t({style:Me(p)})},settings:n})}),(0,Vc.jsx)(Mt,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,Vc.jsx)(eI,{duotonePalette:s,colorPalette:a,disableCustomDuotone:f,disableCustomColors:d,value:m,onChange:h=>{let p=pAe(h,s),g={...e,color:{...e?.color,duotone:p??h}};t({style:Me(g)})},settings:n})})]})}var Pz={shareWithChildBlocks:!0,edit:hAe,useBlockProps:vAe,attributeKeys:["style"],hasSupport(e){return(0,uf.hasBlockSupport)(e,"filter.duotone")}};function gAe(e){return(0,uf.hasBlockSupport)(e,"filter.duotone")&&(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}})),e}function bAe({clientId:e,id:t,selector:o,attribute:r}){let n=Iz({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),i=Array.isArray(r),s=i?void 0:zfe(r,n),a=typeof r=="string"&&s,c=typeof r=="string"&&!a,u=null;a?u=s:(c||i)&&(u=r);let m=o.split(",").map(g=>`.${t}${g.trim()}`).join(", "),h=Array.isArray(u)||u==="unset";tc(h?{css:u!=="unset"?Dfe(m,t):Mfe(m),__unstableType:"presets"}:void 0),tc(h?{assets:u!=="unset"?UR(t,u):"",__unstableType:"svgs"}:void 0);let p=Xe(e);(0,G_.useEffect)(()=>{if(h&&p&&mAe){let g=p.style.display;p.style.setProperty("display","inline-block"),p.offsetHeight,p.style.setProperty("display",g)}},[h,p,u])}var kAe={};function vAe({clientId:e,name:t,style:o}){let r=(0,Vfe.useInstanceId)(kAe),n=(0,G_.useMemo)(()=>{let c=(0,uf.getBlockType)(t);if(c){if(!(0,uf.getBlockSupport)(c,"filter.duotone",!1))return null;let d=(0,uf.getBlockSupport)(c,"color.__experimentalDuotone",!1);if(d){let f=oi(c);return typeof d=="string"?bg(f,d):f}return oi(c,"filter.duotone",{fallback:!0})}},[t]),i=o?.color?.duotone,s=`wp-duotone-${r}`,a=n&&i;return bAe({clientId:e,id:s,selector:n,attribute:i}),{className:a?s:""}}(0,Ffe.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",gAe);var GR=l(R(),1),W_=l(F(),1),jfe=l(Z(),1),$_=l($(),1),K_=l(N(),1);var Ufe=l(Un(),1);var HR=l(w(),1),yAe={},SAe={};function _Ae({blockName:e,setAttributes:t,style:o}){if(ao()!=="default")return null;let n=(0,$_.getBlockType)(e);function i(a){let c=a?.css?.trim()?a.css:void 0;t({style:Me({...a,css:c})})}let s=(0,K_.sprintf)((0,K_.__)("Add your own CSS to customize the appearance of the %s block. You do not need to include a CSS selector, just add the property and value, e.g. color: red;."),n?.title);return(0,HR.jsx)(fe,{group:"advanced",children:(0,HR.jsx)(ZP,{value:o,onChange:i,inheritedValue:o,help:s})})}var xAe="custom-css-edit-warning";function wAe({clientId:e,name:t,setAttributes:o}){let{style:r,canEditCSS:n}=(0,W_.useSelect)(i=>{let{getBlockAttributes:s,getSettings:a}=i(_);return{style:s(e)?.style||SAe,canEditCSS:a().canEditCSS}},[e]);return n?(0,HR.jsx)(_Ae,{blockName:t,setAttributes:o,style:r}):null}function CAe({style:e}){let t=e?.css,o=typeof t=="string"&&t.trim().length>0&&qP(t),r=(0,W_.useSelect)(u=>u(_).getSettings().canEditCSS,[]),{createWarningNotice:n}=(0,W_.useDispatch)(Ufe.store),i=!!t?.trim();(0,GR.useEffect)(()=>{!r&&i&&n((0,K_.__)("This post contains blocks with custom CSS. You do not have permission to edit CSS. If you save this post, the custom CSS will be removed."),{id:xAe,isDismissible:!0})},[r,i,n]);let s=(0,jfe.useInstanceId)(yAe,"wp-custom-css"),a=`.${s}`,c=(0,GR.useMemo)(()=>{if(o)return CS(t,a)},[t,a,o]);return Qn({css:c}),o?{className:`has-custom-css ${s}`}:{}}function BAe(e,t,o){if(!(0,$_.hasBlockSupport)(t,"customCSS",!0)||!o?.style?.css?.trim())return e;let r=e.className?`${e.className} has-custom-css`:"has-custom-css";return{...e,className:r}}var WR={edit:wAe,useBlockProps:CAe,addSaveProps:BAe,attributeKeys:["style"],hasSupport(e){return(0,$_.hasBlockSupport)(e,"customCSS",!0)}};var $R=l(Z(),1),Oz=l(ut(),1),Fc=l($(),1),KR=l(F(),1),fl=l(A(),1),Rk=l(N(),1);var Yo=l(w(),1),EAe="is-style-",Az="layout",{kebabCase:Rz}=M(fl.privateApis);function Lz(e){return(0,Fc.hasBlockSupport)(e,"layout")||(0,Fc.hasBlockSupport)(e,"__experimentalLayout")}function YR(e={},t=""){let{layout:o}=e,{default:r}=(0,Fc.getBlockSupport)(t,Az)||{},n=o?.inherit||o?.contentSize||o?.wideSize?{...o,type:"constrained"}:o||r||{},i=[];if(Hn[n?.type||"default"]?.className){let a=Hn[n?.type||"default"]?.className,c=t.split("/"),d=`wp-block-${c[0]==="core"?c.pop():c.join("-")}-${a}`;i.push(a,d)}return(0,KR.useSelect)(a=>!n?.inherit&&!n?.contentSize&&n?.type!=="constrained"?!1:a(_).getSettings().__experimentalFeatures?.useRootPaddingAwareAlignments,[n?.contentSize,n?.inherit,n?.type])&&i.push("has-global-padding"),n?.orientation&&i.push(`is-${Rz(n.orientation)}`),n?.justifyContent&&i.push(`is-content-justification-${Rz(n.justifyContent)}`),n?.flexWrap&&n.flexWrap==="nowrap"&&i.push("is-nowrap"),i}function Nz(e={},t,o){let{layout:r={},style:n={}}=e,i=r?.inherit||r?.contentSize||r?.wideSize?{...r,type:"constrained"}:r||{},s=xs(i?.type||"default"),[a]=me("spacing.blockGap"),c=a!==null;return s?.getLayoutStyle?.({blockName:t,selector:o,layout:r,style:n,hasBlockGapSupport:c})}function TAe({layout:e,setAttributes:t,name:o,clientId:r}){let n=is(o),{layout:i}=n,{themeSupportsLayout:s}=(0,KR.useSelect)(T=>{let{getSettings:O}=T(_);return{themeSupportsLayout:O().supportsLayout}},[]);if(ao()!=="default")return null;let c=(0,Fc.getBlockSupport)(o,Az,{}),u={...i,...c},{allowSwitching:d,allowEditing:f=!0,allowInheriting:m=!0,default:h}=u;if(!f)return null;let p={...c,...e},{type:g,default:{type:b="default"}={}}=p,v=g||b,k=!!(m&&(!v||v==="default"||v==="constrained"||p.inherit)),y=e||h||{},{inherit:S=!1,contentSize:x=null}=y;if((v==="default"||v==="constrained")&&!s)return null;let C=xs(v),B=xs("constrained"),I=!y.type&&(x||S),P=!!S||!!x,E=T=>t({layout:{type:T}}),L=T=>t({layout:T});return(0,Yo.jsxs)(Yo.Fragment,{children:[(0,Yo.jsx)(fe,{children:(0,Yo.jsxs)(fl.PanelBody,{title:(0,Rk.__)("Layout"),children:[k&&(0,Yo.jsx)(Yo.Fragment,{children:(0,Yo.jsx)(fl.ToggleControl,{label:(0,Rk.__)("Inner blocks use content width"),checked:C?.name==="constrained"||P,onChange:()=>t({layout:{type:C?.name==="constrained"||P?"default":"constrained"}}),help:C?.name==="constrained"||P?(0,Rk.__)("Nested blocks use content width with options for full and wide widths."):(0,Rk.__)("Nested blocks will fill the width of this container.")})}),!S&&d&&(0,Yo.jsx)(IAe,{type:v,onChange:E}),C&&C.name!=="default"&&(0,Yo.jsx)(C.inspectorControls,{layout:y,onChange:L,layoutBlockSupport:u,name:o,clientId:r}),B&&I&&(0,Yo.jsx)(B.inspectorControls,{layout:y,onChange:L,layoutBlockSupport:u,name:o,clientId:r})]})}),!S&&C&&(0,Yo.jsx)(C.toolBarControls,{layout:y,onChange:L,layoutBlockSupport:c,name:o,clientId:r})]})}var Hfe={shareWithChildBlocks:!0,edit:TAe,attributeKeys:["layout"],hasSupport(e){return Lz(e)}};function IAe({type:e,onChange:t}){return(0,Yo.jsx)(fl.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,isBlock:!0,label:(0,Rk.__)("Layout type"),hideLabelFromVision:!0,isAdaptiveWidth:!0,value:e,onChange:t,children:fH().map(({name:o,label:r})=>(0,Yo.jsx)(fl.__experimentalToggleGroupControlOption,{value:o,label:r},o))})}function PAe(e){return"type"in(e.attributes?.layout??{})||Lz(e)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e}function RAe({block:e,props:t,blockGapSupport:o,globalBlockGapValue:r,layoutClasses:n}){let{name:i,attributes:s}=t,a=(0,$R.useInstanceId)(e),{layout:c}=s,{default:u}=(0,Fc.getBlockSupport)(i,Az)||{},d=c?.inherit||c?.contentSize||c?.wideSize?{...c,type:"constrained"}:c||u||{},f=`wp-container-${Rz(i)}-is-layout-`,m=`.${f}${a}`,h=o!==null,g=xs(d?.type||"default")?.getLayoutStyle?.({blockName:i,selector:m,layout:d,style:s?.style,hasBlockGapSupport:h,globalBlockGapValue:r}),b=V({[`${f}${a}`]:!!g},n);return Qn({css:g}),(0,Yo.jsx)(e,{...t,__unstableLayoutClassNames:b})}var OAe=(0,$R.createHigherOrderComponent)(e=>function(o){let{clientId:r,name:n,attributes:i}=o,s=Lz(n),a=YR(i,n),c=(0,KR.useSelect)(u=>{if(!s)return;let{getSettings:d,getBlockSettings:f}=M(u(_)),m=d(),{disableLayoutStyles:h}=m;if(h)return;let[p]=f(r,"spacing.blockGap"),g=m[xi],b,v=i?.className;if(v?.includes(EAe)){let{getBlockStyles:y}=u(Fc.store),S=y(n),x=jV(v,S);b=x?g?.blocks?.[n]?.variations?.[x]?.spacing?.blockGap:void 0}let k=b??g?.blocks?.[n]?.spacing?.blockGap??g?.spacing?.blockGap;return{blockGapSupport:p,globalBlockGapValue:k}},[s,r,i?.className,n]);return c?(0,Yo.jsx)(RAe,{block:e,props:o,layoutClasses:a,...c}):(0,Yo.jsx)(e,{...o,__unstableLayoutClassNames:s?a:void 0})},"withLayoutStyles");(0,Oz.addFilter)("blocks.registerBlockType","core/layout/addAttribute",PAe);(0,Oz.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",OAe);var Xfe=l(Z(),1),zz=l(F(),1),Qfe=l(R(),1);var fs=l(R(),1),df=l(F(),1),Wfe=l(Z(),1);function q_(e,t){return Array.from({length:t},(o,r)=>e+r)}var aa=class{constructor({columnStart:e,rowStart:t,columnEnd:o,rowEnd:r,columnSpan:n,rowSpan:i}={}){this.columnStart=e??1,this.rowStart=t??1,n!==void 0?this.columnEnd=this.columnStart+n-1:this.columnEnd=o??this.columnStart,i!==void 0?this.rowEnd=this.rowStart+i-1:this.rowEnd=r??this.rowStart}get columnSpan(){return this.columnEnd-this.columnStart+1}get rowSpan(){return this.rowEnd-this.rowStart+1}contains(e,t){return e>=this.columnStart&&e<=this.columnEnd&&t>=this.rowStart&&t<=this.rowEnd}containsRect(e){return this.contains(e.columnStart,e.rowStart)&&this.contains(e.columnEnd,e.rowEnd)}intersectsRect(e){return this.columnStart<=e.columnEnd&&this.columnEnd>=e.columnStart&&this.rowStart<=e.rowEnd&&this.rowEnd>=e.rowStart}};function Bo(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function Y_(e,t){let o=[];for(let r of e.split(" ")){let n=o[o.length-1],i=n?n.end+t:0,s=i+parseFloat(r);o.push({start:i,end:s})}return o}function zc(e,t,o="start"){return e.reduce((r,n,i)=>Math.abs(n[o]-t)a(_).getSettings().isDistractionFree,[]),i=Xe(e);if(n||!i)return null;let s=o?.isManualPlacement&&window.__experimentalEnableGridInteractivity;return(0,ki.jsx)(LAe,{gridClientId:e,gridElement:i,isManualGrid:s,ref:t,childGridClientId:r})}var LAe=(0,fs.forwardRef)(({gridClientId:e,gridElement:t,isManualGrid:o,childGridClientId:r},n)=>{let[i,s]=(0,fs.useState)(()=>Mz(t)),[a,c]=(0,fs.useState)(!1),u=Xe(r),d=(0,fs.useMemo)(()=>u?Gfe(u):null,[u]);return(0,fs.useEffect)(()=>{let f=()=>s(Mz(t)),m=new window.ResizeObserver(f);m.observe(t,{box:"border-box"});let h=new window.ResizeObserver(f);return h.observe(t),()=>{m.disconnect(),h.disconnect()}},[t]),(0,fs.useEffect)(()=>{function f(){c(!0)}function m(){c(!1)}return document.addEventListener("drag",f),document.addEventListener("dragend",m),()=>{document.removeEventListener("drag",f),document.removeEventListener("dragend",m)}},[]),(0,ki.jsx)(Hi,{className:V("block-editor-grid-visualizer",{"is-dropping-allowed":a}),clientId:e,__unstablePopoverSlot:"__unstable-block-tools-after",children:(0,ki.jsx)("div",{ref:n,className:"block-editor-grid-visualizer__grid",style:i.style,children:o?(0,ki.jsx)(MAe,{gridClientId:e,gridInfo:i,childGridRect:d}):(0,ki.jsx)(NAe,{gridInfo:i,childGridRect:d})})})});function NAe({gridInfo:e,childGridRect:t}){return q_(1,e.numRows).map(o=>q_(1,e.numColumns).map(r=>{let n=e.currentColor;return t?.contains(r,o)&&(n="transparent"),(0,ki.jsx)($fe,{color:n},`${o}-${r}`)}))}function MAe({gridClientId:e,gridInfo:t,childGridRect:o}){let[r,n]=(0,fs.useState)(null),i=(0,df.useSelect)(a=>{let{getBlockOrder:c,getBlockStyles:u}=M(a(_)),d=c(e);return u(d)},[e]),s=(0,fs.useMemo)(()=>{let a=[];for(let c of Object.values(i)){let{columnStart:u,rowStart:d,columnSpan:f=1,rowSpan:m=1}=c?.layout??{};!u||!d||a.push(new aa({columnStart:u,rowStart:d,columnSpan:f,rowSpan:m}))}return a},[i]);return q_(1,t.numRows).map(a=>q_(1,t.numColumns).map(c=>{let u=o?.contains(c,a),d=t.currentColor;u&&(d="transparent");let f=s.some(h=>h.contains(c,a)),m=r?.contains(c,a)??!1;return(0,ki.jsx)($fe,{color:d,className:m&&"is-highlighted",children:f&&!u?(0,ki.jsx)(DAe,{column:c,row:a,gridClientId:e,gridInfo:t,setHighlightedRect:n}):(0,ki.jsx)(VAe,{column:c,row:a,gridClientId:e,gridInfo:t,setHighlightedRect:n})},`${a}-${c}`)}))}function $fe({color:e,children:t,className:o}){return(0,ki.jsx)("div",{className:V("block-editor-grid-visualizer__cell",o),style:{boxShadow:`inset 0 0 0 1px color-mix(in srgb, ${e} 20%, #0000)`,color:e},children:t})}function Kfe(e,t,o,r,n){let{getBlockAttributes:i,getBlockRootClientId:s,canInsertBlockType:a,getBlockName:c}=(0,df.useSelect)(_),{updateBlockAttributes:u,moveBlocksToPosition:d,__unstableMarkNextChangeAsNotPersistent:f}=(0,df.useDispatch)(_),m=np(o,r.numColumns);return FAe({validateDrag(h){let p=c(h);if(!a(p,o))return!1;let g=i(h),b=new aa({columnStart:e,rowStart:t,columnSpan:g.style?.layout?.columnSpan,rowSpan:g.style?.layout?.rowSpan});return new aa({columnSpan:r.numColumns,rowSpan:r.numRows}).containsRect(b)},onDragEnter(h){let p=i(h);n(new aa({columnStart:e,rowStart:t,columnSpan:p.style?.layout?.columnSpan,rowSpan:p.style?.layout?.rowSpan}))},onDragLeave(){n(h=>h?.columnStart===e&&h?.rowStart===t?null:h)},onDrop(h){n(null);let p=i(h);u(h,{style:{...p.style,layout:{...p.style?.layout,columnStart:e,rowStart:t}}}),f(),d([h],s(h),o,m(e,t))}})}function DAe({column:e,row:t,gridClientId:o,gridInfo:r,setHighlightedRect:n}){return(0,ki.jsx)("div",{className:"block-editor-grid-visualizer__drop-zone",ref:Kfe(e,t,o,r,n)})}function VAe({column:e,row:t,gridClientId:o,gridInfo:r,setHighlightedRect:n}){let{updateBlockAttributes:i,moveBlocksToPosition:s,__unstableMarkNextChangeAsNotPersistent:a}=(0,df.useDispatch)(_),c=np(o,r.numColumns);return(0,ki.jsx)(Qu,{rootClientId:o,className:"block-editor-grid-visualizer__appender",ref:Kfe(e,t,o,r,n),style:{color:r.currentColor},onSelect:u=>{u&&(i(u.clientId,{style:{layout:{columnStart:e,rowStart:t}}}),a(),s([u.clientId],o,o,c(e,t)))}})}function FAe({validateDrag:e,onDragEnter:t,onDragLeave:o,onDrop:r}){let{getDraggedBlockClientIds:n}=(0,df.useSelect)(_);return(0,Wfe.__experimentalUseDropZone)({onDragEnter(){let[i]=n();i&&e(i)&&t(i)},onDragLeave(){o()},onDrop(){let[i]=n();i&&e(i)&&r(i)}})}var Yfe=l(A(),1),X_=l(R(),1);var qR=l(w(),1);function Dz({clientId:e,bounds:t,onChange:o,parentLayout:r}){let n=Xe(e),i=n?.parentElement,{isManualPlacement:s}=r;return!n||!i?null:(0,qR.jsx)(zAe,{clientId:e,bounds:t,blockElement:n,rootBlockElement:i,onChange:o,isManualGrid:s&&window.__experimentalEnableGridInteractivity})}function zAe({clientId:e,bounds:t,blockElement:o,rootBlockElement:r,onChange:n,isManualGrid:i}){let[s,a]=(0,X_.useState)(null),[c,u]=(0,X_.useState)({top:!1,bottom:!1,left:!1,right:!1});(0,X_.useEffect)(()=>{let h=new window.ResizeObserver(()=>{let p=o.getBoundingClientRect(),g=r.getBoundingClientRect(),b=p.top>g.top,v=p.bottomg.left,y=p.righth.disconnect()},[o,r,i]);let d={right:"left",left:"right"},f={top:"flex-end",bottom:"flex-start"},m={display:"flex",justifyContent:"center",alignItems:"center",...d[s]&&{justifyContent:d[s]},...f[s]&&{alignItems:f[s]}};return(0,qR.jsx)(Hi,{className:"block-editor-grid-item-resizer",clientId:e,__unstablePopoverSlot:"__unstable-block-tools-after",additionalStyles:m,children:(0,qR.jsx)(Yfe.ResizableBox,{className:"block-editor-grid-item-resizer__box",size:{width:"100%",height:"100%"},enable:{bottom:c.bottom,bottomLeft:!1,bottomRight:!1,left:c.left,right:c.right,top:c.top,topLeft:!1,topRight:!1},bounds:t,boundsByDirection:!0,onPointerDown:({target:h,pointerId:p})=>{h.setPointerCapture(p)},onResizeStart:(h,p)=>{a(p)},onResizeStop:(h,p,g)=>{let b=parseFloat(Bo(r,"column-gap")),v=parseFloat(Bo(r,"row-gap")),k=Y_(Bo(r,"grid-template-columns"),b),y=Y_(Bo(r,"grid-template-rows"),v),S=new window.DOMRect(o.offsetLeft+g.offsetLeft,o.offsetTop+g.offsetTop,g.offsetWidth,g.offsetHeight),x=zc(k,S.left)+1,C=zc(y,S.top)+1,B=zc(k,S.right,"end")+1,I=zc(y,S.bottom,"end")+1;n({columnSpan:B-x+1,rowSpan:I-C+1,columnStart:i?x:void 0,rowStart:i?C:void 0})}})})}var ms=l(N(),1),Ok=l(A(),1);var qfe=l(F(),1),Zfe=l(Z(),1);var Nr=l(w(),1);function Vz({layout:e,parentLayout:t,onChange:o,gridClientId:r,blockClientId:n}){let{moveBlocksToPosition:i,__unstableMarkNextChangeAsNotPersistent:s}=(0,qfe.useDispatch)(_),a=e?.columnStart??1,c=e?.rowStart??1,u=e?.columnSpan??1,d=e?.rowSpan??1,f=a+u-1,m=c+d-1,h=t?.columnCount,p=t?.rowCount,g=np(r,h);return(0,Nr.jsx)(Mt,{group:"parent",children:(0,Nr.jsxs)(Ok.ToolbarGroup,{className:"block-editor-grid-item-mover__move-button-container",children:[(0,Nr.jsx)("div",{className:"block-editor-grid-item-mover__move-horizontal-button-container is-left",children:(0,Nr.jsx)(Q_,{icon:(0,ms.isRTL)()?Vo:Mr,label:(0,ms.__)("Move left"),description:(0,ms.__)("Move left"),isDisabled:a<=1,onClick:()=>{o({columnStart:a-1}),s(),i([n],r,r,g(a-1,c))}})}),(0,Nr.jsxs)("div",{className:"block-editor-grid-item-mover__move-vertical-button-container",children:[(0,Nr.jsx)(Q_,{className:"is-up-button",icon:xf,label:(0,ms.__)("Move up"),description:(0,ms.__)("Move up"),isDisabled:c<=1,onClick:()=>{o({rowStart:c-1}),s(),i([n],r,r,g(a,c-1))}}),(0,Nr.jsx)(Q_,{className:"is-down-button",icon:zn,label:(0,ms.__)("Move down"),description:(0,ms.__)("Move down"),isDisabled:p&&m>=p,onClick:()=>{o({rowStart:c+1}),s(),i([n],r,r,g(a,c+1))}})]}),(0,Nr.jsx)("div",{className:"block-editor-grid-item-mover__move-horizontal-button-container is-right",children:(0,Nr.jsx)(Q_,{icon:(0,ms.isRTL)()?Mr:Vo,label:(0,ms.__)("Move right"),description:(0,ms.__)("Move right"),isDisabled:h&&f>=h,onClick:()=>{o({columnStart:a+1}),s(),i([n],r,r,g(a+1,c))}})})]})})}function Q_({className:e,icon:t,label:o,isDisabled:r,onClick:n,description:i}){let a=`block-editor-grid-item-mover-button__description-${(0,Zfe.useInstanceId)(Q_)}`;return(0,Nr.jsxs)(Nr.Fragment,{children:[(0,Nr.jsx)(Ok.ToolbarButton,{className:V("block-editor-grid-item-mover-button",e),icon:t,label:o,"aria-describedby":a,onClick:r?null:n,disabled:r,accessibleWhenDisabled:!0}),(0,Nr.jsx)(Ok.VisuallyHidden,{id:a,children:i})]})}var J_=l(F(),1),XR=l(R(),1),ZR=l(Z(),1);function Fz({clientId:e}){let{gridLayout:t,blockOrder:o,selectedBlockLayout:r}=(0,J_.useSelect)(m=>{let{getBlockAttributes:h,getBlockOrder:p}=m(_),g=m(_).getSelectedBlock();return{gridLayout:h(e).layout??{},blockOrder:p(e),selectedBlockLayout:g?.attributes.style?.layout}},[e]),{getBlockAttributes:n,getBlockRootClientId:i}=(0,J_.useSelect)(_),{updateBlockAttributes:s,__unstableMarkNextChangeAsNotPersistent:a}=(0,J_.useDispatch)(_),c=(0,XR.useMemo)(()=>r?new aa(r):null,[r]),u=(0,ZR.usePrevious)(c),d=(0,ZR.usePrevious)(t.isManualPlacement),f=(0,ZR.usePrevious)(o);(0,XR.useEffect)(()=>{let m={};if(t.isManualPlacement){let h=[];for(let g of o){let{columnStart:b,rowStart:v,columnSpan:k=1,rowSpan:y=1}=n(g).style?.layout??{};!b||!v||h.push(new aa({columnStart:b,rowStart:v,columnSpan:k,rowSpan:y}))}for(let g of o){let b=n(g),{columnStart:v,rowStart:k,columnSpan:y=1,rowSpan:S=1}=b.style?.layout??{};if(v&&k)continue;let[x,C]=jAe(h,t.columnCount,y,S,u?.columnEnd,u?.rowEnd);h.push(new aa({columnStart:x,rowStart:C,columnSpan:y,rowSpan:S})),m[g]={style:{...b.style,layout:{...b.style?.layout,columnStart:x,rowStart:C}}}}let p=Math.max(...h.map(g=>g.rowEnd));(!t.rowCount||t.rowCountu.intersectsRect(c)))return[a,s]}}var jc=l(w(),1),UAe={};function HAe({style:e}){let t=(0,zz.useSelect)(g=>!g(_).getSettings().disableLayoutStyles),o=e?.layout??{},{selfStretch:r,flexSize:n,columnStart:i,rowStart:s,columnSpan:a,rowSpan:c}=o,u=Uf()||{},{columnCount:d,minimumColumnWidth:f}=u,m=(0,Xfe.useInstanceId)(UAe),h=`.wp-container-content-${m}`,p="";if(t&&(r==="fixed"&&n?p=`${h} { flex-basis: ${n}; box-sizing: border-box; }`:r==="fill"?p=`${h} { flex-grow: 1; }`:i&&a?p=`${h} { grid-column: ${i} / span ${a}; }`:i?p=`${h} { grid-column: ${i}; }`:a&&(p=`${h} { grid-column: span ${a}; }`),s&&c?p+=`${h} { grid-row: ${s} / span ${c}; }`:s?p+=`${h} { grid-row: ${s}; }`:c&&(p+=`${h} { grid-row: span ${c}; }`),(a||i)&&(f||!d))){let g=parseFloat(f);isNaN(g)&&(g=12);let b=f?.replace(g,"");["px","rem","em"].includes(b)||(b="rem");let v=2;a&&i?v=a+i-1:a?v=a:v=i;let k=b==="px"?24:1.5,y=v*g+(v-1)*k,S=g*2+k-1,x=a&&a>1?"1/-1":"auto";p+=`@container (max-width: ${Math.max(y,S)}${b}) { ${h} { grid-column: ${x}; grid-row: auto; } }`}if(Qn({css:p}),!!p)return{className:`wp-container-content-${m}`}}function GAe({clientId:e,style:t,setAttributes:o}){let r=Uf()||{},{type:n="default",allowSizingOnChildren:i=!1,isManualPlacement:s}=r;return n!=="grid"?null:(0,jc.jsx)(WAe,{clientId:e,style:t,setAttributes:o,allowSizingOnChildren:i,isManualPlacement:s,parentLayout:r})}function WAe({clientId:e,style:t,setAttributes:o,allowSizingOnChildren:r,isManualPlacement:n,parentLayout:i}){let{rootClientId:s,isVisible:a,parentBlockVisibility:c,blockBlockVisibility:u,deviceType:d,isChildBlockAGrid:f}=(0,zz.useSelect)(y=>{let{getBlockRootClientId:S,getBlockEditingMode:x,getTemplateLock:C,getBlockAttributes:B,getSettings:I}=y(_),P=S(e);if(C(P)||x(P)!=="default")return{rootClientId:P,isVisible:!1};let E=B(P),L=B(e),T=I();return{rootClientId:P,isVisible:!0,parentBlockVisibility:E?.metadata?.blockVisibility,blockBlockVisibility:L?.metadata?.blockVisibility,deviceType:T?.[wi]?.toLowerCase()||Et.desktop.value,isChildBlockAGrid:L?.layout?.type==="grid"}},[e]),{isBlockCurrentlyHidden:m}=Mi({blockVisibility:c,deviceType:d}),{isBlockCurrentlyHidden:h}=Mi({blockVisibility:u,deviceType:d}),[p,g]=(0,Qfe.useState)(),b=f?e:void 0;if(!a||m)return null;let v=r&&!h;function k(y){o({style:{...t,layout:{...t?.layout,...y}}})}return(0,jc.jsxs)(jc.Fragment,{children:[(0,jc.jsx)(Z_,{clientId:s,contentRef:g,parentLayout:i,childGridClientId:b}),v&&(0,jc.jsx)(Dz,{clientId:e,bounds:p,onChange:k,parentLayout:i}),n&&window.__experimentalEnableGridInteractivity&&(0,jc.jsx)(Vz,{layout:t?.layout,parentLayout:i,onChange:k,gridClientId:s,blockClientId:e})]})}var jz={useBlockProps:HAe,edit:GAe,attributeKeys:["style"],hasSupport(){return!0}};var Hz=l(ut(),1),Uz=l($(),1),Jfe="metadata";function $Ae(e){return e?.attributes?.[Jfe]?.type||(e.attributes={...e.attributes,[Jfe]:{type:"object"}}),e}function KAe(e,t,o,r){if(r.length===1&&e.innerBlocks.length===t.length||r.length===1&&t.length>1||r.length>1&&t.length===1||r.length>1&&t.length>1&&r.length!==t.length)return e;let n=t[o]?.attributes?.metadata;if(!n)return e;let i={};return n.noteId&&!e.attributes?.metadata?.noteId&&(i.noteId=n.noteId),n.name&&!e.attributes?.metadata?.name&&(0,Uz.hasBlockSupport)(e.name,"renaming",!0)&&(i.name=n.name),n.blockVisibility!==void 0&&!e.attributes?.metadata?.blockVisibility&&(0,Uz.hasBlockSupport)(e.name,"visibility",!0)&&(i.blockVisibility=n.blockVisibility),Object.keys(i).length>0?{...e,attributes:{...e.attributes,metadata:{...e.attributes.metadata,...i}}}:e}(0,Hz.addFilter)("blocks.registerBlockType","core/metadata/addMetaAttribute",$Ae);(0,Hz.addFilter)("blocks.switchToBlockType.transformedBlock","core/metadata/addTransforms",KAe);var Gz=l(N(),1),QR=l(R(),1),JR=l(A(),1),eO=l($(),1),Ak=l(F(),1);var ff=l(w(),1),YAe={};function qAe({name:e,clientId:t,metadata:{ignoredHookedBlocks:o=[]}={}}){let r=(0,Ak.useSelect)(h=>h(eO.store).getBlockTypes(),[]),n=(0,QR.useMemo)(()=>r?.filter(({name:h,blockHooks:p})=>p&&e in p||o.includes(h)),[r,e,o]),i=(0,Ak.useSelect)(h=>{let{getBlocks:p,getBlockRootClientId:g,getGlobalBlockCount:b}=h(_),v=g(t),k=n.reduce((y,S)=>{if(b(S.name)===0)return y;let x=S?.blockHooks?.[e],C;switch(x){case"before":case"after":C=p(v);break;case"first_child":case"last_child":C=p(t);break;case void 0:C=[...p(v),...p(t)];break}let B=C?.find(I=>I.name===S.name);return B?{...y,[S.name]:B.clientId}:y},{});return Object.values(k).length>0?k:YAe},[n,e,t]),{getBlockIndex:s,getBlockCount:a,getBlockRootClientId:c}=(0,Ak.useSelect)(_),{insertBlock:u,removeBlock:d}=(0,Ak.useDispatch)(_);if(!n.length)return null;let f=n.reduce((h,p)=>{let[g]=p.name.split("/");return h[g]||(h[g]=[]),h[g].push(p),h},{}),m=(h,p)=>{let g=s(t),b=a(t),v=c(t);switch(p){case"before":case"after":u(h,p==="after"?g+1:g,v,!1);break;case"first_child":case"last_child":u(h,p==="first_child"?0:b,t,!1);break;case void 0:u(h,g+1,v,!1);break}};return(0,ff.jsx)(fe,{children:(0,ff.jsxs)(JR.PanelBody,{className:"block-editor-hooks__block-hooks",title:(0,Gz.__)("Plugins"),initialOpen:!0,children:[(0,ff.jsx)("p",{className:"block-editor-hooks__block-hooks-helptext",children:(0,Gz.__)("Manage the inclusion of blocks added automatically by plugins.")}),Object.keys(f).map(h=>(0,ff.jsxs)(QR.Fragment,{children:[(0,ff.jsx)("h3",{children:h}),f[h].map(p=>{let g=p.name in i;return(0,ff.jsx)(JR.ToggleControl,{checked:g,label:p.title,onChange:()=>{if(!g){let b=p.blockHooks[e];m((0,eO.createBlock)(p.name),b);return}d(i[p.name],!1)}},p.title)})]},h))]})})}var eme={edit:qAe,attributeKeys:["metadata"],hasSupport(){return!0}};var Wz=l(N(),1),tme=l($(),1),Lk=l(A(),1),ome=l(F(),1),rme=l(R(),1),nme=l(Z(),1);var mf=l(w(),1),ZAe=()=>(0,nme.useViewportMatch)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:259}},XAe=({name:e,metadata:t})=>{let o=(0,rme.useContext)(xr),{removeAllBlockBindings:r}=El(),n=ZAe(),{bindableAttributes:i,hasCompatibleFields:s}=(0,ome.useSelect)(c=>{let{__experimentalBlockBindingsSupportedAttributes:u}=c(_).getSettings(),{getAllBlockBindingsSources:d,getBlockBindingsSourceFieldsList:f}=M(c(tme.store));return{bindableAttributes:u?.[e],hasCompatibleFields:Object.values(d()).some(m=>f(m,o)?.length>0)}},[e,o]);if(!i||i.length===0)return null;let{bindings:a}=t||{};return a===void 0&&!s?null:(0,mf.jsx)(fe,{group:"bindings",children:(0,mf.jsxs)(Lk.__experimentalToolsPanel,{label:(0,Wz.__)("Attributes"),resetAll:()=>{r()},dropdownMenuProps:n,className:"block-editor-bindings__panel",children:[(0,mf.jsx)(Lk.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:i.map(c=>(0,mf.jsx)($v,{attribute:c,blockName:e,binding:a?.[c]},c))}),(0,mf.jsx)(Lk.__experimentalText,{as:"div",variant:"muted",children:(0,mf.jsx)("p",{children:(0,Wz.__)("Attributes connected to custom fields or other dynamic data.")})})]})})},ime={edit:XAe,attributeKeys:["metadata"],hasSupport(e){return!["core/post-date","core/navigation-link","core/navigation-submenu"].includes(e)}};var sme=l(N(),1),ame=l(A(),1),rO=l(F(),1),e0=l($(),1),lme=l(R(),1);var tO=l(F(),1);function oO(e){let{isOpened:t,expandRevision:o}=(0,tO.useSelect)(i=>{let{isListViewPanelOpened:s,getListViewExpandRevision:a}=M(i(_));return{isOpened:s(e),expandRevision:a()}},[e]),{__unstableToggleListViewPanel:r}=(0,tO.useDispatch)(_);return{isOpened:t,expandRevision:o,handleToggle:i=>{r(e,i)}}}var Nk=l(w(),1),QAe="listView";function cme(e){return(0,e0.hasBlockSupport)(e,QAe)}function JAe({clientId:e,name:t}){let{isSelectionWithinCurrentSection:o}=(0,lme.useContext)(ur),{isOpened:r,expandRevision:n,handleToggle:i}=oO(e),{openListViewContentPanel:s}=M((0,rO.useDispatch)(_)),a=cme(t),{hasChildren:c,isNestedListView:u}=(0,rO.useSelect)(h=>{let{getBlockCount:p,getBlockParents:g,getBlockName:b}=h(_),k=g(e,!1).find(y=>{let S=b(y);return S==="core/navigation"||(0,e0.hasBlockSupport)(S,"listView")});return{hasChildren:!!p(e),isNestedListView:k}},[e]),f=(0,e0.getBlockType)(t)?.title||t;return!a||u?null:(0,Nk.jsx)(Sm,{group:"list",children:(0,Nk.jsxs)(ame.PanelBody,{title:o?f:void 0,opened:r,onToggle:i,children:[!c&&(0,Nk.jsx)("p",{className:"block-editor-block-inspector__no-blocks",children:(0,sme.__)("No items yet.")}),(0,Nk.jsx)(NS,{rootClientId:e,isExpanded:!0,description:f,showAppender:!0,onSelect:s},`${e}-${n}`)]})})}var ume={edit:JAe,hasSupport:cme,attributeKeys:[],supportsPatternEditing:!0};var dme=l(ut(),1),fme=l($(),1);function eLe(e){return e.__experimentalLabel||(0,fme.hasBlockSupport)(e,"renaming",!0)&&(e.__experimentalLabel=(o,{context:r})=>{let{metadata:n}=o;if((r==="list-view"||r==="breadcrumb")&&n?.name)return n.name}),e}(0,dme.addFilter)("blocks.registerBlockType","core/metadata/addLabelCallback",eLe);var mme=l(Z(),1),pme=l(ut(),1),hme=l(F(),1);var ps=l(w(),1);function tLe(e){Fz(e)}function oLe({clientId:e,layout:t}){let{isVisible:o,blockVisibility:r,deviceType:n,isAnyAncestorHidden:i}=(0,hme.useSelect)(a=>{let{isBlockSelected:c,hasSelectedInnerBlock:u,isDraggingBlocks:d,getTemplateLock:f,getBlockEditingMode:m,getBlockAttributes:h,getSettings:p}=a(_);if(!d()&&!c(e)||f(e)||m(e)!=="default"||u(e))return{isVisible:!1};let{isBlockParentHiddenAtViewport:g}=M(a(_)),b=h(e),k=p()?.[wi]?.toLowerCase()||Et.desktop.value;return{isVisible:!0,blockVisibility:b?.metadata?.blockVisibility,deviceType:k,isAnyAncestorHidden:g(e,k)}},[e]),{isBlockCurrentlyHidden:s}=Mi({blockVisibility:r,deviceType:n});return(0,ps.jsxs)(ps.Fragment,{children:[(0,ps.jsx)(tLe,{clientId:e}),o&&!s&&!i&&(0,ps.jsx)(Z_,{clientId:e,parentLayout:t})]})}var rLe=(0,mme.createHigherOrderComponent)(e=>function(o){return o.attributes.layout?.type!=="grid"?(0,ps.jsx)(e,{...o},"edit"):(0,ps.jsxs)(ps.Fragment,{children:[(0,ps.jsx)(oLe,{clientId:o.clientId,layout:o.attributes.layout}),(0,ps.jsx)(e,{...o},"edit")]})},"addGridVisualizerToBlockEdit");(0,pme.addFilter)("editor.BlockEdit","core/editor/grid-visualizer",rLe);var t0=l($(),1),bme=l(A(),1),kme=l(F(),1);var iO=l(R(),1),vme=l(N(),1);function gme(e){let t=[],o=[];return Object.entries(e).forEach(([r,n])=>{if(!n.autoGenerateControl)return;let i=nLe(r,n);i&&(t.push(i),o.push(r))}),{fields:t,form:{fields:o}}}function nLe(e,t){let o=t.type,r={id:e,label:t.label||e,type:o==="string"?"text":o};return t.enum&&Array.isArray(t.enum)&&(r.elements=t.enum.map(n=>({value:n,label:String(n)}))),r}var nO=l(w(),1);function iLe(e){return e?Object.values(e).some(t=>t?.autoGenerateControl):!1}function sLe({name:e,clientId:t,setAttributes:o}){let r=ao(),n=(0,iO.useContext)(xr),i=(0,kme.useSelect)(u=>{let d=u(_).getBlockAttributes(t);if(!d?.metadata?.bindings)return d;let{getBlockBindingsSource:f}=M(u(t0.store));return Object.entries(d.metadata.bindings).reduce((m,[h,p])=>{let g=f(p.source);if(!g)return m;let b=g.getValues({select:u,context:n,bindings:{[h]:p}});return{...m,...b}},d)},[n,t]),s=(0,t0.getBlockType)(e),{fields:a,form:c}=(0,iO.useMemo)(()=>s?.attributes?gme(s.attributes):{fields:[],form:{fields:[]}},[s?.attributes]);return r!=="default"||!a||a.length===0?null:(0,nO.jsx)(fe,{children:(0,nO.jsx)(bme.PanelBody,{title:(0,vme.__)("Settings"),children:(0,nO.jsx)(D_,{data:i,fields:a,form:c,onChange:o})})})}var yme={edit:sLe,attributeKeys:[],hasSupport(e){let t=(0,t0.getBlockType)(e);return iLe(t?.attributes)}};function $z(e){let{style:t}=e,o=t?.dimensions||{},r=bi({dimensions:o});return{className:o.aspectRatio?"has-aspect-ratio":void 0,style:r}}function sO(e){let t=e.style?.border||{};return{className:YF(e)||void 0,style:bi({border:t})}}function Kz(e){let{colors:t}=wd(),o=sO(e),{borderColor:r}=e;if(r){let n=lp({colors:t,namedColor:r});o.style.borderColor=n.color}return o}function Yz(e){let t=e.style?.shadow||"";return{style:bi({shadow:t})}}var qz=l(R(),1);function aO(e){let{backgroundColor:t,textColor:o,gradient:r,style:n}=e,i=_i("background-color",t),s=_i("color",o),a=th(r),c=a||n?.color?.gradient,u=V(s,a,{[i]:!c&&!!i,"has-text-color":o||n?.color?.text,"has-background":t||n?.color?.background||r||n?.color?.gradient,"has-link-color":n?.elements?.link?.color}),d=n?.color||{},f=bi({color:d});return{className:u||void 0,style:f}}function Zz(e){let{backgroundColor:t,textColor:o,gradient:r}=e,[n,i,s,a,c,u]=me("color.palette.custom","color.palette.theme","color.palette.default","color.gradients.custom","color.gradients.theme","color.gradients.default"),d=(0,qz.useMemo)(()=>[...n||[],...i||[],...s||[]],[n,i,s]),f=(0,qz.useMemo)(()=>[...a||[],...c||[],...u||[]],[a,c,u]),m=aO(e);if(t){let h=da(d,t);m.style.backgroundColor=h.color}if(r&&(m.style.background=Gw(f,r)),o){let h=da(d,o);m.style.color=h.color}return m}function Xz(e){let{style:t}=e,o=t?.spacing||{};return{style:bi({spacing:o})}}var Sme=l(A(),1);var{kebabCase:aLe}=M(Sme.privateApis);function Qz(e,t){let o=e?.style?.typography||{};o={...o,fontSize:ec({size:e?.style?.typography?.fontSize},t)};let r=bi({typography:o}),n=e?.fontFamily?`has-${aLe(e.fontFamily)}-font-family`:"",i=e?.style?.typography?.textAlign?`has-text-align-${e?.style?.typography?.textAlign}`:"";return{className:V(n,i,hu(e?.fontSize)),style:r}}var lO=l(R(),1);function Jz(e){let[t,o]=(0,lO.useState)(e);return(0,lO.useEffect)(()=>{e&&o(e)},[e]),t}dle([w2,NR,B4,hz,jR,WR,Pz,DR,uV,Hfe,eme,ime,jz,Ale,qde,ume,yme].filter(Boolean));fle([w2,NR,yae,jR,t4,Tfe,Pz,gz,kz,DR,qF,WR,uV,ZX,jz]);mle([w2,NR,B4,Dle,hz,qF,WR,DR,t4,jR,gz,kz]);var _me={button:"wp-element-button",caption:"wp-element-caption"},lLe=e=>_me[e]?_me[e]:"";var xme=()=>"";var Mk=l(R(),1),o0=l($(),1),t6=l(dr(),1);var wme=l(w(),1);function o6(e,t,o){if(e==null||e===!1)return;if(Array.isArray(e))return e6(e,t,o);switch(typeof e){case"string":case"number":return}let{type:r,props:n}=e;switch(r){case Mk.StrictMode:case Mk.Fragment:return e6(n.children,t,o);case Mk.RawHTML:return;case tS.Content:return Cme(t,o);case o_:t.push(n.value);return}switch(typeof r){case"string":return typeof n.children<"u"?e6(n.children,t,o):void 0;case"function":let i=r.prototype&&typeof r.prototype.render=="function"?new r(n).render():r(n);return o6(i,t,o)}}function e6(e,...t){e=Array.isArray(e)?e:[e];for(let o=0;oo instanceof t6.RichTextData?o:t6.RichTextData.fromHTMLString(o))}var Eme=l(A(),1);var r6=l(w(),1);function Tme({clientId:e,resizableBoxProps:t,...o}){return(0,r6.jsx)(Hi,{clientId:e,__unstablePopoverSlot:"block-toolbar",...o,children:(0,r6.jsx)(Eme.ResizableBox,{...t})})}var n0=l(R(),1),cO=l(F(),1),la=l(A(),1),r0=l(N(),1);var hs=l(w(),1);function Ime({rules:e}){let[t,o]=(0,n0.useState)(!1),{clientIds:r,selectPrevious:n,message:i}=(0,cO.useSelect)(p=>M(p(_)).getRemovalPromptData()),{clearBlockRemovalPrompt:s,setBlockRemovalRules:a,privateRemoveBlocks:c}=M((0,cO.useDispatch)(_));if((0,n0.useEffect)(()=>(a(e),()=>{a()}),[e,a]),(0,n0.useEffect)(()=>{o(!1)},[r]),!i)return;let u=typeof i=="object"&&i!==null,d=u?i.description:i,f=u&&i.requireConfirmation,m=f&&!t,h=()=>{c(r,n,!0),s()};return(0,hs.jsx)(la.Modal,{title:(0,r0.__)("Confirm deletion"),onRequestClose:s,size:"medium",children:(0,hs.jsxs)(la.__experimentalVStack,{spacing:4,children:[(0,hs.jsxs)("div",{children:[(0,hs.jsx)("p",{children:d}),u&&(i.warning||i.subtext)&&(0,hs.jsxs)("p",{children:[i.warning&&(0,hs.jsx)("strong",{children:i.warning}),i.warning&&i.subtext&&" ",i.subtext]})]}),f&&(0,hs.jsx)(la.CheckboxControl,{label:(0,r0.__)("I understand the consequences"),checked:t,onChange:o}),(0,hs.jsxs)(la.__experimentalHStack,{justify:"right",children:[(0,hs.jsx)(la.Button,{variant:"tertiary",onClick:s,__next40pxDefaultSize:!0,children:(0,r0.__)("Cancel")}),(0,hs.jsx)(la.Button,{variant:"primary",onClick:h,disabled:m,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,r0.__)("Delete")})]})]})})}var n6=l(R(),1);var Dk=l(A(),1),Rme=l(R(),1),Vn=l(N(),1),uO=l(w(),1),Pme=[{value:"fill",label:(0,Vn._x)("Fill","Scale option for dimensions control"),help:(0,Vn.__)("Fill the space by stretching the content.")},{value:"contain",label:(0,Vn._x)("Contain","Scale option for dimensions control"),help:(0,Vn.__)("Fit the content to the space without clipping.")},{value:"cover",label:(0,Vn._x)("Cover","Scale option for dimensions control"),help:(0,Vn.__)("Fill the space by clipping what doesn't fit.")},{value:"none",label:(0,Vn._x)("None","Scale option for dimensions control"),help:(0,Vn.__)("Do not adjust the sizing of the content. Content that is too large will be clipped, and content that is too small will have additional padding.")},{value:"scale-down",label:(0,Vn._x)("Scale down","Scale option for dimensions control"),help:(0,Vn.__)("Scale down the content to fit the space if it is too big. Content that is too small will have additional padding.")}];function Ome({panelId:e,value:t,onChange:o,options:r=Pme,defaultValue:n=Pme[0].value,isShownByDefault:i=!0}){let s=t??"fill",a=(0,Rme.useMemo)(()=>r.reduce((c,u)=>(c[u.value]=u.help,c),{}),[r]);return(0,uO.jsx)(Dk.__experimentalToolsPanelItem,{label:(0,Vn._x)("Scale","Image scaling options"),isShownByDefault:i,hasValue:()=>s!==n,onDeselect:()=>o(n),panelId:e,children:(0,uO.jsx)(Dk.__experimentalToggleGroupControl,{label:(0,Vn._x)("Scale","Image scaling options"),isBlock:!0,help:a[s],value:s,onChange:o,size:"__unstable-large",children:r.map(c=>(0,uO.jsx)(Dk.__experimentalToggleGroupControlOption,{...c},c.value))})})}var Vk=l(A(),1),wp=l(N(),1),Uc=l(w(),1);function Ame({panelId:e,value:t={},onChange:o=()=>{},units:r,isShownByDefault:n=!0}){let i=t.width==="auto"?"":t.width??"",s=t.height==="auto"?"":t.height??"",a=c=>u=>{let d={...t};u?d[c]=u:delete d[c],o(d)};return(0,Uc.jsxs)(Uc.Fragment,{children:[(0,Uc.jsx)(Vk.__experimentalToolsPanelItem,{style:{gridColumn:"span 1"},label:(0,wp.__)("Width"),isShownByDefault:n,hasValue:()=>i!=="",onDeselect:a("width"),panelId:e,children:(0,Uc.jsx)(Vk.__experimentalUnitControl,{label:(0,wp.__)("Width"),placeholder:(0,wp.__)("Auto"),labelPosition:"top",units:r,min:0,value:i,onChange:a("width"),size:"__unstable-large"})}),(0,Uc.jsx)(Vk.__experimentalToolsPanelItem,{style:{gridColumn:"span 1"},label:(0,wp.__)("Height"),isShownByDefault:n,hasValue:()=>s!=="",onDeselect:a("height"),panelId:e,children:(0,Uc.jsx)(Vk.__experimentalUnitControl,{label:(0,wp.__)("Height"),placeholder:(0,wp.__)("Auto"),labelPosition:"top",units:r,min:0,value:s,onChange:a("height"),size:"__unstable-large"})})]})}var pf=l(w(),1);function cLe({panelId:e,value:t={},onChange:o=()=>{},aspectRatioOptions:r,defaultAspectRatio:n="auto",scaleOptions:i,defaultScale:s="fill",unitsOptions:a,tools:c=["aspectRatio","widthHeight","scale"]}){let u=t.width===void 0||t.width==="auto"?null:t.width,d=t.height===void 0||t.height==="auto"?null:t.height,f=t.aspectRatio===void 0||t.aspectRatio==="auto"?null:t.aspectRatio,m=t.scale===void 0||t.scale==="fill"?null:t.scale,[h,p]=(0,n6.useState)(m),[g,b]=(0,n6.useState)(f),v=u&&d?"custom":g,k=f||u&&d;return(0,pf.jsxs)(pf.Fragment,{children:[c.includes("aspectRatio")&&(0,pf.jsx)(NP,{panelId:e,options:r,defaultValue:n,value:v,onChange:y=>{let S={...t};y=y==="auto"?null:y,b(y),y?S.aspectRatio=y:delete S.aspectRatio,y?h?S.scale=h:(S.scale=s,p(s)):delete S.scale,y!=="custom"&&u&&d&&delete S.height,o(S)}}),c.includes("widthHeight")&&(0,pf.jsx)(Ame,{panelId:e,units:a,value:{width:u,height:d},onChange:({width:y,height:S})=>{let x={...t};y=y==="auto"?null:y,S=S==="auto"?null:S,y?x.width=y:delete x.width,S?x.height=S:delete x.height,y&&S?delete x.aspectRatio:g&&(x.aspectRatio=g),!g&&!!y!=!!S?delete x.scale:h?x.scale=h:(x.scale=s,p(s)),o(x)}}),c.includes("scale")&&k&&(0,pf.jsx)(Ome,{panelId:e,options:i,defaultValue:s,value:h,onChange:y=>{let S={...t};y=y==="fill"?null:y,p(y),y?S.scale=y:delete S.scale,o(S)}})]})}var Lme=cLe;var dO=l(A(),1),Hc=l(N(),1),i6=l(w(),1),Nme=[{label:(0,Hc._x)("Thumbnail","Image size option for resolution control"),value:"thumbnail"},{label:(0,Hc._x)("Medium","Image size option for resolution control"),value:"medium"},{label:(0,Hc._x)("Large","Image size option for resolution control"),value:"large"},{label:(0,Hc._x)("Full Size","Image size option for resolution control"),value:"full"}];function Mme({panelId:e,value:t,onChange:o,options:r=Nme,defaultValue:n=Nme[0].value,isShownByDefault:i=!0,resetAllFilter:s}){let a=t??n;return(0,i6.jsx)(dO.__experimentalToolsPanelItem,{hasValue:()=>a!==n,label:(0,Hc.__)("Resolution"),onDeselect:()=>o(n),isShownByDefault:i,panelId:e,resetAllFilter:s,children:(0,i6.jsx)(dO.SelectControl,{label:(0,Hc.__)("Resolution"),value:a,options:r,onChange:o,help:(0,Hc.__)("Select the size of the source image."),size:"__unstable-large"})})}var Cp=l(N(),1),Fk=l(A(),1),Vme=l(F(),1);var ca=l(N(),1),Dme={a:(0,ca.__)("The element should be used for links that navigate to a different page or to a different section within the same page."),article:(0,ca.__)("The
element should represent a self-contained, syndicatable portion of the document."),aside:(0,ca.__)("The