System.register(["../../../../common/index-legacy.sLMPZLm9.js","../../../../common/vue-router-legacy.BDEEsdoO.js","../../../../common/index-legacy.NSn_Zdym.js","../index-legacy.DvuPgGlN.js","../../../../common/index-legacy.Bk-po7Kp.js","./AIAgentIcon-legacy.WJk97u1K.js","../../../../common/index-legacy.DnShwas9.js","../../../../common/index-legacy.DWOuG56R.js","../../../../common/_plugin-vue_export-helper-legacy.DgAO6S8O.js","../../../../common/index-legacy.DjPCm-Xr.js","../../../../common/KeyCode-legacy.B-3hPYkN.js","../../../../common/index-legacy.5srSrAru.js","../../../../common/_getTag-legacy.CG1mexpa.js","../../../../common/useState-legacy.VsKoz4di.js","../../../../common/FormItemContext-legacy.DK_xJlQ4.js","../../../../common/compact-item-legacy.3e1PWnds.js","../../../../common/omit-legacy.Y6HgJwmj.js","../../../../common/devWarning-legacy.QuSHKYiX.js","../../../../common/Compact-legacy.f4toi_Qn.js"],(function(e,a){"use strict";var t,n,o,c,s,i,d,l,g,r,m,u,v,b,p,y,f,h,x,j;return{setters:[e=>{t=e.d,n=e.e,o=e.m,c=e.n,s=e.M,i=e.u,d=e.A,l=e.l,g=e.z,r=e.x,m=e.y},e=>{u=e.a},e=>{v=e.a},e=>{b=e.u,p=e.s},e=>{y=e.u},e=>{f=e.default},e=>{h=e.S},e=>{x=e.B},e=>{j=e._},null,null,null,null,null,null,null,null,null,null],execute:function(){var a=document.createElement("style");a.textContent="[data-v-0dcae5bc] .ant-switch{background:#dd5757!important}[data-v-0dcae5bc] .ant-switch .ant-switch-handle:before{background:#fff}[data-v-0dcae5bc] .ant-switch-checked{background:#2daa0d!important}[data-v-0dcae5bc] .ant-switch-checked:hover{background:#2daa0d}[data-v-0dcae5bc] .ant-switch-checked .ant-switch-handle:before{background:#fff}.ai-agent-footer[data-v-0dcae5bc]{bottom:1rem;display:flex;gap:10px;justify-content:end;margin:1rem 0 0;right:1rem;position:absolute}.ai-agent-footer[data-v-0dcae5bc] .ant-btn{background:#f5f5f5;border:none;border-radius:20px}.ai-agent-footer[data-v-0dcae5bc] .ant-btn:hover{background:#47b0f1;color:#000}.ai-agent-footer[data-v-0dcae5bc] .ant-btn span{display:inline-block;font-size:10px;padding:0 .3rem}\n/*$vite$:1*/",document.head.appendChild(a);const k=["id"],w={class:"ai-agent-box-header"},I={class:"ai-agent-title-status"},_={class:"ai-agent-title"},A={class:"ai-agent-status"},C={class:"ai-agent-description"},S={class:"ai-agent-footer"};e("default",j(t({__name:"AiAgentBox",props:{agentId:{}},setup(e){var a;const t=e,j=b(),{aiAgents:$}=p(j),{emit:z}=y("saaiSettingsSaved"),{__:T,sprintf:q}=window.wp.i18n,B=u(),D=$.value[j.getAgentIndex(t.agentId)],E=n("active"===D.status&&"yes"===(null==D||null===(a=D.settings)||void 0===a?void 0:a.enabled)),L=e=>{E.value=e,$.value[j.getAgentIndex(t.agentId)].settings.enabled=e?"yes":"no",v().post(`storeagent-ai/v1/${t.agentId}/settings/save`,{enabled:e?"yes":"no"}).then((e=>{z(t.agentId)})).catch((e=>{console.error(e)}))},P=()=>{B.replace({name:"IndexPage",query:{page:"storeagent-settings",subpage:"ai-agents",agent:D.id}})};return(e,a)=>(c(),o("div",{id:`agent-${i(D).id}`,class:"saai-agent-box",style:s({transitionDelay:i(D).id.charCodeAt(0)%5*.005+"s"})},[d("div",w,[l(f,{icon:i(D).icon,alt:i(q)(i(T)("%s logo","storeagent-ai-for-woocommerce"),i(D).title)},null,8,["icon","alt"]),d("div",I,[d("h3",_,g(i(D).title),1),d("p",A,[l(i(h),{title:E.value?i(T)("Deactivate this agent","storeagent-ai-for-woocommerce"):i(T)("Activate this agent","storeagent-ai-for-woocommerce"),checked:E.value,"onUpdate:checked":a[0]||(a[0]=e=>E.value=e),size:"default",onChange:L},null,8,["title","checked"])])])]),d("p",C,g(i(D).description),1),d("div",S,[l(i(x),{size:"small",onClick:P},{default:r((()=>[m(g(i(T)("SETTINGS","storeagent-ai-for-woocommerce")),1)])),_:1})])],12,k))}}),[["__scopeId","data-v-0dcae5bc"]]))}}}));
