(()=>{"use strict";const e=window.wp.element,t=window.wp.i18n,o=window.wp.data,s=window.wp.hooks,r=window.wp.compose,n=window.wp.blockEditor,l=window.ReactJSXRuntime,c=new window.CSSStyleSheet;document.adoptedStyleSheets.push(c);const d={text:"color",background:"background-color",gradient:"background"},i=window.blockSupportsExtended?.color||{};Object.entries(i).forEach((([i,p])=>{const a=(0,r.compose)((0,n.withColors)({[i]:i}),(0,r.createHigherOrderComponent)((s=>r=>{const{clientId:a,name:u,attributes:w,setAttributes:m,[i]:b,[`set${i.substring(0,1).toUpperCase()}${i.substring(1)}`]:g}=r;if(!(0,o.useSelect)((e=>{const t=e("core/blocks").getBlockSupport(u,"color");return t&&t[i]}),[u]))return(0,l.jsx)(s,{...r});const h=(0,n.__experimentalUseMultipleOriginColorsAndGradients)(),C=b?.color||w?.style?.elements&&w?.style?.elements[i]?.color[p.property]||"",S=p.default||"",k=(0,n.useBlockProps)().className.match(/wp-elements-(\d+)/),x=k&&k[1]?parseInt(k[1],10):"",[y,R]=(0,e.useState)(null);return(0,e.useEffect)((()=>{const e=(0,t.sprintf)(`${p.selector} { ${d[p.property]||"color"}: ${C||S}; }`,`wp-elements-${x}`);if(null!==y)c.deleteRule(y),c.insertRule(e,y);else{const t=c.cssRules.length;c.insertRule(e,t),R(t)}}),[C,S,x,y,R]),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s,{...r}),(0,l.jsx)(n.InspectorControls,{group:"color",children:(0,l.jsx)(n.__experimentalColorGradientSettingsDropdown,{settings:[{label:p.label,colorValue:C,onColorChange:e=>{g(e),m({style:{...w?.style||{},elements:{...w?.style?.elements||{},[i]:{color:{[p.property]:e}}}}})}}],panelId:a,hasColorsOrGradients:!1,disableCustomColors:!1,__experimentalIsRenderedInSidebar:!0,...h})})]})}),"withPseudoContentColorUI"));wp.domReady((()=>{(0,s.addFilter)("editor.BlockEdit",`block-supports-extended/${i}`,a)}))}))})();