2 lines
35 KiB
JavaScript
2 lines
35 KiB
JavaScript
import{d as fe,z as we,y as ke,Q as ye,w as be,a0 as xe,o as _e,A as Ce,c as r,a as i,F as A,P as L,G as g,h as D,i as F,E as u,U as ee,g as te,H as oe,D as d,m as Ue,a1 as Me,T as Ie,r as m,j as _,B as V,f as y,n as ie,J as C,I as ze,b as $,x as Be,q as n,t as Ae}from"./index-DnbYEqLr.js";import{u as Le}from"./useMarketplaceApp-BxXpq2aX.js";const Se={class:"marketplace-container"},je={key:0,"aria-live":"polite",class:"mb-6 space-y-3"},Te={class:"flex items-center justify-between mb-3"},Ne={class:"flex items-center gap-3"},Pe={key:0,class:"animate-spin h-5 w-5 text-blue-400","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},De={key:1,class:"h-5 w-5 text-green-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},Fe={key:2,class:"h-5 w-5 text-red-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},Ve={class:"text-white font-medium"},$e={class:"text-white/70 text-sm"},He={class:"text-white/60 text-sm"},Re={class:"w-full bg-white/10 rounded-full h-2 overflow-hidden"},Oe={class:"hidden md:flex mb-4 items-center gap-4"},Ee={class:"mode-switcher flex-shrink-0"},Ke={class:"mode-switcher flex-shrink-0"},Ge=["onClick"],qe={key:0,class:"ml-1 text-xs px-1.5 py-0.5 rounded-full bg-white/10"},We=["placeholder","aria-label"],Je={class:"md:hidden mb-4"},Xe=["placeholder","aria-label"],Qe={class:"pb-8"},Ye={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6"},Ze=["data-controller-install","onClick","onKeydown"],et={class:"flex items-start gap-4 mb-4"},tt=["src","alt"],ot={key:1,class:"w-16 h-16 rounded-lg bg-white/10 flex items-center justify-center"},it={class:"flex-1"},st={class:"text-xl font-semibold text-white mb-1"},nt={class:"text-sm text-white/60"},rt={key:0,class:"text-xs text-white/50 mt-1"},at={key:0,class:"flex items-center gap-2 mb-3"},lt={class:"text-xs text-white/40"},ct={key:0,class:"text-xs text-white/40"},dt={class:"text-white/80 text-sm mb-4 line-clamp-3 flex-1"},ut={class:"flex gap-2 mt-auto"},mt={key:0,class:"flex-1 px-4 py-2 bg-white/20 rounded-lg text-white/60 text-sm font-medium text-center cursor-default"},ht=["onClick"],gt=["onClick","disabled"],pt={key:0,class:"flex items-center justify-center gap-2"},vt={key:1},ft={key:3,disabled:"",class:"flex-1 px-4 py-2 bg-white/10 rounded-lg text-white/40 text-sm font-medium cursor-not-allowed"},wt={key:0,class:"text-center py-12"},kt={key:0,class:"flex flex-col items-center gap-4"},yt={class:"text-white/70"},bt={key:1,class:"flex flex-col items-center gap-4"},xt={class:"text-white/70"},_t={class:"text-white/40 text-sm"},Ct={key:2,class:"text-white/70"},Ut={class:"flex items-center justify-between mb-6"},Mt={class:"text-2xl font-bold text-white"},It={class:"grid grid-cols-1 sm:grid-cols-2 gap-3"},zt=["onClick"],Bt={class:"flex items-center gap-3"},At={class:"flex-shrink-0 w-10 h-10 rounded-lg bg-white/10 flex items-center justify-center"},Lt={key:0,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},St={key:1,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},jt={key:2,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Tt={key:3,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Nt={key:4,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Pt={key:5,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Dt={key:6,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Ft={key:7,class:"w-6 h-6",viewBox:"0 0 122.88 122.88",fill:"currentColor"},Vt={key:8,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},$t={key:9,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Ht={class:"flex-1"},Rt={class:"font-semibold"},Ot={key:0,class:"text-xs text-white/60 mt-1"},Et={key:0,class:"w-5 h-5 text-white flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20"},Kt=fe({__name:"Marketplace",setup(Gt){const H=Be(),R=we(),{t:c}=ke(),{setCurrentApp:se}=Le(),ne=ye(),h=m("all"),S=_(()=>[{id:"all",name:c("marketplace.all")},{id:"community",name:c("marketplace.community")},{id:"nostr",name:"Nostr"},{id:"commerce",name:c("marketplace.commerce")},{id:"money",name:c("marketplace.money")},{id:"data",name:c("marketplace.data")},{id:"home",name:c("marketplace.homeCategory")},{id:"car",name:c("marketplace.auto")},{id:"networking",name:c("marketplace.networking")},{id:"l484",name:"L484"},{id:"other",name:c("marketplace.other")}]),a=m(new Map),re=m(60);be(()=>R.packages,o=>{if(o)for(const[e,t]of Object.entries(o)){const s=t["install-progress"];if(s&&t.state==="installing"&&a.value.has(e)){const l=a.value.get(e),v=s.size>0?Math.round(s.downloaded/s.size*100):0,P=(s.downloaded/(1024*1024)).toFixed(1),ve=(s.size/(1024*1024)).toFixed(1);a.value.set(e,{...l,status:"downloading",progress:Math.min(v,95),message:s.size>0?`Downloading: ${P} / ${ve} MB (${v}%)`:c("marketplace.downloading")})}}},{deep:!0});const U=m(!1),O=m(null),E=m(null);function M(){E.value?.focus?.(),U.value=!1}xe(O,U,M,{restoreFocusRef:E});function K(o){h.value=o,o==="nostr"&&f.value.length===0&&!k.value&&G()}const I=m(!1),ae=m(""),j=m([]),p=m(""),f=m([]),k=m(!1),z=m("");async function G(){if(!(f.value.length>0||k.value)){k.value=!0,z.value="";try{const o=await V.marketplaceDiscover();f.value=o.apps.map(e=>({id:e.manifest.app_id,title:e.manifest.name,version:e.manifest.version,description:(typeof e.manifest.description=="string",e.manifest.description),icon:e.manifest.icon_url||"",author:e.manifest.author.name,dockerImage:e.manifest.container.image,repoUrl:e.manifest.repo_url,category:e.manifest.category,source:"nostr",trustScore:e.trust_score,trustTier:e.trust_tier,relayCount:e.relay_count}))}catch(o){z.value=o instanceof Error?o.message:"Discovery failed"}finally{k.value=!1}}}const q=_(()=>R.data?.["package-data"]||{});function W(o){if(o.category)return o.category;const e=o.id.toLowerCase(),t=o.title?.toLowerCase()||"",s=(typeof o.description=="string"?o.description:o.description?.short??"").toLowerCase(),l=`${e} ${t} ${s}`;return e.includes("bitcoin")||e.includes("btc")||e.includes("lightning")||e.includes("lnd")||e.includes("cln")||e.includes("electr")||e.includes("fedimint")||e.includes("cashu")||t.includes("lightning")||l.includes("wallet")||l.includes("satoshi")?"money":e.includes("btcpay")||e.includes("commerce")||e.includes("shop")||e.includes("store")||e.includes("pos")||e.includes("payment")||l.includes("merchant")||l.includes("invoice")?"commerce":e.includes("cloud")||e.includes("nextcloud")||e.includes("sync")||e.includes("storage")||e.includes("backup")||e.includes("file")||e.includes("photo")||e.includes("immich")||e.includes("jellyfin")||e.includes("plex")||e.includes("media")||e.includes("vault")||l.includes("password manager")||l.includes("file storage")?"data":e.includes("home-assistant")||e.includes("homeassistant")||e.includes("smart-home")||e.includes("automation")||e.includes("iot")||l.includes("home automation")||l.includes("smart home")?"home":e.includes("nostr")||e.includes("relay")&&l.includes("nostr")||l.includes("nostr relay")||l.includes("nostr client")?"nostr":e.includes("vpn")||e.includes("wireguard")||e.includes("tailscale")||e.includes("proxy")||e.includes("dns")||e.includes("pihole")||e.includes("adguard")||e.includes("nginx")||e.includes("tor")||l.includes("network")||l.includes("firewall")?"networking":e.includes("matrix")||e.includes("synapse")||e.includes("element")||e.includes("mastodon")||e.includes("lemmy")||e.includes("messenger")||e.includes("chat")||e.includes("social")||e.includes("cups")||l.includes("communication")||l.includes("messaging")?"community":"other"}const J=_(()=>{const o=[],e=j.value.map(s=>{const l=W(s);return{...s,category:l,source:"community"}}),t=[...o,...e];if(f.value.length>0){const s=new Set(t.map(v=>v.id)),l=f.value.filter(v=>!s.has(v.id)).map(v=>{const P=v.category||W(v);return{...v,category:P,source:"nostr"}});return[...t,...l]}return t}),X=_(()=>{const o=J.value;return S.value.filter(e=>e.id==="all"?o.length>0:o.some(t=>t.category===e.id))}),Q=_(()=>{let o=J.value;if(h.value&&h.value!=="all"&&(o=o.filter(e=>e.category===h.value)),p.value){const e=p.value.toLowerCase();o=o.filter(t=>t.title?.toLowerCase().includes(e)||typeof t.description=="string"&&t.description.toLowerCase().includes(e)||typeof t.description=="object"&&t.description?.short?.toLowerCase().includes(e)||t.id?.toLowerCase().includes(e)||t.author?.toLowerCase().includes(e))}return o}),le={mempool:["mempool-web"],bitcoin:["bitcoin-knots"],btcpay:["btcpay-server"],immich:["immich-server","immich-app","immich_server"],nextcloud:["nextcloud-aio","nextcloud-server"]};function w(o){if(o in q.value)return!0;const e=le[o];return e?e.some(t=>t in q.value):!1}function ce(o){ne.openSession(o.id)}_e(()=>{j.value.length===0&&!I.value&&de()});async function de(){I.value=!0,ae.value="",j.value=ue(),I.value=!1}function T(o){const e=["bitcoin-knots","bitcoin","lnd","mempool","btcpay-server","dwn","filebrowser"],t=["fedimint","vaultwarden","uptime-kuma","grafana","searxng","tailscale","portainer"];return e.includes(o)?"core":t.includes(o)?"recommended":"optional"}function ue(){return[{id:"bitcoin-knots",title:"Bitcoin Knots",version:"28.1.0",description:"Run a full Bitcoin node. Validate and relay blocks and transactions on the Bitcoin network.",icon:"/assets/img/app-icons/bitcoin-knots.webp",author:"Bitcoin Knots",dockerImage:"docker.io/bitcoinknots/bitcoin:v28.1",manifestUrl:void 0,repoUrl:"https://github.com/bitcoinknots/bitcoin"},{id:"btcpay-server",title:"BTCPay Server",version:"1.13.5",description:"Self-hosted Bitcoin payment processor. Accept Bitcoin payments without intermediaries or fees.",icon:"/assets/img/app-icons/btcpay-server.png",author:"BTCPay Server Foundation",dockerImage:"docker.io/btcpayserver/btcpayserver:1.13.5",manifestUrl:void 0,repoUrl:"https://github.com/btcpayserver/btcpayserver"},{id:"lnd",title:"LND",version:"0.17.4",description:"Lightning Network Daemon. Fast and cheap Bitcoin payments through the Lightning Network.",icon:"/assets/img/app-icons/lnd.svg",author:"Lightning Labs",dockerImage:"docker.io/lightninglabs/lnd:v0.17.4-beta",manifestUrl:void 0,repoUrl:"https://github.com/lightningnetwork/lnd"},{id:"mempool",title:"Mempool Explorer",version:"2.5.0",description:"Self-hosted Bitcoin blockchain and mempool visualizer with beautiful explorer interface.",icon:"/assets/img/app-icons/mempool.webp",author:"Mempool",dockerImage:"docker.io/mempool/frontend:v2.5.0",manifestUrl:void 0,repoUrl:"https://github.com/mempool/mempool"},{id:"homeassistant",title:"Home Assistant",version:"2024.1",description:"Open-source home automation platform. Control and automate your smart home devices privately.",icon:"/assets/img/app-icons/homeassistant.png",author:"Home Assistant",dockerImage:"docker.io/homeassistant/home-assistant:2024.1",manifestUrl:void 0,repoUrl:"https://github.com/home-assistant/core"},{id:"grafana",title:"Grafana",version:"10.2.0",description:"Analytics and monitoring platform. Create dashboards and visualize data from multiple sources.",icon:"/assets/img/app-icons/grafana.png",author:"Grafana Labs",dockerImage:"docker.io/grafana/grafana:10.2.0",manifestUrl:void 0,repoUrl:"https://github.com/grafana/grafana"},{id:"searxng",title:"SearXNG",version:"2024.1.0",description:"Privacy-respecting metasearch engine. Search without tracking or ads.",icon:"/assets/img/app-icons/searxng.png",author:"SearXNG",dockerImage:"docker.io/searxng/searxng:2024.11.17-e2554de75",manifestUrl:void 0,repoUrl:"https://github.com/searxng/searxng"},{id:"ollama",title:"Ollama",version:"0.1.0",description:"Run large language models locally. Download and run AI models like Llama, Mistral on your own hardware.",icon:"/assets/img/app-icons/ollama.png",author:"Ollama",dockerImage:"docker.io/ollama/ollama:0.5.4",manifestUrl:void 0,repoUrl:"https://github.com/ollama/ollama"},{id:"onlyoffice",title:"OnlyOffice",version:"7.5.1",description:"Office suite for document collaboration. Edit docs, spreadsheets, and presentations.",icon:"/assets/img/app-icons/onlyoffice.webp",author:"Ascensio System SIA",dockerImage:"docker.io/onlyoffice/documentserver:7.5.1",manifestUrl:void 0,repoUrl:"https://github.com/ONLYOFFICE/DocumentServer"},{id:"penpot",title:"Penpot",version:"2.4",description:"Open-source design and prototyping platform. Self-hosted alternative to Figma.",icon:"/assets/img/app-icons/penpot.webp",author:"Penpot",dockerImage:"docker.io/penpotapp/frontend:2.4",manifestUrl:void 0,repoUrl:"https://github.com/penpot/penpot"},{id:"nextcloud",title:"Nextcloud",version:"28.0",description:"Self-hosted cloud storage and collaboration platform. Your own private cloud.",icon:"/assets/img/app-icons/nextcloud.webp",author:"Nextcloud",dockerImage:"docker.io/library/nextcloud:28",manifestUrl:void 0,repoUrl:"https://github.com/nextcloud/server"},{id:"vaultwarden",title:"Vaultwarden",version:"1.30.0",description:"Self-hosted password manager (Bitwarden-compatible). Secure vault for passwords and secrets.",icon:"/assets/img/app-icons/vaultwarden.webp",author:"Vaultwarden",dockerImage:"docker.io/vaultwarden/server:1.30.0-alpine",manifestUrl:void 0,repoUrl:"https://github.com/dani-garcia/vaultwarden"},{id:"jellyfin",title:"Jellyfin",version:"10.8.0",description:"Free media server system. Stream your movies, music, and photos to any device.",icon:"/assets/img/app-icons/jellyfin.webp",author:"Jellyfin",dockerImage:"docker.io/jellyfin/jellyfin:10.8.13",manifestUrl:void 0,repoUrl:"https://github.com/jellyfin/jellyfin"},{id:"photoprism",title:"PhotoPrism",version:"240915",description:"AI-powered photo management. Organize and browse photos with facial recognition.",icon:"/assets/img/app-icons/photoprism.svg",author:"PhotoPrism",dockerImage:"docker.io/photoprism/photoprism:240915",manifestUrl:void 0,repoUrl:"https://github.com/photoprism/photoprism"},{id:"immich",title:"Immich",version:"1.90.0",description:"High-performance self-hosted photo and video backup. Mobile-first with ML features.",icon:"/assets/img/app-icons/immich.png",author:"Immich",dockerImage:"ghcr.io/immich-app/immich-server:release",manifestUrl:void 0,repoUrl:"https://github.com/immich-app/immich"},{id:"filebrowser",title:"File Browser",version:"2.27.0",description:"Web-based file manager. Browse, upload, and manage files through a web interface.",icon:"/assets/img/app-icons/file-browser.webp",author:"File Browser",dockerImage:"docker.io/filebrowser/filebrowser:v2.27.0",manifestUrl:void 0,repoUrl:"https://github.com/filebrowser/filebrowser"},{id:"nginx-proxy-manager",title:"Nginx Proxy Manager",version:"2.11.0",description:"Easy proxy management with SSL. Beautiful web interface for managing reverse proxies.",icon:"/assets/img/app-icons/nginx.svg",author:"Nginx Proxy Manager",dockerImage:"docker.io/jc21/nginx-proxy-manager:2.12.1",manifestUrl:void 0,repoUrl:"https://github.com/NginxProxyManager/nginx-proxy-manager"},{id:"portainer",title:"Portainer",version:"2.19.0",description:"Container management UI. Manage Docker containers through a beautiful web interface.",icon:"/assets/img/app-icons/portainer.webp",author:"Portainer",dockerImage:"docker.io/portainer/portainer-ce:2.19.4",manifestUrl:void 0,repoUrl:"https://github.com/portainer/portainer"},{id:"uptime-kuma",title:"Uptime Kuma",version:"1.23.0",description:"Self-hosted monitoring tool. Monitor uptime for HTTP(s), TCP, DNS, and more.",icon:"/assets/img/app-icons/uptime-kuma.webp",author:"Uptime Kuma",dockerImage:"docker.io/louislam/uptime-kuma:1",manifestUrl:void 0,repoUrl:"https://github.com/louislam/uptime-kuma"},{id:"tailscale",title:"Tailscale",version:"1.78.0",description:"Zero-config VPN for secure remote access. Connect all your devices with WireGuard mesh network.",icon:"/assets/img/app-icons/tailscale.webp",author:"Tailscale",dockerImage:"docker.io/tailscale/tailscale:stable",manifestUrl:void 0,repoUrl:"https://github.com/tailscale/tailscale"},{id:"fedimint",title:"Fedimint",version:"0.10.0",description:"Federated Bitcoin mint with built-in Guardian UI. Private, scalable Bitcoin through federated guardians.",icon:"/assets/img/app-icons/fedimint.png",author:"Fedimint",dockerImage:"docker.io/fedimint/fedimintd:v0.10.0",manifestUrl:void 0,repoUrl:"https://github.com/fedimint/fedimint"},{id:"indeedhub",title:"Indeehub",version:"0.1.0",description:"Bitcoin documentary streaming platform with Nostr identity sign-in. Stream God Bless Bitcoin and other educational content about sovereignty and decentralized technology.",icon:"/assets/img/app-icons/indeedhub.png",author:"Indeehub Team",dockerImage:"localhost/indeedhub:latest",manifestUrl:void 0,repoUrl:"https://github.com/indeedhub/indeedhub"},{id:"dwn",title:"Decentralized Web Node",version:"0.4.0",description:"Store and sync your personal data across devices using decentralized web node protocols. Own your data with DID-based access control.",icon:"/assets/img/app-icons/dwn.svg",author:"TBD",dockerImage:"ghcr.io/tbd54566975/dwn-server:main",manifestUrl:void 0,repoUrl:"https://github.com/TBD54566975/dwn-server"},{id:"nostrudel",title:"noStrudel",version:"0.40.0",category:"nostr",description:"A feature-rich Nostr web client with NIP-07 signer support. Browse your feed, post notes, manage relays, and interact with the Nostr network — all signed with your node's Nostr identity.",icon:"/assets/img/app-icons/nostrudel.svg",author:"hzrd149",dockerImage:"",manifestUrl:void 0,repoUrl:"https://github.com/hzrd149/nostrudel",webUrl:"https://nostrudel.ninja"},{id:"nostr-rs-relay",title:"Nostr Relay",version:"0.9.0",category:"nostr",description:"Run your own Nostr relay. Store your events locally, relay for friends, and publish over Tor. A sovereign relay for your sovereign node.",icon:"/assets/img/app-icons/nostr-rs-relay.svg",author:"scsiblade",dockerImage:"docker.io/scsiblade/nostr-rs-relay:0.9.0",manifestUrl:void 0,repoUrl:"https://sr.ht/~gheartsfield/nostr-rs-relay/"},{id:"botfights",title:"BotFights",version:"1.0.0",description:"AI bot arena — build, train, and battle autonomous agents. Compete in strategy tournaments with your own coded bots.",icon:"/assets/img/app-icons/botfights.svg",author:"BotFights",dockerImage:"",manifestUrl:void 0,repoUrl:"https://botfights.net",webUrl:"https://botfights.net"},{id:"nwnn",title:"Next Web News Network",version:"1.0.0",category:"l484",description:"Decentralized news and link aggregator, synchronized from Telegram. Community-curated content on Bitcoin, sovereignty, and decentralized tech.",icon:"/assets/img/app-icons/nwnn.png",author:"L484",dockerImage:"",manifestUrl:void 0,repoUrl:"https://nwnn.l484.com",webUrl:"https://nwnn.l484.com"},{id:"484-kitchen",title:"484 Kitchen",version:"1.0.0",category:"l484",description:"K484 application platform — an internal tool for the L484 network.",icon:"/assets/img/app-icons/484-kitchen.png",author:"L484",dockerImage:"",manifestUrl:void 0,repoUrl:"https://484.kitchen",webUrl:"https://484.kitchen"},{id:"call-the-operator",title:"Call the Operator",version:"1.0.0",category:"l484",description:"Escape the Matrix — a portal for exploring decentralized alternatives and reclaiming digital sovereignty.",icon:"/assets/img/app-icons/call-the-operator.png",author:"TX1138",dockerImage:"",manifestUrl:void 0,repoUrl:"https://cta.tx1138.com",webUrl:"https://cta.tx1138.com"},{id:"arch-presentation",title:"Arch Presentation",version:"1.0.0",category:"l484",description:"Archipelago: The Future of Decentralized Infrastructure — an interactive presentation about the Archipelago project vision.",icon:"/assets/img/app-icons/arch-presentation.png",author:"L484",dockerImage:"",manifestUrl:void 0,repoUrl:"https://present.l484.com",webUrl:"https://present.l484.com"},{id:"syntropy-institute",title:"Syntropy Institute",version:"1.0.0",category:"l484",description:"Medicine Reimagined — Manual Kinetics, Syntropy Frequency analysis-therapy, digital homeopathy, and concierge protocols.",icon:"/assets/img/app-icons/syntropy-institute.png",author:"Syntropy Institute",dockerImage:"",manifestUrl:void 0,repoUrl:"https://syntropy.institute",webUrl:"https://syntropy.institute"},{id:"t-zero",title:"T-0",version:"1.0.0",category:"l484",description:"Documentary series exploring decentralization, Bitcoin, and the mavericks building the ungovernable future. Conversations with the builders, powered by Nostr.",icon:"/assets/img/app-icons/t-zero.png",author:"T-0",dockerImage:"",manifestUrl:void 0,repoUrl:"https://teeminuszero.net",webUrl:"https://teeminuszero.net"}]}function Y(o){try{w(o.id)?H.push({name:"app-details",params:{id:o.id}}):(se(o),H.push({name:"marketplace-app-detail",params:{id:o.id}}))}catch{}}const b=[],x=[];function B(o,e){const t=setTimeout(()=>{const s=b.indexOf(t);s!==-1&&b.splice(s,1),o()},e);return b.push(t),t}function me(o,e){const t=setInterval(o,e);return x.push(t),t}function N(o){clearInterval(o);const e=x.indexOf(o);e!==-1&&x.splice(e,1)}Ce(()=>{for(const o of b)clearTimeout(o);b.length=0;for(const o of x)clearInterval(o);x.length=0});function Z(o,e){const t=me(()=>{const s=a.value.get(o);if(!s){N(t);return}const l=s.attempt+1;a.value.set(o,{...s,attempt:l,progress:Math.min(60+l*.5,95),message:e}),w(o)?(N(t),a.value.set(o,{...s,status:"complete",progress:100,message:"Installation complete!"}),B(()=>{a.value.delete(o)},2e3)):l>=re.value&&(N(t),a.value.set(o,{...s,status:"error",progress:0,message:"Installation timeout"}),B(()=>{a.value.delete(o)},5e3))},1e3)}async function he(o){if(!(a.value.has(o.id)||w(o.id))){a.value.set(o.id,{id:o.id,title:o.title??o.id,status:"downloading",progress:10,message:"Preparing installation...",attempt:0});try{const e=o.url||o.manifestUrl||o.s9pkUrl;a.value.set(o.id,{...a.value.get(o.id),status:"downloading",progress:30,message:"Downloading package..."}),await V.call({method:"package.install",params:{id:o.id,url:e,version:o.version}}),a.value.set(o.id,{...a.value.get(o.id),status:"installing",progress:60,message:"Installing package..."}),Z(o.id,"Starting application...")}catch(e){a.value.set(o.id,{...a.value.get(o.id),status:"error",progress:0,message:`Failed: ${e}`}),B(()=>{a.value.delete(o.id)},5e3)}}}async function ge(o){if(!(a.value.has(o.id)||w(o.id)||!o.dockerImage)){a.value.set(o.id,{id:o.id,title:o.title??o.id,status:"downloading",progress:10,message:"Pulling Docker image...",attempt:0});try{a.value.set(o.id,{...a.value.get(o.id),status:"downloading",progress:20,message:"Downloading container image..."}),await V.call({method:"package.install",params:{id:o.id,dockerImage:o.dockerImage,version:o.version},timeout:18e4}),a.value.set(o.id,{...a.value.get(o.id),status:"installing",progress:60,message:"Starting container..."}),Z(o.id,"Initializing application...")}catch(e){a.value.set(o.id,{...a.value.get(o.id),status:"error",progress:0,message:`Failed: ${e}`}),B(()=>{a.value.delete(o.id)},5e3)}}}function pe(o){const e=o.target;e.src="/assets/img/logo-archipelago.svg"}return(o,e)=>(n(),r("div",Se,[i("div",null,[a.value.size>0?(n(),r("div",je,[(n(!0),r(A,null,L(a.value,([t,s])=>(n(),r("div",{key:t,class:y(["glass-card p-4 border-l-4",{"border-blue-500":s.status==="downloading"||s.status==="installing","border-orange-500":s.status==="starting","border-green-500":s.status==="complete","border-red-500":s.status==="error"}])},[i("div",Te,[i("div",Ne,[s.status!=="complete"&&s.status!=="error"?(n(),r("svg",Pe,[...e[6]||(e[6]=[i("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),i("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)])])):s.status==="complete"?(n(),r("svg",De,[...e[7]||(e[7]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])])):(n(),r("svg",Fe,[...e[8]||(e[8]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])])),i("div",null,[i("p",Ve,d(s.title),1),i("p",$e,d(s.message),1)])]),i("div",He,d(s.progress)+"% ",1)]),i("div",Re,[i("div",{class:y(["h-full rounded-full transition-all duration-500",{"bg-gradient-to-r from-blue-500 to-blue-400":s.status==="downloading"||s.status==="installing","bg-gradient-to-r from-orange-500 to-orange-400":s.status==="starting","bg-gradient-to-r from-green-500 to-green-400":s.status==="complete","bg-gradient-to-r from-red-500 to-red-400":s.status==="error"}]),style:ie({width:`${s.progress}%`})},null,6)])],2))),128))])):g("",!0),i("div",Oe,[i("div",Ee,[D(u(ee),{to:"/dashboard/apps",class:"mode-switcher-btn"},{default:F(()=>[...e[9]||(e[9]=[C("My Apps",-1)])]),_:1}),D(u(ee),{to:"/dashboard/marketplace",class:"mode-switcher-btn mode-switcher-btn-active"},{default:F(()=>[...e[10]||(e[10]=[C("App Store",-1)])]),_:1})]),i("div",Ke,[(n(!0),r(A,null,L(X.value,t=>(n(),r("button",{key:t.id,onClick:s=>K(t.id),class:y(["mode-switcher-btn",{"mode-switcher-btn-active":h.value===t.id}])},[C(d(t.name)+" ",1),t.id==="nostr"&&f.value.length>0?(n(),r("span",qe,"+"+d(f.value.length),1)):g("",!0)],10,Ge))),128))]),te(i("input",{"onUpdate:modelValue":e[0]||(e[0]=t=>p.value=t),type:"text",placeholder:u(c)("marketplace.searchPlaceholder"),"aria-label":u(c)("marketplace.searchApps"),class:"flex-1 px-4 py-2 bg-white/10 border border-white/20 rounded-lg text-white placeholder-white/50 focus:outline-none focus:border-white/40 transition-colors"},null,8,We),[[oe,p.value]])]),i("div",Je,[te(i("input",{"onUpdate:modelValue":e[1]||(e[1]=t=>p.value=t),type:"text",placeholder:u(c)("marketplace.searchPlaceholder"),"aria-label":u(c)("marketplace.searchApps"),class:"w-full px-4 py-3 md:py-2 bg-white/10 border border-white/20 rounded-lg text-white placeholder-white/50 focus:outline-none focus:border-white/40 transition-colors"},null,8,Xe),[[oe,p.value]])])]),i("div",Qe,[i("div",Ye,[(n(!0),r(A,null,L(Q.value,(t,s)=>(n(),r("div",{key:t.id,"data-controller-container":"","data-controller-install":!(w(t.id)||a.value.has(t.id))&&(t.source==="local"||t.dockerImage)?"1":void 0,tabindex:"0",role:"link",class:"glass-card card-stagger p-6 hover:bg-white/10 transition-all cursor-pointer flex flex-col",style:ie({"--stagger-index":s}),onClick:l=>Y(t),onKeydown:ze(l=>Y(t),["enter"])},[i("div",et,[t.icon?(n(),r("img",{key:0,src:t.icon,alt:t.title,class:"w-16 h-16 rounded-lg object-cover",onError:pe},null,40,tt)):(n(),r("div",ot,[...e[11]||(e[11]=[i("svg",{class:"w-8 h-8 text-white/40",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"})],-1)])])),i("div",it,[i("h3",st,[C(d(t.title)+" ",1),T(t.id)!=="optional"?(n(),r("span",{key:0,class:y(["tier-badge",T(t.id)==="core"?"tier-badge-core":"tier-badge-recommended"])},d(T(t.id)),3)):g("",!0)]),i("p",nt,d(t.version?`v${t.version}`:"latest"),1),t.author?(n(),r("p",rt,"by "+d(t.author),1)):g("",!0)])]),t.trustTier?(n(),r("div",at,[i("span",{class:y(["text-xs px-2 py-0.5 rounded-full font-medium",{"bg-green-400/20 text-green-400":t.trustTier==="verified","bg-yellow-400/20 text-yellow-400":t.trustTier==="community","bg-orange-400/20 text-orange-400":t.trustTier==="unverified","bg-red-400/20 text-red-400":t.trustTier==="untrusted"}])},d(t.trustTier),3),i("span",lt,"Score: "+d(t.trustScore)+"/100",1),t.relayCount?(n(),r("span",ct,"· "+d(t.relayCount)+" relay"+d(t.relayCount!==1?"s":""),1)):g("",!0)])):g("",!0),i("p",dt,d(typeof t.description=="object"?t.description.short:t.description||"No description available"),1),i("div",ut,[w(t.id)?(n(),r("span",mt,d(u(c)("marketplace.alreadyInstalled")),1)):g("",!0),w(t.id)?(n(),r("button",{key:1,onClick:$(l=>ce(t),["stop"]),class:"px-4 py-2 glass-button glass-button-sm rounded-lg text-sm font-medium"},d(u(c)("common.launch")),9,ht)):t.source==="local"||t.dockerImage?(n(),r("button",{key:2,"data-controller-install-btn":"",onClick:$(l=>t.source==="local"?he(t):ge(t),["stop"]),disabled:a.value.has(t.id),class:"flex-1 px-4 py-2 glass-button glass-button-sm rounded-lg text-sm font-medium disabled:opacity-50 disabled:cursor-not-allowed"},[a.value.has(t.id)?(n(),r("span",pt,[e[12]||(e[12]=i("svg",{class:"animate-spin h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[i("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),i("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)),C(" "+d(a.value.get(t.id)?.message||u(c)("common.installing")),1)])):(n(),r("span",vt,d(u(c)("common.install")),1))],8,gt)):(n(),r("button",ft,d(u(c)("common.notAvailable")),1))])],44,Ze))),128))]),Q.value.length===0?(n(),r("div",wt,[I.value||k.value?(n(),r("div",kt,[e[13]||(e[13]=i("svg",{class:"animate-spin h-12 w-12 text-blue-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[i("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),i("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)),i("p",yt,d(k.value?u(c)("marketplace.queryingRelays"):u(c)("common.loading")),1)])):z.value&&h.value==="nostr"?(n(),r("div",bt,[i("p",xt,d(u(c)("marketplace.noCommunityApps")),1),i("p",_t,d(z.value),1),i("button",{onClick:e[2]||(e[2]=t=>{f.value=[],G()}),class:"px-4 py-2 glass-button rounded-lg text-sm"},d(u(c)("common.retry")),1)])):(n(),r("p",Ct,d(p.value&&h.value!=="all"?u(c)("marketplace.noResults",{category:S.value.find(t=>t.id===h.value)?.name,query:p.value}):p.value?u(c)("marketplace.noResultsSearch",{query:p.value}):u(c)("marketplace.noResultsCategory",{category:S.value.find(t=>t.id===h.value)?.name})),1))])):g("",!0)]),(n(),Ue(Me,{to:"body"},[i("button",{onClick:e[3]||(e[3]=t=>U.value=!0),class:"md:hidden fixed right-4 z-40 w-14 h-14 rounded-full glass-button flex items-center justify-center shadow-2xl mobile-back-btn",style:{left:"auto"}},[...e[14]||(e[14]=[i("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})],-1)])])])),D(Ie,{name:"modal"},{default:F(()=>[U.value?(n(),r("div",{key:0,class:"fixed inset-0 z-50 flex items-end justify-center md:hidden bg-black/10 backdrop-blur-md",onClick:e[5]||(e[5]=$(t=>M(),["self"]))},[i("div",{ref_key:"filterModalRef",ref:O,class:"glass-card p-6 w-full rounded-t-3xl max-h-[80vh] overflow-y-auto"},[i("div",Ut,[i("h2",Mt,d(u(c)("marketplace.filterByCategory")),1),i("button",{onClick:e[4]||(e[4]=t=>M()),class:"text-white/60 hover:text-white transition-colors"},[...e[15]||(e[15]=[i("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])]),i("div",It,[(n(!0),r(A,null,L(X.value,t=>(n(),r("button",{key:t.id,onClick:s=>{K(t.id),M()},class:y(["p-4 rounded-xl font-medium transition-all text-left",h.value===t.id?"bg-white/20 text-white border-2 border-white/40":"glass-card text-white/80 hover:bg-white/10"])},[i("div",Bt,[i("div",At,[t.id==="all"?(n(),r("svg",Lt,[...e[16]||(e[16]=[i("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-2V6zM14 6a2 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-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"},null,-1)])])):t.id==="community"?(n(),r("svg",St,[...e[17]||(e[17]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"},null,-1)])])):t.id==="nostr"?(n(),r("svg",jt,[...e[18]||(e[18]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 10V3L4 14h7v7l9-11h-7z"},null,-1)])])):t.id==="commerce"?(n(),r("svg",Tt,[...e[19]||(e[19]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0z"},null,-1)])])):t.id==="money"?(n(),r("svg",Nt,[...e[20]||(e[20]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])])):t.id==="data"?(n(),r("svg",Pt,[...e[21]||(e[21]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"},null,-1)])])):t.id==="home"?(n(),r("svg",Dt,[...e[22]||(e[22]=[i("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)])])):t.id==="car"?(n(),r("svg",Ft,[...e[23]||(e[23]=[i("path",{d:"M61.44,0c33.93,0,61.44,27.51,61.44,61.44c0,33.93-27.51,61.44-61.44,61.44S0,95.37,0,61.44 C0,27.51,27.51,0,61.44,0L61.44,0z M61.17,61.6c1.76,0,3.18,1.42,3.18,3.18c0,1.76-1.42,3.18-3.18,3.18 c-1.76,0-3.18-1.42-3.18-3.18C57.99,63.03,59.42,61.6,61.17,61.6L61.17,61.6z M61.2,53.28c6.34,0,11.47,5.14,11.47,11.47 c0,6.34-5.14,11.47-11.47,11.47c-6.33,0-11.47-5.14-11.47-11.47C49.73,58.41,54.87,53.28,61.2,53.28L61.2,53.28z M14.78,44.57 c4.45-12.31,13.52-22.7,24.9-28.01c15.63-7.29,34.61-7.75,50.69,4.15c9.48,7.01,12.94,12.76,17.67,22.95 c3.58,9.03,0.64,11.97-10.87,6.9c-23.79-11.77-47.84-11.24-72.12,0C16.09,56.41,11.06,51.53,14.78,44.57L14.78,44.57z M75.9,109.05 c16.62-5.23,26.32-15.81,32.27-29.3c3.87-10.43-8.26-13.97-12.52-7.1c-2.55,5.06-5.59,9.4-9.55,12.77 c-6.2,5.27-15.18,6.23-16.58,16.16C68.79,106.74,69.97,111.38,75.9,109.05L75.9,109.05z M47.26,109.05 c-16.62-5.23-26.32-15.81-32.27-29.3c-3.87-10.43,8.26-13.97,12.52-7.1c2.55,5.06,5.59,9.4,9.55,12.77 c6.2,5.27,15.18,6.23,16.58,16.16C54.37,106.74,53.19,111.38,47.26,109.05L47.26,109.05z"},null,-1)])])):t.id==="networking"?(n(),r("svg",Vt,[...e[24]||(e[24]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"},null,-1)])])):(n(),r("svg",$t,[...e[25]||(e[25]=[i("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-2V6zM14 6a2 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-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"},null,-1)])]))]),i("div",Ht,[i("p",Rt,d(t.name),1),h.value===t.id?(n(),r("p",Ot,"Currently viewing")):g("",!0)]),h.value===t.id?(n(),r("svg",Et,[...e[26]||(e[26]=[i("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"},null,-1)])])):g("",!0)])],10,zt))),128))])],512)])):g("",!0)]),_:1})]))}}),Jt=Ae(Kt,[["__scopeId","data-v-f5eafd6d"]]);export{Jt as default};
|