@duplicati/ngclient 0.0.202 → 0.0.204

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.
Files changed (47) hide show
  1. package/assets/sh.woff2 +0 -0
  2. package/chunk-2PCEVKZ4.js +1 -0
  3. package/{chunk-YDE34GTN.js → chunk-3QV6WLWV.js} +1 -1
  4. package/chunk-4I55TVYE.js +1 -0
  5. package/{chunk-2UQHKWPX.js → chunk-5FCREC3N.js} +1 -1
  6. package/chunk-5I4CGX7S.js +1 -0
  7. package/{chunk-X2K5SVKZ.js → chunk-77VFSONV.js} +1 -1
  8. package/{chunk-HETNGT36.js → chunk-7DCQVM6E.js} +1 -1
  9. package/chunk-B5GHHS3A.js +1 -0
  10. package/chunk-BFTGDQ4K.js +1 -0
  11. package/{chunk-UK6PJVXG.js → chunk-C25WT56X.js} +1 -1
  12. package/{chunk-WNG24347.js → chunk-C7N24TZM.js} +1 -1
  13. package/{chunk-VY3GBMSF.js → chunk-CB6NK5B2.js} +1 -1
  14. package/{chunk-F5SNXI4Q.js → chunk-EE27B3OV.js} +1 -1
  15. package/chunk-F6H5V7OU.js +1 -0
  16. package/{chunk-ZMSYEF6G.js → chunk-GRVTXORM.js} +1 -1
  17. package/{chunk-XIHS2E55.js → chunk-IFP4WWLK.js} +1 -1
  18. package/{chunk-XHIPGS6J.js → chunk-IGYSPFE7.js} +1 -1
  19. package/chunk-K34VOGDF.js +1 -0
  20. package/{chunk-6PRBIISZ.js → chunk-MO72YRC7.js} +1 -1
  21. package/{chunk-2K372PXE.js → chunk-NG3P67UR.js} +1 -1
  22. package/{chunk-47WLUZZW.js → chunk-OINQP25T.js} +1 -1
  23. package/{chunk-VDAFXR4A.js → chunk-PXULEZKF.js} +1 -1
  24. package/{chunk-AMTYI2HA.js → chunk-Q2UQ5J3C.js} +1 -1
  25. package/{chunk-BZCQDJKC.js → chunk-RJOLHDBR.js} +1 -1
  26. package/{chunk-KYDOMNGV.js → chunk-RNYUAYNZ.js} +1 -1
  27. package/{chunk-FRPWQ4C3.js → chunk-T4BXBCQI.js} +1 -1
  28. package/chunk-TN6HBIUN.js +11 -0
  29. package/{chunk-O64YAUSG.js → chunk-TX7JDBPD.js} +1 -1
  30. package/{chunk-PGHGTNMG.js → chunk-TXFTUL4R.js} +1 -1
  31. package/{chunk-5FG47DZE.js → chunk-UNZWYG3U.js} +1 -1
  32. package/chunk-W3YBKYPJ.js +1 -0
  33. package/{chunk-LODLMHG5.js → chunk-XLMLR5EV.js} +1 -1
  34. package/{chunk-BZECS72X.js → chunk-YN3R7XGF.js} +1 -1
  35. package/{chunk-F2LKEAZA.js → chunk-ZORSGUCK.js} +1 -1
  36. package/index.html +1 -1
  37. package/{main-CY7NIZIC.js → main-T6UJTPG4.js} +1 -1
  38. package/package.json +1 -1
  39. package/chunk-3TJKPVBA.js +0 -1
  40. package/chunk-K6G3RPPP.js +0 -11
  41. package/chunk-PE34XFKC.js +0 -1
  42. package/chunk-RTXGZ7K6.js +0 -1
  43. package/chunk-VHTM26J2.js +0 -1
  44. package/chunk-WITGABR3.js +0 -1
  45. package/chunk-X3BNEJHR.js +0 -1
  46. package/chunk-Y64QX4FF.js +0 -1
  47. package/chunk-Z35S3FHQ.js +0 -1
package/assets/sh.woff2 CHANGED
Binary file
@@ -0,0 +1 @@
1
+ import"./chunk-7CGTOI24.js";var o=[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-OINQP25T.js")},{path:"destination",loadComponent:()=>import("./chunk-F6H5V7OU.js")},{path:"source-data",loadComponent:()=>import("./chunk-RNYUAYNZ.js")},{path:"schedule",loadComponent:()=>import("./chunk-PXULEZKF.js")},{path:"options",loadComponent:()=>import("./chunk-ZORSGUCK.js")}];export{o as default};
@@ -1 +1 @@
1
- import{a as M}from"./chunk-F5SNXI4Q.js";import"./chunk-Q74O3CWJ.js";import"./chunk-3TJKPVBA.js";import"./chunk-QHBOEY2O.js";import"./chunk-NK5WD6WE.js";import"./chunk-B62TPRVG.js";import"./chunk-6Q6SSTBK.js";import"./chunk-SZUNW4JO.js";import"./chunk-TL4WOQKT.js";import"./chunk-7LTHH6OG.js";import"./chunk-HSHF5HR7.js";import"./chunk-5LBG6MOL.js";import"./chunk-D6IP567E.js";import"./chunk-VDSX2M4H.js";import"./chunk-ZU6T3TW3.js";import"./chunk-HUZXJWCG.js";import"./chunk-7TWUW4XJ.js";import{B as D,C as N,u as E}from"./chunk-UNMDSCAN.js";import"./chunk-CFNARBNK.js";import{e as m}from"./chunk-I27PVH6D.js";import"./chunk-5VE6P5U5.js";import"./chunk-PO3L6MKW.js";import"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.js";import{Ab as n,Bb as o,Pa as c,Pb as r,Qb as l,Rb as i,cb as T,xc as d,yb as s,zb as e}from"./chunk-26Z7TPJB.js";import"./chunk-7CGTOI24.js";var f=()=>["/backup/new"],O=()=>["/backup/import"],u=class p{static \u0275fac=function(t){return new(t||p)};static \u0275cmp=T({type:p,selectors:[["app-add-backup"]],decls:23,vars:4,consts:()=>{let a;a=$localize`Add a new backup`;let t;t=$localize`New backup`;let C;C=$localize`Configure a new backup. Choose your destination, source data and schedule.`;let A;A=$localize` Add a new backup ${"\uFFFD#13\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#13\uFFFD"}:CLOSE_TAG_SH_ICON:`;let g;g=$localize`Import from file`;let P;P=$localize`Import backup configuration from a file. During import, you can adjust the settings.`;let S;return S=$localize` Import from file ${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:upload-simple${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON:`,[a,t,C,A,g,P,S,[1,"backup-types"],[1,"type-a"],["src","assets/images/new-backup.png"],["shButton","",1,"raised","primary",3,"routerLink"]]},template:function(t,C){t&1&&(o(0,"app-status-bar"),e(1,"section")(2,"h2"),i(3,0),n(),e(4,"div",7)(5,"sh-card",8),o(6,"img",9),e(7,"h3"),i(8,1),n(),e(9,"p"),i(10,2),n(),e(11,"button",10),r(12,3),o(13,"sh-icon"),l(),n()(),e(14,"sh-card",8),o(15,"img",9),e(16,"h3"),i(17,4),n(),e(18,"p"),i(19,5),n(),e(20,"button",10),r(21,6),o(22,"sh-icon"),l(),n()()()()),t&2&&(c(11),s("routerLink",d(2,f)),c(9),s("routerLink",d(3,O)))},dependencies:[M,D,N,E,m],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;align-items:center;flex-direction:column;gap:2rem;padding:2rem 0}div.backup-types[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem;max-width:43.75rem}sh-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:1rem;padding-bottom:3rem}sh-card[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:18.75rem}sh-card[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;text-align:center;width:75%}"],changeDetection:0})};export{u as default};
1
+ import{a as M}from"./chunk-EE27B3OV.js";import"./chunk-Q74O3CWJ.js";import"./chunk-BFTGDQ4K.js";import"./chunk-QHBOEY2O.js";import"./chunk-NK5WD6WE.js";import"./chunk-B62TPRVG.js";import"./chunk-6Q6SSTBK.js";import"./chunk-SZUNW4JO.js";import"./chunk-TL4WOQKT.js";import"./chunk-7LTHH6OG.js";import"./chunk-HSHF5HR7.js";import"./chunk-5LBG6MOL.js";import"./chunk-D6IP567E.js";import"./chunk-VDSX2M4H.js";import"./chunk-ZU6T3TW3.js";import"./chunk-HUZXJWCG.js";import"./chunk-7TWUW4XJ.js";import{B as D,C as N,u as E}from"./chunk-UNMDSCAN.js";import"./chunk-CFNARBNK.js";import{e as m}from"./chunk-I27PVH6D.js";import"./chunk-5VE6P5U5.js";import"./chunk-PO3L6MKW.js";import"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.js";import{Ab as n,Bb as o,Pa as c,Pb as r,Qb as l,Rb as i,cb as T,xc as d,yb as s,zb as e}from"./chunk-26Z7TPJB.js";import"./chunk-7CGTOI24.js";var f=()=>["/backup/new"],O=()=>["/backup/import"],u=class p{static \u0275fac=function(t){return new(t||p)};static \u0275cmp=T({type:p,selectors:[["app-add-backup"]],decls:23,vars:4,consts:()=>{let a;a=$localize`Add a new backup`;let t;t=$localize`New backup`;let C;C=$localize`Configure a new backup. Choose your destination, source data and schedule.`;let A;A=$localize` Add a new backup ${"\uFFFD#13\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#13\uFFFD"}:CLOSE_TAG_SH_ICON:`;let g;g=$localize`Import from file`;let P;P=$localize`Import backup configuration from a file. During import, you can adjust the settings.`;let S;return S=$localize` Import from file ${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:upload-simple${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON:`,[a,t,C,A,g,P,S,[1,"backup-types"],[1,"type-a"],["src","assets/images/new-backup.png"],["shButton","",1,"raised","primary",3,"routerLink"]]},template:function(t,C){t&1&&(o(0,"app-status-bar"),e(1,"section")(2,"h2"),i(3,0),n(),e(4,"div",7)(5,"sh-card",8),o(6,"img",9),e(7,"h3"),i(8,1),n(),e(9,"p"),i(10,2),n(),e(11,"button",10),r(12,3),o(13,"sh-icon"),l(),n()(),e(14,"sh-card",8),o(15,"img",9),e(16,"h3"),i(17,4),n(),e(18,"p"),i(19,5),n(),e(20,"button",10),r(21,6),o(22,"sh-icon"),l(),n()()()()),t&2&&(c(11),s("routerLink",d(2,f)),c(9),s("routerLink",d(3,O)))},dependencies:[M,D,N,E,m],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;align-items:center;flex-direction:column;gap:2rem;padding:2rem 0}div.backup-types[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem;max-width:43.75rem}sh-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:1rem;padding-bottom:3rem}sh-card[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:18.75rem}sh-card[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;text-align:center;width:75%}"],changeDetection:0})};export{u as default};
@@ -0,0 +1 @@
1
+ import{a as Ze}from"./chunk-TXFTUL4R.js";import{h as Ke,m as Qe}from"./chunk-TN6HBIUN.js";import{d as re}from"./chunk-K34VOGDF.js";import{a as je}from"./chunk-SZUNW4JO.js";import{a as D}from"./chunk-HSHF5HR7.js";import{b as _e}from"./chunk-VDSX2M4H.js";import{b as qe}from"./chunk-ZU6T3TW3.js";import{a as K}from"./chunk-HUZXJWCG.js";import{B as j,H as ze,L as Je,M as Xe,P as Ue,V as Ye,W as He,b as we,c as B,e as V,f as W,i as Be,j as z,l as Ve,p as J,q as X,r as U,s as We,t as Y,u as H,z as se}from"./chunk-UNMDSCAN.js";import{c as q}from"./chunk-CFNARBNK.js";import{b as M,d as L}from"./chunk-I27PVH6D.js";import{fa as ne}from"./chunk-7AVOHYTE.js";import{$ as P,Ab as a,Bb as p,C as Q,Cc as le,Dc as ke,E as R,Ec as xe,Fb as b,Gb as v,H as Pe,Ib as A,K as Ie,L as ee,Mc as O,Pa as d,Pb as m,Qb as T,R as Me,Rb as f,Sb as De,Tb as ye,Vb as N,W as c,Xb as C,aa as I,cb as w,g as Ce,gc as $e,hb as Le,jc as G,la as _,lc as be,m as Ne,mc as ve,na as x,oc as te,pc as ie,qc as oe,sb as g,tb as F,v as ae,w as he,wc as Ae,xc as Ge,yb as E,z as Re,zb as r}from"./chunk-26Z7TPJB.js";function rt(s,t){s&1&&(r(0,"p"),f(1,3),a())}function at(s,t){s&1&&(r(0,"sh-form-field")(1,"label",11),f(2,4),a(),p(3,"input",12),a())}var et=new U,ot=()=>et.group({passphrase:et.control("")}),ce=class s{#e=c(q);#t=c(y);#n=c(L);#o=c(M);encryptionForm=this.#t.encryptionForm;creatingTemporaryBackup=_(!1);settings=_([]);hasEncryptedBackup=O(()=>{let t=this.#t.destinationTestSignal();return t==="testing"||typeof t=="string"?!0:t?.containsEncryptedBackupFiles??!0});showEncryptionField=_(!1);next(){let t=this.#t.destinationTargetUrl();if(!t)throw new Error("No target URL");this.creatingTemporaryBackup.set(!0);let e=this.encryptionForm.value?.passphrase??null,i=[];e?i.push({Name:"--passphrase",Value:e}):i.push({Name:"--no-encryption",Value:"true"}),this.settings().forEach(o=>{let n=o.Name?.trim();n&&n!=="--"&&(n.startsWith("--")||(n=`--${n}`),i.push({Name:n,Value:o.Value??""}))}),this.#e.postApiV1Backups({requestBody:{Backup:{TargetURL:t,Settings:i}},temporary:!0}).pipe(R(()=>this.creatingTemporaryBackup.set(!1))).subscribe({next:o=>{let n=o.ID;this.#n.navigate([`/restore-draft/${n}`])},error:o=>{console.error(o)}})}back(){this.#t.isFileRestore()?this.#n.navigate(["destination"],{relativeTo:this.#o.parent}):this.#t.exit()}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=w({type:s,selectors:[["app-restore-encryption"]],decls:14,vars:5,consts:()=>{let t;t=$localize`Advanced options`;let e;e=$localize`${"\uFFFD#10\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let i;i=$localize`${"\uFFFD#13\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#13\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let o;o=$localize`The backup does not contain encrypted files.`;let n;n=$localize`Enter backup passphrase if defined.`;let l;return l=$localize`Password`,[t,e,i,o,l,[3,"submit","formGroup"],["title",""],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],["for","password"],["type","password","id","password","placeholder",n,"formControlName","passphrase"]]},template:function(e,i){e&1&&(r(0,"form",5),N("submit",function(){return i.next()}),g(1,rt,2,0,"p"),g(2,at,4,0,"sh-form-field"),r(3,"sh-toggle-card"),b(4,6),f(5,0),v(),r(6,"app-options-list",7),oe("optionsChange",function(n){return ie(i.settings,n)||(i.settings=n),n}),a()(),r(7,"div",8)(8,"button",9),N("click",function(){return i.back()}),m(9,1),p(10,"sh-icon"),T(),a(),r(11,"button",10),m(12,2),p(13,"sh-icon"),T(),a()()()),e&2&&(E("formGroup",i.encryptionForm),d(),F(i.hasEncryptedBackup()?-1:1),d(),F(i.hasEncryptedBackup()||i.showEncryptionField()?2:-1),d(4),te("options",i.settings),E("hasFreeTextSettings",!0))},dependencies:[Y,z,B,V,W,X,J,ze,H,j,Ye,Ze],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var lt=()=>({standalone:!0});function _t(s,t){s&1&&p(0,"sh-progress-bar",8)}function ct(s,t){if(s&1&&(G(0),le(1,"bytes")),s&2){let e=C().$implicit;be(" (",ke(1,1,e.FileSizes),") ")}}function pt(s,t){s&1&&(r(0,"span",16),f(1,4),a())}function ut(s,t){if(s&1&&(r(0,"div",15),G(1),le(2,"date"),g(3,ct,2,3),g(4,pt,2,0,"span",16),a()),s&2){let e=t.$implicit;d(),ve(" ",e.Version,": ",xe(2,4,e.Time,"medium")," "),d(2),F(e.FileSizes?3:-1),d(),F(e.IsFullBackup===!1?4:-1)}}function dt(s,t){s&1&&p(0,"sh-progress-bar",8)}function mt(s,t){if(s&1){let e=A();r(0,"app-file-tree",17),N("hasExtendedData",function(o){P(e);let n=C(2);return I(n.extendedDataType.set(o))}),r(1,"label",18),f(2,5),a(),p(3,"input",19),a()}if(s&2){let e=C(2);E("rootPaths",e.rootPaths())("initialNodes",e.initialNodes())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)("loadExtendedData",!0)}}function Tt(s,t){if(s&1){let e=A();r(0,"sh-select",12),N("cleared",function(){P(e);let o=C();return I(o.abortLoading())}),r(1,"input",13),oe("ngModelChange",function(o){P(e);let n=C();return ie(n.selectOption,o)||(n.selectOption=o),I(o)}),a(),Le(2,ut,5,7,"ng-template"),a(),g(3,dt,1,0,"sh-progress-bar",8),g(4,mt,4,6,"app-file-tree",14)}if(s&2){let e=C();E("options",e.versionOptions())("isClearable",!1),d(),te("ngModel",e.selectOption),E("ngModelOptions",Ge(6,lt)),d(2),F(e.isRepairing()||e.versionOptionsLoading()||e.loadingRootPath()?3:-1),d(),F(e.showFileTree()?4:-1)}}var ue=new U,nt=()=>ue.group({filesToRestore:ue.control(""),passphrase:ue.control(null)}),de=class s{#e=c(q);#t=c(y);#n=c(qe);#o=c(K);#i=c(L);#s=c(M);#a=c(ne);#l=null;#_=null;#r=_([]);selectFilesForm=this.#t.selectFilesForm;selectFilesFormSignal=this.#t.selectFilesFormSignal;selectOption=this.#t.selectOption;backupId=this.#t.backupId;versionOptionsLoading=this.#t.versionOptionsLoading;versionOptions=this.#t.versionOptions;isFileRestore=this.#t.isFileRestore;extendedDataType=this.#t.extendedDataType;needsDatabaseRepair=O(()=>this.#t.backup()?.Backup?.IsTemporary??!0);showFileTree=_(!1);backupSettings=_(null);rootPaths=_([]);initialNodes=_([]);loadingRootPath=_(!1);isRepairing=O(()=>this.#r().length>0);loadedVersions=_({});loadingEffect=x(()=>{if(this.versionOptionsLoading())return;let e=this.versionOptions();if(e&&e?.length>0){let i=e[0].Version;this.selectOption.set(i.toString())}});backupSettingsEffect=x(()=>{let t=this.backupId(),e=this.selectOption(),i=this.isRepairing(),o=this.loadedVersions();if(!e||!t)return;let l=this.versionOptions()?.find(Z=>Z.Version===parseInt(e))?.Time??null;if(!l)return;let u=`${t}+${l}`,h=o[u];if(this.needsDatabaseRepair()&&(!h||i))return;let $={id:t+"",time:l};this.backupSettings.set($),this.getRootPath($)});repairEffect=x(()=>{if(!this.needsDatabaseRepair())return;let t=this.selectOption(),e=this.versionOptions();if(t){let i=e.find(l=>l.Version===parseInt(t));if(i===void 0)return;let o=this.backupId(),n=`${o}+${i.Time}`;if(this.#_===n||(this.#_=n,this.#r().includes(n)))return;this.#r.update(l=>[...l,n]),this.#e.postApiV1BackupByIdRepairupdate({id:o,requestBody:{only_paths:!0,time:i.Time}}).pipe(ee(this.abortLoading$),R(()=>{this.#_=null})).subscribe(l=>{let u=l.ID;this.#n.waitForTaskToComplete(u).pipe(Q(1)).subscribe(()=>{this.#r.update(h=>h.filter($=>$!==n)),this.loadedVersions.update(h=>(h[n]=!0,h))})})}});getRootPath(t){let e={id:t.id+"",time:t.time,prefixOnly:!0,folderContents:!1},i=t.id+"";this.isRepairing()||this.#l===i||(this.#l=i,this.loadingRootPath.set(!0),this.showFileTree.set(!1),this.#o.hasV2ListOperations()?this.#e.postApiV2BackupListFolder({requestBody:{BackupId:t.id,Time:t.time,Paths:null,PageSize:0,Page:0}}).pipe(ee(this.abortLoading$),R(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1),this.#l=null})).subscribe({next:o=>{let n=(o.Data??[]).map(l=>l.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}):this.#e.getApiV1BackupByIdFiles(e).pipe(ee(this.abortLoading$),R(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1)})).subscribe({next:o=>{let n=o.Files.map(l=>l.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}))}abortLoading$=new Ce;abortLoading(){this.showFileTree.set(!1),this.loadingRootPath.set(!1),this.abortLoading$.next(!0)}displayFn(){let t=this.versionOptions();return e=>{if(!e)return"";let i=t?.find(o=>typeof o.Version=="number"&&o.Version.toString()===e);return i?`${i.Version}: ${this.#a.transform(i.Time,"medium")}`:""}}next(){this.#i.navigate(["options"],{relativeTo:this.#s.parent})}back(){this.#t.isFileRestore()?this.#i.navigate(["encryption"],{relativeTo:this.#s.parent}):this.#t.exit()}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=w({type:s,selectors:[["app-select-files"]],features:[Ae([ne])],decls:13,vars:3,consts:()=>{let t;t=$localize`Select files`;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let o;o=$localize`Select an option...`;let n;n=$localize`(partial)`;let l;return l=$localize`Path`,[["formRef",""],t,e,i,n,l,[3,"submit","formGroup"],[1,"title-30"],[1,"indeterminate","primary"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],["value","Version",3,"cleared","options","isClearable"],["type","text","placeholder",o,3,"ngModelChange","ngModel","ngModelOptions"],[3,"rootPaths","initialNodes","backupSettings","multiSelect","showFiles","loadExtendedData"],[1,"custom-option"],[1,"partial"],[3,"hasExtendedData","rootPaths","initialNodes","backupSettings","multiSelect","showFiles","loadExtendedData"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]]},template:function(e,i){if(e&1){let o=A();r(0,"form",6,0),N("submit",function(){return P(o),I(i.next())}),r(2,"h3",7),f(3,1),a(),g(4,_t,1,0,"sh-progress-bar",8)(5,Tt,5,7),r(6,"div",9)(7,"button",10),N("click",function(){return P(o),I(i.back())}),m(8,2),p(9,"sh-icon"),T(),a(),r(10,"button",11),m(11,3),p(12,"sh-icon"),T(),a()()()}e&2&&(E("formGroup",i.selectFilesForm),d(4),F(i.versionOptionsLoading()?4:5),d(5),De(i.isFileRestore()?"Back":"Exit"),ye(8))},dependencies:[We,z,B,V,W,Be,Y,X,J,re,j,H,Ue,Je,ne,je],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.partial[_ngcontent-%COMP%]{color:var(--base-9);font-style:italic}"],changeDetection:0})};var y=class s{#e=c(L);#t=c(M);#n=c(K);#o=c(se);#i=c(q);backupId=_(null);backup=_(null);destinationTargetUrl=_(null);destinationTestSignal=_(null);selectFilesForm=nt();optionsForm=st();encryptionForm=ot();optionsFormSignal=_e(this.optionsForm.valueChanges);selectFilesFormSignal=_e(this.selectFilesForm.valueChanges);selectOption=_(null);versionOptionsLoading=_(!1);versionOptions=_([]);isSubmitting=_(!1);isFileRestore=_(!1);isFullWidthPage=_(!1);extendedDataType=_(null);alternateRestorePath=_(null);init(t,e=!1){this.backupId.set(t),this.isFileRestore.set(e),this.alternateRestorePath.set(null),this.extendedDataType.set(null),e&&this.#e.navigate(["/restore-from-files/destination"]),e||this.getBackup()}updateTargetUrl(t){this.destinationTargetUrl.set(t)}setAlternateRestorePath(t){this.alternateRestorePath.set(t)}submit(){this.isSubmitting.set(!0);let t=this.backupId();this.backup()?.Backup?.IsTemporary??!1?this.#i.postApiV1BackupByIdCopytotemp({id:this.backupId()??""}).subscribe({next:i=>{this.#s(i.ID??"")},error:i=>this.showErrorDialog($localize`An error occurred while copying the backup to a temporary location: ${i.message}`)}):this.#s(t??"")}showErrorDialog(t){this.#o.open(D,{data:{title:$localize`Error occured`,message:t,confirmText:$localize`OK`,cancelText:void 0},closed:e=>{}})}#s(t){let e=this.optionsForm.value,i=this.selectFilesForm.value,o=this.selectOption(),n=this.versionOptions()?.find(l=>l.Version===(o&&parseInt(o)));this.#i.postApiV1BackupByIdRestore({id:t??"",requestBody:{paths:i.filesToRestore?.split("\0").map(l=>l.endsWith("/")||l.endsWith("\\")?`${l}*`:l)??[],passphrase:i.passphrase??null,time:n?.Time,restore_path:this.alternateRestorePath()??e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!e.includeMetadata}}).pipe(R(()=>this.isSubmitting.set(!1))).subscribe({next:l=>{this.#e.navigate([`./${l.ID}`,"progress"],{relativeTo:this.#t})},error:l=>{console.error("restore error",l)}})}exit(){this.#o.open(D,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:t=>{t&&(this.#a(),this.#e.navigate(["/"]))}})}getVersionOptions(){this.versionOptions()}loadFilesetsWithRetryv2(t,e=2){return this.#i.postApiV2BackupListFilesets({requestBody:{BackupId:t}}).pipe(Re(i=>{let o=i?.error?.body?.StatusCode??i?.error?.requestBody?.StatusCode;return o==="EncryptedStorageNoPassphrase"||o==="FolderMissing"||o==="EmptyRemoteFolder"||e===0?Ne(()=>i):he(1e3).pipe(Ie(()=>this.loadFilesetsWithRetryv2(t,e-1)))}))}getBackup(){let t=this.backupId();this.versionOptionsLoading.set(!0),this.#n.hasV2ListOperations()?ae([this.#i.getApiV1BackupById({id:t}),this.loadFilesetsWithRetryv2(t)]).pipe(Q(1),R(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([e,i])=>{if(i.Error)throw new Error(i.Error);if(!(e.Backup?.IsTemporary??!0)&&e?.Backup?.DBPathExists===!1){this.#o.open(D,{data:{title:$localize`Missing Local Database`,message:$localize`The local database for this backup is missing. Please repair or recreate the local database before restoring.`,confirmText:$localize`OK`,cancelText:void 0},closed:n=>{this.#e.navigate(["/backup",t,"database"])}});return}this.versionOptions.set((i.Data??[]).map(n=>({Version:n.Version??-1,IsFullBackup:n.IsFullBackup??void 0,Time:n.Time??"<missing>",FileCount:n.FileCount??void 0,FileSizes:n.FileSizes??void 0}))),this.backup.set(e)},error:e=>{let i=e?.error?.body?.StatusCode??e?.error?.requestBody?.StatusCode,o=i==="EncryptedStorageNoPassphrase",n=i==="FolderMissing",l=i==="EmptyRemoteFolder",u=$localize`An error occurred while loading the backup filesets: ${e.message}`;o&&(u=$localize`The remote storage is encrypted. Please enter the passphrase to access the backup.`),n&&(u=$localize`The backup storage folder was not found.`),l&&(u=$localize`The backup storage folder does not contain any filesets.`),this.#o.open(D,{data:{title:$localize`Failed to load backup filesets`,message:u,confirmText:$localize`OK`,cancelText:void 0},closed:h=>{this.#e.navigate([o?"/restore-from-files/encryption":"/restore-from-files/destination"])}})}}):ae([this.#i.getApiV1BackupById({id:t}),this.#i.getApiV1BackupByIdFilesets({id:t}).pipe(Pe(3))]).pipe(Q(1),R(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([e,i])=>{this.versionOptions.set(i.map(o=>({Version:o.Version??-1,IsFullBackup:(o.IsFullBackup??1)==1,Time:o.Time??"<missing>",FileCount:o.FileCount??void 0,FileSizes:o.FileSizes??void 0}))),this.backup.set(e)}})}#a(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||s)};static \u0275prov=Me({token:s,factory:s.\u0275fac,providedIn:"root"})};function St(s,t){if(s&1&&(r(0,"app-file-tree",29)(1,"label",31),G(2,"Path"),a(),p(3,"input",32),a()),s&2){let e,i=C(2);E("disabled",((e=i.optionsFormSignal())==null?null:e.restoreFrom)!=="pickLocation")("enableCreateFolder",!0)}}function Et(s,t){if(s&1&&(r(0,"app-file-tree",30)(1,"label",31),G(2,"Path"),a(),p(3,"input",32),a()),s&2){let e=C(2);E("office365Mode",!0)("backupId",e.backupId())("sourcePrefix",e.office365SourcePrefix())("destinationUrl",e.office365destinationUrl())}}function gt(s,t){if(s&1){let e=A();r(0,"sh-radio",25),m(1,5),p(2,"input",26),T(),a(),r(3,"sh-radio",25),m(4,6),r(5,"input",27),N("click",function(){P(e);let o=C();return I(o.chooseOfficeTenant())}),a(),T(),a(),r(6,"sh-radio",25),m(7,7),p(8,"input",28),T(),a(),g(9,St,4,2,"app-file-tree",29),g(10,Et,4,4,"app-file-tree",30)}if(s&2){let e,i=C();d(9),F(((e=i.optionsFormSignal())==null?null:e.restoreFrom)==="pickLocation"?9:-1),d(),F(i.showOffice365RestoreTree()?10:-1)}}function Ft(s,t){if(s&1&&(r(0,"sh-radio",25),m(1,8),p(2,"input",33),T(),a(),r(3,"sh-radio",25),m(4,9),p(5,"input",28),T(),a(),r(6,"app-file-tree",29)(7,"label",31),G(8,"Path"),a(),p(9,"input",32),a()),s&2){let e,i=C();d(6),E("disabled",((e=i.optionsFormSignal())==null?null:e.restoreFrom)!=="pickLocation")("enableCreateFolder",!0)}}function ft(s,t){s&1&&(r(0,"app-toggle-card",20),b(1,21),f(2,10),v(),r(3,"sh-toggle",25),m(4,11),p(5,"input",34),T(),a()()),s&2&&E("disallowToggle",!0)}function Ot(s,t){s&1&&(r(0,"app-toggle-card",20),b(1,21),f(2,12),v(),r(3,"sh-radio",25),m(4,13),p(5,"input",35),T(),a(),r(6,"sh-radio",25),m(7,14),p(8,"input",36),T(),a()(),r(9,"app-toggle-card"),b(10,21),f(11,15),v(),r(12,"sh-toggle",37),m(13,16),p(14,"input",38),T(),a(),r(15,"sh-toggle",37),m(16,17),p(17,"input",39),T(),a()()),s&2&&E("disallowToggle",!0)}var k=new U,st=()=>k.group({restoreFrom:k.control("original"),restoreFromPath:k.control(""),handleExisting:k.control("saveTimestamp"),permissions:k.control(!1),includeMetadata:k.control(!0),officeIgnoreExisting:k.control(!1)}),me=class s{#e=c(y);#t=c(L);#n=c(M);#o=c(K);#i=c(se);optionsForm=this.#e.optionsForm;optionsFormSignal=this.#e.optionsFormSignal;isSubmitting=this.#e.isSubmitting;extendedData=this.#e.extendedDataType;office365CustomTargetUrl=_(null);backupId=O(()=>this.#e.backup()?.Backup?.ID??null);hasOffice365Data=O(()=>this.extendedData()==="o365");office365SourceEntry=O(()=>this.#e.backup()?.Backup?.Sources?.filter(t=>t.startsWith("@")&&t.includes("|office365"))[0]??null);office365SourceUrl=O(()=>this.office365SourceEntry()?.split("|")[1]??null);office365SourcePrefix=O(()=>this.office365SourceEntry()?.split("|")[0]??null);office365destinationUrl=O(()=>{let t=this.optionsFormSignal()?.restoreFrom,e=this.hasOffice365Data();return t==="same-o365"&&e?this.office365SourceUrl():t==="other-o365"&&e?this.office365CustomTargetUrl():null});showOffice365RestoreTree=O(()=>!!(this.optionsFormSignal()?.restoreFrom==="same-o365"&&this.office365destinationUrl()&&this.backupId()||this.optionsFormSignal()?.restoreFrom==="other-o365"&&this.office365destinationUrl()));isOffice365Restore=O(()=>{let t=this.optionsFormSignal()?.restoreFrom;return t==="same-o365"||t==="other-o365"});chooseOfficeTenant(){return this.#i.open(Qe,{maxWidth:"700px",maxHeight:"80vh",width:"100%",closeOnOutsideClick:!1,data:{targetUrlModel:this.office365CustomTargetUrl()||this.office365SourceUrl()||"office365://",moduleType:"RestoreDestinationProvider",askToCreate:!0,expectedResult:"any",suppressErrorDialogs:!0,backupId:this.backupId(),sourcePrefix:this.office365SourcePrefix()}}).closed.subscribe(e=>{e&&(this.office365CustomTargetUrl.set(e),this.optionsForm.controls.restoreFrom.setValue("other-o365"))}),!1}#s=x(()=>{let t=this.optionsFormSignal()?.restoreFrom;this.hasOffice365Data()&&(t==="original"||t===void 0)&&(this.optionsForm.controls.restoreFrom.setValue("pickLocation"),this.optionsForm.controls.handleExisting.setValue("overwrite")),!this.hasOffice365Data()&&(t==="same-o365"||t==="other-o365")&&(this.optionsForm.controls.restoreFrom.setValue("original"),this.optionsForm.controls.handleExisting.setValue("saveTimestamp"))});goBack(){this.#t.navigate(["select-files"],{relativeTo:this.#n.parent})}submit(){let t=this.#e.selectFilesFormSignal()?.filesToRestore??[];if(t.length>0&&this.optionsFormSignal()?.restoreFrom=="original"&&(t[0].includes("/")?"/":"\\")!==this.#o.systemInfo()?.DirectorySeparator){this.#i.open(D,{data:{title:$localize`Confirm target folder`,message:$localize`This backup was created on another operating system. Restoring files without specifying a destination folder can cause files to be restored in unexpected places. Are you sure you want to continue without choosing a destination folder?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:o=>{o&&this.#e.submit()}});return}if(this.optionsFormSignal()?.restoreFrom==="same-o365"||this.optionsFormSignal()?.restoreFrom==="other-o365"){let i=this.optionsFormSignal()?.restoreFromPath;if(i&&i.startsWith("/")&&(i=i.substring(1)),!i||i.trim()===""){this.#i.open(D,{data:{title:$localize`No path specified`,message:$localize`Please choose a path to restore to in the Office 365 tenant.`,confirmText:$localize`OK`,cancelText:void 0}});return}let o=this.optionsFormSignal()?.officeIgnoreExisting,n=this.office365destinationUrl()?.substring(this.office365destinationUrl().indexOf("?")),l=`@office365://${i}${n}&office365-ignore-existing=${o?"true":"false"}`;this.#e.setAlternateRestorePath(l),this.optionsForm.controls.includeMetadata.setValue(!0),this.optionsForm.controls.permissions.setValue(!0)}else this.#e.setAlternateRestorePath(null);this.#e.submit()}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=w({type:s,selectors:[["app-advanced-options-settings"]],decls:18,vars:6,consts:()=>{let t;t=$localize`Restore options`;let e;e=$localize`Where do you want to restore files to?`;let i;i=$localize`${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `;let n;n=$localize` Same Office 365 Tenant ${"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"}:TAG_INPUT:`;let l;l=$localize` Different Office 365 Tenant ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let u;u=$localize` Local file system ${"\uFFFD#8\uFFFD\uFFFD/#8\uFFFD"}:TAG_INPUT:`;let h;h=$localize` Original location ${"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"}:TAG_INPUT:`;let $;$=$localize` Pick location ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let Z;Z=$localize`Restore settings`;let Te;Te=$localize` Ignore existing resources in the destination ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let Se;Se=$localize`How do you want to handle existing files?`;let Ee;Ee=$localize` Overwrite ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let ge;ge=$localize` Save different versions with timestamp in file name ${"\uFFFD#8\uFFFD\uFFFD/#8\uFFFD"}:TAG_INPUT:`;let Fe;Fe=$localize`Metadata settings`;let fe;fe=$localize` Restore file metadata ${"\uFFFD#14\uFFFD\uFFFD/#14\uFFFD"}:TAG_INPUT:`;let Oe;return Oe=$localize` Restore read/write permissions ${"\uFFFD#17\uFFFD\uFFFD/#17\uFFFD"}:TAG_INPUT:`,[["formRef",""],t,e,i,o,n,l,u,h,$,Z,Te,Se,Ee,ge,Fe,fe,Oe,[3,"submit","formGroup"],[1,"title-30"],[3,"disallowToggle"],["title",""],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],[1,"raised","primary"],["type","radio","name","restoreFrom","value","same-o365","formControlName","restoreFrom"],["type","radio","name","restoreFrom","value","other-o365","formControlName","restoreFrom",3,"click"],["type","radio","name","restoreFrom","value","pickLocation","formControlName","restoreFrom"],[3,"disabled","enableCreateFolder"],[3,"office365Mode","backupId","sourcePrefix","destinationUrl"],["for","path"],["type","text","id","path","formControlName","restoreFromPath"],["type","radio","name","restoreFrom","value","original","formControlName","restoreFrom"],["type","checkbox","formControlName","officeIgnoreExisting"],["type","radio","name","handleExisting","value","overwrite","formControlName","handleExisting"],["type","radio","name","handleExisting","value","saveTimestamp","formControlName","handleExisting"],[1,"primary","raised"],["type","checkbox","formControlName","includeMetadata"],["type","checkbox","formControlName","permissions"]]},template:function(e,i){if(e&1){let o=A();r(0,"form",18,0),N("submit",function(){return P(o),I(i.submit())}),r(2,"h3",19),f(3,1),a(),r(4,"app-toggle-card",20),b(5,21),f(6,2),v(),g(7,gt,11,2)(8,Ft,10,2),a(),g(9,ft,6,1,"app-toggle-card",20)(10,Ot,18,1),r(11,"div",22)(12,"button",23),N("click",function(){return P(o),I(i.goBack())}),m(13,3),p(14,"sh-icon"),T(),a(),r(15,"button",24),m(16,4),p(17,"sh-icon"),T(),a()()()}e&2&&(E("formGroup",i.optionsForm),d(4),E("disallowToggle",!0),d(3),F(i.hasOffice365Data()?7:8),d(2),F(i.isOffice365Restore()?9:10),d(6),$e("loader",i.isSubmitting()))},dependencies:[Y,z,B,we,Ve,V,W,X,J,Ke,re,He,Xe,j,H],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};export{st as a,me as b,ot as c,ce as d,nt as e,de as f,y as g};
@@ -1 +1 @@
1
- import{e as a,f as b}from"./chunk-Y64QX4FF.js";import"./chunk-PGHGTNMG.js";import"./chunk-K6G3RPPP.js";import"./chunk-Z35S3FHQ.js";import"./chunk-IMHM7ISI.js";import"./chunk-6LAXPU22.js";import"./chunk-6Q6SSTBK.js";import"./chunk-SZUNW4JO.js";import"./chunk-TL4WOQKT.js";import"./chunk-7LTHH6OG.js";import"./chunk-HSHF5HR7.js";import"./chunk-D6IP567E.js";import"./chunk-VDSX2M4H.js";import"./chunk-ZU6T3TW3.js";import"./chunk-HUZXJWCG.js";import"./chunk-7TWUW4XJ.js";import"./chunk-UNMDSCAN.js";import"./chunk-CFNARBNK.js";import"./chunk-I27PVH6D.js";import"./chunk-5VE6P5U5.js";import"./chunk-PO3L6MKW.js";import"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.js";import"./chunk-26Z7TPJB.js";import"./chunk-7CGTOI24.js";export{a as createRestoreSelectFilesForm,b as default};
1
+ import{e as a,f as b}from"./chunk-4I55TVYE.js";import"./chunk-TXFTUL4R.js";import"./chunk-TN6HBIUN.js";import"./chunk-K34VOGDF.js";import"./chunk-IMHM7ISI.js";import"./chunk-6LAXPU22.js";import"./chunk-6Q6SSTBK.js";import"./chunk-SZUNW4JO.js";import"./chunk-TL4WOQKT.js";import"./chunk-7LTHH6OG.js";import"./chunk-HSHF5HR7.js";import"./chunk-D6IP567E.js";import"./chunk-VDSX2M4H.js";import"./chunk-ZU6T3TW3.js";import"./chunk-HUZXJWCG.js";import"./chunk-7TWUW4XJ.js";import"./chunk-UNMDSCAN.js";import"./chunk-CFNARBNK.js";import"./chunk-I27PVH6D.js";import"./chunk-5VE6P5U5.js";import"./chunk-PO3L6MKW.js";import"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.js";import"./chunk-26Z7TPJB.js";import"./chunk-7CGTOI24.js";export{a as createRestoreSelectFilesForm,b as default};
@@ -0,0 +1 @@
1
+ import{g as pe}from"./chunk-4I55TVYE.js";import"./chunk-TXFTUL4R.js";import{i as de,j as Se,k as ue,l as Ee,p as Ce}from"./chunk-TN6HBIUN.js";import"./chunk-K34VOGDF.js";import{b as Te,c as ge}from"./chunk-IMHM7ISI.js";import"./chunk-6LAXPU22.js";import"./chunk-6Q6SSTBK.js";import"./chunk-SZUNW4JO.js";import"./chunk-TL4WOQKT.js";import"./chunk-7LTHH6OG.js";import{a as M}from"./chunk-HSHF5HR7.js";import"./chunk-D6IP567E.js";import"./chunk-VDSX2M4H.js";import"./chunk-ZU6T3TW3.js";import"./chunk-HUZXJWCG.js";import"./chunk-7TWUW4XJ.js";import{B as le,H as _e,K as ce,c as Q,e as Y,f as Z,g as ee,i as te,j as ne,s as ie,u as oe,w as re,y as ae,z as se}from"./chunk-UNMDSCAN.js";import"./chunk-CFNARBNK.js";import{b as j,d as q}from"./chunk-I27PVH6D.js";import"./chunk-5VE6P5U5.js";import"./chunk-PO3L6MKW.js";import"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.js";import{$ as l,Ab as a,Bb as O,Fb as V,Gb as W,Ib as u,Mc as $,Pa as T,Pb as E,Qb as C,Rb as I,Sc as w,Ub as z,Vb as d,W as m,Xb as c,aa as _,cb as B,cc as J,da as v,dc as X,jc as P,la as N,oc as f,pc as R,qc as h,rc as A,sb as p,sc as y,tb as F,tc as L,wc as H,xc as K,yb as D,zb as r}from"./chunk-26Z7TPJB.js";import"./chunk-7CGTOI24.js";var Fe=["formRef"],Oe=["testUrl"],me=()=>({maxWidth:"700px",width:"100%"});function Re(o,i){if(o&1){let e=u();r(0,"button",24),d("click",function(){l(e);let t=c();return _(t.openTargetUrlDialog())}),E(1,5),O(2,"sh-icon"),C(),a()}}function Ne(o,i){if(o&1){let e=u();r(0,"button",24),d("click",function(){l(e);let t=c(2);return _(t.copyTargetUrl())}),E(1,7),O(2,"sh-icon"),C(),a()}}function De(o,i){if(o&1){let e=u();r(0,"sh-menu")(1,"button",15)(2,"sh-icon"),P(3,"dots-three-vertical"),a()(),V(4,25),r(5,"button",24),d("click",function(){l(e);let t=c();return _(t.openTargetUrlDialog())}),E(6,6),O(7,"sh-icon"),C(),a(),p(8,Ne,3,0,"button",15),W(),a()}if(o&2){c();let e=L(0);T(8),F(e?8:-1)}}function Ie(o,i){if(o&1){let e=u();r(0,"app-destination-list-item",17)(1,"button",20),d("click",function(){l(e);let t=c();return _(t.removeDestination())}),I(2,8),a()()}if(o&2){c();let e=L(12);D("destination",e)}}function fe(o,i){if(o&1){let e=u();r(0,"app-destination-list",26),d("setDestination",function(t){l(e);let s=c();return _(s.setDestination(t))}),a()}}function he(o,i){if(o&1){let e=u();r(0,"app-single-destination",27),h("targetUrlChange",function(t){l(e);let s=c();return R(s.targetUrlModel,t)||(s.targetUrlModel=t),_(t)}),a()}if(o&2){let e=c();f("targetUrl",e.targetUrlModel)}}function Me(o,i){o&1&&(E(0,4,1),O(1,"sh-icon",22),C())}function Pe(o,i){o&1&&(E(0,4,2),O(1,"sh-icon"),C())}function Ae(o,i){if(o&1){let e=u();r(0,"sh-dialog",28),h("isOpenChange",function(t){l(e);let s=c();return R(s.targetUrlDialogOpen,t)||(s.targetUrlDialogOpen=t),_(t)}),r(1,"header",29)(2,"div",30)(3,"h2"),I(4,9),a(),r(5,"sh-alert",31),I(6,10),a()()(),r(7,"div",32)(8,"sh-form-field")(9,"textarea",33),h("ngModelChange",function(t){l(e);let s=c();return R(s.targetUrlCtrl,t)||(s.targetUrlCtrl=t),_(t)}),a()()(),r(10,"footer",34)(11,"button",20),d("click",function(){l(e);let t=c();return _(t.closeTargetUrlDialog(!1))}),P(12,"Cancel"),a(),r(13,"button",35),d("click",function(){l(e);let t=c();return _(t.closeTargetUrlDialog(!0))}),E(14,11),O(15,"sh-icon"),C(),a()()()}if(o&2){let e=c();f("isOpen",e.targetUrlDialogOpen),D("options",K(3,me)),T(9),f("ngModel",e.targetUrlCtrl)}}var x=class o{#i=m(q);#o=m(j);#n=m(se);injector=m(v);#e=m(pe);formRef=w.required("formRef");testUrlComponent=w.required("testUrl");testSignal=this.#e.destinationTestSignal;targetUrlModel=this.#e.destinationTargetUrl;targetUrlCtrl=N(null);targetUrlInitial=N(null);targetUrlDialogOpen=N(!1);toggleNewDestination=N(!0);selectedDestinationType=$(()=>{let i=this.#e.destinationTargetUrl();return i?Te(i):null});selectedDestinationTypeOption=$(()=>{let i=this.selectedDestinationType();return i?{key:i.customKey??i.key,customKey:i.customKey??null,displayName:i.displayName,description:i.description,icon:i.icon}:null});copyTargetUrl(){navigator.clipboard.writeText(this.#e.destinationTargetUrl()??"")}openTargetUrlDialog(){let i=this.#e.destinationTargetUrl();this.targetUrlCtrl.set(i),this.targetUrlInitial.set(i),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(i=!1){this.targetUrlDialogOpen.set(!1);let e=this.targetUrlCtrl(),n=this.targetUrlInitial();!i||e===n||!e||this.#e.updateTargetUrl(e)}setDestination(i){let e=ge(i??"");if(e){if(e.mapper.default){let n=e.mapper.default("");this.#e.updateTargetUrl(n);return}this.#e.updateTargetUrl(`${i}://`)}}removeDestination(){this.#e.updateTargetUrl(null)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let i=this.testSignal();if(i===null){this.#n.open(M,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:n=>{n?this.testUrlComponent()?.testDestination(!1)?.then(t=>{t.action==="success"&&t.containsBackup?this.#t():this.#n.open(M,{data:{title:$localize`Test did not succeed`,message:t.errorMessage??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#t()}});return}let e=typeof i=="string"?null:i;if(e?.action!=="success"||!e.containsBackup){this.#n.open(M,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Edit destination`,cancelText:$localize`Yes, continue`},closed:n=>{n||this.#t()}});return}this.#t()}#t(){this.#i.navigate(["encryption"],{relativeTo:this.#o.parent})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=B({type:o,selectors:[["app-restore-destination"]],viewQuery:function(e,n){e&1&&J(n.formRef,Fe,5)(n.testUrlComponent,Oe,5),e&2&&X(2)},features:[H([Ce])],decls:25,vars:17,consts:()=>{let i;i=$localize`Backup destination`;let e;e=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let n;n=$localize`${"\uFFFD*22:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*22:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*23:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*23:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,n=z(n);let t;t=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Set target URL `;let s;s=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: Edit target URL `;let g;g=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:copy${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Copy URL to clipboard `;let U;U=$localize`Change`;let b;b=$localize`Edit target URL`;let G;G=$localize`Be careful, this will overwrite everything you have in your destination.`;let k;return k=$localize` Override target URL ${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],["testUrl",""],i,e,n,t,s,g,U,b,G,k,[3,"submit"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small"],[3,"targetUrlChange","testSignalChange","targetUrl","testSignal","backupId","sourcePrefix","suppressErrorDialogs","askToCreate","testExpectation","moduleType"],[1,"current-destination",3,"destination"],[3,"targetUrl"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click"],["menu",""],[3,"setDestination"],[3,"targetUrlChange","targetUrl"],[3,"isOpenChange","isOpen","options"],["header",""],[1,"target-dialog-header"],[1,"warn"],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(e,n){if(e&1){let t=u();A(0),r(1,"form",12,0),d("submit",function(){return l(t),_(n.next())}),r(3,"header")(4,"h3",13)(5,"span"),I(6,2),a(),r(7,"div",14),p(8,Re,3,0,"button",15)(9,De,9,1,"sh-menu"),a()(),r(10,"app-test-url",16,1),h("targetUrlChange",function(g){return l(t),R(n.targetUrlModel,g)||(n.targetUrlModel=g),_(g)})("testSignalChange",function(g){return l(t),R(n.testSignal,g)||(n.testSignal=g),_(g)}),a(),A(12),p(13,Ie,3,1,"app-destination-list-item",17),a(),p(14,fe,1,0,"app-destination-list"),p(15,he,1,1,"app-single-destination",18),r(16,"div",19)(17,"button",20),d("click",function(){return l(t),_(n.goBack())}),E(18,3),O(19,"sh-icon"),C(),a(),r(20,"button",21),E(21,4),p(22,Me,2,0,"sh-icon",22)(23,Pe,2,0,"sh-icon"),C(),a()()(),p(24,Ae,16,4,"sh-dialog",23)}if(e&2){let t=y(!!n.targetUrlModel());T(8),F(t?9:8),T(2),f("targetUrl",n.targetUrlModel)("testSignal",n.testSignal),D("backupId",null)("sourcePrefix",null)("suppressErrorDialogs",!1)("askToCreate",!1)("testExpectation","containsBackup")("moduleType","Backend"),T(2);let s=y(n.selectedDestinationTypeOption());T(),F(s?13:-1),T(),F(t?-1:14),T(),F(t?15:-1),T(5),D("disabled",n.testSignal()=="testing"||!t),T(2),F(n.testSignal()=="testing"?22:23),T(2),F(n.targetUrlDialogOpen()?24:-1)}},dependencies:[ue,Se,de,ie,ne,Q,Y,Z,te,ee,le,_e,ce,oe,ae,re,Ee],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}pre[_ngcontent-%COMP%]{white-space:pre-wrap}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.field-row.single-field[_ngcontent-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-8)}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-8)}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}.target-dialog-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:.5rem}"],changeDetection:0})};export{x as default};
@@ -1,3 +1,3 @@
1
- import{a as Ee}from"./chunk-PGHGTNMG.js";import{a as Ne}from"./chunk-F5SNXI4Q.js";import"./chunk-Q74O3CWJ.js";import{h as Te,q as A}from"./chunk-K6G3RPPP.js";import"./chunk-Z35S3FHQ.js";import"./chunk-IMHM7ISI.js";import"./chunk-6LAXPU22.js";import{b as he}from"./chunk-3TJKPVBA.js";import"./chunk-QHBOEY2O.js";import"./chunk-NK5WD6WE.js";import"./chunk-B62TPRVG.js";import"./chunk-6Q6SSTBK.js";import"./chunk-SZUNW4JO.js";import"./chunk-TL4WOQKT.js";import"./chunk-7LTHH6OG.js";import"./chunk-HSHF5HR7.js";import"./chunk-5LBG6MOL.js";import"./chunk-D6IP567E.js";import{b as D}from"./chunk-VDSX2M4H.js";import"./chunk-ZU6T3TW3.js";import"./chunk-HUZXJWCG.js";import"./chunk-7TWUW4XJ.js";import{B as ue,G as de,H as _e,L as pe,P as Ce,Y as ge,c as Z,e as ee,f as te,j as ne,n as oe,o as ie,p as ae,q as se,r as re,s as le,t as ce,u as me}from"./chunk-UNMDSCAN.js";import{b as Fe,c as Se}from"./chunk-CFNARBNK.js";import{b as W,d as Q,e as Y}from"./chunk-I27PVH6D.js";import"./chunk-5VE6P5U5.js";import"./chunk-PO3L6MKW.js";import"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.js";import{$ as E,Ab as o,Bb as a,Fb as I,Gb as M,Ib as v,Pa as u,Pb as p,Qb as C,R as b,Rb as O,Sb as x,Tb as w,Vb as K,W as _,Xb as N,aa as f,cb as R,gc as J,la as L,na as $,oc as X,pc as q,qc as V,sb as k,tb as G,ub as B,vc as H,wb as y,wc as z,xb as U,xc as j,yb as F,zb as l}from"./chunk-26Z7TPJB.js";import"./chunk-7CGTOI24.js";var T=class s{#e=new Map;saveState(t){let e=crypto.randomUUID();return this.#e.set(e,t),e}getState(t){return this.#e.get(t)}static \u0275fac=function(e){return new(e||s)};static \u0275prov=b({token:s,factory:s.\u0275fac,providedIn:"root"})};var Ie=()=>["backup"];function Me(s,t){s&1&&a(0,"sh-progress-bar",11)}function Oe(s,t){if(s&1&&(l(0,"sh-form-field"),a(1,"input",35),o()),s&2){let e=t.$implicit,n=t.$index;u(),F("id",H("filter-",n))("formControl",e)}}function De(s,t){if(s&1){let e=v();l(0,"form",12)(1,"sh-select",13)(2,"label",14),p(3,1),a(4,"sh-icon",15),C(),o(),a(5,"input",16),o(),l(6,"sh-form-field")(7,"label",17),p(8,2),a(9,"sh-icon",18),C(),o(),a(10,"textarea",19),o(),l(11,"sh-form-field")(12,"label",20),p(13,3),a(14,"sh-icon",21),C(),o(),a(15,"textarea",22),o()(),l(16,"sh-divider"),O(17,4),o(),l(18,"form",12)(19,"sh-form-field")(20,"label",23),p(21,5),a(22,"sh-icon",24),C(),o(),a(23,"input",25),o(),l(24,"sh-form-field")(25,"label",26),p(26,6),a(27,"sh-icon",27),C(),o(),a(28,"input",28),o(),l(29,"app-toggle-card",29),I(30,30),O(31,7),M(),I(32,31),y(33,Oe,2,3,"sh-form-field",null,B),M(),o()(),l(35,"app-options-list",32),V("optionsChange",function(r){E(e);let m=N();return q(m.settings,r)||(m.settings=r),f(r)}),o(),l(36,"div",33)(37,"button",34),K("click",function(){E(e);let r=N();return f(r.submit())}),p(38,8),a(39,"sh-icon"),C(),o()()}if(s&2){let e=N();F("formGroup",e.baseCmdForm),u(),F("options",e.commandOptions()??j(10,Ie))("inlineSearch",!0),u(17),F("formGroup",e.standardFields),u(11),F("disallowToggle",!0),u(4),U(e.standardFields.controls.filters.controls),u(2),X("options",e.settings),F("hasFreeTextSettings",!0),u(2),J("loader",e.isSubmitting()),u(2),x(e.baseCmdForm.value.command),w(38)}}var c=new re,P=class s{#e=_(A);#n=_(Se);#o=_(Q);#t=_(W);#a=_(Fe);#s=_(he);#i=_(T);#r=D(this.#t.params);commandOptions=D(this.#a.getApiV1Commandline());isSubmitting=L(!1);optionsFields=this.#e.optionsFields;standardFields=c.group({"backup-id":c.control(""),"backup-name":c.control(""),dbpath:c.control(""),filters:c.array([])});baseCmdForm=c.group({command:c.control("backup"),targetUrl:c.control(""),arguments:c.control("")});finishedLoading=this.#e.finishedLoading;backupId=this.#e.backupId;settings=this.#e.settings;#c=$(()=>{let t=this.#r()?.id;this.#e.backupId.set(t),this.getBackup(t)});getBackup(t){this.#n.getApiV1BackupById({id:t}).subscribe({next:e=>{this.#e.mapScheduleToForm(e.Schedule??null),e.Backup&&(this.#e.mapGeneralToForm(e.Backup),this.mapStandardFieldsToForm(e.Backup),this.mapBaseCmdToForm(e.Backup),this.#e.mapOptionsToForms(e.Backup,!0)),this.applyStateFromUrl(),this.#e.finishedLoading.set(!0)}})}mapStandardFieldsToForm(t){this.standardFields.patchValue({dbpath:t.DBPath,"backup-id":t.ID,"backup-name":t.Name}),t.Filters&&t.Filters.length&&t.Filters.map(e=>{this.standardFields.controls.filters.push(c.control(`${e.Include?"":"-"}${e.Expression}`))})}submit(){this.#s.resumeDialogCheck(()=>this.#l())}#l(){this.isSubmitting.set(!0);let t=this.updateUrl(),e=this.baseCmdForm.value,n=e.targetUrl??"",r=(e.arguments??"").split(`
1
+ import{a as Ee}from"./chunk-TXFTUL4R.js";import{a as Ne}from"./chunk-EE27B3OV.js";import"./chunk-Q74O3CWJ.js";import{h as Te,p as A}from"./chunk-TN6HBIUN.js";import"./chunk-K34VOGDF.js";import"./chunk-IMHM7ISI.js";import"./chunk-6LAXPU22.js";import{b as he}from"./chunk-BFTGDQ4K.js";import"./chunk-QHBOEY2O.js";import"./chunk-NK5WD6WE.js";import"./chunk-B62TPRVG.js";import"./chunk-6Q6SSTBK.js";import"./chunk-SZUNW4JO.js";import"./chunk-TL4WOQKT.js";import"./chunk-7LTHH6OG.js";import"./chunk-HSHF5HR7.js";import"./chunk-5LBG6MOL.js";import"./chunk-D6IP567E.js";import{b as D}from"./chunk-VDSX2M4H.js";import"./chunk-ZU6T3TW3.js";import"./chunk-HUZXJWCG.js";import"./chunk-7TWUW4XJ.js";import{B as ue,G as de,H as _e,L as pe,P as Ce,Y as ge,c as Z,e as ee,f as te,j as ne,n as oe,o as ie,p as ae,q as se,r as re,s as le,t as ce,u as me}from"./chunk-UNMDSCAN.js";import{b as Fe,c as Se}from"./chunk-CFNARBNK.js";import{b as W,d as Q,e as Y}from"./chunk-I27PVH6D.js";import"./chunk-5VE6P5U5.js";import"./chunk-PO3L6MKW.js";import"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.js";import{$ as E,Ab as o,Bb as a,Fb as I,Gb as M,Ib as v,Pa as u,Pb as p,Qb as C,R as b,Rb as O,Sb as x,Tb as w,Vb as K,W as _,Xb as N,aa as f,cb as R,gc as J,la as L,na as $,oc as X,pc as q,qc as V,sb as k,tb as G,ub as B,vc as H,wb as y,wc as z,xb as U,xc as j,yb as F,zb as l}from"./chunk-26Z7TPJB.js";import"./chunk-7CGTOI24.js";var T=class s{#e=new Map;saveState(t){let e=crypto.randomUUID();return this.#e.set(e,t),e}getState(t){return this.#e.get(t)}static \u0275fac=function(e){return new(e||s)};static \u0275prov=b({token:s,factory:s.\u0275fac,providedIn:"root"})};var Ie=()=>["backup"];function Me(s,t){s&1&&a(0,"sh-progress-bar",11)}function Oe(s,t){if(s&1&&(l(0,"sh-form-field"),a(1,"input",35),o()),s&2){let e=t.$implicit,n=t.$index;u(),F("id",H("filter-",n))("formControl",e)}}function De(s,t){if(s&1){let e=v();l(0,"form",12)(1,"sh-select",13)(2,"label",14),p(3,1),a(4,"sh-icon",15),C(),o(),a(5,"input",16),o(),l(6,"sh-form-field")(7,"label",17),p(8,2),a(9,"sh-icon",18),C(),o(),a(10,"textarea",19),o(),l(11,"sh-form-field")(12,"label",20),p(13,3),a(14,"sh-icon",21),C(),o(),a(15,"textarea",22),o()(),l(16,"sh-divider"),O(17,4),o(),l(18,"form",12)(19,"sh-form-field")(20,"label",23),p(21,5),a(22,"sh-icon",24),C(),o(),a(23,"input",25),o(),l(24,"sh-form-field")(25,"label",26),p(26,6),a(27,"sh-icon",27),C(),o(),a(28,"input",28),o(),l(29,"app-toggle-card",29),I(30,30),O(31,7),M(),I(32,31),y(33,Oe,2,3,"sh-form-field",null,B),M(),o()(),l(35,"app-options-list",32),V("optionsChange",function(r){E(e);let m=N();return q(m.settings,r)||(m.settings=r),f(r)}),o(),l(36,"div",33)(37,"button",34),K("click",function(){E(e);let r=N();return f(r.submit())}),p(38,8),a(39,"sh-icon"),C(),o()()}if(s&2){let e=N();F("formGroup",e.baseCmdForm),u(),F("options",e.commandOptions()??j(10,Ie))("inlineSearch",!0),u(17),F("formGroup",e.standardFields),u(11),F("disallowToggle",!0),u(4),U(e.standardFields.controls.filters.controls),u(2),X("options",e.settings),F("hasFreeTextSettings",!0),u(2),J("loader",e.isSubmitting()),u(2),x(e.baseCmdForm.value.command),w(38)}}var c=new re,P=class s{#e=_(A);#n=_(Se);#o=_(Q);#t=_(W);#a=_(Fe);#s=_(he);#i=_(T);#r=D(this.#t.params);commandOptions=D(this.#a.getApiV1Commandline());isSubmitting=L(!1);optionsFields=this.#e.optionsFields;standardFields=c.group({"backup-id":c.control(""),"backup-name":c.control(""),dbpath:c.control(""),filters:c.array([])});baseCmdForm=c.group({command:c.control("backup"),targetUrl:c.control(""),arguments:c.control("")});finishedLoading=this.#e.finishedLoading;backupId=this.#e.backupId;settings=this.#e.settings;#c=$(()=>{let t=this.#r()?.id;this.#e.backupId.set(t),this.getBackup(t)});getBackup(t){this.#n.getApiV1BackupById({id:t}).subscribe({next:e=>{this.#e.mapScheduleToForm(e.Schedule??null),e.Backup&&(this.#e.mapGeneralToForm(e.Backup),this.mapStandardFieldsToForm(e.Backup),this.mapBaseCmdToForm(e.Backup),this.#e.mapOptionsToForms(e.Backup,!0)),this.applyStateFromUrl(),this.#e.finishedLoading.set(!0)}})}mapStandardFieldsToForm(t){this.standardFields.patchValue({dbpath:t.DBPath,"backup-id":t.ID,"backup-name":t.Name}),t.Filters&&t.Filters.length&&t.Filters.map(e=>{this.standardFields.controls.filters.push(c.control(`${e.Include?"":"-"}${e.Expression}`))})}submit(){this.#s.resumeDialogCheck(()=>this.#l())}#l(){this.isSubmitting.set(!0);let t=this.updateUrl(),e=this.baseCmdForm.value,n=e.targetUrl??"",r=(e.arguments??"").split(`
2
2
  `)??[],m=[n,...r].filter(i=>i.length>0),g=this.standardFields.value,S=g.filters??[],h=[e.command,...m,`--backup-name=${g["backup-name"]}`,`--dbpath=${g.dbpath}`,`--backup-id=${g["backup-id"]}`,...S.filter(i=>i).map(i=>i.startsWith("-")?`--exclude=${i?.slice(1)}`:`--include=${i}`),...this.#e.mapFormsToSettings(["backup-id","backup-name","dbpath"]).map(i=>`${i.Name.startsWith("--")?"":"--"}${i.Name}=${i.Value}`),"--disable-module=console-password-input"];this.#n.postApiV1Commandline({requestBody:h}).subscribe({next:i=>{i.Status==="OK"&&this.#o.navigate(["backup",this.backupId(),"commandline",i.ID],{queryParams:{state:t}})},error:()=>{this.isSubmitting.set(!1)}})}mapBaseCmdToForm(t){let e=t.TargetURL??null;e&&this.baseCmdForm.patchValue({targetUrl:e??"",arguments:t.Sources?.join(`
3
3
  `)??""})}updateUrl(){let t=this.baseCmdForm.value,e=this.standardFields.value,n=e.filters??[],r=this.settings(),m=this.#i.saveState({command:t.command,targetUrl:t.targetUrl,arguments:t.arguments,backupId:e["backup-id"],backupName:e["backup-name"],dbpath:e.dbpath,filters:n,options:r});return this.#o.navigate([],{relativeTo:this.#t,queryParams:{state:m},replaceUrl:!0}),m}applyStateFromUrl(){let e=this.#t.snapshot.queryParams.state;if(!e)return;let n=this.#i.getState(e);n&&(this.baseCmdForm.patchValue({command:n.command,targetUrl:n.targetUrl,arguments:n.arguments}),this.standardFields.patchValue({"backup-id":n.backupId,"backup-name":n.backupName,dbpath:n.dbpath}),n.filters&&(this.standardFields.controls.filters.clear(),n.filters.forEach(r=>{this.standardFields.controls.filters.push(c.control(r))})),n.options&&n.options.length>0&&this.settings.set(n.options))}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=R({type:s,selectors:[["app-commandline"]],features:[z([A])],decls:8,vars:1,consts:()=>{let t;t=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let e;e=$localize` Command ${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON:`;let n;n=$localize` TargetUrl ${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON:`;let r;r=$localize` Commandline Arguments ${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON:`;let m;m=$localize`Advanced options`;let g;g=$localize` Backup ID ${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON:`;let S;S=$localize` Backup Name ${"\uFFFD#27\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#27\uFFFD"}:CLOSE_TAG_SH_ICON:`;let h;h=$localize`Filters`;let i;return i=$localize`${"\uFFFD#39\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#39\uFFFD"}:CLOSE_TAG_SH_ICON: Run "${"\uFFFD0\uFFFD"}:INTERPOLATION:" command now `,[t,e,n,r,m,g,S,h,i,[1,"back"],["type","button","shButton","","routerLink","/",1,"small"],[1,"indeterminate","primary"],[3,"formGroup"],["placeholder","Select a command...",3,"options","inlineSearch"],["for","command"],["shTooltip","Choose the command to execute"],["type","text","id","command","formControlName","command"],["for","targetUrl"],["shTooltip","Enter the URL of the backup target"],["id","targetUrl","autocomplete","off","formControlName","targetUrl"],["for","arguments"],["shTooltip","Enter one argument per line without quotes (e.g., *.txt)"],["id","arguments","autocomplete","off","rows","5","formControlName","arguments","placeholder","Enter one argument per line without quotes (e.g., *.txt)",1,"arguments"],["for","backup-id"],["shTooltip","The ID of the backup configuration this run belongs to (can be empty)"],["id","backup-id","formControlName","backup-id"],["for","backup-name"],["shTooltip","The optional name of the backup"],["id","backup-name","formControlName","backup-name"],[3,"disallowToggle"],["title",""],["content","","formGroupName","filters"],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["shButton","",1,"raised","primary",3,"click"],[3,"id","formControl"]]},template:function(e,n){e&1&&(a(0,"app-status-bar"),l(1,"section")(2,"div",9)(3,"button",10),p(4,0),a(5,"sh-icon"),C(),o()(),k(6,Me,1,0,"sh-progress-bar",11)(7,De,40,11),o()),e&2&&(u(6),G(n.finishedLoading()?7:6))},dependencies:[le,ne,Z,ee,te,Ne,Ee,Te,ce,oe,se,ae,ie,Y,_e,ue,de,Ce,pe,me,ge],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;max-width:40rem;padding:2.5rem;gap:1.25rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.arguments[_ngcontent-%COMP%]{min-height:6rem;white-space:pre}"],changeDetection:0})};export{P as default};
@@ -1 +1 @@
1
- import{a as $e,b as He}from"./chunk-UK6PJVXG.js";import{a as we}from"./chunk-MZ5COKIP.js";import{a as V}from"./chunk-ZMSYEF6G.js";import"./chunk-3TJKPVBA.js";import{a as Ge}from"./chunk-B62TPRVG.js";import"./chunk-6Q6SSTBK.js";import"./chunk-SZUNW4JO.js";import"./chunk-7LTHH6OG.js";import"./chunk-HSHF5HR7.js";import{a as ye}from"./chunk-BABBRM6A.js";import"./chunk-5LBG6MOL.js";import{a as be}from"./chunk-D6IP567E.js";import"./chunk-VDSX2M4H.js";import"./chunk-ZU6T3TW3.js";import{a as Re}from"./chunk-HUZXJWCG.js";import{c as Ce,e as ve}from"./chunk-7TWUW4XJ.js";import{B as R,G as Pe,H as Ie,J as Le,Q as Me,Y as De,c as Te,d as me,e as he,i as Ee,r as Ae,s as Fe,t as Oe,u as D,w as B,x as Ne,z as fe}from"./chunk-UNMDSCAN.js";import{c as Y}from"./chunk-CFNARBNK.js";import{c as pe,e as Se,f as ge}from"./chunk-I27PVH6D.js";import"./chunk-5VE6P5U5.js";import"./chunk-PO3L6MKW.js";import"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.js";import{$ as m,Ab as o,Bb as _,E as W,Fb as ie,Gb as oe,Ib as E,Mc as U,Pa as r,Pb as g,Qb as C,Qc as ue,Rb as f,Sc as de,Ub as G,Uc as Q,Vb as T,W as S,Xb as c,aa as h,cb as M,cc as ae,dc as se,gc as k,ic as L,jc as u,kc as q,la as F,lc as b,na as j,oc as y,pc as $,qc as H,rc as re,sb as d,sc as le,tb as p,tc as w,ub as ee,uc as _e,wb as te,xb as ne,xc as ce,yb as O,zb as a}from"./chunk-26Z7TPJB.js";import{a as X,b as z}from"./chunk-7CGTOI24.js";var Be=["scroller"];function Ye(i,n){i&1&&(a(0,"sh-icon"),u(1,"bell-ringing"),o())}function Ve(i,n){i&1&&(a(0,"sh-icon"),u(1,"bell"),o())}function Je(i,n){if(i&1&&_(0,"app-notification",8),i&2){c(2);let e=w(6);O("index",0)("notification",e.content)}}function Xe(i,n){if(i&1&&(a(0,"div",11),u(1),o()),i&2){c(3);let e=w(6);r(),b(" ",e.content.content," ")}}function ze(i,n){if(i&1&&(a(0,"sh-alert")(1,"div",10),u(2),o(),d(3,Xe,2,1,"div",11),o()),i&2){c(2);let e=w(6);L(e.content.type||"error"),r(2),q(e.content.title),r(),p(e.content.content?3:-1)}}function We(i,n){if(i&1&&(a(0,"div",6),d(1,Je,1,2,"app-notification",8)(2,ze,4,4,"sh-alert",9),o()),i&2){c();let e=w(6);r(),p(e.type==="notification"?1:2)}}function je(i,n){if(i&1){let e=E();a(0,"div",7)(1,"div",12)(2,"h6",13),g(3,2),a(4,"button",5),T("click",function(){m(e);let s=c();return h(s.toggleNotifications())}),_(5,"sh-icon"),o(),C(),o(),a(6,"div",14,0)(8,"div",15),_(9,"app-notifications"),o()()()()}}function qe(i,n){if(i&1&&(a(0,"div",20),u(1),o()),i&2){let e=c().$implicit;r(),b(" ",e.content," ")}}function Qe(i,n){if(i&1){let e=E();a(0,"sh-alert",18,1),T("click",function(){let s=m(e).$implicit,l=c(2);return h(l.deleteAlertByIndex(s.id))}),a(2,"div",19),u(3),o(),d(4,qe,2,1,"div",20),o()}if(i&2){let e=n.$implicit;L(e.type),O("id",e.id),r(3),q(e.title),r(),p(e.content?4:-1)}}function Ke(i,n){i&1&&(a(0,"p",17),f(1,4),o())}function Ze(i,n){if(i&1){let e=E();a(0,"div",7)(1,"div",12)(2,"h6",13),g(3,3),a(4,"button",5),T("click",function(){m(e);let s=c();return h(s.toggleAlerts())}),_(5,"sh-icon"),o(),C(),o(),a(6,"div",14,0)(8,"div",15),te(9,Qe,5,5,"sh-alert",16,ee,!1,Ke,2,0,"p",17),o()()()()}if(i&2){let e=c();r(9),ne(e.alertHistory())}}var xe=new Ae,x=class i{#e=S(Ne);#t=S(V);isSubmitting=F(!1);messageSent=F(!1);form=xe.group({message:xe.control("",[me.required])});notifications=this.#t.notifications;shownMessage=F(null);shownMessageInterval=null;alertHistory=this.#e.alertHistory;alertHistoryIsOpen=this.#e.alertHistoryIsOpen;alertHistoryIsHidden=this.#e.alertHistoryIsHidden;numberOfOpenAlerts=U(()=>this.alertHistory().filter(n=>n.isOpen).length);scroller=de("scroller");isAlertsOpen=Q(!1);isNotificationsOpen=Q(!1);previousHistoryCount=F(null);previousNotificationsCount=F(null);constructor(){j(()=>{let n=this.alertHistory(),e=this.notifications();if(e.length===0){this.shownMessage.set(null);return}e.length&&this.previousHistoryCount()!==n.length&&!this.isNotificationsOpen()?(this.shownMessage.set({content:e[0],countDown:3,type:"notification"}),this.previousHistoryCount.set(n.length),this.shownMessageInterval=setInterval(()=>{let t=this.shownMessage();if(t?.countDown===0){this.shownMessage.set(null),this.shownMessageInterval=null;return}t!==null&&this.shownMessage.update(s=>z(X({},s),{countDown:s.countDown-1}))},1e3)):n.length&&this.previousHistoryCount()!==n.length&&!this.isAlertsOpen()&&(this.shownMessage.set({content:n[0],countDown:3,type:"alert"}),this.previousHistoryCount.set(n.length),this.shownMessageInterval=setInterval(()=>{let t=this.shownMessage();if(t?.countDown===0){this.shownMessage.set(null),this.shownMessageInterval=null;return}t!==null&&this.shownMessage.update(s=>z(X({},s),{countDown:s.countDown-1}))},1e3))}),j(()=>{this.alertHistoryIsOpen(),this.scrollToBottom()})}resetPreviewMessage(){this.shownMessage.set(null),this.shownMessageInterval=null}toggleAlerts(){this.isAlertsOpen()?this.isAlertsOpen.set(!1):(this.isAlertsOpen.set(!0),this.isNotificationsOpen.set(!1),this.resetPreviewMessage())}toggleNotifications(){this.isNotificationsOpen.set(!this.isNotificationsOpen()),this.isAlertsOpen()&&this.isAlertsOpen.set(!1)}deleteAlertByIndex(n){this.#e.removeAlert(n)}scrollToBottom(){this.scroller()&&this.scroller()?.nativeElement&&this.scroller().nativeElement.scrollTo(0,this.scroller().nativeElement.scrollHeight)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=M({type:i,selectors:[["app-service-hub"]],viewQuery:function(e,t){e&1&&ae(t.scroller,Be,5),e&2&&se()},inputs:{isAlertsOpen:[1,"isAlertsOpen"],isNotificationsOpen:[1,"isNotificationsOpen"]},outputs:{isAlertsOpen:"isAlertsOpenChange",isNotificationsOpen:"isNotificationsOpenChange"},decls:10,vars:9,consts:()=>{let n;n=$localize` Notifications ${"\uFFFD#4\uFFFD"}:START_TAG_BUTTON:${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:x-circle${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_BUTTON:`;let e;e=$localize` Alerts ${"\uFFFD#4\uFFFD"}:START_TAG_BUTTON:${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:x-circle${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_BUTTON:`;let t;return t=$localize`No alerts yet`,[["scroller",""],["alerts",""],n,e,t,["shButton","",3,"click"],[1,"preview-alert-wrap"],[1,"alert-stream-modal"],[3,"index","notification"],[3,"class"],["ship-alert-title",""],["ship-alert-content",""],[1,"alert-stream-modal-content"],[1,"paragraph-20"],[1,"alert-stream-modal-list-scroller"],[1,"alert-stream-modal-list"],[3,"class","id"],[1,"no-alerts"],[3,"click","id"],["title",""],["content",""]]},template:function(e,t){if(e&1){let s=E();a(0,"button",5),T("click",function(){return m(s),h(t.toggleAlerts())}),a(1,"sh-icon"),u(2,"info"),o()(),a(3,"button",5),T("click",function(){return m(s),h(t.toggleNotifications())}),d(4,Ye,2,0,"sh-icon")(5,Ve,2,0,"sh-icon"),o(),re(6),d(7,We,3,1,"div",6),d(8,je,10,0,"div",7),d(9,Ze,12,1,"div",7)}if(e&2){L(t.alertHistory().length?"error":""),r(3),L(t.notifications().length?"error":""),r(),p(t.notifications().length?4:5),r(2);let s=le(t.shownMessage());r(),p(s?7:-1),r(),p(t.isNotificationsOpen()?8:-1),r(),p(t.isAlertsOpen()?9:-1)}},dependencies:[Oe,B,D,R,He,$e],styles:["[_nghost-%COMP%]{display:flex;position:fixed;gap:.5rem;bottom:1.5rem;right:1.5rem;z-index:5000}@media only screen and (max-width:768px){[_nghost-%COMP%]{bottom:1rem;right:1rem}}[_nghost-%COMP%] h6[_ngcontent-%COMP%]{margin:0}.preview-alert-wrap[_ngcontent-%COMP%]{position:absolute;bottom:2.6875rem;right:0;display:flex;flex-direction:column;min-width:15.625rem}.helpdesk-modal[_ngcontent-%COMP%]{position:absolute;bottom:2.6875rem;right:0;display:flex;flex-direction:column}@media only screen and (max-width:768px){.helpdesk-modal[_ngcontent-%COMP%]{bottom:2.6875rem}}.helpdesk-modal-content[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;gap:1rem;min-width:20rem;border:1px solid var(--base-4);background-color:var(--base-1);border-radius:var(--shape-2)}.helpdesk-modal-content[_ngcontent-%COMP%] .message-sent[_ngcontent-%COMP%]{padding:0 1rem 1rem;text-wrap:pretty}.helpdesk-modal-content[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{padding:1rem;border-bottom:1px solid var(--base-4);display:flex;align-items:center;justify-content:space-between}.helpdesk-modal-content[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{padding:0 1rem 1rem;display:flex;flex-direction:column;align-items:flex-end;gap:1rem}.helpdesk-modal-content[_ngcontent-%COMP%] form[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{width:100%;text-wrap:pretty}.helpdesk-modal-content[_ngcontent-%COMP%] form[_ngcontent-%COMP%] mat-form-field[_ngcontent-%COMP%]{width:100%}.alert-stream-modal[_ngcontent-%COMP%]{position:absolute;bottom:2.6875rem;right:0;display:flex;flex-direction:column}@media only screen and (max-width:768px){.alert-stream-modal[_ngcontent-%COMP%]{bottom:2.6875rem}}.alert-stream-modal-list-scroller[_ngcontent-%COMP%]{overflow-y:auto;max-height:18.75rem}.alert-stream-modal-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:1rem;border-radius:var(--shape-2)}.alert-stream-modal-content[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;min-width:20rem;border:1px solid var(--base-4);background-color:var(--base-1);border-radius:var(--shape-2)}.alert-stream-modal-content[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{padding:1rem;border-bottom:1px solid var(--base-4);display:flex;align-items:center;justify-content:space-between}.no-alerts[_ngcontent-%COMP%]{padding:1rem;display:flex;flex-direction:column;gap:1rem;text-align:center}"],changeDetection:0})};function et(i,n){i&1&&(a(0,"sh-icon",14),u(1,"check"),o())}function tt(i,n){i&1&&(a(0,"sh-icon",15),u(1,"prohibit"),o())}function nt(i,n){if(i&1){let e=E();a(0,"button",20),T("click",function(){m(e);let s=c();return h(s.updatePassphrase())}),f(1,5),o()}if(i&2){let e=c();k("loader",e.isUpdating())}}function it(i,n){if(i&1){let e=E();a(0,"button",21),T("click",function(){m(e);let s=c();return h(s.updatePassphrase())}),f(1,6),o()}if(i&2){let e=c();k("loader",e.isUpdating()),O("disabled",!0)}}var J=class i{#e=S(Y);closed=ue();isUpdating=F(!1);passphrase=F("");repeatPassphrase=F("");updatePassphrase(){this.passphrase()===this.repeatPassphrase()&&(this.isUpdating.set(!0),this.#e.patchApiV1Serversettings({requestBody:{"server-passphrase":this.passphrase()}}).pipe(W(()=>this.isUpdating.set(!1))).subscribe({next:()=>this.closed.emit()}))}cancel(){this.isUpdating.set(!0),this.#e.patchApiV1Serversettings({requestBody:{"has-asked-for-password-change":"True"}}).pipe(W(()=>this.isUpdating.set(!1))).subscribe({next:()=>this.closed.emit()})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=M({type:i,selectors:[["app-change-passphrase-alert-dialog"]],outputs:{closed:"closed"},decls:23,vars:7,consts:()=>{let n;n=$localize`Enter new password`;let e;e=$localize`Repeat password`;let t;t=$localize`Password have to be filled and have to match`;let s;s=$localize`Change passphrase`;let l;l=$localize` Duplicati needs to be secured with a passphrase and a random passphrase has been generated for you. ${"[\uFFFD#6\uFFFD\uFFFD/#6\uFFFD|\uFFFD#7\uFFFD\uFFFD/#7\uFFFD]"}:LINE_BREAK:${"[\uFFFD#6\uFFFD\uFFFD/#6\uFFFD|\uFFFD#7\uFFFD\uFFFD/#7\uFFFD]"}:LINE_BREAK: If you open Duplicati from the tray icon, you do not need a passphrase, but if you plan to open it from another location you need to set a passphrase you know. Do you want to set a passphrase now? `,l=G(l);let P;P=$localize`Passphrase`;let I;I=$localize`Repeat passphrase`;let v;v=$localize`Not now thanks`;let A;A=$localize` Yes, update passphrase now `;let Z;return Z=$localize` Yes, update passphrase now `,[s,l,P,I,v,A,Z,["header",""],["content",""],["type","warning"],["for","password"],["type","password","name","password","autocomplete","disabled","placeholder",n,"tabindex","1",3,"ngModelChange","ngModel"],["for","repeatPassword"],["type","password","name","repeatPassword","autocomplete","disabled","placeholder",e,"tabindex","2",3,"ngModelChange","disabled","ngModel"],["suffix","",1,"sh-success"],["suffix",""],["footer",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"loader"],["shButton","","shTooltip",t,1,"raised","primary",3,"loader","disabled"],["shButton","",1,"raised","primary",3,"click"],["shButton","","shTooltip",t,1,"raised","primary",3,"click","disabled"]]},template:function(e,t){e&1&&(a(0,"header",7)(1,"h3"),f(2,0),o()(),a(3,"div",8)(4,"sh-alert",9),g(5,1),_(6,"br")(7,"br"),C(),o(),a(8,"sh-form-field")(9,"label",10),f(10,2),o(),a(11,"input",11),H("ngModelChange",function(l){return $(t.passphrase,l)||(t.passphrase=l),l}),o()(),a(12,"sh-form-field")(13,"label",12),f(14,3),o(),a(15,"input",13),H("ngModelChange",function(l){return $(t.repeatPassphrase,l)||(t.repeatPassphrase=l),l}),o(),d(16,et,2,0,"sh-icon",14)(17,tt,2,0,"sh-icon",15),o()(),a(18,"footer",16)(19,"button",17),T("click",function(){return t.cancel()}),f(20,4),o(),d(21,nt,2,2,"button",18)(22,it,2,3,"button",19),o()),e&2&&(r(11),y("ngModel",t.passphrase),r(4),O("disabled",t.passphrase().length===0),y("ngModel",t.repeatPassphrase),r(),p(t.passphrase().length!==0&&t.passphrase()===t.repeatPassphrase()?16:17),r(3),k("loader",t.isUpdating()),r(2),p(t.passphrase().length!==0&&t.passphrase()===t.repeatPassphrase()?21:22))},dependencies:[Fe,Te,he,Ee,B,Ie,D,De,R],styles:["[_nghost-%COMP%]{display:block;--dialog-p: 1.5rem}[content][_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}"],changeDetection:0})};var ot=()=>({exact:!0});function at(i,n){i&1&&(a(0,"sh-icon",26),u(1,"x-bold"),o())}function st(i,n){i&1&&(a(0,"sh-icon",27),u(1,"list-bold"),o())}function rt(i,n){if(i&1){let e=E();ie(0,9),a(1,"button",25),T("click",function(){m(e);let s=c();return h(s.toggleNav())}),d(2,at,2,0,"sh-icon",26)(3,st,2,0,"sh-icon",27),o(),oe()}if(i&2){let e=c();r(2),p(e.isNavOpen()?2:3)}}function lt(i,n){i&1&&(a(0,"sh-icon"),u(1,"sun"),o())}function _t(i,n){i&1&&(a(0,"sh-icon"),u(1,"moon"),o())}function ct(i,n){if(i&1){let e=E();a(0,"button",28),T("click",function(){m(e);let s=c();return h(s.logout())}),g(1,7),_(2,"sh-icon"),C(),o()}}var K=class i{#e=S(we);#t=S(Y);#i=S(Ge);#o=S(Ce);#a=S(fe);#s=S(V);#r=S(ve);#l=S(be);#n=S(Re);relayIsEnabled=this.#o.relayIsEnabled;isDarkMode=this.#e.isDarkMode;isNavOpen=this.#e.isNavOpen;isMobile=this.#e.isMobile;sidenavType=this.#e.sidenavType;machineName=U(()=>{let n=this.#l.serverSettings();if(n&&n["--machine-name"])return n["--machine-name"];if(n&&n["machine-name"])return n["machine-name"];let e=this.#n.allOptions().find(t=>t.name==="machine-name");return e&&e.defaultValue?e.defaultValue:this.#n.systemInfo()?.MachineName??"Unknown"});ngOnInit(){return this.#s.init(),this.#i.getBackups(!0),this.#t.getApiV1Serversettings().subscribe({next:n=>{let e=n["autogenerated-passphrase"]==="True",t=n["has-asked-for-password-change"]==="True";e&&!t&&this.#a.open(J,{maxWidth:"500px"})}})}toggleNav(){this.#e.toggleNav()}toggleBodyClass(){this.#e.toggleBodyClass()}changeDefaultClientTo(n){this.#_(n),window.location.replace(`/${n}`)}logout(){this.#r.logout()}#_(n){var e=new Date;e.setTime(e.getTime()+2160*60*60*1e3),document.cookie="default-client="+n+"; expires="+e.toUTCString()+"; path=/"}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=M({type:i,selectors:[["app-layout"]],decls:42,vars:12,consts:()=>{let n;n=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SH_ICON:house${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SH_ICON: Home `;let e;e=$localize`${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:database${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON: Add backup `;let t;t=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:clock-counter-clockwise${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Restore `;let s;s=$localize`${"\uFFFD#20\uFFFD"}:START_TAG_SH_ICON:gear${"\uFFFD/#20\uFFFD"}:CLOSE_TAG_SH_ICON: Settings `;let l;l=$localize`${"\uFFFD#30\uFFFD"}:START_TAG_SH_ICON:info${"\uFFFD/#30\uFFFD"}:CLOSE_TAG_SH_ICON: About Duplicati `;let P;P=$localize`${"\uFFFD#33\uFFFD"}:START_TAG_SH_ICON:files${"[\uFFFD/#33\uFFFD|\uFFFD/#34\uFFFD]"}:CLOSE_TAG_SH_ICON: Documentation ${"\uFFFD#34\uFFFD"}:START_TAG_SH_ICON_1:arrow-square-out${"[\uFFFD/#33\uFFFD|\uFFFD/#34\uFFFD]"}:CLOSE_TAG_SH_ICON:`,P=G(P);let I;I=$localize`${"\uFFFD#37\uFFFD"}:START_TAG_SH_ICON:chats-circle${"[\uFFFD/#37\uFFFD|\uFFFD/#38\uFFFD]"}:CLOSE_TAG_SH_ICON: Visit forum ${"\uFFFD#38\uFFFD"}:START_TAG_SH_ICON_1:arrow-square-out${"[\uFFFD/#37\uFFFD|\uFFFD/#38\uFFFD]"}:CLOSE_TAG_SH_ICON:`,I=G(I);let v;return v=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:sign-out${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Log out `,[n,e,t,s,l,P,I,v,[3,"isOpenChange","isOpen","disableDrag"],["sidenav-closed-topbar",""],["sidenav",""],["shButton","",1,"icon","small",3,"click"],[1,"base-1","primary"],["action","","routerLink","/","routerLinkActive","active",3,"routerLinkActiveOptions"],["action","","routerLink","/add-backup","routerLinkActive","active"],["action","","routerLink","/restore","routerLinkActive","active"],["action","","routerLink","/settings","routerLinkActive","active"],[1,"spacer"],[1,"base-1l","primary"],["action","",1,"machine-name",3,"title"],["action","","routerLink","/about","routerLinkActive","active"],["href","https://docs.duplicati.com","target","_blank","action",""],["suffix",""],["href","https://forum.duplicati.com","target","_blank","action",""],["action",""],["shButton","",1,"small","toggle-sidebar",3,"click"],[1,"cross"],[1,"burger"],["action","",3,"click"]]},template:function(e,t){e&1&&(a(0,"sh-sidenav",8),H("isOpenChange",function(l){return $(t.isNavOpen,l)||(t.isNavOpen=l),l}),d(1,rt,4,1,"ng-container",9),a(2,"div",10)(3,"header"),_(4,"app-logo"),a(5,"button",11),T("click",function(){return t.toggleBodyClass()}),d(6,lt,2,0,"sh-icon")(7,_t,2,0,"sh-icon"),o()(),a(8,"sh-list",12)(9,"button",13),g(10,0),_(11,"sh-icon"),C(),o(),a(12,"button",14),g(13,1),_(14,"sh-icon"),C(),o(),a(15,"button",15),g(16,2),_(17,"sh-icon"),C(),o(),a(18,"button",16),g(19,3),_(20,"sh-icon"),C(),o()(),_(21,"div",17),a(22,"sh-list",18)(23,"div",19)(24,"sh-icon"),u(25,"desktop"),o(),u(26),o(),_(27,"sh-divider"),a(28,"button",20),g(29,4),_(30,"sh-icon"),C(),o(),a(31,"a",21),g(32,5),_(33,"sh-icon")(34,"sh-icon",22),C(),o(),a(35,"a",23),g(36,6),_(37,"sh-icon")(38,"sh-icon",22),C(),o(),d(39,ct,3,0,"button",24),o()(),_(40,"router-outlet")(41,"app-service-hub"),o()),e&2&&(L(t.sidenavType()),y("isOpen",t.isNavOpen),O("disableDrag",!0),r(),p(t.isMobile()?1:-1),r(5),p(t.isDarkMode()?6:7),r(3),O("routerLinkActiveOptions",ce(11,ot)),r(14),O("title",_e(t.machineName())),r(3),b(" ",t.machineName()," "),r(13),p(t.relayIsEnabled()?-1:39))},dependencies:[pe,Se,ge,Me,D,Le,R,Pe,x,ye],styles:["[_nghost-%COMP%]{height:100vh;width:100%;overflow:hidden}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1.25rem;gap:.75rem}.toggle-sidebar[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center;justify-content:center}.toggle-sidebar[_ngcontent-%COMP%] .cross[_ngcontent-%COMP%], .toggle-sidebar[_ngcontent-%COMP%] .burger[_ngcontent-%COMP%]{opacity:1;transition:opacity 124ms linear;margin:0}.toggle-sidebar[_ngcontent-%COMP%] .cross.hidden[_ngcontent-%COMP%], .toggle-sidebar[_ngcontent-%COMP%] .burger.hidden[_ngcontent-%COMP%]{opacity:0}.toggle-sidebar[_ngcontent-%COMP%] .burger[_ngcontent-%COMP%]{position:absolute;inset:auto}h3[title][_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}div[sidenav][_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100vh}.machine-name[_ngcontent-%COMP%]{margin:0;cursor:default}"],changeDetection:0})};export{K as default};
1
+ import{a as $e,b as He}from"./chunk-C25WT56X.js";import{a as we}from"./chunk-MZ5COKIP.js";import{a as V}from"./chunk-GRVTXORM.js";import"./chunk-BFTGDQ4K.js";import{a as Ge}from"./chunk-B62TPRVG.js";import"./chunk-6Q6SSTBK.js";import"./chunk-SZUNW4JO.js";import"./chunk-7LTHH6OG.js";import"./chunk-HSHF5HR7.js";import{a as ye}from"./chunk-BABBRM6A.js";import"./chunk-5LBG6MOL.js";import{a as be}from"./chunk-D6IP567E.js";import"./chunk-VDSX2M4H.js";import"./chunk-ZU6T3TW3.js";import{a as Re}from"./chunk-HUZXJWCG.js";import{c as Ce,e as ve}from"./chunk-7TWUW4XJ.js";import{B as R,G as Pe,H as Ie,J as Le,Q as Me,Y as De,c as Te,d as me,e as he,i as Ee,r as Ae,s as Fe,t as Oe,u as D,w as B,x as Ne,z as fe}from"./chunk-UNMDSCAN.js";import{c as Y}from"./chunk-CFNARBNK.js";import{c as pe,e as Se,f as ge}from"./chunk-I27PVH6D.js";import"./chunk-5VE6P5U5.js";import"./chunk-PO3L6MKW.js";import"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.js";import{$ as m,Ab as o,Bb as _,E as W,Fb as ie,Gb as oe,Ib as E,Mc as U,Pa as r,Pb as g,Qb as C,Qc as ue,Rb as f,Sc as de,Ub as G,Uc as Q,Vb as T,W as S,Xb as c,aa as h,cb as M,cc as ae,dc as se,gc as k,ic as L,jc as u,kc as q,la as F,lc as b,na as j,oc as y,pc as $,qc as H,rc as re,sb as d,sc as le,tb as p,tc as w,ub as ee,uc as _e,wb as te,xb as ne,xc as ce,yb as O,zb as a}from"./chunk-26Z7TPJB.js";import{a as X,b as z}from"./chunk-7CGTOI24.js";var Be=["scroller"];function Ye(i,n){i&1&&(a(0,"sh-icon"),u(1,"bell-ringing"),o())}function Ve(i,n){i&1&&(a(0,"sh-icon"),u(1,"bell"),o())}function Je(i,n){if(i&1&&_(0,"app-notification",8),i&2){c(2);let e=w(6);O("index",0)("notification",e.content)}}function Xe(i,n){if(i&1&&(a(0,"div",11),u(1),o()),i&2){c(3);let e=w(6);r(),b(" ",e.content.content," ")}}function ze(i,n){if(i&1&&(a(0,"sh-alert")(1,"div",10),u(2),o(),d(3,Xe,2,1,"div",11),o()),i&2){c(2);let e=w(6);L(e.content.type||"error"),r(2),q(e.content.title),r(),p(e.content.content?3:-1)}}function We(i,n){if(i&1&&(a(0,"div",6),d(1,Je,1,2,"app-notification",8)(2,ze,4,4,"sh-alert",9),o()),i&2){c();let e=w(6);r(),p(e.type==="notification"?1:2)}}function je(i,n){if(i&1){let e=E();a(0,"div",7)(1,"div",12)(2,"h6",13),g(3,2),a(4,"button",5),T("click",function(){m(e);let s=c();return h(s.toggleNotifications())}),_(5,"sh-icon"),o(),C(),o(),a(6,"div",14,0)(8,"div",15),_(9,"app-notifications"),o()()()()}}function qe(i,n){if(i&1&&(a(0,"div",20),u(1),o()),i&2){let e=c().$implicit;r(),b(" ",e.content," ")}}function Qe(i,n){if(i&1){let e=E();a(0,"sh-alert",18,1),T("click",function(){let s=m(e).$implicit,l=c(2);return h(l.deleteAlertByIndex(s.id))}),a(2,"div",19),u(3),o(),d(4,qe,2,1,"div",20),o()}if(i&2){let e=n.$implicit;L(e.type),O("id",e.id),r(3),q(e.title),r(),p(e.content?4:-1)}}function Ke(i,n){i&1&&(a(0,"p",17),f(1,4),o())}function Ze(i,n){if(i&1){let e=E();a(0,"div",7)(1,"div",12)(2,"h6",13),g(3,3),a(4,"button",5),T("click",function(){m(e);let s=c();return h(s.toggleAlerts())}),_(5,"sh-icon"),o(),C(),o(),a(6,"div",14,0)(8,"div",15),te(9,Qe,5,5,"sh-alert",16,ee,!1,Ke,2,0,"p",17),o()()()()}if(i&2){let e=c();r(9),ne(e.alertHistory())}}var xe=new Ae,x=class i{#e=S(Ne);#t=S(V);isSubmitting=F(!1);messageSent=F(!1);form=xe.group({message:xe.control("",[me.required])});notifications=this.#t.notifications;shownMessage=F(null);shownMessageInterval=null;alertHistory=this.#e.alertHistory;alertHistoryIsOpen=this.#e.alertHistoryIsOpen;alertHistoryIsHidden=this.#e.alertHistoryIsHidden;numberOfOpenAlerts=U(()=>this.alertHistory().filter(n=>n.isOpen).length);scroller=de("scroller");isAlertsOpen=Q(!1);isNotificationsOpen=Q(!1);previousHistoryCount=F(null);previousNotificationsCount=F(null);constructor(){j(()=>{let n=this.alertHistory(),e=this.notifications();if(e.length===0){this.shownMessage.set(null);return}e.length&&this.previousHistoryCount()!==n.length&&!this.isNotificationsOpen()?(this.shownMessage.set({content:e[0],countDown:3,type:"notification"}),this.previousHistoryCount.set(n.length),this.shownMessageInterval=setInterval(()=>{let t=this.shownMessage();if(t?.countDown===0){this.shownMessage.set(null),this.shownMessageInterval=null;return}t!==null&&this.shownMessage.update(s=>z(X({},s),{countDown:s.countDown-1}))},1e3)):n.length&&this.previousHistoryCount()!==n.length&&!this.isAlertsOpen()&&(this.shownMessage.set({content:n[0],countDown:3,type:"alert"}),this.previousHistoryCount.set(n.length),this.shownMessageInterval=setInterval(()=>{let t=this.shownMessage();if(t?.countDown===0){this.shownMessage.set(null),this.shownMessageInterval=null;return}t!==null&&this.shownMessage.update(s=>z(X({},s),{countDown:s.countDown-1}))},1e3))}),j(()=>{this.alertHistoryIsOpen(),this.scrollToBottom()})}resetPreviewMessage(){this.shownMessage.set(null),this.shownMessageInterval=null}toggleAlerts(){this.isAlertsOpen()?this.isAlertsOpen.set(!1):(this.isAlertsOpen.set(!0),this.isNotificationsOpen.set(!1),this.resetPreviewMessage())}toggleNotifications(){this.isNotificationsOpen.set(!this.isNotificationsOpen()),this.isAlertsOpen()&&this.isAlertsOpen.set(!1)}deleteAlertByIndex(n){this.#e.removeAlert(n)}scrollToBottom(){this.scroller()&&this.scroller()?.nativeElement&&this.scroller().nativeElement.scrollTo(0,this.scroller().nativeElement.scrollHeight)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=M({type:i,selectors:[["app-service-hub"]],viewQuery:function(e,t){e&1&&ae(t.scroller,Be,5),e&2&&se()},inputs:{isAlertsOpen:[1,"isAlertsOpen"],isNotificationsOpen:[1,"isNotificationsOpen"]},outputs:{isAlertsOpen:"isAlertsOpenChange",isNotificationsOpen:"isNotificationsOpenChange"},decls:10,vars:9,consts:()=>{let n;n=$localize` Notifications ${"\uFFFD#4\uFFFD"}:START_TAG_BUTTON:${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:x-circle${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_BUTTON:`;let e;e=$localize` Alerts ${"\uFFFD#4\uFFFD"}:START_TAG_BUTTON:${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:x-circle${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_BUTTON:`;let t;return t=$localize`No alerts yet`,[["scroller",""],["alerts",""],n,e,t,["shButton","",3,"click"],[1,"preview-alert-wrap"],[1,"alert-stream-modal"],[3,"index","notification"],[3,"class"],["ship-alert-title",""],["ship-alert-content",""],[1,"alert-stream-modal-content"],[1,"paragraph-20"],[1,"alert-stream-modal-list-scroller"],[1,"alert-stream-modal-list"],[3,"class","id"],[1,"no-alerts"],[3,"click","id"],["title",""],["content",""]]},template:function(e,t){if(e&1){let s=E();a(0,"button",5),T("click",function(){return m(s),h(t.toggleAlerts())}),a(1,"sh-icon"),u(2,"info"),o()(),a(3,"button",5),T("click",function(){return m(s),h(t.toggleNotifications())}),d(4,Ye,2,0,"sh-icon")(5,Ve,2,0,"sh-icon"),o(),re(6),d(7,We,3,1,"div",6),d(8,je,10,0,"div",7),d(9,Ze,12,1,"div",7)}if(e&2){L(t.alertHistory().length?"error":""),r(3),L(t.notifications().length?"error":""),r(),p(t.notifications().length?4:5),r(2);let s=le(t.shownMessage());r(),p(s?7:-1),r(),p(t.isNotificationsOpen()?8:-1),r(),p(t.isAlertsOpen()?9:-1)}},dependencies:[Oe,B,D,R,He,$e],styles:["[_nghost-%COMP%]{display:flex;position:fixed;gap:.5rem;bottom:1.5rem;right:1.5rem;z-index:5000}@media only screen and (max-width:768px){[_nghost-%COMP%]{bottom:1rem;right:1rem}}[_nghost-%COMP%] h6[_ngcontent-%COMP%]{margin:0}.preview-alert-wrap[_ngcontent-%COMP%]{position:absolute;bottom:2.6875rem;right:0;display:flex;flex-direction:column;min-width:15.625rem}.helpdesk-modal[_ngcontent-%COMP%]{position:absolute;bottom:2.6875rem;right:0;display:flex;flex-direction:column}@media only screen and (max-width:768px){.helpdesk-modal[_ngcontent-%COMP%]{bottom:2.6875rem}}.helpdesk-modal-content[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;gap:1rem;min-width:20rem;border:1px solid var(--base-4);background-color:var(--base-1);border-radius:var(--shape-2)}.helpdesk-modal-content[_ngcontent-%COMP%] .message-sent[_ngcontent-%COMP%]{padding:0 1rem 1rem;text-wrap:pretty}.helpdesk-modal-content[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{padding:1rem;border-bottom:1px solid var(--base-4);display:flex;align-items:center;justify-content:space-between}.helpdesk-modal-content[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{padding:0 1rem 1rem;display:flex;flex-direction:column;align-items:flex-end;gap:1rem}.helpdesk-modal-content[_ngcontent-%COMP%] form[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{width:100%;text-wrap:pretty}.helpdesk-modal-content[_ngcontent-%COMP%] form[_ngcontent-%COMP%] mat-form-field[_ngcontent-%COMP%]{width:100%}.alert-stream-modal[_ngcontent-%COMP%]{position:absolute;bottom:2.6875rem;right:0;display:flex;flex-direction:column}@media only screen and (max-width:768px){.alert-stream-modal[_ngcontent-%COMP%]{bottom:2.6875rem}}.alert-stream-modal-list-scroller[_ngcontent-%COMP%]{overflow-y:auto;max-height:18.75rem}.alert-stream-modal-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:1rem;border-radius:var(--shape-2)}.alert-stream-modal-content[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;min-width:20rem;border:1px solid var(--base-4);background-color:var(--base-1);border-radius:var(--shape-2)}.alert-stream-modal-content[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{padding:1rem;border-bottom:1px solid var(--base-4);display:flex;align-items:center;justify-content:space-between}.no-alerts[_ngcontent-%COMP%]{padding:1rem;display:flex;flex-direction:column;gap:1rem;text-align:center}"],changeDetection:0})};function et(i,n){i&1&&(a(0,"sh-icon",14),u(1,"check"),o())}function tt(i,n){i&1&&(a(0,"sh-icon",15),u(1,"prohibit"),o())}function nt(i,n){if(i&1){let e=E();a(0,"button",20),T("click",function(){m(e);let s=c();return h(s.updatePassphrase())}),f(1,5),o()}if(i&2){let e=c();k("loader",e.isUpdating())}}function it(i,n){if(i&1){let e=E();a(0,"button",21),T("click",function(){m(e);let s=c();return h(s.updatePassphrase())}),f(1,6),o()}if(i&2){let e=c();k("loader",e.isUpdating()),O("disabled",!0)}}var J=class i{#e=S(Y);closed=ue();isUpdating=F(!1);passphrase=F("");repeatPassphrase=F("");updatePassphrase(){this.passphrase()===this.repeatPassphrase()&&(this.isUpdating.set(!0),this.#e.patchApiV1Serversettings({requestBody:{"server-passphrase":this.passphrase()}}).pipe(W(()=>this.isUpdating.set(!1))).subscribe({next:()=>this.closed.emit()}))}cancel(){this.isUpdating.set(!0),this.#e.patchApiV1Serversettings({requestBody:{"has-asked-for-password-change":"True"}}).pipe(W(()=>this.isUpdating.set(!1))).subscribe({next:()=>this.closed.emit()})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=M({type:i,selectors:[["app-change-passphrase-alert-dialog"]],outputs:{closed:"closed"},decls:23,vars:7,consts:()=>{let n;n=$localize`Enter new password`;let e;e=$localize`Repeat password`;let t;t=$localize`Password have to be filled and have to match`;let s;s=$localize`Change passphrase`;let l;l=$localize` Duplicati needs to be secured with a passphrase and a random passphrase has been generated for you. ${"[\uFFFD#6\uFFFD\uFFFD/#6\uFFFD|\uFFFD#7\uFFFD\uFFFD/#7\uFFFD]"}:LINE_BREAK:${"[\uFFFD#6\uFFFD\uFFFD/#6\uFFFD|\uFFFD#7\uFFFD\uFFFD/#7\uFFFD]"}:LINE_BREAK: If you open Duplicati from the tray icon, you do not need a passphrase, but if you plan to open it from another location you need to set a passphrase you know. Do you want to set a passphrase now? `,l=G(l);let P;P=$localize`Passphrase`;let I;I=$localize`Repeat passphrase`;let v;v=$localize`Not now thanks`;let A;A=$localize` Yes, update passphrase now `;let Z;return Z=$localize` Yes, update passphrase now `,[s,l,P,I,v,A,Z,["header",""],["content",""],["type","warning"],["for","password"],["type","password","name","password","autocomplete","disabled","placeholder",n,"tabindex","1",3,"ngModelChange","ngModel"],["for","repeatPassword"],["type","password","name","repeatPassword","autocomplete","disabled","placeholder",e,"tabindex","2",3,"ngModelChange","disabled","ngModel"],["suffix","",1,"sh-success"],["suffix",""],["footer",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"loader"],["shButton","","shTooltip",t,1,"raised","primary",3,"loader","disabled"],["shButton","",1,"raised","primary",3,"click"],["shButton","","shTooltip",t,1,"raised","primary",3,"click","disabled"]]},template:function(e,t){e&1&&(a(0,"header",7)(1,"h3"),f(2,0),o()(),a(3,"div",8)(4,"sh-alert",9),g(5,1),_(6,"br")(7,"br"),C(),o(),a(8,"sh-form-field")(9,"label",10),f(10,2),o(),a(11,"input",11),H("ngModelChange",function(l){return $(t.passphrase,l)||(t.passphrase=l),l}),o()(),a(12,"sh-form-field")(13,"label",12),f(14,3),o(),a(15,"input",13),H("ngModelChange",function(l){return $(t.repeatPassphrase,l)||(t.repeatPassphrase=l),l}),o(),d(16,et,2,0,"sh-icon",14)(17,tt,2,0,"sh-icon",15),o()(),a(18,"footer",16)(19,"button",17),T("click",function(){return t.cancel()}),f(20,4),o(),d(21,nt,2,2,"button",18)(22,it,2,3,"button",19),o()),e&2&&(r(11),y("ngModel",t.passphrase),r(4),O("disabled",t.passphrase().length===0),y("ngModel",t.repeatPassphrase),r(),p(t.passphrase().length!==0&&t.passphrase()===t.repeatPassphrase()?16:17),r(3),k("loader",t.isUpdating()),r(2),p(t.passphrase().length!==0&&t.passphrase()===t.repeatPassphrase()?21:22))},dependencies:[Fe,Te,he,Ee,B,Ie,D,De,R],styles:["[_nghost-%COMP%]{display:block;--dialog-p: 1.5rem}[content][_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}"],changeDetection:0})};var ot=()=>({exact:!0});function at(i,n){i&1&&(a(0,"sh-icon",26),u(1,"x-bold"),o())}function st(i,n){i&1&&(a(0,"sh-icon",27),u(1,"list-bold"),o())}function rt(i,n){if(i&1){let e=E();ie(0,9),a(1,"button",25),T("click",function(){m(e);let s=c();return h(s.toggleNav())}),d(2,at,2,0,"sh-icon",26)(3,st,2,0,"sh-icon",27),o(),oe()}if(i&2){let e=c();r(2),p(e.isNavOpen()?2:3)}}function lt(i,n){i&1&&(a(0,"sh-icon"),u(1,"sun"),o())}function _t(i,n){i&1&&(a(0,"sh-icon"),u(1,"moon"),o())}function ct(i,n){if(i&1){let e=E();a(0,"button",28),T("click",function(){m(e);let s=c();return h(s.logout())}),g(1,7),_(2,"sh-icon"),C(),o()}}var K=class i{#e=S(we);#t=S(Y);#i=S(Ge);#o=S(Ce);#a=S(fe);#s=S(V);#r=S(ve);#l=S(be);#n=S(Re);relayIsEnabled=this.#o.relayIsEnabled;isDarkMode=this.#e.isDarkMode;isNavOpen=this.#e.isNavOpen;isMobile=this.#e.isMobile;sidenavType=this.#e.sidenavType;machineName=U(()=>{let n=this.#l.serverSettings();if(n&&n["--machine-name"])return n["--machine-name"];if(n&&n["machine-name"])return n["machine-name"];let e=this.#n.allOptions().find(t=>t.name==="machine-name");return e&&e.defaultValue?e.defaultValue:this.#n.systemInfo()?.MachineName??"Unknown"});ngOnInit(){return this.#s.init(),this.#i.getBackups(!0),this.#t.getApiV1Serversettings().subscribe({next:n=>{let e=n["autogenerated-passphrase"]==="True",t=n["has-asked-for-password-change"]==="True";e&&!t&&this.#a.open(J,{maxWidth:"500px"})}})}toggleNav(){this.#e.toggleNav()}toggleBodyClass(){this.#e.toggleBodyClass()}changeDefaultClientTo(n){this.#_(n),window.location.replace(`/${n}`)}logout(){this.#r.logout()}#_(n){var e=new Date;e.setTime(e.getTime()+2160*60*60*1e3),document.cookie="default-client="+n+"; expires="+e.toUTCString()+"; path=/"}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=M({type:i,selectors:[["app-layout"]],decls:42,vars:12,consts:()=>{let n;n=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SH_ICON:house${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SH_ICON: Home `;let e;e=$localize`${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:database${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON: Add backup `;let t;t=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:clock-counter-clockwise${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Restore `;let s;s=$localize`${"\uFFFD#20\uFFFD"}:START_TAG_SH_ICON:gear${"\uFFFD/#20\uFFFD"}:CLOSE_TAG_SH_ICON: Settings `;let l;l=$localize`${"\uFFFD#30\uFFFD"}:START_TAG_SH_ICON:info${"\uFFFD/#30\uFFFD"}:CLOSE_TAG_SH_ICON: About Duplicati `;let P;P=$localize`${"\uFFFD#33\uFFFD"}:START_TAG_SH_ICON:files${"[\uFFFD/#33\uFFFD|\uFFFD/#34\uFFFD]"}:CLOSE_TAG_SH_ICON: Documentation ${"\uFFFD#34\uFFFD"}:START_TAG_SH_ICON_1:arrow-square-out${"[\uFFFD/#33\uFFFD|\uFFFD/#34\uFFFD]"}:CLOSE_TAG_SH_ICON:`,P=G(P);let I;I=$localize`${"\uFFFD#37\uFFFD"}:START_TAG_SH_ICON:chats-circle${"[\uFFFD/#37\uFFFD|\uFFFD/#38\uFFFD]"}:CLOSE_TAG_SH_ICON: Visit forum ${"\uFFFD#38\uFFFD"}:START_TAG_SH_ICON_1:arrow-square-out${"[\uFFFD/#37\uFFFD|\uFFFD/#38\uFFFD]"}:CLOSE_TAG_SH_ICON:`,I=G(I);let v;return v=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:sign-out${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Log out `,[n,e,t,s,l,P,I,v,[3,"isOpenChange","isOpen","disableDrag"],["sidenav-closed-topbar",""],["sidenav",""],["shButton","",1,"icon","small",3,"click"],[1,"base-1","primary"],["action","","routerLink","/","routerLinkActive","active",3,"routerLinkActiveOptions"],["action","","routerLink","/add-backup","routerLinkActive","active"],["action","","routerLink","/restore","routerLinkActive","active"],["action","","routerLink","/settings","routerLinkActive","active"],[1,"spacer"],[1,"base-1l","primary"],["action","",1,"machine-name",3,"title"],["action","","routerLink","/about","routerLinkActive","active"],["href","https://docs.duplicati.com","target","_blank","action",""],["suffix",""],["href","https://forum.duplicati.com","target","_blank","action",""],["action",""],["shButton","",1,"small","toggle-sidebar",3,"click"],[1,"cross"],[1,"burger"],["action","",3,"click"]]},template:function(e,t){e&1&&(a(0,"sh-sidenav",8),H("isOpenChange",function(l){return $(t.isNavOpen,l)||(t.isNavOpen=l),l}),d(1,rt,4,1,"ng-container",9),a(2,"div",10)(3,"header"),_(4,"app-logo"),a(5,"button",11),T("click",function(){return t.toggleBodyClass()}),d(6,lt,2,0,"sh-icon")(7,_t,2,0,"sh-icon"),o()(),a(8,"sh-list",12)(9,"button",13),g(10,0),_(11,"sh-icon"),C(),o(),a(12,"button",14),g(13,1),_(14,"sh-icon"),C(),o(),a(15,"button",15),g(16,2),_(17,"sh-icon"),C(),o(),a(18,"button",16),g(19,3),_(20,"sh-icon"),C(),o()(),_(21,"div",17),a(22,"sh-list",18)(23,"div",19)(24,"sh-icon"),u(25,"desktop"),o(),u(26),o(),_(27,"sh-divider"),a(28,"button",20),g(29,4),_(30,"sh-icon"),C(),o(),a(31,"a",21),g(32,5),_(33,"sh-icon")(34,"sh-icon",22),C(),o(),a(35,"a",23),g(36,6),_(37,"sh-icon")(38,"sh-icon",22),C(),o(),d(39,ct,3,0,"button",24),o()(),_(40,"router-outlet")(41,"app-service-hub"),o()),e&2&&(L(t.sidenavType()),y("isOpen",t.isNavOpen),O("disableDrag",!0),r(),p(t.isMobile()?1:-1),r(5),p(t.isDarkMode()?6:7),r(3),O("routerLinkActiveOptions",ce(11,ot)),r(14),O("title",_e(t.machineName())),r(3),b(" ",t.machineName()," "),r(13),p(t.relayIsEnabled()?-1:39))},dependencies:[pe,Se,ge,Me,D,Le,R,Pe,x,ye],styles:["[_nghost-%COMP%]{height:100vh;width:100%;overflow:hidden}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1.25rem;gap:.75rem}.toggle-sidebar[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center;justify-content:center}.toggle-sidebar[_ngcontent-%COMP%] .cross[_ngcontent-%COMP%], .toggle-sidebar[_ngcontent-%COMP%] .burger[_ngcontent-%COMP%]{opacity:1;transition:opacity 124ms linear;margin:0}.toggle-sidebar[_ngcontent-%COMP%] .cross.hidden[_ngcontent-%COMP%], .toggle-sidebar[_ngcontent-%COMP%] .burger.hidden[_ngcontent-%COMP%]{opacity:0}.toggle-sidebar[_ngcontent-%COMP%] .burger[_ngcontent-%COMP%]{position:absolute;inset:auto}h3[title][_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}div[sidenav][_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100vh}.machine-name[_ngcontent-%COMP%]{margin:0;cursor:default}"],changeDetection:0})};export{K as default};
@@ -0,0 +1 @@
1
+ import"./chunk-7CGTOI24.js";var o=[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"destination",loadComponent:()=>import("./chunk-5I4CGX7S.js")},{path:"encryption",loadComponent:()=>import("./chunk-UNZWYG3U.js")},{path:"select-files",loadComponent:()=>import("./chunk-5FCREC3N.js")},{path:"options",loadComponent:()=>import("./chunk-YN3R7XGF.js")},{path:":taskid/progress",loadComponent:()=>import("./chunk-IFP4WWLK.js")}],t=o;export{t as default};
@@ -0,0 +1 @@
1
+ import{a as R}from"./chunk-B62TPRVG.js";import{a as P}from"./chunk-SZUNW4JO.js";import{a as B}from"./chunk-HSHF5HR7.js";import{b as _}from"./chunk-ZU6T3TW3.js";import{a as $}from"./chunk-HUZXJWCG.js";import{z as S}from"./chunk-UNMDSCAN.js";import{c as z}from"./chunk-CFNARBNK.js";import{E as u,K as h,Mc as c,R as k,W as l,l as d,la as n,na as f,p as m}from"./chunk-26Z7TPJB.js";import{a,b as s}from"./chunk-7CGTOI24.js";var b={Starting_Operation:$localize`Starting operation …`,Backup_Begin:$localize`Starting backup …`,Backup_PreBackupVerify:$localize`Verifying backend data …`,Backup_PostBackupTest:$localize`Verifying remote data …`,Backup_PreviousBackupFinalize:$localize`Completing previous backup …`,Backup_ProcessingFiles:$localize`Processing files to backup …`,Backup_Finalize:$localize`Completing backup …`,Backup_WaitForUpload:$localize`Waiting for upload to finish …`,Backup_Delete:$localize`Deleting unwanted files …`,Backup_Compact:$localize`Compacting remote data …`,Backup_VerificationUpload:$localize`Uploading verification file …`,Backup_PostBackupVerify:$localize`Verifying backend data …`,Backup_Lock:$localize`Locking remote data …`,Backup_Complete:$localize`Backup complete!`,Restore_Begin:$localize`Starting restore …`,Restore_RecreateDatabase:$localize`Rebuilding local database …`,Restore_PreRestoreVerify:$localize`Verifying remote data …`,Restore_CreateFileList:$localize`Building list of files to restore …`,Restore_CreateTargetFolders:$localize`Creating target folders …`,Restore_ScanForExistingFiles:$localize`Scanning existing files …`,Restore_ScanForLocalBlocks:$localize`Scanning for local blocks …`,Restore_PatchWithLocalBlocks:$localize`Patching files with local blocks …`,Restore_Download:$localize`Downloading files …`,Restore_PatchWithRemoteFiles:$localize`Patching files with remote data …`,Restore_VerifyRestoredFiles:$localize`Verifying restored files …`,Restore_Finaluze:$localize`Finalizing restore …`,Restore_Complete:$localize`Restore complete!`,Recreate_Begin:$localize`Starting database recreate …`,Recreate_Delete:$localize`Deleting old database …`,Recreate_Create:$localize`Creating new database …`,Recreate_Download:$localize`Downloading files …`,Recreate_Process:$localize`Processing files …`,Recreate_Complete:$localize`Database recreate complete!`,Verify_Begin:$localize`Starting verification …`,Verify_Download:$localize`Downloading files …`,Verify_Process:$localize`Processing files …`,Verify_Complete:$localize`Verification complete!`,BugReport_Begin:$localize`Starting bug report …`,BugReport_Gathering:$localize`Gathering information …`,BugReport_Complete:$localize`Bug report complete!`,List_Begin:$localize`Starting list …`,List_Download:$localize`Downloading files …`,List_Process:$localize`Processing files …`,List_Complete:$localize`List complete!`,Delete_Begin:$localize`Starting delete …`,Delete_Download:$localize`Downloading files …`,Delete_Process:$localize`Processing files …`,Delete_Complete:$localize`Delete complete!`,Compact_Begin:$localize`Starting compact …`,Compact_Download:$localize`Downloading files …`,Compact_Process:$localize`Processing files …`,Compact_Complete:$localize`Compact complete!`,Restore_DownloadingRemoteFiles:$localize`Downloading files …`,Restore_PostRestoreVerify:$localize`Verifying restored files …`,Recreate_Running:$localize`Recreating database …`,Vacuum_Running:$localize`Vacuuming database …`,Repair_Running:$localize`Repairing database …`,Verify_Running:$localize`Verifying files …`,BugReport_Running:$localize`Creating bug report …`,Delete_Listing:$localize`Listing remote files …`,Delete_Deleting:$localize`Deleting remote files …`,PurgeFiles_Begin:$localize`Listing remote files for purge …`,PurgeFiles_Process:$localize`Purging files …`,PurgeFiles_Compact:$localize`Compacting remote data …`,PurgeFiles_Complete:$localize`Purging files complete!`,ReadLockInfo_Running:$localize`Reading lock info …`,Error:$localize`Error!`};var D=class g{#i=l(P);#t=l(z);#o=l(R);#e=l(_);#c=l(S);#g=l($);#l=n(!1);#a=n(null);statusData=this.#a.asReadonly();lastState=null;serverState=c(()=>{let e=this.#e.serverState();return e?(e.ProposedSchedule=e.ProposedSchedule?.map(i=>s(a({},i),{backup:i.Item1?this.#o.getBackupById(i.Item1):null}))??null,this.lastState=e,e):this.lastState});hasProgressOnWebsocket=c(()=>this.#g.hasProgressSubscribeOption()&&this.#e.getConnectionMethod()==="websocket");clientIsRunning=c(()=>this.serverState()?.ProgramState==="Running");isResuming=n(!1);isFetching=this.#l.asReadonly();connectionStatus=this.#e.connectionStatus;pollingInterval;#f=f(()=>{let e=this.#e.serverState();e?.ActiveTask||this.#o.getBackups(!0),this.hasProgressOnWebsocket()&&(this.#e.subscribe("progress"),this.#e.subscribe("taskqueue")),e?.ActiveTask&&this.pollingInterval===void 0?this.startPollingProgress():e?.ActiveTask||this.stopPollingProgress()});#d=f(()=>{let e=this.#e.progressState(),i=this.#e.taskQueueState();if(e){let t=i?.find(o=>o.ID===e.TaskID)??null;this.#r(s(a({},e),{task:t}))}});setConnectionMethod(e){this.#e.setConnectionMethod(e)}startPollingProgress(){this.hasProgressOnWebsocket()?this.#e.subscribe("progress"):this.pollingInterval=setInterval(()=>{this.#s()},1e3)}stopPollingProgress(){clearInterval(this.pollingInterval)}fetchProgressState(){this.#s()}pauseResume(){return this.isResuming.set(!0),this.#t.postApiV1ServerstateResume().pipe(u(()=>this.isResuming.set(!1)))}resumeDialogCheck(e){if(!this.clientIsRunning()){this.#c.open(B,{data:{title:$localize`Server paused`,message:$localize`Server is currently paused. Do you want to resume now?`,confirmText:$localize`Resume`,cancelText:$localize`No, I'll resume later`},closed:i=>{i&&this.pauseResume().subscribe({next:()=>{e()}})}});return}e()}#s(){this.#l.set(!0),this.#t.getApiV1Progressstate().pipe(h(e=>{let i=e.TaskID??null;return i===null?d(e):this.#t.getApiV1TaskByTaskid({taskid:i}).pipe(m(t=>s(a({},e),{task:t??null})))}),u(()=>this.#l.set(!1))).subscribe({next:e=>{this.#r(e),this.serverState()?.ActiveTask==null&&this.stopPollingProgress()},error:e=>{e.status===404&&this.stopPollingProgress()}})}#r(e){let i=e.TaskID??null,t=e.BackupID??null;i!==null&&t!==null&&(e.backup=this.#o.getBackupById(t)),this.#a.set(s(a({},e),{progress:this.#p(e),statusText:this.#u(e),actionText:e.backup?.Backup?.Name??$localize`Running task`}))}#p(e){let i=-1;if(e.task&&e)if(e.Phase==="Backup_ProcessingFiles"||e.Phase==="Restore_DownloadingRemoteFiles")if(e.StillCounting)i=0;else{let t=e.CurrentFilecomplete?0:e.CurrentFileoffset,o=e.TotalFileCount-e.ProcessedFileCount,r=e.TotalFileSize-e.ProcessedFileSize-t;i=(e.ProcessedFileSize+t)/e.TotalFileSize,e.ProcessedFileCount===0?i=0:i>=.9&&(i=.9)}else e.Phase==="Backup_Finalize"||e.Phase==="Backup_WaitForUpload"?i=.9:e.Phase==="Backup_Delete"||e.Phase==="Backup_Compact"?i=.95:e.Phase==="Backup_VerificationUpload"||e.Phase==="Backup_PostBackupVerify"?i=.98:e.Phase==="Backup_Complete"?i=1:e.OverallProgress>0&&(i=e.OverallProgress);return i}#n(e){let i=(e.ActiveTransfers??[]).map(o=>o.BackendSpeed).reduce((o,r)=>(o??0)+(r??0),0)??-1,t=i<=0?e.BackendSpeed:i;return(t??-1)<0?"":` at ${this.#i.transform(t)}/s`}#u(e){let i="Running \u2026";if(e.task&&e){if(i=e.Phase?b[e.Phase]??e.Phase:"Running \u2026",e.TotalFileCount===0)return i;if(e.Phase==="Backup_ProcessingFiles"||e.Phase==="Restore_DownloadingRemoteFiles")if(e.StillCounting)i=`Counting (${e.TotalFileCount} files found, ${this.#i.transform(e.TotalFileSize)})`;else{let t=e.CurrentFilecomplete?0:e.CurrentFileoffset,o=e.TotalFileCount-e.ProcessedFileCount,r=e.TotalFileSize-e.ProcessedFileSize-t,C=e.Phase==="Restore_DownloadingRemoteFiles"?"Restoring: ":"",p=this.#n(e);e.Phase==="Backup_ProcessingFiles"&&o===0?i=`Completing upload ${p}`:e.BackendIsBlocking??!1?i=`Waiting for transfers ${p}`:i=`${C}${o} files (${this.#i.transform(r)}) to go ${p}`}else if(e.Phase==="Backup_WaitForUpload"){let t=this.#n(e);t!==""&&(i=`Waiting for upload to finish ${t}`)}}return i}static \u0275fac=function(i){return new(i||g)};static \u0275prov=k({token:g,factory:g.\u0275fac,providedIn:"root"})};export{b as a,D as b};
@@ -1 +1 @@
1
- import{a as F}from"./chunk-ZMSYEF6G.js";import{a as te}from"./chunk-HSHF5HR7.js";import{e as ee}from"./chunk-7TWUW4XJ.js";import{B as Q,L as Y,w as K,x as W,z as q}from"./chunk-UNMDSCAN.js";import{a as H,c as Z}from"./chunk-CFNARBNK.js";import{b as U,d as j}from"./chunk-I27PVH6D.js";import{$ as p,Ab as c,Bb as S,Fb as y,Gb as D,Ib as f,Ma as x,Mc as h,Pa as r,Pb as G,Qb as V,Rb as _,Rc as A,Vb as u,W as d,Xb as s,aa as I,cb as E,ic as z,jc as P,kc as L,la as v,lc as J,rc as X,sb as N,sc as B,tb as T,tc as g,wb as b,xb as k,yb as m,zb as a}from"./chunk-26Z7TPJB.js";function ae(n,t){if(n&1&&(a(0,"div",11),P(1),c()),n&2){s();let e=g(0);r(),J(" ",e.Message," ")}}function re(n,t){if(n&1&&(a(0,"div"),G(1,1),S(2,"a",15),V(),c()),n&2){let e=s();r(2),m("href",e.downloadLink(),x)}}function le(n,t){if(n&1){let e=f();a(0,"button",14),u("click",function(){p(e);let i=s(),l=g(0);return I(i.doRepair(l.BackupID))}),_(1,2),c()}}function ce(n,t){if(n&1){let e=f();a(0,"button",14),u("click",function(){p(e);let i=s(),l=g(0);return I(i.doDownloadBugreport(l))}),_(1,3),c()}}function _e(n,t){if(n&1&&S(0,"sh-progress-bar",17),n&2){let e,o=s(2);m("value",(e=o.serverState())==null?null:e.UpdateDownloadProgress)}}function se(n,t){if(n&1){let e=f();a(0,"div",11),y(1),_(2,4),D(),a(3,"a",16),P(4),c(),N(5,_e,1,1,"sh-progress-bar",17),a(6,"button",14),u("click",function(){p(e);let i=s();return I(i.doShowUpdate())}),_(7,5),c()()}if(n&2){let e,o,i=s(),l=g(0);r(3),m("href",(e=i.serverState())==null?null:e.UpdateDownloadLink,x),r(),L(l.Message),r(),T(((o=i.serverState())==null?null:o.UpdaterState)==="Downloading"?5:-1)}}function de(n,t){if(n&1){let e=f();a(0,"button",14),u("click",function(){p(e);let i=s(),l=g(0);return I(i.doShowLog(l.BackupID))}),_(1,6),c()}}function Ne(n,t){if(n&1){let e=f();a(0,"button",14),u("click",function(){p(e);let i=s();return I(i.doShowLink("https://docs.duplicati.com/detailed-descriptions/the-server-database"))}),_(1,7),c()}}function Te(n,t){if(n&1){let e=f();a(0,"button",14),u("click",function(){p(e);let i=s();return I(i.doShowLink("https://docs.duplicati.com/detailed-descriptions/the-server-database"))}),_(1,8),c()}}var Ce={Error:"error",Warning:"warn",Information:"primary"},M=class n{#e=d(j);#a=d(U);#r=d(q);#t=d(W);#i=d(F);#n=d(Z);#l=d(ee);#o=v(null);serverState=this.#i.serverState;index=A.required();notification=A.required();downloadLink=h(()=>this.#o()||this.notification().DownloadLink||"");deleteNotificationByIndex(){this.#i.deleteNotification(this.index())}deleteAllNotifications(){this.#i.deleteAllNotifications()}getAlertType(t){return t&&Ce[t]||"primary"}doShowLog(t){this.#n.getApiV1BackupByIdIsactive({id:t}).subscribe({next:e=>{this.#e.navigate(["/backup/"+t+"/log"])},error:e=>{if(e.status===404){let o={title:$localize`Error`,message:$localize`The backup is missing, has it been deleted?`,confirmText:$localize`OK`,cancelText:null};parseInt(t)+""!=t&&(o={title:$localize`Error`,message:$localize`The backup was temporary and does not exist anymore, so the log data is lost`,confirmText:$localize`OK`,cancelText:null}),this.#r.open(te,{maxWidth:"550px",width:"100%",data:o})}else this.#t.error($localize`Failed to find backup: `+e.message)}})}doRepair(t){this.#n.postApiV1BackupByIdRepair({id:t}).subscribe({next:()=>{this.#t.success($localize`Backup repaired`),this.#e.navigate(["./"],{onSameUrlNavigation:"reload",relativeTo:this.#a})},error:e=>{this.#t.error($localize`Failed to repair backup: `+e.message)}})}doShowUpdate(){this.#e.navigate(["/about/changelog"])}doShowLink(t){window.open(t,"_blank")}doDownloadBugreport(t){let e=t.Action.slice(19);this.#n.postApiV1AuthIssuetokenByOperation({operation:"bugreport"}).subscribe({next:o=>{if(!o.Token){this.#t.error("Failed to get bug report URL: No token generated");return}let i=H.BASE||"",l=this.#l.xsrfQueryParam(),O=`${location.origin}${i}/api/v1/bugreport/${e}?token=${o.Token}${l?`&${l}`:""}`;t.DownloadLink=O,this.#o.set(O),this.triggerDownload(O)},error:o=>{this.#t.error(`Failed to get bug report URL: ${o.message}`)}})}triggerDownload(t){let e=document.createElement("a");e.href=t,e.download="",e.style.display="none",document.body.appendChild(e);try{e.click()}catch{}document.body.removeChild(e)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=E({type:n,selectors:[["app-notification"]],inputs:{index:[1,"index"],notification:[1,"notification"]},decls:16,vars:12,consts:()=>{let t;t=$localize`Dismiss`;let e;e=$localize` If the backup file was not downloaded automatically, ${"\uFFFD#2\uFFFD"}:START_LINK:right click and choose "Save as …"${"\uFFFD/#2\uFFFD"}:CLOSE_LINK:`;let o;o=$localize`Repair`;let i;i=$localize`Download`;let l;l=$localize`New update found:`;let O;O=$localize`Show Update`;let w;w=$localize`Show Log`;let $;$=$localize` Show Help `;let R;return R=$localize` Show Help `,[t,e,o,i,l,O,w,$,R,["ship-alert-title",""],["ship-alert-content","",1,"content"],[1,"message"],[1,"actions"],["shButton","",1,"small","outlined"],["shButton","",1,"small","outlined",3,"click"],["target","_blank",3,"href"],[3,"href"],[3,"value"]]},template:function(e,o){if(e&1){let i=f();X(0),a(1,"sh-alert")(2,"div",9),P(3),c(),a(4,"div",10),N(5,ae,2,1,"div",11),N(6,re,3,1,"div"),a(7,"div",12),N(8,le,2,0,"button",13),N(9,ce,2,0,"button",13),N(10,se,8,3,"div",11),N(11,de,2,0,"button",13),N(12,Ne,2,0,"button",13),N(13,Te,2,0,"button",13),a(14,"button",14),u("click",function(){return p(i),I(o.deleteNotificationByIndex())}),_(15,0),c()()()()}if(e&2){let i=B(o.notification());r(),z(o.getAlertType(i.Type)),r(2),L(i.Title),r(2),T(i.Action!=="update:new"&&i.Action!=="update:manual"?5:-1),r(),T(o.downloadLink()?6:-1),r(2),T(i.Message!=null&&i.Message.includes("please run repair")?8:-1),r(),T(i.Action!=null&&i.Action.startsWith("bug-report:created:")&&!o.downloadLink()?9:-1),r(),T(i.Action==="update:new"?10:-1),r(),T(i.Action==="backup:show-log"?11:-1),r(),T(i.Action==="config:issue:unencrypted-database"?12:-1),r(),T(i.Action==="config:issue:windows-folder-used"?13:-1)}},dependencies:[Y,Q,K],styles:["[_nghost-%COMP%]{display:block}.content[_ngcontent-%COMP%]{margin-top:.5rem;display:flex;flex-direction:column;gap:.5rem}.message[_ngcontent-%COMP%]{max-height:12.5rem;overflow:auto}"],changeDetection:0})};var pe=(n,t)=>t.ID;function Ie(n,t){if(n&1&&S(0,"app-notification",1),n&2){let e=t.$implicit,o=t.$index;m("index",o)("notification",e)}}function fe(n,t){n&1&&(a(0,"div",2)(1,"p"),_(2,0),c()())}var ie=class n{#e=d(F);notificationFilterPredicate=A();notifications=h(()=>{let t=this.notificationFilterPredicate()?.predicate,e=this.#e.notifications();return typeof t!="function"?e:e.filter(t)});static \u0275fac=function(e){return new(e||n)};static \u0275cmp=E({type:n,selectors:[["app-notifications"]],inputs:{notificationFilterPredicate:[1,"notificationFilterPredicate"]},decls:3,vars:1,consts:()=>{let t;return t=$localize`No more notifications`,[t,[3,"index","notification"],[1,"notification-list"]]},template:function(e,o){e&1&&b(0,Ie,1,2,"app-notification",1,pe,!1,fe,3,0,"div",2),e&2&&k(o.notifications())},dependencies:[M],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.actions[_ngcontent-%COMP%]{display:flex;gap:.25rem;justify-content:flex-end}.notification-list[_ngcontent-%COMP%]{padding:1rem;display:flex;flex-direction:column;gap:1rem;text-align:center}"],changeDetection:0})};export{M as a,ie as b};
1
+ import{a as F}from"./chunk-GRVTXORM.js";import{a as te}from"./chunk-HSHF5HR7.js";import{e as ee}from"./chunk-7TWUW4XJ.js";import{B as Q,L as Y,w as K,x as W,z as q}from"./chunk-UNMDSCAN.js";import{a as H,c as Z}from"./chunk-CFNARBNK.js";import{b as U,d as j}from"./chunk-I27PVH6D.js";import{$ as p,Ab as c,Bb as S,Fb as y,Gb as D,Ib as f,Ma as x,Mc as h,Pa as r,Pb as G,Qb as V,Rb as _,Rc as A,Vb as u,W as d,Xb as s,aa as I,cb as E,ic as z,jc as P,kc as L,la as v,lc as J,rc as X,sb as N,sc as B,tb as T,tc as g,wb as b,xb as k,yb as m,zb as a}from"./chunk-26Z7TPJB.js";function ae(n,t){if(n&1&&(a(0,"div",11),P(1),c()),n&2){s();let e=g(0);r(),J(" ",e.Message," ")}}function re(n,t){if(n&1&&(a(0,"div"),G(1,1),S(2,"a",15),V(),c()),n&2){let e=s();r(2),m("href",e.downloadLink(),x)}}function le(n,t){if(n&1){let e=f();a(0,"button",14),u("click",function(){p(e);let i=s(),l=g(0);return I(i.doRepair(l.BackupID))}),_(1,2),c()}}function ce(n,t){if(n&1){let e=f();a(0,"button",14),u("click",function(){p(e);let i=s(),l=g(0);return I(i.doDownloadBugreport(l))}),_(1,3),c()}}function _e(n,t){if(n&1&&S(0,"sh-progress-bar",17),n&2){let e,o=s(2);m("value",(e=o.serverState())==null?null:e.UpdateDownloadProgress)}}function se(n,t){if(n&1){let e=f();a(0,"div",11),y(1),_(2,4),D(),a(3,"a",16),P(4),c(),N(5,_e,1,1,"sh-progress-bar",17),a(6,"button",14),u("click",function(){p(e);let i=s();return I(i.doShowUpdate())}),_(7,5),c()()}if(n&2){let e,o,i=s(),l=g(0);r(3),m("href",(e=i.serverState())==null?null:e.UpdateDownloadLink,x),r(),L(l.Message),r(),T(((o=i.serverState())==null?null:o.UpdaterState)==="Downloading"?5:-1)}}function de(n,t){if(n&1){let e=f();a(0,"button",14),u("click",function(){p(e);let i=s(),l=g(0);return I(i.doShowLog(l.BackupID))}),_(1,6),c()}}function Ne(n,t){if(n&1){let e=f();a(0,"button",14),u("click",function(){p(e);let i=s();return I(i.doShowLink("https://docs.duplicati.com/detailed-descriptions/the-server-database"))}),_(1,7),c()}}function Te(n,t){if(n&1){let e=f();a(0,"button",14),u("click",function(){p(e);let i=s();return I(i.doShowLink("https://docs.duplicati.com/detailed-descriptions/the-server-database"))}),_(1,8),c()}}var Ce={Error:"error",Warning:"warn",Information:"primary"},M=class n{#e=d(j);#a=d(U);#r=d(q);#t=d(W);#i=d(F);#n=d(Z);#l=d(ee);#o=v(null);serverState=this.#i.serverState;index=A.required();notification=A.required();downloadLink=h(()=>this.#o()||this.notification().DownloadLink||"");deleteNotificationByIndex(){this.#i.deleteNotification(this.index())}deleteAllNotifications(){this.#i.deleteAllNotifications()}getAlertType(t){return t&&Ce[t]||"primary"}doShowLog(t){this.#n.getApiV1BackupByIdIsactive({id:t}).subscribe({next:e=>{this.#e.navigate(["/backup/"+t+"/log"])},error:e=>{if(e.status===404){let o={title:$localize`Error`,message:$localize`The backup is missing, has it been deleted?`,confirmText:$localize`OK`,cancelText:null};parseInt(t)+""!=t&&(o={title:$localize`Error`,message:$localize`The backup was temporary and does not exist anymore, so the log data is lost`,confirmText:$localize`OK`,cancelText:null}),this.#r.open(te,{maxWidth:"550px",width:"100%",data:o})}else this.#t.error($localize`Failed to find backup: `+e.message)}})}doRepair(t){this.#n.postApiV1BackupByIdRepair({id:t}).subscribe({next:()=>{this.#t.success($localize`Backup repaired`),this.#e.navigate(["./"],{onSameUrlNavigation:"reload",relativeTo:this.#a})},error:e=>{this.#t.error($localize`Failed to repair backup: `+e.message)}})}doShowUpdate(){this.#e.navigate(["/about/changelog"])}doShowLink(t){window.open(t,"_blank")}doDownloadBugreport(t){let e=t.Action.slice(19);this.#n.postApiV1AuthIssuetokenByOperation({operation:"bugreport"}).subscribe({next:o=>{if(!o.Token){this.#t.error("Failed to get bug report URL: No token generated");return}let i=H.BASE||"",l=this.#l.xsrfQueryParam(),O=`${location.origin}${i}/api/v1/bugreport/${e}?token=${o.Token}${l?`&${l}`:""}`;t.DownloadLink=O,this.#o.set(O),this.triggerDownload(O)},error:o=>{this.#t.error(`Failed to get bug report URL: ${o.message}`)}})}triggerDownload(t){let e=document.createElement("a");e.href=t,e.download="",e.style.display="none",document.body.appendChild(e);try{e.click()}catch{}document.body.removeChild(e)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=E({type:n,selectors:[["app-notification"]],inputs:{index:[1,"index"],notification:[1,"notification"]},decls:16,vars:12,consts:()=>{let t;t=$localize`Dismiss`;let e;e=$localize` If the backup file was not downloaded automatically, ${"\uFFFD#2\uFFFD"}:START_LINK:right click and choose "Save as …"${"\uFFFD/#2\uFFFD"}:CLOSE_LINK:`;let o;o=$localize`Repair`;let i;i=$localize`Download`;let l;l=$localize`New update found:`;let O;O=$localize`Show Update`;let w;w=$localize`Show Log`;let $;$=$localize` Show Help `;let R;return R=$localize` Show Help `,[t,e,o,i,l,O,w,$,R,["ship-alert-title",""],["ship-alert-content","",1,"content"],[1,"message"],[1,"actions"],["shButton","",1,"small","outlined"],["shButton","",1,"small","outlined",3,"click"],["target","_blank",3,"href"],[3,"href"],[3,"value"]]},template:function(e,o){if(e&1){let i=f();X(0),a(1,"sh-alert")(2,"div",9),P(3),c(),a(4,"div",10),N(5,ae,2,1,"div",11),N(6,re,3,1,"div"),a(7,"div",12),N(8,le,2,0,"button",13),N(9,ce,2,0,"button",13),N(10,se,8,3,"div",11),N(11,de,2,0,"button",13),N(12,Ne,2,0,"button",13),N(13,Te,2,0,"button",13),a(14,"button",14),u("click",function(){return p(i),I(o.deleteNotificationByIndex())}),_(15,0),c()()()()}if(e&2){let i=B(o.notification());r(),z(o.getAlertType(i.Type)),r(2),L(i.Title),r(2),T(i.Action!=="update:new"&&i.Action!=="update:manual"?5:-1),r(),T(o.downloadLink()?6:-1),r(2),T(i.Message!=null&&i.Message.includes("please run repair")?8:-1),r(),T(i.Action!=null&&i.Action.startsWith("bug-report:created:")&&!o.downloadLink()?9:-1),r(),T(i.Action==="update:new"?10:-1),r(),T(i.Action==="backup:show-log"?11:-1),r(),T(i.Action==="config:issue:unencrypted-database"?12:-1),r(),T(i.Action==="config:issue:windows-folder-used"?13:-1)}},dependencies:[Y,Q,K],styles:["[_nghost-%COMP%]{display:block}.content[_ngcontent-%COMP%]{margin-top:.5rem;display:flex;flex-direction:column;gap:.5rem}.message[_ngcontent-%COMP%]{max-height:12.5rem;overflow:auto}"],changeDetection:0})};var pe=(n,t)=>t.ID;function Ie(n,t){if(n&1&&S(0,"app-notification",1),n&2){let e=t.$implicit,o=t.$index;m("index",o)("notification",e)}}function fe(n,t){n&1&&(a(0,"div",2)(1,"p"),_(2,0),c()())}var ie=class n{#e=d(F);notificationFilterPredicate=A();notifications=h(()=>{let t=this.notificationFilterPredicate()?.predicate,e=this.#e.notifications();return typeof t!="function"?e:e.filter(t)});static \u0275fac=function(e){return new(e||n)};static \u0275cmp=E({type:n,selectors:[["app-notifications"]],inputs:{notificationFilterPredicate:[1,"notificationFilterPredicate"]},decls:3,vars:1,consts:()=>{let t;return t=$localize`No more notifications`,[t,[3,"index","notification"],[1,"notification-list"]]},template:function(e,o){e&1&&b(0,Ie,1,2,"app-notification",1,pe,!1,fe,3,0,"div",2),e&2&&k(o.notifications())},dependencies:[M],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.actions[_ngcontent-%COMP%]{display:flex;gap:.25rem;justify-content:flex-end}.notification-list[_ngcontent-%COMP%]{padding:1rem;display:flex;flex-direction:column;gap:1rem;text-align:center}"],changeDetection:0})};export{M as a,ie as b};
@@ -1 +1 @@
1
- import{a as A}from"./chunk-F5SNXI4Q.js";import"./chunk-Q74O3CWJ.js";import"./chunk-3TJKPVBA.js";import"./chunk-QHBOEY2O.js";import"./chunk-NK5WD6WE.js";import"./chunk-B62TPRVG.js";import"./chunk-6Q6SSTBK.js";import"./chunk-SZUNW4JO.js";import"./chunk-TL4WOQKT.js";import"./chunk-7LTHH6OG.js";import"./chunk-HSHF5HR7.js";import"./chunk-5LBG6MOL.js";import"./chunk-D6IP567E.js";import"./chunk-VDSX2M4H.js";import"./chunk-ZU6T3TW3.js";import"./chunk-HUZXJWCG.js";import"./chunk-7TWUW4XJ.js";import{U as S}from"./chunk-UNMDSCAN.js";import"./chunk-CFNARBNK.js";import{c as u,e as N,f as c}from"./chunk-I27PVH6D.js";import"./chunk-5VE6P5U5.js";import"./chunk-PO3L6MKW.js";import"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.js";import{Ab as t,Bb as T,Rb as n,cb as g,zb as e}from"./chunk-26Z7TPJB.js";import"./chunk-7CGTOI24.js";var l=class s{static \u0275fac=function(o){return new(o||s)};static \u0275cmp=g({type:s,selectors:[["app-about"]],decls:19,vars:0,consts:()=>{let i;i=$localize`General`;let o;o=$localize`Changelog`;let r;r=$localize`Libraries`;let C;C=$localize`System info`;let a;a=$localize`Server settings`;let E;E=$localize`Logs`;let O;return O=$localize`Crash log`,[i,o,r,C,a,E,O,[1,"content"],[1,"primary"],["tab","","routerLink","/about/general","routerLinkActive","active"],["tab","","routerLink","/about/changelog","routerLinkActive","active"],["tab","","routerLink","/about/libraries","routerLinkActive","active"],["tab","","routerLink","/about/system-info","routerLinkActive","active"],["tab","","routerLink","/about/server-settings","routerLinkActive","active"],["tab","","routerLink","/about/logs","routerLinkActive","active"],["tab","","routerLink","/about/crashlogs","routerLinkActive","active"]]},template:function(o,r){o&1&&(T(0,"app-status-bar"),e(1,"div",7)(2,"sh-tabs",8)(3,"button",9),n(4,0),t(),e(5,"button",10),n(6,1),t(),e(7,"button",11),n(8,2),t(),e(9,"button",12),n(10,3),t(),e(11,"button",13),n(12,4),t(),e(13,"button",14),n(14,5),t(),e(15,"button",15),n(16,6),t()(),e(17,"section"),T(18,"router-outlet"),t()())},dependencies:[A,S,u,N,c],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:0}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:1rem 0}.content[_ngcontent-%COMP%] sh-tabs[_ngcontent-%COMP%]{margin:0 2rem 2rem}.content[_ngcontent-%COMP%] section[_ngcontent-%COMP%]{padding:0}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:2rem}"],changeDetection:0})};export{l as default};
1
+ import{a as A}from"./chunk-EE27B3OV.js";import"./chunk-Q74O3CWJ.js";import"./chunk-BFTGDQ4K.js";import"./chunk-QHBOEY2O.js";import"./chunk-NK5WD6WE.js";import"./chunk-B62TPRVG.js";import"./chunk-6Q6SSTBK.js";import"./chunk-SZUNW4JO.js";import"./chunk-TL4WOQKT.js";import"./chunk-7LTHH6OG.js";import"./chunk-HSHF5HR7.js";import"./chunk-5LBG6MOL.js";import"./chunk-D6IP567E.js";import"./chunk-VDSX2M4H.js";import"./chunk-ZU6T3TW3.js";import"./chunk-HUZXJWCG.js";import"./chunk-7TWUW4XJ.js";import{U as S}from"./chunk-UNMDSCAN.js";import"./chunk-CFNARBNK.js";import{c as u,e as N,f as c}from"./chunk-I27PVH6D.js";import"./chunk-5VE6P5U5.js";import"./chunk-PO3L6MKW.js";import"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.js";import{Ab as t,Bb as T,Rb as n,cb as g,zb as e}from"./chunk-26Z7TPJB.js";import"./chunk-7CGTOI24.js";var l=class s{static \u0275fac=function(o){return new(o||s)};static \u0275cmp=g({type:s,selectors:[["app-about"]],decls:19,vars:0,consts:()=>{let i;i=$localize`General`;let o;o=$localize`Changelog`;let r;r=$localize`Libraries`;let C;C=$localize`System info`;let a;a=$localize`Server settings`;let E;E=$localize`Logs`;let O;return O=$localize`Crash log`,[i,o,r,C,a,E,O,[1,"content"],[1,"primary"],["tab","","routerLink","/about/general","routerLinkActive","active"],["tab","","routerLink","/about/changelog","routerLinkActive","active"],["tab","","routerLink","/about/libraries","routerLinkActive","active"],["tab","","routerLink","/about/system-info","routerLinkActive","active"],["tab","","routerLink","/about/server-settings","routerLinkActive","active"],["tab","","routerLink","/about/logs","routerLinkActive","active"],["tab","","routerLink","/about/crashlogs","routerLinkActive","active"]]},template:function(o,r){o&1&&(T(0,"app-status-bar"),e(1,"div",7)(2,"sh-tabs",8)(3,"button",9),n(4,0),t(),e(5,"button",10),n(6,1),t(),e(7,"button",11),n(8,2),t(),e(9,"button",12),n(10,3),t(),e(11,"button",13),n(12,4),t(),e(13,"button",14),n(14,5),t(),e(15,"button",15),n(16,6),t()(),e(17,"section"),T(18,"router-outlet"),t()())},dependencies:[A,S,u,N,c],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:0}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:1rem 0}.content[_ngcontent-%COMP%] sh-tabs[_ngcontent-%COMP%]{margin:0 2rem 2rem}.content[_ngcontent-%COMP%] section[_ngcontent-%COMP%]{padding:0}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:2rem}"],changeDetection:0})};export{l as default};
@@ -1 +1 @@
1
- import{a}from"./chunk-PGHGTNMG.js";import"./chunk-Z35S3FHQ.js";import"./chunk-IMHM7ISI.js";import"./chunk-HSHF5HR7.js";import"./chunk-HUZXJWCG.js";import"./chunk-UNMDSCAN.js";import"./chunk-CFNARBNK.js";import"./chunk-PO3L6MKW.js";import"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.js";import"./chunk-26Z7TPJB.js";import"./chunk-7CGTOI24.js";export{a as OptionsListComponent};
1
+ import{a}from"./chunk-TXFTUL4R.js";import"./chunk-K34VOGDF.js";import"./chunk-IMHM7ISI.js";import"./chunk-HSHF5HR7.js";import"./chunk-HUZXJWCG.js";import"./chunk-UNMDSCAN.js";import"./chunk-CFNARBNK.js";import"./chunk-PO3L6MKW.js";import"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.js";import"./chunk-26Z7TPJB.js";import"./chunk-7CGTOI24.js";export{a as OptionsListComponent};
@@ -1 +1 @@
1
- import{a as Ie}from"./chunk-Q74O3CWJ.js";import{b as De}from"./chunk-3TJKPVBA.js";import{a as fe}from"./chunk-QHBOEY2O.js";import{a as Ne}from"./chunk-B62TPRVG.js";import{a as J}from"./chunk-SZUNW4JO.js";import{a as Re}from"./chunk-TL4WOQKT.js";import{a as Ae}from"./chunk-D6IP567E.js";import{b as Oe}from"./chunk-ZU6T3TW3.js";import{a as me}from"./chunk-HUZXJWCG.js";import{c as re}from"./chunk-7TWUW4XJ.js";import{B as k,H as pe,L as Ce,O as ge,P as Ee,Y as G,c as Te,e as ce,i as ue,k as Se,s as de,u as $,z as Fe}from"./chunk-UNMDSCAN.js";import{c as U}from"./chunk-CFNARBNK.js";import{e as le}from"./chunk-I27PVH6D.js";import{fa as _e}from"./chunk-7AVOHYTE.js";import{$ as N,Ab as l,Bb as c,Cc as H,Dc as oe,E as Z,Ec as se,Ib as R,Mc as I,Pa as r,Pb as u,Qb as S,Qc as ae,Rb as O,Sb as Q,Tb as ee,Ub as M,Vb as d,W as F,Xb as p,aa as D,cb as f,fc as te,gc as L,jc as w,la as C,mc as ne,na as q,oc as h,pc as v,qc as y,sb as g,tb as E,wc as ie,xc as V,yb as m,zb as _}from"./chunk-26Z7TPJB.js";var he=()=>["/connect/logon"];function Le(o,t){o&1&&(u(0,0,1),c(1,"div",9),S())}function $e(o,t){o&1&&(u(0,0,2),c(1,"div",10),S())}function ke(o,t){if(o&1){let i=R();_(0,"div",8),d("click",function(){N(i);let n=p();return D(n.resetAndRetry())}),u(1,0),g(2,Le,2,0)(3,$e,2,0),S(),l()}if(o&2){let i=p();r(2),E(i.resetting()?2:3)}}function Ge(o,t){o&1&&(_(0,"div",6),u(1,1),c(2,"div",11),S(),l()),o&2&&m("routerLink",V(1,he))}function Ue(o,t){o&1&&(_(0,"div",6),u(1,2),c(2,"div",10),S(),l()),o&2&&m("routerLink",V(1,he))}function xe(o,t){if(o&1){let i=R();_(0,"div",7),u(1,3),_(2,"sh-icon",12),d("click",function(){N(i);let n=p();return D(n.cancel())}),l(),_(3,"div",13),d("click",function(){N(i);let n=p();return D(n.claim())}),l(),c(4,"div",14),S(),l()}}function we(o,t){if(o&1){let i=R();_(0,"div",8),d("click",function(){N(i);let n=p();return D(n.openConsole())}),u(1,4),c(2,"div",15),S(),l()}}var B=class o{#e=F(Re);state=this.#e.state;resetting=C(!1);stateEffect=q(()=>{let t=this.#e.state(),i=this.resetting();t==="registered"&&i&&(this.resetting.set(!1),this.#e.beginRemoteRegistration())});ngOnInit(){this.#e.refreshRemoteControlStatus()}claim(){let t=this.#e.claimUrl();t&&window.open(t,"_blank")}cancel(){this.#e.cancelRemoteRegistration()}resetAndRetry(){this.resetting.set(!0),this.#e.cancelRemoteRegistration()}openConsole(){this.#e.openConsole()}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=f({type:o,selectors:[["app-remote-connectivity-status"]],decls:5,vars:1,consts:()=>{let t;t=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF: Resetting ${"\uFFFD#1:1\uFFFD"}:START_TAG_DIV:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_DIV:${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE: Click to connect ${"\uFFFD#1:2\uFFFD"}:START_TAG_DIV_1:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_DIV:${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,t=M(t);let i;i=$localize` Connecting ${"\uFFFD#2\uFFFD"}:START_TAG_DIV:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_DIV:`;let e;e=$localize` Click to register ${"\uFFFD#2\uFFFD"}:START_TAG_DIV:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_DIV:`;let n;n=$localize`Cancel registration`;let s;s=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:x-circle${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD#3\uFFFD"}:START_TAG_DIV:Click to claim${"[\uFFFD/#3\uFFFD|\uFFFD/#4\uFFFD]"}:CLOSE_TAG_DIV:${"\uFFFD#4\uFFFD"}:START_TAG_DIV_1:${"[\uFFFD/#3\uFFFD|\uFFFD/#4\uFFFD]"}:CLOSE_TAG_DIV:`,s=M(s);let T;return T=$localize` Connected ${"\uFFFD#2\uFFFD"}:START_TAG_DIV:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_DIV:`,[t,i,e,s,T,[1,"connectivity-status"],[1,"connectivity-status",3,"routerLink"],[1,"connectivity-status","claim"],[1,"connectivity-status",3,"click"],[1,"status","blinking"],[1,"status"],[1,"status","warning","blinking"],["shTooltip",n,3,"click"],[1,"claim",3,"click"],[1,"status","success","blinking"],[1,"status","success"]]},template:function(i,e){if(i&1&&g(0,ke,4,1,"div",5)(1,Ge,3,2,"div",6)(2,Ue,3,2,"div",6)(3,xe,5,0,"div",7)(4,we,3,0,"div",5),i&2){let n=e.state()==="unknown"||e.state()==="inactive"||e.state()==="registeringfaulted",s=e.state()==="registeringfaulted",T=e.state()==="registering",a=e.state()==="registered",A=e.state()==="connected"||e.state()==="disabled"||e.state()==="connecting";E(s?0:T?1:n?2:a?3:A?4:-1)}},dependencies:[le,$,G],styles:["[_nghost-%COMP%]{display:flex;align-items:center;padding:0 .75rem}.connectivity-status[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer}.connectivity-status[_ngcontent-%COMP%]:hover{color:var(--primary-8)}.connectivity-status.claim[_ngcontent-%COMP%]{display:flex;gap:.5rem;cursor:pointer}.connectivity-status.claim[_ngcontent-%COMP%]:hover{color:inherit}.connectivity-status.claim[_ngcontent-%COMP%] .claim[_ngcontent-%COMP%]:hover{color:var(--primary-8)}.connectivity-status.claim[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]:hover{color:var(--error-8)}.status[_ngcontent-%COMP%]{width:.625rem;height:.625rem;border-radius:50%;background-color:var(--base-4)}.status.success[_ngcontent-%COMP%]{background-color:var(--success-8)}.status.warning[_ngcontent-%COMP%]{background-color:var(--warn-8)}.status.blinking[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_blinking 1s infinite}@keyframes _ngcontent-%COMP%_blinking{0%{opacity:.2}50%{opacity:1}to{opacity:.2}}"],changeDetection:0})};var ve={Byte:"B",KByte:"KB",MByte:"MB",GByte:"GB",TByte:"TB",PByte:"PB"},Ve=["mbps","gbps"],ye=8,Y=1024,x=Y*1024,K=x*1024,W=K*1024,Be=W*1024,He={B:1,KB:Y,MB:x,GB:K,TB:W,PB:Be},Je=1e3,z=Je*1e3,X=z*1e3,Xe=[{threshold:Be,unitPrefix:"PByte"},{threshold:W,unitPrefix:"TByte"},{threshold:K,unitPrefix:"GByte"},{threshold:x,unitPrefix:"MByte"},{threshold:Y,unitPrefix:"KByte"},{threshold:1,unitPrefix:"Byte"}],b=class o{#e=F(U);closed=ae();isSubmitting=C(!1);sizeOptions=C([...Ve]);maxUpload=C(0);maxDownload=C(0);maxUploadUnit=C("mbps");maxDownloadUnit=C("mbps");ngOnInit(){this.init()}convertToBitsPerSecondUnits(t,i){let n=t*(He[i.toUpperCase()]||x)*ye;return n===0?{value:0,unit:"mbps"}:n>=X?{value:parseFloat((n/X).toFixed(2)),unit:"gbps"}:{value:parseFloat((n/z).toFixed(2)),unit:"mbps"}}convertFromBitsPerSecondUnits(t,i){let e=0;switch(i){case"gbps":e=t*X;break;case"mbps":e=t*z;break}let n=e/ye;if(n===0)return{valueForApi:0,unitPrefixForApi:"Byte"};for(let{threshold:s,unitPrefix:T}of Xe)if(n>=s)return{valueForApi:Math.round(n/s),unitPrefixForApi:T};return{valueForApi:Math.round(n),unitPrefixForApi:"Byte"}}init(){this.#e.getApiV1Serversettings().subscribe({next:t=>{let i=t?.["max-upload-speed"],e=t?.["max-download-speed"];if(i&&i!==""){let n=i.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(n){let s=parseFloat(n[1]),T=n[2],a=this.convertToBitsPerSecondUnits(s,T);this.maxUpload.set(a.value),this.maxUploadUnit.set(a.unit)}else console.warn("Unexpected max-upload-speed format from API:",i),this.resetUpload()}else this.resetUpload();if(e&&e!==""){let n=e.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(n){let s=parseFloat(n[1]),T=n[2],a=this.convertToBitsPerSecondUnits(s,T);this.maxDownload.set(a.value),this.maxDownloadUnit.set(a.unit)}else console.warn("Unexpected max-download-speed format from API:",e),this.resetDownload()}else this.resetDownload()},error:t=>{console.error("Failed to get server settings:",t),this.resetDownload(),this.resetUpload()}})}resetDownload(){this.maxDownload.set(0),this.maxDownloadUnit.set("mbps")}resetUpload(){this.maxUpload.set(0),this.maxUploadUnit.set("mbps")}blockDecimalKeys(t){if([".",","].includes(t.key))return t.preventDefault()}cleanupInputAfterPasting(t){t.preventDefault();let i=t.clipboardData?.getData("text/plain");if(!i)return;let e=i.replaceAll(/[\.,]/g,"");t.target.value=e}submit(){this.isSubmitting.set(!0);let t="",i="",e=this.maxUpload()??0,n=this.maxUploadUnit(),s=this.maxDownload()??0,T=this.maxDownloadUnit();if(e>0){let{valueForApi:a,unitPrefixForApi:A}=this.convertFromBitsPerSecondUnits(e,n),P=ve[A];P?t=`${a}${P}`:console.error(`Invalid unit prefix for API submission (upload): ${A}. Defaulting to empty string.`)}if(s){let{valueForApi:a,unitPrefixForApi:A}=this.convertFromBitsPerSecondUnits(s,T),P=ve[A];P?i=`${a}${P}`:console.error(`Invalid unit prefix for API submission (download): ${A}. Defaulting to empty string.`)}this.#e.patchApiV1Serversettings({requestBody:{"max-upload-speed":t,"max-download-speed":i}}).pipe(Z(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{this.closed.emit(!0)},error:a=>{console.error("Failed to submit throttle settings:",a)}})}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=f({type:o,selectors:[["app-throttle-settings-dialog"]],outputs:{closed:"closed"},decls:26,vars:10,consts:()=>{let t;t=$localize`Throttle network speed`;let i;i=$localize`We will round bits to the nearest byte value.`;let e;e=$localize`Max upload speed`;let n;n=$localize`Max download speed`;let s;s=$localize`Cancel`;let T;return T=$localize` Update settings `,[t,i,e,n,s,T,["content",""],[1,"column"],[1,"field-row"],["type","number",3,"paste","keydown","ngModelChange","ngModel"],[3,"isClearable","options"],["type","text",3,"ngModelChange","ngModel"],["footer",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"click"]]},template:function(i,e){i&1&&(_(0,"header")(1,"h3"),O(2,0),l(),_(3,"p"),O(4,1),l()(),_(5,"div",6)(6,"div",7)(7,"div",8)(8,"label"),O(9,2),l(),_(10,"sh-form-field")(11,"input",9),d("paste",function(s){return e.cleanupInputAfterPasting(s)})("keydown",function(s){return e.blockDecimalKeys(s)}),y("ngModelChange",function(s){return v(e.maxUpload,s)||(e.maxUpload=s),s}),l()(),_(12,"sh-select",10)(13,"input",11),y("ngModelChange",function(s){return v(e.maxUploadUnit,s)||(e.maxUploadUnit=s),s}),l()()(),_(14,"div",8)(15,"label"),O(16,3),l(),_(17,"sh-form-field")(18,"input",9),d("paste",function(s){return e.cleanupInputAfterPasting(s)})("keydown",function(s){return e.blockDecimalKeys(s)}),y("ngModelChange",function(s){return v(e.maxDownload,s)||(e.maxDownload=s),s}),l()(),_(19,"sh-select",10)(20,"input",11),y("ngModelChange",function(s){return v(e.maxDownloadUnit,s)||(e.maxDownloadUnit=s),s}),l()()()()(),_(21,"footer",12)(22,"button",13),d("click",function(){return e.closed.emit(!1)}),O(23,4),l(),_(24,"button",14),d("click",function(){return e.submit()}),O(25,5),l()()),i&2&&(r(11),h("ngModel",e.maxUpload),r(),m("isClearable",!1)("options",e.sizeOptions()),r(),h("ngModel",e.maxUploadUnit),r(5),h("ngModel",e.maxDownload),r(),m("isClearable",!1)("options",e.sizeOptions()),r(),h("ngModel",e.maxDownloadUnit),r(4),L("loader",e.isSubmitting()))},dependencies:[de,Te,Se,ce,ue,pe,Ee,k],styles:['[_nghost-%COMP%]{display:block}h3[_ngcontent-%COMP%]{font:var(--title-30)}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;padding:1rem;gap:.5rem;margin-bottom:1rem}.column[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.field-row[_ngcontent-%COMP%]{display:grid;grid-template-areas:"label label" "input select";grid-template-columns:1fr auto;align-items:center;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%]{grid-area:input}.field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{grid-area:select}'],changeDetection:0})};function ze(o,t){if(o&1&&(_(0,"div",12),w(1),l(),c(2,"sh-progress-bar",13)),o&2){let i=p();m("shTooltip",i.tooltipText()),r(),ne("",i.statusData().actionText," - ",i.statusData().statusText),r(),m("value",i.statusData().progress*100)}}function Ye(o,t){if(o&1&&(_(0,"div",8),u(1,1),c(2,"sh-icon"),H(3,"relativeTime"),H(4,"date"),S(),l()),o&2){let i,e=p();r(4),Q((i=e.nextBackup().backup)==null||i.Backup==null?null:i.Backup.Name)(oe(3,3,e.nextBackup().time))(se(4,5,e.nextBackup().time,"shortTime")),ee(1)}}function Ke(o,t){o&1&&(_(0,"div",8),O(1,2),l())}function We(o,t){o&1&&(_(0,"div",9),u(1,3),c(2,"sh-spinner"),S(),l()),o&2&&(r(2),te("--spinner-size","12px")("--spinner-thickness","2px"))}function je(o,t){o&1&&c(0,"app-remote-connectivity-status")}function Ze(o,t){if(o&1){let i=R();_(0,"button",11),d("click",function(){N(i);let n=p(2);return D(n.abort())}),u(1,4),c(2,"sh-icon"),S(),l()}}function qe(o,t){if(o&1){let i=R();_(0,"button",11),d("click",function(){N(i);let n=p(2);return D(n.stop())}),u(1,5),c(2,"sh-icon"),S(),l()}}function Qe(o,t){if(o&1&&g(0,Ze,3,0,"button",14)(1,qe,3,0,"button",14),o&2){let i=p();E(i.isStopping()?0:1)}}function et(o,t){o&1&&(u(0,0,1),c(1,"sh-icon"),S())}function tt(o,t){o&1&&(u(0,0,2),c(1,"sh-icon"),S())}var be=new Date,j=class o{#e=F(U);#t=F(De);#n=F(Fe);#a=F(Ne);#i=F(re);#_=F(me);#o=F(Oe);#l=F(Ae);#r=F(J);minsAgo=be.setMinutes(be.getMinutes()-1);statusData=this.#t.statusData;serverState=this.#t.serverState;clientIsRunning=this.#t.clientIsRunning;isResuming=this.#t.isResuming;runningTask=I(()=>this.#o.serverState()?.ActiveTask?.Item1);isStopping=I(()=>this.runningTask()==this.#s());#s=C(-1);pgState=I(()=>this.#o.serverState());isUsingRelay=this.#i.relayIsEnabled;hideConsoleConnectionStatus=this.#l.isConsoleConnectionStatusHidden;tooltipText=I(()=>{let t=this.statusData();return t?.CurrentFilename?`${t.CurrentFilename} (${this.#r.transform(t.CurrentFilesize,!1,!0)})`:""});nextBackup=I(()=>{let t=this.#a.backups();return{backup:this.serverState()?.ProposedSchedule?.[0]?.backup,time:this.serverState()?.ProposedSchedule?.[0]?.Item2}});openThrottleSettingsDialog(){this.#n.open(b,{maxWidth:"550px",width:"100%"})}openPauseDialog(){this.#n.open(Ie,{maxWidth:"550px",width:"100%"})}pauseResume(){if(this.clientIsRunning()){this.openPauseDialog();return}this.#t.pauseResume().subscribe()}stop(){let t=this.runningTask();t&&(this.#s.set(t),this.#e.postApiV1TaskByTaskidStop({taskid:t}).subscribe())}abort(){let t=this.runningTask();t&&this.#e.postApiV1TaskByTaskidAbort({taskid:t}).subscribe()}ngAfterViewInit(){let t=this.#i.relayIsEnabled()||!this.#_.hasWebSocket()?"longpoll":"websocket";this.#t.setConnectionMethod(t)}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=f({type:o,selectors:[["app-status-bar"]],features:[ie([J])],decls:16,vars:6,consts:()=>{let t;t=$localize`${"\uFFFD*11:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:pause${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Pause ${"\uFFFD/*11:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*12:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:play${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Resume ${"\uFFFD/*12:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,t=M(t);let i;i=$localize` ${"\uFFFD0\uFFFD"}:INTERPOLATION: - ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:clock${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD1\uFFFD"}:INTERPOLATION_1: at ${"\uFFFD2\uFFFD"}:INTERPOLATION_2: `;let e;e=$localize`No scheduled tasks`;let n;n=$localize` Loading ${"\uFFFD#2\uFFFD"}:START_TAG_SH_SPINNER:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_SPINNER:`;let s;s=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:skull${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Abort `;let T;return T=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:stop${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Stop `,[t,i,e,n,s,T,[1,"current-backup"],[1,"current-backup-progress"],[1,"label"],[1,"label","label-loading"],[1,"current-backup-actions"],["shButton","",3,"click"],[3,"shTooltip"],[1,"raised","primary",3,"value"],["shButton",""]]},template:function(i,e){if(i&1&&(_(0,"div",6)(1,"div",7),g(2,ze,3,4)(3,Ye,5,8,"div",8)(4,Ke,2,0,"div",8)(5,We,3,4,"div",9),l(),_(6,"div",10),g(7,je,1,0,"app-remote-connectivity-status"),g(8,Qe,2,1),_(9,"button",11),d("click",function(){return e.pauseResume()}),u(10,0),g(11,et,2,0)(12,tt,2,0),S(),l(),_(13,"button",11),d("click",function(){return e.openThrottleSettingsDialog()}),_(14,"sh-icon"),w(15,"speedometer"),l()()()()),i&2){let n;r(2),E((n=e.serverState())!=null&&n.ActiveTask&&(!((n=e.statusData())==null||n.task==null)&&n.task.Status)&&((n=e.statusData())==null||n.task==null?null:n.task.Status)!=="Completed"?2:e.nextBackup().backup||e.nextBackup().time?3:(n=e.serverState())!=null&&n.ActiveTask?5:4),r(5),E(!e.isUsingRelay()&&!e.hideConsoleConnectionStatus()?7:-1),r(),E(e.runningTask()?8:-1),r(),L("loader",e.isResuming()),r(2),E(e.clientIsRunning()?11:12)}},dependencies:[B,$,k,ge,Ce,G,fe,_e],styles:["[_nghost-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1rem;min-height:3.875rem;border-bottom:1px solid var(--base-4);position:sticky;top:0;z-index:2000;background:var(--base-1)}.current-backup[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;width:100%;gap:.5rem}.current-backup-progress[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;min-width:18.75rem;flex:1 0}.current-backup-progress[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{max-width:18.75rem;width:100%}.current-backup-progress[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.current-backup-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.label-loading[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.25rem}"],changeDetection:0})};export{j as a};
1
+ import{a as Ie}from"./chunk-Q74O3CWJ.js";import{b as De}from"./chunk-BFTGDQ4K.js";import{a as fe}from"./chunk-QHBOEY2O.js";import{a as Ne}from"./chunk-B62TPRVG.js";import{a as J}from"./chunk-SZUNW4JO.js";import{a as Re}from"./chunk-TL4WOQKT.js";import{a as Ae}from"./chunk-D6IP567E.js";import{b as Oe}from"./chunk-ZU6T3TW3.js";import{a as me}from"./chunk-HUZXJWCG.js";import{c as re}from"./chunk-7TWUW4XJ.js";import{B as k,H as pe,L as Ce,O as ge,P as Ee,Y as G,c as Te,e as ce,i as ue,k as Se,s as de,u as $,z as Fe}from"./chunk-UNMDSCAN.js";import{c as U}from"./chunk-CFNARBNK.js";import{e as le}from"./chunk-I27PVH6D.js";import{fa as _e}from"./chunk-7AVOHYTE.js";import{$ as N,Ab as l,Bb as c,Cc as H,Dc as oe,E as Z,Ec as se,Ib as R,Mc as I,Pa as r,Pb as u,Qb as S,Qc as ae,Rb as O,Sb as Q,Tb as ee,Ub as M,Vb as d,W as F,Xb as p,aa as D,cb as f,fc as te,gc as L,jc as w,la as C,mc as ne,na as q,oc as h,pc as v,qc as y,sb as g,tb as E,wc as ie,xc as V,yb as m,zb as _}from"./chunk-26Z7TPJB.js";var he=()=>["/connect/logon"];function Le(o,t){o&1&&(u(0,0,1),c(1,"div",9),S())}function $e(o,t){o&1&&(u(0,0,2),c(1,"div",10),S())}function ke(o,t){if(o&1){let i=R();_(0,"div",8),d("click",function(){N(i);let n=p();return D(n.resetAndRetry())}),u(1,0),g(2,Le,2,0)(3,$e,2,0),S(),l()}if(o&2){let i=p();r(2),E(i.resetting()?2:3)}}function Ge(o,t){o&1&&(_(0,"div",6),u(1,1),c(2,"div",11),S(),l()),o&2&&m("routerLink",V(1,he))}function Ue(o,t){o&1&&(_(0,"div",6),u(1,2),c(2,"div",10),S(),l()),o&2&&m("routerLink",V(1,he))}function xe(o,t){if(o&1){let i=R();_(0,"div",7),u(1,3),_(2,"sh-icon",12),d("click",function(){N(i);let n=p();return D(n.cancel())}),l(),_(3,"div",13),d("click",function(){N(i);let n=p();return D(n.claim())}),l(),c(4,"div",14),S(),l()}}function we(o,t){if(o&1){let i=R();_(0,"div",8),d("click",function(){N(i);let n=p();return D(n.openConsole())}),u(1,4),c(2,"div",15),S(),l()}}var B=class o{#e=F(Re);state=this.#e.state;resetting=C(!1);stateEffect=q(()=>{let t=this.#e.state(),i=this.resetting();t==="registered"&&i&&(this.resetting.set(!1),this.#e.beginRemoteRegistration())});ngOnInit(){this.#e.refreshRemoteControlStatus()}claim(){let t=this.#e.claimUrl();t&&window.open(t,"_blank")}cancel(){this.#e.cancelRemoteRegistration()}resetAndRetry(){this.resetting.set(!0),this.#e.cancelRemoteRegistration()}openConsole(){this.#e.openConsole()}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=f({type:o,selectors:[["app-remote-connectivity-status"]],decls:5,vars:1,consts:()=>{let t;t=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF: Resetting ${"\uFFFD#1:1\uFFFD"}:START_TAG_DIV:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_DIV:${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE: Click to connect ${"\uFFFD#1:2\uFFFD"}:START_TAG_DIV_1:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_DIV:${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,t=M(t);let i;i=$localize` Connecting ${"\uFFFD#2\uFFFD"}:START_TAG_DIV:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_DIV:`;let e;e=$localize` Click to register ${"\uFFFD#2\uFFFD"}:START_TAG_DIV:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_DIV:`;let n;n=$localize`Cancel registration`;let s;s=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:x-circle${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD#3\uFFFD"}:START_TAG_DIV:Click to claim${"[\uFFFD/#3\uFFFD|\uFFFD/#4\uFFFD]"}:CLOSE_TAG_DIV:${"\uFFFD#4\uFFFD"}:START_TAG_DIV_1:${"[\uFFFD/#3\uFFFD|\uFFFD/#4\uFFFD]"}:CLOSE_TAG_DIV:`,s=M(s);let T;return T=$localize` Connected ${"\uFFFD#2\uFFFD"}:START_TAG_DIV:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_DIV:`,[t,i,e,s,T,[1,"connectivity-status"],[1,"connectivity-status",3,"routerLink"],[1,"connectivity-status","claim"],[1,"connectivity-status",3,"click"],[1,"status","blinking"],[1,"status"],[1,"status","warning","blinking"],["shTooltip",n,3,"click"],[1,"claim",3,"click"],[1,"status","success","blinking"],[1,"status","success"]]},template:function(i,e){if(i&1&&g(0,ke,4,1,"div",5)(1,Ge,3,2,"div",6)(2,Ue,3,2,"div",6)(3,xe,5,0,"div",7)(4,we,3,0,"div",5),i&2){let n=e.state()==="unknown"||e.state()==="inactive"||e.state()==="registeringfaulted",s=e.state()==="registeringfaulted",T=e.state()==="registering",a=e.state()==="registered",A=e.state()==="connected"||e.state()==="disabled"||e.state()==="connecting";E(s?0:T?1:n?2:a?3:A?4:-1)}},dependencies:[le,$,G],styles:["[_nghost-%COMP%]{display:flex;align-items:center;padding:0 .75rem}.connectivity-status[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer}.connectivity-status[_ngcontent-%COMP%]:hover{color:var(--primary-8)}.connectivity-status.claim[_ngcontent-%COMP%]{display:flex;gap:.5rem;cursor:pointer}.connectivity-status.claim[_ngcontent-%COMP%]:hover{color:inherit}.connectivity-status.claim[_ngcontent-%COMP%] .claim[_ngcontent-%COMP%]:hover{color:var(--primary-8)}.connectivity-status.claim[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]:hover{color:var(--error-8)}.status[_ngcontent-%COMP%]{width:.625rem;height:.625rem;border-radius:50%;background-color:var(--base-4)}.status.success[_ngcontent-%COMP%]{background-color:var(--success-8)}.status.warning[_ngcontent-%COMP%]{background-color:var(--warn-8)}.status.blinking[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_blinking 1s infinite}@keyframes _ngcontent-%COMP%_blinking{0%{opacity:.2}50%{opacity:1}to{opacity:.2}}"],changeDetection:0})};var ve={Byte:"B",KByte:"KB",MByte:"MB",GByte:"GB",TByte:"TB",PByte:"PB"},Ve=["mbps","gbps"],ye=8,Y=1024,x=Y*1024,K=x*1024,W=K*1024,Be=W*1024,He={B:1,KB:Y,MB:x,GB:K,TB:W,PB:Be},Je=1e3,z=Je*1e3,X=z*1e3,Xe=[{threshold:Be,unitPrefix:"PByte"},{threshold:W,unitPrefix:"TByte"},{threshold:K,unitPrefix:"GByte"},{threshold:x,unitPrefix:"MByte"},{threshold:Y,unitPrefix:"KByte"},{threshold:1,unitPrefix:"Byte"}],b=class o{#e=F(U);closed=ae();isSubmitting=C(!1);sizeOptions=C([...Ve]);maxUpload=C(0);maxDownload=C(0);maxUploadUnit=C("mbps");maxDownloadUnit=C("mbps");ngOnInit(){this.init()}convertToBitsPerSecondUnits(t,i){let n=t*(He[i.toUpperCase()]||x)*ye;return n===0?{value:0,unit:"mbps"}:n>=X?{value:parseFloat((n/X).toFixed(2)),unit:"gbps"}:{value:parseFloat((n/z).toFixed(2)),unit:"mbps"}}convertFromBitsPerSecondUnits(t,i){let e=0;switch(i){case"gbps":e=t*X;break;case"mbps":e=t*z;break}let n=e/ye;if(n===0)return{valueForApi:0,unitPrefixForApi:"Byte"};for(let{threshold:s,unitPrefix:T}of Xe)if(n>=s)return{valueForApi:Math.round(n/s),unitPrefixForApi:T};return{valueForApi:Math.round(n),unitPrefixForApi:"Byte"}}init(){this.#e.getApiV1Serversettings().subscribe({next:t=>{let i=t?.["max-upload-speed"],e=t?.["max-download-speed"];if(i&&i!==""){let n=i.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(n){let s=parseFloat(n[1]),T=n[2],a=this.convertToBitsPerSecondUnits(s,T);this.maxUpload.set(a.value),this.maxUploadUnit.set(a.unit)}else console.warn("Unexpected max-upload-speed format from API:",i),this.resetUpload()}else this.resetUpload();if(e&&e!==""){let n=e.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(n){let s=parseFloat(n[1]),T=n[2],a=this.convertToBitsPerSecondUnits(s,T);this.maxDownload.set(a.value),this.maxDownloadUnit.set(a.unit)}else console.warn("Unexpected max-download-speed format from API:",e),this.resetDownload()}else this.resetDownload()},error:t=>{console.error("Failed to get server settings:",t),this.resetDownload(),this.resetUpload()}})}resetDownload(){this.maxDownload.set(0),this.maxDownloadUnit.set("mbps")}resetUpload(){this.maxUpload.set(0),this.maxUploadUnit.set("mbps")}blockDecimalKeys(t){if([".",","].includes(t.key))return t.preventDefault()}cleanupInputAfterPasting(t){t.preventDefault();let i=t.clipboardData?.getData("text/plain");if(!i)return;let e=i.replaceAll(/[\.,]/g,"");t.target.value=e}submit(){this.isSubmitting.set(!0);let t="",i="",e=this.maxUpload()??0,n=this.maxUploadUnit(),s=this.maxDownload()??0,T=this.maxDownloadUnit();if(e>0){let{valueForApi:a,unitPrefixForApi:A}=this.convertFromBitsPerSecondUnits(e,n),P=ve[A];P?t=`${a}${P}`:console.error(`Invalid unit prefix for API submission (upload): ${A}. Defaulting to empty string.`)}if(s){let{valueForApi:a,unitPrefixForApi:A}=this.convertFromBitsPerSecondUnits(s,T),P=ve[A];P?i=`${a}${P}`:console.error(`Invalid unit prefix for API submission (download): ${A}. Defaulting to empty string.`)}this.#e.patchApiV1Serversettings({requestBody:{"max-upload-speed":t,"max-download-speed":i}}).pipe(Z(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{this.closed.emit(!0)},error:a=>{console.error("Failed to submit throttle settings:",a)}})}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=f({type:o,selectors:[["app-throttle-settings-dialog"]],outputs:{closed:"closed"},decls:26,vars:10,consts:()=>{let t;t=$localize`Throttle network speed`;let i;i=$localize`We will round bits to the nearest byte value.`;let e;e=$localize`Max upload speed`;let n;n=$localize`Max download speed`;let s;s=$localize`Cancel`;let T;return T=$localize` Update settings `,[t,i,e,n,s,T,["content",""],[1,"column"],[1,"field-row"],["type","number",3,"paste","keydown","ngModelChange","ngModel"],[3,"isClearable","options"],["type","text",3,"ngModelChange","ngModel"],["footer",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"click"]]},template:function(i,e){i&1&&(_(0,"header")(1,"h3"),O(2,0),l(),_(3,"p"),O(4,1),l()(),_(5,"div",6)(6,"div",7)(7,"div",8)(8,"label"),O(9,2),l(),_(10,"sh-form-field")(11,"input",9),d("paste",function(s){return e.cleanupInputAfterPasting(s)})("keydown",function(s){return e.blockDecimalKeys(s)}),y("ngModelChange",function(s){return v(e.maxUpload,s)||(e.maxUpload=s),s}),l()(),_(12,"sh-select",10)(13,"input",11),y("ngModelChange",function(s){return v(e.maxUploadUnit,s)||(e.maxUploadUnit=s),s}),l()()(),_(14,"div",8)(15,"label"),O(16,3),l(),_(17,"sh-form-field")(18,"input",9),d("paste",function(s){return e.cleanupInputAfterPasting(s)})("keydown",function(s){return e.blockDecimalKeys(s)}),y("ngModelChange",function(s){return v(e.maxDownload,s)||(e.maxDownload=s),s}),l()(),_(19,"sh-select",10)(20,"input",11),y("ngModelChange",function(s){return v(e.maxDownloadUnit,s)||(e.maxDownloadUnit=s),s}),l()()()()(),_(21,"footer",12)(22,"button",13),d("click",function(){return e.closed.emit(!1)}),O(23,4),l(),_(24,"button",14),d("click",function(){return e.submit()}),O(25,5),l()()),i&2&&(r(11),h("ngModel",e.maxUpload),r(),m("isClearable",!1)("options",e.sizeOptions()),r(),h("ngModel",e.maxUploadUnit),r(5),h("ngModel",e.maxDownload),r(),m("isClearable",!1)("options",e.sizeOptions()),r(),h("ngModel",e.maxDownloadUnit),r(4),L("loader",e.isSubmitting()))},dependencies:[de,Te,Se,ce,ue,pe,Ee,k],styles:['[_nghost-%COMP%]{display:block}h3[_ngcontent-%COMP%]{font:var(--title-30)}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;padding:1rem;gap:.5rem;margin-bottom:1rem}.column[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.field-row[_ngcontent-%COMP%]{display:grid;grid-template-areas:"label label" "input select";grid-template-columns:1fr auto;align-items:center;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%]{grid-area:input}.field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{grid-area:select}'],changeDetection:0})};function ze(o,t){if(o&1&&(_(0,"div",12),w(1),l(),c(2,"sh-progress-bar",13)),o&2){let i=p();m("shTooltip",i.tooltipText()),r(),ne("",i.statusData().actionText," - ",i.statusData().statusText),r(),m("value",i.statusData().progress*100)}}function Ye(o,t){if(o&1&&(_(0,"div",8),u(1,1),c(2,"sh-icon"),H(3,"relativeTime"),H(4,"date"),S(),l()),o&2){let i,e=p();r(4),Q((i=e.nextBackup().backup)==null||i.Backup==null?null:i.Backup.Name)(oe(3,3,e.nextBackup().time))(se(4,5,e.nextBackup().time,"shortTime")),ee(1)}}function Ke(o,t){o&1&&(_(0,"div",8),O(1,2),l())}function We(o,t){o&1&&(_(0,"div",9),u(1,3),c(2,"sh-spinner"),S(),l()),o&2&&(r(2),te("--spinner-size","12px")("--spinner-thickness","2px"))}function je(o,t){o&1&&c(0,"app-remote-connectivity-status")}function Ze(o,t){if(o&1){let i=R();_(0,"button",11),d("click",function(){N(i);let n=p(2);return D(n.abort())}),u(1,4),c(2,"sh-icon"),S(),l()}}function qe(o,t){if(o&1){let i=R();_(0,"button",11),d("click",function(){N(i);let n=p(2);return D(n.stop())}),u(1,5),c(2,"sh-icon"),S(),l()}}function Qe(o,t){if(o&1&&g(0,Ze,3,0,"button",14)(1,qe,3,0,"button",14),o&2){let i=p();E(i.isStopping()?0:1)}}function et(o,t){o&1&&(u(0,0,1),c(1,"sh-icon"),S())}function tt(o,t){o&1&&(u(0,0,2),c(1,"sh-icon"),S())}var be=new Date,j=class o{#e=F(U);#t=F(De);#n=F(Fe);#a=F(Ne);#i=F(re);#_=F(me);#o=F(Oe);#l=F(Ae);#r=F(J);minsAgo=be.setMinutes(be.getMinutes()-1);statusData=this.#t.statusData;serverState=this.#t.serverState;clientIsRunning=this.#t.clientIsRunning;isResuming=this.#t.isResuming;runningTask=I(()=>this.#o.serverState()?.ActiveTask?.Item1);isStopping=I(()=>this.runningTask()==this.#s());#s=C(-1);pgState=I(()=>this.#o.serverState());isUsingRelay=this.#i.relayIsEnabled;hideConsoleConnectionStatus=this.#l.isConsoleConnectionStatusHidden;tooltipText=I(()=>{let t=this.statusData();return t?.CurrentFilename?`${t.CurrentFilename} (${this.#r.transform(t.CurrentFilesize,!1,!0)})`:""});nextBackup=I(()=>{let t=this.#a.backups();return{backup:this.serverState()?.ProposedSchedule?.[0]?.backup,time:this.serverState()?.ProposedSchedule?.[0]?.Item2}});openThrottleSettingsDialog(){this.#n.open(b,{maxWidth:"550px",width:"100%"})}openPauseDialog(){this.#n.open(Ie,{maxWidth:"550px",width:"100%"})}pauseResume(){if(this.clientIsRunning()){this.openPauseDialog();return}this.#t.pauseResume().subscribe()}stop(){let t=this.runningTask();t&&(this.#s.set(t),this.#e.postApiV1TaskByTaskidStop({taskid:t}).subscribe())}abort(){let t=this.runningTask();t&&this.#e.postApiV1TaskByTaskidAbort({taskid:t}).subscribe()}ngAfterViewInit(){let t=this.#i.relayIsEnabled()||!this.#_.hasWebSocket()?"longpoll":"websocket";this.#t.setConnectionMethod(t)}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=f({type:o,selectors:[["app-status-bar"]],features:[ie([J])],decls:16,vars:6,consts:()=>{let t;t=$localize`${"\uFFFD*11:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:pause${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Pause ${"\uFFFD/*11:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*12:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:play${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Resume ${"\uFFFD/*12:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,t=M(t);let i;i=$localize` ${"\uFFFD0\uFFFD"}:INTERPOLATION: - ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:clock${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD1\uFFFD"}:INTERPOLATION_1: at ${"\uFFFD2\uFFFD"}:INTERPOLATION_2: `;let e;e=$localize`No scheduled tasks`;let n;n=$localize` Loading ${"\uFFFD#2\uFFFD"}:START_TAG_SH_SPINNER:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_SPINNER:`;let s;s=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:skull${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Abort `;let T;return T=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:stop${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Stop `,[t,i,e,n,s,T,[1,"current-backup"],[1,"current-backup-progress"],[1,"label"],[1,"label","label-loading"],[1,"current-backup-actions"],["shButton","",3,"click"],[3,"shTooltip"],[1,"raised","primary",3,"value"],["shButton",""]]},template:function(i,e){if(i&1&&(_(0,"div",6)(1,"div",7),g(2,ze,3,4)(3,Ye,5,8,"div",8)(4,Ke,2,0,"div",8)(5,We,3,4,"div",9),l(),_(6,"div",10),g(7,je,1,0,"app-remote-connectivity-status"),g(8,Qe,2,1),_(9,"button",11),d("click",function(){return e.pauseResume()}),u(10,0),g(11,et,2,0)(12,tt,2,0),S(),l(),_(13,"button",11),d("click",function(){return e.openThrottleSettingsDialog()}),_(14,"sh-icon"),w(15,"speedometer"),l()()()()),i&2){let n;r(2),E((n=e.serverState())!=null&&n.ActiveTask&&(!((n=e.statusData())==null||n.task==null)&&n.task.Status)&&((n=e.statusData())==null||n.task==null?null:n.task.Status)!=="Completed"?2:e.nextBackup().backup||e.nextBackup().time?3:(n=e.serverState())!=null&&n.ActiveTask?5:4),r(5),E(!e.isUsingRelay()&&!e.hideConsoleConnectionStatus()?7:-1),r(),E(e.runningTask()?8:-1),r(),L("loader",e.isResuming()),r(2),E(e.clientIsRunning()?11:12)}},dependencies:[B,$,k,ge,Ce,G,fe,_e],styles:["[_nghost-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1rem;min-height:3.875rem;border-bottom:1px solid var(--base-4);position:sticky;top:0;z-index:2000;background:var(--base-1)}.current-backup[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;width:100%;gap:.5rem}.current-backup-progress[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;min-width:18.75rem;flex:1 0}.current-backup-progress[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{max-width:18.75rem;width:100%}.current-backup-progress[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.current-backup-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.label-loading[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.25rem}"],changeDetection:0})};export{j as a};
@@ -0,0 +1 @@
1
+ import{i as pe,j as Ce,k as Se,l as me,p as Ne}from"./chunk-TN6HBIUN.js";import"./chunk-K34VOGDF.js";import{b as ue,c as Te}from"./chunk-IMHM7ISI.js";import"./chunk-6LAXPU22.js";import"./chunk-6Q6SSTBK.js";import"./chunk-TL4WOQKT.js";import"./chunk-7LTHH6OG.js";import{a as A}from"./chunk-HSHF5HR7.js";import"./chunk-D6IP567E.js";import"./chunk-VDSX2M4H.js";import"./chunk-ZU6T3TW3.js";import"./chunk-HUZXJWCG.js";import"./chunk-7TWUW4XJ.js";import{B as ce,H as ge,K as de,c as Y,e as Z,f as ee,g as te,i as ne,j as ie,r as oe,s as ae,u as re,w as se,y as le,z as _e}from"./chunk-UNMDSCAN.js";import"./chunk-CFNARBNK.js";import{b as q,d as Q}from"./chunk-I27PVH6D.js";import"./chunk-5VE6P5U5.js";import"./chunk-PO3L6MKW.js";import"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.js";import{$ as l,Ab as s,Bb as p,Fb as V,Gb as K,Ib as C,Mc as R,Pa as g,Pb as N,Qb as E,Rb as D,Sc as w,Vb as T,W as I,Xb as c,aa as _,cb as v,cc as z,da as B,dc as J,gc as X,jc as y,la as O,oc as F,pc as f,qc as P,rc as W,sb as S,sc as H,tb as m,tc as U,xc as j,yb as h,zb as r}from"./chunk-26Z7TPJB.js";import"./chunk-7CGTOI24.js";var Ee=["formRef"],Ie=["testUrl"],he=()=>({maxWidth:"700px",width:"100%"});function De(o,i){if(o&1){let e=C();r(0,"button",27),T("click",function(){l(e);let n=c();return _(n.openTargetUrlDialog())}),N(1,6),p(2,"sh-icon"),E(),s()}}function fe(o,i){if(o&1){let e=C();r(0,"button",27),T("click",function(){l(e);let n=c(2);return _(n.copyTargetUrl())}),N(1,8),p(2,"sh-icon"),E(),s()}}function Oe(o,i){if(o&1){let e=C();r(0,"sh-menu")(1,"button",19)(2,"sh-icon"),y(3,"dots-three-vertical"),s()(),V(4,28),r(5,"button",27),T("click",function(){l(e);let n=c();return _(n.openTargetUrlDialog())}),N(6,7),p(7,"sh-icon"),E(),s(),S(8,fe,3,0,"button",19),K(),s()}if(o&2){c();let e=U(0);g(8),m(e?8:-1)}}function Fe(o,i){if(o&1){let e=C();r(0,"app-destination-list",29),T("setDestination",function(n){l(e);let a=c();return _(a.setDestination(n))}),s()}}function Pe(o,i){if(o&1){let e=C();r(0,"app-single-destination",30),P("targetUrlChange",function(n){l(e);let a=c();return f(a.targetUrlModel,n)||(a.targetUrlModel=n),_(n)}),s()}if(o&2){let e=c();F("targetUrl",e.targetUrlModel),h("useBackupState",!0)}}function Ae(o,i){o&1&&(r(0,"h2"),D(1,11),s())}function Me(o,i){o&1&&(r(0,"h2"),D(1,12),s())}function ye(o,i){if(o&1){let e=C();r(0,"sh-dialog",31),P("isOpenChange",function(n){l(e);let a=c();return f(a.targetUrlDialogOpen,n)||(a.targetUrlDialogOpen=n),_(n)}),r(1,"header",32)(2,"div",33),S(3,Ae,2,0,"h2")(4,Me,2,0,"h2"),r(5,"sh-alert",34),D(6,9),s()()(),r(7,"div",35)(8,"sh-form-field")(9,"textarea",36),P("ngModelChange",function(n){l(e);let a=c();return f(a.targetUrlCtrl,n)||(a.targetUrlCtrl=n),_(n)}),s()()(),r(10,"footer",37)(11,"button",22),T("click",function(){l(e);let n=c();return _(n.closeTargetUrlDialog(!1))}),y(12,"Cancel"),s(),r(13,"button",38),T("click",function(){l(e);let n=c();return _(n.closeTargetUrlDialog(!0))}),N(14,10),p(15,"sh-icon"),E(),s()()()}if(o&2){let e=c(),t=U(0);F("isOpen",e.targetUrlDialogOpen),h("options",j(4,he)),g(3),m(t?4:3),g(6),F("ngModel",e.targetUrlCtrl)}}var M=new oe,je=(o={destinations:[]})=>M.group({destinations:M.array(o.destinations)}),qe=({key:o,customGroup:i,dynamicGroup:e,advancedGroup:t})=>M.group({destinationType:M.control(o),custom:i,dynamic:e,advanced:t}),$=class o{#i=I(Q);#o=I(q);#e=I(Ne);#n=I(_e);injector=I(B);formRef=w.required("formRef");testUrlComponent=w.required("testUrl");testSignal=this.#e.targetUrlTestSignal;targetUrlModel=this.#e.targetUrlModel;targetUrlCtrl=O(null);targetUrlInitial=O(null);targetUrlDialogOpen=O(!1);toggleNewDestination=O(!0);isNew=this.#e.isNew;backupId=this.#e.backupId;selectedDestinationType=R(()=>{let i=this.targetUrlModel();return i?ue(i)??null:null});selectedDestinationTypeOption=R(()=>{let i=this.selectedDestinationType();return i?{key:i.customKey??i.key,customKey:i.customKey??null,displayName:i.displayName,description:i.description,icon:i.icon}:null});copyTargetUrl(){navigator.clipboard.writeText(this.targetUrlModel()??"")}openTargetUrlDialog(){let i=this.targetUrlModel();this.targetUrlCtrl.set(i),this.targetUrlInitial.set(i),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(i=!1){this.targetUrlDialogOpen.set(!1);let e=this.targetUrlCtrl(),t=this.targetUrlInitial();!i||e===t||!e||this.#e.setTargetUrl(e)}setDestination(i){let e=Te(i??"");if(e){if(e.mapper.default){let t=e.mapper.default(this.#e.backupName()??"");this.#e.setTargetUrl(t,!0);return}this.#e.setTargetUrl(`${i}://`,!0)}}removeDestination(){this.#e.setTargetUrl(null,!0)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let i=this.#e.isNew(),e=this.testSignal();if(!i){this.#t();return}if(e===null){this.#n.open(A,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:n=>{n?this.testUrlComponent()?.testDestination(!1)?.then(a=>{a.action==="success"&&!a.containsBackup&&!a.anyFilesFound?this.#t():this.#n.open(A,{data:{title:$localize`Test did not succeed`,message:a.errorMessage??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#t()}});return}let t=typeof e=="string"?null:e;if(t?.action!=="success"||t.containsBackup||t.anyFilesFound){this.#n.open(A,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Yes, continue`,cancelText:$localize`Cancel`},closed:n=>{n&&this.#t()}});return}this.#t()}#t(){this.#e.shouldAutoSave()&&this.#e.submit(!0),this.#i.navigate(["source-data"],{relativeTo:this.#o.parent})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=v({type:o,selectors:[["app-destination"]],viewQuery:function(e,t){e&1&&z(t.formRef,Ee,5)(t.testUrlComponent,Ie,5),e&2&&J(2)},decls:28,vars:17,consts:()=>{let i;i=$localize`Backup destination`;let e;e=$localize`Change`;let t;t=$localize`${"\uFFFD#23\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#23\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let n;n=$localize`${"\uFFFD#26\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#26\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let a;a=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Set target URL `;let d;d=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: Edit target URL `;let x;x=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:copy${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Copy URL to clipboard `;let L;L=$localize`Be careful, this will overwrite everything you have in your destination.`;let G;G=$localize` Override target URL ${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON:`;let b;b=$localize`Set target URL`;let k;return k=$localize`Edit target URL`,[["formRef",""],["testUrl",""],i,e,t,n,a,d,x,L,G,b,k,["autocomplete","off",3,"submit"],[2,"position","absolute","left","-9999px","width","1px","height","1px","overflow","hidden"],["type","text","name","fake_email","tabindex","-1"],["type","password","name","fake_password","tabindex","-1"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small"],[3,"targetUrlChange","testSignalChange","targetUrl","testSignal","backupId","sourcePrefix","suppressErrorDialogs","askToCreate","testExpectation","moduleType"],[1,"current-destination",3,"targetUrl"],["shButton","","type","button",3,"click"],[3,"targetUrl","useBackupState"],[1,"form-actions"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click"],["menu",""],[3,"setDestination"],[3,"targetUrlChange","targetUrl","useBackupState"],[3,"isOpenChange","isOpen","options"],["header",""],[1,"target-dialog-header"],[1,"warn"],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(e,t){if(e&1){let n=C();W(0),r(1,"form",13,0),T("submit",function(){return l(n),_(t.next())}),r(3,"div",14),p(4,"input",15)(5,"input",16),s(),r(6,"header")(7,"h3",17)(8,"span"),D(9,2),s(),r(10,"div",18),S(11,De,3,0,"button",19)(12,Oe,9,1,"sh-menu"),s()(),r(13,"app-test-url",20,1),P("targetUrlChange",function(d){return l(n),f(t.targetUrlModel,d)||(t.targetUrlModel=d),_(d)})("testSignalChange",function(d){return l(n),f(t.testSignal,d)||(t.testSignal=d),_(d)}),s(),r(15,"app-destination-list-item",21)(16,"button",22),T("click",function(){return l(n),_(t.removeDestination())}),D(17,3),s()()(),S(18,Fe,1,0,"app-destination-list"),S(19,Pe,1,2,"app-single-destination",23),r(20,"div",24)(21,"button",22),T("click",function(){return l(n),_(t.goBack())}),N(22,4),p(23,"sh-icon"),E(),s(),r(24,"button",25),N(25,5),p(26,"sh-icon"),E(),s()()(),S(27,ye,16,5,"sh-dialog",26)}if(e&2){let n=H(!!t.targetUrlModel());g(11),m(n?12:11),g(2),F("targetUrl",t.targetUrlModel)("testSignal",t.testSignal),h("backupId",t.backupId())("sourcePrefix",null)("suppressErrorDialogs",!1)("askToCreate",!0)("testExpectation",t.isNew()?"destinationEmpty":"any")("moduleType","Backend"),g(2),h("targetUrl",t.targetUrlModel()),g(3),m(n?-1:18),g(),m(n?19:-1),g(5),X("loading",t.testSignal()=="testing"),h("disabled",t.testSignal()=="testing"||!n),g(3),m(t.targetUrlDialogOpen()?27:-1)}},dependencies:[Se,Ce,pe,me,ae,ie,Y,Z,ee,ne,te,ce,ge,de,re,le,se],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem;padding:2.5rem 2.5rem 0}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;height:100%;padding:0 0 2.5rem}.current-destination[_ngcontent-%COMP%]{margin:1rem 0 0}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}.target-dialog-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:.5rem}"],changeDetection:0})};export{je as createDestinationForm,qe as createDestinationFormGroup,$ as default};
@@ -1 +1 @@
1
- import{b as u}from"./chunk-3TJKPVBA.js";import{c as m}from"./chunk-CFNARBNK.js";import{C as o,E as p,M as h,R as N,W as r,l as c,la as s,na as l,v as f,z as d}from"./chunk-26Z7TPJB.js";var b=class a{#e=r(m);#o=r(u);serverState=this.#o.serverState;serverStateEffect=l(()=>{let t=this.#o.serverState();t?.LastNotificationUpdateID&&this.updateLastNotificationEventId(t?.LastNotificationUpdateID)});#s=-1;#a=s(!1);#t=s([]);#i=s([]);notifications=this.#t.asReadonly();init(){this.notifications().length===0&&this.getNotifications()}updateLastNotificationEventId(t){this.#s!==t&&(this.#s=t,this.getNotifications())}getNotifications(){this.#a.set(!0),this.#e.getApiV1Notifications().pipe(o(1),h(t=>this.#t.set(t)),p(()=>this.#a.set(!1))).subscribe()}getNofication(t){this.#e.getApiV1NotificationById({id:t}).pipe(o(1)).subscribe()}deleteNotification(t){let i=this.#t(),e=i[t];this.#i.set(i),i.splice(t,1),this.#t.set(i),this.#e.deleteApiV1NotificationById({id:e.ID}).pipe(o(1)).subscribe({error:()=>{this.#t.set(this.#i()),this.#i.set([])}})}deleteAllNotifications(){let t=this.#t();this.#i.set(t),this.#t.set([]);let i=t.map(e=>this.#e.deleteApiV1NotificationById({id:e.ID}).pipe(d(()=>c(e))));f(i).pipe(o(1)).subscribe({next:e=>{let g=e.filter(n=>n!=null&&"ID"in n);this.#t.set(g),this.#i.set([])},error:()=>{this.#t.set(this.#i()),this.#i.set([])}})}static \u0275fac=function(i){return new(i||a)};static \u0275prov=N({token:a,factory:a.\u0275fac,providedIn:"root"})};export{b as a};
1
+ import{b as u}from"./chunk-BFTGDQ4K.js";import{c as m}from"./chunk-CFNARBNK.js";import{C as o,E as p,M as h,R as N,W as r,l as c,la as s,na as l,v as f,z as d}from"./chunk-26Z7TPJB.js";var b=class a{#e=r(m);#o=r(u);serverState=this.#o.serverState;serverStateEffect=l(()=>{let t=this.#o.serverState();t?.LastNotificationUpdateID&&this.updateLastNotificationEventId(t?.LastNotificationUpdateID)});#s=-1;#a=s(!1);#t=s([]);#i=s([]);notifications=this.#t.asReadonly();init(){this.notifications().length===0&&this.getNotifications()}updateLastNotificationEventId(t){this.#s!==t&&(this.#s=t,this.getNotifications())}getNotifications(){this.#a.set(!0),this.#e.getApiV1Notifications().pipe(o(1),h(t=>this.#t.set(t)),p(()=>this.#a.set(!1))).subscribe()}getNofication(t){this.#e.getApiV1NotificationById({id:t}).pipe(o(1)).subscribe()}deleteNotification(t){let i=this.#t(),e=i[t];this.#i.set(i),i.splice(t,1),this.#t.set(i),this.#e.deleteApiV1NotificationById({id:e.ID}).pipe(o(1)).subscribe({error:()=>{this.#t.set(this.#i()),this.#i.set([])}})}deleteAllNotifications(){let t=this.#t();this.#i.set(t),this.#t.set([]);let i=t.map(e=>this.#e.deleteApiV1NotificationById({id:e.ID}).pipe(d(()=>c(e))));f(i).pipe(o(1)).subscribe({next:e=>{let g=e.filter(n=>n!=null&&"ID"in n);this.#t.set(g),this.#i.set([])},error:()=>{this.#t.set(this.#i()),this.#i.set([])}})}static \u0275fac=function(i){return new(i||a)};static \u0275prov=N({token:a,factory:a.\u0275fac,providedIn:"root"})};export{b as a};