(()=>{"use strict";const t=window.ReactJSXRuntime,{registerPlugin:s}=wp.plugins,{PluginToolbarButton:e}=wp.editPost,{addFilter:o}=wp.hooks,{Fragment:r,useEffect:i}=wp.element,{BlockControls:a}=wp.blockEditor,{Button:n,ToolbarGroup:l,ToolbarButton:c,Tooltip:p}=wp.components,{__}=wp.i18n;let h=(0,t.jsxs)("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",children:[(0,t.jsxs)("defs",{children:[(0,t.jsxs)("linearGradient",{id:"b",children:[(0,t.jsx)("stop",{offset:"0",style:{stopColor:"#0e44ac",stopOpacity:1}}),(0,t.jsx)("stop",{offset:"1",style:{stopColor:"#664ef1",stopOpacity:1}})]}),(0,t.jsxs)("linearGradient",{id:"a",children:[(0,t.jsx)("stop",{offset:"0",style:{stopColor:"#0e44ac",stopOpacity:1}}),(0,t.jsx)("stop",{offset:"1",style:{stopColor:"#664ef1",stopOpacity:1}})]}),(0,t.jsx)("linearGradient",{xlinkHref:"#a",id:"c",x1:"10.148",x2:"116.734",y1:"62.229",y2:"62.229",gradientUnits:"userSpaceOnUse"}),(0,t.jsx)("linearGradient",{xlinkHref:"#b",id:"d",x1:"11.811",x2:"115.07",y1:"62.229",y2:"62.229",gradientUnits:"userSpaceOnUse"})]}),(0,t.jsx)("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,t.jsx)("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)"})]});o("editor.BlockEdit","softaculous/ai",(s=>e=>(0,t.jsxs)(r,{children:[(0,t.jsx)(a,{children:(0,t.jsx)(l,{children:(0,t.jsx)(c,{icon:h,label:__("Ask AI","softaculous"),onClick:()=>{if("0px"!=jQuery(".spro-chat").css("right")){jQuery(".spro-chat").css({right:0,visibility:"visible"});let t=jQuery(".spro-chat-response-section .spro-chat-response");return t.length>0&&"content"==t.eq(t.length-1).data("type")&&t.eq(t.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(e)}jQuery(".spro-chat").css({right:"-25vw"})}})})}),(0,t.jsx)(s,{...e})]}))),s("soft-ai-sidebar",{render:()=>(i((()=>{var t=jQuery("#soft-ai-toolbar-btn").closest("div"),s=jQuery(".editor-header__settings");s.length<1||(t.detach(),s.prepend(t),t.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 t=jQuery(".spro-chat-response-section .spro-chat-response");return t.length>0&&"content"==t.eq(t.length-1).data("type")&&t.eq(t.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,t.jsx)(p,{text:"Softaculous AI",children:(0,t.jsx)(n,{id:"soft-ai-toolbar-btn","aria-label":"Softaculous AI",style:{height:"auto",padding:"4px 8px","font-size":"13px",display:"flex","align-items":"center",width:"max-content"},children:h})})),icon:{soft_ai_icon:h}})})();