Files
archy-demo/web-dist/assets/CloudFolder-8jSNyq3F.js

2 lines
36 KiB
JavaScript

import{$ as fe,r as b,j as k,d as G,c as i,a as e,F as P,P as O,f as z,D as M,G as $,q as l,E as p,b as V,N as ne,m as q,o as pe,B as H,a1 as ae,g as ie,a2 as he,H as ge,z as we,w as ke,J as Z,h as _,i as xe,U as be,n as ye,x as $e,u as Ce}from"./index-DnbYEqLr.js";import{f as I}from"./filebrowser-client-DRXM9PC4.js";const ee=fe("cloud",()=>{const t=b("/"),f=b([]),s=b(!1),h=b(null),a=b(!1),r=k(()=>{const c=t.value.split("/").filter(Boolean),v=[{name:"Home",path:"/"}];let x="";for(const U of c)x+=`/${U}`,v.push({name:U,path:x});return v}),u=k(()=>{const c=f.value.filter(x=>x.isDir),v=f.value.filter(x=>!x.isDir);return c.sort((x,U)=>x.name.localeCompare(U.name)),v.sort((x,U)=>x.name.localeCompare(U.name)),[...c,...v]});async function d(){if(a.value)return!0;const c=await I.login();return a.value=c,c}async function g(c){s.value=!0,h.value=null;try{if(!a.value&&!await d()){h.value="Failed to authenticate with File Browser";return}try{const v=await I.listDirectory(c);f.value=v,t.value=c}catch{if(c!=="/")try{const v=c.substring(0,c.lastIndexOf("/"))||"/",x=c.substring(c.lastIndexOf("/")+1);await I.createFolder(v,x);const U=await I.listDirectory(c);f.value=U,t.value=c}catch{const v=await I.listDirectory("/");f.value=v,t.value="/"}else throw new Error("Failed to list root directory")}}catch(v){h.value=v instanceof Error?v.message:"Failed to load files"}finally{s.value=!1}}async function y(){await g(t.value)}async function E(c){await I.upload(t.value,c),await y()}async function B(c){await I.deleteItem(c),await y()}function o(c){return I.downloadUrl(c)}async function m(c){return I.fetchBlobUrl(c)}async function C(c){return I.downloadFile(c)}function L(){t.value="/",f.value=[],s.value=!1,h.value=null}return{currentPath:t,items:f,loading:s,error:h,authenticated:a,breadcrumbs:r,sortedItems:u,init:d,navigate:g,refresh:y,uploadFile:E,deleteItem:B,downloadUrl:o,fetchBlobUrl:m,downloadFile:C,reset:L}}),Me={class:"cloud-toolbar"},Be={class:"cloud-breadcrumbs"},Se=["onClick"],De={key:0,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},je={key:1},ze={key:2,class:"w-3 h-3 text-white/30 mx-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Le={class:"flex items-center gap-2"},Ue={class:"cloud-view-toggle"},Ve=G({__name:"CloudToolbar",props:{breadcrumbs:{},viewMode:{}},emits:["navigate","refresh","upload","update:viewMode"],setup(t,{emit:f}){const s=f,h=b(null);function a(){h.value?.click()}function r(u){const d=u.target;d.files&&d.files.length>0&&(s("upload",Array.from(d.files)),d.value="")}return(u,d)=>(l(),i("div",Me,[e("nav",Be,[(l(!0),i(P,null,O(t.breadcrumbs,(g,y)=>(l(),i("button",{key:g.path,class:z(["cloud-breadcrumb-item",{"cloud-breadcrumb-active":y===t.breadcrumbs.length-1}]),onClick:E=>y<t.breadcrumbs.length-1&&u.$emit("navigate",g.path)},[y===0?(l(),i("svg",De,[...d[3]||(d[3]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"},null,-1)])])):(l(),i("span",je,M(g.name),1)),y<t.breadcrumbs.length-1?(l(),i("svg",ze,[...d[4]||(d[4]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])])):$("",!0)],10,Se))),128))]),e("div",Le,[e("div",Ue,[e("button",{class:z(["cloud-view-toggle-btn",{"cloud-view-toggle-active":t.viewMode==="grid"}]),title:"Grid view",onClick:d[0]||(d[0]=g=>u.$emit("update:viewMode","grid"))},[...d[5]||(d[5]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm10 0a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zm10 0a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"})],-1)])],2),e("button",{class:z(["cloud-view-toggle-btn",{"cloud-view-toggle-active":t.viewMode==="list"}]),title:"List view",onClick:d[1]||(d[1]=g=>u.$emit("update:viewMode","list"))},[...d[6]||(d[6]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 10h16M4 14h16M4 18h16"})],-1)])],2)]),e("button",{class:"glass-button cloud-toolbar-btn",title:"Upload file",onClick:a},[...d[7]||(d[7]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"})],-1),e("span",{class:"hidden md:inline"},"Upload",-1)])]),e("button",{class:"glass-button cloud-toolbar-btn",title:"Refresh",onClick:d[2]||(d[2]=g=>u.$emit("refresh"))},[...d[8]||(d[8]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1)])])]),e("input",{ref_key:"fileInput",ref:h,type:"file",class:"hidden",multiple:"",onChange:r},null,544)]))}}),Ee=new Set(["jpg","jpeg","png","gif","webp","svg","bmp","ico"]),Ae=new Set(["mp3","flac","wav","ogg","aac","m4a","wma"]),Ie=new Set(["mp4","mkv","avi","mov","webm","wmv","flv"]),Fe=new Set(["pdf","doc","docx","txt","rtf","odt","md"]),Te=new Set(["xls","xlsx","csv","ods"]),Pe=new Set(["zip","tar","gz","rar","7z","bz2"]);function He(t,f){return f?"folder":Ee.has(t)?"image":Ae.has(t)?"audio":Ie.has(t)?"video":Fe.has(t)?"document":Te.has(t)?"spreadsheet":Pe.has(t)?"archive":"file"}const Ne={folder:["M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"],audio:["M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3"],video:["M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z","M21 12a9 9 0 11-18 0 9 9 0 0118 0z"],image:["M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"],document:["M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"],spreadsheet:["M3 10h18M3 14h18M3 6h18M3 18h18M8 6v12M16 6v12"],archive:["M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8v10a2 2 0 002 2h10a2 2 0 002-2V8m-9 4h4"],file:["M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"]},Oe={folder:"text-amber-400",audio:"text-orange-400",video:"text-purple-400",image:"text-blue-400",document:"text-green-400",spreadsheet:"text-emerald-400",archive:"text-yellow-400",file:"text-white/50"},Re={folder:"Folder",audio:"Audio",video:"Video",image:"Image",document:"Document",spreadsheet:"Spreadsheet",archive:"Archive",file:"File"},Ge={folder:"bg-amber-500/15 text-amber-400/70",audio:"bg-orange-500/15 text-orange-400/70",video:"bg-purple-500/15 text-purple-400/70",image:"bg-blue-500/15 text-blue-400/70",document:"bg-green-500/15 text-green-400/70",spreadsheet:"bg-emerald-500/15 text-emerald-400/70",archive:"bg-yellow-500/15 text-yellow-400/70",file:"bg-white/8 text-white/50"};function re(t,f){const s=k(()=>He(t.value,f.value)),h=k(()=>s.value==="image"),a=k(()=>s.value==="audio"),r=k(()=>s.value==="video"),u=k(()=>Ne[s.value]),d=k(()=>Oe[s.value]),g=k(()=>Re[s.value]),y=k(()=>Ge[s.value]);return{category:s,isImage:h,isAudio:a,isVideo:r,iconPaths:u,iconColor:d,badgeLabel:g,badgeClass:y}}function ue(t){if(t===0)return"0 B";const f=["B","KB","MB","GB","TB"],s=Math.floor(Math.log(t)/Math.log(1024));return`${(t/Math.pow(1024,s)).toFixed(s>0?1:0)} ${f[s]}`}function de(t){const f=new Date(t),h=Date.now()-f.getTime(),a=Math.floor(h/6e4);if(a<1)return"Just now";if(a<60)return`${a}m ago`;const r=Math.floor(a/60);if(r<24)return`${r}h ago`;const u=Math.floor(r/24);return u<7?`${u}d ago`:f.toLocaleDateString()}const Xe={class:"cloud-file-item-thumb"},Ye=["src","alt"],qe={key:1,class:"w-full h-full rounded-[6px] flex items-center justify-center bg-white/8"},Je=["d"],Ke={class:"min-w-0 flex-1 py-0.5"},Qe={class:"text-sm font-semibold truncate text-white/90"},We={class:"text-xs mt-0.5 text-white/40"},Ze={key:0},_e={key:1},et={class:"flex items-center gap-1.5 mt-1.5"},tt={key:0,class:"cloud-file-badge bg-white/8 text-white/50"},lt=["href"],ot={key:2,class:"w-4 h-4 text-white/30",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},st=G({__name:"FileCard",props:{item:{}},emits:["navigate","delete","share"],setup(t,{emit:f}){const s=t,h=f,a=ee(),r=b(!1),u=k(()=>s.item.extension),d=k(()=>s.item.isDir),{isImage:g,iconPaths:y,iconColor:E,badgeLabel:B,badgeClass:o}=re(u,d),m=k(()=>!g.value||r.value?null:a.downloadUrl(s.item.path)),C=k(()=>a.downloadUrl(s.item.path));function L(){s.item.isDir&&h("navigate",s.item.path)}return(c,v)=>(l(),i("button",{class:"cloud-file-item group","data-controller-container":"",tabindex:"0",onClick:L},[e("div",Xe,[p(g)&&m.value&&!r.value?(l(),i("img",{key:0,src:m.value,alt:t.item.name,class:"w-full h-full object-cover rounded-[6px] transition-transform duration-300 group-hover:scale-105",loading:"lazy",onError:v[0]||(v[0]=x=>r.value=!0)},null,40,Ye)):(l(),i("div",qe,[(l(),i("svg",{class:z(["w-5 h-5",p(E)]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[(l(!0),i(P,null,O(p(y),(x,U)=>(l(),i("path",{key:U,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:x},null,8,Je))),128))],2))]))]),e("div",Ke,[e("p",Qe,M(t.item.name),1),e("p",We,[t.item.isDir?$("",!0):(l(),i("span",Ze,M(p(ue)(t.item.size)),1)),t.item.isDir?$("",!0):(l(),i("span",_e," · ")),e("span",null,M(p(de)(t.item.modified)),1)]),e("div",et,[e("span",{class:z(["cloud-file-badge",p(o)])},M(p(B)),3),t.item.extension&&!t.item.isDir?(l(),i("span",tt," ."+M(t.item.extension),1)):$("",!0)])]),e("div",{class:"cloud-file-item-actions",onClick:v[4]||(v[4]=V(()=>{},["stop"]))},[e("button",{class:"cloud-file-action-btn cloud-file-action-share",title:"Share with peers",onClick:v[1]||(v[1]=V(x=>c.$emit("share",t.item.path,t.item.name,t.item.isDir),["stop"]))},[...v[5]||(v[5]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z"})],-1)])]),t.item.isDir?$("",!0):(l(),i("a",{key:0,href:C.value,download:"",class:"cloud-file-action-btn",title:"Download",onClick:v[2]||(v[2]=V(()=>{},["stop"]))},[...v[6]||(v[6]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})],-1)])],8,lt)),t.item.isDir?$("",!0):(l(),i("button",{key:1,class:"cloud-file-action-btn cloud-file-action-delete",title:"Delete",onClick:v[3]||(v[3]=V(x=>c.$emit("delete",t.item.path),["stop"]))},[...v[7]||(v[7]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)])])),t.item.isDir?(l(),i("svg",ot,[...v[8]||(v[8]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])])):$("",!0)])]))}}),D=b(null),Y=b(null),te=b(""),N=b(!1),le=b(0),J=b(0),X=b(null);function it(t,f){if(D.value||(D.value=new Audio,D.value.addEventListener("timeupdate",()=>{le.value=D.value?.currentTime??0}),D.value.addEventListener("loadedmetadata",()=>{J.value=D.value?.duration??0,X.value=null}),D.value.addEventListener("ended",()=>{N.value=!1}),D.value.addEventListener("pause",()=>{N.value=!1}),D.value.addEventListener("play",()=>{N.value=!0,X.value=null}),D.value.addEventListener("error",()=>{N.value=!1,X.value="Could not play audio. File Browser may not be running."})),X.value=null,Y.value===t&&N.value){D.value.pause();return}Y.value!==t&&(D.value.src=t,Y.value=t,te.value=f),D.value.play()}function nt(){D.value?.pause()}function at(t){D.value&&(D.value.currentTime=t)}function rt(){D.value&&(D.value.pause(),D.value.currentTime=0),N.value=!1,Y.value=null,te.value=""}const ut=k(()=>J.value===0?0:le.value/J.value*100);function ce(){return{play:it,pause:nt,seek:at,stop:rt,playing:N,currentName:te,currentTime:le,duration:J,progress:ut,currentSrc:Y,error:X}}const dt=["src","alt"],ct=["src","alt"],vt=["d"],mt={class:"cloud-grid-card-play-btn"},ft={key:0,class:"w-8 h-8 text-white",fill:"currentColor",viewBox:"0 0 24 24"},pt={key:1,class:"w-8 h-8 text-white",fill:"currentColor",viewBox:"0 0 24 24"},ht={class:"cloud-grid-card-info"},gt={class:"text-xs font-semibold text-white/90 leading-tight truncate"},wt={class:"flex items-center gap-1 mt-0.5"},kt={key:0,class:"text-xs text-white/40"},xt={key:1,class:"text-xs text-white/40"},bt={class:"text-xs text-white/40"},yt={class:"cloud-grid-card-badges"},$t=["href"],Ct=G({__name:"FileCardGrid",props:{item:{}},emits:["navigate","delete","play","share"],setup(t,{emit:f}){const s=t,h=f,a=ee(),r=b(!1),u=k(()=>s.item.extension),d=k(()=>s.item.isDir),{category:g,isImage:y,isAudio:E,isVideo:B,iconPaths:o,iconColor:m,badgeLabel:C,badgeClass:L}=re(u,d),c=k(()=>r.value?null:y.value||B.value?a.downloadUrl(s.item.path):null),v=k(()=>a.downloadUrl(s.item.path)),{playing:x,currentSrc:U}=ce(),T=k(()=>x.value&&U.value===v.value),R=k(()=>y.value||B.value?"aspect-square":g.value==="document"||g.value==="folder"?"aspect-[4/3]":"aspect-square"),A=k(()=>s.item.isDir?"bg-amber-500/10":E.value?"bg-orange-500/10":B.value?"bg-purple-500/10":y.value?"bg-blue-500/10":g.value==="document"?"bg-green-500/10":g.value==="spreadsheet"?"bg-emerald-500/10":g.value==="archive"?"bg-yellow-500/10":"bg-white/5");function K(){s.item.isDir&&h("navigate",s.item.path)}return(oe,w)=>(l(),i("button",{class:"cloud-grid-card group","data-controller-container":"",tabindex:"0",onClick:K},[e("div",{class:z(["cloud-grid-card-cover",R.value])},[p(y)&&c.value&&!r.value?(l(),i("img",{key:0,src:c.value,alt:t.item.name,class:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-110",loading:"lazy",onError:w[0]||(w[0]=F=>r.value=!0)},null,40,dt)):p(B)&&c.value&&!r.value?(l(),i("img",{key:1,src:c.value,alt:t.item.name,class:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-110",loading:"lazy",onError:w[1]||(w[1]=F=>r.value=!0)},null,40,ct)):(l(),i("div",{key:2,class:z(["w-full h-full flex items-center justify-center",A.value])},[(l(),i("svg",{class:z(["w-10 h-10",p(m)]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[(l(!0),i(P,null,O(p(o),(F,Q)=>(l(),i("path",{key:Q,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:F},null,8,vt))),128))],2))],2)),w[12]||(w[12]=e("div",{class:"cloud-grid-card-gradient"},null,-1)),p(E)||p(B)?(l(),i("div",{key:3,class:z(["cloud-grid-card-play",{"cloud-grid-card-play-active":T.value}]),onClick:w[2]||(w[2]=V(F=>h("play",t.item.path,t.item.name),["stop"]))},[e("span",mt,[T.value?(l(),i("svg",pt,[...w[8]||(w[8]=[e("path",{d:"M6 4h4v16H6V4zm8 0h4v16h-4V4z"},null,-1)])])):(l(),i("svg",ft,[...w[7]||(w[7]=[e("path",{d:"M8 5v14l11-7L8 5z"},null,-1)])]))])],2)):$("",!0),e("div",ht,[e("p",gt,M(t.item.name),1),e("div",wt,[t.item.isDir?$("",!0):(l(),i("span",kt,M(p(ue)(t.item.size)),1)),t.item.isDir?$("",!0):(l(),i("span",xt,"·")),e("span",bt,M(p(de)(t.item.modified)),1)])]),e("div",yt,[e("span",{class:z(["cloud-grid-card-badge",p(L)])},M(p(C)),3)]),e("div",{class:"cloud-grid-card-actions",onClick:w[6]||(w[6]=V(()=>{},["stop"]))},[e("button",{class:"cloud-file-action-btn cloud-file-action-share",title:"Share with peers",onClick:w[3]||(w[3]=V(F=>h("share",t.item.path,t.item.name,t.item.isDir),["stop"]))},[...w[9]||(w[9]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z"})],-1)])]),t.item.isDir?$("",!0):(l(),i("a",{key:0,href:v.value,download:"",class:"cloud-file-action-btn",title:"Download",onClick:w[4]||(w[4]=V(()=>{},["stop"]))},[...w[10]||(w[10]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})],-1)])],8,$t)),t.item.isDir?$("",!0):(l(),i("button",{key:1,class:"cloud-file-action-btn cloud-file-action-delete",title:"Delete",onClick:w[5]||(w[5]=V(F=>h("delete",t.item.path),["stop"]))},[...w[11]||(w[11]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)])]))])],2)]))}}),Mt={class:"flex-1 min-h-0 overflow-y-auto"},Bt={key:0,class:"aspect-square rounded-[10px] bg-white/8 animate-pulse"},St={key:1,class:"flex flex-col items-center justify-center py-16 text-center"},Dt={key:2,class:"cloud-card-grid"},jt={key:3,class:"cloud-file-list"},zt=G({__name:"FileGrid",props:{items:{},loading:{type:Boolean},viewMode:{default:"grid"}},emits:["navigate","delete","play","share"],setup(t){return(f,s)=>(l(),i("div",Mt,[t.loading?(l(),i("div",{key:0,class:z(t.viewMode==="grid"?"cloud-card-grid":"cloud-file-list")},[(l(),i(P,null,O(6,h=>e("div",{key:h,class:z(t.viewMode==="grid"?"cloud-grid-card-skeleton":"cloud-file-item cloud-file-item-skeleton")},[t.viewMode==="grid"?(l(),i("div",Bt)):(l(),i(P,{key:1},[s[7]||(s[7]=ne('<div class="cloud-file-item-thumb"><div class="w-full h-full rounded-[6px] bg-white/8 animate-pulse"></div></div><div class="min-w-0 flex-1 py-0.5"><div class="h-4 w-32 rounded bg-white/8 animate-pulse mb-1.5"></div><div class="h-3 w-20 rounded bg-white/5 animate-pulse"></div></div>',2))],64))],2)),64))],2)):t.items.length===0?(l(),i("div",St,[...s[8]||(s[8]=[e("svg",{class:"w-16 h-16 text-white/10 mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})],-1),e("p",{class:"text-white/50 text-sm"},"This folder is empty",-1),e("p",{class:"text-white/30 text-xs mt-1"},"Upload files to get started",-1)])])):t.viewMode==="grid"?(l(),i("div",Dt,[(l(!0),i(P,null,O(t.items,h=>(l(),q(Ct,{key:h.path,item:h,onNavigate:s[0]||(s[0]=a=>f.$emit("navigate",a)),onDelete:s[1]||(s[1]=a=>f.$emit("delete",a)),onPlay:s[2]||(s[2]=(a,r)=>f.$emit("play",a,r)),onShare:s[3]||(s[3]=(a,r,u)=>f.$emit("share",a,r,u))},null,8,["item"]))),128))])):(l(),i("div",jt,[(l(!0),i(P,null,O(t.items,h=>(l(),q(st,{key:h.path,item:h,onNavigate:s[4]||(s[4]=a=>f.$emit("navigate",a)),onDelete:s[5]||(s[5]=a=>f.$emit("delete",a)),onShare:s[6]||(s[6]=(a,r,u)=>f.$emit("share",a,r,u))},null,8,["item"]))),128))]))]))}}),Lt={class:"share-modal glass-card"},Ut={class:"flex items-center justify-between mb-5"},Vt={class:"flex items-center gap-3"},Et={class:"text-xs text-white/50 truncate max-w-[200px]"},At={class:"share-modal-row"},It={class:"flex-1"},Ft={class:"text-sm font-medium text-white/90"},Tt={class:"share-toggle"},Pt={key:0,class:"mt-4 space-y-3"},Ht={class:"share-access-options"},Nt={key:0,class:"share-price-input-wrap"},Ot={key:1,class:"share-modal-status mt-4"},Rt={key:2,class:"share-modal-error mt-4"},Gt={class:"text-sm text-red-400"},Xt={key:3,class:"share-modal-success mt-4"},Yt={class:"text-sm text-green-400"},qt={class:"flex justify-end gap-3 mt-5"},Jt=["disabled"],Kt=G({__name:"ShareModal",props:{filename:{},filepath:{},isDir:{type:Boolean},existingItemId:{}},emits:["close","saved"],setup(t,{emit:f}){const s=t,h=f,a=b(!1),r=b("free"),u=b(100),d=b(!1),g=b(null),y=b(null);pe(async()=>{try{const o=(await H.call({method:"content.list-mine"})).items.find(m=>m.filename===s.filename||m.filename===s.filepath);if(o){a.value=!0;const m=o.access;typeof m=="string"?m==="free"?r.value="free":m==="peersonly"&&(r.value="peers_only"):m&&typeof m=="object"&&("paid"in m&&m.paid?(r.value="paid",u.value=m.paid.price_sats||100):"peersonly"in m&&(r.value="peers_only"))}}catch{}});async function E(){d.value=!0,g.value=null,y.value=null;try{if(a.value){let o=(await H.call({method:"content.list-mine"})).items.find(L=>L.filename===s.filename||L.filename===s.filepath)?.id;if(!o){const L=s.filename.split(".").pop()?.toLowerCase()||"",c={jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp",mp4:"video/mp4",webm:"video/webm",mkv:"video/x-matroska",mp3:"audio/mpeg",flac:"audio/flac",ogg:"audio/ogg",wav:"audio/wav",pdf:"application/pdf",zip:"application/zip",txt:"text/plain"};o=(await H.call({method:"content.add",params:{filename:s.filepath||s.filename,mime_type:c[L]||"application/octet-stream",description:""}})).item.id}const m={id:o,access:r.value};r.value==="paid"&&(m.price_sats=u.value),await H.call({method:"content.set-pricing",params:m}),await H.call({method:"content.set-availability",params:{id:o,availability:"all_peers"}});const C=r.value==="paid"?`Shared for ${u.value} sats`:r.value==="peers_only"?"Shared with peers":"Shared (free)";y.value=C}else{const o=(await H.call({method:"content.list-mine"})).items.find(m=>m.filename===s.filename||m.filename===s.filepath);o&&await H.call({method:"content.remove",params:{id:o.id}}),y.value="Sharing disabled"}setTimeout(()=>h("saved"),800)}catch(B){g.value=B instanceof Error?B.message:"Failed to update sharing"}finally{d.value=!1}}return(B,o)=>(l(),q(ae,{to:"body"},[e("div",{class:"share-modal-backdrop",onClick:o[7]||(o[7]=V(m=>B.$emit("close"),["self"]))},[e("div",Lt,[e("div",Ut,[e("div",Vt,[o[9]||(o[9]=e("div",{class:"w-9 h-9 rounded-lg bg-orange-500/15 flex items-center justify-center"},[e("svg",{class:"w-5 h-5 text-orange-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z"})])],-1)),e("div",null,[o[8]||(o[8]=e("h3",{class:"text-base font-semibold text-white"},"Share with Peers",-1)),e("p",Et,M(t.filename),1)])]),e("button",{class:"share-modal-close",onClick:o[0]||(o[0]=m=>B.$emit("close"))},[...o[10]||(o[10]=[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])]),e("div",At,[e("div",It,[e("p",Ft,"Share this "+M(t.isDir?"folder":"file"),1),o[11]||(o[11]=e("p",{class:"text-xs text-white/50 mt-0.5"},"Make visible to connected peers",-1))]),e("label",Tt,[ie(e("input",{type:"checkbox","onUpdate:modelValue":o[1]||(o[1]=m=>a.value=m)},null,512),[[he,a.value]]),o[12]||(o[12]=e("span",{class:"share-toggle-slider"},null,-1))])]),a.value?(l(),i("div",Pt,[o[18]||(o[18]=e("p",{class:"text-xs font-medium text-white/60 uppercase tracking-wider"},"Access Type",-1)),e("div",Ht,[e("button",{class:z(["share-access-option",{"share-access-option-active":r.value==="free"}]),onClick:o[2]||(o[2]=m=>r.value="free")},[...o[13]||(o[13]=[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1),e("span",{class:"text-sm font-medium"},"Free",-1),e("span",{class:"text-xs text-white/40"},"Open access",-1)])],2),e("button",{class:z(["share-access-option",{"share-access-option-active":r.value==="peers_only"}]),onClick:o[3]||(o[3]=m=>r.value="peers_only")},[...o[14]||(o[14]=[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"})],-1),e("span",{class:"text-sm font-medium"},"Peers Only",-1),e("span",{class:"text-xs text-white/40"},"Authenticated",-1)])],2),e("button",{class:z(["share-access-option",{"share-access-option-active":r.value==="paid"}]),onClick:o[4]||(o[4]=m=>r.value="paid")},[...o[15]||(o[15]=[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 10V3L4 14h7v7l9-11h-7z"})],-1),e("span",{class:"text-sm font-medium"},"Paid",-1),e("span",{class:"text-xs text-white/40"},"Earn sats",-1)])],2)]),r.value==="paid"?(l(),i("div",Nt,[o[16]||(o[16]=e("div",{class:"share-price-icon"},[e("svg",{class:"w-4 h-4 text-orange-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 10V3L4 14h7v7l9-11h-7z"})])],-1)),ie(e("input",{"onUpdate:modelValue":o[5]||(o[5]=m=>u.value=m),type:"number",min:"1",max:"1000000",placeholder:"Price in sats",class:"share-price-input"},null,512),[[ge,u.value,void 0,{number:!0}]]),o[17]||(o[17]=e("span",{class:"share-price-unit"},"sats",-1))])):$("",!0)])):$("",!0),d.value?(l(),i("div",Ot,[...o[19]||(o[19]=[e("div",{class:"w-4 h-4 border-2 border-white/20 border-t-white/80 rounded-full animate-spin"},null,-1),e("span",{class:"text-sm text-white/60"},"Saving...",-1)])])):$("",!0),g.value?(l(),i("div",Rt,[e("span",Gt,M(g.value),1)])):$("",!0),y.value?(l(),i("div",Xt,[o[20]||(o[20]=e("svg",{class:"w-4 h-4 text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})],-1)),e("span",Yt,M(y.value),1)])):$("",!0),e("div",qt,[e("button",{class:"glass-button px-4 py-2 rounded-lg text-sm",onClick:o[6]||(o[6]=m=>B.$emit("close"))},"Cancel"),e("button",{class:"glass-button px-5 py-2 rounded-lg text-sm font-medium share-modal-save",disabled:d.value||a.value&&r.value==="paid"&&(!u.value||u.value<1),onClick:E},M(a.value?"Share":"Stop Sharing"),9,Jt)])])])]))}}),Qt={class:"cloud-folder-container flex flex-col h-full"},Wt={class:"shrink-0 mb-4"},Zt={class:"flex items-center justify-between"},_t={class:"flex items-center gap-4"},el=["d"],tl={class:"hidden md:block"},ll={class:"text-2xl font-bold text-white"},ol={class:"text-sm text-white/50"},sl={class:"flex gap-2"},il={key:0,class:"glass-card p-12 text-center flex-1 flex flex-col items-center justify-center"},nl={class:"text-xl font-semibold text-white mb-2"},al={class:"text-white/60 mb-4"},rl={key:0,class:"cloud-drop-overlay"},ul={key:1,class:"glass-card p-3 mb-3 flex items-center gap-3"},dl={key:2,class:"glass-card p-3 mb-3 flex items-center gap-3 border border-red-500/30"},cl={class:"text-sm text-red-400"},vl={key:3,class:"cloud-audio-player"},ml={key:0,class:"w-6 h-6",fill:"currentColor",viewBox:"0 0 24 24"},fl={key:1,class:"w-6 h-6",fill:"currentColor",viewBox:"0 0 24 24"},pl={class:"flex-1 min-w-0"},hl={key:0,class:"text-sm text-red-400 truncate"},gl={key:1,class:"text-sm font-medium text-white/90 truncate"},wl={class:"cloud-audio-progress"},kl={key:2,class:"flex-1 min-h-0 rounded-xl overflow-hidden border border-white/10"},xl={key:0,class:"flex items-center justify-center h-full"},bl={class:"glass-card p-8 flex flex-col items-center gap-4"},yl={class:"text-sm text-white/60"},$l=["src"],Bl=G({__name:"CloudFolder",setup(t){const f=$e(),s=Ce(),h=we(),a=ee(),r=b("grid"),u=ce(),d=b(!1),g=b(!1),y=k(()=>s.params.folderId),E={immich:["immich_server","immich-server"],nextcloud:["nextcloud-aio","nextcloud-server"]};function B(j){const n=h.packages;if(n[j]?.state==="running")return!0;const S=E[j];if(S){for(const W of S)if(n[W]?.state==="running")return!0}return!1}const o=k(()=>window.location.origin),m={photos:()=>({name:"Photos & Videos",description:"Auto-backup & browse your media",appId:"filebrowser",appLabel:"File Browser",iconPaths:["M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"],iconBg:"bg-blue-500/15",iconColor:"text-blue-400",iframeUrl:`${o.value}/app/immich/photos`,externalUrl:`${o.value}/app/filebrowser/`,nativeUI:!0,initialPath:"/Photos"}),music:()=>({name:"Music",description:"Your music collection",appId:"filebrowser",appLabel:"File Browser",iconPaths:["M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3"],iconBg:"bg-orange-500/15",iconColor:"text-orange-400",iframeUrl:`${o.value}/app/nextcloud/apps/files/?dir=/Songs`,externalUrl:`${o.value}/app/filebrowser/`,nativeUI:!0,initialPath:"/Music"}),documents:()=>({name:"Documents",description:"Files, docs & spreadsheets",appId:"filebrowser",appLabel:"File Browser",iconPaths:["M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"],iconBg:"bg-green-500/15",iconColor:"text-green-400",iframeUrl:`${o.value}/app/nextcloud/apps/files/?dir=/Documents`,externalUrl:`${o.value}/app/filebrowser/`,nativeUI:!0,initialPath:"/Documents"}),files:()=>({name:"All Files",description:"Browse your server file system",appId:"filebrowser",appLabel:"File Browser",iconPaths:["M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"],iconBg:"bg-white/10",iconColor:"text-white/70",iframeUrl:`${o.value}/app/filebrowser/`,externalUrl:`${o.value}/app/filebrowser/`,nativeUI:!0,initialPath:"/"})},C=k(()=>{const j=m[y.value];return j?j():null}),L=k(()=>C.value?B(C.value.appId):!1),c=k(()=>C.value?.nativeUI===!0&&L.value),v=k(()=>C.value?.iframeUrl||"");ke([c,C],async([j,n])=>{j&&n&&(a.reset(),await a.init()&&await a.navigate(n.initialPath))},{immediate:!0});const x=b(null);function U(j,n,S){x.value={path:j,name:n,isDir:S}}const T=b(null),R=b(!1);let A=null;function K(){A&&(clearTimeout(A),A=null),R.value=!0}function oe(){A&&clearTimeout(A),A=setTimeout(()=>{R.value=!1},100)}function w(j){R.value=!1,A&&(clearTimeout(A),A=null);const n=j.dataTransfer;n?.files?.length&&F(Array.from(n.files))}async function F(j){g.value=!0,T.value=null;try{for(const n of j)await a.uploadFile(n)}catch(n){T.value=n instanceof Error?n.message:"Upload failed"}finally{g.value=!1}}async function Q(j){await a.deleteItem(j)}function ve(j,n){const S=a.downloadUrl(j);u.play(S,n)}function me(){C.value&&window.open(C.value.externalUrl,"_blank","noopener,noreferrer")}function se(){f.push("/dashboard/cloud")}return(j,n)=>(l(),i("div",Qt,[e("div",Wt,[e("button",{onClick:se,class:"hidden md:flex mb-4 items-center gap-2 text-white/70 hover:text-white transition-colors"},[...n[10]||(n[10]=[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1),Z(" Back to Cloud ",-1)])]),(l(),q(ae,{to:"body"},[e("button",{onClick:se,class:"md:hidden mobile-back-btn glass-button px-6 py-3 rounded-lg font-medium shadow-2xl flex items-center justify-center gap-2"},[...n[11]||(n[11]=[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1),e("span",null,"Back to Cloud",-1)])])])),e("div",Zt,[e("div",_t,[e("div",{class:z(["flex-shrink-0 w-12 h-12 rounded-xl flex items-center justify-center",C.value?.iconBg||"bg-white/10"])},[(l(),i("svg",{class:z(["w-7 h-7",C.value?.iconColor||"text-white/70"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[(l(!0),i(P,null,O(C.value?.iconPaths||[],(S,W)=>(l(),i("path",{key:W,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:S},null,8,el))),128))],2))],2),e("div",tl,[e("h1",ll,M(C.value?.name||"Folder"),1),e("p",ol,M(C.value?.description),1)])]),e("div",sl,[L.value?(l(),i("button",{key:0,onClick:me,class:"glass-button px-4 py-2 rounded-lg text-sm font-medium flex items-center gap-2"},[...n[12]||(n[12]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})],-1),Z(" Open in New Tab ",-1)])])):$("",!0)])])]),L.value?c.value?(l(),i("div",{key:1,class:"flex-1 min-h-0 flex flex-col relative",onDragover:V(K,["prevent"]),onDragleave:oe,onDrop:V(w,["prevent"])},[R.value?(l(),i("div",rl,[...n[15]||(n[15]=[ne('<div class="cloud-drop-overlay-inner"><svg class="w-12 h-12 text-white/80 mb-3" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"></path></svg><p class="text-lg font-medium text-white/90">Drop files to upload</p><p class="text-sm text-white/50">Files will be added to the current folder</p></div>',1)])])):$("",!0),g.value?(l(),i("div",ul,[...n[16]||(n[16]=[e("div",{class:"w-5 h-5 border-2 border-white/20 border-t-white/80 rounded-full animate-spin"},null,-1),e("span",{class:"text-sm text-white/70"},"Uploading...",-1)])])):$("",!0),T.value?(l(),i("div",dl,[e("span",cl,M(T.value),1),e("button",{class:"text-xs text-white/50 hover:text-white ml-auto",onClick:n[0]||(n[0]=S=>T.value=null)},"Dismiss")])):$("",!0),_(Ve,{breadcrumbs:p(a).breadcrumbs,"view-mode":r.value,onNavigate:n[1]||(n[1]=S=>p(a).navigate(S)),onRefresh:n[2]||(n[2]=S=>p(a).refresh()),onUpload:F,"onUpdate:viewMode":n[3]||(n[3]=S=>r.value=S)},null,8,["breadcrumbs","view-mode"]),_(zt,{items:p(a).sortedItems,loading:p(a).loading,"view-mode":r.value,onNavigate:n[4]||(n[4]=S=>p(a).navigate(S)),onDelete:Q,onPlay:ve,onShare:U},null,8,["items","loading","view-mode"]),p(u).currentName.value?(l(),i("div",vl,[e("button",{class:"cloud-audio-player-btn",onClick:n[5]||(n[5]=S=>p(u).playing.value?p(u).pause():p(u).play(p(u).currentSrc.value,p(u).currentName.value))},[p(u).playing.value?(l(),i("svg",fl,[...n[18]||(n[18]=[e("path",{d:"M6 4h4v16H6V4zm8 0h4v16h-4V4z"},null,-1)])])):(l(),i("svg",ml,[...n[17]||(n[17]=[e("path",{d:"M8 5v14l11-7L8 5z"},null,-1)])]))]),e("div",pl,[p(u).error.value?(l(),i("p",hl,M(p(u).error.value),1)):(l(),i("p",gl,M(p(u).currentName.value),1)),e("div",wl,[e("div",{class:"cloud-audio-progress-bar",style:ye({width:p(u).progress.value+"%"})},null,4)])]),e("button",{class:"cloud-audio-player-btn",onClick:n[6]||(n[6]=S=>p(u).stop())},[...n[19]||(n[19]=[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])])):$("",!0)],32)):(l(),i("div",kl,[d.value?$("",!0):(l(),i("div",xl,[e("div",bl,[n[20]||(n[20]=e("div",{class:"w-8 h-8 border-2 border-white/20 border-t-white/80 rounded-full animate-spin"},null,-1)),e("p",yl,"Loading "+M(C.value?.appLabel)+"...",1)])])),L.value?(l(),i("iframe",{key:1,src:v.value,class:z(["w-full h-full border-0",{"opacity-0":!d.value}]),style:{"min-height":"500px"},onLoad:n[7]||(n[7]=S=>d.value=!0),sandbox:"allow-scripts allow-same-origin allow-forms allow-popups"},null,42,$l)):$("",!0)])):(l(),i("div",il,[n[14]||(n[14]=e("svg",{class:"w-20 h-20 text-white/15 mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),e("h3",nl,M(C.value?.appLabel)+" not running",1),e("p",al,"Install "+M(C.value?.appLabel)+" from the App Store to manage your "+M(C.value?.name?.toLowerCase())+".",1),_(p(be),{to:"/dashboard/marketplace",class:"glass-button inline-flex items-center gap-2 px-5 py-2.5 rounded-lg text-sm font-medium"},{default:xe(()=>[...n[13]||(n[13]=[Z(" Open App Store ",-1)])]),_:1})])),x.value?(l(),q(Kt,{key:3,filename:x.value.name,filepath:x.value.path,"is-dir":x.value.isDir,onClose:n[8]||(n[8]=S=>x.value=null),onSaved:n[9]||(n[9]=S=>x.value=null)},null,8,["filename","filepath","is-dir"])):$("",!0)]))}});export{Bl as default};