1import"../chunks/CWj6FrbW.js";import"../chunks/69_IOA4Y.js";import{p as N,g as O,o as V,h as y,i as T,a as c,b as U,s as q,k as x,l as r,e as d,m as B,c as l,r as m,f as g,u as W}from"../chunks/7a2fV5I9.js";import{i as P}from"../chunks/Dw-yaK-_.js";import{i as D}from"../chunks/CWFN-V6k.js";import{g as v}from"../chunks/DKj2ZiCb.js";import{p as Q}from"../chunks/DM_dH_2S.js";import{b as j,d as z,a as C}from"../chunks/CKDpr9Zd.js";import{S as F}from"../chunks/2p5Upk8k.js";import{T as G}from"../chunks/DE9C4Oa9.js";import{e as H,c as M,W as _}from"../chunks/CwGRjOQu.js";import{t as Y}from"../chunks/DjKuKC5p.js";import{t as n}from"../chunks/B1RxOmHW.js";var A=g('<div class="h-full min-w-0 overflow-x-hidden"><!></div>'),J=g('<div class="flex items-center justify-center h-full"><div class=" pb-16"><!></div></div>');function le(f,h){N(h,!1);const i=()=>d(w,"$i18n",p),E=()=>d(Q,"$page",p),[p,I]=q(),w=O("i18n");let t=B(null);const S=async o=>{const e=H(o.content);if(M((e==null?void 0:e.required_open_webui_version)??"0.0.0",_)){n.error(i().t("Open WebUI version (v{{OPEN_WEBUI_VERSION}}) is lower than required version (v{{REQUIRED_VERSION}})",{OPEN_WEBUI_VERSION:_,REQUIRED_VERSION:(e==null?void 0:e.required_open_webui_version)??"0.0.0"}));return}await z(localStorage.token,r(t).id,{id:o.id,name:o.name,meta:o.meta,content:o.content,access_grants:o.access_grants}).catch(a=>(n.error(`${a}`),null))&&(n.success(i().t("Tool updated successfully")),Y.set(await C(localStorage.token)))};V(async()=>{const o=E().url.searchParams.get("id");if(o){const e=await j(localStorage.token,o).catch(s=>(n.error(`${s}`),v("/workspace/tools"),null));if(e&&!e.write_access){n.error(i().t("You do not have permission to edit this tool")),v("/workspace/tools");return}e&&(x(t,e),r(t))}}),D();var u=y(),R=T(u);{var $=o=>{var e=A(),s=l(e);{let a=W(()=>r(t).access_grants??[]);G(s,{edit:!0,get id(){return r(t).id},get name(){return r(t).name},get meta(){return r(t).meta},get content(){return r(t).content},get accessGrants(){return r(a)},onSave:k=>{S(k)}})}m(e),c(o,e)},b=o=>{var e=J(),s=l(e),a=l(s);F(a,{className:"size-5"}),m(s),m(e),c(o,e)};P(R,o=>{r(t)?o($):o(b,-1)})}c(f,u),U(),I()}export{le as component}; 2//# sourceMappingURL=51.DzQPui5e.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.