(()=>{"use strict";const e=window.React,{registerPlugin:t}=wp.plugins,{PluginToolbarButton:o}=wp.editPost,{addFilter:r}=wp.hooks,{Fragment:s,useEffect:a}=wp.element,{BlockControls:n}=wp.blockEditor,{Button:l,ToolbarGroup:i,ToolbarButton:c,Tooltip:p,Icon:h}=wp.components,{__}=wp.i18n;let u=()=>(0,e.createElement)(h,{icon:(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:"24",height:"24",viewBox:"0 0 151.668 151.616"},(0,e.createElement)("defs",null,(0,e.createElement)("linearGradient",{id:"b"},(0,e.createElement)("stop",{offset:"0",style:{stopColor:"#0e44ac",stopOpacity:1}}),(0,e.createElement)("stop",{offset:"1",style:{stopColor:"#664ef1",stopOpacity:1}})),(0,e.createElement)("linearGradient",{id:"a"},(0,e.createElement)("stop",{offset:"0",style:{stopColor:"#0e44ac",stopOpacity:1}}),(0,e.createElement)("stop",{offset:"1",style:{stopColor:"#664ef1",stopOpacity:1}})),(0,e.createElement)("linearGradient",{xlinkHref:"#a",id:"c",x1:"10.148",x2:"116.734",y1:"62.229",y2:"62.229",gradientUnits:"userSpaceOnUse"}),(0,e.createElement)("linearGradient",{xlinkHref:"#b",id:"d",x1:"11.811",x2:"115.07",y1:"62.229",y2:"62.229",gradientUnits:"userSpaceOnUse"})),(0,e.createElement)("path",{d:"M64.039 88.243c-8.629.199-42.93 30.806-49.172 24.845-6.242-5.96 22.757-41.633 22.559-50.261-.198-8.63-30.806-42.93-24.845-49.172s41.633 22.757 50.262 22.559 42.93-30.806 49.172-24.845-22.758 41.633-22.56 50.262 30.807 42.93 24.846 49.171c-5.962 6.242-41.633-22.757-50.262-22.559z",style:{fill:"none",stroke:"url(#c)",strokeWidth:10.9,strokeDasharray:"none",strokeDashoffset:.8655,strokeOpacity:1},transform:"rotate(-44.365 86.218 53.877)"}),(0,e.createElement)("path",{d:"M64.039 88.243c-8.629.199-42.93 30.806-49.172 24.845-6.242-5.96 22.757-41.633 22.559-50.261-.198-8.63-30.806-42.93-24.845-49.172s41.633 22.757 50.262 22.559 42.93-30.806 49.172-24.845-22.758 41.633-22.56 50.262 30.807 42.93 24.846 49.171c-5.962 6.242-41.633-22.757-50.262-22.559",style:{fill:"url(#d)",stroke:"none",strokeWidth:1.431,strokeDasharray:"1.431,2.862",strokeDashoffset:.7155},transform:"matrix(.2651 -.25928 .25928 .2651 92.639 125.492)"}))});r("editor.BlockEdit","softaculous/ai",(t=>o=>(0,e.createElement)(s,null,(0,e.createElement)(n,null,(0,e.createElement)(i,null,(0,e.createElement)(c,{icon:u,label:__("Ask AI","softaculous"),onClick:()=>{if("0px"!=jQuery(".spro-chat").css("right")){jQuery(".spro-chat").css({right:0,visibility:"visible"});let e=jQuery(".spro-chat-response-section .spro-chat-response");return e.length>0&&"content"==e.eq(e.length-1).data("type")&&e.eq(e.length-1).remove(),jQuery(".spro-prompt-shortcuts").css("display","flex"),jQuery(".spro-ai-chat-overlay").show(),jQuery(".spro-chat-startup-placeholder").hide(),void soft_handle_ai_content(o)}jQuery(".spro-chat").css({right:"-25vw"})}}))),(0,e.createElement)(t,{...o})))),t("soft-ai-sidebar",{render:()=>(a((()=>{var e=jQuery("#soft-ai-toolbar-btn"),t=jQuery(".editor-header__settings, .edit-post-header__settings");t.length<1||(e.detach(),t.prepend(e),e.show(),jQuery("#soft-ai-toolbar-btn").off("click").click((function(){if("0px"!=jQuery(".spro-chat").css("right")){jQuery(".spro-chat").css({right:0,visibility:"visible"}),jQuery(".spro-prompt-shortcuts").hide(),jQuery(".spro-ai-chat-overlay").show();let e=jQuery(".spro-chat-response-section .spro-chat-response");return e.length>0&&"content"==e.eq(e.length-1).data("type")&&e.eq(e.length-1).remove(),jQuery(".spro-chat-response-section .spro-chat-response").length<1?jQuery(".spro-chat-startup-placeholder").show():jQuery(".spro-prompt-shortcuts").show(),void soft_handle_ai_content()}jQuery(".spro-chat").css({right:"-25vw"})})))})),(0,e.createElement)(l,{id:"soft-ai-toolbar-btn",icon:u,label:"Softaculous AI",showTooltip:"true"})),icon:{soft_ai_icon:u}})})();