(()=>{"use strict";const e=window.React,t=window.wp.i18n,o=window.wp.blocks,n=window.wp.plugins,l=window.wp.element,a=window.wp.data,r=window.wp.components,i="gutenify",s=window?.[`_${i}_vars`]?window[`_${i}_vars`]:{},{is_pro_activated:c,pro_account_url:u,pro_license_status:d,title:p,prefix:m,slug:_,authorWebSite:w,authorDemoWebSite:g,authorWebSiteProPage:b,defaultTheme:f,authorWebSiteSupport:h,plugin_directory_url:S,brand_color:$,plugin_main_version:k,documentationsURL:y,pro_title:v,active_blocks:E,plugin_main_camel_case_name:C}=s,M=(s?.siteUrl?s.siteUrl:s.site_url,(0,t.sprintf)("Want to enjoy all feature of blocks? Checkout %1$s%2$s%3$s.",'<a href="'+b+'" target="_blank">',v,"</a>"),{pluginMainSlug:"gutenify",pluginMainCamelCaseName:C,pluginMainFunctionPrefix:"gutenify"}),{pluginMainSlug:W}=M,P=()=>{const{insertBlocks:n}=(0,a.useDispatch)("core/block-editor");return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(r.Button,{className:"components-button components-icon-button",onClick:e=>{e.preventDefault(),n((0,o.createBlock)(`${W}/templates-browser`,{isTemplatesModalOnly:!0}))}},(0,e.createElement)(r.Icon,{icon:"grid-view"})," ",(0,t.__)("Add Template","@@text_domain")))};(0,n.registerPlugin)(`${W}-toolbar-templates`,{render:()=>((0,l.useEffect)((()=>{let t=document.querySelector(".edit-post-header__toolbar"),o=!1;if(t||(t=document.querySelector(".editor-header__toolbar"),o=!0),t){const n=document.createElement("div");n.classList.add(`${W}-toolbar-templates`),o||n.classList.add(`${W}-toolbar-templates-left`),t.querySelector(`.${W}-toolbar-templates`)||t.appendChild(n),l.createRoot?(0,l.createRoot)(n).render((0,e.createElement)(P,null)):(0,l.render)((0,e.createElement)(P,null),n)}}),[]),null)})})();