1import"../chunks/CWj6FrbW.js";import"../chunks/69_IOA4Y.js";import{p as M,g as C,o as D,h,i as I,a as p,b as J,s as P,k as l,l as o,e as g,m as d,c as Q,r as H,u,f as L}from"../chunks/7a2fV5I9.js";import{i as j}from"../chunks/Dw-yaK-_.js";import{k as z}from"../chunks/PFz3DOhQ.js";import{i as A}from"../chunks/CWFN-V6k.js";import{t as _}from"../chunks/B1RxOmHW.js";import{g as b}from"../chunks/BnvOT63w.js";import{c as G,f as K,d as T,e as X}from"../chunks/C33EP41Y.js";import{c as Y,g as Z}from"../chunks/BwF-AzEk.js";import{F as ee}from"../chunks/Day8yLqD.js";import{g as te}from"../chunks/BIMfEMVU.js";import{e as oe,c as ne,W as N}from"../chunks/DKKyCjZm.js";var se=L('<div class="px-[1rem] h-full min-w-0 overflow-x-hidden"><!></div>');function we(O,R){M(R,!1);const v=()=>g(F,"$i18n",m),w=()=>g(G,"$config",m),k=()=>g(X,"$settings",m),[m,V]=P(),F=C("i18n");let E=d(!1),S=d(!1),s=d(null);const U=async e=>{var r,a,c;const n=oe(e.content);if(ne((n==null?void 0:n.required_open_webui_version)??"0.0.0",N)){_.error(v().t("Open WebUI version (v{{OPEN_WEBUI_VERSION}}) is lower than required version (v{{REQUIRED_VERSION}})",{OPEN_WEBUI_VERSION:N,REQUIRED_VERSION:(n==null?void 0:n.required_open_webui_version)??"0.0.0"}));return}await Y(localStorage.token,{id:e.id,name:e.name,meta:e.meta,content:e.content}).catch(f=>(_.error(`${f}`),null))&&(_.success(v().t("Function created successfully")),K.set(await Z(localStorage.token)),T.set(await te(localStorage.token,((a=(r=w())==null?void 0:r.features)==null?void 0:a.enable_direct_connections)&&(((c=k())==null?void 0:c.directConnections)??null),!1,!0)),await b("/admin/functions"))};D(()=>{var e,n;if(!((n=(e=w())==null?void 0:e.features)!=null&&n.enable_plugins)){b("/admin",{replaceState:!0});return}window.addEventListener("message",async i=>{["https://openwebui.com","https://www.openwebui.com","http://localhost:9999"].includes(i.origin)&&(l(s,JSON.parse(i.data)),o(s))}),(window.opener??!1)&&window.opener.postMessage("loaded","*"),sessionStorage.function&&(l(s,JSON.parse(sessionStorage.function)),sessionStorage.removeItem("function"),o(s),l(S,!0)),l(E,!0)}),A();var $=h(),q=I($);{var x=e=>{var n=h(),i=I(n);z(i,()=>{var r;return(r=o(s))==null?void 0:r.content},r=>{var a=se(),c=Q(a);{let f=u(()=>{var t;return((t=o(s))==null?void 0:t.id)??""}),W=u(()=>{var t;return((t=o(s))==null?void 0:t.name)??""}),y=u(()=>{var t;return((t=o(s))==null?void 0:t.meta)??{description:""}}),B=u(()=>{var t;return((t=o(s))==null?void 0:t.content)??""});ee(c,{get id(){return o(f)},get name(){return o(W)},get meta(){return o(y)},get content(){return o(B)},get clone(){return o(S)},onSave:t=>{U(t)}})}H(a),p(r,a)}),p(e,n)};j(q,e=>{o(E)&&e(x)})}p(O,$),J(),V()}export{we as component}; 2//# sourceMappingURL=16.BMzCIIvJ.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.