import{bH as c,C as r}from"./index-BGoV7aa6.js";const l=async(a,n)=>{const t=new URLSearchParams;return t.set("project",n),t.set("recursion","1"),fetch(`/1.0/networks/${encodeURIComponent(a)}/load-balancers?${t.toString()}`).then(r).then(e=>e.metadata.sort((o,s)=>o.listen_address.localeCompare(s.listen_address)*10+(o.location&&s.location?o.location.localeCompare(s.location):0)))},i=async(a,n,t)=>{const e=new URLSearchParams;return e.set("project",t),e.set("recursion","1"),fetch(`/1.0/networks/${encodeURIComponent(a)}/load-balancers/${encodeURIComponent(n)}?${e.toString()}`).then(r).then(o=>o.metadata)},h=async(a,n,t)=>{const e=new URLSearchParams;return e.set("project",t),fetch(`/1.0/networks/${encodeURIComponent(a)}/load-balancers?${e.toString()}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then(c).then(o=>{const s=o.headers.get("Location");return(s==null?void 0:s.split("/").pop())??""})},m=async(a,n,t)=>{const e=new URLSearchParams;e.set("project",t),await fetch(`/1.0/networks/${encodeURIComponent(a)}/load-balancers/${encodeURIComponent(n.listen_address)}?${e.toString()}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then(r)},w=async(a,n,t)=>{const e=new URLSearchParams;e.set("project",t),await fetch(`/1.0/networks/${encodeURIComponent(a.name)}/load-balancers/${encodeURIComponent(n.listen_address)}?${e.toString()}`,{method:"DELETE"}).then(r)};export{l as a,h as c,w as d,i as f,m as u};
