import{b as M,w as S,c as T,Z as I,j as l,p as v,q as n,s as E,u as s,y as j,a,g as C,i as y,G as b,F as A,H as F,z as P}from"./vue-Cm77DuTi.js";import{u as $}from"./widget-jbnupkVY.js";import{M as B}from"./MkContainer-CNBcUt5w.js";import{S as U,_ as q,Q as R,d as V,k as D,V as k}from"./app-QjDgb7aF.js";import"./charts-3gEHPHRq.js";import"./media-DuCIZ-3n.js";const H=["id","width"],L=["id"],f="abcdefghijklmnopqrstuvwxyz",N=M({__name:"MkTagCloud",setup(w,{expose:p}){const g=!!window.TagCanvas,h=getComputedStyle(document.documentElement),e=Array.from(Array(16)).map(()=>f[Math.floor(Math.random()*f.length)]).join(""),i=Array.from(Array(16)).map(()=>f[Math.floor(Math.random()*f.length)]).join("");let o=a(!1),d=a(null),c=a(null),r=a(null),u=a(300);return S(o,()=>{try{window.TagCanvas.Start(e,i,{textColour:"#ffffff",outlineColour:U(h.getPropertyValue("--accent")).toHexString(),outlineRadius:10,initial:[-.03,-.01],frontSelect:!0,imageRadius:8,dragThreshold:3,wheelZoom:!1,reverse:!0,depth:.5,maxSpeed:.2,minSpeed:.003,stretchX:.8,stretchY:.8})}catch{}}),T(()=>{u.value=d.value.offsetWidth,g?o.value=!0:document.head.appendChild(Object.assign(document.createElement("script"),{async:!0,src:"/client-assets/tagcanvas.min.js"})).addEventListener("load",()=>o.value=!0)}),I(()=>{window.TagCanvas&&window.TagCanvas.Delete(e)}),p({update:()=>{window.TagCanvas.Update(e)}}),(m,t)=>(l(),v("div",{ref_key:"rootEl",ref:d,class:"meijqfqm"},[n("canvas",{id:s(e),ref_key:"canvasEl",ref:c,class:"canvas",width:s(u),height:"300",onContextmenu:E(()=>{},["prevent"])},null,40,H),n("div",{id:s(i),ref_key:"tagsEl",ref:r,class:"tags"},[n("ul",null,[j(m.$slots,"default",{},void 0,!0)])],8,L)],512))}}),W=q(N,[["__scopeId","data-v-28d58014"]]),z={class:""},O=["onClick"],Z=["src"],x="instanceCloud",ae=M({__name:"instance-cloud",props:{widget:{}},emits:["updateProps"],setup(w,{expose:p,emit:g}){const h={transparent:{type:"boolean",default:!1}},e=w,i=g,{widgetProps:o,configure:d}=$(x,h,e,i),c=a();let r=P(null);function u(t){D(`/instance-info/${t.host}`)}R(()=>{V("federation/instances",{sort:"+lastCommunicatedAt",limit:25}).then(t=>{r.value=t,c.value&&c.value.update()})},1e3*60*3,{immediate:!0,afterMounted:!0});function m(t){return k(t.iconUrl,"preview")??k(t.faviconUrl,"preview")??"/client-assets/dummy.png"}return p({name:x,configure:d,id:e.widget?e.widget.id:null}),(t,G)=>(l(),C(B,{naked:s(o).transparent,"show-header":!1,class:"mkw-instance-cloud"},{default:y(()=>[n("div",z,[s(r)?(l(),C(W,{key:0},{default:y(()=>[(l(!0),v(A,null,b(s(r),_=>(l(),v("li",{key:_.id},[n("a",{onClick:E(Q=>u(_),["prevent"])},[n("img",{style:{width:"32px"},src:m(_)},null,8,Z)],8,O)]))),128))]),_:1})):F("",!0)])]),_:1},8,["naked"]))}});export{ae as default};
//# sourceMappingURL=instance-cloud-DCwEFC9W.js.map
