(()=>{"use strict";const t=window.wp.data,e=jQuery;Drupal.behaviors.gutenbergContentBlocks={attach(c){e(document).ajaxComplete((e,o,l)=>{drupalSettings.contentBlockId&&l.url&&l.url.includes("/editor/content_block_type/settings/")&&once("gutenberg-content-blocks","#gutenberg-content-block-type-settings",c).forEach(async()=>{const e=await(0,t.select)("core/block-editor").getSelectedBlock(),c=await(0,t.select)("core/block-editor").getSelectedBlockClientId(),o={...e.attributes,contentBlockId:drupalSettings.contentBlockId};await(0,t.dispatch)("core/block-editor").updateBlockAttributes(c,{contentBlockId:null,viewMode:"empty"}),await(0,t.dispatch)("core/block-editor").updateBlockAttributes(c,o),(0,t.dispatch)("core/block-editor").flashBlock(c),delete drupalSettings.contentBlockId})})}}})();