import{_ as w}from"./AbstraButton.vue_vue_type_script_setup_true_lang-DlgKlyjd.js";import{e as h,W as I,r as o,n as A,J as m,q as x,g as r,x as g,v as d,f as p,s as a,K as t,aV as P,X as S,j as z,a$ as D,T as C,U as E,as as O}from"./jwt-decode.esm-TBTnMpAQ.js";import"./router-D3FyrFLh.js";import{M as V,i as $}from"./member-DcSvDUMh.js";import{a as B}from"./organization-c9JpfAmx.js";import"./tables-BnZZliwP.js";import{O as F,a as M}from"./OrgPageHeader-DEalzHNh.js";import"./LoadingOutlined-BqxBN2hi.js";import"./ts.worker-9cx-N_QF.js";import"./string-BWyWHyKB.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},c=new Error().stack;c&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[c]="3d1b042e-fd98-4cd7-99c0-df1777f97592",s._sentryDebugIdIdentifier="sentry-dbid-3d1b042e-fd98-4cd7-99c0-df1777f97592")}catch{}})();const N={key:0,class:"loading-container"},T={key:0,class:"ai-skills-footer"},R=h({__name:"AiSkills",setup(s){const l=I().params.organizationId,_=new B,k=new V,v=o(!0),u=o(!1),i=o(""),f=o(!1);A(async()=>{try{const[e,n]=await Promise.all([_.listSkills(l),k.me(l).catch(()=>null)]);e.length>0&&(i.value=e[0].content),f.value=$(n)}catch(e){m.error(e instanceof Error?e.message:"Failed to load skill")}finally{v.value=!1}});async function y(){u.value=!0;try{await _.upsertSkill(l,{content:i.value}),m.success(t.translate("i18n_aiskills_saved"))}catch(e){m.error(e instanceof Error?e.message:"Failed to save")}finally{u.value=!1}}return(e,n)=>(r(),x(M,null,{default:g(()=>[d(F,{title:a(t).translate("i18n_aiskills_title"),subtitle:a(t).translate("i18n_aiskills_subtitle")},null,8,["title","subtitle"]),v.value?(r(),p("div",N,[d(a(P),{size:"large"})])):(r(),p(S,{key:1},[d(a(D),{value:i.value,"onUpdate:value":n[0]||(n[0]=b=>i.value=b),placeholder:a(t).translate("i18n_aiskills_placeholder"),"auto-size":{minRows:20},disabled:!f.value,class:"ai-skills-editor"},null,8,["value","placeholder","disabled"]),f.value?(r(),p("div",T,[d(w,{type:"primary",loading:u.value,onClick:y},{default:g(()=>[C(E(a(t).translate("i18n_aiskills_save")),1)]),_:1},8,["loading"])])):z("",!0)],64))]),_:1}))}}),Q=O(R,[["__scopeId","data-v-c355984b"]]);export{Q as default};
//# sourceMappingURL=AiSkills-CefXgM2m.js.map
