(()=>{"use strict";const e=window.wp.blocks,t=window.wp.i18n,n=window.wp.blockEditor,o=window.wp.components,s=window.wp.data,r=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"frontend-admin/step","title":"Form Step","description":"Groups content into steps.","category":"frontend-admin","parent":["frontend-admin/steps"],"textdomain":"frontend-admin","icon":"list-view","supports":{"align":["wide"]},"usesContext":["frontend-admin/steps/active_step"],"attributes":{"title":{"type":"string","default":""},"next_button_text":{"type":"string","default":"Next"},"prev_button_text":{"type":"string","default":"Previous"}},"editorScript":"file:../../step/index.js"}');(0,e.registerBlockType)(r,{edit:function(e){var r=e.attributes,c=e.setAttributes,i=e.clientId,l=e.context,a=(e.isSelected,r.title),d=(0,s.useSelect)((function(e){return e(n.store).getBlocks(i)}),[i]).length>0,p=(0,s.useDispatch)("core/block-editor"),u=(p.insertBlock,p.removeBlock,p.updateBlockAttributes,p.selectBlock),m=(0,s.useSelect)((function(e){var t=e("core/block-editor"),n=t.hasSelectedInnerBlock;return(0,t.isBlockSelected)(i)||n(i,!0)}),[i]),k=l["frontend-admin/steps/active_step"],f=(0,s.useSelect)((function(e){return(0,e("core/block-editor").getBlockIndex)(i)}),[i]);return React.createElement(React.Fragment,null,React.createElement("div",{className:"fe-form-step",style:{display:m||k===f?"block":"none"}},!d&&React.createElement("div",{className:"my-placeholder",onClick:function(){u(i)}},a||"Step "+(f+1),": Step content goes here. Please add blocks inside this step."),React.createElement(n.InnerBlocks,null)),React.createElement(n.InspectorControls,null,React.createElement(o.PanelBody,{title:(0,t.__)("Step Settings","frontend-admin")},React.createElement(o.TextControl,{label:(0,t.__)("Step Title","frontend-admin"),value:a,onChange:function(e){return c({title:e})}}))))},save:function(){var e=n.useBlockProps.save(),t=n.useInnerBlocksProps.save(e);return React.createElement("div",t)}})})();