(()=>{"use strict";const e=window.React,t=window.wp.blocks,o=window.wp.element,c=window.wp.data,n=window.wp.blockEditor,i=[{attributes:{isMultiOpen:{type:"boolean",default:!1}},save({attributes:{isMultiOpen:t}}){const o=n.useBlockProps.save({className:"accordion"+(t?"  is-multiselect":"")});return(0,e.createElement)("div",{...o},(0,e.createElement)(n.InnerBlocks.Content,null))}}];(0,t.registerBlockType)("ucla-wordpress-plugin/accordion",{title:"Accordion (Deprecated)",category:"ucla-design-system-components",supports:{inserter:!1,html:!1},attributes:{isMultiOpen:{type:"boolean",default:!1}},edit:function({attributes:i,clientId:r}){const{replaceBlock:a}=(0,c.useDispatch)("core/block-editor"),l=(0,c.useSelect)((e=>e("core/block-editor").getBlocks(r)),[r]);return(0,o.useEffect)((()=>{var e;if(!l)return;const{isMultiOpen:o}=i,c=null!==(e=l[0]?.attributes?.accordionHeadingLevel)&&void 0!==e?e:3,n=l.map((e=>{const{accordionHeading:o="",accordionHeadingLevel:c=4}=e.attributes;return(0,t.createBlock)("core/accordion-item",{openByDefault:!1},[(0,t.createBlock)("core/accordion-heading",{title:o,level:c}),(0,t.createBlock)("core/accordion-panel",{},e.innerBlocks)])})),s=(0,t.createBlock)("core/accordion",{autoclose:!o,headingLevel:c},n);a(r,s)}),[]),(0,e.createElement)("div",{...(0,n.useBlockProps)(),"aria-hidden":!0})},save:()=>null,deprecated:i})})();