docker-client-mx 1.40.0 → 1.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/docker-desktop-mx/browser/{chunk-CpVmilfG.js → chunk-3VyqMz_T.js} +2 -2
- package/dist/docker-desktop-mx/browser/{chunk-Doow6WqE.js → chunk-BW20bBdg.js} +1 -1
- package/dist/docker-desktop-mx/browser/chunk-Ba_z6LGV.js +1 -0
- package/dist/docker-desktop-mx/browser/chunk-BdOOWVGY.js +4 -0
- package/dist/docker-desktop-mx/browser/chunk-BgNCBUvw2.js +1 -0
- package/dist/docker-desktop-mx/browser/{chunk-D4dQfTTc.js → chunk-BoN9ZlqT.js} +1 -1
- package/dist/docker-desktop-mx/browser/chunk-BsAqguck2.js +3 -0
- package/dist/docker-desktop-mx/browser/{chunk-Bw7Mtap6.js → chunk-Bx2_SrZM.js} +1 -1
- package/dist/docker-desktop-mx/browser/{chunk-CZNcOfBu2.js → chunk-C-yEXU2P.js} +2 -2
- package/dist/docker-desktop-mx/browser/chunk-C1Wg9uje.js +1 -0
- package/dist/docker-desktop-mx/browser/{chunk-CC_wIdx2.js → chunk-C22Z7vgK.js} +1 -1
- package/dist/docker-desktop-mx/browser/chunk-C6u6rXYb2.js +1 -0
- package/dist/docker-desktop-mx/browser/{chunk-Ch8nHKqR.js → chunk-CC84vXik.js} +1 -1
- package/dist/docker-desktop-mx/browser/{chunk-DdFeg3-c.js → chunk-CI9I9Npi.js} +1 -1
- package/dist/docker-desktop-mx/browser/{chunk-DBPVGjlB.js → chunk-CMrtklQ1.js} +2 -2
- package/dist/docker-desktop-mx/browser/{chunk-wVwXBw1N.js → chunk-CRNeTD5E.js} +1 -1
- package/dist/docker-desktop-mx/browser/{chunk-5jLUVNg7.js → chunk-CSrKHPxR.js} +1 -1
- package/dist/docker-desktop-mx/browser/{chunk-Dz9ZDzia.js → chunk-CT1ZUgmS.js} +1 -1
- package/dist/docker-desktop-mx/browser/chunk-CWusqRG0.js +1 -0
- package/dist/docker-desktop-mx/browser/{chunk-8P32TlCt.js → chunk-Cbit44lz.js} +1 -1
- package/dist/docker-desktop-mx/browser/chunk-Cc4_zCxe2.js +1 -0
- package/dist/docker-desktop-mx/browser/{chunk-BH9xkVLp.js → chunk-Ckq_aT3A.js} +1 -1
- package/dist/docker-desktop-mx/browser/{chunk-BEAPEQBM.js → chunk-CrBxmi_g.js} +1 -1
- package/dist/docker-desktop-mx/browser/chunk-D-7d5O7f.js +1 -0
- package/dist/docker-desktop-mx/browser/{chunk-CP90rR4k.js → chunk-D0xC_xVf.js} +1 -1
- package/dist/docker-desktop-mx/browser/chunk-D29s9m84.js +1 -0
- package/dist/docker-desktop-mx/browser/chunk-DKpHNjiv.js +1 -0
- package/dist/docker-desktop-mx/browser/chunk-DLeqF0uQ.js +1 -0
- package/dist/docker-desktop-mx/browser/chunk-DZjRtM2K.js +1 -0
- package/dist/docker-desktop-mx/browser/chunk-DsuW5Ksa2.js +1 -0
- package/dist/docker-desktop-mx/browser/chunk-DvoPI4MU.js +1 -0
- package/dist/docker-desktop-mx/browser/chunk-DzG5R5Kk.js +1 -0
- package/dist/docker-desktop-mx/browser/{chunk-fqYbS3e-.js → chunk-KUYJNmP22.js} +1 -1
- package/dist/docker-desktop-mx/browser/chunk-QaMufr3I.js +1 -0
- package/dist/docker-desktop-mx/browser/{chunk-MpnWAfxv.js → chunk-V7ftX_10.js} +1 -1
- package/dist/docker-desktop-mx/browser/{chunk-Bn40KMmY.js → chunk-Zcfhi-RM.js} +1 -1
- package/dist/docker-desktop-mx/browser/{chunk-CiOk-qoT.js → chunk-Zom3ankA.js} +1 -1
- package/dist/docker-desktop-mx/browser/{chunk-DKNRYU3y.js → chunk-cYufOe8J.js} +1 -1
- package/dist/docker-desktop-mx/browser/chunk-eG8Su12W.js +1 -0
- package/dist/docker-desktop-mx/browser/chunk-ep62jwHG.js +1 -0
- package/dist/docker-desktop-mx/browser/{chunk-Di8ZOBwa.js → chunk-iwVkNYYA.js} +1 -1
- package/dist/docker-desktop-mx/browser/chunk-wa_VZZFY.js +1 -0
- package/dist/docker-desktop-mx/browser/index.html +2 -2
- package/dist/docker-desktop-mx/browser/main-DECBD64Q.js +1 -0
- package/dist/docker-desktop-mx/browser/styles-5TXFXUUF.css +1 -0
- package/dist-electron/auto-prune.js +76 -0
- package/dist-electron/auto-prune.js.map +1 -0
- package/dist-electron/channels.js +9 -0
- package/dist-electron/channels.js.map +1 -1
- package/dist-electron/container-commit.js +39 -0
- package/dist-electron/container-commit.js.map +1 -0
- package/dist-electron/container-rename.js +63 -0
- package/dist-electron/container-rename.js.map +1 -0
- package/dist-electron/environment.js +52 -0
- package/dist-electron/environment.js.map +1 -0
- package/dist-electron/image-reference.js +92 -0
- package/dist-electron/image-reference.js.map +1 -0
- package/dist-electron/image-tags.js +138 -0
- package/dist-electron/image-tags.js.map +1 -0
- package/dist-electron/images.js +2 -17
- package/dist-electron/images.js.map +1 -1
- package/dist-electron/ipc.js +26 -0
- package/dist-electron/ipc.js.map +1 -1
- package/dist-electron/main.js +34 -0
- package/dist-electron/main.js.map +1 -1
- package/dist-electron/preload.js +18 -1
- package/dist-electron/preload.js.map +1 -1
- package/dist-electron/pull.js +20 -12
- package/dist-electron/pull.js.map +1 -1
- package/dist-electron/redact.js +9 -0
- package/dist-electron/redact.js.map +1 -1
- package/dist-electron/renew.js +2 -2
- package/dist-electron/renew.js.map +1 -1
- package/dist-electron/settings.js +22 -0
- package/dist-electron/settings.js.map +1 -1
- package/dist-electron/volume-backup.js +16 -3
- package/dist-electron/volume-backup.js.map +1 -1
- package/dist-electron/volume-copy.js +145 -0
- package/dist-electron/volume-copy.js.map +1 -0
- package/package.json +1 -1
- package/dist/docker-desktop-mx/browser/chunk-7fAa0H9l2.js +0 -1
- package/dist/docker-desktop-mx/browser/chunk-BMXieIjc.js +0 -1
- package/dist/docker-desktop-mx/browser/chunk-BfC3KqGQ.js +0 -1
- package/dist/docker-desktop-mx/browser/chunk-CC7DUrLR.js +0 -1
- package/dist/docker-desktop-mx/browser/chunk-CHFuuSv8.js +0 -1
- package/dist/docker-desktop-mx/browser/chunk-CaYY-6hH.js +0 -1
- package/dist/docker-desktop-mx/browser/chunk-CmtjDUsV.js +0 -1
- package/dist/docker-desktop-mx/browser/chunk-CzrtYwlw.js +0 -1
- package/dist/docker-desktop-mx/browser/chunk-D0pCyzqb.js +0 -1
- package/dist/docker-desktop-mx/browser/chunk-DAgdneMS.js +0 -1
- package/dist/docker-desktop-mx/browser/chunk-DEsPgcXV.js +0 -4
- package/dist/docker-desktop-mx/browser/chunk-DFhjd8-d2.js +0 -1
- package/dist/docker-desktop-mx/browser/chunk-DGtAiSbg.js +0 -1
- package/dist/docker-desktop-mx/browser/chunk-DLh60Eif.js +0 -1
- package/dist/docker-desktop-mx/browser/chunk-Dq9pgyA42.js +0 -2
- package/dist/docker-desktop-mx/browser/chunk-Ds9stAVj.js +0 -1
- package/dist/docker-desktop-mx/browser/chunk-lLCuDcp6.js +0 -1
- package/dist/docker-desktop-mx/browser/chunk-nped2UPz.js +0 -1
- package/dist/docker-desktop-mx/browser/main-HUWYR6IC.js +0 -1
- package/dist/docker-desktop-mx/browser/styles-D7Y5N7JX.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$n as sk,A as HE,B as Kr,Bn as ok,Ct as Tg,D as Gm,En as kE,Fn as nS,Gt as _m,H as Ld,J as Nc,K as My,Pn as mj,Pt as Wm,R as Jm,Rt as X$1,Tn as jc,Wn as pg,Xn as rf,cn as f,et as Od,f as C,gr as wt,ht as SE,jn as lk,ln as fS,lr as vg,mr as wc,o as Ac,on as eH,or as vS,rn as dk,rt as Ot,sn as ec,t as $E,tt as Oi,xn as hg}from"./chunk-BdOOWVGY.js";import{n as u,t as f$1}from"./chunk-V7ftX_10.js";import{n as p,t as M}from"./chunk-C22Z7vgK.js";import{_ as pn,d as dn,f as fn,g as ln,l as an,m as ie,r as Je,u as cn,v as un}from"./chunk-QaMufr3I.js";import{n as v,t as u$1}from"./chunk-BoN9ZlqT.js";var me;var D;var X=f(()=>{Kr();M();Kr();me=`containers.groups`,D=class i{assignments=C(p).entries(me);names=Ot(()=>[...new Set(this.assignments().values())].sort((t,e)=>t.localeCompare(e)));groupOf(n){return this.assignments().get(n)??null}assign(n,t){let e=t.trim();if(e===``)return;let a=new Map(this.assignments());for(let d of n)a.set(d,e);this.assignments.set(a)}release(n){let t=new Map(this.assignments());for(let e of n)t.delete(e);this.assignments.set(t)}rename(n,t){let e=t.trim();if(e===``||e===n)return;let a=new Map(this.assignments());for(let[d,te]of a)te===n&&a.set(d,e);this.assignments.set(a)}moveContainer(n,t){let e=this.assignments().get(n);if(e===void 0||n===t)return;let a=new Map(this.assignments());a.delete(n),a.set(t,e),this.assignments.set(a)}dissolve(n){let t=new Map([...this.assignments()].filter(([,e])=>e!==n));this.assignments.set(t)}static ɵfac=function(t){return new(t||i)};static ɵprov=X$1({token:i,factory:i.ɵfac,providedIn:`root`})}});function pe(i,n){if(i&1&&(Oi(0,`p`,11),fS(1),Nc()),i&2){let t=HE(2);ec(),pg(t.t().taken)}}function ce(i,n){if(i&1&&(Oi(0,`p`,12),fS(1),Nc()),i&2){let t=HE(2);ec(),pg(t.t().invalid)}}function ge(i,n){if(i&1&&(Oi(0,`p`,13),fS(1),Nc()),i&2){let t=HE(2);ec(),Ac(` `,t.t().compose,` `)}}function ue(i,n){i&1&&(Oi(0,`p`,14),fS(1),Nc()),i&2&&(ec(),pg(n))}function xe(i,n){if(i&1){let t=$E();Gm(0,`div`,2),Oi(1,`div`,3)(2,`div`,4)(3,`h2`,5),fS(4),Nc(),Oi(5,`p`,6),fS(6),Nc(),Oi(7,`form`,7),Jm(`submit`,function(a){Ld(t);return Od(HE().submit(a))}),Oi(8,`label`,8)(9,`span`,9),fS(10),Nc(),Oi(11,`input`,10),Jm(`input`,function(a){Ld(t);return Od(HE().target.set(a.target.value))}),Nc()(),SE(12,pe,2,1,`p`,11)(13,ce,2,1,`p`,12),SE(14,ge,2,1,`p`,13),SE(15,ue,2,1,`p`,14),Oi(16,`div`,15)(17,`button`,16),Gm(18,`app-icon`,17),fS(19),Nc(),Oi(20,`button`,18),Gm(21,`app-icon`,19),fS(22),Nc()()()()()}if(i&2){let t,e=HE();ec(4),pg(e.t().title),ec(2),pg(e.t().description(e.name())),ec(4),pg(e.t().label),ec(),nS(e.field+` mt-1.5`),Wm(`value`,e.target()),ec(),kE(e.taken()?12:e.invalid()?13:-1),ec(2),kE(e.compose()?14:-1),ec(),kE((t=e.problem())?15:-1,t),ec(3),Wm(`size`,14),ec(),Ac(` `,e.common().close,` `),ec(),Wm(`disabled`,!e.canSave()),ec(),Wm(`size`,14),ec(),Ac(` `,e.saving()?e.t().saving:e.t().save,` `)}}var fe;var $;var ee;var ve=f(()=>{Kr();Je();v();lk();X();sk();dk();f$1();Kr();fe=`mx-focus w-full rounded-md border border-ink-700 bg-ink-800 px-2.5 py-1.5 font-mono text-[13px] text-ink-100 placeholder:text-ink-500`,$=/^[a-zA-Z0-9][a-zA-Z0-9_.-]+$/,ee=class i{open=mj(!1);containerId=jc.required();name=jc.required();compose=jc(!1);store=C(u$1);groups=C(D);toast=C(u);t=Ot(()=>ok().containers.rename);common=Ot(()=>ok().common);field=fe;target=wt(``);saving=wt(!1);problem=wt(null);wanted=Ot(()=>this.target().trim());invalid=Ot(()=>this.wanted()!==``&&!$.test(this.wanted()));taken=Ot(()=>this.store.containers().some(n=>n.name===this.wanted()&&n.id!==this.containerId()));canSave=Ot(()=>!this.saving()&&$.test(this.wanted())&&!this.taken()&&this.wanted()!==this.name());constructor(){rf(()=>{if(!this.open())return;let n=this.name();Tg(()=>{this.target.set(n),this.problem.set(null)})})}async submit(n){if(n.preventDefault(),!this.canSave())return;let t=this.name(),e=this.wanted();this.saving.set(!0),this.problem.set(null);try{let a=await window.electron.containers.rename(this.containerId(),e);a.ok?(this.groups.moveContainer(t,e),this.toast.success(this.t().saved(t,e)),this.open.set(!1)):this.problem.set(a.problem)}catch(a){this.problem.set(eH(a))}finally{this.saving.set(!1)}}static ɵfac=function(t){return new(t||i)};static ɵcmp=wc({type:i,selectors:[[`app-rename-dialog`]],inputs:{open:[1,`open`],containerId:[1,`containerId`],name:[1,`name`],compose:[1,`compose`]},outputs:{open:`openChange`},decls:2,vars:1,consts:[[`rdxDialogRoot`,``,3,`openChange`,`open`],[`rdxDialogPortal`,``],[`rdxDialogBackdrop`,``,1,`fixed`,`inset-0`,`z-40`,`bg-black/50`],[`rdxDialogViewport`,``,1,`fixed`,`inset-0`,`z-50`,`grid`,`place-items-center`,`p-4`],[`rdxDialogPopup`,``,`data-testid`,`rename-dialog`,1,`w-full`,`max-w-md`,`rounded-lg`,`border`,`border-ink-700`,`bg-ink-850`,`p-5`,`shadow-2xl`],[`rdxDialogTitle`,``,1,`text-[15px]`,`font-semibold`,`text-ink-100`],[`rdxDialogDescription`,``,1,`mt-1`,`text-[13px]`,`text-ink-400`],[1,`mt-4`,3,`submit`],[1,`block`],[1,`text-[13px]`,`font-medium`,`text-ink-200`],[`type`,`text`,`spellcheck`,`false`,`autocomplete`,`off`,`data-testid`,`rename-name`,3,`input`,`value`],[`data-testid`,`rename-taken`,1,`mt-2`,`text-[12px]`,`text-danger`],[`data-testid`,`rename-invalid`,1,`mt-2`,`text-[12px]`,`text-danger`],[`data-testid`,`rename-compose`,1,`mt-3`,`rounded-md`,`border`,`border-warn/40`,`bg-warn/10`,`px-3`,`py-2`,`text-[12px]`,`text-ink-200`],[`role`,`alert`,1,`mt-3`,`rounded-md`,`border`,`border-danger/40`,`bg-danger/10`,`px-3`,`py-2`,`text-[13px]`,`text-danger`],[1,`mt-5`,`flex`,`items-center`,`justify-end`,`gap-2`],[`type`,`button`,`rdxDialogClose`,``,1,`mx-btn`,`mx-focus`],[`name`,`close`,3,`size`],[`type`,`submit`,`data-testid`,`rename-save`,1,`mx-btn`,`mx-focus`,`border-accent`,`text-accent`,3,`disabled`],[`name`,`pencil`,3,`size`]],template:function(t,e){t&1&&(Oi(0,`div`,0),vg(`openChange`,function(d){return vS(e.open,d)||(e.open=d),d}),_m(1,xe,23,14,`ng-template`,1),Nc()),t&2&&hg(`open`,e.open)},dependencies:[ie,ln,an,pn,cn,fn,dn,un,My],encapsulation:2})}});export{ve as i,X as n,ee as r,D as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{B as Kr,Rt as X,cn as f,cr as ve,f as C,gr as wt,jn as lk,on as eH,rt as Ot}from"./chunk-BdOOWVGY.js";import{n as u$1,t as f$1}from"./chunk-V7ftX_10.js";var u;var v=f(()=>{Kr();lk();f$1();Kr();u=class o{toast=C(u$1);items=wt([]);measurements=wt(new Map);busy=wt(!1);loadProblem=wt(null);running=wt(new Set);containers=this.items.asReadonly();stats=this.measurements.asReadonly();loading=this.busy.asReadonly();problem=this.loadProblem.asReadonly();pending=this.running.asReadonly();runningIds=Ot(()=>this.items().filter(e=>e.state===`running`).map(e=>e.id),{equal:(e,n)=>e.length===n.length&&e.every((t,a)=>t===n[a])});constructor(){let e=C(ve);e.onDestroy(window.electron.events.subscribe(n=>{n.includes(`container`)&&this.refresh()})),e.onDestroy(window.electron.containers.onStats(n=>this.applyStats(n)))}async refresh(){this.busy.set(!0);try{this.items.set(await window.electron.containers.list()),this.loadProblem.set(null)}catch(e){this.loadProblem.set(eH(e))}finally{this.busy.set(!1)}}watchStats(e){window.electron.containers.watchStats(e)}async run(e,n){this.running.update(t=>new Set(t).add(n));try{let t=await window.electron.containers.action(e,n);t.ok||this.toast.error(t.problem)}finally{this.running.update(t=>{let a=new Set(t);return a.delete(n),a})}}async runMany(e,n){await Promise.all(n.map(t=>this.run(e,t)))}applyStats(e){let n=new Map(this.measurements());for(let t of e)n.set(t.id,t);this.measurements.set(n)}static ɵfac=function(n){return new(n||o)};static ɵprov=X({token:o,factory:o.ɵfac,providedIn:`root`})}});export{v as n,u as t};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{$n as sk,$t as bg,A as HE,B as Kr,Bn as ok,Cn as ik,Cr as zE,Ct as Tg,D as Gm,Dn as kc,En as kE,Fn as nS,Gn as pj,Gt as _m,H as Ld,J as Nc,K as My,N as IS,Nn as mg,Pn as mj,Pt as Wm,Qn as sg,R as Jm,Rt as X,St as Tc,Tn as jc,Vt as Zd,Wn as pg,Xn as rf,Xt as bS,Zn as rg,_ as DE,_r as xS,_t as Sc,br as yS,bt as TE,cn as f,cr as ve,dr as vr,et as Od,f as C,gn as gj,gr as wt,gt as SS,ht as SE,i as $m,jn as lk,ln as fS,lr as vg,mr as wc,o as Ac,on as eH,or as vS,p as CE,q as NS,qt as ag,rn as dk,rt as Ot$1,sn as ec,t as $E,tt as Oi$1,u as Br,xn as hg}from"./chunk-BdOOWVGY.js";import{n as y,t as o}from"./chunk-CSrKHPxR.js";import{n as u,t as f$1}from"./chunk-V7ftX_10.js";import{n as y$1,t as c}from"./chunk-iwVkNYYA.js";import{a as Me$1,o as Ne$1}from"./chunk-D29s9m84.js";import"./chunk-CMrtklQ1.js";import{a as x,i as h,r as d,t as A}from"./chunk-CRNeTD5E.js";import{n as h$1,t as P}from"./chunk-Cbit44lz.js";import{n as p,t as M}from"./chunk-C22Z7vgK.js";import"./chunk-eG8Su12W.js";import"./chunk-Bx2_SrZM.js";import{_ as pn$1,d as dn,f as fn$1,g as ln,l as an,m as ie,r as Je,u as cn,v as un$1}from"./chunk-QaMufr3I.js";import{n as v,t as u$1}from"./chunk-BoN9ZlqT.js";import{n as x$1,t as u$2}from"./chunk-BW20bBdg.js";import{a as Yt,s as fe,u as ra$1}from"./chunk-DzG5R5Kk.js";import{n as V,t as G}from"./chunk-CWusqRG0.js";import{n as W,t as J}from"./chunk-DZjRtM2K.js";import{a as z,i as r,n as O,r as d$1}from"./chunk-DLeqF0uQ.js";import{n as u$3,t as c$1}from"./chunk-cYufOe8J.js";import{a as fi$1,i as _e,n as Qt,o as gi$1,r as Ye,s as we$1,t as Le}from"./chunk-ep62jwHG.js";import{a as T,i as H,n as B,o as U,r as G$1,s as V$1,t as $}from"./chunk-KUYJNmP22.js";import{i as ve$1,r as ee}from"./chunk-BgNCBUvw2.js";function pn(n,t){if(n&1&&(Oi$1(0,`pre`,15),fS(1),Nc(),Oi$1(2,`p`,16),fS(3),Nc()),n&2){let e=HE(2);ec(),pg(e.markdown()),ec(2),pg(e.redactionText())}}function un(n,t){if(n&1&&(Oi$1(0,`p`,7),fS(1),Nc()),n&2){let e=HE(2);ec(),Ac(` `,e.problem(),` `)}}function xn(n,t){if(n&1&&(Oi$1(0,`p`,8),fS(1),Nc()),n&2){let e=HE(2);ec(),pg(e.t().collecting)}}function gn(n,t){n&1&&(Oi$1(0,`span`,10),fS(1),Nc()),n&2&&(ec(),pg(t))}function _n(n,t){if(n&1){let e=$E();Gm(0,`div`,2),Oi$1(1,`div`,3)(2,`div`,4)(3,`h2`,5),fS(4),Nc(),Oi$1(5,`p`,6),fS(6),Nc(),SE(7,pn,4,2)(8,un,2,1,`p`,7)(9,xn,2,1,`p`,8),Oi$1(10,`div`,9),SE(11,gn,2,1,`span`,10),Oi$1(12,`button`,11),Gm(13,`app-icon`,12),fS(14),Nc(),Oi$1(15,`button`,13),Jm(`click`,function(){Ld(e);return Od(HE().copy())}),Gm(16,`app-icon`,14),fS(17),Nc()()()()}if(n&2){let e,i,l=HE();ec(4),pg(l.t().title),ec(2),pg(l.t().description),ec(),kE((e=l.result()?.ok)===!0?7:e===!1?8:9),ec(4),kE((i=l.copyProblem())?11:-1,i),ec(2),Wm(`size`,14),ec(),Ac(` `,l.common().close,` `),ec(),Wm(`disabled`,l.result()?.ok!==!0),ec(),Wm(`name`,l.copied()?`check`:`copy`)(`size`,14),ec(),Ac(` `,l.copied()?l.common().copied:l.common().copy,` `)}}var he;var Tt=f(()=>{Kr();Je();lk();dk();sk();Kr();he=class n{open=mj(!1);containerId=jc.required();t=Ot$1(()=>ok().containers.diagnosis);common=Ot$1(()=>ok().common);result=wt(null);copied=wt(!1);copyProblem=wt(null);constructor(){rf(()=>{if(!this.open())return;let t=this.containerId();Tg(()=>{this.load(t)})})}markdown(){let t=this.result();return t?.ok===!0?t.markdown:``}problem(){let t=this.result();return t?.ok===!1?t.problem:``}redactionText(){let t=this.result(),e=t?.ok===!0?t.redactions:0;return e===0?this.t().noRedactions:this.t().redactions(e)}async copy(){let t=this.result();if(t?.ok===!0)try{await navigator.clipboard.writeText(t.markdown),this.copyProblem.set(null),this.copied.set(!0),setTimeout(()=>this.copied.set(!1),1500)}catch(e){this.copyProblem.set(this.t().copyFailed(eH(e)))}}async load(t){this.result.set(null),this.copied.set(!1),this.copyProblem.set(null);try{this.result.set(await window.electron.containers.diagnose(t))}catch(e){this.result.set({ok:!1,problem:eH(e)})}}static ɵfac=function(e){return new(e||n)};static ɵcmp=wc({type:n,selectors:[[`app-diagnosis-dialog`]],inputs:{open:[1,`open`],containerId:[1,`containerId`]},outputs:{open:`openChange`},decls:2,vars:1,consts:[[`rdxDialogRoot`,``,3,`openChange`,`open`],[`rdxDialogPortal`,``],[`rdxDialogBackdrop`,``,1,`fixed`,`inset-0`,`z-40`,`bg-black/50`],[`rdxDialogViewport`,``,1,`fixed`,`inset-0`,`z-50`,`grid`,`place-items-center`,`p-4`],[`rdxDialogPopup`,``,`data-testid`,`diagnosis-dialog`,1,`flex`,`max-h-[85vh]`,`w-full`,`max-w-3xl`,`flex-col`,`rounded-lg`,`border`,`border-ink-700`,`bg-ink-850`,`p-5`,`shadow-2xl`],[`rdxDialogTitle`,``,1,`text-[15px]`,`font-semibold`,`text-ink-100`],[`rdxDialogDescription`,``,1,`mt-1`,`text-[13px]`,`text-ink-400`],[1,`mt-4`,`rounded-md`,`border`,`border-danger/40`,`bg-danger/10`,`px-3`,`py-2`,`text-[13px]`,`text-danger`],[1,`mt-4`,`text-[13px]`,`text-ink-400`],[1,`mt-4`,`flex`,`items-center`,`justify-end`,`gap-2`],[1,`mr-auto`,`text-[12px]`,`text-danger`],[`type`,`button`,`rdxDialogClose`,``,1,`mx-btn`,`mx-focus`],[`name`,`close`,3,`size`],[`type`,`button`,`data-testid`,`diagnosis-copy`,1,`mx-btn`,`mx-focus`,3,`click`,`disabled`],[3,`name`,`size`],[`data-testid`,`diagnosis-text`,1,`mt-4`,`min-h-0`,`flex-1`,`overflow-auto`,`rounded-md`,`border`,`border-ink-700`,`bg-ink-900`,`p-3`,`font-mono`,`text-[12px]`,`leading-relaxed`,`whitespace-pre-wrap`,`text-ink-200`],[`data-testid`,`diagnosis-redactions`,1,`mt-2`,`text-[12px]`,`text-ink-500`]],template:function(e,i){e&1&&(Oi$1(0,`div`,0),vg(`openChange`,function(c){return vS(i.open,c)||(i.open=c),c}),_m(1,_n,18,10,`ng-template`,1),Nc()),e&2&&hg(`open`,i.open)},dependencies:[ie,ln,an,pn$1,cn,fn$1,dn,un$1,My],encapsulation:2})}});function yn(n,t){if(n&1&&(Oi$1(0,`p`,7),fS(1),Nc()),n&2){let e=HE(2);ec(),pg(e.t().loading)}}function fn(n,t){if(n&1&&(Oi$1(0,`p`,23),fS(1),Nc()),n&2){let e=HE(3);ec(),pg(e.t().compose)}}function vn(n,t){if(n&1){let e=$E();Oi$1(0,`p`,14),fS(1),Nc(),Oi$1(2,`div`,15)(3,`label`,16)(4,`span`,17),fS(5),Nc(),Oi$1(6,`input`,18),Jm(`input`,function(l){Ld(e);return Od(HE(2).amount.set(l.target.value))}),Nc()(),Oi$1(7,`select`,19),Jm(`change`,function(l){Ld(e);return Od(HE(2).unit.set(l.target.value))}),Oi$1(8,`option`,20),fS(9,`MB`),Nc(),Oi$1(10,`option`,21),fS(11,`GB`),Nc()()(),Oi$1(12,`p`,22),fS(13),Nc(),SE(14,fn,2,1,`p`,23)}if(n&2){let e=HE(2);ec(),Ac(` `,e.current()===null?e.t().none:e.t().current(e.format(e.current()??0)),` `),ec(4),pg(e.t().label),ec(),nS(e.field+` mt-1.5 w-full`),Wm(`value`,e.amount()),Br(`aria-label`,e.t().label),ec(),nS(e.field),Br(`aria-label`,e.t().unit),ec(),Wm(`selected`,e.unit()===`MB`),ec(2),Wm(`selected`,e.unit()===`GB`),ec(3),pg(e.t().noRemove),ec(),kE(e.compose()?14:-1)}}function bn(n,t){n&1&&(Oi$1(0,`p`,8),fS(1),Nc()),n&2&&(ec(),pg(t))}function hn(n,t){if(n&1){let e=$E();Gm(0,`div`,2),Oi$1(1,`div`,3)(2,`div`,4)(3,`h2`,5),fS(4),Nc(),Oi$1(5,`p`,6),fS(6),Nc(),SE(7,yn,2,1,`p`,7)(8,vn,15,13),SE(9,bn,2,1,`p`,8),Oi$1(10,`div`,9)(11,`button`,10),Gm(12,`app-icon`,11),fS(13),Nc(),Oi$1(14,`button`,12),Jm(`click`,function(){Ld(e);return Od(HE().save())}),Gm(15,`app-icon`,13),fS(16),Nc()()()()}if(n&2){let e,i=HE();ec(4),pg(i.t().title),ec(2),pg(i.t().description),ec(),kE(i.loading()?7:8),ec(2),kE((e=i.problem())?9:-1,e),ec(3),Wm(`size`,14),ec(),Ac(` `,i.common().close,` `),ec(),Wm(`disabled`,i.loading()||i.saving()),ec(),Wm(`size`,14),ec(),Ac(` `,i.saving()?i.t().saving:i.t().save,` `)}}function wn(n,t){let e=Number(n.replace(`,`,`.`));return!Number.isFinite(e)||e<=0?null:Math.round(e*(t===`GB`?ze:Oe))}var Oe;var ze;var Cn;var Ce;var Mt=f(()=>{Kr();Je();lk();h();dk();f$1();sk();Kr();Oe=1024*1024,ze=1024*Oe,Cn=`mx-focus min-w-0 rounded-md border border-ink-700 bg-ink-800 px-2.5 py-1.5 text-[13px] text-ink-100 placeholder:text-ink-500`;Ce=class n{open=mj(!1);containerId=jc.required();compose=jc(!1);saved=pj();toast=C(u);t=Ot$1(()=>ok().containers.memoryLimit);common=Ot$1(()=>ok().common);field=Cn;current=wt(null);amount=wt(``);unit=wt(`MB`);loading=wt(!0);saving=wt(!1);problem=wt(null);constructor(){rf(()=>{if(!this.open())return;let t=this.containerId();Tg(()=>{this.load(t)})})}format(t){return d(t)}async save(){let t=wn(this.amount(),this.unit());if(t===null){this.problem.set(this.t().invalid);return}this.saving.set(!0),this.problem.set(null);try{let e=await window.electron.containers.setMemoryLimit(this.containerId(),t);e.ok?(this.toast.success(this.t().saved(d(t))),this.saved.emit(),this.open.set(!1)):this.problem.set(e.problem)}catch(e){this.problem.set(eH(e))}finally{this.saving.set(!1)}}async load(t){this.loading.set(!0),this.problem.set(null);try{let e=await window.electron.containers.memoryLimit(t);if(e.ok){this.current.set(e.limitBytes);let i=e.limitBytes;i!==null&&i%ze===0?(this.unit.set(`GB`),this.amount.set(String(i/ze))):(this.unit.set(`MB`),this.amount.set(i===null?``:String(Math.round(i/Oe))))}else this.problem.set(e.problem)}catch(e){this.problem.set(eH(e))}finally{this.loading.set(!1)}}static ɵfac=function(e){return new(e||n)};static ɵcmp=wc({type:n,selectors:[[`app-memory-limit-dialog`]],inputs:{open:[1,`open`],containerId:[1,`containerId`],compose:[1,`compose`]},outputs:{open:`openChange`,saved:`saved`},decls:2,vars:1,consts:[[`rdxDialogRoot`,``,3,`openChange`,`open`],[`rdxDialogPortal`,``],[`rdxDialogBackdrop`,``,1,`fixed`,`inset-0`,`z-40`,`bg-black/50`],[`rdxDialogViewport`,``,1,`fixed`,`inset-0`,`z-50`,`grid`,`place-items-center`,`p-4`],[`rdxDialogPopup`,``,`data-testid`,`memory-limit-dialog`,1,`w-full`,`max-w-md`,`rounded-lg`,`border`,`border-ink-700`,`bg-ink-850`,`p-5`,`shadow-2xl`],[`rdxDialogTitle`,``,1,`text-[15px]`,`font-semibold`,`text-ink-100`],[`rdxDialogDescription`,``,1,`mt-1`,`text-[13px]`,`text-ink-400`],[1,`mt-4`,`text-[13px]`,`text-ink-400`],[`role`,`alert`,1,`mt-3`,`rounded-md`,`border`,`border-danger/40`,`bg-danger/10`,`px-3`,`py-2`,`text-[13px]`,`text-danger`],[1,`mt-5`,`flex`,`items-center`,`justify-end`,`gap-2`],[`type`,`button`,`rdxDialogClose`,``,1,`mx-btn`,`mx-focus`],[`name`,`close`,3,`size`],[`type`,`button`,`data-testid`,`memory-limit-save`,1,`mx-btn`,`mx-focus`,`border-accent`,`text-accent`,3,`click`,`disabled`],[`name`,`check`,3,`size`],[`data-testid`,`memory-limit-current`,1,`mt-4`,`text-[13px]`,`text-ink-200`],[1,`mt-3`,`flex`,`items-end`,`gap-2`],[1,`block`,`flex-1`],[1,`text-[13px]`,`font-medium`,`text-ink-200`],[`type`,`number`,`min`,`1`,`step`,`any`,3,`input`,`value`],[3,`change`],[`value`,`MB`,3,`selected`],[`value`,`GB`,3,`selected`],[1,`mt-3`,`text-[12px]`,`text-ink-500`],[1,`mt-1`,`text-[12px]`,`text-ink-500`]],template:function(e,i){e&1&&(Oi$1(0,`div`,0),vg(`openChange`,function(c){return vS(i.open,c)||(i.open=c),c}),_m(1,hn,17,9,`ng-template`,1),Nc()),e&2&&hg(`open`,i.open)},dependencies:[ie,ln,an,pn$1,cn,fn$1,dn,un$1,My],encapsulation:2})}});function Dn(n,t){if(n&1&&(Oi$1(0,`p`,7),fS(1),Nc()),n&2){let e=HE(2);ec(),pg(e.t().loading)}}function kn(n,t){if(n&1&&(Oi$1(0,`p`,20),fS(1),Nc()),n&2){let e=HE(3);ec(),pg(e.t().compose)}}function Sn(n,t){if(n&1){let e=$E();Oi$1(0,`p`,14),fS(1),Nc(),Oi$1(2,`label`,15)(3,`span`,16),fS(4),Nc(),Oi$1(5,`input`,17),Jm(`input`,function(l){Ld(e);return Od(HE(2).amount.set(l.target.value))}),Nc()(),Oi$1(6,`p`,18),fS(7),Nc(),Oi$1(8,`p`,19),fS(9),Nc(),SE(10,kn,2,1,`p`,20)}if(n&2){let e=HE(2);ec(),Ac(` `,e.current()===null?e.t().none:e.t().current(e.format(e.current()??0)),` `),ec(3),pg(e.t().label),ec(),nS(e.field+` mt-1.5 w-full`),Wm(`value`,e.amount()),Br(`aria-label`,e.t().label),ec(2),pg(e.t().hint(e.format(e.max()))),ec(2),pg(e.t().noRemove),ec(),kE(e.compose()?10:-1)}}function In(n,t){n&1&&(Oi$1(0,`p`,8),fS(1),Nc()),n&2&&(ec(),pg(t))}function En(n,t){if(n&1){let e=$E();Gm(0,`div`,2),Oi$1(1,`div`,3)(2,`div`,4)(3,`h2`,5),fS(4),Nc(),Oi$1(5,`p`,6),fS(6),Nc(),SE(7,Dn,2,1,`p`,7)(8,Sn,11,9),SE(9,In,2,1,`p`,8),Oi$1(10,`div`,9)(11,`button`,10),Gm(12,`app-icon`,11),fS(13),Nc(),Oi$1(14,`button`,12),Jm(`click`,function(){Ld(e);return Od(HE().save())}),Gm(15,`app-icon`,13),fS(16),Nc()()()()}if(n&2){let e,i=HE();ec(4),pg(i.t().title),ec(2),pg(i.t().description),ec(),kE(i.loading()?7:8),ec(2),kE((e=i.problem())?9:-1,e),ec(3),Wm(`size`,14),ec(),Ac(` `,i.common().close,` `),ec(),Wm(`disabled`,i.loading()||i.saving()),ec(),Wm(`size`,14),ec(),Ac(` `,i.saving()?i.t().saving:i.t().save,` `)}}function Mn(n){let t=Number(n.trim().replace(`,`,`.`));return Number.isFinite(t)&&t>0?t:null}function Be(n,t){return new Intl.NumberFormat(t,{maximumFractionDigits:2}).format(n)}var Tn;var we;var Vt=f(()=>{Kr();Je();y();lk();sk();dk();f$1();Kr();Tn=`mx-focus min-w-0 rounded-md border border-ink-700 bg-ink-800 px-2.5 py-1.5 text-[13px] text-ink-100 placeholder:text-ink-500`;we=class n{open=mj(!1);containerId=jc.required();compose=jc(!1);saved=pj();toast=C(u);engine=C(o);t=Ot$1(()=>ok().containers.cpuLimit);common=Ot$1(()=>ok().common);field=Tn;max=Ot$1(()=>this.engine.status()?.info?.cpus??1);current=wt(null);amount=wt(``);loading=wt(!0);saving=wt(!1);problem=wt(null);constructor(){rf(()=>{if(!this.open())return;let t=this.containerId();Tg(()=>{this.load(t)})})}format(t){return Be(t,ik())}async save(){let t=Mn(this.amount());if(t===null){this.problem.set(this.t().invalid);return}this.saving.set(!0),this.problem.set(null);try{let e=await window.electron.containers.setCpuLimit(this.containerId(),t);e.ok?(this.toast.success(this.t().saved(this.format(t))),this.saved.emit(),this.open.set(!1)):this.problem.set(e.problem)}catch(e){this.problem.set(eH(e))}finally{this.saving.set(!1)}}async load(t){this.loading.set(!0),this.problem.set(null);try{let e=await window.electron.containers.cpuLimit(t);e.ok?(this.current.set(e.cpus),this.amount.set(e.cpus===null?``:this.format(e.cpus))):this.problem.set(e.problem)}catch(e){this.problem.set(eH(e))}finally{this.loading.set(!1)}}static ɵfac=function(e){return new(e||n)};static ɵcmp=wc({type:n,selectors:[[`app-cpu-limit-dialog`]],inputs:{open:[1,`open`],containerId:[1,`containerId`],compose:[1,`compose`]},outputs:{open:`openChange`,saved:`saved`},decls:2,vars:1,consts:[[`rdxDialogRoot`,``,3,`openChange`,`open`],[`rdxDialogPortal`,``],[`rdxDialogBackdrop`,``,1,`fixed`,`inset-0`,`z-40`,`bg-black/50`],[`rdxDialogViewport`,``,1,`fixed`,`inset-0`,`z-50`,`grid`,`place-items-center`,`p-4`],[`rdxDialogPopup`,``,`data-testid`,`cpu-limit-dialog`,1,`w-full`,`max-w-md`,`rounded-lg`,`border`,`border-ink-700`,`bg-ink-850`,`p-5`,`shadow-2xl`],[`rdxDialogTitle`,``,1,`text-[15px]`,`font-semibold`,`text-ink-100`],[`rdxDialogDescription`,``,1,`mt-1`,`text-[13px]`,`text-ink-400`],[1,`mt-4`,`text-[13px]`,`text-ink-400`],[`role`,`alert`,1,`mt-3`,`rounded-md`,`border`,`border-danger/40`,`bg-danger/10`,`px-3`,`py-2`,`text-[13px]`,`text-danger`],[1,`mt-5`,`flex`,`items-center`,`justify-end`,`gap-2`],[`type`,`button`,`rdxDialogClose`,``,1,`mx-btn`,`mx-focus`],[`name`,`close`,3,`size`],[`type`,`button`,`data-testid`,`cpu-limit-save`,1,`mx-btn`,`mx-focus`,`border-accent`,`text-accent`,3,`click`,`disabled`],[`name`,`check`,3,`size`],[`data-testid`,`cpu-limit-current`,1,`mt-4`,`text-[13px]`,`text-ink-200`],[1,`mt-3`,`block`],[1,`text-[13px]`,`font-medium`,`text-ink-200`],[`type`,`text`,`inputmode`,`decimal`,`autocomplete`,`off`,3,`input`,`value`],[1,`mt-1.5`,`text-[12px]`,`text-ink-500`],[1,`mt-3`,`text-[12px]`,`text-ink-500`],[1,`mt-1`,`text-[12px]`,`text-ink-500`]],template:function(e,i){e&1&&(Oi$1(0,`div`,0),vg(`openChange`,function(c){return vS(i.open,c)||(i.open=c),c}),_m(1,En,17,9,`ng-template`,1),Nc()),e&2&&hg(`open`,i.open)},dependencies:[ie,ln,an,pn$1,cn,fn$1,dn,un$1,My],encapsulation:2})}});function Nn(n,t){n&1&&(Oi$1(0,`p`,0),fS(1),Nc()),n&2&&(ec(),pg(t))}function Pn(n,t){if(n&1&&(Oi$1(0,`p`,6),fS(1),Nc()),n&2){let e=HE(2);ec(),pg(e.t().empty)}}function Ln(n,t){if(n&1){let e=$E();Oi$1(0,`button`,17),Jm(`click`,function(){Ld(e);let l=HE().$implicit;return Od(HE(3).reveal(l.name))}),fS(1,` •••••••• `),Oi$1(2,`span`,18),fS(3),Nc()()}if(n&2){let e=HE().$implicit,i=HE(3);Br(`aria-label`,i.t().reveal(e.name))(`data-testid`,`env-reveal-`+e.name),ec(3),pg(i.t().show)}}function Rn(n,t){if(n&1&&(Oi$1(0,`span`,15),fS(1),Nc()),n&2){let e=HE(4);ec(),pg(e.t().emptyValue)}}function Fn(n,t){if(n&1&&fS(0),n&2){let e=HE().$implicit;Ac(` `,e.value,` `)}}function zn(n,t){if(n&1&&(Oi$1(0,`tr`,11)(1,`td`,12),fS(2),Nc(),Oi$1(3,`td`,13),SE(4,Ln,4,3,`button`,14)(5,Rn,2,1,`span`,15)(6,Fn,1,1),Nc(),Oi$1(7,`td`,16),fS(8),Nc()()),n&2){let e=t.$implicit,i=HE(3);Br(`data-testid`,`env-`+e.name),ec(2),pg(e.name),ec(2),kE(i.hidden(e)?4:e.value===``?5:6),ec(3),nS(e.source===`image`?`text-ink-500`:`text-ink-300`),ec(),pg(i.t().sources[e.source])}}function On(n,t){if(n&1&&(Oi$1(0,`table`,7)(1,`thead`)(2,`tr`,8)(3,`th`,9),fS(4),Nc(),Oi$1(5,`th`,9),fS(6),Nc(),Oi$1(7,`th`,10),fS(8),Nc()()(),Oi$1(9,`tbody`),kc(10,zn,9,6,`tr`,11,Vn),Nc()()),n&2){let e=HE(),i=HE();ec(4),pg(i.t().name),ec(2),pg(i.t().value),ec(2),pg(i.t().source),ec(2),Tc(e)}}function Bn(n,t){if(n&1){let e=$E();Oi$1(0,`div`,2)(1,`p`,3),fS(2),Nc(),Oi$1(3,`button`,4),Jm(`click`,function(){Ld(e);return Od(HE().copyAll())}),Gm(4,`app-icon`,5),fS(5),Nc()(),SE(6,Pn,2,1,`p`,6)(7,On,12,3,`table`,7)}if(n&2){let e=t,i=HE();ec(2),pg(i.compose()?i.t().composeNote:i.t().readOnly),ec(),Wm(`disabled`,e.length===0),ec(),Wm(`size`,14),ec(),Ac(` `,i.t().copyAll,` `),ec(),kE(e.length===0?6:7)}}function Wn(n,t){if(n&1&&(Oi$1(0,`p`,1),fS(1),Nc()),n&2){let e=HE();ec(),pg(e.t().loading)}}var Vn;var De;var Nt=f(()=>{Kr();lk();sk();dk();f$1();Kr();Vn=(n,t)=>t.name;De=class n{containerId=jc.required();compose=jc(!1);toast=C(u);t=Ot$1(()=>ok().containers.environment);variables=wt(null);problem=wt(null);revealed=wt(new Set);constructor(){rf(()=>{let t=this.containerId();Tg(()=>{this.load(t)})})}hidden(t){return t.secret&&!this.revealed().has(t.name)}reveal(t){this.revealed.update(e=>new Set(e).add(t))}async copyAll(){let t=this.variables()??[],e=t.filter(i=>!this.hidden(i));try{await navigator.clipboard.writeText(e.map(i=>`${i.name}=${i.value}`).join(`
|
|
2
|
+
`)),this.toast.success(this.t().copied(e.length,t.length-e.length))}catch(i){this.toast.error(eH(i))}}async load(t){this.variables.set(null),this.problem.set(null),this.revealed.set(new Set);try{let e=await window.electron.containers.environment(t);e.ok?this.variables.set(e.variables):this.problem.set(e.problem)}catch(e){this.problem.set(eH(e))}}static ɵfac=function(e){return new(e||n)};static ɵcmp=wc({type:n,selectors:[[`app-environment-view`]],hostAttrs:[1,`block`,`h-full`,`overflow-auto`,`px-6`,`py-4`],inputs:{containerId:[1,`containerId`],compose:[1,`compose`]},decls:3,vars:1,consts:[[1,`rounded-md`,`border`,`border-danger/40`,`bg-danger/10`,`px-3`,`py-2`,`text-[13px]`,`text-danger`],[1,`text-[13px]`,`text-ink-400`],[1,`flex`,`flex-wrap`,`items-center`,`gap-3`],[1,`text-[12px]`,`text-ink-500`],[`type`,`button`,`data-testid`,`env-copy`,1,`mx-btn`,`mx-focus`,`ml-auto`,3,`click`,`disabled`],[`name`,`copy`,3,`size`],[1,`mt-4`,`text-[13px]`,`text-ink-400`],[1,`mt-3`,`w-full`,`text-[13px]`],[1,`border-b`,`border-ink-700`,`text-left`,`text-[12px]`,`text-ink-400`],[1,`py-1.5`,`pr-4`,`font-normal`],[1,`w-36`,`py-1.5`,`font-normal`],[1,`border-b`,`border-ink-800`,`align-top`],[1,`py-1.5`,`pr-4`,`font-mono`,`text-[12px]`,`break-all`,`text-ink-100`],[1,`py-1.5`,`pr-4`,`font-mono`,`text-[12px]`,`break-all`,`text-ink-300`],[`type`,`button`,1,`mx-focus`,`rounded`,`text-ink-500`,`hover:text-ink-200`],[1,`text-ink-600`],[1,`py-1.5`,`text-[12px]`],[`type`,`button`,1,`mx-focus`,`rounded`,`text-ink-500`,`hover:text-ink-200`,3,`click`],[1,`font-sans`,`text-[11px]`,`underline`]],template:function(e,i){if(e&1&&SE(0,Nn,2,1,`p`,0)(1,Bn,8,5)(2,Wn,2,1,`p`,1),e&2){let l;kE((l=i.problem())?0:(l=i.variables())?1:2,l)}},dependencies:[My],encapsulation:2})}});function jn(n,t){if(n&1&&(Oi$1(0,`p`,7),fS(1),Nc()),n&2){let e=HE(2);ec(),pg(e.t().loading)}}function An(n,t){if(n&1&&(Oi$1(0,`option`,17),fS(1),Nc()),n&2){let e=t.$implicit,i=HE(3);Wm(`value`,e)(`selected`,i.name()===e),ec(),pg(i.t().names[e])}}function Hn(n,t){if(n&1){let e=$E();Oi$1(0,`label`,18)(1,`span`,15),fS(2),Nc(),Oi$1(3,`input`,19),Jm(`input`,function(l){Ld(e);return Od(HE(3).setMaximum(l.target.value))}),Nc(),Oi$1(4,`span`,20),fS(5),Nc()()}if(n&2){let e=HE(3);ec(2),pg(e.t().maximum),ec(),nS(e.field+` mt-1.5 w-full`),Wm(`value`,e.maximum()),Br(`aria-label`,e.t().maximum),ec(2),pg(e.t().maximumHint)}}function $n(n,t){if(n&1){let e=$E();Oi$1(0,`label`,14)(1,`span`,15),fS(2),Nc(),Oi$1(3,`select`,16),Jm(`change`,function(l){Ld(e);return Od(HE(2).choose(l.target.value))}),kc(4,An,2,3,`option`,17,Sc),Nc()(),SE(6,Hn,6,6,`label`,18)}if(n&2){let e=HE(2);ec(2),pg(e.t().label),ec(),nS(e.field+` mt-1.5 w-full`),Br(`aria-label`,e.t().label),ec(),Tc(e.names),ec(2),kE(e.name()===`on-failure`?6:-1)}}function Jn(n,t){n&1&&(Oi$1(0,`p`,8),fS(1),Nc()),n&2&&(ec(),Ac(` `,t,` `))}function qn(n,t){if(n&1){let e=$E();Gm(0,`div`,2),Oi$1(1,`div`,3)(2,`div`,4)(3,`h2`,5),fS(4),Nc(),Oi$1(5,`p`,6),fS(6),Nc(),SE(7,jn,2,1,`p`,7)(8,$n,7,5),SE(9,Jn,2,1,`p`,8),Oi$1(10,`div`,9)(11,`button`,10),Gm(12,`app-icon`,11),fS(13),Nc(),Oi$1(14,`button`,12),Jm(`click`,function(){Ld(e);return Od(HE().save())}),Gm(15,`app-icon`,13),fS(16),Nc()()()()}if(n&2){let e,i=HE();ec(4),pg(i.t().title),ec(2),pg(i.t().description),ec(),kE(i.loading()?7:8),ec(2),kE((e=i.problem())?9:-1,e),ec(3),Wm(`size`,14),ec(),Ac(` `,i.common().close,` `),ec(),Wm(`disabled`,i.loading()||i.saving()),ec(),Wm(`size`,14),ec(),Ac(` `,i.saving()?i.t().saving:i.t().save,` `)}}var Pt;var Gn;var ke;var Lt=f(()=>{Kr();Je();lk();dk();f$1();sk();Kr();Pt=[`no`,`always`,`unless-stopped`,`on-failure`],Gn=`mx-focus min-w-0 rounded-md border border-ink-700 bg-ink-800 px-2.5 py-1.5 text-[13px] text-ink-100 placeholder:text-ink-500`,ke=class n{open=mj(!1);containerId=jc.required();toast=C(u);t=Ot$1(()=>ok().containers.restartPolicy);common=Ot$1(()=>ok().common);field=Gn;names=Pt;name=wt(`no`);maximum=wt(0);loading=wt(!0);saving=wt(!1);problem=wt(null);constructor(){rf(()=>{if(!this.open())return;let t=this.containerId();Tg(()=>{this.load(t)})})}choose(t){this.name.set(Pt.find(e=>e===t)??`no`)}setMaximum(t){let e=Number.parseInt(t,10);this.maximum.set(Number.isNaN(e)?0:Math.min(100,Math.max(0,e)))}async save(){this.saving.set(!0),this.problem.set(null);try{let t={name:this.name(),maximumRetryCount:this.maximum()},e=await window.electron.containers.setRestartPolicy(this.containerId(),t);e.ok?(this.toast.success(this.t().saved(this.t().names[t.name])),this.open.set(!1)):this.problem.set(e.problem)}catch(t){this.problem.set(eH(t))}finally{this.saving.set(!1)}}async load(t){this.loading.set(!0),this.problem.set(null);try{let e=await window.electron.containers.restartPolicy(t);e.ok?(this.name.set(e.policy.name),this.maximum.set(e.policy.maximumRetryCount)):this.problem.set(e.problem)}catch(e){this.problem.set(eH(e))}finally{this.loading.set(!1)}}static ɵfac=function(e){return new(e||n)};static ɵcmp=wc({type:n,selectors:[[`app-restart-policy-dialog`]],inputs:{open:[1,`open`],containerId:[1,`containerId`]},outputs:{open:`openChange`},decls:2,vars:1,consts:[[`rdxDialogRoot`,``,3,`openChange`,`open`],[`rdxDialogPortal`,``],[`rdxDialogBackdrop`,``,1,`fixed`,`inset-0`,`z-40`,`bg-black/50`],[`rdxDialogViewport`,``,1,`fixed`,`inset-0`,`z-50`,`grid`,`place-items-center`,`p-4`],[`rdxDialogPopup`,``,`data-testid`,`restart-policy-dialog`,1,`w-full`,`max-w-md`,`rounded-lg`,`border`,`border-ink-700`,`bg-ink-850`,`p-5`,`shadow-2xl`],[`rdxDialogTitle`,``,1,`text-[15px]`,`font-semibold`,`text-ink-100`],[`rdxDialogDescription`,``,1,`mt-1`,`text-[13px]`,`text-ink-400`],[1,`mt-4`,`text-[13px]`,`text-ink-400`],[`role`,`alert`,1,`mt-3`,`rounded-md`,`border`,`border-danger/40`,`bg-danger/10`,`px-3`,`py-2`,`text-[13px]`,`text-danger`],[1,`mt-5`,`flex`,`items-center`,`justify-end`,`gap-2`],[`type`,`button`,`rdxDialogClose`,``,1,`mx-btn`,`mx-focus`],[`name`,`close`,3,`size`],[`type`,`button`,`data-testid`,`restart-policy-save`,1,`mx-btn`,`mx-focus`,`border-accent`,`text-accent`,3,`click`,`disabled`],[`name`,`check`,3,`size`],[1,`mt-4`,`block`],[1,`text-[13px]`,`font-medium`,`text-ink-200`],[3,`change`],[3,`value`,`selected`],[1,`mt-3`,`block`],[`type`,`number`,`min`,`0`,`max`,`100`,3,`input`,`value`],[1,`mt-1`,`block`,`text-[12px]`,`text-ink-500`]],template:function(e,i){e&1&&(Oi$1(0,`div`,0),vg(`openChange`,function(c){return vS(i.open,c)||(i.open=c),c}),_m(1,qn,17,9,`ng-template`,1),Nc()),e&2&&hg(`open`,i.open)},dependencies:[ie,ln,an,pn$1,cn,fn$1,dn,un$1,My],encapsulation:2})}});function Kn(n,t){if(n&1){let e=$E();Oi$1(0,`p`,8),fS(1),Nc(),Oi$1(2,`div`,9)(3,`button`,10),Gm(4,`app-icon`,11),fS(5),Nc(),Oi$1(6,`button`,12),Jm(`click`,function(){let l=Ld(e);return Od(HE(2).goTo(`zoek`,l.reference))}),Gm(7,`app-icon`,13),fS(8),Nc(),Oi$1(9,`button`,14),Jm(`click`,function(){let l=Ld(e);return Od(HE(2).goTo(`starten`,l.reference))}),Gm(10,`app-icon`,15),fS(11),Nc()()}if(n&2){let e=t,i=HE(2);ec(),Ac(` `,i.t().saved(e.reference,e.imageId),` `),ec(3),Wm(`size`,14),ec(),Ac(` `,i.common().close,` `),ec(2),Wm(`size`,14),ec(),Ac(` `,i.t().toImage,` `),ec(2),Wm(`size`,14),ec(),Ac(` `,i.t().run,` `)}}function Qn(n,t){if(n&1&&(Oi$1(0,`p`,20),fS(1),Nc()),n&2){let e=HE(3);ec(),pg(e.t().invalid)}}function Xn(n,t){if(n&1&&(Oi$1(0,`p`,21),fS(1),Nc()),n&2){let e=HE(3);ec(),pg(e.t().exists(e.normalized()))}}function Yn(n,t){if(n&1&&(Oi$1(0,`p`,22),fS(1),Nc()),n&2){let e=HE(3);ec(),pg(e.t().hint)}}function Zn(n,t){if(n&1&&(Oi$1(0,`p`,23),fS(1),Nc()),n&2){let e=HE(3);ec(),pg(e.t().running)}}function ei(n,t){if(n&1&&(Oi$1(0,`li`,30),fS(1),Nc()),n&2){let e=t.$implicit;ec(),mg(``,e.source,` → `,e.destination)}}function ti(n,t){if(n&1&&(Oi$1(0,`div`,24)(1,`p`),fS(2),Nc(),Oi$1(3,`ul`,29),kc(4,ei,2,2,`li`,30,Un),Nc()()),n&2){let e=HE(3);ec(2),pg(e.t().mounts),ec(2),Tc(e.mounts())}}function ni(n,t){n&1&&(Oi$1(0,`p`,25),fS(1),Nc()),n&2&&(ec(),pg(t))}function ii(n,t){if(n&1){let e=$E();Oi$1(0,`form`,16),Jm(`submit`,function(l){Ld(e);return Od(HE(2).submit(l))}),Oi$1(1,`label`,17)(2,`span`,18),fS(3),Nc(),Oi$1(4,`input`,19),Jm(`input`,function(l){Ld(e);return Od(HE(2).target.set(l.target.value))}),Nc()(),SE(5,Qn,2,1,`p`,20)(6,Xn,2,1,`p`,21)(7,Yn,2,1,`p`,22),SE(8,Zn,2,1,`p`,23),SE(9,ti,6,1,`div`,24),SE(10,ni,2,1,`p`,25),Oi$1(11,`div`,26)(12,`button`,10),Gm(13,`app-icon`,11),fS(14),Nc(),Oi$1(15,`button`,27),Gm(16,`app-icon`,28),fS(17),Nc()()()}if(n&2){let e,i=HE(2);ec(3),pg(i.t().label),ec(),nS(i.field+` mt-1.5`),Wm(`value`,i.target()),ec(),kE(i.invalid()?5:i.exists()?6:7),ec(3),kE(i.running()?8:-1),ec(),kE(i.mounts().length>0?9:-1),ec(),kE((e=i.problem())?10:-1,e),ec(3),Wm(`size`,14),ec(),Ac(` `,i.common().close,` `),ec(),Wm(`disabled`,!i.canSave()),ec(),Wm(`size`,14),ec(),Ac(` `,i.saving()?i.t().saving:i.t().save,` `)}}function ai(n,t){if(n&1&&(Gm(0,`div`,2),Oi$1(1,`div`,3)(2,`div`,4)(3,`h2`,5),fS(4),Nc(),Oi$1(5,`p`,6),fS(6),Nc(),SE(7,Kn,12,7)(8,ii,18,13,`form`,7),Nc()()),n&2){let e,i=HE();ec(4),pg(i.t().title),ec(2),pg(i.t().description),ec(),kE((e=i.saved())?7:8,e)}}var Un;var oi;var Se;var Rt=f(()=>{Kr();ra$1();Je();z();lk();P();sk();dk();f$1();Kr();Un=(n,t)=>t.destination;oi=`mx-focus w-full rounded-md border border-ink-700 bg-ink-800 px-2.5 py-1.5 font-mono text-[13px] text-ink-100 placeholder:text-ink-500`,Se=class n{open=mj(!1);containerId=jc.required();containerName=jc.required();image=jc.required();running=jc(!1);mounts=jc([]);images=C(h$1);router=C(fe);toast=C(u);t=Ot$1(()=>ok().containers.commit);common=Ot$1(()=>ok().common);field=oi;target=wt(``);saving=wt(!1);problem=wt(null);saved=wt(null);wanted=Ot$1(()=>this.target().trim());invalid=Ot$1(()=>this.wanted()!==``&&!d$1(this.wanted()));normalized=Ot$1(()=>{let{repository:t,tag:e}=r(this.wanted());return`${t}:${e}`});exists=Ot$1(()=>this.images.images().some(t=>t.reference===this.normalized()));canSave=Ot$1(()=>!this.saving()&&d$1(this.wanted()));constructor(){rf(()=>{if(!this.open())return;let t=O(this.image(),this.containerName(),this.t().suffix);Tg(()=>{this.target.set(t),this.problem.set(null),this.saved.set(null),this.images.images().length===0&&this.images.refresh()})})}async submit(t){if(t.preventDefault(),!!this.canSave()){this.saving.set(!0),this.problem.set(null);try{let e=await window.electron.containers.commit(this.containerId(),this.wanted());e.ok?(this.saved.set({reference:e.reference,imageId:e.imageId}),this.toast.success(this.t().saved(e.reference,e.imageId)),this.images.refresh()):this.problem.set(e.problem)}catch(e){this.problem.set(eH(e))}finally{this.saving.set(!1)}}}goTo(t,e){this.open.set(!1),this.router.navigate([`/images`],{queryParams:{[t]:e}})}static ɵfac=function(e){return new(e||n)};static ɵcmp=wc({type:n,selectors:[[`app-commit-dialog`]],inputs:{open:[1,`open`],containerId:[1,`containerId`],containerName:[1,`containerName`],image:[1,`image`],running:[1,`running`],mounts:[1,`mounts`]},outputs:{open:`openChange`},decls:2,vars:1,consts:[[`rdxDialogRoot`,``,3,`openChange`,`open`],[`rdxDialogPortal`,``],[`rdxDialogBackdrop`,``,1,`fixed`,`inset-0`,`z-40`,`bg-black/50`],[`rdxDialogViewport`,``,1,`fixed`,`inset-0`,`z-50`,`grid`,`place-items-center`,`p-4`],[`rdxDialogPopup`,``,`data-testid`,`commit-dialog`,1,`w-full`,`max-w-md`,`rounded-lg`,`border`,`border-ink-700`,`bg-ink-850`,`p-5`,`shadow-2xl`],[`rdxDialogTitle`,``,1,`text-[15px]`,`font-semibold`,`text-ink-100`],[`rdxDialogDescription`,``,1,`mt-1`,`text-[13px]`,`text-ink-400`],[1,`mt-4`],[`data-testid`,`commit-saved`,1,`mt-4`,`rounded-md`,`border`,`border-accent/40`,`bg-accent/10`,`px-3`,`py-2`,`text-[13px]`,`text-ink-100`],[1,`mt-5`,`flex`,`flex-wrap`,`items-center`,`justify-end`,`gap-2`],[`type`,`button`,`rdxDialogClose`,``,1,`mx-btn`,`mx-focus`],[`name`,`close`,3,`size`],[`type`,`button`,`data-testid`,`commit-to-image`,1,`mx-btn`,`mx-focus`,3,`click`],[`name`,`images`,3,`size`],[`type`,`button`,`data-testid`,`commit-run`,1,`mx-btn`,`mx-focus`,`border-accent`,`text-accent`,3,`click`],[`name`,`play`,3,`size`],[1,`mt-4`,3,`submit`],[1,`block`],[1,`text-[13px]`,`font-medium`,`text-ink-200`],[`type`,`text`,`spellcheck`,`false`,`autocomplete`,`off`,`data-testid`,`commit-name`,3,`input`,`value`],[`data-testid`,`commit-invalid`,1,`mt-2`,`text-[12px]`,`text-danger`],[`data-testid`,`commit-exists`,1,`mt-2`,`text-[12px]`,`text-warn`],[1,`mt-1.5`,`text-[12px]`,`text-ink-500`],[1,`mt-3`,`text-[12px]`,`text-ink-500`],[`data-testid`,`commit-mounts`,1,`mt-3`,`rounded-md`,`border`,`border-warn/40`,`bg-warn/10`,`px-3`,`py-2`,`text-[12px]`,`text-ink-200`],[`role`,`alert`,1,`mt-3`,`rounded-md`,`border`,`border-danger/40`,`bg-danger/10`,`px-3`,`py-2`,`text-[13px]`,`text-danger`],[1,`mt-5`,`flex`,`items-center`,`justify-end`,`gap-2`],[`type`,`submit`,`data-testid`,`commit-save`,1,`mx-btn`,`mx-focus`,`border-accent`,`text-accent`,3,`disabled`],[`name`,`check`,3,`size`],[1,`mt-1.5`,`space-y-0.5`,`font-mono`,`text-[11px]`,`text-ink-300`],[1,`truncate`]],template:function(e,i){e&1&&(Oi$1(0,`div`,0),vg(`openChange`,function(c){return vS(i.open,c)||(i.open=c),c}),_m(1,ai,9,3,`ng-template`,1),Nc()),e&2&&hg(`open`,i.open)},dependencies:[ie,ln,an,pn$1,cn,fn$1,dn,un$1,My],encapsulation:2})}});function ri(n,t){if(n&1){let e=$E();Oi$1(0,`button`,18),Jm(`click`,function(){let l=Ld(e).$implicit;return Od(HE(2).format.set(l))}),fS(1),Nc()}if(n&2){let e=t.$implicit,i=HE(2);nS(i.format()===e?`bg-ink-700 text-ink-100`:`text-ink-400 hover:text-ink-200`),Br(`aria-pressed`,i.format()===e)(`data-testid`,`run-command-format-`+e),ec(),Ac(` `,e===`run`?i.t().formatRun:i.t().formatCompose,` `)}}function li(n,t){if(n&1&&(Oi$1(0,`p`,9),fS(1),Nc()),n&2){let e=HE(2);ec(),Ac(` `,e.t().composeNote(t),` `)}}function si(n,t){if(n&1&&(Oi$1(0,`pre`,19),fS(1),Nc(),Oi$1(2,`p`,20),fS(3),Nc()),n&2){let e=HE(2);ec(),pg(e.command()),ec(2),pg(e.envText())}}function di(n,t){if(n&1&&(Oi$1(0,`p`,10),fS(1),Nc()),n&2){let e=HE(2);ec(),Ac(` `,e.problem(),` `)}}function ci(n,t){if(n&1&&(Oi$1(0,`p`,11),fS(1),Nc()),n&2){let e=HE(2);ec(),pg(e.t().building)}}function mi(n,t){n&1&&(Oi$1(0,`span`,13),fS(1),Nc()),n&2&&(ec(),pg(t))}function pi(n,t){if(n&1){let e=$E();Gm(0,`div`,2),Oi$1(1,`div`,3)(2,`div`,4)(3,`h2`,5),fS(4),Nc(),Oi$1(5,`p`,6),fS(6),Nc(),Oi$1(7,`div`,7),kc(8,ri,2,5,`button`,8,Sc),Nc(),SE(10,li,2,1,`p`,9),SE(11,si,4,2)(12,di,2,1,`p`,10)(13,ci,2,1,`p`,11),Oi$1(14,`div`,12),SE(15,mi,2,1,`span`,13),Oi$1(16,`button`,14),Gm(17,`app-icon`,15),fS(18),Nc(),Oi$1(19,`button`,16),Jm(`click`,function(){Ld(e);return Od(HE().copy())}),Gm(20,`app-icon`,17),fS(21),Nc()()()()}if(n&2){let e,i,l,c=HE();ec(4),pg(c.format()===`compose`?c.t().composeTitle:c.t().title),ec(2),pg(c.format()===`compose`?c.t().composeDescription:c.t().description),ec(2),Tc(c.formats),ec(2),kE((e=c.composeProject())?10:-1,e),ec(),kE((i=c.result()?.ok)===!0?11:i===!1?12:13),ec(4),kE((l=c.copyProblem())?15:-1,l),ec(2),Wm(`size`,14),ec(),Ac(` `,c.common().close,` `),ec(),Wm(`disabled`,c.result()?.ok!==!0),ec(),Wm(`name`,c.copied()?`check`:`copy`)(`size`,14),ec(),Ac(` `,c.copied()?c.common().copied:c.common().copy,` `)}}var Ie;var Ft=f(()=>{Kr();Je();lk();dk();sk();Kr();Ie=class n{open=mj(!1);containerId=jc.required();composeProject=jc(null);format=mj(`run`);formats=[`run`,`compose`];t=Ot$1(()=>ok().containers.runCommand);common=Ot$1(()=>ok().common);result=wt(null);copied=wt(!1);copyProblem=wt(null);constructor(){rf(()=>{if(!this.open())return;let t=this.containerId();Tg(()=>{this.load(t)})})}command(){let t=this.result();return t?.ok!==!0?``:this.format()===`compose`?t.compose:t.command}problem(){let t=this.result();return t?.ok===!1?t.problem:``}envText(){let t=this.result(),e=t?.ok===!0?t.envCount:0;return e===0?this.t().noEnv:this.format()===`compose`?this.t().composeEnvWarning(e):this.t().envWarning(e)}async copy(){if(this.result()?.ok===!0)try{await navigator.clipboard.writeText(this.command()),this.copyProblem.set(null),this.copied.set(!0),setTimeout(()=>this.copied.set(!1),1500)}catch(e){this.copyProblem.set(this.t().copyFailed(eH(e)))}}async load(t){this.result.set(null),this.copied.set(!1),this.copyProblem.set(null);try{this.result.set(await window.electron.containers.runCommand(t))}catch(e){this.result.set({ok:!1,problem:eH(e)})}}static ɵfac=function(e){return new(e||n)};static ɵcmp=wc({type:n,selectors:[[`app-run-command-dialog`]],inputs:{open:[1,`open`],containerId:[1,`containerId`],composeProject:[1,`composeProject`],format:[1,`format`]},outputs:{open:`openChange`,format:`formatChange`},decls:2,vars:1,consts:[[`rdxDialogRoot`,``,3,`openChange`,`open`],[`rdxDialogPortal`,``],[`rdxDialogBackdrop`,``,1,`fixed`,`inset-0`,`z-40`,`bg-black/50`],[`rdxDialogViewport`,``,1,`fixed`,`inset-0`,`z-50`,`grid`,`place-items-center`,`p-4`],[`rdxDialogPopup`,``,`data-testid`,`run-command-dialog`,1,`flex`,`max-h-[85vh]`,`w-full`,`max-w-3xl`,`flex-col`,`rounded-lg`,`border`,`border-ink-700`,`bg-ink-850`,`p-5`,`shadow-2xl`],[`rdxDialogTitle`,``,1,`text-[15px]`,`font-semibold`,`text-ink-100`],[`rdxDialogDescription`,``,1,`mt-1`,`text-[13px]`,`text-ink-400`],[`role`,`group`,1,`mt-3`,`inline-flex`,`self-start`,`rounded-md`,`border`,`border-ink-700`,`p-0.5`,`text-[12px]`],[`type`,`button`,1,`mx-focus`,`rounded`,`px-2.5`,`py-1`,3,`class`],[1,`mt-3`,`rounded-md`,`border`,`border-ink-700`,`bg-ink-900`,`px-3`,`py-2`,`text-[12px]`,`text-ink-400`],[1,`mt-4`,`rounded-md`,`border`,`border-danger/40`,`bg-danger/10`,`px-3`,`py-2`,`text-[13px]`,`text-danger`],[1,`mt-4`,`text-[13px]`,`text-ink-400`],[1,`mt-4`,`flex`,`items-center`,`justify-end`,`gap-2`],[1,`mr-auto`,`text-[12px]`,`text-danger`],[`type`,`button`,`rdxDialogClose`,``,1,`mx-btn`,`mx-focus`],[`name`,`close`,3,`size`],[`type`,`button`,`data-testid`,`run-command-copy`,1,`mx-btn`,`mx-focus`,3,`click`,`disabled`],[3,`name`,`size`],[`type`,`button`,1,`mx-focus`,`rounded`,`px-2.5`,`py-1`,3,`click`],[`data-testid`,`run-command-text`,1,`mt-4`,`min-h-0`,`flex-1`,`overflow-auto`,`rounded-md`,`border`,`border-ink-700`,`bg-ink-900`,`p-3`,`font-mono`,`text-[12px]`,`leading-relaxed`,`break-all`,`whitespace-pre-wrap`,`text-ink-200`],[`data-testid`,`run-command-env`,1,`mt-2`,`text-[12px]`,`text-ink-500`]],template:function(e,i){e&1&&(Oi$1(0,`div`,0),vg(`openChange`,function(c){return vS(i.open,c)||(i.open=c),c}),_m(1,pi,22,11,`ng-template`,1),Nc()),e&2&&hg(`open`,i.open)},dependencies:[ie,ln,an,pn$1,cn,fn$1,dn,un$1,My],encapsulation:2})}});function xi(n,t){if(n&1){let e=$E();Oi$1(0,`button`,10),Jm(`click`,function(){Ld(e);let l=HE().$implicit;return Od(HE().toggle(l.path))}),Gm(1,`app-icon`,11),Nc()}if(n&2){let e=HE().$implicit,i=HE();Br(`aria-expanded`,i.isOpen(e.path))(`aria-label`,i.isOpen(e.path)?i.t().collapse(e.key):i.t().expand(e.key)),ec(),Wm(`name`,i.isOpen(e.path)?`chevronDown`:`chevronRight`)(`size`,12)}}function gi(n,t){n&1&&Gm(0,`span`,5)}function _i(n,t){if(n&1&&(Oi$1(0,`span`,8),fS(1),Nc()),n&2){let e=HE().$implicit;ec(),pg(e.preview)}}function yi(n,t){if(n&1&&(Oi$1(0,`span`,9),fS(1),Nc()),n&2){let e=HE().$implicit;ec(),pg(e.preview)}}function fi(n,t){if(n&1&&(Oi$1(0,`div`,3),SE(1,xi,2,4,`button`,4)(2,gi,1,0,`span`,5),Oi$1(3,`span`,6),fS(4),Nc(),Oi$1(5,`span`,7),fS(6,`:`),Nc(),SE(7,_i,2,1,`span`,8)(8,yi,2,1,`span`,9),Nc()),n&2){let e=t.$implicit;sg(`padding-left`,e.depth*14+4,`px`),ec(),kE(e.hasChildren?1:2),ec(3),pg(e.key),ec(3),kE(e.kind===`value`?7:8)}}function vi(n,t){if(n&1&&(Oi$1(0,`p`,2),fS(1),Nc()),n&2){let e=HE();ec(),pg(e.t().empty)}}function We(n){return Array.isArray(n)?n.map((t,e)=>[String(e),t]):n!==null&&typeof n==`object`?Object.entries(n):[]}function bi(n){return Array.isArray(n)?`array`:n!==null&&typeof n==`object`?`object`:`value`}function hi(n,t){if(t===`array`){let e=n.length;return e===0?`[]`:`[${String(e)}]`}if(t===`object`){let e=Object.keys(n).length;return e===0?`{}`:`{${String(e)}}`}return JSON.stringify(n)??`null`}function Ci(n,t){let e=[];function i(l,c,D,je){let Ae=bi(c),Le=We(c);if(e.push({path:D,key:l,depth:je,kind:Ae,preview:hi(c,Ae),hasChildren:Le.length>0}),!(Le.length===0||!t.has(D)))for(let[He,Kt]of Le)i(He,Kt,`${D}.${He}`,je+1)}for(let[l,c]of We(n))i(l,c,l,0);return e}function wi(n){return new Set(We(n).map(([t])=>t))}var ui;var Ee;var zt=f(()=>{Kr();dk();sk();Kr();ui=(n,t)=>t.path;Ee=class n{value=jc.required();t=Ot$1(()=>ok().shell.jsonView);overrides=wt(new Map);defaults=Ot$1(()=>wi(this.value()));rows=Ot$1(()=>Ci(this.value(),this.openPaths()));openPaths=Ot$1(()=>{let t=new Set(this.defaults());for(let[e,i]of this.overrides())i?t.add(e):t.delete(e);return t});isOpen(t){return this.openPaths().has(t)}toggle(t){let e=new Map(this.overrides());e.set(t,!this.isOpen(t)),this.overrides.set(e)}static ɵfac=function(e){return new(e||n)};static ɵcmp=wc({type:n,selectors:[[`app-json-view`]],inputs:{value:[1,`value`]},decls:4,vars:1,consts:[[1,`font-mono`,`text-[12px]`,`leading-[1.7]`],[`data-testid`,`json-row`,1,`flex`,`gap-1.5`,`rounded-sm`,`px-1`,`hover:bg-ink-850`,3,`padding-left`],[1,`text-ink-400`],[`data-testid`,`json-row`,1,`flex`,`gap-1.5`,`rounded-sm`,`px-1`,`hover:bg-ink-850`],[`type`,`button`,1,`mx-focus`,`w-3`,`shrink-0`,`cursor-pointer`,`text-ink-500`,`hover:text-ink-100`],[1,`w-3`,`shrink-0`],[1,`shrink-0`,`text-accent`],[1,`text-ink-600`],[1,`break-all`,`text-ink-200`],[1,`text-ink-500`],[`type`,`button`,1,`mx-focus`,`w-3`,`shrink-0`,`cursor-pointer`,`text-ink-500`,`hover:text-ink-100`,3,`click`],[3,`name`,`size`]],template:function(e,i){e&1&&(Oi$1(0,`div`,0),kc(1,fi,9,5,`div`,1,ui,!1,vi,2,1,`p`,2),Nc()),e&2&&(ec(),Tc(i.rows()))},dependencies:[My],encapsulation:2})}});var Ot;var Di;var me;var Bt=f(()=>{Kr();lk();Kr();Ot=2e3,Di=500,me=class n{buffer=wt([]);busy=wt(!1);failure=wt(null);dropped=wt(!1);streamId=null;unsubscribe=null;disposed=!1;lines=this.buffer.asReadonly();loading=this.busy.asReadonly();problem=this.failure.asReadonly();truncated=this.dropped.asReadonly();constructor(){C(ve).onDestroy(()=>this.close())}async open(t,e=Di){this.close(),this.disposed=!1,this.busy.set(!0),this.buffer.set([]),this.dropped.set(!1);try{let i=await window.electron.logs.open(t,e);if(this.disposed){window.electron.logs.close(i);return}this.streamId=i,this.unsubscribe=window.electron.logs.onLines(i,l=>this.append(l)),this.failure.set(null)}catch(i){this.failure.set(eH(i))}finally{this.busy.set(!1)}}close(){this.disposed=!0,this.unsubscribe?.(),this.unsubscribe=null,this.streamId!==null&&(window.electron.logs.close(this.streamId),this.streamId=null)}clear(){this.buffer.set([]),this.dropped.set(!1)}append(t){let e=[...this.buffer(),...t];if(e.length>Ot){this.dropped.set(!0),this.buffer.set(e.slice(e.length-Ot));return}this.buffer.set(e)}static ɵfac=function(e){return new(e||n)};static ɵprov=X({token:n,factory:n.ɵfac})}});function Si(n,t){if(n&1&&fS(0),n&2)Ac(` `,HE().t().connecting,` `)}function Ii(n,t){if(n&1&&(Oi$1(0,`span`,21),fS(1),Nc()),n&2){let e=HE(2);ec(),Ac(` · `,e.t().truncated)}}function Ei(n,t){if(n&1&&(fS(0),SE(1,Ii,2,1,`span`,21)),n&2){let e=HE();Ac(` `,e.t().count(e.visible().length,e.session.lines().length),` `),ec(),kE(e.session.truncated()?1:-1)}}function Ti(n,t){n&1&&(Oi$1(0,`p`,17),fS(1),Nc()),n&2&&(ec(),Ac(` `,t,` `))}function Mi(n,t){if(n&1&&(Oi$1(0,`span`,23),fS(1),Nc()),n&2){let e=HE().$implicit;ec(),pg(e.line.timestamp)}}function Vi(n,t){if(n&1&&(Oi$1(0,`div`,22),SE(1,Mi,2,1,`span`,23),Oi$1(2,`span`,24),fS(3),Nc()()),n&2){let e=t.$implicit,i=HE();ag(`text-danger`,e.line.stream===`stderr`&&e.level===null),ec(),kE(i.showTimestamps()&&e.line.timestamp?1:-1),ec(),nS(i.colorOf(e)),ec(),pg(e.line.text)}}function Ni(n,t){if(n&1&&(Oi$1(0,`p`,20),fS(1),Nc()),n&2){let e=HE();ec(),Ac(` `,e.session.loading()?``:e.filter()===``&&e.levels().size===0?e.t().empty:e.t().noMatches,` `)}}var ki;var Te;var Wt=f(()=>{Kr();V$1();Bt();M();dk();$();f$1();sk();Kr();ki=[`scroller`];Te=class n{containerId=jc.required();name=jc(``);session=C(me);preferences=C(p);t=Ot$1(()=>ok().containers.logs);common=Ot$1(()=>ok().common);filter=wt(``);follow=this.preferences.flag(`logs.follow`,!0);showTimestamps=this.preferences.flag(`logs.showTimestamps`);copied=wt(!1);saving=wt(!1);toast=C(u);scroller=gj(`scroller`);levels=wt(new Set);leveled=Ot$1(()=>this.session.lines().map(t=>({line:t,level:B(t.text)})));matching=Ot$1(()=>{let t=this.filter().trim().toLowerCase();return t===``?this.leveled():this.leveled().filter(e=>e.line.text.toLowerCase().includes(t))});counts=Ot$1(()=>U(this.matching().map(t=>t.level)));visible=Ot$1(()=>{let t=this.levels();return t.size===0?this.matching():this.matching().filter(e=>H(e.level,t))});constructor(){rf(()=>{this.session.open(this.containerId())}),rf(()=>{let t=this.visible(),e=this.scroller()?.nativeElement;!this.follow()||e===void 0||t.length===0||queueMicrotask(()=>{e.scrollTop=e.scrollHeight})})}colorOf(t){return t.level!==null?G$1[t.level]:t.line.stream===`stdout`?`text-ink-200`:``}async save(){this.saving.set(!0);try{let t=await window.electron.containers.saveLogs(this.containerId(),this.name()||this.containerId().slice(0,12));t.ok?this.toast.success(this.t().saved(t.lines,t.path)):t.canceled||this.toast.error(t.problem)}finally{this.saving.set(!1)}}async copy(){let t=this.visible().map(({line:e})=>this.showTimestamps()&&e.timestamp!==null?`${e.timestamp} ${e.text}`:e.text).join(`
|
|
3
|
+
`);try{await navigator.clipboard.writeText(t),this.copied.set(!0),setTimeout(()=>this.copied.set(!1),1500)}catch{}}static ɵfac=function(e){return new(e||n)};static ɵcmp=wc({type:n,selectors:[[`app-logs-view`]],viewQuery:function(e,i){e&1&&rg(i.scroller,ki,5),e&2&&zE()},inputs:{containerId:[1,`containerId`],name:[1,`name`]},features:[IS([me])],decls:33,vars:33,consts:[[`scroller`,``],[1,`flex`,`h-full`,`flex-col`],[1,`flex`,`flex-wrap`,`items-center`,`gap-3`,`border-b`,`border-ink-700`,`px-4`,`py-2`],[1,`relative`,`flex`,`items-center`],[1,`pointer-events-none`,`absolute`,`left-2.5`,`text-ink-500`],[`name`,`search`,3,`size`],[1,`sr-only`],[`type`,`search`,1,`mx-focus`,`w-64`,`rounded-md`,`border`,`border-ink-700`,`bg-ink-850`,`py-1`,`pr-3`,`pl-8`,`text-[12px]`,`text-ink-100`,`placeholder:text-ink-500`,3,`input`,`placeholder`,`value`],[3,`chosenChange`,`chosen`,`errors`,`warnings`],[`type`,`button`,1,`mx-btn`,`mx-focus`,3,`click`],[`name`,`play`,3,`size`],[`name`,`clock`,3,`size`],[3,`name`,`size`],[`type`,`button`,`data-testid`,`logs-save`,1,`mx-btn`,`mx-focus`,3,`click`,`title`,`disabled`],[`name`,`download`,3,`size`],[`name`,`eraser`,3,`size`],[1,`ml-auto`,`text-[12px]`,`text-ink-500`],[1,`m-4`,`rounded-md`,`border`,`border-danger/40`,`bg-danger/10`,`px-3`,`py-2`,`text-[13px]`,`text-danger`],[`data-testid`,`log-pane`,1,`min-h-0`,`flex-1`,`overflow-auto`,`bg-ink-950`,`px-4`,`py-2`,`font-mono`,`text-[12px]`,`leading-[1.6]`],[`data-testid`,`log-line`,1,`flex`,`gap-2`,`whitespace-pre-wrap`,3,`text-danger`],[1,`text-ink-500`],[1,`text-warn`],[`data-testid`,`log-line`,1,`flex`,`gap-2`,`whitespace-pre-wrap`],[1,`shrink-0`,`text-ink-500`],[1,`break-all`]],template:function(e,i){if(e&1){let l=$E();Oi$1(0,`div`,1)(1,`div`,2)(2,`label`,3)(3,`span`,4),Gm(4,`app-icon`,5),Nc(),Oi$1(5,`span`,6),fS(6),Nc(),Oi$1(7,`input`,7),Jm(`input`,function(D){return i.filter.set(D.target.value)}),Nc()(),Oi$1(8,`app-level-filter`,8),vg(`chosenChange`,function(D){return Ld(l),vS(i.levels,D)||(i.levels=D),Od(D)}),Nc(),Oi$1(9,`button`,9),Jm(`click`,function(){return i.follow.set(!i.follow())}),Gm(10,`app-icon`,10),fS(11),Nc(),Oi$1(12,`button`,9),Jm(`click`,function(){return i.showTimestamps.set(!i.showTimestamps())}),Gm(13,`app-icon`,11),fS(14),Nc(),Oi$1(15,`button`,9),Jm(`click`,function(){return i.copy()}),Gm(16,`app-icon`,12),fS(17),Nc(),Oi$1(18,`button`,13),Jm(`click`,function(){return i.save()}),Gm(19,`app-icon`,14),fS(20),Nc(),Oi$1(21,`button`,9),Jm(`click`,function(){return i.session.clear()}),Gm(22,`app-icon`,15),fS(23),Nc(),Oi$1(24,`span`,16),SE(25,Si,1,1)(26,Ei,2,2),Nc()(),SE(27,Ti,2,1,`p`,17),Oi$1(28,`div`,18,0),kc(30,Vi,4,6,`div`,19,TE,!1,Ni,2,1,`p`,20),Nc()()}if(e&2){let l;ec(4),Wm(`size`,14),ec(2),pg(i.t().filter),ec(),Wm(`placeholder`,i.t().filter)(`value`,i.filter()),ec(),hg(`chosen`,i.levels),Wm(`errors`,i.counts().error)(`warnings`,i.counts().warn),ec(),ag(`border-accent`,i.follow())(`text-accent`,i.follow()),Br(`aria-pressed`,i.follow()),ec(),Wm(`size`,14),ec(),Ac(` `,i.t().follow,` `),ec(),ag(`border-accent`,i.showTimestamps())(`text-accent`,i.showTimestamps()),Br(`aria-pressed`,i.showTimestamps()),ec(),Wm(`size`,14),ec(),Ac(` `,i.t().timestamps,` `),ec(2),Wm(`name`,i.copied()?`check`:`copy`)(`size`,14),ec(),Ac(` `,i.copied()?i.common().copied:i.common().copy,` `),ec(),Wm(`title`,i.t().saveHint)(`disabled`,i.saving()),ec(),Wm(`size`,14),ec(),Ac(` `,i.t().save,` `),ec(2),Wm(`size`,14),ec(),Ac(` `,i.t().clear,` `),ec(2),kE(i.session.loading()?25:26),ec(2),kE((l=i.session.problem())?27:-1,l),ec(3),Tc(i.visible())}},dependencies:[My,T],encapsulation:2})}});function Li(n,t){if(n&1){let e=$E();Oi$1(0,`button`,7),Jm(`click`,function(){Ld(e);let l=HE();return Od(l.go(l.parentOf(l.path())))}),Gm(1,`app-icon`,14),Nc()}if(n&2){let e=HE();Wm(`disabled`,e.path()===`/`||e.busy()),Br(`aria-label`,e.t().up),ec(),Wm(`size`,14)}}function Ri(n,t){if(n&1&&(Oi$1(0,`p`,3),fS(1),Nc()),n&2){let e=HE();ec(),mg(` `,e.t().changesTitle,` · `,e.t().changesCount(e.changes().length),` `)}}function Fi(n,t){if(n&1&&(Oi$1(0,`span`,15),fS(1),Nc()),n&2){let e=HE().$implicit;ec(),pg(e.label)}}function zi(n,t){n&1&&(Oi$1(0,`span`,17),fS(1,`/`),Nc())}function Oi(n,t){if(n&1){let e=$E();Oi$1(0,`button`,16),Jm(`click`,function(){Ld(e);let l=HE().$implicit;return Od(HE(2).go(l.path))}),fS(1),Nc(),SE(2,zi,2,0,`span`,17)}if(n&2){let e=HE().$implicit;ec(),Ac(` `,e.label,` `),ec(),kE(e.path!==`/`?2:-1)}}function Bi(n,t){if(n&1&&SE(0,Fi,2,1,`span`,15)(1,Oi,3,2),n&2){let e=t.$index,i=t.$count;kE(e===i-1?0:1)}}function Wi(n,t){if(n&1&&(Oi$1(0,`nav`,4),kc(1,Bi,2,1,null,null,jt),Nc()),n&2){let e=HE();Br(`aria-label`,e.t().path),ec(),Tc(e.crumbs())}}function ji(n,t){if(n&1){let e=$E();Oi$1(0,`button`,7),Jm(`click`,function(){Ld(e);return Od(HE().chooseAndUpload())}),Gm(1,`app-icon`,18),fS(2),Nc()}if(n&2){let e=HE();Wm(`disabled`,e.busy()),ec(),Wm(`size`,14),ec(),Ac(` `,e.t().upload,` `)}}function Ai(n,t){if(n&1){let e=$E();Oi$1(0,`button`,19),Jm(`click`,function(){Ld(e);return Od(HE().saveAsImage.emit())}),Gm(1,`app-icon`,20),fS(2),Nc()}if(n&2){let e=HE();Wm(`disabled`,e.busy()),ec(),Wm(`size`,14),ec(),Ac(` `,e.actions().commit,` `)}}function Hi(n,t){if(n&1&&(Oi$1(0,`p`,21),fS(1),Nc()),n&2){let e=HE(2);ec(),pg(e.t().changesEmpty)}}function $i(n,t){if(n&1){let e=$E();Oi$1(0,`li`,23)(1,`span`,24),fS(2),Nc(),Oi$1(3,`button`,25),Jm(`click`,function(){let l=Ld(e).$implicit;return Od(HE(2).openFolderOf(l))}),fS(4),Nc()()}if(n&2){let e=t.$implicit,i=HE(2);ec(),nS(i.kindTone(e)),ec(),pg(i.t().changeKind[e.kind]),ec(),Br(`aria-label`,i.t().openFolderOf(e.path)),ec(),Ac(` `,e.path,` `)}}function Ji(n,t){if(n&1&&(SE(0,Hi,2,1,`p`,21),Oi$1(1,`ul`,22),kc(2,$i,5,5,`li`,23,jt),Nc()),n&2){let e=HE();kE(e.changes().length===0&&!e.busy()&&e.problem()===null?0:-1),ec(2),Tc(e.changes())}}function qi(n,t){if(n&1&&(Oi$1(0,`p`,21),fS(1),Nc()),n&2){let e=HE(2);ec(),pg(e.t().empty)}}function Gi(n,t){if(n&1){let e=$E();Oi$1(0,`button`,33),Jm(`click`,function(){Ld(e);let l=HE().$implicit,c=HE(2);return Od(c.go(c.childOf(l)))}),fS(1),Nc()}if(n&2){let e=HE().$implicit;ec(),Ac(` `,e.name,` `)}}function Ui(n,t){if(n&1&&(Oi$1(0,`span`,30),fS(1),Nc()),n&2){let e=HE().$implicit;ec(),pg(e.name)}}function Ki(n,t){if(n&1){let e=$E();Oi$1(0,`li`,27),Gm(1,`app-icon`,28),SE(2,Gi,2,1,`button`,29)(3,Ui,2,1,`span`,30),Oi$1(4,`button`,31),Jm(`click`,function(){let l=Ld(e).$implicit;return Od(HE(2).download(l))}),Gm(5,`app-icon`,32),Nc()()}if(n&2){let e=t.$implicit,i=HE(2);ec(),ag(`text-accent`,e.kind===`dir`)(`text-ink-500`,e.kind===`file`),Wm(`name`,e.kind===`dir`?`folder`:`file`)(`size`,15),ec(),kE(e.kind===`dir`?2:3),ec(2),Wm(`disabled`,i.busy()),Br(`aria-label`,e.kind===`dir`?i.t().downloadFolder(e.name):i.t().downloadFile(e.name)),ec(),Wm(`size`,14)}}function Qi(n,t){if(n&1&&(SE(0,qi,2,1,`p`,21),Oi$1(1,`ul`,26),kc(2,Ki,6,10,`li`,27,Pi),Nc()),n&2){let e=HE();kE(e.entries().length===0&&!e.busy()&&e.problem()===null?0:-1),ec(2),Tc(e.entries())}}function Xi(n,t){return n.endsWith(`/`)?`${n}${t}`:`${n}/${t}`}var jt;var Pi;var Me;var At=f(()=>{Kr();lk();dk();x$1();f$1();sk();Kr();jt=(n,t)=>t.path,Pi=(n,t)=>t.name;Me=class n{containerId=jc.required();active=jc(!0);saveAsImage=pj();toast=C(u);t=Ot$1(()=>ok().containers.files);actions=Ot$1(()=>ok().containers.actions);path=wt(`/`);entries=wt([]);busy=wt(!1);problem=wt(null);dragging=wt(!1);changed=wt(!1);changes=wt([]);loaded=!1;crumbs=Ot$1(()=>{let t=this.path().split(`/`).filter(e=>e!==``);return[{label:`/`,path:`/`},...t.map((e,i)=>({label:e,path:`/${t.slice(0,i+1).join(`/`)}`}))]});constructor(){rf(()=>{this.active()&&!this.loaded&&(this.loaded=!0,Tg(()=>{this.load()}))})}async load(){if(this.changed()){await this.loadChanges();return}this.busy.set(!0);try{let t=await window.electron.files.list(this.containerId(),this.path());this.path.set(t.path),t.ok?(this.entries.set(t.entries),this.problem.set(null)):(this.entries.set([]),this.problem.set(t.problem))}catch(t){this.problem.set(eH(t))}finally{this.busy.set(!1)}}openFolderOf(t){this.changed.set(!1),this.go(this.parentOf(t.path))}toggleChanged(){this.changed.update(t=>!t),this.load()}kindTone(t){return t.kind===`added`?`text-ok`:t.kind===`deleted`?`text-danger`:`text-warn`}go(t){this.path.set(t),this.load()}async loadChanges(){this.busy.set(!0);try{let t=await window.electron.files.changes(this.containerId());t.ok?(this.changes.set(t.changes),this.problem.set(null)):(this.changes.set([]),this.problem.set(t.problem))}catch(t){this.problem.set(eH(t))}finally{this.busy.set(!1)}}parentOf(t){return`/${t.split(`/`).filter(i=>i!==``).slice(0,-1).join(`/`)}`}childOf(t){return Xi(this.path(),t.name)}async download(t){try{let e=await window.electron.files.download(this.containerId(),this.childOf(t),t.kind);e.ok?e.savedTo!==null&&this.toast.success(this.t().savedAs(e.savedTo)):this.toast.error(e.problem)}catch(e){this.toast.error(eH(e))}}async chooseAndUpload(){await this.afterUpload(window.electron.files.chooseAndUpload(this.containerId(),this.path()))}onDragOver(t){t.preventDefault(),this.dragging.set(!0)}async onDrop(t){t.preventDefault(),this.dragging.set(!1);let e=[...t.dataTransfer?.files??[]];e.length>0&&await this.afterUpload(window.electron.files.upload(this.containerId(),this.path(),e))}async afterUpload(t){this.busy.set(!0);try{let e=await t;if(!e.ok){this.toast.error(e.problem);return}e.count>0&&this.toast.success(this.t().uploaded(e.count,this.path()))}catch(e){this.toast.error(eH(e))}finally{this.busy.set(!1)}await this.load()}static ɵfac=function(e){return new(e||n)};static ɵcmp=wc({type:n,selectors:[[`app-files-view`]],hostAttrs:[1,`block`,`h-full`],inputs:{containerId:[1,`containerId`],active:[1,`active`]},outputs:{saveAsImage:`saveAsImage`},decls:20,vars:19,consts:[[1,`flex`,`h-full`,`min-h-0`,`flex-col`,3,`dragover`,`dragleave`,`drop`],[1,`flex`,`shrink-0`,`flex-wrap`,`items-center`,`gap-2`,`border-b`,`border-ink-700`,`px-6`,`py-2.5`],[`type`,`button`,1,`mx-btn`,`mx-focus`,3,`disabled`],[1,`min-w-0`,`flex-1`,`text-[12px]`,`text-ink-400`],[1,`flex`,`min-w-0`,`flex-1`,`flex-wrap`,`items-center`,`font-mono`,`text-[12px]`],[`type`,`button`,`data-testid`,`files-changed`,1,`mx-btn`,`mx-focus`,3,`click`,`disabled`],[`name`,`pencil`,3,`size`],[`type`,`button`,1,`mx-btn`,`mx-focus`,3,`click`,`disabled`],[`name`,`refresh`,3,`size`],[`type`,`button`,`data-testid`,`files-commit`,1,`mx-btn`,`mx-focus`,3,`disabled`],[1,`px-6`],[3,`problem`],[1,`min-h-0`,`flex-1`,`overflow-auto`,`px-6`,`py-3`],[1,`shrink-0`,`border-t`,`border-ink-800`,`px-6`,`py-2`,`text-[11px]`,`text-ink-500`],[`name`,`arrow-up`,3,`size`],[`aria-current`,`location`,1,`text-ink-100`],[`type`,`button`,1,`mx-focus`,`cursor-pointer`,`text-ink-400`,`hover:text-ink-100`,3,`click`],[1,`px-1`,`text-ink-600`],[`name`,`upload`,3,`size`],[`type`,`button`,`data-testid`,`files-commit`,1,`mx-btn`,`mx-focus`,3,`click`,`disabled`],[`name`,`images`,3,`size`],[1,`text-[13px]`,`text-ink-400`],[`data-testid`,`change-list`,1,`divide-y`,`divide-ink-800`,`text-[13px]`],[1,`flex`,`items-center`,`gap-3`,`py-1.5`],[1,`w-24`,`shrink-0`,`text-[11px]`],[`type`,`button`,1,`mx-focus`,`min-w-0`,`flex-1`,`cursor-pointer`,`truncate`,`text-left`,`font-mono`,`text-[12px]`,`text-ink-200`,`hover:underline`,3,`click`],[`data-testid`,`file-list`,1,`divide-y`,`divide-ink-800`,`text-[13px]`],[1,`group`,`flex`,`items-center`,`gap-2`,`py-1.5`],[3,`name`,`size`],[`type`,`button`,1,`mx-focus`,`min-w-0`,`flex-1`,`cursor-pointer`,`truncate`,`text-left`,`text-ink-100`,`hover:underline`],[1,`min-w-0`,`flex-1`,`truncate`,`text-ink-200`],[`type`,`button`,1,`mx-focus`,`cursor-pointer`,`rounded`,`p-1`,`text-ink-500`,`opacity-0`,`group-hover:opacity-100`,`focus:opacity-100`,`hover:text-ink-100`,3,`click`,`disabled`],[`name`,`download`,3,`size`],[`type`,`button`,1,`mx-focus`,`min-w-0`,`flex-1`,`cursor-pointer`,`truncate`,`text-left`,`text-ink-100`,`hover:underline`,3,`click`]],template:function(e,i){e&1&&(Oi$1(0,`section`,0),Jm(`dragover`,function(c){return i.onDragOver(c)})(`dragleave`,function(){return i.dragging.set(!1)})(`drop`,function(c){return i.onDrop(c)}),Oi$1(1,`div`,1),SE(2,Li,2,3,`button`,2),SE(3,Ri,2,2,`p`,3)(4,Wi,3,1,`nav`,4),Oi$1(5,`button`,5),Jm(`click`,function(){return i.toggleChanged()}),Gm(6,`app-icon`,6),fS(7),Nc(),Oi$1(8,`button`,7),Jm(`click`,function(){return i.load()}),Gm(9,`app-icon`,8),fS(10),Nc(),SE(11,ji,3,3,`button`,2)(12,Ai,3,3,`button`,9),Nc(),Oi$1(13,`div`,10),Gm(14,`app-page-messages`,11),Nc(),Oi$1(15,`div`,12),SE(16,Ji,4,1)(17,Qi,4,1),Nc(),Oi$1(18,`p`,13),fS(19),Nc()()),e&2&&(ag(`bg-accent/5`,i.dragging()),ec(2),kE(i.changed()?-1:2),ec(),kE(i.changed()?3:4),ec(2),ag(`border-accent`,i.changed())(`text-accent`,i.changed()),Wm(`disabled`,i.busy()),Br(`aria-pressed`,i.changed()),ec(),Wm(`size`,14),ec(),Ac(` `,i.t().changed,` `),ec(),Wm(`disabled`,i.busy()),ec(),Wm(`size`,14),ec(),Ac(` `,i.t().refresh,` `),ec(),kE(i.changed()?12:11),ec(3),Wm(`problem`,i.problem()),ec(2),kE(i.changed()?16:17),ec(3),Ac(` `,i.changed()?i.t().changesHint:i.t().hint(i.path()),` `))},dependencies:[My,u$2],encapsulation:2})}});function Yi(n,t){if(n&1&&(Oi$1(0,`p`,2),Gm(1,`app-icon`,4),fS(2),Nc()),n&2){let e=HE();ec(),Wm(`size`,14),ec(),Ac(` `,e.t().crashLoop(e.crashes()),` `)}}function Zi(n,t){if(n&1&&(Oi$1(0,`p`,3),fS(1),Nc()),n&2){let e=HE();ec(),pg(e.t().loading)}}function ea(n,t){if(n&1&&(Oi$1(0,`p`,3),fS(1),Nc()),n&2){let e=HE();ec(),pg(e.t().empty)}}function ta(n,t){n&1&&(Oi$1(0,`span`,11),fS(1),Nc()),n&2&&(ec(),Ac(`— `,t))}function na(n,t){if(n&1&&(Oi$1(0,`li`,6)(1,`span`,8),fS(2),Nc(),Gm(3,`app-icon`,9),Oi$1(4,`span`,10),fS(5),SE(6,ta,2,1,`span`,11),Nc()()),n&2){let e,i=t.$implicit,l=HE(2);ec(),Wm(`title`,l.fullTime(i)),ec(),pg(l.when(i)),ec(),Wm(`name`,l.icon(i))(`size`,13),ec(),nS(l.tone(i)),ec(),Ac(` `,l.describe(i),` `),ec(),kE((e=l.hint(i))?6:-1,e)}}function ia(n,t){if(n&1&&(Oi$1(0,`ol`,5),kc(1,na,7,8,`li`,6,TE),Nc(),Oi$1(3,`p`,7),fS(4),Nc()),n&2){let e=HE();ec(),Tc(e.events()),ec(3),pg(e.t().scope)}}function Ht(n){let t=[...n].sort((l,c)=>l.time-c.time),e=new Set,i=-Infinity;for(let l of t)l.action===`kill`?i=l.time:l.action===`die`&&l.time-i<=ra&&e.add(l);return e}function ca(n,t){let e=Ht(n);return n.filter(i=>i.time>=t-aa&&(i.action===`oom`||i.action===`die`&&i.exitCode!==0&&!e.has(i))).length}var aa;var oa;var ra;var la;var sa;var da;var Ve;var $t=f(()=>{Kr();v();dk();sk();Kr();aa=3600*1e3,oa=4,ra=3e4,la={1:`SIGHUP`,2:`SIGINT`,9:`SIGKILL`,15:`SIGTERM`},sa={oom:`text-danger`,start:`text-ok`},da={start:`play`,restart:`refresh`,stop:`stop`,kill:`stop`,die:`stop`,oom:`warning`,health:`pulse`,destroy:`trash`,create:`plus`};Ve=class n{name=jc.required();active=jc(!1);store=C(u$1);t=Ot$1(()=>ok().containers.detail.events);crashLoopAt=oa;events=wt(null);crashes=Ot$1(()=>ca(this.events()??[],Date.now()));stopped=Ot$1(()=>Ht(this.events()??[]));constructor(){rf(()=>{let t=this.name();this.store.containers(),this.active()&&Tg(()=>{this.load(t)})})}when(t){let e=new Date(t.time);return new Date().toDateString()===e.toDateString()?e.toLocaleTimeString():`${e.toLocaleDateString()} ${e.toLocaleTimeString()}`}fullTime(t){return new Date(t.time).toISOString()}icon(t){return da[t.action]??`lines`}tone(t){return t.action===`die`?t.exitCode===0||this.stopped().has(t)?`text-ink-200`:`text-danger`:t.action===`health`?t.health===`unhealthy`?`text-danger`:t.health===`healthy`?`text-ok`:`text-ink-200`:sa[t.action]??`text-ink-200`}describe(t){let e=this.t();switch(t.action){case`die`:return t.exitCode===null?e.exitedUnknown:e.exited(t.exitCode);case`kill`:return e.kill(la[t.signal??``]??t.signal??`?`);case`health`:return t.health===null?e.health.starting:e.health[t.health];case`rename`:return t.oldName===null?e.renamed:e.rename(t.oldName);default:return e[t.action]}}hint(t){return t.action!==`die`||this.stopped().has(t)?null:t.exitCode===137?this.t().exitHint137:t.exitCode===143?this.t().exitHint143:null}async load(t){try{this.events.set(await window.electron.containers.events(t))}catch{this.events.set([])}}static ɵfac=function(e){return new(e||n)};static ɵcmp=wc({type:n,selectors:[[`app-events-view`]],inputs:{name:[1,`name`],active:[1,`active`]},decls:6,vars:2,consts:[[1,`h-full`,`overflow-auto`,`px-6`,`py-5`],[1,`max-w-3xl`],[`role`,`status`,`data-testid`,`events-crash-loop`,1,`mb-4`,`flex`,`items-center`,`gap-2`,`rounded-md`,`border`,`border-danger/40`,`bg-danger/10`,`px-3`,`py-2`,`text-[13px]`,`text-danger`],[1,`text-[13px]`,`text-ink-400`],[`name`,`warning`,3,`size`],[`data-testid`,`events-list`,1,`divide-y`,`divide-ink-800`],[1,`flex`,`items-baseline`,`gap-3`,`py-1.5`,`text-[13px]`],[1,`mt-4`,`text-[12px]`,`text-ink-500`],[1,`w-36`,`shrink-0`,`font-mono`,`text-[12px]`,`text-ink-500`,3,`title`],[1,`shrink-0`,`self-center`,`text-ink-500`,3,`name`,`size`],[1,`min-w-0`,`flex-1`],[1,`ml-1`,`text-[12px]`,`text-ink-500`]],template:function(e,i){e&1&&(Oi$1(0,`div`,0)(1,`section`,1),SE(2,Yi,3,2,`p`,2),SE(3,Zi,2,1,`p`,3)(4,ea,2,1,`p`,3)(5,ia,5,1),Nc()()),e&2&&(ec(2),kE(i.crashes()>=i.crashLoopAt?2:-1),ec(),kE(i.events()===null?3:i.events()?.length===0?4:5))},dependencies:[My],encapsulation:2})}});function ma(n,t){if(n&1&&(Oi$1(0,`span`,4),fS(1),Nc()),n&2){let e=HE();ec(),pg(e.t().failingStreak(e.health().failingStreak))}}function pa(n,t){n&1&&(Oi$1(0,`code`,10),fS(1),Nc()),n&2&&(ec(),pg(t))}function ua(n,t){if(n&1&&(Oi$1(0,`span`,11),fS(1),Nc()),n&2){let e=HE();ec(),pg(e.t().fromImage)}}function xa(n,t){if(n&1&&(Oi$1(0,`p`,14),fS(1),Nc()),n&2){let e=HE();ec(),pg(e.t().noProbes)}}function ga(n,t){n&1&&(Oi$1(0,`pre`,20),fS(1),Nc()),n&2&&(ec(),pg(t))}function _a(n,t){if(n&1&&(Oi$1(0,`p`,21),fS(1),Nc()),n&2){let e=HE(3);ec(),pg(e.t().noOutput)}}function ya(n,t){if(n&1&&(Oi$1(0,`li`,16)(1,`div`,17)(2,`span`,18),fS(3),Nc(),Oi$1(4,`span`,19),fS(5),Nc()(),SE(6,ga,2,1,`pre`,20)(7,_a,2,1,`p`,21),Nc()),n&2){let e,i=t.$implicit,l=HE(2);ec(3),pg(l.clock(i)),ec(),nS(i.exitCode===0?`text-ok`:`text-danger`),ec(),Ac(` `,l.exitCode(i),` `),ec(),kE((e=i.output.trim())?6:7,e)}}function fa(n,t){if(n&1&&(Oi$1(0,`ul`,15),kc(1,ya,8,5,`li`,16,TE),Nc()),n&2){let e=HE();ec(),Tc(e.health().probes)}}var va;var Ne;var Jt=f(()=>{Kr();h();dk();sk();Kr();va={healthy:`border-ok/40 bg-ok/10 text-ok`,unhealthy:`border-danger/40 bg-danger/10 text-danger`,starting:`border-warn/40 bg-warn/10 text-warn`},Ne=class n{health=jc.required();busy=jc(!1);refresh=pj();t=Ot$1(()=>ok().containers.detail.health);tone=Ot$1(()=>va[this.health().status??``]??`border-ink-700 bg-ink-800 text-ink-300`);statusLabel=Ot$1(()=>{let t=this.health().status;return t===null?this.t().status.unknown:this.t().status[t]});command=Ot$1(()=>this.health().test.join(` `));rhythm=Ot$1(()=>{let t=this.health(),e=this.t(),i=[];return t.intervalMs!==null&&i.push(e.every(x(t.intervalMs))),t.timeoutMs!==null&&i.push(e.timeout(x(t.timeoutMs))),t.startPeriodMs!==null&&i.push(e.startPeriod(x(t.startPeriodMs))),t.retries!==null&&i.push(e.retries(t.retries)),i.length===0?e.defaults:i.join(` · `)});clock(t){return A(t.finishedAt)||`—`}exitCode(t){return t.exitCode===null?this.t().unknownExitCode:this.t().exitCode(t.exitCode)}static ɵfac=function(e){return new(e||n)};static ɵcmp=wc({type:n,selectors:[[`app-health-view`]],hostAttrs:[1,`block`,`h-full`,`min-h-0`],inputs:{health:[1,`health`],busy:[1,`busy`]},outputs:{refresh:`refresh`},decls:26,vars:13,consts:[[1,`h-full`,`overflow-auto`,`px-6`,`py-5`],[1,`max-w-3xl`],[1,`flex`,`flex-wrap`,`items-center`,`gap-3`],[1,`rounded-md`,`border`,`px-2`,`py-0.5`,`font-mono`,`text-[12px]`],[1,`text-[13px]`,`text-ink-400`],[`type`,`button`,1,`mx-btn`,`mx-focus`,`ml-auto`,3,`click`,`disabled`],[`name`,`refresh`,3,`size`],[1,`mt-5`,`space-y-3`],[1,`text-[12px]`,`text-ink-500`],[1,`mt-0.5`,`text-[13px]`,`text-ink-100`],[1,`font-mono`,`break-all`],[1,`text-ink-400`],[1,`mt-8`,`max-w-3xl`],[1,`text-[13px]`,`font-medium`,`text-ink-200`],[1,`mt-2`,`text-[13px]`,`text-ink-400`],[1,`mt-3`,`space-y-2`],[1,`rounded-lg`,`border`,`border-ink-700`,`bg-ink-850`,`px-4`,`py-3`],[1,`flex`,`flex-wrap`,`items-baseline`,`gap-3`],[1,`font-mono`,`text-[12px]`,`text-ink-300`],[1,`text-[12px]`],[1,`mt-2`,`font-mono`,`text-[12px]`,`whitespace-pre-wrap`,`text-ink-200`],[1,`mt-2`,`text-[12px]`,`text-ink-500`]],template:function(e,i){if(e&1&&(Oi$1(0,`div`,0)(1,`section`,1)(2,`div`,2)(3,`span`,3),fS(4),Nc(),SE(5,ma,2,1,`span`,4),Oi$1(6,`button`,5),Jm(`click`,function(){return i.refresh.emit()}),Gm(7,`app-icon`,6),fS(8),Nc()(),Oi$1(9,`dl`,7)(10,`div`)(11,`dt`,8),fS(12),Nc(),Oi$1(13,`dd`,9),SE(14,pa,2,1,`code`,10)(15,ua,2,1,`span`,11),Nc()(),Oi$1(16,`div`)(17,`dt`,8),fS(18),Nc(),Oi$1(19,`dd`,9),fS(20),Nc()()()(),Oi$1(21,`section`,12)(22,`h3`,13),fS(23),Nc(),SE(24,xa,2,1,`p`,14)(25,fa,3,0,`ul`,15),Nc()()),e&2){let l;ec(3),nS(i.tone()),ec(),pg(i.statusLabel()),ec(),kE(i.health().failingStreak>0?5:-1),ec(),Wm(`disabled`,i.busy()),ec(),Wm(`size`,14),ec(),Ac(` `,i.busy()?i.t().loading:i.t().refresh,` `),ec(4),pg(i.t().command),ec(2),kE((l=i.command())?14:15,l),ec(4),pg(i.t().rhythm),ec(2),pg(i.rhythm()),ec(3),pg(i.t().probes),ec(),kE(i.health().probes.length===0?24:25)}},dependencies:[My],encapsulation:2})}});function Ca(n,t){if(n&1&&(Oi$1(0,`p`,3),fS(1),Nc()),n&2){let e=HE();ec(),pg(e.t().loading)}}function wa(n,t){if(n&1&&(Oi$1(0,`p`,3),fS(1),Nc()),n&2){let e=HE();ec(),pg(e.t().empty)}}function Da(n,t){if(n&1&&fS(0),n&2){let e=HE().$implicit;Ac(` · `,HE(2).t().alsoKnownAs(e.aliases.join(`, `)),` `)}}function ka(n,t){if(n&1){let e=$E();Oi$1(0,`li`,10)(1,`div`,11)(2,`div`,12),fS(3),Nc(),Oi$1(4,`div`,6),fS(5),SE(6,Da,1,1),Nc()(),Oi$1(7,`button`,13),Jm(`click`,function(){let l=Ld(e).$implicit;return Od(HE(2).disconnect(l.name))}),Gm(8,`app-icon`,14),fS(9),Nc()()}if(n&2){let e=t.$implicit,i=HE(2);ec(3),pg(e.name),ec(2),Ac(` `,e.ipAddress??i.t().noAddress,` `),ec(),kE(e.aliases.length>0?6:-1),ec(),Wm(`disabled`,i.busy()),Br(`aria-label`,i.t().disconnectFrom(e.name)),ec(),Wm(`size`,14),ec(),Ac(` `,i.t().disconnect,` `)}}function Sa(n,t){if(n&1&&(Oi$1(0,`ul`,4),kc(1,ka,10,7,`li`,10,ba),Nc()),n&2){let e=HE();ec(),Tc(e.attached())}}function Ia(n,t){if(n&1&&(Oi$1(0,`p`,7),fS(1),Nc()),n&2){let e=HE();ec(),pg(e.t().allConnected)}}function Ea(n,t){if(n&1&&(Oi$1(0,`option`,18),fS(1),Nc()),n&2){let e=t.$implicit,i=HE(2);Wm(`value`,e.name)(`selected`,i.chosen()===e.name),ec(),pg(e.name)}}function Ta(n,t){if(n&1){let e=$E();Oi$1(0,`label`,19)(1,`span`,2),fS(2),Nc(),Oi$1(3,`input`,22),Jm(`input`,function(l){Ld(e);return Od(HE(2).alias.set(l.target.value))}),Nc(),Oi$1(4,`span`,23),fS(5),Nc()()}if(n&2){let e=HE(2);ec(2),pg(e.t().alias),ec(),nS(e.field+` mt-1.5 w-full`),Wm(`placeholder`,e.t().aliasPlaceholder)(`value`,e.alias()),Br(`aria-label`,e.t().alias),ec(2),pg(e.t().aliasHint)}}function Ma(n,t){if(n&1){let e=$E();Oi$1(0,`form`,15),Jm(`submit`,function(l){Ld(e);return Od(HE().connect(l))}),Oi$1(1,`select`,16),Jm(`change`,function(l){Ld(e);return Od(HE().choose(l.target.value))}),Oi$1(2,`option`,17),fS(3),Nc(),kc(4,Ea,2,3,`option`,18,ha),Nc(),SE(6,Ta,6,7,`label`,19),Oi$1(7,`button`,20),Gm(8,`app-icon`,21),fS(9),Nc()()}if(n&2){let e=HE();ec(),nS(e.field+` w-full`),Br(`aria-label`,e.t().networkLabel),ec(),Wm(`selected`,e.chosen()===``),ec(),pg(e.t().choose),ec(),Tc(e.available()),ec(2),kE(e.canAlias()?6:-1),ec(),Wm(`disabled`,e.chosen()===``||e.busy()),ec(),Wm(`size`,14),ec(),Ac(` `,e.busy()?e.t().working:e.t().connect,` `)}}function Va(n,t){n&1&&(Oi$1(0,`p`,9),fS(1),Nc()),n&2&&(ec(),Ac(` `,t,` `))}var ba;var ha;var Na;var Pa;var Pe;var qt=f(()=>{Kr();lk();dk();sk();Kr();ba=(n,t)=>t.name,ha=(n,t)=>t.id;Na=/^[\w][\w.-]*$/,Pa=`mx-focus min-w-0 rounded-md border border-ink-700 bg-ink-800 px-2.5 py-1.5 text-[13px] text-ink-100 placeholder:text-ink-500`,Pe=class n{containerId=jc.required();t=Ot$1(()=>ok().containers.detail.networks);field=Pa;attached=wt([]);all=wt([]);chosen=wt(``);alias=wt(``);problem=wt(null);loading=wt(!0);busy=wt(!1);available=Ot$1(()=>{let t=new Set(this.attached().map(e=>e.name));return this.all().filter(e=>!t.has(e.name))});canAlias=Ot$1(()=>{let t=this.chosen();return t!==``&&this.all().some(e=>e.name===t&&!e.builtIn)});constructor(){rf(()=>{this.load(this.containerId())})}async load(t){this.loading.set(!0);try{let[e,i]=await Promise.all([window.electron.networks.ofContainer(t),window.electron.networks.list()]);this.attached.set(e),this.all.set(i)}catch(e){this.problem.set(eH(e))}finally{this.loading.set(!1)}}choose(t){this.chosen.set(t),this.canAlias()||this.alias.set(``)}async connect(t){t.preventDefault();let e=this.chosen(),i=this.canAlias()?this.alias().trim():``;if(e===``||this.busy())return;if(i!==``&&!Na.test(i)){this.problem.set(this.t().invalidAlias(i));return}await this.attach(()=>window.electron.networks.connect(e,this.containerId(),i===``?null:i))&&(this.chosen.set(``),this.alias.set(``))}async disconnect(t){await this.attach(()=>window.electron.networks.disconnect(t,this.containerId()))}async attach(t){this.busy.set(!0),this.problem.set(null);try{let e=await t();return e.ok?(await this.load(this.containerId()),!0):(this.problem.set(e.problem),!1)}catch(e){return this.problem.set(eH(e)),!1}finally{this.busy.set(!1)}}static ɵfac=function(e){return new(e||n)};static ɵcmp=wc({type:n,selectors:[[`app-networks-view`]],hostAttrs:[1,`block`,`h-full`,`min-h-0`],inputs:{containerId:[1,`containerId`]},decls:15,vars:6,consts:[[1,`h-full`,`overflow-auto`,`px-6`,`py-5`],[1,`max-w-3xl`],[1,`text-[13px]`,`font-medium`,`text-ink-200`],[1,`mt-2`,`text-[13px]`,`text-ink-400`],[1,`mt-3`,`divide-y`,`divide-ink-800`,`rounded-lg`,`border`,`border-ink-700`,`bg-ink-850`],[1,`mt-8`,`max-w-3xl`],[1,`mt-0.5`,`text-[12px]`,`text-ink-500`],[1,`mt-3`,`text-[13px]`,`text-ink-400`],[1,`mt-3`,`space-y-3`],[`role`,`alert`,1,`mt-3`,`rounded-md`,`border`,`border-danger/40`,`bg-danger/10`,`px-3`,`py-2`,`text-[13px]`,`text-danger`],[1,`flex`,`items-center`,`gap-4`,`px-4`,`py-3`],[1,`min-w-0`,`flex-1`],[1,`truncate`,`text-[13px]`,`text-ink-100`],[`type`,`button`,1,`mx-btn`,`mx-focus`,3,`click`,`disabled`],[`name`,`close`,3,`size`],[1,`mt-3`,`space-y-3`,3,`submit`],[3,`change`],[`value`,``,3,`selected`],[3,`value`,`selected`],[1,`block`],[`type`,`submit`,1,`mx-btn`,`mx-focus`,`border-accent`,`text-accent`,3,`disabled`],[`name`,`plus`,3,`size`],[`type`,`text`,`autocomplete`,`off`,`spellcheck`,`false`,3,`input`,`placeholder`,`value`],[1,`mt-1`,`block`,`text-[12px]`,`text-ink-500`]],template:function(e,i){if(e&1&&(Oi$1(0,`div`,0)(1,`section`,1)(2,`h3`,2),fS(3),Nc(),SE(4,Ca,2,1,`p`,3)(5,wa,2,1,`p`,3)(6,Sa,3,0,`ul`,4),Nc(),Oi$1(7,`section`,5)(8,`h3`,2),fS(9),Nc(),Oi$1(10,`p`,6),fS(11),Nc(),SE(12,Ia,2,1,`p`,7)(13,Ma,10,9,`form`,8),SE(14,Va,2,1,`p`,9),Nc()()),e&2){let l;ec(3),pg(i.t().title),ec(),kE(i.loading()?4:i.attached().length===0?5:6),ec(5),pg(i.t().addTitle),ec(2),pg(i.t().addHint),ec(),kE(i.available().length===0?12:13),ec(2),kE((l=i.problem())?14:-1,l)}},dependencies:[My],encapsulation:2})}});function Fa(n,t){if(n&1){let e=$E();Oi$1(0,`button`,24),Jm(`click`,function(){Ld(e);return Od(HE(4).recreate())}),Gm(1,`app-icon`,25),fS(2),Nc()}if(n&2){let e=HE(4);Wm(`disabled`,e.recreateBusy()),ec(),Wm(`size`,14),ec(),Ac(` `,e.a().recreate,` `)}}function za(n,t){if(n&1){let e=$E();Oi$1(0,`div`,15),Gm(1,`app-icon`,17),Oi$1(2,`div`,18)(3,`p`,19),fS(4),Nc(),Oi$1(5,`p`,20),fS(6),Nc()(),SE(7,Fa,3,3,`button`,21),Oi$1(8,`button`,22),Jm(`click`,function(){let l=Ld(e);return Od(HE(3).reconnect(l))}),Gm(9,`app-icon`,23),fS(10),Nc()()}if(n&2){let e=t,i=HE(3);ec(),Wm(`size`,14),ec(3),pg(i.w().network(e)),ec(2),pg(i.w().networkWhy),ec(),kE(i.canRecreate()?7:-1),ec(),Wm(`disabled`,i.wiringBusy()),ec(),Wm(`size`,14),ec(),Ac(` `,i.w().connect(e),` `)}}function Oa(n,t){if(n&1){let e=$E();Oi$1(0,`button`,22),Jm(`click`,function(){Ld(e);return Od(HE(5).recreate())}),Gm(1,`app-icon`,25),fS(2),Nc()}if(n&2){let e=HE(5);Wm(`disabled`,e.recreateBusy()),ec(),Wm(`size`,14),ec(),Ac(` `,e.a().recreate,` `)}}function Ba(n,t){if(n&1){let e=$E();Oi$1(0,`button`,22),Jm(`click`,function(){Ld(e);return Od(HE(5).restartForPorts())}),Gm(1,`app-icon`,25),fS(2),Nc()}if(n&2){let e=HE(5);Wm(`disabled`,e.wiringBusy()||e.pending()),ec(),Wm(`size`,14),ec(),Ac(` `,e.w().restart,` `)}}function Wa(n,t){if(n&1&&SE(0,Oa,3,3,`button`,27)(1,Ba,3,3,`button`,27),n&2)kE(HE(4).canRecreate()?0:1)}function ja(n,t){if(n&1&&(Oi$1(0,`div`,16),Gm(1,`app-icon`,26),Oi$1(2,`div`,18)(3,`p`,19),fS(4),Nc(),Oi$1(5,`p`,20),fS(6),Nc()(),SE(7,Wa,2,1),Nc()),n&2){let e=HE(),i=HE(2);ec(),Wm(`size`,14),ec(3),pg(i.w().ports(i.portList(e.missingPorts))),ec(2),pg(e.missingNetwork===null?i.w().portsWhy:i.w().portsFromNetwork),ec(),kE(e.missingNetwork===null?7:-1)}}function Aa(n,t){if(n&1&&(SE(0,za,11,7,`div`,15),SE(1,ja,8,4,`div`,16)),n&2){let e,i=t;kE((e=i.missingNetwork)?0:-1,e),ec(),kE(i.missingPorts.length>0?1:-1)}}function Ha(n,t){if(n&1){let e=$E();Oi$1(0,`div`,8),Gm(1,`app-state-dot`,9),Oi$1(2,`h1`,10),fS(3),Nc(),Oi$1(4,`span`,11),fS(5),Nc(),Oi$1(6,`span`,12),fS(7),Nc(),Oi$1(8,`span`,11),fS(9),Nc(),Oi$1(10,`div`,13)(11,`app-action-menu`,14),Jm(`picked`,function(l){Ld(e);return Od(HE().onMenu(l))}),Nc()()(),SE(12,Aa,2,2)}if(n&2){let e,i=HE(),l=bS(0);ec(),Wm(`state`,l.state),ec(2),pg(l.name),ec(2),pg(l.status),ec(2),pg(l.shortId),ec(2),pg(l.image),ec(2),Wm(`label`,i.t().menu)(`items`,i.menuItems()),ec(),kE((e=i.wiring())?12:-1,e)}}function $a(n,t){if(n&1&&(Oi$1(0,`a`,28),fS(1),Nc()),n&2){let e=t,i=HE(3);Wm(`routerLink`,SS(2,Ra,e.id)),ec(),Ac(` `,i.t().successor(e.name,e.status),` `)}}function Ja(n,t){if(n&1&&(Oi$1(0,`p`)(1,`span`,19),fS(2),Nc(),fS(3),Nc(),SE(4,$a,2,4,`a`,28)),n&2){let e,i=HE(2);ec(2),pg(t),ec(),Ac(``,i.t().gone,` `),ec(),kE((e=i.successor())?4:-1,e)}}function qa(n,t){if(n&1&&(Oi$1(0,`p`),fS(1),Nc()),n&2){let e=HE(2);ec(),pg(e.t().goneUnnamed)}}function Ga(n,t){if(n&1&&(Oi$1(0,`div`,2),SE(1,Ja,5,3)(2,qa,2,1,`p`),Nc()),n&2){let e,i=HE();ec(),kE((e=i.name())?1:2,e)}}function Ua(n,t){if(n&1&&(Oi$1(0,`button`,31),Gm(1,`app-icon`,55),fS(2),Nc()),n&2){let e=t.$implicit,i=HE(2);Wm(`value`,e),ec(),Wm(`name`,i.tabIcons[e])(`size`,14),ec(),Ac(``,i.tabLabel(e),` `)}}function Ka(n,t){if(n&1){let e=$E();Oi$1(0,`div`,34)(1,`app-health-view`,56),Jm(`refresh`,function(){Ld(e);return Od(HE(2).onHealthRefresh())}),Nc()()}if(n&2){let e=HE(2);ec(),Wm(`health`,t)(`busy`,e.healthBusy())}}function Qa(n,t){n&1&&(Oi$1(0,`p`,36),fS(1),Nc()),n&2&&(ec(),pg(t))}function Xa(n,t){n&1&&Gm(0,`app-json-view`,37),n&2&&Wm(`value`,t)}function Ya(n,t){if(n&1&&(Oi$1(0,`p`,11),fS(1),Nc()),n&2){let e=HE(2);ec(),pg(e.t().fetching)}}function Za(n,t){if(n&1&&(Oi$1(0,`div`,38),Gm(1,`app-environment-view`,57),Nc()),n&2){let e=HE(2),i=bS(0);ec(),Wm(`containerId`,e.id())(`compose`,!!i.composeProject)}}function eo(n,t){if(n&1&&Gm(0,`app-terminal-view`,58),n&2){let e=HE(3);Wm(`containerId`,e.id())(`active`,e.tab()===`terminal`)}}function to(n,t){if(n&1&&(Oi$1(0,`p`,42),fS(1),Nc()),n&2){let e=HE(3);ec(),pg(e.t().terminalLoading)}}function no(n,t){if(n&1&&($m(0,eo,1,2)(1,to,2,1),DE(2,0,La,1)),n&2){let e=HE(2);ec(2),CE(e.visited().has(`terminal`))}}function io(n,t){if(n&1&&(Oi$1(0,`p`,42),fS(1),Nc()),n&2){let e=HE(2);ec(),pg(e.t().shellOnlyRunning)}}function ao(n,t){if(n&1&&(Oi$1(0,`div`,45),Gm(1,`app-networks-view`,59),Nc()),n&2){let e=HE(2);ec(),Wm(`containerId`,e.id())}}function oo(n,t){if(n&1&&(Oi$1(0,`div`,46),Gm(1,`app-assistant-view`,59),Nc()),n&2){let e=HE(2);ec(),Wm(`containerId`,e.id())}}function ro(n,t){if(n&1&&(vr(),Oi$1(0,`svg`,60),Gm(1,`polyline`,61),Nc(),Zd(),Oi$1(2,`div`,62),fS(3),NS(4,`number`),Nc()),n&2){let e=HE(2);ec(),Br(`points`,e.cpuPath()),ec(2),Ac(` `,e.t().lastMinute(xS(4,2,e.cpuPeak(),`1.2-2`)??``),` `)}}function lo(n,t){if(n&1&&(Gm(0,`div`,63),Oi$1(1,`div`,62),fS(2),Nc()),n&2){let e=HE(2);ec(2),pg(e.t().chartPending)}}function so(n,t){if(n&1&&(Oi$1(0,`p`,67),fS(1),Nc()),n&2){let e=HE(3);ec(),pg(e.t().nearLimit)}}function co(n,t){if(n&1&&(Oi$1(0,`div`,64),Gm(1,`div`,65),Nc(),Oi$1(2,`div`,66),fS(3),NS(4,`number`),Nc(),SE(5,so,2,1,`p`,67)),n&2){let e=HE(2);ec(),nS(e.memoryPercent()>=90?`bg-danger`:`bg-accent`),sg(`width`,e.memoryPercent(),`%`),ec(2),Ac(` `,e.t().ofLimit(xS(4,6,e.memoryPercent(),`1.1-1`)??``),` `),ec(2),kE(e.memoryPercent()>=90?5:-1)}}function mo(n,t){if(n&1&&(Oi$1(0,`div`,53),fS(1),Nc()),n&2){let e=HE(2);ec(),pg(e.t().noLimit)}}function po(n,t){if(n&1&&(Oi$1(0,`p`,54),fS(1),Nc()),n&2){let e=HE(2);ec(),pg(e.t().statsOnlyRunning)}}function uo(n,t){if(n&1){let e=$E();Oi$1(0,`div`,29),vg(`valueChange`,function(l){Ld(e);let c=HE();return vS(c.tab,l)||(c.tab=l),Od(l)}),Oi$1(1,`div`,30),kc(2,Ua,3,4,`button`,31,Sc),Nc(),Oi$1(4,`div`,32),Gm(5,`app-logs-view`,33),Nc(),SE(6,Ka,2,2,`div`,34),Oi$1(7,`div`,35),SE(8,Qa,2,1,`p`,36)(9,Xa,1,1,`app-json-view`,37)(10,Ya,2,1,`p`,11),Nc(),SE(11,Za,2,2,`div`,38),Oi$1(12,`div`,39),Gm(13,`app-events-view`,40),Nc(),Oi$1(14,`div`,41),SE(15,no,4,1)(16,io,2,1,`p`,42),Nc(),Oi$1(17,`div`,43)(18,`app-files-view`,44),Jm(`saveAsImage`,function(){Ld(e);return Od(HE().commitOpen.set(!0))}),Nc()(),SE(19,ao,2,1,`div`,45),SE(20,oo,2,1,`div`,46),Oi$1(21,`div`,47)(22,`div`,48)(23,`div`,49)(24,`div`,20),fS(25),Nc(),Oi$1(26,`div`,50),fS(27),NS(28,`number`),Oi$1(29,`span`,51),fS(30,`%`),Nc()(),SE(31,ro,5,5)(32,lo,3,1),Oi$1(33,`div`,52),fS(34),Nc()(),Oi$1(35,`div`,49)(36,`div`,20),fS(37),Nc(),Oi$1(38,`div`,50),fS(39),Nc(),SE(40,co,6,9)(41,mo,2,1,`div`,53),Nc()(),SE(42,po,2,1,`p`,54),Nc()()}if(n&2){let e,i,l=HE(),c=bS(0);hg(`value`,l.tab),ec(),Br(`aria-label`,l.t().tabsLabel),ec(),Tc(l.tabNames()),ec(3),Wm(`containerId`,l.id())(`name`,c.name),ec(),kE((e=l.health())?6:-1,e),ec(2),kE((i=l.inspectProblem())?8:(i=l.inspect())?9:10,i),ec(3),kE(l.visited().has(`env`)?11:-1),ec(2),Wm(`name`,c.name)(`active`,l.tab()===`events`),ec(2),kE(c.state===`running`?15:16),ec(3),Wm(`containerId`,l.id())(`active`,l.tab()===`files`),ec(),kE(l.visited().has(`networks`)?19:-1),ec(),kE(l.assistantConfigured()&&l.visited().has(`assistant`)?20:-1);let D=l.sample();ec(5),pg(l.t().cpu),ec(2),Ac(` `,D?xS(28,22,D.cpuPercent,`1.2-2`):`—`),ec(4),kE(l.cpuPath()?31:32),ec(3),pg(l.cpuLimit()===null?l.t().cpuNoLimit:l.cpuOfLimitText()),ec(3),pg(l.t().memory),ec(2),pg(l.memoryLabel()),ec(),kE(l.memoryLimit()!==null?40:41),ec(2),kE(D?-1:42)}}function xo(n,t){if(n&1){let e=$E();Oi$1(0,`app-rename-dialog`,68),vg(`openChange`,function(l){Ld(e);let c=HE();return vS(c.renameOpen,l)||(c.renameOpen=l),Od(l)}),Nc(),Oi$1(1,`app-commit-dialog`,69),vg(`openChange`,function(l){Ld(e);let c=HE();return vS(c.commitOpen,l)||(c.commitOpen=l),Od(l)}),Nc()}if(n&2){let e=t,i=HE();hg(`open`,i.renameOpen),Wm(`containerId`,i.id())(`name`,e.name)(`compose`,!!e.composeProject),ec(),hg(`open`,i.commitOpen),Wm(`containerId`,i.id())(`containerName`,e.name)(`image`,e.image)(`running`,e.state===`running`)(`mounts`,i.commitMounts())}}var La;var Ra;var Gt;var Ut;f(()=>{Kr();Ne$1();ra$1();Le();y$1();v();lk();h();G();J();f$1();Ye();Tt();Mt();Vt();Nt();Lt();ve$1();Rt();Ft();dk();zt();u$3();Wt();At();$t();Jt();qt();sk();Kr();La=()=>[import(`./chunk-DKpHNjiv.js`).then(n=>n.TerminalView)],Ra=n=>[`/containers`,n];Gt=60,Ut=class n{id=jc.required();name=jc(void 0);diagnose=jc(void 0);tabblad=jc(void 0);geheugen=jc(void 0);processor=jc(void 0);hernoemen=jc(void 0);yaml=jc(void 0);store=C(u$1);router=C(fe);toast=C(u);compose=C(c);t=Ot$1(()=>ok().containers.detail);tabIcons={logs:`lines`,health:`pulse`,inspect:`code`,env:`sliders`,stats:`chart`,terminal:`terminal`,files:`folder`,networks:`networks`,events:`clock`,assistant:`sparkle`};assistantConfigured=wt(!1);tabNames=Ot$1(()=>{let t=[`logs`,`inspect`,`env`,`stats`,`events`,`terminal`,`files`,`networks`],e=this.health()===null?t:[`logs`,`health`,...t.slice(1)];return this.assistantConfigured()?[...e,`assistant`]:e});tab=wt(`logs`);visited=wt(new Set([`logs`]));health=wt(null);healthBusy=wt(!1);inspect=wt(null);inspectProblem=wt(null);confirmOpen=wt(!1);diagnosisOpen=wt(!1);runCommandOpen=wt(!1);runCommandFormat=wt(`run`);restartPolicyOpen=wt(!1);memoryLimitOpen=wt(!1);cpuLimitOpen=wt(!1);renameOpen=wt(!1);commitOpen=wt(!1);commitMounts=Ot$1(()=>(this.inspect()?.Mounts??[]).map(e=>({source:e.Type===`volume`?e.Name??``:e.Type===`tmpfs`?`tmpfs`:e.Source??``,destination:e.Destination??``})));memoryLimit=Ot$1(()=>{let e=this.inspect()?.HostConfig?.Memory;return typeof e==`number`&&e>0?e:null});cpuLimit=Ot$1(()=>{let e=this.inspect()?.HostConfig?.NanoCpus;return typeof e==`number`&&e>0?e/1e9:null});cpuHistory=wt([]);wiring=wt(null);wiringBusy=wt(!1);w=Ot$1(()=>ok().containers.detail.wiring);a=Ot$1(()=>ok().containers.actions);canRecreate=Ot$1(()=>{let t=this.container();return t!==null&&t.composeProject!==null&&t.composeService!==null&&t.composeWorkingDir!==null&&this.compose.status()?.cliAvailable===!0});recreateBusy=Ot$1(()=>{let t=this.container()?.composeProject;return t==null||this.compose.pending().has(t)});wiringKey=Ot$1(()=>{let t=this.container();return t===null?null:`${t.id}|${t.state}|${t.missingNetwork??``}`});container=Ot$1(()=>this.store.containers().find(t=>t.id===this.id())??null);successor=Ot$1(()=>{let t=this.name();return t===void 0?null:this.store.containers().find(e=>e.name===t&&e.id!==this.id())??null});loaded=Ot$1(()=>this.store.containers().length>0||!this.store.loading());sample=Ot$1(()=>this.store.stats().get(this.id())??null);pending=Ot$1(()=>this.store.pending().has(this.id()));menuItems=Ot$1(()=>{let t=this.container(),e=this.pending();if(t===null)return[];let i=ok().common,l=ok().containers.actions;return[...t.state===`running`?[{id:`stop`,label:i.stop,icon:`stop`,disabled:e},{id:`restart`,label:i.restart,icon:`refresh`,disabled:e},{id:`pause`,label:l.pause,icon:`pause`,disabled:e}]:t.state===`paused`?[{id:`unpause`,label:l.resume,icon:`play`,disabled:e}]:[{id:`start`,label:i.start,icon:`play`,disabled:e}],...this.canRecreate()?[{id:`recreate`,label:l.recreate,icon:`refresh`,disabled:e||this.recreateBusy(),hint:`docker compose up -d --force-recreate`}]:[],{id:`diagnose`,label:l.copyDiagnosis,icon:`copy`,separated:!0},{id:`runCommand`,label:l.copyRunCommand,icon:`copy`},{id:`composeService`,label:l.copyComposeService,icon:`file`},{id:`rename`,label:l.rename,icon:`pencil`,separated:!0},{id:`commit`,label:l.commit,icon:`images`},{id:`restartPolicy`,label:l.restartPolicy,icon:`refresh`},{id:`memoryLimit`,label:l.memoryLimit,icon:`sliders`},{id:`cpuLimit`,label:l.cpuLimit,icon:`sliders`},{id:`remove`,label:i.remove,icon:`trash`,danger:!0,disabled:e,separated:!0}]});cpuPath=Ot$1(()=>{let t=this.cpuHistory();if(t.length<2)return``;let e=this.cpuLimit(),i=e===null?Math.max(...t,1):e*100,l=100/(Gt-1);return t.map((c,D)=>`${(D*l).toFixed(2)},${(30-Math.min(c,i)/i*28).toFixed(2)}`).join(` `)});cpuPeak=Ot$1(()=>Math.max(...this.cpuHistory(),0));constructor(){rf(()=>{let t=this.tab();this.visited.update(e=>e.has(t)?e:new Set(e).add(t))}),rf(()=>{this.store.watchStats([this.id()])}),rf(()=>{let t=this.sample();t!==null&&this.cpuHistory.update(e=>[...e,t.cpuPercent].slice(-Gt))}),rf(()=>{this.loadInspect(this.id())}),rf(()=>{this.wiringKey()!==null&&this.loadWiring(this.id())}),rf(()=>{if((this.container()?.status??``)===``){this.health.set(null);return}this.loadHealth(this.id())}),rf(()=>{this.diagnose()!==void 0&&this.diagnosisOpen.set(!0)}),rf(()=>{let t=this.tabblad();t!==void 0&&this.tabNames().includes(t)&&Tg(()=>this.tab.set(t))}),rf(()=>{this.geheugen()!==void 0&&Tg(()=>this.memoryLimitOpen.set(!0)),this.processor()!==void 0&&Tg(()=>this.cpuLimitOpen.set(!0)),this.hernoemen()!==void 0&&Tg(()=>this.renameOpen.set(!0))}),rf(()=>{this.yaml()!==void 0&&Tg(()=>{this.runCommandFormat.set(`compose`),this.runCommandOpen.set(!0)})}),C(ve).onDestroy(()=>this.store.watchStats([])),window.electron.assistant.status().then(t=>this.assistantConfigured.set(t.configured)).catch(()=>this.assistantConfigured.set(!1)),this.store.refresh(),this.compose.status()===null&&this.compose.loadStatus().catch(()=>{})}tabLabel(t){return this.t().tabs[t]}memoryLabel(){let t=this.sample();if(t===null)return`—`;let e=this.memoryLimit();return e===null?d(t.memoryBytes):`${d(t.memoryBytes)} / ${d(e)}`}memoryPercent(){let t=this.sample(),e=this.memoryLimit();return t===null||e===null?0:Math.min(100,t.memoryBytes/e*100)}cpuOfLimitText(){let t=this.sample(),e=this.cpuLimit();if(t===null||e===null)return``;let i=new Intl.NumberFormat(ik(),{maximumFractionDigits:1}).format(Math.min(100,t.cpuPercent/e));return this.t().cpuOfLimit(i,Be(e,ik()))}onMemoryLimitSaved(){this.loadInspect(this.id())}onMenu(t){t===`diagnose`?this.diagnosisOpen.set(!0):t===`runCommand`?(this.runCommandFormat.set(`run`),this.runCommandOpen.set(!0)):t===`composeService`?(this.runCommandFormat.set(`compose`),this.runCommandOpen.set(!0)):t===`restartPolicy`?this.restartPolicyOpen.set(!0):t===`memoryLimit`?this.memoryLimitOpen.set(!0):t===`cpuLimit`?this.cpuLimitOpen.set(!0):t===`rename`?this.renameOpen.set(!0):t===`commit`?this.commitOpen.set(!0):t===`remove`?this.askRemove():t===`recreate`?this.recreate():this.store.run(t,this.id())}askRemove(){this.confirmOpen.set(!0)}async confirmRemove(){await this.store.run(`remove`,this.id()),await this.router.navigate([`/containers`])}onHealthRefresh(){this.loadHealth(this.id())}async loadHealth(t){this.healthBusy.set(!0);try{this.health.set(await window.electron.containers.health(t))}catch{this.health.set(null)}finally{this.healthBusy.set(!1)}}portList(t){return t.map(e=>{let i=e.hostPort===null?String(e.containerPort):String(e.hostPort);return e.hostIp===null?i:`${e.hostIp}:${i}`}).join(`, `)}async reconnect(t){this.wiringBusy.set(!0);try{let e=await window.electron.networks.connect(t,this.id(),null);e.ok||this.toast.error(e.problem)}catch(e){this.toast.error(eH(e))}finally{this.wiringBusy.set(!1)}await this.store.refresh(),await this.loadWiring(this.id())}async recreate(){let t=this.container();if(t===null||t.composeProject===null||t.composeService===null||!await this.compose.recreate(t.composeProject,t.composeService))return;await this.store.refresh();let i=this.store.containers().find(l=>l.name===t.name&&l.id!==t.id);i!==void 0&&await this.router.navigate([`/containers`,i.id],{replaceUrl:!0})}async restartForPorts(){await this.store.run(`restart`,this.id()),await this.loadWiring(this.id())}async loadWiring(t){try{this.wiring.set(await window.electron.containers.wiring(t))}catch{this.wiring.set(null)}}async loadInspect(t){try{this.inspect.set(await window.electron.containers.inspect(t)),this.inspectProblem.set(null)}catch(e){this.inspect.set(null),this.inspectProblem.set(eH(e))}}static ɵfac=function(e){return new(e||n)};static ɵcmp=wc({type:n,selectors:[[`app-container-detail`]],hostAttrs:[1,`flex`,`h-full`,`flex-col`],inputs:{id:[1,`id`],name:[1,`name`],diagnose:[1,`diagnose`],tabblad:[1,`tabblad`],geheugen:[1,`geheugen`],processor:[1,`processor`],hernoemen:[1,`hernoemen`],yaml:[1,`yaml`]},decls:14,vars:22,consts:[[1,`shrink-0`,`border-b`,`border-ink-700`,`px-6`,`pt-4`,`pb-3`],[`routerLink`,`/containers`,1,`mx-focus`,`inline-flex`,`items-center`,`gap-1`,`text-[12px]`,`text-ink-400`,`hover:text-ink-100`],[`data-testid`,`container-gone`,1,`mt-3`,`text-[13px]`,`text-ink-400`],[`rdxTabsRoot`,``,1,`flex`,`min-h-0`,`flex-1`,`flex-col`,3,`value`],[3,`openChange`,`open`,`containerId`],[3,`openChange`,`formatChange`,`open`,`format`,`containerId`,`composeProject`],[3,`openChange`,`saved`,`open`,`containerId`,`compose`],[3,`openChange`,`confirmed`,`open`,`title`,`description`],[1,`mt-2`,`flex`,`flex-wrap`,`items-center`,`gap-3`],[`size`,`md`,`aria-hidden`,`true`,3,`state`],[1,`text-lg`,`font-semibold`,`tracking-tight`,`text-ink-100`],[1,`text-[13px]`,`text-ink-400`],[1,`font-mono`,`text-[12px]`,`text-ink-500`],[1,`ml-auto`],[3,`picked`,`label`,`items`],[`role`,`status`,`data-testid`,`wiring-network`,1,`mt-3`,`flex`,`flex-wrap`,`items-center`,`gap-3`,`rounded-md`,`border`,`border-danger/40`,`bg-danger/10`,`px-3`,`py-2`,`text-[13px]`],[`role`,`status`,`data-testid`,`wiring-ports`,1,`mt-3`,`flex`,`flex-wrap`,`items-center`,`gap-3`,`rounded-md`,`border`,`border-danger/40`,`bg-danger/10`,`px-3`,`py-2`,`text-[13px]`],[`name`,`networks`,1,`text-danger`,3,`size`],[1,`min-w-0`,`flex-1`],[1,`text-ink-100`],[1,`text-[12px]`,`text-ink-400`],[`type`,`button`,`data-testid`,`wiring-recreate`,1,`mx-btn`,`mx-focus`,3,`disabled`],[`type`,`button`,1,`mx-btn`,`mx-focus`,3,`click`,`disabled`],[`name`,`plus`,3,`size`],[`type`,`button`,`data-testid`,`wiring-recreate`,1,`mx-btn`,`mx-focus`,3,`click`,`disabled`],[`name`,`refresh`,3,`size`],[`name`,`warning`,1,`text-danger`,3,`size`],[`type`,`button`,1,`mx-btn`,`mx-focus`,3,`disabled`],[1,`mx-focus`,`mt-2`,`inline-flex`,`items-center`,`gap-1`,`text-accent`,`hover:underline`,3,`routerLink`],[`rdxTabsRoot`,``,1,`flex`,`min-h-0`,`flex-1`,`flex-col`,3,`valueChange`,`value`],[`rdxTabsList`,``,1,`flex`,`shrink-0`,`gap-1`,`border-b`,`border-ink-700`,`px-6`],[`type`,`button`,`rdxTabsTab`,``,1,`mx-focus`,`-mb-px`,`cursor-pointer`,`border-b-2`,`border-transparent`,`px-3`,`py-2`,`text-[13px]`,`text-ink-400`,`transition-colors`,`hover:text-ink-100`,`data-[active]:border-accent`,`data-[active]:text-ink-100`,3,`value`],[`rdxTabsPanel`,``,`value`,`logs`,1,`min-h-0`,`flex-1`],[3,`containerId`,`name`],[`rdxTabsPanel`,``,`value`,`health`,1,`min-h-0`,`flex-1`],[`rdxTabsPanel`,``,`value`,`inspect`,1,`min-h-0`,`flex-1`,`overflow-auto`,`px-6`,`py-4`],[1,`rounded-md`,`border`,`border-danger/40`,`bg-danger/10`,`px-3`,`py-2`,`text-[13px]`,`text-danger`],[3,`value`],[`rdxTabsPanel`,``,`value`,`env`,1,`min-h-0`,`flex-1`],[`rdxTabsPanel`,``,`value`,`events`,1,`min-h-0`,`flex-1`],[3,`name`,`active`],[`rdxTabsPanel`,``,`value`,`terminal`,1,`min-h-0`,`flex-1`],[1,`px-6`,`py-5`,`text-[13px]`,`text-ink-400`],[`rdxTabsPanel`,``,`value`,`files`,1,`min-h-0`,`flex-1`],[3,`saveAsImage`,`containerId`,`active`],[`rdxTabsPanel`,``,`value`,`networks`,1,`min-h-0`,`flex-1`],[`rdxTabsPanel`,``,`value`,`assistant`,1,`min-h-0`,`flex-1`],[`rdxTabsPanel`,``,`value`,`stats`,1,`min-h-0`,`flex-1`,`overflow-auto`,`px-6`,`py-5`],[1,`grid`,`max-w-3xl`,`gap-6`,`sm:grid-cols-2`],[1,`rounded-lg`,`border`,`border-ink-700`,`bg-ink-850`,`p-4`],[1,`mt-1`,`text-2xl`,`font-semibold`,`tabular-nums`,`text-ink-100`],[1,`text-base`,`text-ink-400`],[`data-testid`,`cpu-limit`,1,`mt-1`,`text-[11px]`,`text-ink-500`],[`data-testid`,`memory-no-limit`,1,`mt-4`,`text-[11px]`,`text-ink-500`],[1,`mt-6`,`text-[13px]`,`text-ink-400`],[1,`mr-1.5`,`-mt-0.5`,`inline-flex`,`align-middle`,3,`name`,`size`],[3,`refresh`,`health`,`busy`],[3,`containerId`,`compose`],[3,`containerId`,`active`],[3,`containerId`],[`viewBox`,`0 0 100 30`,`preserveAspectRatio`,`none`,`aria-hidden`,`true`,1,`mt-3`,`h-16`,`w-full`],[`fill`,`none`,`stroke`,`currentColor`,`stroke-width`,`1`,`vector-effect`,`non-scaling-stroke`,1,`text-accent`],[1,`mt-1`,`text-[11px]`,`text-ink-500`],[1,`mt-3`,`h-16`],[1,`mt-4`,`h-2`,`w-full`,`overflow-hidden`,`rounded-full`,`bg-ink-800`],[1,`h-full`,`rounded-full`,`transition-[width]`],[`data-testid`,`memory-of-limit`,1,`mt-1`,`text-[11px]`,`text-ink-500`],[`role`,`status`,`data-testid`,`memory-near-limit`,1,`mt-2`,`text-[12px]`,`text-danger`],[3,`openChange`,`open`,`containerId`,`name`,`compose`],[3,`openChange`,`open`,`containerId`,`containerName`,`image`,`running`,`mounts`]],template:function(e,i){if(e&1){let l=$E();bg(0),Oi$1(1,`header`,0)(2,`a`,1),fS(3),Nc(),SE(4,Ha,13,8)(5,Ga,3,1,`div`,2),Nc(),SE(6,uo,43,25,`div`,3),Oi$1(7,`app-diagnosis-dialog`,4),vg(`openChange`,function(D){return Ld(l),vS(i.diagnosisOpen,D)||(i.diagnosisOpen=D),Od(D)}),Nc(),Oi$1(8,`app-run-command-dialog`,5),vg(`openChange`,function(D){return Ld(l),vS(i.runCommandOpen,D)||(i.runCommandOpen=D),Od(D)})(`formatChange`,function(D){return Ld(l),vS(i.runCommandFormat,D)||(i.runCommandFormat=D),Od(D)}),Nc(),Oi$1(9,`app-restart-policy-dialog`,4),vg(`openChange`,function(D){return Ld(l),vS(i.restartPolicyOpen,D)||(i.restartPolicyOpen=D),Od(D)}),Nc(),Oi$1(10,`app-memory-limit-dialog`,6),vg(`openChange`,function(D){return Ld(l),vS(i.memoryLimitOpen,D)||(i.memoryLimitOpen=D),Od(D)}),Jm(`saved`,function(){return i.onMemoryLimitSaved()}),Nc(),SE(11,xo,2,10),Oi$1(12,`app-cpu-limit-dialog`,6),vg(`openChange`,function(D){return Ld(l),vS(i.cpuLimitOpen,D)||(i.cpuLimitOpen=D),Od(D)}),Jm(`saved`,function(){return i.onMemoryLimitSaved()}),Nc(),Oi$1(13,`app-confirm-dialog`,7),vg(`openChange`,function(D){return Ld(l),vS(i.confirmOpen,D)||(i.confirmOpen=D),Od(D)}),Jm(`confirmed`,function(){return i.confirmRemove()}),Nc()}if(e&2){let l,c=yS(i.container());ec(3),Ac(` `,i.t().back,` `),ec(),kE(c?4:i.loaded()?5:-1),ec(2),kE(c?6:-1),ec(),hg(`open`,i.diagnosisOpen),Wm(`containerId`,i.id()),ec(),hg(`open`,i.runCommandOpen)(`format`,i.runCommandFormat),Wm(`containerId`,i.id())(`composeProject`,i.container()?.composeProject??null),ec(),hg(`open`,i.restartPolicyOpen),Wm(`containerId`,i.id()),ec(),hg(`open`,i.memoryLimitOpen),Wm(`containerId`,i.id())(`compose`,!!i.container()?.composeProject),ec(),kE((l=i.container())?11:-1,l),ec(),hg(`open`,i.cpuLimitOpen),Wm(`containerId`,i.id())(`compose`,!!i.container()?.composeProject),ec(),hg(`open`,i.confirmOpen),Wm(`title`,i.t().confirmTitle)(`description`,i.t().confirmDescription)}},dependencies:[Yt,we$1,fi$1,gi$1,_e,My,Ee,Te,Me,Ne,Ve,Pe,W,he,Ie,ke,Ce,we,ee,Se,De,Qt,V,c$1,Me$1],encapsulation:2})}})();export{Ut as ContainerDetail};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as
|
|
1
|
+
import{B as Kr,Q as OD,U as M,Xn as rf,cn as f$1}from"./chunk-BdOOWVGY.js";import{E as tn,g as en}from"./chunk-eG8Su12W.js";function L(r){return{provide:v,useFactory:r}}var p;var N;var f;var v;var g=f$1(()=>{Kr();tn();p={mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}},N=50,f=class{constructor(e){this.host=e,this.nodes=[],this.prevAnimationNames=new WeakMap,this.pendingExits=new Set,this.removeListeners=null,this.closeTimestamp=0,this.exitVersion=0,this.waapiPending=!1,this.safetyTimer=null,this.prevPresent=e.present(),this.state=this.prevPresent?`mounted`:`unmounted`,this.prevPresent&&this.mount(),rf(()=>{let i=e.present();i!==this.prevPresent&&(this.prevPresent=i,i?this.send(`MOUNT`):e.isBrowser?(this.closeTimestamp=this.now(),OD(()=>this.evaluateExit(),{injector:e.injector})):this.send(`UNMOUNT`))},{injector:e.injector,debugName:`PresenceMachine.present`})}dispose(){this.unmount()}evaluateExit(){if(this.state!==`mounted`||this.host.present())return;this.pendingExits.clear();for(let i of this.nodes){let t=getComputedStyle(i),n=t.animationName||`none`,s=this.prevAnimationNames.get(i)??`none`;n!==`none`&&t.display!==`none`&&s!==n&&this.pendingExits.add(i)}let e=this.collectExitAnimations();if(this.pendingExits.size===0&&e.length===0){this.send(`UNMOUNT`);return}if(this.send(`ANIMATION_OUT`),e.length>0){this.waapiPending=!0;let i=this.exitVersion;Promise.all(e.map(t=>t.finished.catch(()=>{}))).then(()=>this.finishExit(i)),this.armSafetyNet(i,e)}}collectExitAnimations(){if(!this.host.isBrowser)return[];let e=[];for(let i of this.nodes)if(typeof i.getAnimations==`function`)for(let t of i.getAnimations({subtree:!0})){let n=t.startTime===null||Number(t.startTime)>=this.closeTimestamp;(t.playState===`running`||t.pending)&&n&&e.push(t)}return e}armSafetyNet(e,i){let t=new Set(this.nodes);for(let s of i){let o=s.effect?.target;o instanceof HTMLElement&&t.add(o)}let n=0;for(let s of t)n=Math.max(n,en(s));this.clearSafetyNet(),this.safetyTimer=setTimeout(()=>this.finishExit(e),n+N)}finishExit(e){e===this.exitVersion&&(this.waapiPending=!1,this.clearSafetyNet(),this.send(`ANIMATION_END`))}clearSafetyNet(){this.safetyTimer!==null&&(clearTimeout(this.safetyTimer),this.safetyTimer=null)}send(e){let i=p[this.state][e];if(!(i===void 0||i===this.state))if(this.state=i,i===`mounted`)if(this.exitVersion++,this.waapiPending=!1,this.clearSafetyNet(),this.nodes.length>0){this.pendingExits.clear();for(let t of this.nodes)this.prevAnimationNames.set(t,this.getAnimationName(t))}else this.mount();else i===`unmounted`&&(this.exitVersion++,this.unmount())}mount(){if(this.nodes=this.host.mountView(),this.host.isBrowser&&this.nodes.length>0){for(let e of this.nodes)this.prevAnimationNames.set(e,this.getAnimationName(e));this.addAnimationListeners()}}unmount(){this.removeListeners?.(),this.removeListeners=null,this.clearSafetyNet(),this.waapiPending=!1,this.host.destroyView(),this.nodes=[],this.pendingExits.clear()}addAnimationListeners(){let e=t=>{let n=t.target;this.nodes.includes(n)&&this.prevAnimationNames.set(n,this.getAnimationName(n))},i=t=>{let n=t.target;this.nodes.includes(n)&&this.getAnimationName(n).includes(t.animationName)&&(this.pendingExits.delete(n),!this.waapiPending&&this.pendingExits.size===0&&this.finishExit(this.exitVersion))};for(let t of this.nodes)t.addEventListener(`animationstart`,e),t.addEventListener(`animationcancel`,i),t.addEventListener(`animationend`,i);this.removeListeners=()=>{for(let t of this.nodes)t.removeEventListener(`animationstart`,e),t.removeEventListener(`animationcancel`,i),t.removeEventListener(`animationend`,i)}}getAnimationName(e){return(this.host.isBrowser?getComputedStyle(e).animationName:``)||`none`}now(){let e=typeof document<`u`?document.timeline?.currentTime:null;return typeof e==`number`?e:Number(e??0)}},v=new M(`RdxPresenceContext`)});export{v as i,f as n,g as r,L as t};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{$n as sk,$t as bg,Bn as ok,Ct as Tg,D as
|
|
1
|
+
import{$n as sk,$t as bg,A as HE,B as Kr,Bn as ok,Ct as Tg,D as Gm,Dn as kc,En as kE,Fn as nS,Ft as Wr,Gn as pj,Gt as _m,H as Ld,J as Nc,K as My,Kn as qr,Nn as mg,Nt as W,Pn as mj,Pt as Wm,R as Jm,St as Tc,Tn as jc,Wn as pg,Xn as rf,Xt as bS,_t as Sc,br as yS,cn as f,cr as ve,et as Od,f as C,gr as wt$1,gt as SS,ht as SE,jn as lk,ln as fS,lr as vg,mr as wc,o as Ac,on as eH,or as vS,qt as ag,rn as dk,rt as Ot$1,sn as ec,t as $E,tt as Oi,u as Br,w as G,xn as hg,z as Km}from"./chunk-BdOOWVGY.js";import{n as y,t as f$1}from"./chunk-CrBxmi_g.js";import"./chunk-V7ftX_10.js";import{n as y$1,t as c}from"./chunk-iwVkNYYA.js";import"./chunk-D29s9m84.js";import{n as o,t as i}from"./chunk-Zcfhi-RM.js";import"./chunk-eG8Su12W.js";import"./chunk-Bx2_SrZM.js";import{_ as pn,d as dn,f as fn,g as ln,l as an,m as ie,r as Je$1,u as cn,v as un}from"./chunk-QaMufr3I.js";import{n as v,t as u}from"./chunk-BoN9ZlqT.js";import{n as x,t as u$1}from"./chunk-BW20bBdg.js";import{a as Yt,r as Q,s as fe,u as ra}from"./chunk-DzG5R5Kk.js";import{n as V,t as G$1}from"./chunk-CWusqRG0.js";import{n as W$1,t as J}from"./chunk-DZjRtM2K.js";import{n as u$2,t as c$1}from"./chunk-cYufOe8J.js";function Ke(n,t){if(n&1){let e=$E();Oi(0,`button`,18),Jm(`click`,function(){let o=Ld(e).$implicit;return Od(HE(2).view.set(o))}),fS(1),Nc()}if(n&2){let e=t.$implicit,i=HE(2);ag(`border-accent`,i.view()===e)(`text-accent`,i.view()===e),Br(`data-testid`,`compose-view-`+e)(`aria-pressed`,i.view()===e),ec(),Ac(` `,e===`raw`?i.t().raw:i.t().resolved,` `)}}function Qe(n,t){n&1&&(Oi(0,`pre`,9),fS(1),Nc()),n&2&&(ec(),pg(t))}function Je(n,t){n&1&&(Oi(0,`p`,10),fS(1),Nc()),n&2&&(ec(),pg(t))}function Xe(n,t){if(n&1&&(Oi(0,`p`,11),fS(1),Nc()),n&2){let e=HE(2);ec(),pg(e.t().loading)}}function Ye(n,t){n&1&&(Oi(0,`span`,13),fS(1),Nc()),n&2&&(ec(),pg(t))}function Ze(n,t){if(n&1){let e=$E();Gm(0,`div`,2),Oi(1,`div`,3)(2,`div`,4)(3,`h2`,5),fS(4),Nc(),Oi(5,`p`,6),fS(6),Nc(),Oi(7,`div`,7),kc(8,Ke,2,7,`button`,8,Sc),Nc(),SE(10,Qe,2,1,`pre`,9)(11,Je,2,1,`p`,10)(12,Xe,2,1,`p`,11),Oi(13,`div`,12),SE(14,Ye,2,1,`span`,13),Oi(15,`button`,14),Gm(16,`app-icon`,15),fS(17),Nc(),Oi(18,`button`,16),Jm(`click`,function(){Ld(e);return Od(HE().copy())}),Gm(19,`app-icon`,17),fS(20),Nc()()()()}if(n&2){let e,i,o=HE();ec(4),pg(o.t().title(o.project())),ec(2),Ac(` `,o.view()===`raw`?o.t().rawHint:o.t().resolvedHint,` `),ec(2),Tc(o.views),ec(2),kE((e=o.body())?10:(e=o.problem())?11:12,e),ec(4),kE((i=o.copyProblem())?14:-1,i),ec(2),Wm(`size`,14),ec(),Ac(` `,o.common().close,` `),ec(),Wm(`disabled`,o.body()===null),ec(),Wm(`name`,o.copied()?`check`:`copy`)(`size`,14),ec(),Ac(` `,o.copied()?o.common().copied:o.common().copy,` `)}}var se;var Ne=f(()=>{Kr();Je$1();lk();dk();sk();Kr();se=class n{open=mj(!1);project=jc.required();t=Ot$1(()=>ok().compose.file);common=Ot$1(()=>ok().common);views=[`raw`,`resolved`];view=wt$1(`raw`);files=wt$1(null);config=wt$1(null);copied=wt$1(!1);copyProblem=wt$1(null);constructor(){rf(()=>{if(!this.open())return;let t=this.project();Tg(()=>{this.load(t)})})}body(){if(this.view()===`resolved`){let e=this.config();return e?.ok===!0?e.yaml:null}let t=this.files();return t?.ok!==!0?null:t.files.map(e=>`# ${e.path}
|
|
2
2
|
${e.problem??(e.content.trim()===``?this.t().empty:e.content)}`).join(`
|
|
3
3
|
|
|
4
|
-
`)}problem(){let t=this.view()===`resolved`?this.config():this.files();return t?.ok===!1?t.problem:null}async copy(){let t=this.body();if(t!==null)try{await navigator.clipboard.writeText(t),this.copyProblem.set(null),this.copied.set(!0),setTimeout(()=>this.copied.set(!1),1500)}catch(e){this.copyProblem.set(this.t().copyFailed(eH(e)))}}async load(t){this.files.set(null),this.config.set(null),this.copied.set(!1),this.copyProblem.set(null),this.view.set(`raw`);let[e,i]=await Promise.all([window.electron.compose.files(t).catch(o=>({ok:!1,problem:eH(o)})),window.electron.compose.config(t).catch(o=>({ok:!1,problem:eH(o)}))]);this.files.set(e),this.config.set(i)}static ɵfac=function(e){return new(e||n)};static ɵcmp=wc({type:n,selectors:[[`app-compose-file-dialog`]],inputs:{open:[1,`open`],project:[1,`project`]},outputs:{open:`openChange`},decls:2,vars:1,consts:[[`rdxDialogRoot`,``,3,`openChange`,`open`],[`rdxDialogPortal`,``],[`rdxDialogBackdrop`,``,1,`fixed`,`inset-0`,`z-40`,`bg-black/50`],[`rdxDialogViewport`,``,1,`fixed`,`inset-0`,`z-50`,`grid`,`place-items-center`,`p-4`],[`rdxDialogPopup`,``,`data-testid`,`compose-file-dialog`,1,`flex`,`max-h-[85vh]`,`w-full`,`max-w-4xl`,`flex-col`,`rounded-lg`,`border`,`border-ink-700`,`bg-ink-850`,`p-5`,`shadow-2xl`],[`rdxDialogTitle`,``,1,`text-[15px]`,`font-semibold`,`text-ink-100`],[`rdxDialogDescription`,``,1,`mt-1`,`text-[13px]`,`text-ink-400`],[1,`mt-3`,`flex`,`shrink-0`,`gap-1`],[`type`,`button`,1,`mx-btn`,`mx-focus`,3,`border-accent`,`text-accent`],[`data-testid`,`compose-file-text`,1,`mt-3`,`min-h-0`,`flex-1`,`overflow-auto`,`rounded-md`,`border`,`border-ink-700`,`bg-ink-900`,`p-3`,`font-mono`,`text-[12px]`,`leading-relaxed`,`whitespace-pre`,`text-ink-200`],[1,`mt-4`,`rounded-md`,`border`,`border-danger/40`,`bg-danger/10`,`px-3`,`py-2`,`text-[13px]`,`text-danger`],[1,`mt-4`,`text-[13px]`,`text-ink-400`],[1,`mt-4`,`flex`,`items-center`,`justify-end`,`gap-2`],[1,`mr-auto`,`text-[12px]`,`text-danger`],[`type`,`button`,`rdxDialogClose`,``,1,`mx-btn`,`mx-focus`],[`name`,`close`,3,`size`],[`type`,`button`,`data-testid`,`compose-file-copy`,1,`mx-btn`,`mx-focus`,3,`click`,`disabled`],[3,`name`,`size`],[`type`,`button`,1,`mx-btn`,`mx-focus`,3,`click`]],template:function(e,i){e&1&&(Oi(0,`div`,0),vg(`openChange`,function(s){return vS(i.open,s)||(i.open=s),s}),_m(1,Ze,21,10,`ng-template`,1),Nc()),e&2&&hg(`open`,i.open)},dependencies:[ie,ln,an,pn,cn,fn,dn,un,My],encapsulation:2})}});function et(n,t){if(n&1&&(qr(0,`p`,1),fS(1),Wr()),n&2){let e=HE();ec(),pg(e.t().done(e.service()))}}function tt(n,t){if(n&1&&(qr(0,`p`,2),fS(1),Wr()),n&2){let e=HE();ec(),pg(e.problem())}}function nt(n,t){if(n&1&&(qr(0,`details`,3)(1,`summary`,4),fS(2),Wr(),qr(3,`pre`,5),fS(4),Wr()()),n&2){let e=HE();Km(`open`,!e.result().ok),ec(2),pg(e.t().output),ec(2),pg(e.result().output)}}function it(n,t){if(n&1&&Gm(0,`app-build-output`,2),n&2)Wm(`service`,HE().service())(`result`,t)}var A;var L;var ge=f(()=>{Kr();lk();sk();dk();Kr();A=class n{service=jc.required();result=jc.required();t=Ot$1(()=>ok().compose.build);problem(){let t=this.result();return t.ok?``:t.problem}static ɵfac=function(e){return new(e||n)};static ɵcmp=wc({type:n,selectors:[[`app-build-output`]],hostAttrs:[1,`block`],inputs:{service:[1,`service`],result:[1,`result`]},decls:4,vars:3,consts:[[1,`text-[12px]`],[1,`text-ok`],[1,`whitespace-pre-line`,`text-danger`],[1,`mt-1`,3,`open`],[1,`cursor-pointer`,`text-ink-400`,`hover:text-ink-200`],[1,`mt-1`,`max-h-64`,`overflow-auto`,`rounded-md`,`border`,`border-ink-700`,`bg-ink-900`,`p-2`,`font-mono`,`text-[11px]`,`leading-snug`,`whitespace-pre-wrap`,`text-ink-300`]],template:function(e,i){e&1&&(qr(0,`div`,0),SE(1,et,2,1,`p`,1)(2,tt,2,1,`p`,2),SE(3,nt,5,3,`details`,3),Wr()),e&2&&(Br(`data-testid`,`service-build-result-`+i.service()),ec(),kE(i.result().ok?1:2),ec(2),kE(i.result().output!==``?3:-1))},encapsulation:2})},L=class n{project=jc.required();service=jc.required();disabled=jc(!1);showResult=jc(!0);finished=pj();t=Ot$1(()=>ok().compose.build);busy=wt$1(!1);result=wt$1(null);async build(){this.busy.set(!0),this.result.set(null);let t;try{t=await window.electron.compose.rebuild(this.project(),this.service())}catch(e){t={ok:!1,problem:eH(e),output:``}}this.result.set(t),this.busy.set(!1),this.finished.emit(t)}static ɵfac=function(e){return new(e||n)};static ɵcmp=wc({type:n,selectors:[[`app-service-build`]],hostAttrs:[1,`block`],inputs:{project:[1,`project`],service:[1,`service`],disabled:[1,`disabled`],showResult:[1,`showResult`]},outputs:{finished:`finished`},decls:4,vars:7,consts:[[`type`,`button`,1,`mx-btn`,`mx-focus`,3,`click`,`disabled`,`title`],[`name`,`refresh`,3,`size`],[1,`mt-2`,3,`service`,`result`]],template:function(e,i){if(e&1&&(Oi(0,`button`,0),Jm(`click`,function(){return i.build()}),Gm(1,`app-icon`,1),fS(2),Nc(),SE(3,it,1,2,`app-build-output`,2)),e&2){let o;Wm(`disabled`,i.busy()||i.disabled())(`title`,i.t().title),Br(`aria-label`,i.t().aria(i.service()))(`data-testid`,`service-build-`+i.service()),ec(),Wm(`size`,14),ec(),Ac(` `,i.busy()?i.t().busy:i.t().button,` `),ec(),kE((o=i.showResult()&&i.result())?3:-1,o)}},dependencies:[My,A],encapsulation:2})}});function rt(n,t){if(n&1&&(Oi(0,`p`,7),fS(1),Nc()),n&2){let e=HE(2);ec(),pg(e.t().loading)}}function lt(n,t){if(n&1&&(Oi(0,`li`,14),Gm(1,`app-icon`,16),Oi(2,`span`,17),fS(3),Nc(),Oi(4,`span`,18),fS(5),Nc(),Oi(6,`span`,19),fS(7),Nc()()),n&2){let e=t.$implicit,i=HE(3);ec(),nS(i.iconClass(e)),Wm(`name`,i.iconOf(e))(`size`,13),ec(),Wm(`title`,e.reference),ec(),pg(e.reference),ec(2),pg(e.services.join(`, `)),ec(),nS(e.state===`failed`?`text-danger`:`text-ink-400`),Wm(`title`,e.problem??``),ec(),Ac(` `,i.stateOf(e),` `)}}function dt(n,t){if(n&1&&Gm(0,`app-service-build`,23),n&2){let e=HE().$implicit,i=HE(3);Wm(`project`,i.project())(`service`,e.service)(`disabled`,!i.finished())}}function st(n,t){if(n&1&&(Oi(0,`li`,15)(1,`div`,14),Gm(2,`app-icon`,20),Oi(3,`span`,21),fS(4),Nc(),Oi(5,`span`,22),fS(6),Nc()(),SE(7,dt,1,3,`app-service-build`,23),Nc()),n&2){let e=t.$implicit,i=HE(3);ec(2),Wm(`size`,13),ec(2),pg(e.service),ec(2),pg(e.reason===`build`?i.t().skippedBuild:i.t().skippedDigest),ec(),kE(e.reason===`build`?7:-1)}}function pt(n,t){if(n&1&&(Oi(0,`ul`,8),kc(1,lt,8,11,`li`,14,ot),kc(3,st,8,4,`li`,15,at),Nc()),n&2){let e=HE(2);ec(),Tc(e.rows()),ec(2),Tc(e.skipped())}}function ct(n,t){if(n&1&&(Oi(0,`p`,7),fS(1),Nc()),n&2){let e=HE(2);ec(),pg(e.t().noImages)}}function mt(n,t){n&1&&(Oi(0,`p`,9),fS(1),Nc()),n&2&&(ec(),pg(t))}function ut(n,t){if(n&1&&(Oi(0,`p`,7),fS(1),Nc()),n&2){let e=HE(2);ec(),pg(e.t().checking)}}function _t(n,t){if(n&1&&(Oi(0,`p`,24),Gm(1,`app-icon`,25),fS(2),Nc()),n&2){let e=HE(3);ec(),Wm(`size`,13),ec(),Ac(` `,e.t().upToDate)}}function gt(n,t){if(n&1&&(Oi(0,`p`,28),fS(1),Nc()),n&2){let e=HE(),i=HE(4);ec(),pg(i.t().renewed(e.renewed.join(`, `)))}}function xt(n,t){if(n&1&&(Oi(0,`p`,29),fS(1),Nc()),n&2){let e=HE(),i=HE(4);ec(),pg(i.t().unchanged(e.unchanged.join(`, `)))}}function ft(n,t){if(n&1&&(Oi(0,`p`,30),fS(1),Nc()),n&2){let e=t.$implicit;ec(),pg(e)}}function yt(n,t){if(n&1&&(SE(0,gt,2,1,`p`,28),SE(1,xt,2,1,`p`,29),kc(2,ft,2,1,`p`,30,Sc)),n&2){let e=t;kE(e.renewed.length>0?0:-1),ec(),kE(e.unchanged.length>0?1:-1),ec(),Tc(e.problems)}}function bt(n,t){if(n&1){let e=RE();Oi(0,`div`,27)(1,`button`,31),Jm(`click`,function(){Ld(e);return Od(HE(4).renew())}),Gm(2,`app-icon`,32),fS(3),Nc(),Oi(4,`span`,33),fS(5),Nc()()}if(n&2){let e=HE(4);ec(),Wm(`disabled`,e.phase()===`renewing`),ec(),Wm(`size`,14),ec(),Ac(` `,e.phase()===`renewing`?e.t().renewing:e.t().renew,` `),ec(2),pg(e.t().renewHint)}}function vt(n,t){if(n&1&&(Oi(0,`p`,26),fS(1),Nc(),SE(2,yt,4,2)(3,bt,6,4,`div`,27)),n&2){let e,i=HE(),o=HE(2);ec(),pg(o.t().stale(i.join(`, `))),ec(),kE((e=o.result())?2:3,e)}}function ht(n,t){n&1&&(Oi(0,`div`,10),SE(1,_t,3,2,`p`,24)(2,vt,4,2),Nc()),n&2&&(ec(),kE(t.length===0?1:2))}function Ct(n,t){if(n&1&&(Gm(0,`div`,2),Oi(1,`div`,3)(2,`div`,4)(3,`h2`,5),fS(4),Nc(),Oi(5,`p`,6),fS(6),Nc(),SE(7,rt,2,1,`p`,7),SE(8,pt,5,0,`ul`,8)(9,ct,2,1,`p`,7),SE(10,mt,2,1,`p`,9),SE(11,ut,2,1,`p`,7),SE(12,ht,3,1,`div`,10),Oi(13,`div`,11)(14,`button`,12),Gm(15,`app-icon`,13),fS(16),Nc()()()()),n&2){let e,i,o=HE();ec(4),pg(o.t().title(o.project())),ec(2),pg(o.t().description),ec(),kE(o.phase()===`loading`?7:-1),ec(),kE(o.rows().length>0||o.skipped().length>0?8:o.phase()!==`loading`&&o.phase()!==`failed`?9:-1),ec(2),kE((e=o.problem())?10:-1,e),ec(),kE(o.phase()===`checking`?11:-1),ec(),kE((i=o.stale())?12:-1,i),ec(3),Wm(`size`,14),ec(),Ac(` `,o.finished()?o.common().close:o.common().cancel,` `)}}function wt(n){let t=n.layers.reduce((e,i)=>e+i.total,0);return t===0?null:Math.round(n.layers.reduce((e,i)=>e+i.current,0)/t*100)}var ot;var at;var pe;var Be=f(()=>{Kr();Je$1();lk();sk();dk();ge();Kr();ot=(n,t)=>t.reference,at=(n,t)=>t.service;pe=class n{open=mj(!1);project=jc.required();t=Ot$1(()=>ok().compose.update);common=Ot$1(()=>ok().common);phase=wt$1(`loading`);rows=wt$1([]);skipped=wt$1([]);stale=wt$1(null);result=wt$1(null);problem=wt$1(null);finished=Ot$1(()=>[`ready`,`done`,`failed`].includes(this.phase()));round=0;stopPull=null;constructor(){C(ve).onDestroy(()=>this.cancel()),rf(()=>{let t=this.open(),e=this.project();Tg(()=>{t?this.start(e):this.cancel()})})}stateOf(t){let e=this.t();switch(t.state){case`waiting`:return e.waiting;case`pulling`:return t.percent===null?e.pulling:`${e.pulling} ${String(t.percent)}%`;case`done`:return e.pulled;case`failed`:return e.failed(t.problem??``)}}iconOf(t){return t.state===`done`?`check`:t.state===`failed`?`warning`:`download`}iconClass(t){return t.state===`done`?`text-ok`:t.state===`failed`?`text-danger`:t.state===`pulling`?`text-accent`:`text-ink-500`}cancel(){this.round+=1,this.stopPull?.(),this.stopPull=null}async start(t){this.cancel();let e=this.round,i=()=>e===this.round;this.phase.set(`loading`),this.rows.set([]),this.skipped.set([]),this.stale.set(null),this.result.set(null),this.problem.set(null);try{let o=await window.electron.compose.images(t);if(!i())return;this.rows.set(o.images.map(u=>G(W({},u),{state:`waiting`,percent:null,problem:null}))),this.skipped.set(o.skipped),this.phase.set(`pulling`);for(let u of o.images)if(await this.pull(u.reference,i),!i())return;this.phase.set(`checking`);let s=await window.electron.compose.stale(t);i()&&(this.stale.set(s),this.phase.set(`ready`))}catch(o){i()&&(this.problem.set(eH(o)),this.phase.set(`failed`))}}async pull(t,e){let i=s=>{e()&&this.rows.update(u=>u.map(R=>R.reference===t?W(W({},R),s):R))};i({state:`pulling`});let o=await window.electron.images.pull(t);if(!o.ok){i({state:`failed`,problem:o.problem});return}await new Promise(s=>{let u=window.electron.images.onPullProgress(o.streamId,G=>{if(!G.done){i({percent:wt(G)});return}i(G.problem===null?{state:`done`,percent:null}:{state:`failed`,problem:G.problem}),R()}),R=()=>{u(),window.electron.images.close(o.streamId),this.stopPull=null,s()};this.stopPull=R})}async renew(){let t=this.round;this.phase.set(`renewing`);try{let e=await window.electron.compose.renew(this.project());t===this.round&&(this.result.set(e),this.phase.set(`done`))}catch(e){t===this.round&&(this.result.set({renewed:[],unchanged:[],problems:[eH(e)]}),this.phase.set(`done`))}}static ɵfac=function(e){return new(e||n)};static ɵcmp=wc({type:n,selectors:[[`app-project-update-dialog`]],inputs:{open:[1,`open`],project:[1,`project`]},outputs:{open:`openChange`},decls:2,vars:1,consts:[[`rdxDialogRoot`,``,3,`openChange`,`open`],[`rdxDialogPortal`,``],[`rdxDialogBackdrop`,``,1,`fixed`,`inset-0`,`z-40`,`bg-black/50`],[`rdxDialogViewport`,``,1,`fixed`,`inset-0`,`z-50`,`grid`,`place-items-center`,`p-4`],[`rdxDialogPopup`,``,`data-testid`,`project-update`,1,`w-full`,`max-w-2xl`,`rounded-lg`,`border`,`border-ink-700`,`bg-ink-850`,`p-5`,`shadow-2xl`],[`rdxDialogTitle`,``,1,`text-[15px]`,`font-semibold`,`text-ink-100`],[`rdxDialogDescription`,``,1,`mt-1`,`text-[13px]`,`text-ink-400`],[1,`mt-4`,`text-[13px]`,`text-ink-400`],[`data-testid`,`project-update-images`,1,`mt-4`,`space-y-1.5`,`text-[13px]`],[1,`mt-4`,`text-[13px]`,`text-danger`],[`data-testid`,`project-update-stale`,1,`mt-4`,`rounded-md`,`border`,`border-ink-700`,`bg-ink-800`,`px-3`,`py-2.5`,`text-[13px]`],[1,`mt-5`,`flex`,`justify-end`],[`type`,`button`,`rdxDialogClose`,``,1,`mx-btn`,`mx-focus`],[`name`,`close`,3,`size`],[1,`flex`,`items-center`,`gap-3`],[1,`text-ink-500`],[3,`name`,`size`],[1,`min-w-0`,`truncate`,`font-mono`,`text-ink-100`,3,`title`],[1,`min-w-0`,`truncate`,`text-ink-500`],[1,`ml-auto`,`shrink-0`,`text-[12px]`,3,`title`],[`name`,`code`,3,`size`],[1,`font-mono`],[1,`ml-auto`,`text-[12px]`],[1,`mt-1.5`,`ml-6`,3,`project`,`service`,`disabled`],[1,`flex`,`items-center`,`gap-2`,`text-ink-300`],[`name`,`check`,1,`text-ok`,3,`size`],[1,`text-ink-200`],[1,`mt-2.5`,`flex`,`items-center`,`gap-3`],[1,`mt-2`,`text-ok`],[1,`mt-1`,`text-ink-400`],[1,`mt-2`,`text-danger`],[`type`,`button`,`data-testid`,`project-update-renew`,1,`mx-btn`,`mx-focus`,3,`click`,`disabled`],[`name`,`refresh`,3,`size`],[1,`text-[12px]`,`text-ink-500`]],template:function(e,i){e&1&&(Oi(0,`div`,0),vg(`openChange`,function(s){return vS(i.open,s)||(i.open=s),s}),_m(1,Ct,17,9,`ng-template`,1),Nc()),e&2&&hg(`open`,i.open)},dependencies:[ie,ln,an,pn,cn,fn,dn,un,My,L],encapsulation:2})}});function jt(n,t){if(n&1&&(Oi(0,`div`,6),fS(1),Nc()),n&2){let e=HE();ec(),pg(e.version)}}function St(n,t){if(n&1&&(Oi(0,`div`,13),fS(1),Nc()),n&2){let e=HE();ec(),pg(e.problem)}}function Et(n,t){n&1&&SE(0,jt,2,1,`div`,6)(1,St,2,1,`div`,13),n&2&&kE(t.cliAvailable?0:1)}function Mt(n,t){if(n&1&&(Oi(0,`div`,6),fS(1),Nc()),n&2){let e=HE();ec(),pg(e.t().updating)}}function Tt(n,t){if(n&1&&(Oi(0,`span`,20),fS(1),Nc()),n&2){let e=t;Wm(`title`,e),ec(),pg(e)}}function It(n,t){if(n&1&&(Oi(0,`div`,23),fS(1),Nc()),n&2){let e=HE(2);ec(),pg(e.t().busy)}}function Rt(n,t){if(n&1&&(Oi(0,`div`,26),Gm(1,`app-icon`,27),fS(2),Nc()),n&2){let e=t,i=HE().$implicit,o=HE();nS(e.problem?`text-danger`:`text-accent`),Wm(`title`,e.problem?``:o.t().driftTitle),Br(`data-testid`,`compose-drift-`+i.name),ec(),Wm(`name`,e.problem?`warning`:`file`)(`size`,12),ec(),Ac(` `,e.text,` `)}}function Ft(n,t){if(n&1&&(Oi(0,`span`,31),fS(1),Nc()),n&2){let e=HE().$implicit,i=HE(2).$implicit,o=HE();Wm(`title`,o.t().driftTitle),Br(`data-testid`,`compose-drift-`+i.name+`-`+e.name),ec(),pg(o.t().drift)}}function Nt(n,t){if(n&1){let e=RE();Oi(0,`app-service-build`,37),Jm(`finished`,function(o){Ld(e);let s=HE().$implicit,u=HE(2).$implicit;return Od(HE().afterBuild(u.name,s.name,o))}),Nc()}if(n&2){let e=HE().$implicit,i=HE(2).$implicit,o=bS(0);Wm(`project`,i.name)(`service`,e.name)(`disabled`,o)(`showResult`,!1)}}function Bt(n,t){if(n&1&&Gm(0,`app-build-output`,35),n&2){let e=HE().$implicit;Wm(`service`,e.name)(`result`,t)}}function Ot(n,t){if(n&1&&(Oi(0,`span`,41),fS(1),Nc()),n&2){let e=t.$implicit;ec(),Ac(` `,e.hostPort?e.hostPort+`:`+e.containerPort:e.containerPort,` `)}}function $t(n,t){if(n&1&&(Oi(0,`span`,39),kc(1,Ot,2,1,`span`,41,Pt),Nc()),n&2){let e=HE().$implicit;ec(),Tc(e.ports.slice(0,2))}}function Vt(n,t){if(n&1&&(Oi(0,`div`,36),Gm(1,`app-state-dot`,17),Oi(2,`a`,38),fS(3),Nc(),Oi(4,`span`,39),fS(5),Nc(),Oi(6,`span`,40),fS(7),Nc(),SE(8,$t,3,0,`span`,39),Nc()),n&2){let e=t.$implicit;ec(),Wm(`state`,e.state),ec(),Wm(`routerLink`,SS(6,Dt,e.id)),ec(),pg(e.name),ec(2),pg(e.status),ec(2),pg(e.image),ec(),kE(e.ports.length>0?8:-1)}}function zt(n,t){if(n&1){let e=RE();Oi(0,`div`,28)(1,`div`,29)(2,`div`,30),fS(3),Nc(),SE(4,Ft,2,3,`span`,31),SE(5,Nt,1,4,`app-service-build`,32),Oi(6,`button`,33),Jm(`click`,function(){let o=Ld(e).$implicit,s=HE(2).$implicit;return Od(HE().recreate(s,o))}),Gm(7,`app-icon`,34),fS(8),Nc()(),SE(9,Bt,1,2,`app-build-output`,35),kc(10,Vt,9,8,`div`,36,kt),Nc()}if(n&2){let e,i=t.$implicit,o=HE(2).$implicit,s=bS(0),u=HE();ec(3),pg(i.name),ec(),kE(u.drifted(o.name,i.name)?4:-1),ec(),kE(u.canBuild(o.name,i.name)?5:-1),ec(),ag(`ml-auto`,!u.canBuild(o.name,i.name)),Wm(`disabled`,s||!u.canCompose(o))(`title`,u.canCompose(o)?u.t().recreateTitle:u.composeBlockedReason(o)),Br(`data-testid`,`compose-recreate-`+i.name)(`aria-label`,u.t().recreateAria(i.name)),ec(),Wm(`size`,14),ec(),Ac(` `,u.t().recreate,` `),ec(),kE((e=u.buildResult(o.name,i.name))?9:-1,e),ec(),Tc(i.containers)}}function Ut(n,t){if(n&1&&(Oi(0,`div`,25),kc(1,zt,12,12,`div`,28,$e),Nc()),n&2){let e=HE().$implicit;ec(),Tc(e.services)}}function Lt(n,t){if(n&1){let e=RE();bg(0),Oi(1,`div`,9)(2,`div`,14)(3,`button`,15),Jm(`click`,function(){let o=Ld(e).$implicit;return Od(HE().toggle(o.name))}),Gm(4,`app-icon`,16)(5,`app-state-dot`,17),Oi(6,`span`,18),fS(7),Nc()(),Oi(8,`span`,19),fS(9),Nc(),SE(10,Tt,2,2,`span`,20),Oi(11,`div`,21)(12,`app-action-menu`,22),Jm(`picked`,function(o){let s=Ld(e).$implicit;return Od(HE().onProjectMenu(o,s))}),Nc()()(),SE(13,It,2,1,`div`,23),SE(14,Rt,3,7,`div`,24),SE(15,Ut,3,0,`div`,25),Nc()}if(n&2){let e,i,o=t.$implicit,s=HE(),u=yS(s.busy(o));ec(3),Br(`aria-expanded`,s.isExpanded(o.name))(`aria-label`,s.isExpanded(o.name)?s.t().collapse(o.name):s.t().expand(o.name)),ec(),Wm(`name`,s.isExpanded(o.name)?`chevronDown`:`chevronRight`)(`size`,14),ec(),Wm(`state`,o.state),ec(2),pg(o.name),ec(2),mg(` `,s.projectLabelOf(o.state),` · `,s.t().runningOf(o.running,o.total),` `),ec(),kE((e=o.workingDir)?10:-1,e),ec(2),Wm(`label`,s.t().menuAria(o.name))(`items`,s.projectMenu(o)),ec(),kE(u?13:-1),ec(),kE((i=s.driftNote(o.name))?14:-1,i),ec(),kE(s.isExpanded(o.name)?15:-1)}}function Wt(n,t){if(n&1&&(Oi(0,`p`,10),fS(1),Nc()),n&2){let e=HE();ec(),pg(e.t().empty)}}var Dt;var $e;var kt;var Pt;var Oe;f(()=>{Kr();ra();y();y$1();v();sk();J();dk();x();u$2();Ne();Be();ge();G$1();o();Kr();Dt=n=>[`/containers`,n],$e=(n,t)=>t.name,kt=(n,t)=>t.id,Pt=(n,t)=>t.containerPort;Oe=class n{containers=C(u);compose=C(c);t=Ot$1(()=>ok().compose);common=Ot$1(()=>ok().common);loading=this.containers.loading;problem=this.containers.problem;composePending=this.compose.pending;containerPending=this.containers.pending;status=this.compose.status;projects=Ot$1(()=>f$1(this.containers.containers()));expanded=wt$1(new Set);confirmOpen=wt$1(!1);fileOpen=wt$1(!1);fileProject=wt$1(``);pendingDown=wt$1(null);updateOpen=wt$1(!1);drift=wt$1(new Map);buildable=wt$1(new Map);buildResults=wt$1(new Map);projectKey=Ot$1(()=>this.projects().filter(t=>t.workingDir!==null).map(t=>t.name).join(`
|
|
4
|
+
`)}problem(){let t=this.view()===`resolved`?this.config():this.files();return t?.ok===!1?t.problem:null}async copy(){let t=this.body();if(t!==null)try{await navigator.clipboard.writeText(t),this.copyProblem.set(null),this.copied.set(!0),setTimeout(()=>this.copied.set(!1),1500)}catch(e){this.copyProblem.set(this.t().copyFailed(eH(e)))}}async load(t){this.files.set(null),this.config.set(null),this.copied.set(!1),this.copyProblem.set(null),this.view.set(`raw`);let[e,i]=await Promise.all([window.electron.compose.files(t).catch(o=>({ok:!1,problem:eH(o)})),window.electron.compose.config(t).catch(o=>({ok:!1,problem:eH(o)}))]);this.files.set(e),this.config.set(i)}static ɵfac=function(e){return new(e||n)};static ɵcmp=wc({type:n,selectors:[[`app-compose-file-dialog`]],inputs:{open:[1,`open`],project:[1,`project`]},outputs:{open:`openChange`},decls:2,vars:1,consts:[[`rdxDialogRoot`,``,3,`openChange`,`open`],[`rdxDialogPortal`,``],[`rdxDialogBackdrop`,``,1,`fixed`,`inset-0`,`z-40`,`bg-black/50`],[`rdxDialogViewport`,``,1,`fixed`,`inset-0`,`z-50`,`grid`,`place-items-center`,`p-4`],[`rdxDialogPopup`,``,`data-testid`,`compose-file-dialog`,1,`flex`,`max-h-[85vh]`,`w-full`,`max-w-4xl`,`flex-col`,`rounded-lg`,`border`,`border-ink-700`,`bg-ink-850`,`p-5`,`shadow-2xl`],[`rdxDialogTitle`,``,1,`text-[15px]`,`font-semibold`,`text-ink-100`],[`rdxDialogDescription`,``,1,`mt-1`,`text-[13px]`,`text-ink-400`],[1,`mt-3`,`flex`,`shrink-0`,`gap-1`],[`type`,`button`,1,`mx-btn`,`mx-focus`,3,`border-accent`,`text-accent`],[`data-testid`,`compose-file-text`,1,`mt-3`,`min-h-0`,`flex-1`,`overflow-auto`,`rounded-md`,`border`,`border-ink-700`,`bg-ink-900`,`p-3`,`font-mono`,`text-[12px]`,`leading-relaxed`,`whitespace-pre`,`text-ink-200`],[1,`mt-4`,`rounded-md`,`border`,`border-danger/40`,`bg-danger/10`,`px-3`,`py-2`,`text-[13px]`,`text-danger`],[1,`mt-4`,`text-[13px]`,`text-ink-400`],[1,`mt-4`,`flex`,`items-center`,`justify-end`,`gap-2`],[1,`mr-auto`,`text-[12px]`,`text-danger`],[`type`,`button`,`rdxDialogClose`,``,1,`mx-btn`,`mx-focus`],[`name`,`close`,3,`size`],[`type`,`button`,`data-testid`,`compose-file-copy`,1,`mx-btn`,`mx-focus`,3,`click`,`disabled`],[3,`name`,`size`],[`type`,`button`,1,`mx-btn`,`mx-focus`,3,`click`]],template:function(e,i){e&1&&(Oi(0,`div`,0),vg(`openChange`,function(s){return vS(i.open,s)||(i.open=s),s}),_m(1,Ze,21,10,`ng-template`,1),Nc()),e&2&&hg(`open`,i.open)},dependencies:[ie,ln,an,pn,cn,fn,dn,un,My],encapsulation:2})}});function et(n,t){if(n&1&&(qr(0,`p`,1),fS(1),Wr()),n&2){let e=HE();ec(),pg(e.t().done(e.service()))}}function tt(n,t){if(n&1&&(qr(0,`p`,2),fS(1),Wr()),n&2){let e=HE();ec(),pg(e.problem())}}function nt(n,t){if(n&1&&(qr(0,`details`,3)(1,`summary`,4),fS(2),Wr(),qr(3,`pre`,5),fS(4),Wr()()),n&2){let e=HE();Km(`open`,!e.result().ok),ec(2),pg(e.t().output),ec(2),pg(e.result().output)}}function it(n,t){if(n&1&&Gm(0,`app-build-output`,2),n&2)Wm(`service`,HE().service())(`result`,t)}var A;var L;var ge=f(()=>{Kr();lk();sk();dk();Kr();A=class n{service=jc.required();result=jc.required();t=Ot$1(()=>ok().compose.build);problem(){let t=this.result();return t.ok?``:t.problem}static ɵfac=function(e){return new(e||n)};static ɵcmp=wc({type:n,selectors:[[`app-build-output`]],hostAttrs:[1,`block`],inputs:{service:[1,`service`],result:[1,`result`]},decls:4,vars:3,consts:[[1,`text-[12px]`],[1,`text-ok`],[1,`whitespace-pre-line`,`text-danger`],[1,`mt-1`,3,`open`],[1,`cursor-pointer`,`text-ink-400`,`hover:text-ink-200`],[1,`mt-1`,`max-h-64`,`overflow-auto`,`rounded-md`,`border`,`border-ink-700`,`bg-ink-900`,`p-2`,`font-mono`,`text-[11px]`,`leading-snug`,`whitespace-pre-wrap`,`text-ink-300`]],template:function(e,i){e&1&&(qr(0,`div`,0),SE(1,et,2,1,`p`,1)(2,tt,2,1,`p`,2),SE(3,nt,5,3,`details`,3),Wr()),e&2&&(Br(`data-testid`,`service-build-result-`+i.service()),ec(),kE(i.result().ok?1:2),ec(2),kE(i.result().output!==``?3:-1))},encapsulation:2})},L=class n{project=jc.required();service=jc.required();disabled=jc(!1);showResult=jc(!0);finished=pj();t=Ot$1(()=>ok().compose.build);busy=wt$1(!1);result=wt$1(null);async build(){this.busy.set(!0),this.result.set(null);let t;try{t=await window.electron.compose.rebuild(this.project(),this.service())}catch(e){t={ok:!1,problem:eH(e),output:``}}this.result.set(t),this.busy.set(!1),this.finished.emit(t)}static ɵfac=function(e){return new(e||n)};static ɵcmp=wc({type:n,selectors:[[`app-service-build`]],hostAttrs:[1,`block`],inputs:{project:[1,`project`],service:[1,`service`],disabled:[1,`disabled`],showResult:[1,`showResult`]},outputs:{finished:`finished`},decls:4,vars:7,consts:[[`type`,`button`,1,`mx-btn`,`mx-focus`,3,`click`,`disabled`,`title`],[`name`,`refresh`,3,`size`],[1,`mt-2`,3,`service`,`result`]],template:function(e,i){if(e&1&&(Oi(0,`button`,0),Jm(`click`,function(){return i.build()}),Gm(1,`app-icon`,1),fS(2),Nc(),SE(3,it,1,2,`app-build-output`,2)),e&2){let o;Wm(`disabled`,i.busy()||i.disabled())(`title`,i.t().title),Br(`aria-label`,i.t().aria(i.service()))(`data-testid`,`service-build-`+i.service()),ec(),Wm(`size`,14),ec(),Ac(` `,i.busy()?i.t().busy:i.t().button,` `),ec(),kE((o=i.showResult()&&i.result())?3:-1,o)}},dependencies:[My,A],encapsulation:2})}});function rt(n,t){if(n&1&&(Oi(0,`p`,7),fS(1),Nc()),n&2){let e=HE(2);ec(),pg(e.t().loading)}}function lt(n,t){if(n&1&&(Oi(0,`li`,14),Gm(1,`app-icon`,16),Oi(2,`span`,17),fS(3),Nc(),Oi(4,`span`,18),fS(5),Nc(),Oi(6,`span`,19),fS(7),Nc()()),n&2){let e=t.$implicit,i=HE(3);ec(),nS(i.iconClass(e)),Wm(`name`,i.iconOf(e))(`size`,13),ec(),Wm(`title`,e.reference),ec(),pg(e.reference),ec(2),pg(e.services.join(`, `)),ec(),nS(e.state===`failed`?`text-danger`:`text-ink-400`),Wm(`title`,e.problem??``),ec(),Ac(` `,i.stateOf(e),` `)}}function dt(n,t){if(n&1&&Gm(0,`app-service-build`,23),n&2){let e=HE().$implicit,i=HE(3);Wm(`project`,i.project())(`service`,e.service)(`disabled`,!i.finished())}}function st(n,t){if(n&1&&(Oi(0,`li`,15)(1,`div`,14),Gm(2,`app-icon`,20),Oi(3,`span`,21),fS(4),Nc(),Oi(5,`span`,22),fS(6),Nc()(),SE(7,dt,1,3,`app-service-build`,23),Nc()),n&2){let e=t.$implicit,i=HE(3);ec(2),Wm(`size`,13),ec(2),pg(e.service),ec(2),pg(e.reason===`build`?i.t().skippedBuild:i.t().skippedDigest),ec(),kE(e.reason===`build`?7:-1)}}function pt(n,t){if(n&1&&(Oi(0,`ul`,8),kc(1,lt,8,11,`li`,14,ot),kc(3,st,8,4,`li`,15,at),Nc()),n&2){let e=HE(2);ec(),Tc(e.rows()),ec(2),Tc(e.skipped())}}function ct(n,t){if(n&1&&(Oi(0,`p`,7),fS(1),Nc()),n&2){let e=HE(2);ec(),pg(e.t().noImages)}}function mt(n,t){n&1&&(Oi(0,`p`,9),fS(1),Nc()),n&2&&(ec(),pg(t))}function ut(n,t){if(n&1&&(Oi(0,`p`,7),fS(1),Nc()),n&2){let e=HE(2);ec(),pg(e.t().checking)}}function _t(n,t){if(n&1&&(Oi(0,`p`,24),Gm(1,`app-icon`,25),fS(2),Nc()),n&2){let e=HE(3);ec(),Wm(`size`,13),ec(),Ac(` `,e.t().upToDate)}}function gt(n,t){if(n&1&&(Oi(0,`p`,28),fS(1),Nc()),n&2){let e=HE(),i=HE(4);ec(),pg(i.t().renewed(e.renewed.join(`, `)))}}function xt(n,t){if(n&1&&(Oi(0,`p`,29),fS(1),Nc()),n&2){let e=HE(),i=HE(4);ec(),pg(i.t().unchanged(e.unchanged.join(`, `)))}}function ft(n,t){if(n&1&&(Oi(0,`p`,30),fS(1),Nc()),n&2){let e=t.$implicit;ec(),pg(e)}}function yt(n,t){if(n&1&&(SE(0,gt,2,1,`p`,28),SE(1,xt,2,1,`p`,29),kc(2,ft,2,1,`p`,30,Sc)),n&2){let e=t;kE(e.renewed.length>0?0:-1),ec(),kE(e.unchanged.length>0?1:-1),ec(),Tc(e.problems)}}function bt(n,t){if(n&1){let e=$E();Oi(0,`div`,27)(1,`button`,31),Jm(`click`,function(){Ld(e);return Od(HE(4).renew())}),Gm(2,`app-icon`,32),fS(3),Nc(),Oi(4,`span`,33),fS(5),Nc()()}if(n&2){let e=HE(4);ec(),Wm(`disabled`,e.phase()===`renewing`),ec(),Wm(`size`,14),ec(),Ac(` `,e.phase()===`renewing`?e.t().renewing:e.t().renew,` `),ec(2),pg(e.t().renewHint)}}function vt(n,t){if(n&1&&(Oi(0,`p`,26),fS(1),Nc(),SE(2,yt,4,2)(3,bt,6,4,`div`,27)),n&2){let e,i=HE(),o=HE(2);ec(),pg(o.t().stale(i.join(`, `))),ec(),kE((e=o.result())?2:3,e)}}function ht(n,t){n&1&&(Oi(0,`div`,10),SE(1,_t,3,2,`p`,24)(2,vt,4,2),Nc()),n&2&&(ec(),kE(t.length===0?1:2))}function Ct(n,t){if(n&1&&(Gm(0,`div`,2),Oi(1,`div`,3)(2,`div`,4)(3,`h2`,5),fS(4),Nc(),Oi(5,`p`,6),fS(6),Nc(),SE(7,rt,2,1,`p`,7),SE(8,pt,5,0,`ul`,8)(9,ct,2,1,`p`,7),SE(10,mt,2,1,`p`,9),SE(11,ut,2,1,`p`,7),SE(12,ht,3,1,`div`,10),Oi(13,`div`,11)(14,`button`,12),Gm(15,`app-icon`,13),fS(16),Nc()()()()),n&2){let e,i,o=HE();ec(4),pg(o.t().title(o.project())),ec(2),pg(o.t().description),ec(),kE(o.phase()===`loading`?7:-1),ec(),kE(o.rows().length>0||o.skipped().length>0?8:o.phase()!==`loading`&&o.phase()!==`failed`?9:-1),ec(2),kE((e=o.problem())?10:-1,e),ec(),kE(o.phase()===`checking`?11:-1),ec(),kE((i=o.stale())?12:-1,i),ec(3),Wm(`size`,14),ec(),Ac(` `,o.finished()?o.common().close:o.common().cancel,` `)}}function wt(n){let t=n.layers.reduce((e,i)=>e+i.total,0);return t===0?null:Math.round(n.layers.reduce((e,i)=>e+i.current,0)/t*100)}var ot;var at;var pe;var Be=f(()=>{Kr();Je$1();lk();sk();dk();ge();Kr();ot=(n,t)=>t.reference,at=(n,t)=>t.service;pe=class n{open=mj(!1);project=jc.required();t=Ot$1(()=>ok().compose.update);common=Ot$1(()=>ok().common);phase=wt$1(`loading`);rows=wt$1([]);skipped=wt$1([]);stale=wt$1(null);result=wt$1(null);problem=wt$1(null);finished=Ot$1(()=>[`ready`,`done`,`failed`].includes(this.phase()));round=0;stopPull=null;constructor(){C(ve).onDestroy(()=>this.cancel()),rf(()=>{let t=this.open(),e=this.project();Tg(()=>{t?this.start(e):this.cancel()})})}stateOf(t){let e=this.t();switch(t.state){case`waiting`:return e.waiting;case`pulling`:return t.percent===null?e.pulling:`${e.pulling} ${String(t.percent)}%`;case`done`:return e.pulled;case`failed`:return e.failed(t.problem??``)}}iconOf(t){return t.state===`done`?`check`:t.state===`failed`?`warning`:`download`}iconClass(t){return t.state===`done`?`text-ok`:t.state===`failed`?`text-danger`:t.state===`pulling`?`text-accent`:`text-ink-500`}cancel(){this.round+=1,this.stopPull?.(),this.stopPull=null}async start(t){this.cancel();let e=this.round,i=()=>e===this.round;this.phase.set(`loading`),this.rows.set([]),this.skipped.set([]),this.stale.set(null),this.result.set(null),this.problem.set(null);try{let o=await window.electron.compose.images(t);if(!i())return;this.rows.set(o.images.map(u=>G(W({},u),{state:`waiting`,percent:null,problem:null}))),this.skipped.set(o.skipped),this.phase.set(`pulling`);for(let u of o.images)if(await this.pull(u.reference,i),!i())return;this.phase.set(`checking`);let s=await window.electron.compose.stale(t);i()&&(this.stale.set(s),this.phase.set(`ready`))}catch(o){i()&&(this.problem.set(eH(o)),this.phase.set(`failed`))}}async pull(t,e){let i=s=>{e()&&this.rows.update(u=>u.map(R=>R.reference===t?W(W({},R),s):R))};i({state:`pulling`});let o=await window.electron.images.pull(t);if(!o.ok){i({state:`failed`,problem:o.problem});return}await new Promise(s=>{let u=window.electron.images.onPullProgress(o.streamId,G=>{if(!G.done){i({percent:wt(G)});return}i(G.problem===null?{state:`done`,percent:null}:{state:`failed`,problem:G.problem}),R()}),R=()=>{u(),window.electron.images.close(o.streamId),this.stopPull=null,s()};this.stopPull=R})}async renew(){let t=this.round;this.phase.set(`renewing`);try{let e=await window.electron.compose.renew(this.project());t===this.round&&(this.result.set(e),this.phase.set(`done`))}catch(e){t===this.round&&(this.result.set({renewed:[],unchanged:[],problems:[eH(e)]}),this.phase.set(`done`))}}static ɵfac=function(e){return new(e||n)};static ɵcmp=wc({type:n,selectors:[[`app-project-update-dialog`]],inputs:{open:[1,`open`],project:[1,`project`]},outputs:{open:`openChange`},decls:2,vars:1,consts:[[`rdxDialogRoot`,``,3,`openChange`,`open`],[`rdxDialogPortal`,``],[`rdxDialogBackdrop`,``,1,`fixed`,`inset-0`,`z-40`,`bg-black/50`],[`rdxDialogViewport`,``,1,`fixed`,`inset-0`,`z-50`,`grid`,`place-items-center`,`p-4`],[`rdxDialogPopup`,``,`data-testid`,`project-update`,1,`w-full`,`max-w-2xl`,`rounded-lg`,`border`,`border-ink-700`,`bg-ink-850`,`p-5`,`shadow-2xl`],[`rdxDialogTitle`,``,1,`text-[15px]`,`font-semibold`,`text-ink-100`],[`rdxDialogDescription`,``,1,`mt-1`,`text-[13px]`,`text-ink-400`],[1,`mt-4`,`text-[13px]`,`text-ink-400`],[`data-testid`,`project-update-images`,1,`mt-4`,`space-y-1.5`,`text-[13px]`],[1,`mt-4`,`text-[13px]`,`text-danger`],[`data-testid`,`project-update-stale`,1,`mt-4`,`rounded-md`,`border`,`border-ink-700`,`bg-ink-800`,`px-3`,`py-2.5`,`text-[13px]`],[1,`mt-5`,`flex`,`justify-end`],[`type`,`button`,`rdxDialogClose`,``,1,`mx-btn`,`mx-focus`],[`name`,`close`,3,`size`],[1,`flex`,`items-center`,`gap-3`],[1,`text-ink-500`],[3,`name`,`size`],[1,`min-w-0`,`truncate`,`font-mono`,`text-ink-100`,3,`title`],[1,`min-w-0`,`truncate`,`text-ink-500`],[1,`ml-auto`,`shrink-0`,`text-[12px]`,3,`title`],[`name`,`code`,3,`size`],[1,`font-mono`],[1,`ml-auto`,`text-[12px]`],[1,`mt-1.5`,`ml-6`,3,`project`,`service`,`disabled`],[1,`flex`,`items-center`,`gap-2`,`text-ink-300`],[`name`,`check`,1,`text-ok`,3,`size`],[1,`text-ink-200`],[1,`mt-2.5`,`flex`,`items-center`,`gap-3`],[1,`mt-2`,`text-ok`],[1,`mt-1`,`text-ink-400`],[1,`mt-2`,`text-danger`],[`type`,`button`,`data-testid`,`project-update-renew`,1,`mx-btn`,`mx-focus`,3,`click`,`disabled`],[`name`,`refresh`,3,`size`],[1,`text-[12px]`,`text-ink-500`]],template:function(e,i){e&1&&(Oi(0,`div`,0),vg(`openChange`,function(s){return vS(i.open,s)||(i.open=s),s}),_m(1,Ct,17,9,`ng-template`,1),Nc()),e&2&&hg(`open`,i.open)},dependencies:[ie,ln,an,pn,cn,fn,dn,un,My,L],encapsulation:2})}});function jt(n,t){if(n&1&&(Oi(0,`div`,6),fS(1),Nc()),n&2){let e=HE();ec(),pg(e.version)}}function St(n,t){if(n&1&&(Oi(0,`div`,13),fS(1),Nc()),n&2){let e=HE();ec(),pg(e.problem)}}function Et(n,t){n&1&&SE(0,jt,2,1,`div`,6)(1,St,2,1,`div`,13),n&2&&kE(t.cliAvailable?0:1)}function Mt(n,t){if(n&1&&(Oi(0,`div`,6),fS(1),Nc()),n&2){let e=HE();ec(),pg(e.t().updating)}}function Tt(n,t){if(n&1&&(Oi(0,`span`,20),fS(1),Nc()),n&2){let e=t;Wm(`title`,e),ec(),pg(e)}}function It(n,t){if(n&1&&(Oi(0,`div`,23),fS(1),Nc()),n&2){let e=HE(2);ec(),pg(e.t().busy)}}function Rt(n,t){if(n&1&&(Oi(0,`div`,26),Gm(1,`app-icon`,27),fS(2),Nc()),n&2){let e=t,i=HE().$implicit,o=HE();nS(e.problem?`text-danger`:`text-accent`),Wm(`title`,e.problem?``:o.t().driftTitle),Br(`data-testid`,`compose-drift-`+i.name),ec(),Wm(`name`,e.problem?`warning`:`file`)(`size`,12),ec(),Ac(` `,e.text,` `)}}function Ft(n,t){if(n&1&&(Oi(0,`span`,31),fS(1),Nc()),n&2){let e=HE().$implicit,i=HE(2).$implicit,o=HE();Wm(`title`,o.t().driftTitle),Br(`data-testid`,`compose-drift-`+i.name+`-`+e.name),ec(),pg(o.t().drift)}}function Nt(n,t){if(n&1){let e=$E();Oi(0,`app-service-build`,37),Jm(`finished`,function(o){Ld(e);let s=HE().$implicit,u=HE(2).$implicit;return Od(HE().afterBuild(u.name,s.name,o))}),Nc()}if(n&2){let e=HE().$implicit,i=HE(2).$implicit,o=bS(0);Wm(`project`,i.name)(`service`,e.name)(`disabled`,o)(`showResult`,!1)}}function Bt(n,t){if(n&1&&Gm(0,`app-build-output`,35),n&2){let e=HE().$implicit;Wm(`service`,e.name)(`result`,t)}}function Ot(n,t){if(n&1&&(Oi(0,`span`,41),fS(1),Nc()),n&2){let e=t.$implicit;ec(),Ac(` `,e.hostPort?e.hostPort+`:`+e.containerPort:e.containerPort,` `)}}function $t(n,t){if(n&1&&(Oi(0,`span`,39),kc(1,Ot,2,1,`span`,41,Pt),Nc()),n&2){let e=HE().$implicit;ec(),Tc(e.ports.slice(0,2))}}function Vt(n,t){if(n&1&&(Oi(0,`div`,36),Gm(1,`app-state-dot`,17),Oi(2,`a`,38),fS(3),Nc(),Oi(4,`span`,39),fS(5),Nc(),Oi(6,`span`,40),fS(7),Nc(),SE(8,$t,3,0,`span`,39),Nc()),n&2){let e=t.$implicit;ec(),Wm(`state`,e.state),ec(),Wm(`routerLink`,SS(6,Dt,e.id)),ec(),pg(e.name),ec(2),pg(e.status),ec(2),pg(e.image),ec(),kE(e.ports.length>0?8:-1)}}function zt(n,t){if(n&1){let e=$E();Oi(0,`div`,28)(1,`div`,29)(2,`div`,30),fS(3),Nc(),SE(4,Ft,2,3,`span`,31),SE(5,Nt,1,4,`app-service-build`,32),Oi(6,`button`,33),Jm(`click`,function(){let o=Ld(e).$implicit,s=HE(2).$implicit;return Od(HE().recreate(s,o))}),Gm(7,`app-icon`,34),fS(8),Nc()(),SE(9,Bt,1,2,`app-build-output`,35),kc(10,Vt,9,8,`div`,36,kt),Nc()}if(n&2){let e,i=t.$implicit,o=HE(2).$implicit,s=bS(0),u=HE();ec(3),pg(i.name),ec(),kE(u.drifted(o.name,i.name)?4:-1),ec(),kE(u.canBuild(o.name,i.name)?5:-1),ec(),ag(`ml-auto`,!u.canBuild(o.name,i.name)),Wm(`disabled`,s||!u.canCompose(o))(`title`,u.canCompose(o)?u.t().recreateTitle:u.composeBlockedReason(o)),Br(`data-testid`,`compose-recreate-`+i.name)(`aria-label`,u.t().recreateAria(i.name)),ec(),Wm(`size`,14),ec(),Ac(` `,u.t().recreate,` `),ec(),kE((e=u.buildResult(o.name,i.name))?9:-1,e),ec(),Tc(i.containers)}}function Ut(n,t){if(n&1&&(Oi(0,`div`,25),kc(1,zt,12,12,`div`,28,$e),Nc()),n&2){let e=HE().$implicit;ec(),Tc(e.services)}}function Lt(n,t){if(n&1){let e=$E();bg(0),Oi(1,`div`,9)(2,`div`,14)(3,`button`,15),Jm(`click`,function(){let o=Ld(e).$implicit;return Od(HE().toggle(o.name))}),Gm(4,`app-icon`,16)(5,`app-state-dot`,17),Oi(6,`span`,18),fS(7),Nc()(),Oi(8,`span`,19),fS(9),Nc(),SE(10,Tt,2,2,`span`,20),Oi(11,`div`,21)(12,`app-action-menu`,22),Jm(`picked`,function(o){let s=Ld(e).$implicit;return Od(HE().onProjectMenu(o,s))}),Nc()()(),SE(13,It,2,1,`div`,23),SE(14,Rt,3,7,`div`,24),SE(15,Ut,3,0,`div`,25),Nc()}if(n&2){let e,i,o=t.$implicit,s=HE(),u=yS(s.busy(o));ec(3),Br(`aria-expanded`,s.isExpanded(o.name))(`aria-label`,s.isExpanded(o.name)?s.t().collapse(o.name):s.t().expand(o.name)),ec(),Wm(`name`,s.isExpanded(o.name)?`chevronDown`:`chevronRight`)(`size`,14),ec(),Wm(`state`,o.state),ec(2),pg(o.name),ec(2),mg(` `,s.projectLabelOf(o.state),` · `,s.t().runningOf(o.running,o.total),` `),ec(),kE((e=o.workingDir)?10:-1,e),ec(2),Wm(`label`,s.t().menuAria(o.name))(`items`,s.projectMenu(o)),ec(),kE(u?13:-1),ec(),kE((i=s.driftNote(o.name))?14:-1,i),ec(),kE(s.isExpanded(o.name)?15:-1)}}function Wt(n,t){if(n&1&&(Oi(0,`p`,10),fS(1),Nc()),n&2){let e=HE();ec(),pg(e.t().empty)}}var Dt;var $e;var kt;var Pt;var Oe;f(()=>{Kr();ra();y();y$1();v();sk();J();dk();x();u$2();Ne();Be();ge();G$1();o();Kr();Dt=n=>[`/containers`,n],$e=(n,t)=>t.name,kt=(n,t)=>t.id,Pt=(n,t)=>t.containerPort;Oe=class n{containers=C(u);compose=C(c);t=Ot$1(()=>ok().compose);common=Ot$1(()=>ok().common);loading=this.containers.loading;problem=this.containers.problem;composePending=this.compose.pending;containerPending=this.containers.pending;status=this.compose.status;projects=Ot$1(()=>f$1(this.containers.containers()));expanded=wt$1(new Set);confirmOpen=wt$1(!1);fileOpen=wt$1(!1);fileProject=wt$1(``);pendingDown=wt$1(null);updateOpen=wt$1(!1);drift=wt$1(new Map);buildable=wt$1(new Map);buildResults=wt$1(new Map);projectKey=Ot$1(()=>this.projects().filter(t=>t.workingDir!==null).map(t=>t.name).join(`
|
|
5
5
|
`));updateProject=wt$1(``);bestand=jc(void 0);afbreken=jc(void 0);bijwerken=jc(void 0);router=C(fe);route=C(Q);constructor(){this.containers.refresh(),this.compose.loadStatus(),rf(()=>{let t=this.bestand();t!==void 0&&Tg(()=>{this.fileProject.set(t),this.fileOpen.set(!0),i(this.router,this.route,`bestand`)})}),rf(()=>{let t=this.projectKey(),e=this.status()?.cliAvailable;t!==``&&e===!0&&Tg(()=>t.split(`
|
|
6
6
|
`).forEach(i=>{this.checkDrift(i),this.loadBuildable(i)}))}),rf(()=>{let t=this.bijwerken();t!==void 0&&Tg(()=>{this.openUpdate(t),i(this.router,this.route,`bijwerken`)})}),rf(()=>{let t=this.afbreken();t!==void 0&&Tg(()=>{this.pendingDown.set(t),this.confirmOpen.set(!0),i(this.router,this.route,`afbreken`)})})}isExpanded(t){return this.expanded().has(t)}toggle(t){let e=new Set(this.expanded());e.delete(t)||e.add(t),this.expanded.set(e)}projectLabelOf(t){return this.t().state[t]}busy(t){return this.composePending().has(t.name)||t.containerIds.some(e=>this.containerPending().has(e))}composeBlockedReason(t){let e=this.status();return e!==null&&!e.cliAvailable?this.t().noCli:t.workingDir===null?this.t().noWorkingDir:``}canCompose(t){return this.composeBlockedReason(t)===``}run(t,e){this.containers.runMany(t,e.containerIds)}up(t){this.compose.up(t.name)}projectMenu(t){let e=this.t(),i=this.common(),o=this.busy(t),s=this.canCompose(t),u=s?void 0:this.composeBlockedReason(t);return[{id:`up`,label:e.up,icon:`plus`,disabled:o||!s,hint:u??`docker compose up -d`},{id:`start`,label:i.start,icon:`play`,disabled:o},{id:`stop`,label:i.stop,icon:`stop`,disabled:o},{id:`restart`,label:i.restart,icon:`refresh`,disabled:o},{id:`update`,label:e.update.menu,icon:`download`,disabled:o||!s,hint:u??e.update.hint},{id:`file`,label:e.file.button,icon:`file`,disabled:t.workingDir===null,separated:!0},{id:`down`,label:e.down,icon:`trash`,danger:!0,disabled:o||!s,hint:u??`docker compose down`,separated:!0}]}onProjectMenu(t,e){t===`up`?this.up(e):t===`update`?this.openUpdate(e.name):t===`file`?this.openFile(e):t===`down`?this.askDown(e):this.run(t,e)}recreate(t,e){this.compose.recreate(t.name,e.name).then(()=>this.checkDrift(t.name))}async checkDrift(t){try{let e=await window.electron.compose.drift(t);this.drift.update(i=>new Map(i).set(t,e))}catch{}}async loadBuildable(t){try{let e=await window.electron.compose.buildable(t);this.buildable.update(i=>new Map(i).set(t,e))}catch{}}canBuild(t,e){return this.buildable().get(t)?.includes(e)===!0}afterBuild(t,e,i){this.buildResults.update(o=>new Map(o).set(`${t}/${e}`,i)),this.checkDrift(t)}buildResult(t,e){return this.buildResults().get(`${t}/${e}`)??null}drifted(t,e){let i=this.drift().get(t);return i?.ok===!0&&i.changed.includes(e)}driftNote(t){let e=this.drift().get(t);return e===void 0?null:e.ok?e.changed.length===0?null:{text:this.t().driftProject(e.changed.join(`, `)),problem:!1}:{text:this.t().driftProblem(e.problem),problem:!0}}openUpdate(t){this.updateProject.set(t),this.updateOpen.set(!0)}openFile(t){this.fileProject.set(t.name),this.fileOpen.set(!0)}askDown(t){this.pendingDown.set(t.name),this.confirmOpen.set(!0)}confirmDown(){let t=this.pendingDown();t!==null&&(this.compose.down(t),this.pendingDown.set(null))}downDescription(){let t=this.pendingDown();return t===null?``:this.t().downDialog.description(t)}static ɵfac=function(e){return new(e||n)};static ɵcmp=wc({type:n,selectors:[[`app-compose-page`]],inputs:{bestand:[1,`bestand`],afbreken:[1,`afbreken`],bijwerken:[1,`bijwerken`]},decls:19,vars:14,consts:[[1,`flex`,`h-full`,`flex-col`],[1,`shrink-0`,`px-6`,`pt-5`,`pb-3`],[1,`flex`,`flex-wrap`,`items-start`,`gap-4`],[1,`text-xl`,`font-semibold`,`tracking-tight`,`text-ink-100`],[1,`mt-1`,`max-w-prose`,`text-[13px]`,`text-ink-400`],[1,`ml-auto`,`text-right`],[1,`text-[12px]`,`text-ink-500`],[3,`problem`],[1,`min-h-0`,`flex-1`,`space-y-3`,`overflow-y-auto`,`px-6`,`pb-6`],[1,`rounded-lg`,`border`,`border-ink-700`,`bg-ink-850`],[1,`py-10`,`text-center`,`text-[13px]`,`text-ink-400`],[3,`openChange`,`open`,`project`],[3,`openChange`,`confirmed`,`open`,`title`,`description`,`confirmLabel`],[1,`max-w-xs`,`text-[12px]`,`text-warn`],[1,`flex`,`flex-wrap`,`items-center`,`gap-3`,`px-3`,`py-2.5`],[`type`,`button`,1,`mx-focus`,`flex`,`min-w-0`,`cursor-pointer`,`items-center`,`gap-2`,`text-left`,3,`click`],[1,`shrink-0`,`text-ink-500`,3,`name`,`size`],[3,`state`],[1,`truncate`,`text-[14px]`,`font-medium`,`text-ink-100`],[1,`shrink-0`,`text-[12px]`,`text-ink-400`],[1,`min-w-0`,`truncate`,`font-mono`,`text-[11px]`,`text-ink-500`,3,`title`],[1,`ml-auto`,`shrink-0`],[`compact`,``,3,`picked`,`label`,`items`],[1,`px-3`,`pb-2`,`text-[12px]`,`text-ink-500`],[1,`flex`,`items-center`,`gap-1.5`,`px-3`,`pb-2`,`text-[12px]`,3,`class`,`title`],[1,`border-t`,`border-ink-800`],[1,`flex`,`items-center`,`gap-1.5`,`px-3`,`pb-2`,`text-[12px]`,3,`title`],[3,`name`,`size`],[1,`border-b`,`border-ink-800`,`px-3`,`py-2`,`last:border-b-0`],[1,`flex`,`items-center`,`gap-3`],[1,`text-[12px]`,`font-medium`,`text-ink-300`],[1,`text-[11px]`,`text-accent`,3,`title`],[1,`ml-auto`,3,`project`,`service`,`disabled`,`showResult`],[`type`,`button`,1,`mx-btn`,`mx-focus`,3,`click`,`disabled`,`title`],[`name`,`refresh`,3,`size`],[1,`mt-1.5`,`mb-1`,3,`service`,`result`],[1,`mt-1`,`flex`,`flex-wrap`,`items-center`,`gap-3`,`pl-3`,`text-[13px]`],[1,`ml-auto`,3,`finished`,`project`,`service`,`disabled`,`showResult`],[1,`mx-focus`,`min-w-0`,`truncate`,`text-ink-100`,`hover:text-accent`,`hover:underline`,3,`routerLink`],[1,`shrink-0`,`text-ink-500`],[1,`min-w-0`,`truncate`,`text-ink-400`],[1,`mr-2`]],template:function(e,i){if(e&1&&(Oi(0,`section`,0)(1,`div`,1)(2,`div`,2)(3,`div`)(4,`h1`,3),fS(5),Nc(),Oi(6,`p`,4),fS(7),Nc()(),Oi(8,`div`,5),SE(9,Et,2,1),SE(10,Mt,2,1,`div`,6),Nc()(),Gm(11,`app-page-messages`,7),Nc(),Oi(12,`div`,8),kc(13,Lt,16,15,`div`,9,$e,!1,Wt,2,1,`p`,10),Nc()(),Oi(16,`app-compose-file-dialog`,11),vg(`openChange`,function(s){return vS(i.fileOpen,s)||(i.fileOpen=s),s}),Nc(),Oi(17,`app-project-update-dialog`,11),vg(`openChange`,function(s){return vS(i.updateOpen,s)||(i.updateOpen=s),s}),Nc(),Oi(18,`app-confirm-dialog`,12),vg(`openChange`,function(s){return vS(i.confirmOpen,s)||(i.confirmOpen=s),s}),Jm(`confirmed`,function(){return i.confirmDown()}),Nc()),e&2){let o;ec(5),pg(i.t().title),ec(2),pg(i.t().intro),ec(2),kE((o=i.status())?9:-1,o),ec(),kE(i.loading()?10:-1),ec(),Wm(`problem`,i.problem()),ec(2),Tc(i.projects()),ec(3),hg(`open`,i.fileOpen),Wm(`project`,i.fileProject()),ec(),hg(`open`,i.updateOpen),Wm(`project`,i.updateProject()),ec(),hg(`open`,i.confirmOpen),Wm(`title`,i.t().downDialog.title)(`description`,i.downDescription())(`confirmLabel`,i.t().downDialog.confirm)}},dependencies:[Yt,My,W$1,u$1,c$1,se,pe,L,A,V],encapsulation:2})}})();export{Oe as ComposePage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$n as sk,$t as bg,A as HE,B as Kr,Bn as ok,Ct as Tg,D as Gm,Dn as kc,En as kE,Fn as nS,Gn as pj,Gt as _m,H as Ld,J as Nc,K as My,Nn as mg,Nt as W,Pn as mj,Pt as Wm,Qn as sg,R as Jm,St as Tc,Tn as jc,Wn as pg,Xn as rf,Xt as bS,_t as Sc,br as yS,bt as TE,cn as f,cr as ve$1,et as Od,f as C,gr as wt$1,ht as SE,jn as lk,ln as fS,lr as vg,mr as wc,o as Ac,on as eH,or as vS,qt as ag,rn as dk,rt as Ot$1,sn as ec,t as $E,tt as Oi,u as Br,xn as hg}from"./chunk-BdOOWVGY.js";import{n as u,t as f$1}from"./chunk-V7ftX_10.js";import"./chunk-D29s9m84.js";import{i as h,n as N,r as d}from"./chunk-CRNeTD5E.js";import{n as h$1,t as P}from"./chunk-Cbit44lz.js";import{n as o,t as i}from"./chunk-Zcfhi-RM.js";import{n as p,t as M}from"./chunk-C22Z7vgK.js";import"./chunk-eG8Su12W.js";import"./chunk-Bx2_SrZM.js";import{_ as pn$1,d as dn$1,f as fn$1,g as ln$1,l as an$1,m as ie,r as Je$1,u as cn$1,v as un$1}from"./chunk-QaMufr3I.js";import{n as x,t as u$1}from"./chunk-BW20bBdg.js";import{r as Q,s as fe,u as ra}from"./chunk-DzG5R5Kk.js";import{i as z,n as oe,r as x$1}from"./chunk-Ba_z6LGV.js";import{n as P$1,t as K}from"./chunk-DvoPI4MU.js";import{n as V,t as G}from"./chunk-CWusqRG0.js";import{n as W$1,t as J}from"./chunk-DZjRtM2K.js";import{a as z$1,i as r,r as d$1,t as A}from"./chunk-DLeqF0uQ.js";function rt(a,t){a&1&&(Oi(0,`p`,13),fS(1),Nc()),a&2&&(ec(),pg(t))}function lt(a,t){if(a&1&&(Oi(0,`p`,14),fS(1),Nc()),a&2){let e=HE(3);ec(),pg(e.t().empty)}}function st(a,t){if(a&1&&(Oi(0,`span`,20),fS(1),Nc()),a&2){let e=HE(5);ec(),pg(e.t().noSize)}}function dt(a,t){if(a&1){let e=$E();Oi(0,`li`,16)(1,`span`,17),fS(2),Nc(),Oi(3,`button`,18),Jm(`click`,function(){let l=Ld(e).$index;return Od(HE(4).toggle(l))}),Oi(4,`pre`,19),fS(5),Nc(),SE(6,st,2,1,`span`,20),Nc()()}if(a&2){let e=t.$implicit,n=t.$index,l=HE(4);ec(),nS(e.sizeBytes===0?`text-ink-600`:`text-ink-200`),ec(),Ac(` `,e.sizeBytes===0?`—`:l.size(e),` `),ec(),Br(`aria-label`,l.t().expand)(`aria-expanded`,l.isOpen(n)),ec(),ag(`line-clamp-2`,!l.isOpen(n)),ec(),pg(e.instruction),ec(),kE(e.sizeBytes===0?6:-1)}}function pt(a,t){if(a&1&&(Oi(0,`ul`,15),kc(1,dt,7,9,`li`,16,TE),Nc()),a&2){let e=HE(3);ec(),Tc(e.layers())}}function ct(a,t){if(a&1&&(Oi(0,`p`,12),fS(1),Nc(),SE(2,rt,2,1,`p`,13),SE(3,lt,2,1,`p`,14)(4,pt,3,0,`ul`,15)),a&2){let e,n=HE(2);ec(),pg(n.summary()),ec(),kE((e=n.packed())?2:-1,e),ec(),kE(n.layers().length===0?3:4)}}function mt(a,t){if(a&1&&(Oi(0,`p`,7),fS(1),Nc()),a&2){let e=HE(2);ec(),Ac(` `,e.problem(),` `)}}function ut(a,t){if(a&1&&(Oi(0,`p`,8),fS(1),Nc()),a&2){let e=HE(2);ec(),pg(e.t().loading)}}function gt(a,t){if(a&1&&(Gm(0,`div`,2),Oi(1,`div`,3)(2,`div`,4)(3,`h2`,5),fS(4),Nc(),Oi(5,`p`,6),fS(6),Nc(),SE(7,ct,5,3)(8,mt,2,1,`p`,7)(9,ut,2,1,`p`,8),Oi(10,`div`,9)(11,`button`,10),Gm(12,`app-icon`,11),fS(13),Nc()()()()),a&2){let e,n=HE();ec(4),pg(n.t().title(n.reference())),ec(2),pg(n.t().description),ec(),kE((e=n.result()?.ok)===!0?7:e===!1?8:9),ec(5),Wm(`size`,14),ec(),Ac(` `,n.common().close,` `)}}var ye;var Ke=f(()=>{Kr();Je$1();lk();h();dk();sk();Kr();ye=class a{open=mj(!1);reference=jc.required();t=Ot$1(()=>ok().images.layers);common=Ot$1(()=>ok().common);result=wt$1(null);expanded=wt$1(new Set);constructor(){rf(()=>{if(!this.open())return;let t=this.reference();Tg(()=>{this.load(t)})})}layers(){let t=this.result();return t?.ok===!0?t.layers:[]}summary(){let t=this.result();return t?.ok===!0?this.t().summary(t.layers.length,d(t.imageBytes)):``}packed(){let t=this.result();return t?.ok!==!0||t.imageBytes===0||t.layersBytes>=t.imageBytes*.95?null:this.t().packed(d(t.layersBytes))}problem(){let t=this.result();return t?.ok===!1?t.problem:``}size(t){return d(t.sizeBytes)}isOpen(t){return this.expanded().has(t)}toggle(t){this.expanded.update(e=>{let n=new Set(e);return n.delete(t)||n.add(t),n})}async load(t){this.result.set(null),this.expanded.set(new Set);try{this.result.set(await window.electron.images.history(t))}catch(e){this.result.set({ok:!1,problem:eH(e)})}}static ɵfac=function(e){return new(e||a)};static ɵcmp=wc({type:a,selectors:[[`app-layers-dialog`]],inputs:{open:[1,`open`],reference:[1,`reference`]},outputs:{open:`openChange`},decls:2,vars:1,consts:[[`rdxDialogRoot`,``,3,`openChange`,`open`],[`rdxDialogPortal`,``],[`rdxDialogBackdrop`,``,1,`fixed`,`inset-0`,`z-40`,`bg-black/50`],[`rdxDialogViewport`,``,1,`fixed`,`inset-0`,`z-50`,`grid`,`place-items-center`,`p-4`],[`rdxDialogPopup`,``,`data-testid`,`layers-dialog`,1,`flex`,`max-h-[85vh]`,`w-full`,`max-w-3xl`,`flex-col`,`rounded-lg`,`border`,`border-ink-700`,`bg-ink-850`,`p-5`,`shadow-2xl`],[`rdxDialogTitle`,``,1,`text-[15px]`,`font-semibold`,`text-ink-100`],[`rdxDialogDescription`,``,1,`mt-1`,`text-[13px]`,`text-ink-400`],[1,`mt-4`,`rounded-md`,`border`,`border-danger/40`,`bg-danger/10`,`px-3`,`py-2`,`text-[13px]`,`text-danger`],[1,`mt-4`,`text-[13px]`,`text-ink-400`],[1,`mt-4`,`flex`,`justify-end`],[`type`,`button`,`rdxDialogClose`,``,1,`mx-btn`,`mx-focus`],[`name`,`close`,3,`size`],[`data-testid`,`layers-summary`,1,`mt-3`,`text-[12px]`,`text-ink-500`],[`data-testid`,`layers-packed`,1,`mt-1`,`text-[12px]`,`text-ink-600`],[1,`mt-3`,`text-[13px]`,`text-ink-400`],[`data-testid`,`layer-list`,1,`mt-3`,`min-h-0`,`flex-1`,`divide-y`,`divide-ink-800`,`overflow-auto`],[1,`flex`,`gap-4`,`py-2.5`],[1,`w-24`,`shrink-0`,`text-right`,`text-[12px]`],[`type`,`button`,1,`mx-focus`,`min-w-0`,`flex-1`,`cursor-pointer`,`text-left`,3,`click`],[1,`font-mono`,`text-[12px]`,`leading-relaxed`,`whitespace-pre-wrap`,`text-ink-200`],[1,`mt-0.5`,`block`,`text-[11px]`,`text-ink-600`]],template:function(e,n){e&1&&(Oi(0,`div`,0),vg(`openChange`,function(d){return vS(n.open,d)||(n.open=d),d}),_m(1,gt,14,5,`ng-template`,1),Nc()),e&2&&hg(`open`,n.open)},dependencies:[ie,ln$1,an$1,pn$1,cn$1,fn$1,dn$1,un$1,My],encapsulation:2})}});function ft(a,t){if(a&1&&(Oi(0,`div`,19)(1,`span`,20),fS(2),Nc(),Oi(3,`span`,21),fS(4),Nc(),Oi(5,`span`,22),Gm(6,`span`,23),Nc(),Oi(7,`span`,24),fS(8),Nc()()),a&2){let e=t.$implicit,n=HE(4);ec(),Wm(`title`,e.id),ec(),pg(e.id),ec(),Wm(`title`,e.status),ec(),pg(e.status),ec(2),sg(`width`,n.percentOf(e),`%`),ec(2),pg(n.sizeOf(e.total))}}function yt(a,t){if(a&1&&(Oi(0,`div`,18),kc(1,ft,9,7,`div`,19,_t),Nc()),a&2){let e=HE();ec(),Tc(e.layers)}}function vt(a,t){if(a&1&&(Oi(0,`p`,17),fS(1),Nc(),SE(2,yt,3,0,`div`,18)),a&2){let e=t;ag(`text-danger`,e.problem)(`text-ink-300`,!e.problem),ec(),Ac(` `,e.problem??e.message,` `),ec(),kE(e.layers.length>0?2:-1)}}function ht(a,t){if(a&1&&(Oi(0,`li`)(1,`span`,7),fS(2),Nc(),Oi(3,`span`,28),fS(4),Nc()()),a&2){let e=t.$implicit,n=HE(3);ec(2),pg(e.services.join(`, `)),ec(2),Ac(` `,n.t().inProject(e.name))}}function bt(a,t){if(a&1&&(Oi(0,`li`)(1,`span`,7),fS(2),Nc(),Oi(3,`span`,28),fS(4),Nc()()),a&2){let e=t.$implicit,n=HE(3);ec(2),pg(e),ec(2),Ac(` — `,n.t().notCompose)}}function wt(a,t){if(a&1&&(Oi(0,`p`,29),fS(1),Nc()),a&2){let e=HE(),n=HE(3);ec(),pg(n.t().renewed(e.renewed.join(`, `)))}}function kt(a,t){if(a&1&&(Oi(0,`p`,30),fS(1),Nc()),a&2){let e=t.$implicit;ec(),pg(e)}}function Ct(a,t){if(a&1&&(SE(0,wt,2,1,`p`,29),kc(1,kt,2,1,`p`,30,Sc)),a&2){let e=t;kE(e.renewed.length>0?0:-1),ec(),Tc(e.problems)}}function Dt(a,t){if(a&1){let e=$E();Oi(0,`div`,27)(1,`button`,31),Jm(`click`,function(){Ld(e);return Od(HE(3).renew())}),Gm(2,`app-icon`,32),fS(3),Nc(),Oi(4,`span`,33),fS(5),Nc()()}if(a&2){let e=HE(3);ec(),Wm(`disabled`,e.renewing()),ec(),Wm(`size`,14),ec(),Ac(` `,e.renewing()?e.t().renewing:e.t().renew,` `),ec(2),pg(e.t().renewHint)}}function It(a,t){if(a&1&&(Oi(0,`div`,11)(1,`p`,25),fS(2),Nc(),Oi(3,`ul`,26),kc(4,ht,5,2,`li`,null,xt),kc(6,bt,5,2,`li`,null,Sc),Nc(),SE(8,Ct,3,1)(9,Dt,6,4,`div`,27),Nc()),a&2){let e,n=t,l=HE(2);ec(2),pg(l.t().staleHeading),ec(2),Tc(n.projects),ec(2),Tc(n.loose),ec(2),kE((e=l.renewed())?8:n.projects.length>0?9:-1,e)}}function St(a,t){if(a&1){let e=$E();Gm(0,`div`,2),Oi(1,`div`,3)(2,`div`,4)(3,`h2`,5),fS(4),Nc(),Oi(5,`p`,6),fS(6),Oi(7,`code`,7),fS(8,`nginx:stable-alpine`),Nc(),fS(9),Oi(10,`code`,7),fS(11,`latest`),Nc(),fS(12),Nc(),Oi(13,`form`,8),Jm(`submit`,function(l){Ld(e);return Od(HE().submit(l))}),Oi(14,`label`,9),fS(15),Nc(),Oi(16,`input`,10),Jm(`input`,function(l){Ld(e);return Od(HE().reference.set(l.target.value))}),Nc()(),SE(17,vt,3,6),SE(18,It,10,2,`div`,11),Oi(19,`div`,12)(20,`button`,13),Gm(21,`app-icon`,14),fS(22),Nc(),Oi(23,`button`,15),Gm(24,`app-icon`,16),fS(25),Nc()()()()}if(a&2){let e,n,l=HE();ec(4),pg(l.t().title),ec(2),Ac(` `,l.t().nameAndTag,` `),ec(3),Ac(`. `,l.t().withoutTag,` `),ec(3),Ac(` `,l.t().isUsed,` `),ec(3),pg(l.t().inputLabel),ec(),Wm(`value`,l.reference())(`disabled`,l.busy()),ec(),kE((e=l.progress())?17:-1,e),ec(),kE((n=l.staleShown())?18:-1,n),ec(3),Wm(`size`,14),ec(),Ac(` `,l.finished()?l.common().close:l.common().cancel,` `),ec(),Wm(`disabled`,!l.canPull()),ec(),Wm(`size`,14),ec(),Ac(` `,l.t().submit,` `)}}var _t;var xt;var Se;var ve;var qe=f(()=>{Kr();Je$1();h();dk();lk();sk();Kr();_t=(a,t)=>t.id,xt=(a,t)=>t.name;Se=class{constructor(t){this.onProgress=t}onProgress;streamId=null;unsubscribe=null;disposed=!1;async start(t){this.stop(),this.disposed=!1;let e=await window.electron.images.pull(t);return e.ok?this.disposed?(window.electron.images.close(e.streamId),null):(this.streamId=e.streamId,this.unsubscribe=window.electron.images.onPullProgress(e.streamId,this.onProgress),null):e.problem}stop(){this.disposed=!0,this.unsubscribe?.(),this.unsubscribe=null,this.streamId!==null&&(window.electron.images.close(this.streamId),this.streamId=null)}},ve=class a{open=mj(!1);t=Ot$1(()=>ok().images.pullDialog);common=Ot$1(()=>ok().common);preset=jc(null);reference=wt$1(``);progress=wt$1(null);busy=wt$1(!1);finished=Ot$1(()=>this.progress()?.done??!1);stale=wt$1(null);renewing=wt$1(!1);renewed=wt$1(null);staleShown=Ot$1(()=>{let t=this.stale();return t!==null&&(t.projects.length>0||t.loose.length>0)?t:null});pulled=wt$1(``);canPull=Ot$1(()=>{let t=this.reference().trim();if(this.busy()||t===``)return!1;let e=this.progress();return!(e?.done===!0&&e.problem===null&&t===this.pulled())});run=new Se(t=>{this.progress.set(t),t.done&&(this.busy.set(!1),t.problem===null&&this.lookForStale(this.pulled()))});constructor(){C(ve$1).onDestroy(()=>this.run.stop()),rf(()=>{let t=this.preset();this.open()&&Tg(()=>{this.busy()||this.clear(),t!==null&&(this.reference.set(t),this.pull())})})}clear(){this.reference.set(``),this.progress.set(null),this.stale.set(null),this.renewed.set(null),this.pulled.set(``)}submit(t){t.preventDefault(),this.pull()}pull(){let t=this.reference().trim();this.canPull()&&(this.busy.set(!0),this.progress.set(null),this.stale.set(null),this.renewed.set(null),this.pulled.set(t),this.run.start(t).then(e=>{e!==null&&this.fail(t,e)}).catch(e=>this.fail(t,eH(e))))}async lookForStale(t){try{let e=await window.electron.images.staleContainers(t);t===this.pulled()&&this.stale.set(e)}catch{this.stale.set(null)}}renew(){let t=this.pulled();this.renewing.set(!0),window.electron.images.renew(t).then(e=>this.renewed.set(e)).catch(e=>this.renewed.set({renewed:[],problems:[eH(e)]})).finally(()=>this.renewing.set(!1))}fail(t,e){this.busy.set(!1),this.progress.set({reference:t,layers:[],message:``,done:!0,problem:e})}percentOf(t){return/complete|already exists/i.test(t.status)?100:t.total<=0?0:Math.min(100,t.current/t.total*100)}sizeOf(t){return t<=0?``:d(t)}static ɵfac=function(e){return new(e||a)};static ɵcmp=wc({type:a,selectors:[[`app-pull-dialog`]],inputs:{open:[1,`open`],preset:[1,`preset`]},outputs:{open:`openChange`},decls:2,vars:1,consts:[[`rdxDialogRoot`,``,3,`openChange`,`open`],[`rdxDialogPortal`,``],[`rdxDialogBackdrop`,``,1,`fixed`,`inset-0`,`z-40`,`bg-black/50`],[`rdxDialogViewport`,``,1,`fixed`,`inset-0`,`z-50`,`grid`,`place-items-center`,`p-4`],[`rdxDialogPopup`,``,1,`w-full`,`max-w-3xl`,`rounded-lg`,`border`,`border-ink-700`,`bg-ink-850`,`p-5`,`shadow-2xl`],[`rdxDialogTitle`,``,1,`text-[15px]`,`font-semibold`,`text-ink-100`],[`rdxDialogDescription`,``,1,`mt-1`,`text-[13px]`,`text-ink-400`],[1,`font-mono`],[`id`,`pull-form`,1,`mt-4`,3,`submit`],[`for`,`pull-reference`,1,`sr-only`],[`id`,`pull-reference`,`type`,`text`,`placeholder`,`nginx:stable-alpine`,`autocomplete`,`off`,`spellcheck`,`false`,1,`mx-focus`,`w-full`,`rounded-md`,`border`,`border-ink-700`,`bg-ink-800`,`px-3`,`py-1.5`,`text-[13px]`,`text-ink-100`,`placeholder:text-ink-500`,3,`input`,`value`,`disabled`],[`data-stale`,``,1,`mt-4`,`rounded-md`,`border`,`border-ink-700`,`bg-ink-800`,`px-3`,`py-2.5`,`text-[13px]`],[1,`mt-5`,`flex`,`justify-end`,`gap-2`],[`type`,`button`,`rdxDialogClose`,``,1,`mx-btn`,`mx-focus`],[`name`,`close`,3,`size`],[`type`,`submit`,`form`,`pull-form`,1,`mx-btn`,`mx-focus`,`border-accent`,`text-accent`,3,`disabled`],[`name`,`download`,3,`size`],[1,`mt-4`,`text-[13px]`],[1,`mt-3`,`max-h-64`,`space-y-1.5`,`overflow-y-auto`,`pr-1`],[1,`flex`,`items-center`,`gap-4`,`text-[12px]`],[1,`w-28`,`shrink-0`,`truncate`,`font-mono`,`text-ink-500`,3,`title`],[1,`w-44`,`shrink-0`,`truncate`,`text-ink-400`,3,`title`],[1,`h-1.5`,`min-w-0`,`flex-1`,`overflow-hidden`,`rounded-full`,`bg-ink-800`],[1,`block`,`h-full`,`rounded-full`,`bg-accent`,`transition-[width]`],[1,`w-20`,`shrink-0`,`text-right`,`tabular-nums`,`text-ink-500`],[1,`text-ink-200`],[1,`mt-1.5`,`space-y-0.5`,`text-ink-300`],[1,`mt-2.5`,`flex`,`items-center`,`gap-3`],[1,`text-ink-500`],[1,`mt-2`,`text-ok`],[1,`mt-2`,`text-danger`],[`type`,`button`,1,`mx-btn`,`mx-focus`,3,`click`,`disabled`],[`name`,`refresh`,3,`size`],[1,`text-[12px]`,`text-ink-500`]],template:function(e,n){e&1&&(Oi(0,`div`,0),vg(`openChange`,function(d){return vS(n.open,d)||(n.open=d),d}),_m(1,St,26,14,`ng-template`,1),Nc()),e&2&&hg(`open`,n.open)},dependencies:[ie,ln$1,an$1,pn$1,cn$1,fn$1,dn$1,un$1,My],encapsulation:2})}});function Et(a,t){if(a&1&&(Oi(0,`div`,13)(1,`span`,14),fS(2),Nc(),Oi(3,`span`,15),fS(4),Nc(),Oi(5,`span`,16),Gm(6,`span`,17),Nc(),Oi(7,`span`,18),fS(8),Nc()()),a&2){let e=t.$implicit,n=HE(4);ec(),Wm(`title`,e.id),ec(),pg(e.id),ec(),Wm(`title`,e.status),ec(),pg(e.status),ec(2),sg(`width`,n.percentOf(e),`%`),ec(2),pg(n.sizeOf(e.total))}}function Tt(a,t){if(a&1&&(Oi(0,`div`,12),kc(1,Et,9,7,`div`,13,Pt),Nc()),a&2){let e=HE();ec(),Tc(e.layers)}}function Mt(a,t){if(a&1&&(Oi(0,`p`,11),fS(1),Nc(),SE(2,Tt,3,0,`div`,12)),a&2){let e=t,n=HE(2);ag(`text-danger`,e.problem)(`text-ink-300`,!e.problem),ec(),Ac(` `,e.problem??(e.done?n.t().done:e.message),` `),ec(),kE(e.layers.length>0?2:-1)}}function Rt(a,t){if(a&1&&(Oi(0,`p`,19),fS(1),Nc()),a&2){let e=HE(3);ec(),Ac(` `,e.t().hubPublic,` `)}}function Nt(a,t){if(a&1&&(SE(0,Rt,2,1,`p`,19),Oi(1,`p`,20),fS(2),Nc(),Oi(3,`p`,21),fS(4),Nc()),a&2){let e=HE(2);kE(e.host()===null?0:-1),ec(2),pg(e.t().final),ec(2),pg(e.t().other)}}function Vt(a,t){if(a&1){let e=$E();Oi(0,`button`,22),Jm(`click`,function(){Ld(e);return Od(HE(2).push())}),Gm(1,`app-icon`,23),fS(2),Nc()}if(a&2){let e=HE(2);Wm(`disabled`,e.busy()),ec(),Wm(`size`,14),ec(),Ac(` `,e.busy()?e.t().pushing:e.t().confirm,` `)}}function zt(a,t){if(a&1&&(Gm(0,`div`,2),Oi(1,`div`,3)(2,`div`,4)(3,`h2`,5),fS(4),Nc(),Oi(5,`p`,6),fS(6),Nc(),SE(7,Mt,3,6)(8,Nt,5,3),Oi(9,`div`,7)(10,`button`,8),Gm(11,`app-icon`,9),fS(12),Nc(),SE(13,Vt,3,3,`button`,10),Nc()()()),a&2){let e,n=HE();ec(4),pg(n.t().title(n.reference())),ec(2),Ac(` `,n.host()===null?n.t().hub:n.t().registry(n.host()??``),` `),ec(),kE((e=n.progress())?7:8,e),ec(4),Wm(`size`,14),ec(),Ac(` `,n.progress()?.done?n.common().close:n.common().cancel,` `),ec(),kE(n.progress()===null?13:-1)}}var Pt;var he;var Qe=f(()=>{Kr();Je$1();z$1();lk();h();sk();dk();Kr();Pt=(a,t)=>t.id;he=class a{open=mj(!1);reference=jc.required();t=Ot$1(()=>ok().images.pushDialog);common=Ot$1(()=>ok().common);host=Ot$1(()=>A(this.reference()));progress=wt$1(null);busy=wt$1(!1);streamId=null;unsubscribe=null;constructor(){C(ve$1).onDestroy(()=>this.stop()),rf(()=>{this.open()&&Tg(()=>{this.busy()||(this.stop(),this.progress.set(null))})})}async push(){let t=this.reference();this.busy.set(!0);try{let e=await window.electron.images.push(t);if(!e.ok){this.fail(t,e.problem);return}this.streamId=e.streamId,this.progress.set({reference:t,layers:[],message:this.t().pushing,done:!1,problem:null}),this.unsubscribe=window.electron.images.onPullProgress(e.streamId,n=>{this.progress.set(n),n.done&&this.busy.set(!1)})}catch(e){this.fail(t,eH(e))}}fail(t,e){this.busy.set(!1),this.progress.set({reference:t,layers:[],message:``,done:!0,problem:e})}stop(){this.unsubscribe?.(),this.unsubscribe=null,this.streamId!==null&&(window.electron.images.close(this.streamId),this.streamId=null)}percentOf(t){return/pushed|already exists|mounted from/i.test(t.status)?100:t.total<=0?0:Math.min(100,t.current/t.total*100)}sizeOf(t){return t<=0?``:d(t)}static ɵfac=function(e){return new(e||a)};static ɵcmp=wc({type:a,selectors:[[`app-push-dialog`]],inputs:{open:[1,`open`],reference:[1,`reference`]},outputs:{open:`openChange`},decls:2,vars:1,consts:[[`rdxDialogRoot`,``,3,`openChange`,`open`],[`rdxDialogPortal`,``],[`rdxDialogBackdrop`,``,1,`fixed`,`inset-0`,`z-40`,`bg-black/50`],[`rdxDialogViewport`,``,1,`fixed`,`inset-0`,`z-50`,`grid`,`place-items-center`,`p-4`],[`rdxDialogPopup`,``,`data-testid`,`push-dialog`,1,`w-full`,`max-w-2xl`,`rounded-lg`,`border`,`border-ink-700`,`bg-ink-850`,`p-5`,`shadow-2xl`],[`rdxDialogTitle`,``,1,`text-[15px]`,`font-semibold`,`text-ink-100`],[`rdxDialogDescription`,``,`data-testid`,`push-registry`,1,`mt-1`,`text-[13px]`,`text-ink-200`],[1,`mt-5`,`flex`,`justify-end`,`gap-2`],[`type`,`button`,`rdxDialogClose`,``,1,`mx-btn`,`mx-focus`],[`name`,`close`,3,`size`],[`type`,`button`,`data-testid`,`push-confirm`,1,`mx-btn`,`mx-focus`,`border-accent`,`text-accent`,3,`disabled`],[`data-testid`,`push-status`,1,`mt-4`,`text-[13px]`],[1,`mt-3`,`max-h-64`,`space-y-1.5`,`overflow-y-auto`,`pr-1`],[1,`flex`,`items-center`,`gap-4`,`text-[12px]`],[1,`w-28`,`shrink-0`,`truncate`,`font-mono`,`text-ink-500`,3,`title`],[1,`w-44`,`shrink-0`,`truncate`,`text-ink-400`,3,`title`],[1,`h-1.5`,`min-w-0`,`flex-1`,`overflow-hidden`,`rounded-full`,`bg-ink-800`],[1,`block`,`h-full`,`rounded-full`,`bg-accent`,`transition-[width]`],[1,`w-20`,`shrink-0`,`text-right`,`tabular-nums`,`text-ink-500`],[`data-testid`,`push-public`,1,`mt-3`,`rounded-md`,`border`,`border-warn/40`,`bg-warn/10`,`px-3`,`py-2`,`text-[12px]`,`text-ink-200`],[1,`mt-3`,`text-[12px]`,`text-ink-400`],[1,`mt-1`,`text-[12px]`,`text-ink-500`],[`type`,`button`,`data-testid`,`push-confirm`,1,`mx-btn`,`mx-focus`,`border-accent`,`text-accent`,3,`click`,`disabled`],[`name`,`upload`,3,`size`]],template:function(e,n){e&1&&(Oi(0,`div`,0),vg(`openChange`,function(d){return vS(n.open,d)||(n.open=d),d}),_m(1,zt,14,6,`ng-template`,1),Nc()),e&2&&hg(`open`,n.open)},dependencies:[ie,ln$1,an$1,pn$1,cn$1,fn$1,dn$1,un$1,My],encapsulation:2})}});function Ot(a,t){if(a&1&&(Oi(0,`p`,11),fS(1),Nc()),a&2){let e=HE(2);ec(),pg(e.t().invalid)}}function Lt(a,t){if(a&1&&(Oi(0,`p`,12),fS(1),Nc()),a&2){let e=HE(2);ec(),pg(e.t().exists(e.normalized()))}}function Bt(a,t){a&1&&(Oi(0,`p`,13),fS(1),Nc()),a&2&&(ec(),pg(t))}function Ft(a,t){if(a&1){let e=$E();Gm(0,`div`,2),Oi(1,`div`,3)(2,`div`,4)(3,`h2`,5),fS(4),Nc(),Oi(5,`p`,6),fS(6),Nc(),Oi(7,`form`,7),Jm(`submit`,function(l){Ld(e);return Od(HE().submit(l))}),Oi(8,`label`,8)(9,`span`,9),fS(10),Nc(),Oi(11,`input`,10),Jm(`input`,function(l){Ld(e);return Od(HE().target.set(l.target.value))}),Nc()(),SE(12,Ot,2,1,`p`,11)(13,Lt,2,1,`p`,12),SE(14,Bt,2,1,`p`,13),Oi(15,`div`,14)(16,`button`,15),Gm(17,`app-icon`,16),fS(18),Nc(),Oi(19,`button`,17),Gm(20,`app-icon`,18),fS(21),Nc()()()()()}if(a&2){let e,n=HE();ec(4),pg(n.t().title(n.source())),ec(2),pg(n.t().description),ec(4),pg(n.t().label),ec(),nS(n.field+` mt-1.5`),Wm(`value`,n.target()),ec(),kE(n.invalid()?12:n.exists()?13:-1),ec(2),kE((e=n.problem())?14:-1,e),ec(3),Wm(`size`,14),ec(),Ac(` `,n.common().close,` `),ec(),Wm(`disabled`,!n.canSave()),ec(),Wm(`size`,14),ec(),Ac(` `,n.saving()?n.t().saving:n.t().save,` `)}}var Wt;var be;var Ze=f(()=>{Kr();Je$1();z$1();lk();P();sk();dk();f$1();Kr();Wt=`mx-focus w-full rounded-md border border-ink-700 bg-ink-800 px-2.5 py-1.5 font-mono text-[13px] text-ink-100 placeholder:text-ink-500`,be=class a{open=mj(!1);source=jc.required();store=C(h$1);toast=C(u);t=Ot$1(()=>ok().images.tagDialog);common=Ot$1(()=>ok().common);field=Wt;target=wt$1(``);saving=wt$1(!1);problem=wt$1(null);wanted=Ot$1(()=>this.target().trim());invalid=Ot$1(()=>this.wanted()!==``&&!d$1(this.wanted()));normalized=Ot$1(()=>{let{repository:t,tag:e}=r(this.wanted());return`${t}:${e}`});exists=Ot$1(()=>this.normalized()!==this.source()&&this.store.images().some(t=>t.reference===this.normalized()));canSave=Ot$1(()=>!this.saving()&&d$1(this.wanted())&&this.normalized()!==this.source());constructor(){rf(()=>{if(!this.open())return;let t=this.source();Tg(()=>{this.target.set(t.startsWith(`sha256:`)?``:t),this.problem.set(null)})})}async submit(t){if(t.preventDefault(),!this.canSave())return;let e=this.normalized();this.saving.set(!0),this.problem.set(null);try{let n=await window.electron.images.tag(this.source(),e);n.ok?(this.toast.success(this.t().saved(e)),this.store.refresh(),this.open.set(!1)):this.problem.set(n.problem)}catch(n){this.problem.set(eH(n))}finally{this.saving.set(!1)}}static ɵfac=function(e){return new(e||a)};static ɵcmp=wc({type:a,selectors:[[`app-tag-dialog`]],inputs:{open:[1,`open`],source:[1,`source`]},outputs:{open:`openChange`},decls:2,vars:1,consts:[[`rdxDialogRoot`,``,3,`openChange`,`open`],[`rdxDialogPortal`,``],[`rdxDialogBackdrop`,``,1,`fixed`,`inset-0`,`z-40`,`bg-black/50`],[`rdxDialogViewport`,``,1,`fixed`,`inset-0`,`z-50`,`grid`,`place-items-center`,`p-4`],[`rdxDialogPopup`,``,`data-testid`,`tag-dialog`,1,`w-full`,`max-w-md`,`rounded-lg`,`border`,`border-ink-700`,`bg-ink-850`,`p-5`,`shadow-2xl`],[`rdxDialogTitle`,``,1,`text-[15px]`,`font-semibold`,`text-ink-100`],[`rdxDialogDescription`,``,1,`mt-1`,`text-[13px]`,`text-ink-400`],[1,`mt-4`,3,`submit`],[1,`block`],[1,`text-[13px]`,`font-medium`,`text-ink-200`],[`type`,`text`,`spellcheck`,`false`,`autocomplete`,`off`,`data-testid`,`tag-name`,3,`input`,`value`],[`data-testid`,`tag-invalid`,1,`mt-2`,`text-[12px]`,`text-danger`],[`data-testid`,`tag-exists`,1,`mt-2`,`text-[12px]`,`text-warn`],[`role`,`alert`,1,`mt-3`,`rounded-md`,`border`,`border-danger/40`,`bg-danger/10`,`px-3`,`py-2`,`text-[13px]`,`text-danger`],[1,`mt-5`,`flex`,`items-center`,`justify-end`,`gap-2`],[`type`,`button`,`rdxDialogClose`,``,1,`mx-btn`,`mx-focus`],[`name`,`close`,3,`size`],[`type`,`submit`,`data-testid`,`tag-save`,1,`mx-btn`,`mx-focus`,`border-accent`,`text-accent`,3,`disabled`],[`name`,`plus`,3,`size`]],template:function(e,n){e&1&&(Oi(0,`div`,0),vg(`openChange`,function(d){return vS(n.open,d)||(n.open=d),d}),_m(1,Ft,22,13,`ng-template`,1),Nc()),e&2&&hg(`open`,n.open)},dependencies:[ie,ln$1,an$1,pn$1,cn$1,fn$1,dn$1,un$1,My],encapsulation:2})}});function Ut(a,t){if(a&1&&(Oi(0,`option`,22),fS(1),Nc()),a&2){let e=t.$implicit,n=HE(2);Wm(`value`,e.name)(`selected`,n.network()===e.name),ec(),pg(e.name)}}function At(a,t){if(a&1){let e=$E();Oi(0,`label`,23)(1,`span`,13),fS(2),Nc(),Oi(3,`input`,14),Jm(`input`,function(l){Ld(e);return Od(HE(2).networkAlias.set(l.target.value))}),Nc(),Oi(4,`span`,35),fS(5),Nc()()}if(a&2){let e=HE(2);ec(2),pg(e.t().networkAlias),ec(),nS(e.field+` mt-1.5 w-full`),Wm(`placeholder`,e.t().networkAliasPlaceholder)(`value`,e.networkAlias()),Br(`aria-label`,e.t().networkAlias),ec(2),pg(e.t().networkAliasHint)}}function jt(a,t){if(a&1){let e=$E();Oi(0,`input`,37),Jm(`input`,function(l){let d=Ld(e).$index;return Od(HE(3).setPort(d,{host:l.target.value}))}),Nc(),Oi(1,`span`,38),fS(2,`→`),Nc(),Oi(3,`input`,39),Jm(`input`,function(l){let d=Ld(e).$index;return Od(HE(3).setPort(d,{container:l.target.value}))}),Nc(),Oi(4,`select`,20),Jm(`change`,function(l){let d=Ld(e).$index;return Od(HE(3).setPort(d,{protocol:l.target.value}))}),Oi(5,`option`,40),fS(6,`tcp`),Nc(),Oi(7,`option`,41),fS(8,`udp`),Nc()(),Oi(9,`button`,25),Jm(`click`,function(){let l=Ld(e).$index;return Od(HE(3).removePort(l))}),Gm(10,`app-icon`,42),Nc()}if(a&2){let e=t.$implicit,n=t.$index,l=HE(3);nS(l.field),Wm(`placeholder`,l.t().hostPortPlaceholder)(`value`,e.host),Br(`aria-label`,l.t().hostPort(n+1)),ec(3),nS(l.field),Wm(`value`,e.container),Br(`aria-label`,l.t().containerPort(n+1)),ec(),nS(l.field),Br(`aria-label`,l.t().protocol(n+1)),ec(),Wm(`selected`,e.protocol===`tcp`),ec(2),Wm(`selected`,e.protocol===`udp`),ec(2),nS(l.removeButton),Br(`aria-label`,l.t().removePort(n+1)),ec(),Wm(`size`,14)}}function Ht(a,t){if(a&1&&(Oi(0,`div`,24)(1,`span`,36),fS(2),Nc(),Gm(3,`span`),Oi(4,`span`,36),fS(5),Nc(),Oi(6,`span`,36),fS(7),Nc(),Gm(8,`span`),kc(9,jt,11,18,null,null,TE),Nc()),a&2){let e=HE(2);ec(2),pg(e.t().onThisComputer),ec(3),pg(e.t().inContainer),ec(2),pg(e.t().protocolHeader),ec(2),Tc(e.ports())}}function Kt(a,t){if(a&1){let e=$E();Oi(0,`input`,45),Jm(`input`,function(l){let d=Ld(e).$index;return Od(HE(3).setVolume(d,{source:l.target.value}))}),Nc(),Oi(1,`span`,38),fS(2,`→`),Nc(),Oi(3,`input`,46),Jm(`input`,function(l){let d=Ld(e).$index;return Od(HE(3).setVolume(d,{target:l.target.value}))}),Nc(),Oi(4,`label`,47)(5,`input`,48),Jm(`change`,function(l){let d=Ld(e).$index;return Od(HE(3).setVolume(d,{readOnly:l.target.checked}))}),Nc(),fS(6),Nc(),Oi(7,`button`,25),Jm(`click`,function(){let l=Ld(e).$index;return Od(HE(3).removeVolume(l))}),Gm(8,`app-icon`,42),Nc()}if(a&2){let e=t.$implicit,n=t.$index,l=HE(3);nS(l.field),Wm(`placeholder`,l.t().sourcePlaceholder)(`value`,e.source),Br(`aria-label`,l.t().volumeSource(n+1)),ec(3),nS(l.field),Wm(`placeholder`,l.t().targetPlaceholder)(`value`,e.target),Br(`aria-label`,l.t().volumeTarget(n+1)),ec(),Wm(`title`,l.t().readOnlyHint),ec(),Wm(`checked`,e.readOnly),ec(),Ac(` `,l.t().readOnly,` `),ec(),nS(l.removeButton),Br(`aria-label`,l.t().removeVolume(n+1)),ec(),Wm(`size`,14)}}function qt(a,t){if(a&1&&Gm(0,`option`,44),a&2){let e=t.$implicit;Wm(`value`,e)}}function Qt(a,t){if(a&1&&(Oi(0,`div`,24)(1,`span`,36),fS(2),Nc(),Gm(3,`span`),Oi(4,`span`,36),fS(5),Nc(),Gm(6,`span`)(7,`span`),kc(8,Kt,9,17,null,null,TE),Nc(),Oi(10,`datalist`,43),kc(11,qt,1,1,`option`,44,Sc),Nc()),a&2){let e=HE(2);ec(2),pg(e.t().source),ec(3),pg(e.t().inContainer),ec(3),Tc(e.volumes()),ec(3),Tc(e.knownVolumes())}}function Zt(a,t){if(a&1){let e=$E();Oi(0,`input`,49),Jm(`input`,function(l){let d=Ld(e).$index;return Od(HE(3).setEnvKey(d,l.target))}),Nc(),Oi(1,`span`,38),fS(2,`=`),Nc(),Oi(3,`input`,50),Jm(`input`,function(l){let d=Ld(e).$index;return Od(HE(3).setEnv(d,{value:l.target.value}))}),Nc(),Oi(4,`button`,25),Jm(`click`,function(){let l=Ld(e).$index;return Od(HE(3).removeEnv(l))}),Gm(5,`app-icon`,42),Nc()}if(a&2){let e=t.$implicit,n=t.$index,l=HE(3);nS(l.field+` font-mono`),Wm(`value`,e.key),Br(`aria-label`,l.t().envName(n+1)),ec(3),nS(l.field+` font-mono`),Wm(`value`,e.value),Br(`aria-label`,l.t().envValue(n+1))(`data-env-value`,n),ec(),nS(l.removeButton),Br(`aria-label`,l.t().removeEnv(n+1)),ec(),Wm(`size`,14)}}function Gt(a,t){if(a&1&&(Oi(0,`div`,27)(1,`span`,36),fS(2),Nc(),Gm(3,`span`),Oi(4,`span`,36),fS(5),Nc(),Gm(6,`span`),kc(7,Zt,6,13,null,null,TE),Nc()),a&2){let e=HE(2);ec(2),pg(e.t().envNameHeader),ec(3),pg(e.t().envValueHeader),ec(2),Tc(e.env())}}function Jt(a,t){a&1&&(Oi(0,`p`,29),fS(1),Nc()),a&2&&(ec(),Ac(` `,t,` `))}function Xt(a,t){if(a&1){let e=$E();Gm(0,`div`,2),Oi(1,`div`,3)(2,`div`,4)(3,`div`,5)(4,`h2`,6),fS(5),Nc(),Oi(6,`p`,7)(7,`span`),fS(8),Nc(),Oi(9,`code`,8),fS(10),Nc()()(),Oi(11,`form`,9),Jm(`submit`,function(l){Ld(e);return Od(HE().submit(l))}),Oi(12,`div`,10)(13,`section`,11)(14,`label`,12)(15,`span`,13),fS(16),Nc(),Oi(17,`input`,14),Jm(`input`,function(l){Ld(e);return Od(HE().name.set(l.target.value))}),Nc()(),Oi(18,`label`,15)(19,`input`,16),Jm(`change`,function(l){Ld(e);return Od(HE().autoRestart.set(l.target.checked))}),Nc(),Oi(20,`span`)(21,`span`,17),fS(22),Nc(),Oi(23,`span`,18),fS(24),Nc()()()(),Oi(25,`section`)(26,`h3`,13),fS(27),Nc(),Oi(28,`p`,19),fS(29),Nc(),Oi(30,`select`,20),Jm(`change`,function(l){Ld(e);return Od(HE().setNetwork(l.target.value))}),Oi(31,`option`,21),fS(32),Nc(),kc(33,Ut,2,3,`option`,22,$t),Nc(),SE(35,At,6,7,`label`,23),Nc(),Oi(36,`section`)(37,`h3`,13),fS(38),Nc(),Oi(39,`p`,19),fS(40),Nc(),SE(41,Ht,11,3,`div`,24),Oi(42,`button`,25),Jm(`click`,function(){Ld(e);return Od(HE().addPort())}),Gm(43,`app-icon`,26),fS(44),Nc()(),Oi(45,`section`)(46,`h3`,13),fS(47),Nc(),Oi(48,`p`,19),fS(49),Nc(),SE(50,Qt,13,2),Oi(51,`button`,25),Jm(`click`,function(){Ld(e);return Od(HE().addVolume())}),Gm(52,`app-icon`,26),fS(53),Nc()(),Oi(54,`section`)(55,`h3`,13),fS(56),Nc(),Oi(57,`p`,19),fS(58),Nc(),SE(59,Gt,9,2,`div`,27),Oi(60,`button`,25),Jm(`click`,function(){Ld(e);return Od(HE().addEnv())}),Gm(61,`app-icon`,26),fS(62),Nc()()(),Oi(63,`div`,28),SE(64,Jt,2,1,`p`,29),Oi(65,`div`,30)(66,`button`,31),Gm(67,`app-icon`,32),fS(68),Nc(),Oi(69,`button`,33),Gm(70,`app-icon`,34),fS(71),Nc()()()()()()}if(a&2){let e,n=HE();ec(5),pg(n.t().title),ec(3),pg(n.t().fromImage),ec(2),pg(n.image()),ec(6),pg(n.t().name),ec(),nS(n.field+` mt-1.5 w-full`),Wm(`placeholder`,n.t().namePlaceholder)(`value`,n.name()),ec(2),Wm(`checked`,n.autoRestart()),ec(3),pg(n.t().autoRestart),ec(2),pg(n.t().autoRestartHint),ec(3),pg(n.t().network),ec(2),pg(n.t().networkHint),ec(),nS(n.field+` mt-3 w-full`),Br(`aria-label`,n.t().network),ec(),Wm(`selected`,n.network()===``),ec(),pg(n.t().networkDefault),ec(),Tc(n.selectableNetworks()),ec(2),kE(n.canAlias()?35:-1),ec(3),pg(n.t().ports),ec(2),pg(n.t().portsHint),ec(),kE(n.ports().length>0?41:-1),ec(),nS(n.addButton),Br(`aria-label`,n.t().addPort),ec(),Wm(`size`,14),ec(),Ac(` `,n.t().addPort,` `),ec(3),pg(n.t().volumes),ec(2),pg(n.t().volumesHint),ec(),kE(n.volumes().length>0?50:-1),ec(),nS(n.addButton),Br(`aria-label`,n.t().addVolume),ec(),Wm(`size`,14),ec(),Ac(` `,n.t().addVolume,` `),ec(3),pg(n.t().env),ec(2),pg(n.t().envHint),ec(),kE(n.env().length>0?59:-1),ec(),nS(n.addButton),Br(`aria-label`,n.t().addEnv),ec(),Wm(`size`,14),ec(),Ac(` `,n.t().addEnv,` `),ec(2),kE((e=n.problem())?64:-1,e),ec(3),Wm(`size`,14),ec(),Ac(` `,n.common().cancel,` `),ec(),Wm(`disabled`,!n.canSubmit()),ec(),Wm(`size`,14),ec(),Ac(` `,n.busy()?n.t().starting:n.t().submit,` `)}}var $t;var Yt;var en;var tn;var we;var Ge=f(()=>{Kr();Je$1();P();dk();lk();sk();Kr();$t=(a,t)=>t.id;Yt=`mx-focus min-w-0 rounded-md border border-ink-700 bg-ink-800 px-2.5 py-1.5 text-[13px] text-ink-100 placeholder:text-ink-500`,en=`mx-focus mt-2 inline-flex cursor-pointer items-center gap-1.5 rounded-md border border-dashed border-ink-700 px-2.5 py-1 text-[12px] text-ink-300 hover:border-ink-500 hover:text-ink-100`,tn=`mx-focus grid size-8 cursor-pointer place-items-center rounded text-ink-400 hover:text-danger`,we=class a{open=mj(!1);image=jc(``);started=pj();store=C(h$1);t=Ot$1(()=>ok().images.runDialog);common=Ot$1(()=>ok().common);field=Yt;addButton=en;removeButton=tn;name=wt$1(``);autoRestart=wt$1(!1);knownVolumes=wt$1([]);knownNetworks=wt$1([]);network=wt$1(``);networkAlias=wt$1(``);ports=wt$1([]);volumes=wt$1([]);env=wt$1([]);problem=wt$1(null);busy=wt$1(!1);canSubmit=Ot$1(()=>!this.busy()&&this.image()!==``);selectableNetworks=Ot$1(()=>this.knownNetworks().filter(t=>t.name!==`bridge`));canAlias=Ot$1(()=>{let t=this.network();return t!==``&&this.knownNetworks().some(e=>e.name===t&&!e.builtIn)});constructor(){rf(()=>{this.open()&&(this.loadVolumes(),this.loadNetworks())})}async loadVolumes(){try{this.knownVolumes.set((await window.electron.volumes.list()).map(t=>t.name))}catch{this.knownVolumes.set([])}}async loadNetworks(){try{this.knownNetworks.set(await window.electron.networks.list())}catch{this.knownNetworks.set([])}}setNetwork(t){this.network.set(t),this.canAlias()||this.networkAlias.set(``)}addPort(){this.ports.update(t=>[...t,{host:``,container:``,protocol:`tcp`}])}addVolume(){this.volumes.update(t=>[...t,{source:``,target:``,readOnly:!1}])}addEnv(){this.env.update(t=>[...t,{key:``,value:``}])}removePort(t){this.ports.update(e=>e.filter((n,l)=>l!==t))}removeVolume(t){this.volumes.update(e=>e.filter((n,l)=>l!==t))}removeEnv(t){this.env.update(e=>e.filter((n,l)=>l!==t))}setPort(t,e){this.ports.update(n=>n.map((l,d)=>d===t?W(W({},l),e):l))}setVolume(t,e){this.volumes.update(n=>n.map((l,d)=>d===t?W(W({},l),e):l))}setEnv(t,e){this.env.update(n=>n.map((l,d)=>d===t?W(W({},l),e):l))}setEnvKey(t,e){let n=e.value,l=n.indexOf(`=`);if(l<=0){this.setEnv(t,{key:n});return}let d=n.slice(0,l),w=n.slice(l+1);this.setEnv(t,w===``?{key:d}:{key:d,value:w}),e.value=d,e.parentElement?.querySelector(`input[data-env-value="${String(t)}"]`)?.focus()}async submit(t){if(t.preventDefault(),!this.canSubmit())return;let e=this.collect();if(typeof e==`string`){this.problem.set(e);return}this.busy.set(!0),this.problem.set(null);try{let n=await window.electron.images.run(e);if(!n.ok){this.problem.set(n.problem);return}this.reset(),this.open.set(!1),this.started.emit(n.id),this.store.refresh()}catch(n){this.problem.set(eH(n))}finally{this.busy.set(!1)}}collect(){let t=this.t(),e=[];for(let O of this.ports()){let L=Number(O.container.trim());if(!Number.isInteger(L)||L<1||L>65535)return t.invalidContainerPort(O.container);let te=O.host.trim(),ce=te===``?null:Number(te);if(ce!==null&&(!Number.isInteger(ce)||ce<1||ce>65535))return t.invalidHostPort(O.host);e.push({hostPort:ce,containerPort:L,protocol:O.protocol})}let n=[];for(let O of this.volumes()){let L=O.source.trim(),te=O.target.trim();if(L===``||te===``)return t.volumeIncomplete;if(!te.startsWith(`/`))return t.notAbsolute(te);n.push({source:L,target:te,readOnly:O.readOnly})}let l=[];for(let O of this.env()){let L=O.key.trim();if(L===``)return t.envNameMissing;if(L.includes(`=`))return t.envNameWithEquals(L);l.push({key:L,value:O.value})}let d=this.name().trim(),w=this.network(),ne=this.canAlias()?this.networkAlias().trim():``;return ne!==``&&!/^[\w][\w.-]*$/.test(ne)?t.invalidAlias(ne):{image:this.image(),name:d===``?null:d,ports:e,volumes:n,env:l,network:w===``?null:w,networkAlias:ne===``?null:ne,restart:this.autoRestart()?`unless-stopped`:`no`}}reset(){this.name.set(``),this.autoRestart.set(!1),this.network.set(``),this.networkAlias.set(``),this.ports.set([]),this.volumes.set([]),this.env.set([]),this.problem.set(null)}static ɵfac=function(e){return new(e||a)};static ɵcmp=wc({type:a,selectors:[[`app-run-dialog`]],inputs:{open:[1,`open`],image:[1,`image`]},outputs:{open:`openChange`,started:`started`},decls:2,vars:1,consts:[[`rdxDialogRoot`,``,3,`openChange`,`open`],[`rdxDialogPortal`,``],[`rdxDialogBackdrop`,``,1,`fixed`,`inset-0`,`z-40`,`bg-black/50`],[`rdxDialogViewport`,``,1,`fixed`,`inset-0`,`z-50`,`grid`,`place-items-center`,`p-4`],[`rdxDialogPopup`,``,1,`flex`,`max-h-[85vh]`,`w-full`,`max-w-2xl`,`flex-col`,`rounded-lg`,`border`,`border-ink-700`,`bg-ink-850`,`shadow-2xl`],[1,`shrink-0`,`border-b`,`border-ink-800`,`px-5`,`pt-5`,`pb-4`],[`rdxDialogTitle`,``,1,`text-[15px]`,`font-semibold`,`text-ink-100`],[`rdxDialogDescription`,``,1,`mt-1.5`,`flex`,`items-center`,`gap-1.5`,`text-[13px]`,`text-ink-400`],[1,`rounded`,`bg-ink-800`,`px-1.5`,`py-0.5`,`font-mono`,`text-[12px]`,`text-ink-200`],[1,`flex`,`min-h-0`,`flex-1`,`flex-col`,3,`submit`],[1,`min-h-0`,`flex-1`,`space-y-6`,`overflow-y-auto`,`px-5`,`py-5`],[1,`space-y-3`],[1,`block`],[1,`text-[13px]`,`font-medium`,`text-ink-200`],[`type`,`text`,`autocomplete`,`off`,`spellcheck`,`false`,3,`input`,`placeholder`,`value`],[1,`flex`,`cursor-pointer`,`items-start`,`gap-2.5`],[`type`,`checkbox`,1,`mx-focus`,`mt-0.5`,`accent-accent`,3,`change`,`checked`],[1,`block`,`text-[13px]`,`text-ink-100`],[1,`block`,`text-[12px]`,`text-ink-500`],[1,`mt-0.5`,`text-[12px]`,`text-ink-500`],[3,`change`],[`value`,``,3,`selected`],[3,`value`,`selected`],[1,`mt-3`,`block`],[1,`mt-3`,`grid`,`grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)_7rem_2rem]`,`items-center`,`gap-x-2`,`gap-y-2`],[`type`,`button`,3,`click`],[`name`,`plus`,3,`size`],[1,`mt-3`,`grid`,`grid-cols-[minmax(0,2fr)_auto_minmax(0,3fr)_2rem]`,`items-center`,`gap-x-2`,`gap-y-2`],[1,`shrink-0`,`border-t`,`border-ink-800`,`px-5`,`py-3`],[`role`,`alert`,1,`mb-3`,`rounded-md`,`border`,`border-danger/40`,`bg-danger/10`,`px-3`,`py-2`,`text-[13px]`,`text-danger`],[1,`flex`,`justify-end`,`gap-2`],[`type`,`button`,`rdxDialogClose`,``,1,`mx-btn`,`mx-focus`],[`name`,`close`,3,`size`],[`type`,`submit`,1,`mx-btn`,`mx-focus`,`border-accent`,`text-accent`,3,`disabled`],[`name`,`play`,3,`size`],[1,`mt-1`,`block`,`text-[12px]`,`text-ink-500`],[1,`text-[11px]`,`tracking-wide`,`text-ink-500`,`uppercase`],[`type`,`text`,`inputmode`,`numeric`,3,`input`,`placeholder`,`value`],[1,`text-ink-500`],[`type`,`text`,`placeholder`,`80`,`inputmode`,`numeric`,3,`input`,`value`],[`value`,`tcp`,3,`selected`],[`value`,`udp`,3,`selected`],[`name`,`trash`,3,`size`],[`id`,`run-dialog-volumes`],[3,`value`],[`type`,`text`,`spellcheck`,`false`,`autocomplete`,`off`,`list`,`run-dialog-volumes`,3,`input`,`placeholder`,`value`],[`type`,`text`,`spellcheck`,`false`,`autocomplete`,`off`,3,`input`,`placeholder`,`value`],[1,`flex`,`cursor-pointer`,`items-center`,`gap-1.5`,`whitespace-nowrap`,`text-[12px]`,`text-ink-400`,3,`title`],[`type`,`checkbox`,1,`mx-focus`,`accent-accent`,3,`change`,`checked`],[`type`,`text`,`placeholder`,`TZ`,`spellcheck`,`false`,`autocomplete`,`off`,3,`input`,`value`],[`type`,`text`,`placeholder`,`Europe/Amsterdam`,`spellcheck`,`false`,`autocomplete`,`off`,3,`input`,`value`]],template:function(e,n){e&1&&(Oi(0,`div`,0),vg(`openChange`,function(d){return vS(n.open,d)||(n.open=d),d}),_m(1,Xt,72,49,`ng-template`,1),Nc()),e&2&&hg(`open`,n.open)},dependencies:[ie,ln$1,an$1,pn$1,cn$1,fn$1,dn$1,un$1,My],encapsulation:2})}});function nn(a,t){if(a&1&&(Oi(0,`span`,37),fS(1),Nc()),a&2){let e=HE(),n=HE();ec(),mg(``,n.sizeOf(e.done),` / `,n.sizeOf(e.total))}}function an(a,t){if(a&1&&(Oi(0,`span`,37),fS(1),Nc()),a&2){let e=HE(),n=HE();ec(),pg(n.sizeOf(e.done))}}function on(a,t){if(a&1&&(Oi(0,`div`,9)(1,`div`,35)(2,`span`,36),fS(3),Nc(),SE(4,nn,2,2,`span`,37)(5,an,2,1,`span`,37),Nc(),Oi(6,`div`,38),Gm(7,`div`,39),Nc()()),a&2){let e=t,n=HE();ec(3),pg(e.label),ec(),kE(e.total>0?4:e.done>0?5:-1),ec(3),sg(`width`,e.total===0?100:n.transferPercent(),`%`),ag(`animate-pulse`,e.total===0)}}function rn(a,t){if(a&1&&(Oi(0,`span`,17),fS(1),Nc()),a&2){let e=HE();ec(),pg(e.t().refreshing)}}function ln(a,t){if(a&1&&(Oi(0,`p`,19),fS(1),Nc()),a&2){let e=HE();ec(),pg(e.t().updatesHint)}}function sn(a,t){if(a&1){let e=$E();Oi(0,`div`,20)(1,`span`,40),fS(2),Nc(),Oi(3,`button`,41),Jm(`click`,function(){Ld(e);return Od(HE().askRemoveSelected())}),Gm(4,`app-icon`,42),fS(5),Nc()()}if(a&2){let e=HE();ec(2),pg(e.t().selected(e.selected().size)),ec(2),Wm(`size`,14),ec(),Ac(` `,e.common().remove,` `)}}function dn(a,t){if(a&1&&(Oi(0,`span`,43),fS(1),Nc()),a&2){let e=t.$implicit;ag(`text-ink-500`,e.dangling)(`text-ink-100`,!e.dangling),Wm(`title`,e.repository),ec(),Ac(` `,e.repository,` `)}}function pn(a,t){if(a&1&&(Oi(0,`span`,46),Gm(1,`app-icon`,49),fS(2),Nc()),a&2){let e=HE(2);ec(),Wm(`size`,12),ec(),Ac(` `,e.t().badge.newer,` `)}}function cn(a,t){if(a&1&&(Oi(0,`span`,47),fS(1),Nc()),a&2){HE();let e=bS(0),n=HE();Wm(`title`,e?.problem??``),ec(),pg(n.t().badge.notInRegistry)}}function mn(a,t){if(a&1&&(Oi(0,`span`,48),Gm(1,`app-icon`,50),fS(2),Nc()),a&2){HE();let e=bS(0),n=HE();Wm(`title`,e?.problem??``),ec(),Wm(`size`,12),ec(),Ac(` `,n.t().badge.uncheckable,` `)}}function un(a,t){if(a&1&&(bg(0),Oi(1,`span`,44)(2,`span`,45),fS(3),Nc(),SE(4,pn,3,2,`span`,46)(5,cn,2,2,`span`,47)(6,mn,3,3,`span`,48),Nc()),a&2){let e=t.$implicit,n=yS(HE().updateOf(e));ec(2),Wm(`title`,e.tag),ec(),pg(e.tag),ec(),kE(n?.state===`update`?4:n?.state===`unknown`?5:n?.state===`error`?6:-1)}}function gn(a,t){if(a&1&&(Oi(0,`span`,51),fS(1),Nc()),a&2){let e=t.$implicit;ec(),pg(e.shortId)}}function _n(a,t){if(a&1&&(Oi(0,`span`,52),fS(1),Nc()),a&2){let e=HE().$implicit,n=HE();ec(),pg(n.t().containerCount(e.inUseBy))}}function xn(a,t){a&1&&(Oi(0,`span`,53),fS(1,`—`),Nc())}function fn(a,t){if(a&1&&SE(0,_n,2,1,`span`,52)(1,xn,2,0,`span`,53),a&2){let e=t.$implicit;kE(e.inUseBy>0?0:1)}}function yn(a,t){if(a&1&&(Oi(0,`span`,54),fS(1),Nc()),a&2){let e=t.$implicit,n=HE();ec(),pg(n.ageOf(e.createdAt))}}function vn(a,t){if(a&1&&(Oi(0,`span`,55),fS(1),Nc()),a&2){let e=t.$implicit,n=HE();ec(),pg(n.sizeOf(e.sizeBytes))}}function hn(a,t){if(a&1){let e=$E();Oi(0,`div`,56)(1,`app-action-menu`,57),Jm(`picked`,function(l){let d=Ld(e).$implicit;return Od(HE().onRowMenu(l,d))}),Nc()()}if(a&2){let e=t.$implicit,n=HE();ec(),Wm(`label`,n.t().rowMenu(e.reference))(`items`,n.rowMenu(e))}}var Je;f(()=>{Kr();ra();o();P();M();h();G();Ke();J();oe();K();dk();x();qe();Qe();Ze();Ge();sk();lk();f$1();Kr();Je=class a{store=C(h$1);toast=C(u);router=C(fe);route=C(Q);preferences=C(p);t=Ot$1(()=>ok().images);common=Ot$1(()=>ok().common);columns=Ot$1(()=>{let t=this.t().columns;return[{key:`repository`,label:t.repository},{key:`tag`,label:t.tag,width:`230px`},{key:`shortId`,label:t.imageId,width:`120px`},{key:`inUse`,label:t.inUse,width:`110px`},{key:`created`,label:t.created,width:`150px`},{key:`size`,label:t.size,width:`100px`,align:`right`},{key:`actions`,label:t.actions,width:`84px`,align:`right`}]});loading=this.store.loading;problem=this.store.problem;pending=this.store.pending;unusedCount=this.store.unusedCount;search=wt$1(``);zoek=jc(void 0);starten=jc(void 0);lagen=jc(void 0);ophalen=jc(void 0);verwijder=jc(void 0);controleren=jc(void 0);onlyUnused=this.preferences.flag(`images.onlyUnused`);selected=wt$1(new Set);removal=wt$1(null);confirmOpen=wt$1(!1);pullOpen=wt$1(!1);tagSource=wt$1(``);tagOpen=wt$1(!1);pushReference=wt$1(``);pushOpen=wt$1(!1);pullPreset=wt$1(null);updates=this.store.updates;checkingUpdates=this.store.checkingUpdates;hasUpdates=Ot$1(()=>[...this.updates()?.values()??[]].some(t=>t.state===`update`));runOpen=wt$1(!1);runImage=wt$1(``);layersOpen=wt$1(!1);layersImage=wt$1(``);rows=Ot$1(()=>{let t=this.search().trim().toLowerCase(),e=this.onlyUnused();return this.store.images().filter(n=>e&&n.inUseBy>0?!1:t===``?!0:`${n.repository}:${n.tag} ${n.shortId}`.toLowerCase().includes(t))});totalSize=Ot$1(()=>d(this.store.totalBytes()));selectedRefs=Ot$1(()=>[...this.selected()]);trackKey=t=>t.reference;transfer=wt$1(null);transferPercent(){let t=this.transfer();return t===null||t.total===0?0:Math.min(100,t.done/t.total*100)}async saveToFile(t){this.transfer.set({label:this.t().file.saving(t),done:0,total:0});try{let e=await window.electron.images.saveToFile(t);e.ok?this.toast.success(this.t().file.saved(e.path,d(e.bytes))):e.canceled||this.toast.error(e.problem)}catch(e){this.toast.error(eH(e))}finally{this.transfer.set(null)}}async loadFromFile(){this.transfer.set({label:this.t().file.loading,done:0,total:0});try{let t=await window.electron.images.loadFromFile();t.ok?(this.toast.success(t.loaded.length===0?this.t().file.loadedNothing:this.t().file.loaded(t.loaded.join(`, `))),this.store.refresh()):t.canceled||this.toast.error(t.problem)}catch(t){this.toast.error(eH(t))}finally{this.transfer.set(null)}}constructor(){C(ve$1).onDestroy(window.electron.images.onFileProgress(t=>this.transfer.update(e=>e===null?null:W(W({},e),t)))),rf(()=>{let t=this.zoek();t!==void 0&&Tg(()=>this.search.set(t))}),this.fromRoute(this.starten,`starten`,t=>{this.runImage.set(t),this.runOpen.set(!0)}),this.fromRoute(this.lagen,`lagen`,t=>{this.layersImage.set(t),this.layersOpen.set(!0)}),this.fromRoute(this.ophalen,`ophalen`,t=>this.openPull(t)),this.fromRoute(this.controleren,`controleren`,()=>this.checkUpdates()),rf(()=>{let t=this.verwijder(),e=this.store.images().find(n=>n.reference===t);t!==void 0&&e!==void 0&&Tg(()=>{this.askRemove(e),i(this.router,this.route,`verwijder`)})}),this.store.refresh()}fromRoute(t,e,n){rf(()=>{let l=t();l!==void 0&&Tg(()=>{n(l),i(this.router,this.route,e)})})}menuItems=Ot$1(()=>{let t=this.t().menu;return[{id:`pull`,label:t.pull,icon:`download`},{id:`check`,label:this.checkingUpdates()?t.checking:t.check,icon:`refresh`,disabled:this.checkingUpdates()},{id:`prune-dangling`,label:t.pruneDangling,icon:`broom`,separated:!0},{id:`prune-unused`,label:t.pruneUnused,icon:`broom`},{id:`load`,label:t.load,icon:`upload`,disabled:this.transfer()!==null,separated:!0}]});onMenu(t){switch(t){case`pull`:this.openPull(null);break;case`check`:this.checkUpdates();break;case`prune-dangling`:this.askPrune(!1);break;case`prune-unused`:this.askPrune(!0);break;case`load`:this.loadFromFile();break}}checkUpdates(){this.store.checkUpdates()}openPull(t){this.pullPreset.set(t),this.pullOpen.set(!0)}pullClosed(t){this.pullOpen.set(t),t||(this.pullPreset.set(null),this.store.recheckIfChecked())}updateOf(t){return this.updates()?.get(t.reference)??null}sizeOf(t){return d(t)}ageOf(t){return N(t)}rowMenu(t){let e=this.pending().has(t.reference),n=this.t(),l=[];return this.updateOf(t)?.state===`update`&&l.push({id:`update`,label:n.rowUpdate,icon:`download`,disabled:e,hint:n.updateTitle(t.reference)}),l.push({id:`run`,label:n.rowRun,icon:`play`,disabled:e,hint:this.runLabelOf(t)},{id:`layers`,label:n.rowLayers,icon:`images`},{id:`save`,label:n.rowSave,icon:`download`,disabled:this.transfer()!==null},{id:`tag`,label:n.rowTag,icon:`plus`,separated:!0}),t.dangling||l.push({id:`push`,label:n.rowPush,icon:`upload`,disabled:e}),!t.dangling&&(t.inUseBy>0||this.store.images().some(d=>d.id===t.id&&d.reference!==t.reference))&&l.push({id:`untag`,label:n.rowUntag,icon:`eraser`,disabled:e}),l.push({id:`remove`,label:this.common().remove,icon:`trash`,disabled:e,danger:!0,separated:!0}),l}onRowMenu(t,e){t===`save`?this.saveToFile(e.reference):t===`update`?this.openPull(e.reference):t===`run`?this.askRun(e):t===`layers`?(this.layersImage.set(e.reference),this.layersOpen.set(!0)):t===`tag`?(this.tagSource.set(e.reference),this.tagOpen.set(!0)):t===`push`?(this.pushReference.set(e.reference),this.pushOpen.set(!0)):t===`untag`?this.untag(e.reference):this.askRemove(e)}async untag(t){try{let e=await window.electron.images.untag(t);e.ok?(this.toast.success(this.t().untagged(t)),this.store.refresh()):this.toast.error(e.problem)}catch(e){this.toast.error(eH(e))}}askRun(t){this.runImage.set(t.reference),this.runOpen.set(!0)}goToContainer(t){this.router.navigate([`/containers`,t]).catch(()=>{})}runLabelOf(t){return t.dangling?this.t().runLabelDangling:this.t().runLabel(t.reference)}askRemove(t){let e=t.inUseBy>0,n=this.t().remove;this.removal.set({references:[t.reference],title:e?n.forceTitle:n.title,description:e?n.forceDescription(t.reference,t.inUseBy):n.description(t.reference),confirmLabel:e?n.forceConfirm:this.common().remove,force:e}),this.confirmOpen.set(!0)}askRemoveSelected(){let t=this.selectedRefs(),e=this.t().remove;this.removal.set({references:t,title:e.manyTitle,description:e.manyDescription(t.length),confirmLabel:this.common().remove,force:!1}),this.confirmOpen.set(!0)}askPrune(t){let e=this.t().prune;this.removal.set({references:[],title:t?e.allTitle:e.danglingTitle,description:t?e.allDescription:e.danglingDescription,confirmLabel:e.confirm,force:t}),this.confirmOpen.set(!0)}confirm(){let t=this.removal();t!==null&&(t.references.length===0?this.store.prune(t.force):(this.store.removeMany(t.references,t.force),this.selected.set(new Set)),this.removal.set(null))}removalTitle(){return this.removal()?.title??``}removalDescription(){return this.removal()?.description??``}removalConfirmLabel(){return this.removal()?.confirmLabel??this.common().remove}removalConfirmIcon(){return this.removal()?.references.length===0?`broom`:`trash`}static ɵfac=function(e){return new(e||a)};static ɵcmp=wc({type:a,selectors:[[`app-images-page`]],inputs:{zoek:[1,`zoek`],starten:[1,`starten`],lagen:[1,`lagen`],ophalen:[1,`ophalen`],verwijder:[1,`verwijder`],controleren:[1,`controleren`]},decls:47,vars:38,consts:[[1,`flex`,`h-full`,`flex-col`],[1,`shrink-0`,`px-6`,`pt-5`,`pb-3`],[1,`flex`,`flex-wrap`,`items-start`,`gap-4`],[1,`text-xl`,`font-semibold`,`tracking-tight`,`text-ink-100`],[1,`mt-3`,`flex`,`flex-wrap`,`gap-x-10`,`gap-y-2`],[1,`text-[12px]`,`text-ink-400`],[1,`text-[15px]`,`font-medium`,`text-ink-100`],[1,`ml-auto`],[3,`picked`,`label`,`items`],[`role`,`status`,`data-testid`,`image-transfer`,1,`mt-3`,`max-w-md`],[1,`mt-4`,`flex`,`flex-wrap`,`items-center`,`gap-4`],[1,`relative`,`flex`,`items-center`],[1,`pointer-events-none`,`absolute`,`left-2.5`,`text-ink-500`],[`name`,`search`,3,`size`],[1,`sr-only`],[`type`,`search`,1,`mx-focus`,`w-72`,`rounded-md`,`border`,`border-ink-700`,`bg-ink-850`,`py-1.5`,`pr-3`,`pl-8`,`text-[13px]`,`text-ink-100`,`placeholder:text-ink-500`,3,`input`,`placeholder`,`value`],[3,`onChange`,`label`,`on`],[1,`text-[12px]`,`text-ink-500`],[3,`problem`],[1,`mt-2`,`text-[12px]`,`text-ink-400`],[1,`mt-3`,`flex`,`items-center`,`gap-2`,`rounded-md`,`border`,`border-ink-700`,`bg-ink-850`,`px-3`,`py-2`],[1,`min-h-0`,`flex-1`,`overflow-y-auto`,`px-6`,`pb-6`],[3,`selectedChange`,`columns`,`rows`,`trackKey`,`selected`,`emptyMessage`],[`appCell`,`repository`],[`appCell`,`tag`],[`appCell`,`shortId`],[`appCell`,`inUse`],[`appCell`,`created`],[`appCell`,`size`],[`appCell`,`actions`],[3,`openChange`,`confirmed`,`open`,`title`,`description`,`confirmLabel`,`confirmIcon`],[3,`openChange`,`open`,`preset`],[3,`openChange`,`open`,`source`],[3,`openChange`,`open`,`reference`],[3,`openChange`,`started`,`open`,`image`],[1,`flex`,`items-baseline`,`justify-between`,`text-[12px]`],[1,`text-ink-300`],[1,`text-ink-500`,`tabular-nums`],[1,`mt-1`,`h-1.5`,`w-full`,`overflow-hidden`,`rounded-full`,`bg-ink-800`],[1,`h-full`,`rounded-full`,`bg-accent`,`transition-[width]`],[1,`text-[13px]`,`text-ink-200`],[`type`,`button`,1,`mx-btn`,`mx-focus`,`ml-auto`,`text-danger`,`hover:text-danger`,3,`click`],[`name`,`trash`,3,`size`],[1,`block`,`truncate`,3,`title`],[1,`flex`,`min-w-0`,`items-center`,`gap-2`],[1,`truncate`,`text-ink-300`,3,`title`],[`data-testid`,`update-badge`,1,`flex`,`shrink-0`,`items-center`,`gap-1`,`text-[11px]`,`text-warn`],[1,`shrink-0`,`text-[11px]`,`text-ink-500`,3,`title`],[1,`flex`,`shrink-0`,`items-center`,`gap-1`,`text-[11px]`,`text-ink-500`,3,`title`],[`name`,`arrow-up`,3,`size`],[`name`,`warning`,3,`size`],[1,`font-mono`,`text-[12px]`,`text-ink-400`],[1,`text-ink-200`],[1,`text-ink-600`],[1,`text-ink-400`],[1,`tabular-nums`,`text-ink-200`],[1,`flex`,`items-center`,`justify-end`],[`compact`,``,3,`picked`,`label`,`items`]],template:function(e,n){if(e&1&&(Oi(0,`section`,0)(1,`div`,1)(2,`div`,2)(3,`div`)(4,`h1`,3),fS(5),Nc(),Oi(6,`div`,4)(7,`div`)(8,`div`,5),fS(9),Nc(),Oi(10,`div`,6),fS(11),Nc()(),Oi(12,`div`)(13,`div`,5),fS(14),Nc(),Oi(15,`div`,6),fS(16),Nc()()()(),Oi(17,`div`,7)(18,`app-action-menu`,8),Jm(`picked`,function(d){return n.onMenu(d)}),Nc()()(),SE(19,on,8,6,`div`,9),Oi(20,`div`,10)(21,`label`,11)(22,`span`,12),Gm(23,`app-icon`,13),Nc(),Oi(24,`span`,14),fS(25),Nc(),Oi(26,`input`,15),Jm(`input`,function(d){return n.search.set(d.target.value)}),Nc()(),Oi(27,`app-filter-switch`,16),vg(`onChange`,function(d){return vS(n.onlyUnused,d)||(n.onlyUnused=d),d}),Nc(),SE(28,rn,2,1,`span`,17),Nc(),Gm(29,`app-page-messages`,18),SE(30,ln,2,1,`p`,19),SE(31,sn,6,3,`div`,20),Nc(),Oi(32,`div`,21)(33,`app-data-table`,22),vg(`selectedChange`,function(d){return vS(n.selected,d)||(n.selected=d),d}),_m(34,dn,2,6,`ng-template`,23)(35,un,7,4,`ng-template`,24)(36,gn,2,1,`ng-template`,25)(37,fn,2,1,`ng-template`,26)(38,yn,2,1,`ng-template`,27)(39,vn,2,1,`ng-template`,28)(40,hn,2,2,`ng-template`,29),Nc()()(),Oi(41,`app-confirm-dialog`,30),vg(`openChange`,function(d){return vS(n.confirmOpen,d)||(n.confirmOpen=d),d}),Jm(`confirmed`,function(){return n.confirm()}),Nc(),Oi(42,`app-pull-dialog`,31),Jm(`openChange`,function(d){return n.pullClosed(d)}),Nc(),Oi(43,`app-tag-dialog`,32),vg(`openChange`,function(d){return vS(n.tagOpen,d)||(n.tagOpen=d),d}),Nc(),Oi(44,`app-push-dialog`,33),vg(`openChange`,function(d){return vS(n.pushOpen,d)||(n.pushOpen=d),d}),Nc(),Oi(45,`app-run-dialog`,34),vg(`openChange`,function(d){return vS(n.runOpen,d)||(n.runOpen=d),d}),Jm(`started`,function(d){return n.goToContainer(d)}),Nc(),Oi(46,`app-layers-dialog`,33),vg(`openChange`,function(d){return vS(n.layersOpen,d)||(n.layersOpen=d),d}),Nc()),e&2){let l;ec(5),pg(n.t().title),ec(4),pg(n.t().diskSpace),ec(2),pg(n.totalSize()),ec(3),pg(n.t().unused),ec(2),pg(n.unusedCount()),ec(2),Wm(`label`,n.t().menuLabel)(`items`,n.menuItems()),ec(),kE((l=n.transfer())?19:-1,l),ec(4),Wm(`size`,15),ec(2),pg(n.t().searchLabel),ec(),Wm(`placeholder`,n.t().searchLabel)(`value`,n.search()),ec(),Wm(`label`,n.t().onlyUnused),hg(`on`,n.onlyUnused),ec(),kE(n.loading()?28:-1),ec(),Wm(`problem`,n.problem()),ec(),kE(n.hasUpdates()?30:-1),ec(),kE(n.selected().size>0?31:-1),ec(2),Wm(`columns`,n.columns())(`rows`,n.rows())(`trackKey`,n.trackKey),hg(`selected`,n.selected),Wm(`emptyMessage`,n.t().empty),ec(8),hg(`open`,n.confirmOpen),Wm(`title`,n.removalTitle())(`description`,n.removalDescription())(`confirmLabel`,n.removalConfirmLabel())(`confirmIcon`,n.removalConfirmIcon()),ec(),Wm(`open`,n.pullOpen())(`preset`,n.pullPreset()),ec(),hg(`open`,n.tagOpen),Wm(`source`,n.tagSource()),ec(),hg(`open`,n.pushOpen),Wm(`reference`,n.pushReference()),ec(),hg(`open`,n.runOpen),Wm(`image`,n.runImage()),ec(),hg(`open`,n.layersOpen),Wm(`reference`,n.layersImage())}},dependencies:[z,x$1,My,W$1,u$1,ve,we,ye,P$1,V,be,he],encapsulation:2})}})();export{Je as ImagesPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{B as Kr,Rt as X,cn as f,gr as wt}from"./chunk-BdOOWVGY.js";function g(s){try{return localStorage.getItem(u+s)}catch{return null}}function o(s,n){try{localStorage.setItem(u+s,n)}catch{}}function y(s){try{localStorage.removeItem(u+s)}catch{}}function b(s){if(s===null)return new Set;try{let n=JSON.parse(s);return new Set(Array.isArray(n)?n.filter(r=>typeof r==`string`):[])}catch{return new Set}}function v(s){if(s===null)return new Map;try{let n=JSON.parse(s);if(!Array.isArray(n))return new Map;let r=n.filter(t=>Array.isArray(t)&&t.length===2&&typeof t[0]==`string`&&typeof t[1]==`string`);return new Map(r)}catch{return new Map}}var u;var p;var M=f(()=>{Kr();Kr();u=`mx.pref.`;p=class s{flags=new Map;sets=new Map;maps=new Map;choices=new Map;flag(n,r=!1){let t=this.flags.get(n);if(t!==void 0)return t;let i=g(n),e=wt(i===null?r:i===`true`),f=e.set.bind(e);return e.set=l=>{f(l),o(n,String(l))},e.update=l=>e.set(l(e())),this.flags.set(n,e),e}names(n){let r=this.sets.get(n);if(r!==void 0)return r;let t=wt(b(g(n))),i=t.set.bind(t);return t.set=e=>{i(e),o(n,JSON.stringify([...e]))},t.update=e=>t.set(e(t())),this.sets.set(n,t),t}entries(n){let r=this.maps.get(n);if(r!==void 0)return r;let t=wt(v(g(n))),i=t.set.bind(t);return t.set=e=>{i(e),o(n,JSON.stringify([...e]))},t.update=e=>t.set(e(t())),this.maps.set(n,t),t}choice(n){let r=this.choices.get(n);if(r!==void 0)return r;let t=wt(g(n)),i=t.set.bind(t);return t.set=e=>{i(e),e===null?y(n):o(n,e)},t.update=e=>t.set(e(t())),this.choices.set(n,t),t}static ɵfac=function(r){return new(r||s)};static ɵprov=X({token:s,factory:s.ɵfac,providedIn:`root`})}});export{p as n,M as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$n as sk,A as HE,B as Kr,Bn as ok,Cr as zE,Ct as Tg,D as Gm,Dn as kc,En as kE,Fn as nS,H as Ld,J as Nc,K as My,Nn as mg,Pt as Wm,R as Jm,Rt as X,St as Tc,Tn as jc,Wn as pg,Xn as rf,Zn as rg,_t as Sc,cn as f,cr as ve,et as Od,f as C,gn as gj,gr as wt,h as Cj,ht as SE,ln as fS,lr as vg,mr as wc,o as Ac,or as vS,qt as ag,rn as dk,rt as Ot,sn as ec,t as $E,tt as Oi,u as Br,xn as hg}from"./chunk-BdOOWVGY.js";import"./chunk-V7ftX_10.js";import"./chunk-D29s9m84.js";import{n as o,t as i}from"./chunk-Zcfhi-RM.js";import{n as p,t as M}from"./chunk-C22Z7vgK.js";import"./chunk-eG8Su12W.js";import{n as v,t as u}from"./chunk-BoN9ZlqT.js";import{r as Q,s as fe,u as ra}from"./chunk-DzG5R5Kk.js";import{n as P,t as K}from"./chunk-DvoPI4MU.js";import{a as T,c as j,i as H,n as B,o as U,r as G,s as V,t as $}from"./chunk-KUYJNmP22.js";var de;var D;var pe=f(()=>{Kr();v();M();Kr();de=5e3,D=class i{store=C(u);project=C(p).choice(`logs.project`);buffer=wt([]);dropped=wt(!1);following=wt(!1);lines=this.buffer.asReadonly();truncated=this.dropped.asReadonly();active=this.following.asReadonly();sources=Ot(()=>this.store.containers().filter(e=>e.state===`running`).filter(e=>this.project()===null||e.composeProject===this.project()).map(e=>({containerId:e.id,containerName:e.name,composeProject:e.composeProject,composeService:e.composeService})),{equal:(e,t)=>e.length===t.length&&e.every((n,d)=>n.containerId===t[d].containerId)});constructor(){let e=C(ve);e.onDestroy(window.electron.logs.onAllLines(t=>this.append(t))),rf(()=>{let t=this.following()?this.sources():[];window.electron.logs.watchAll(t)}),e.onDestroy(()=>{window.electron.logs.watchAll([])})}attach(){this.following.set(!0)}detach(){this.following.set(!1)}clear(){this.buffer.set([]),this.dropped.set(!1)}async follow(e){e!==this.project()&&(await window.electron.logs.watchAll([]),this.clear(),this.project.set(e))}append(e){if(!this.following())return;let t=[...this.buffer(),...e];if(t.length>de){this.dropped.set(!0),this.buffer.set(t.slice(t.length-de));return}this.buffer.set(t)}static ɵfac=function(t){return new(t||i)};static ɵprov=X({token:i,factory:i.ɵfac,providedIn:`root`})}});function we(i,e){return this.trackId(e)}function Se(i,e){if(i&1&&(Oi(0,`option`,37),fS(1),Nc()),i&2){let t=e.$implicit,n=HE(2);Wm(`value`,t)(`selected`,n.project()===t),ec(),pg(t)}}function Le(i,e){if(i&1){let t=$E();Oi(0,`select`,35),Jm(`change`,function(d){Ld(t);return Od(HE().chooseProject(d.target.value))}),Oi(1,`option`,36),fS(2),Nc(),kc(3,Se,2,3,`option`,37,Sc),Nc()}if(i&2){let t=HE();Br(`aria-label`,t.t().projectLabel),ec(),Wm(`selected`,t.project()===null),ec(),pg(t.t().allProjects),ec(),Tc(t.projects())}}function ke(i,e){if(i&1&&(Oi(0,`span`,18),fS(1),Nc()),i&2){let t=HE();ec(),mg(`(`,t.sources().length-t.hidden().size,`/`,t.sources().length,`)`)}}function Pe(i,e){if(i&1){let t=$E();Oi(0,`label`,38)(1,`input`,41),Jm(`change`,function(){let d=Ld(t).$implicit;return Od(HE(2).toggleSource(d.containerId))}),Nc(),Oi(2,`span`,42),fS(3),Nc()()}if(i&2){let t=e.$implicit,n=HE(2);ec(),Wm(`checked`,!n.hidden().has(t.containerId)),ec(2),pg(n.labelOf(t.containerId))}}function Ee(i,e){if(i&1&&(Oi(0,`p`,39),fS(1),Nc()),i&2){let t=HE(2);ec(),pg(t.t().nothingRunning)}}function Te(i,e){if(i&1){let t=$E();Oi(0,`button`,43),Jm(`click`,function(){Ld(t);return Od(HE(2).showAllSources())}),fS(1),Nc()}if(i&2){let t=HE(2);ec(),Ac(` `,t.t().showAll,` `)}}function Ie(i,e){if(i&1&&(Oi(0,`div`,19),kc(1,Pe,4,2,`label`,38,Ce,!1,Ee,2,1,`p`,39),SE(4,Te,2,1,`button`,40),Nc()),i&2){let t=HE();ec(),Tc(t.sources()),ec(3),kE(t.hidden().size>0?4:-1)}}function je(i,e){i&1&&(Oi(0,`p`,23),fS(1),Nc()),i&2&&(ec(),pg(e))}function Me(i,e){i&1&&Gm(0,`col`,26)}function De(i,e){if(i&1&&(Oi(0,`th`,30),fS(1),Nc()),i&2){let t=HE();ec(),pg(t.t().columns.time)}}function Ne(i,e){if(i&1&&(Oi(0,`td`,44),fS(1),Nc()),i&2){let t=HE().$implicit;ec(),pg(t.time)}}function Re(i,e){if(i&1&&(Oi(0,`tr`,32),SE(1,Ne,2,1,`td`,44),Oi(2,`td`,45),fS(3),Nc(),Oi(4,`td`,46),fS(5),Nc()()),i&2){let t=e.$implicit,n=HE();ec(),kE(n.showTimestamps()?1:-1),ec(),Wm(`title`,t.object),ec(),pg(t.object),ec(),nS(n.colorOf(t.level)),ec(),Ac(` `,t.text,` `)}}function Oe(i,e){if(i&1&&fS(0),i&2){let t=HE(2);Ac(` `,t.t().allFiltered(t.hiddenCount()),` `)}}function ze(i,e){if(i&1&&fS(0),i&2)Ac(` `,HE(2).t().empty,` `)}function Ve(i,e){if(i&1&&(Oi(0,`tr`)(1,`td`,47),SE(2,Oe,1,1)(3,ze,1,1),Nc()()),i&2){let t=HE();ec(),Br(`colspan`,t.showTimestamps()?3:2),ec(),kE(t.hiddenCount()>0?2:3)}}function Fe(i,e){if(i&1&&(Oi(0,`span`),fS(1),Nc()),i&2){let t=HE();ec(),pg(t.t().filteredOut(t.hiddenCount()))}}function Ae(i,e){if(i&1&&(Oi(0,`span`,34),fS(1),Nc()),i&2){let t=HE();ec(),pg(t.t().truncated)}}var be;var Ce;var me;f(()=>{Kr();ra();o();v();V();pe();M();sk();K();dk();$();Kr();be=[`viewport`];Ce=(i,e)=>e.containerId;me=class i$1{logs=C(D);containers=C(u);preferences=C(p);viewport=gj(`viewport`);stick=!0;t=Ot(()=>ok().logs);truncated=this.logs.truncated;search=wt(``);caseSensitive=this.preferences.flag(`logs.caseSensitive`);showTimestamps=this.preferences.flag(`logs.allTimestamps`,!0);filterOpen=wt(!1);hidden=this.preferences.names(`logs.hiddenSources`);matcher=Ot(()=>j(this.search(),this.caseSensitive()));sources=Ot(()=>[...this.logs.sources()].sort((e,t)=>this.labelOf(e.containerId).localeCompare(this.labelOf(t.containerId))));levels=wt(new Set);matching=Ot(()=>{let e=this.matcher(),t=this.hidden();return this.logs.lines().filter(n=>!t.has(n.source.containerId)&&e.test(n.text)).map(n=>this.toRow(n))});levelCounts=Ot(()=>U(this.matching().map(e=>e.level)));rows=Ot(()=>{let e=this.levels();return e.size===0?this.matching():this.matching().filter(t=>H(t.level,e))});problem=Ot(()=>this.matcher().problem);hiddenCount=Ot(()=>this.logs.lines().length-this.rows().length);trackId=e=>e.id;project=this.logs.project;projects=Ot(()=>[...new Set(this.containers.containers().filter(e=>e.state===`running`&&e.composeProject!==null).map(e=>e.composeProject))].sort((e,t)=>e.localeCompare(t)));volg=jc(void 0);router=C(fe);route=C(Q);constructor(){rf(()=>{let e=this.volg();e!==void 0&&Tg(()=>{this.logs.follow(e),i(this.router,this.route,`volg`)})}),this.logs.attach(),C(ve).onDestroy(()=>this.logs.detach()),Cj(()=>{let e=this.rows().length,t=this.viewport()?.nativeElement;t===void 0||e===0||!this.stick||(t.scrollTop=t.scrollHeight)}),this.containers.refresh()}onScroll(e){let t=e.target;this.stick=t.scrollTop+t.clientHeight>=t.scrollHeight-24}colorOf(e){return e===null?`text-ink-300`:G[e]}toggleSource(e){let t=new Set(this.hidden());t.delete(e)||t.add(e),this.hidden.set(t)}chooseProject(e){this.logs.follow(e===``?null:e)}showAllSources(){this.hidden.set(new Set)}clear(){this.logs.clear()}labelOf(e){let t=this.logs.sources().find(n=>n.containerId===e);return t===void 0?e.slice(0,12):this.nameOf(t)}nameOf(e){if(e.composeProject===null)return e.containerName;let t=e.composeService??e.containerName;return this.logs.project()===null?`${e.composeProject}/${t}`:t}toRow(e){return{id:e.id,time:e.timestamp===null?``:e.timestamp.slice(11,19),object:this.nameOf(e.source),text:e.text,level:B(e.text)}}static ɵfac=function(t){return new(t||i$1)};static ɵcmp=wc({type:i$1,selectors:[[`app-logs-page`]],viewQuery:function(t,n){t&1&&rg(n.viewport,be,5),t&2&&zE()},inputs:{volg:[1,`volg`]},decls:54,vars:40,consts:[[`viewport`,``],[1,`flex`,`h-full`,`flex-col`],[1,`shrink-0`,`px-6`,`pt-5`,`pb-3`],[1,`flex`,`flex-wrap`,`items-start`,`gap-4`],[1,`text-xl`,`font-semibold`,`tracking-tight`,`text-ink-100`],[1,`mt-1`,`max-w-prose`,`text-[13px]`,`text-ink-400`],[1,`mt-4`,`flex`,`flex-wrap`,`items-center`,`gap-2`],[`data-testid`,`logs-project`,1,`mx-focus`,`rounded-md`,`border`,`border-ink-700`,`bg-ink-850`,`px-2.5`,`py-1`,`text-[13px]`,`text-ink-100`],[1,`relative`],[1,`pointer-events-none`,`absolute`,`top-1/2`,`left-2.5`,`-translate-y-1/2`,`text-ink-500`],[`name`,`search`,3,`size`],[1,`sr-only`],[`type`,`search`,1,`mx-focus`,`w-96`,`rounded-md`,`border`,`border-ink-700`,`bg-ink-850`,`py-1`,`pr-3`,`pl-8`,`text-[13px]`,`text-ink-100`,`placeholder:text-ink-500`,3,`input`,`placeholder`,`value`],[`type`,`button`,1,`mx-btn`,`mx-focus`,3,`click`,`title`],[`name`,`code`,3,`size`],[3,`chosenChange`,`chosen`,`errors`,`warnings`],[`type`,`button`,`aria-haspopup`,`true`,1,`mx-btn`,`mx-focus`,3,`click`],[`name`,`containers`,3,`size`],[1,`text-[11px]`],[1,`absolute`,`left-0`,`z-50`,`mt-1.5`,`max-h-80`,`w-72`,`overflow-y-auto`,`rounded-md`,`border`,`border-ink-700`,`bg-panel`,`p-1`,`shadow-2xl`],[3,`onChange`,`label`,`on`],[`type`,`button`,1,`mx-btn`,`mx-focus`,`ml-auto`,3,`click`],[`name`,`eraser`,3,`size`],[1,`mt-3`,`rounded-md`,`border`,`border-warn/40`,`bg-warn/10`,`px-3`,`py-2`,`text-[13px]`,`text-warn`],[1,`min-h-0`,`flex-1`,`overflow-y-auto`,`px-6`,`pb-4`,3,`scroll`],[1,`w-full`,`table-fixed`,`border-collapse`,`text-[12px]`],[1,`w-20`],[1,`w-56`],[1,`sticky`,`top-0`,`bg-ink-900`],[1,`border-b`,`border-ink-700`,`text-left`,`text-ink-400`],[`scope`,`col`,1,`px-2`,`py-1.5`,`font-medium`],[1,`font-mono`],[1,`align-top`,`hover:bg-ink-850`],[1,`flex`,`shrink-0`,`items-center`,`gap-3`,`px-6`,`pb-4`,`text-[12px]`,`text-ink-500`],[1,`text-warn`],[`data-testid`,`logs-project`,1,`mx-focus`,`rounded-md`,`border`,`border-ink-700`,`bg-ink-850`,`px-2.5`,`py-1`,`text-[13px]`,`text-ink-100`,3,`change`],[`value`,``,3,`selected`],[3,`value`,`selected`],[1,`flex`,`cursor-pointer`,`items-center`,`gap-2`,`rounded`,`px-2`,`py-1.5`,`text-[12px]`,`text-ink-300`,`hover:bg-ink-850`],[1,`px-2`,`py-3`,`text-center`,`text-[12px]`,`text-ink-500`],[`type`,`button`,1,`mx-focus`,`mt-1`,`w-full`,`cursor-pointer`,`rounded`,`px-2`,`py-1.5`,`text-left`,`text-[12px]`,`text-accent`,`hover:bg-ink-850`],[`type`,`checkbox`,1,`mx-focus`,`accent-accent`,3,`change`,`checked`],[1,`min-w-0`,`flex-1`,`truncate`],[`type`,`button`,1,`mx-focus`,`mt-1`,`w-full`,`cursor-pointer`,`rounded`,`px-2`,`py-1.5`,`text-left`,`text-[12px]`,`text-accent`,`hover:bg-ink-850`,3,`click`],[1,`px-2`,`py-0.5`,`tabular-nums`,`text-ink-500`],[1,`truncate`,`px-2`,`py-0.5`,`text-accent`,3,`title`],[`data-testid`,`log-row`,1,`px-2`,`py-0.5`,`break-all`,`whitespace-pre-wrap`],[1,`px-2`,`py-10`,`text-center`,`font-sans`,`text-ink-400`]],template:function(t,n){if(t&1){let d=$E();Oi(0,`section`,1)(1,`div`,2)(2,`div`,3)(3,`div`)(4,`h1`,4),fS(5),Nc(),Oi(6,`p`,5),fS(7),Nc()()(),Oi(8,`div`,6),SE(9,Le,5,3,`select`,7),Oi(10,`label`,8)(11,`span`,9),Gm(12,`app-icon`,10),Nc(),Oi(13,`span`,11),fS(14),Nc(),Oi(15,`input`,12),Jm(`input`,function(f){return n.search.set(f.target.value)}),Nc()(),Oi(16,`button`,13),Jm(`click`,function(){return n.caseSensitive.set(!n.caseSensitive())}),Gm(17,`app-icon`,14),fS(18,` Aa `),Nc(),Oi(19,`app-level-filter`,15),vg(`chosenChange`,function(f){return Ld(d),vS(n.levels,f)||(n.levels=f),Od(f)}),Nc(),Oi(20,`div`,8)(21,`button`,16),Jm(`click`,function(){return n.filterOpen.set(!n.filterOpen())}),Gm(22,`app-icon`,17),fS(23),SE(24,ke,2,2,`span`,18),Nc(),SE(25,Ie,5,2,`div`,19),Nc(),Oi(26,`app-filter-switch`,20),vg(`onChange`,function(f){return Ld(d),vS(n.showTimestamps,f)||(n.showTimestamps=f),Od(f)}),Nc(),Oi(27,`button`,21),Jm(`click`,function(){return n.clear()}),Gm(28,`app-icon`,22),fS(29),Nc()(),SE(30,je,2,1,`p`,23),Nc(),Oi(31,`div`,24,0),Jm(`scroll`,function(f){return n.onScroll(f)}),Oi(33,`table`,25)(34,`colgroup`),SE(35,Me,1,0,`col`,26),Gm(36,`col`,27)(37,`col`),Nc(),Oi(38,`thead`,28)(39,`tr`,29),SE(40,De,2,1,`th`,30),Oi(41,`th`,30),fS(42),Nc(),Oi(43,`th`,30),fS(44),Nc()()(),Oi(45,`tbody`,31),kc(46,Re,6,6,`tr`,32,we,!0,Ve,4,2,`tr`),Nc()()(),Oi(49,`div`,33)(50,`span`),fS(51),Nc(),SE(52,Fe,2,1,`span`),SE(53,Ae,2,1,`span`,34),Nc()()}if(t&2){let d;ec(5),pg(n.t().title),ec(2),pg(n.t().intro),ec(2),kE(n.projects().length>0?9:-1),ec(3),Wm(`size`,14),ec(2),pg(n.t().searchLabel),ec(),Wm(`placeholder`,n.t().searchPlaceholder)(`value`,n.search()),ec(),ag(`border-accent`,n.caseSensitive())(`text-accent`,n.caseSensitive()),Wm(`title`,n.t().caseSensitive),Br(`aria-pressed`,n.caseSensitive())(`aria-label`,n.t().caseSensitive),ec(),Wm(`size`,14),ec(2),hg(`chosen`,n.levels),Wm(`errors`,n.levelCounts().error)(`warnings`,n.levelCounts().warn),ec(2),ag(`border-accent`,n.hidden().size>0)(`text-accent`,n.hidden().size>0),Br(`aria-expanded`,n.filterOpen()),ec(),Wm(`size`,14),ec(),Ac(` `,n.t().containers,` `),ec(),kE(n.hidden().size>0?24:-1),ec(),kE(n.filterOpen()?25:-1),ec(),Wm(`label`,n.t().timestamps),hg(`on`,n.showTimestamps),ec(2),Wm(`size`,14),ec(),Ac(` `,n.t().clear,` `),ec(),kE((d=n.problem())?30:-1,d),ec(5),kE(n.showTimestamps()?35:-1),ec(5),kE(n.showTimestamps()?40:-1),ec(2),pg(n.t().columns.object),ec(2),pg(n.t().columns.line),ec(2),Tc(n.rows()),ec(5),pg(n.t().lineCount(n.rows().length)),ec(),kE(n.hiddenCount()>0?52:-1),ec(),kE(n.truncated()?53:-1)}},dependencies:[My,P,T],encapsulation:2})}})();export{me as LogsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$n as sk,
|
|
1
|
+
import{$n as sk,B as Kr,Bn as ok,Rt as X,cn as f,f as C,gr as wt,jn as lk,on as eH,rt as Ot}from"./chunk-BdOOWVGY.js";import{n as y$1,t as o}from"./chunk-CSrKHPxR.js";import{n as u,t as f$1}from"./chunk-V7ftX_10.js";import{n as y$2,t as c}from"./chunk-iwVkNYYA.js";var y;var w=f(()=>{Kr();y$2();y$1();lk();sk();f$1();Kr();y=class i{engine=C(o);compose=C(c);toast=C(u);items=wt([]);busy=wt(!1);failure=wt(null);contexts=this.items.asReadonly();switching=this.busy.asReadonly();problem=this.failure.asReadonly();active=Ot(()=>this.items().find(e=>e.active)??null);async load(){try{this.items.set(await window.electron.contexts.list()),this.failure.set(null)}catch(e){this.failure.set(eH(e))}}async use(e){if(!(this.busy()||e===this.active()?.name)){this.busy.set(!0);try{let t=await window.electron.contexts.use(e);if(!t.ok){this.toast.error(t.problem,ok().dashboard.contexts.switchFailed(e));return}await Promise.all([this.load(),this.engine.refresh(),this.compose.loadStatus()])}catch(t){this.toast.error(eH(t),ok().dashboard.contexts.switchFailed(e))}finally{this.busy.set(!1)}}}static ɵfac=function(t){return new(t||i)};static ɵprov=X({token:i,factory:i.ɵfac,providedIn:`root`})}});export{y as n,w as t};
|