@duplicati/ngclient 0.0.93 → 0.0.95

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 (68) hide show
  1. package/assets/spk.woff2 +0 -0
  2. package/{chunk-NWWH6FOD.js → chunk-2FWU7B4D.js} +1 -1
  3. package/{chunk-PN4QLDYL.js → chunk-3HJFVNAL.js} +1 -1
  4. package/chunk-3TZIEZUP.js +1 -0
  5. package/{chunk-X7RS746V.js → chunk-3ZLHMSKS.js} +1 -1
  6. package/{chunk-JBQGUGVU.js → chunk-5RLVPRCW.js} +1 -1
  7. package/chunk-APEDZMBI.js +1 -0
  8. package/{chunk-MEJJFYOP.js → chunk-AVNZ3OXK.js} +1 -1
  9. package/{chunk-5AD5B72M.js → chunk-DTR7JZFL.js} +1 -1
  10. package/chunk-DUPZCVLU.js +3 -0
  11. package/chunk-ECH6I3YN.js +1 -0
  12. package/chunk-ETPUKEDV.js +1 -0
  13. package/chunk-F4AVB6VB.js +1 -0
  14. package/chunk-FAZH6E7O.js +6 -0
  15. package/chunk-HWVDZXYD.js +1 -0
  16. package/{chunk-FXMKPZYY.js → chunk-ICOF6OY2.js} +1 -1
  17. package/{chunk-U4NNGRE4.js → chunk-IR7OYLKR.js} +1 -1
  18. package/{chunk-NKI2QDIB.js → chunk-KJ3CPTGU.js} +1 -1
  19. package/{chunk-L4FEHUC5.js → chunk-L4B5RE7R.js} +1 -1
  20. package/chunk-LFPZBC5Y.js +1 -0
  21. package/chunk-LVHYWUFN.js +1 -0
  22. package/chunk-M5YHW43W.js +6 -0
  23. package/chunk-MLJFOQOI.js +1 -0
  24. package/chunk-NU46HB6T.js +1 -0
  25. package/{chunk-IIXLH5ZP.js → chunk-ORA656R6.js} +1 -1
  26. package/chunk-P5GYPUJD.js +1 -0
  27. package/{chunk-G3EXCHQT.js → chunk-Q67EYU7V.js} +1 -1
  28. package/{chunk-MLWKZUCJ.js → chunk-QXYKZKGV.js} +1 -1
  29. package/{chunk-EDCLBXPN.js → chunk-R6R4GFBX.js} +1 -1
  30. package/chunk-RCP6EKCC.js +1 -0
  31. package/{chunk-LK3VCLPO.js → chunk-RDRLCN5M.js} +1 -1
  32. package/{chunk-HEWPPRUR.js → chunk-RHPHTHFC.js} +1 -1
  33. package/{chunk-GHKDRBKY.js → chunk-S5JZJBJS.js} +1 -1
  34. package/{chunk-72KOKABP.js → chunk-SNZ7FE6B.js} +1 -1
  35. package/chunk-SSXZ4GVY.js +1 -0
  36. package/{chunk-L5JFNWJY.js → chunk-TBPNAHEA.js} +1 -1
  37. package/{chunk-CZYVLZJY.js → chunk-TLNQL27Q.js} +1 -1
  38. package/chunk-TX5R4CFB.js +1 -0
  39. package/{chunk-OQEGPSC6.js → chunk-TYO44G6M.js} +1 -1
  40. package/{chunk-2F746EVW.js → chunk-VFLEQIHL.js} +1 -1
  41. package/{chunk-H2BQFBR7.js → chunk-VS2WUXLN.js} +1 -1
  42. package/{chunk-C5K65UWU.js → chunk-WNQBKJ3M.js} +1 -1
  43. package/chunk-WYXI4BXE.js +1 -0
  44. package/{chunk-BRABR4TV.js → chunk-XL5J65PI.js} +1 -1
  45. package/chunk-XQXYPXR7.js +1 -0
  46. package/{chunk-MEN7LF3Z.js → chunk-YKB6KLXM.js} +1 -1
  47. package/{chunk-5QXJ72T7.js → chunk-ZHWVTLKA.js} +1 -1
  48. package/index.html +2 -2
  49. package/{main-BFHA4U62.js → main-ZZ5NOUMD.js} +1 -1
  50. package/package.json +1 -1
  51. package/{styles-XKGGAPZF.css → styles-IOWRSZHV.css} +1 -1
  52. package/chunk-6CBLVQF7.js +0 -1
  53. package/chunk-72TEDEJQ.js +0 -1
  54. package/chunk-ADUML4PZ.js +0 -1
  55. package/chunk-BMGRMZMS.js +0 -1
  56. package/chunk-CRREGVJC.js +0 -1
  57. package/chunk-G7WA55U2.js +0 -1
  58. package/chunk-GPGZVGAS.js +0 -1
  59. package/chunk-HE7XNGM2.js +0 -3
  60. package/chunk-IWVXUCAK.js +0 -6
  61. package/chunk-LHHHM7NL.js +0 -1
  62. package/chunk-LZN3T7CR.js +0 -1
  63. package/chunk-OTABKUUH.js +0 -1
  64. package/chunk-PJ3V44DO.js +0 -1
  65. package/chunk-PU3VZLC6.js +0 -1
  66. package/chunk-R3DRARWT.js +0 -1
  67. package/chunk-RB3QECD4.js +0 -6
  68. package/chunk-XGR5AA4N.js +0 -1
@@ -1 +1 @@
1
- import{a as J}from"./chunk-PN4QLDYL.js";import{a as he}from"./chunk-G3EXCHQT.js";import{a as H}from"./chunk-N5K6ODRA.js";import{a as Re}from"./chunk-LK3VCLPO.js";import{a as Ne,b as M,d as L,e as $,h as D,j as Pe,m as y,p as A,q as b,r as Ie,s as v}from"./chunk-4IJQ7AAQ.js";import{b as I}from"./chunk-KLIPTMVG.js";import{a as P,c as d}from"./chunk-AIOUSVMR.js";import{a as h,g as k,l as Ee,o as de,p as Oe,r as fe,w as Ce}from"./chunk-R3DRARWT.js";import{pa as q}from"./chunk-2HS3CYRN.js";import{Ab as s,Bb as a,C as ae,Cb as l,D as f,Db as Y,Eb as U,Gb as x,H as le,M as pe,Mb as u,Mc as j,Nb as F,Ob as T,Pb as ue,Qa as S,Qb as Fe,R as _e,Sb as E,Tb as B,X as p,ca as C,da as R,db as N,fc as K,g as re,ib as w,ic as Se,qc as me,rb as m,sa as _,tb as ce,v as se,vc as ge,wb as G,xc as Te}from"./chunk-DTPZU6NP.js";var ke=new b,$e=()=>ke.group({passphrase:ke.control("")}),Z=class n{#t=p(I);#e=p(O);#o=p(d);#i=p(P);encryptionForm=this.#e.encryptionForm;creatingTemporaryBackup=_(!1);next(){let o=this.#e.destinationTargetUrl();if(!o)throw new Error("No target URL");this.creatingTemporaryBackup.set(!0);let e=this.encryptionForm.value?.passphrase??null,t=[{Name:"--no-encryption",Value:"true"}];e&&(t=[{Name:"--passphrase",Value:e}]),this.#t.postApiV1Backups({requestBody:{Backup:{TargetURL:o,Settings:t}},temporary:!0}).pipe(f(()=>this.creatingTemporaryBackup.set(!1))).subscribe({next:i=>{let r=i.ID;this.#e.getBackup(r),this.#o.navigate([`/restore-draft/${r}`])},error:i=>{console.error(i)}})}back(){this.#e.isFileRestore()?this.#o.navigate(["encryption"],{relativeTo:this.#i.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=N({type:n,selectors:[["app-restore-encryption"]],decls:12,vars:1,consts:()=>{let o;o=$localize`Enter backup passphrase if defined.`;let e;e=$localize`Password`;let t;t=$localize`${"\uFFFD#8\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_SPK_ICON: Back `;let i;return i=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `,[e,t,i,[3,"submit","formGroup"],["for","password"],["type","password","id","password","placeholder",o,"formControlName","passphrase"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"]]},template:function(e,t){e&1&&(s(0,"form",3),E("submit",function(){return t.next()}),s(1,"spk-form-field")(2,"label",4),T(3,0),a(),l(4,"input",5),a(),s(5,"div",6)(6,"button",7),E("click",function(){return t.back()}),u(7,1),l(8,"spk-icon"),F(),a(),s(9,"button",8),u(10,2),l(11,"spk-icon"),F(),a()()()),e&2&&m("formGroup",t.encryptionForm)},dependencies:[v,D,M,L,$,y,A,Ee,h,k],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})};function Ae(n,o){n&1&&l(0,"spk-progress-bar",7)}function be(n,o){if(n&1&&(s(0,"div",13),K(1),ge(2,"date"),a()),n&2){let e=o.$implicit;S(),Se("",e.Version,": ",Te(2,2,e.Time,"medium"),"")}}function ve(n,o){n&1&&l(0,"spk-progress-bar",7)}function we(n,o){if(n&1&&(s(0,"app-file-tree",14)(1,"label",15),T(2,4),a(),l(3,"input",16),a()),n&2){let e=B(3);m("rootPath",e.rootPath())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)}}function Ge(n,o){if(n&1&&w(0,we,4,4,"app-file-tree",14),n&2){let e=B(2);G((e.isDraft()&&!e.isRepairing()||!e.isDraft())&&e.backupSettings()?0:-1)}}function xe(n,o){if(n&1){let e=x();s(0,"spk-select",11),E("cleared",function(){C(e);let i=B();return R(i.abortLoading())}),l(1,"input",12),w(2,be,3,5,"ng-template"),a(),w(3,ve,1,0,"spk-progress-bar",7)(4,Ge,1,1)}if(n&2){let e=B();m("options",e.versionOptions())("isClearable",!0),S(3),G(e.isDraft()&&e.isRepairing()||e.versionOptionsLoading()||e.loadingRootPath()?3:-1),S(),G(e.showFileTree()?4:-1)}}var Q=new b,De=()=>Q.group({filesToRestore:Q.control(""),selectedOption:Q.control(null),passphrase:Q.control(null)}),te=class n{#t=p(I);#e=p(O);#o=p(d);#i=p(P);#n=p(q);#r=p(Re);selectFilesForm=this.#e.selectFilesForm;selectFilesFormSignal=this.#e.selectFilesFormSignal;selectOptionSignal=this.#e.selectOptionSignal;backupId=this.#e.backupId;versionOptionsLoading=this.#e.versionOptionsLoading;versionOptions=this.#e.versionOptions;isDraft=this.#e.isDraft;isFileRestore=this.#e.isFileRestore;showFileTree=_(!1);backupSettings=_(null);rootPath=_(void 0);loadingRootPath=_(!1);isRepairing=_(!1);loadingEffect=j(()=>{if(this.versionOptionsLoading())return;let e=this.versionOptions();if(e&&e?.length>0){let t=e[0].Version;Number.isInteger(t)&&this.selectFilesForm.controls.selectedOption.setValue(t)}});backupSettingsEffect=j(()=>{let o=this.backupId(),e=this.isRepairing(),t=typeof this.selectOptionSignal()=="string"?parseInt(this.selectOptionSignal()):this.selectOptionSignal();if(typeof t!="number"||!o)return;let r=this.versionOptions()?.find(c=>c.Version===t)?.Time??null;!r||e||(this.showFileTree.set(!1),queueMicrotask(()=>{let c={id:o+"",time:r};this.backupSettings.set(c),this.getRootPath(c)}))});repairEffect=j(()=>{let o=this.#e.isDraft(),e=this.selectOptionSignal(),t=this.versionOptions();if(o&&e){let i=t.find(c=>c.Version===parseInt(e));if(i===void 0)return;let r=this.backupId();this.isRepairing.set(!0),this.#t.postApiV1BackupByIdRepairupdate({id:r,requestBody:{only_paths:!0,time:i.Time}}).subscribe(c=>{let W=c.ID;var X=window.setInterval(()=>{this.#t.getApiV1TaskByTaskid({taskid:W}).subscribe(z=>{z.Status==="Completed"&&(clearInterval(X),this.isRepairing.set(!1))})},1e3)})}});getRootPath(o){let e={id:o.id+"",time:o.time,prefixOnly:!0,folderContents:!1};this.isRepairing()||(this.loadingRootPath.set(!0),this.#t.getApiV1BackupByIdFiles(e).pipe(pe(this.abortLoading$),f(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1)})).subscribe({next:t=>{let i=t.Files[0].Path;this.rootPath.set(i)}}))}abortLoading$=new re;abortLoading(){this.showFileTree.set(!1),this.loadingRootPath.set(!1),this.abortLoading$.next(!0)}displayFn(){let o=this.versionOptions();return e=>{if(!e)return"";let t=o?.find(i=>typeof i.Version=="number"&&i.Version.toString()===e);return t?`${t.Version}: ${this.#n.transform(t.Time,"medium")}`:""}}next(){this.#o.navigate(["options"],{relativeTo:this.#i.parent})}back(){this.#e.isFileRestore()?this.#o.navigate(["encryption"],{relativeTo:this.#i.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=N({type:n,selectors:[["app-select-files"]],features:[me([q])],decls:13,vars:3,consts:()=>{let o;o=$localize`Select files`;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let t;t=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let i;i=$localize`Select an option...`;let r;return r=$localize`Path`,[["formRef",""],o,e,t,r,[3,"submit","formGroup"],[1,"title-30"],[1,"indeterminate","primary"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],["value","Version",3,"cleared","options","isClearable"],["type","text","placeholder",i,"formControlName","selectedOption"],[1,"custom-option"],[3,"rootPath","backupSettings","multiSelect","showFiles"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]]},template:function(e,t){if(e&1){let i=x();s(0,"form",5,0),E("submit",function(){return C(i),R(t.next())}),s(2,"h3",6),T(3,1),a(),w(4,Ae,1,0,"spk-progress-bar",7)(5,xe,5,4),s(6,"div",8)(7,"button",9),E("click",function(){return C(i),R(t.back())}),u(8,2),l(9,"spk-icon"),F(),a(),s(10,"button",10),u(11,3),l(12,"spk-icon"),F(),a()()()}e&2&&(m("formGroup",t.selectFilesForm),S(4),G(t.versionOptionsLoading()?4:5),S(5),ue(t.isFileRestore()?"Back":"Exit"),Fe(8))},dependencies:[Ie,D,M,L,$,v,y,A,q,J,k,h,fe,de],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 O=class n{#t=p(d);#e=p(I);backupId=_(null);backup=_(null);destinationTargetUrl=_(null);selectFilesForm=De();optionsForm=ye();encryptionForm=$e();optionsFormSignal=H(this.optionsForm.valueChanges);selectFilesFormSignal=H(this.selectFilesForm.valueChanges);selectOptionSignal=H(this.selectFilesForm.controls.selectedOption.valueChanges);versionOptionsLoading=_(!1);versionOptions=_([]);isSubmitting=_(!1);isDraft=_(!1);isFileRestore=_(!1);init(o,e=!1,t=!1){this.backupId.set(o),this.isFileRestore.set(e),this.isDraft.set(t),e&&this.#t.navigate(["/restore-from-files/destination"]),e||this.getBackup(o,!0)}updateTargetUrl(o){this.destinationTargetUrl.set(o)}submit(){this.isSubmitting.set(!0);let o=this.backupId(),e=this.optionsForm.value,t=this.selectFilesForm.value,i=this.versionOptions()?.find(r=>r.Version===t.selectedOption);this.#e.postApiV1BackupByIdRestore({id:o??"",requestBody:{paths:t.filesToRestore?.split("\0").map(r=>`${r}*`)??[],passphrase:t.passphrase??null,time:i?.Time,restore_path:e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!0}}).pipe(f(()=>this.isSubmitting.set(!1))).subscribe({next:()=>this.exit(),error:r=>{console.error("restore error",r)}})}exit(){this.#o(),this.#t.navigate(["/"])}getVersionOptions(){this.versionOptions()}getBackup(o,e=!1){this.versionOptionsLoading.set(!0),se([this.#e.getApiV1BackupById({id:o}),this.#e.getApiV1BackupByIdFilesets({id:o}).pipe(le(3))]).pipe(ae(1),f(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([t,i])=>{this.versionOptions.set(i),this.backup.set(t)}})}#o(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||n)};static \u0275prov=_e({token:n,factory:n.\u0275fac,providedIn:"root"})};var V=new b,ye=()=>V.group({restoreFrom:V.control("orignal"),restoreFromPath:V.control(""),handleExisting:V.control("overwrite"),permissions:V.control(!1)}),oe=class n{#t=p(O);#e=p(d);#o=p(P);optionsForm=this.#t.optionsForm;optionsFormSignal=this.#t.optionsFormSignal;isSubmitting=this.#t.isSubmitting;goBack(){this.#e.navigate(["select-files"],{relativeTo:this.#o.parent})}submit(){this.#t.submit()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=N({type:n,selectors:[["app-advanced-options-settings"]],decls:39,vars:6,consts:()=>{let o;o=$localize`Restore options`;let e;e=$localize`Where do you want to restore files from?`;let t;t=$localize` Original location ${"\uFFFD#9\uFFFD\uFFFD/#9\uFFFD"}:TAG_INPUT:`;let i;i=$localize` Pick location ${"\uFFFD#12\uFFFD\uFFFD/#12\uFFFD"}:TAG_INPUT:`;let r;r=$localize`How do you want to handle existing files?`;let c;c=$localize` Overwrite ${"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"}:TAG_INPUT:`;let W;W=$localize` Save different versions with timestamp in file name ${"\uFFFD#25\uFFFD\uFFFD/#25\uFFFD"}:TAG_INPUT:`;let X;X=$localize`Permissions`;let z;z=$localize` Restore read/write permissions ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let ie;ie=$localize`${"\uFFFD#35\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#35\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let ne;return ne=$localize`${"\uFFFD#38\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_SPK_ICON: Submit `,[["formRef",""],o,e,t,i,r,c,W,X,z,ie,ne,[3,"submit","formGroup"],[1,"title-30"],[3,"disallowToggle"],["title",""],[1,"raised","primary"],["type","radio","name","restoreFrom","value","orignal","formControlName","restoreFrom"],["type","radio","name","restoreFrom","value","pickLocation","formControlName","restoreFrom"],[3,"disabled"],["for","path"],["type","text","id","path","formControlName","restoreFromPath"],["type","radio","name","handleExisting","value","overwrite","formControlName","handleExisting"],["type","radio","name","handleExisting","value","saveTimestamp","formControlName","handleExisting"],[1,"primary","raised"],["type","checkbox","formControlName","permissions"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"]]},template:function(e,t){if(e&1){let i=x();s(0,"form",12,0),E("submit",function(){return C(i),R(t.submit())}),s(2,"h3",13),T(3,1),a(),s(4,"app-toggle-card",14),Y(5,15),T(6,2),U(),s(7,"spk-radio",16),u(8,3),l(9,"input",17),F(),a(),s(10,"spk-radio",16),u(11,4),l(12,"input",18),F(),a(),s(13,"app-file-tree",19)(14,"label",20),K(15,"Path"),a(),l(16,"input",21),a()(),s(17,"app-toggle-card",14),Y(18,15),T(19,5),U(),s(20,"spk-radio",16),u(21,6),l(22,"input",22),F(),a(),s(23,"spk-radio",16),u(24,7),l(25,"input",23),F(),a()(),s(26,"app-toggle-card"),Y(27,15),T(28,8),U(),s(29,"spk-toggle",24),u(30,9),l(31,"input",25),F(),a()(),s(32,"div",26)(33,"button",27),E("click",function(){return C(i),R(t.goBack())}),u(34,10),l(35,"spk-icon"),F(),a(),s(36,"button",28),u(37,11),l(38,"spk-icon"),F(),a()()()}if(e&2){let i;m("formGroup",t.optionsForm),S(4),m("disallowToggle",!0),S(9),m("disabled",((i=t.optionsFormSignal())==null?null:i.restoreFrom)!=="pickLocation"),S(4),m("disallowToggle",!0),S(19),ce("loader",t.isSubmitting())}},dependencies:[v,D,M,Ne,Pe,L,$,y,A,he,J,Ce,Oe,k,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{ye as a,oe as b,$e as c,Z as d,De as e,te as f,O as g};
1
+ import{a as he}from"./chunk-Q67EYU7V.js";import{a as H}from"./chunk-N5K6ODRA.js";import{a as J}from"./chunk-3HJFVNAL.js";import{a as Re}from"./chunk-RDRLCN5M.js";import{a as Ne,b as M,d as L,e as $,h as D,j as Pe,m as y,p as A,q as b,r as Ie,s as v}from"./chunk-4IJQ7AAQ.js";import{a as P,c as d}from"./chunk-AIOUSVMR.js";import{a as h,g as k,l as Ee,o as de,p as Oe,r as fe,x as Ce}from"./chunk-ECH6I3YN.js";import{b as I}from"./chunk-KLIPTMVG.js";import{pa as q}from"./chunk-2HS3CYRN.js";import{Ab as s,Bb as a,C as ae,Cb as l,D as f,Db as Y,Eb as U,Gb as x,H as le,M as pe,Mb as u,Mc as j,Nb as F,Ob as T,Pb as ue,Qa as S,Qb as Fe,R as _e,Sb as E,Tb as B,X as p,ca as C,da as R,db as N,fc as K,g as re,ib as w,ic as Se,qc as me,rb as m,sa as _,tb as ce,v as se,vc as ge,wb as G,xc as Te}from"./chunk-DTPZU6NP.js";var ke=new b,$e=()=>ke.group({passphrase:ke.control("")}),Z=class n{#t=p(I);#e=p(O);#o=p(d);#i=p(P);encryptionForm=this.#e.encryptionForm;creatingTemporaryBackup=_(!1);next(){let o=this.#e.destinationTargetUrl();if(!o)throw new Error("No target URL");this.creatingTemporaryBackup.set(!0);let e=this.encryptionForm.value?.passphrase??null,t=[{Name:"--no-encryption",Value:"true"}];e&&(t=[{Name:"--passphrase",Value:e}]),this.#t.postApiV1Backups({requestBody:{Backup:{TargetURL:o,Settings:t}},temporary:!0}).pipe(f(()=>this.creatingTemporaryBackup.set(!1))).subscribe({next:i=>{let r=i.ID;this.#e.getBackup(r),this.#o.navigate([`/restore-draft/${r}`])},error:i=>{console.error(i)}})}back(){this.#e.isFileRestore()?this.#o.navigate(["encryption"],{relativeTo:this.#i.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=N({type:n,selectors:[["app-restore-encryption"]],decls:12,vars:1,consts:()=>{let o;o=$localize`Enter backup passphrase if defined.`;let e;e=$localize`Password`;let t;t=$localize`${"\uFFFD#8\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_SPK_ICON: Back `;let i;return i=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `,[e,t,i,[3,"submit","formGroup"],["for","password"],["type","password","id","password","placeholder",o,"formControlName","passphrase"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"]]},template:function(e,t){e&1&&(s(0,"form",3),E("submit",function(){return t.next()}),s(1,"spk-form-field")(2,"label",4),T(3,0),a(),l(4,"input",5),a(),s(5,"div",6)(6,"button",7),E("click",function(){return t.back()}),u(7,1),l(8,"spk-icon"),F(),a(),s(9,"button",8),u(10,2),l(11,"spk-icon"),F(),a()()()),e&2&&m("formGroup",t.encryptionForm)},dependencies:[v,D,M,L,$,y,A,Ee,h,k],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})};function Ae(n,o){n&1&&l(0,"spk-progress-bar",7)}function be(n,o){if(n&1&&(s(0,"div",13),K(1),ge(2,"date"),a()),n&2){let e=o.$implicit;S(),Se("",e.Version,": ",Te(2,2,e.Time,"medium"),"")}}function ve(n,o){n&1&&l(0,"spk-progress-bar",7)}function we(n,o){if(n&1&&(s(0,"app-file-tree",14)(1,"label",15),T(2,4),a(),l(3,"input",16),a()),n&2){let e=B(3);m("rootPath",e.rootPath())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)}}function Ge(n,o){if(n&1&&w(0,we,4,4,"app-file-tree",14),n&2){let e=B(2);G((e.isDraft()&&!e.isRepairing()||!e.isDraft())&&e.backupSettings()?0:-1)}}function xe(n,o){if(n&1){let e=x();s(0,"spk-select",11),E("cleared",function(){C(e);let i=B();return R(i.abortLoading())}),l(1,"input",12),w(2,be,3,5,"ng-template"),a(),w(3,ve,1,0,"spk-progress-bar",7)(4,Ge,1,1)}if(n&2){let e=B();m("options",e.versionOptions())("isClearable",!0),S(3),G(e.isDraft()&&e.isRepairing()||e.versionOptionsLoading()||e.loadingRootPath()?3:-1),S(),G(e.showFileTree()?4:-1)}}var Q=new b,De=()=>Q.group({filesToRestore:Q.control(""),selectedOption:Q.control(null),passphrase:Q.control(null)}),te=class n{#t=p(I);#e=p(O);#o=p(d);#i=p(P);#n=p(q);#r=p(Re);selectFilesForm=this.#e.selectFilesForm;selectFilesFormSignal=this.#e.selectFilesFormSignal;selectOptionSignal=this.#e.selectOptionSignal;backupId=this.#e.backupId;versionOptionsLoading=this.#e.versionOptionsLoading;versionOptions=this.#e.versionOptions;isDraft=this.#e.isDraft;isFileRestore=this.#e.isFileRestore;showFileTree=_(!1);backupSettings=_(null);rootPath=_(void 0);loadingRootPath=_(!1);isRepairing=_(!1);loadingEffect=j(()=>{if(this.versionOptionsLoading())return;let e=this.versionOptions();if(e&&e?.length>0){let t=e[0].Version;Number.isInteger(t)&&this.selectFilesForm.controls.selectedOption.setValue(t)}});backupSettingsEffect=j(()=>{let o=this.backupId(),e=this.isRepairing(),t=typeof this.selectOptionSignal()=="string"?parseInt(this.selectOptionSignal()):this.selectOptionSignal();if(typeof t!="number"||!o)return;let r=this.versionOptions()?.find(c=>c.Version===t)?.Time??null;!r||e||(this.showFileTree.set(!1),queueMicrotask(()=>{let c={id:o+"",time:r};this.backupSettings.set(c),this.getRootPath(c)}))});repairEffect=j(()=>{let o=this.#e.isDraft(),e=this.selectOptionSignal(),t=this.versionOptions();if(o&&e){let i=t.find(c=>c.Version===parseInt(e));if(i===void 0)return;let r=this.backupId();this.isRepairing.set(!0),this.#t.postApiV1BackupByIdRepairupdate({id:r,requestBody:{only_paths:!0,time:i.Time}}).subscribe(c=>{let W=c.ID;var X=window.setInterval(()=>{this.#t.getApiV1TaskByTaskid({taskid:W}).subscribe(z=>{z.Status==="Completed"&&(clearInterval(X),this.isRepairing.set(!1))})},1e3)})}});getRootPath(o){let e={id:o.id+"",time:o.time,prefixOnly:!0,folderContents:!1};this.isRepairing()||(this.loadingRootPath.set(!0),this.#t.getApiV1BackupByIdFiles(e).pipe(pe(this.abortLoading$),f(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1)})).subscribe({next:t=>{let i=t.Files[0].Path;this.rootPath.set(i)}}))}abortLoading$=new re;abortLoading(){this.showFileTree.set(!1),this.loadingRootPath.set(!1),this.abortLoading$.next(!0)}displayFn(){let o=this.versionOptions();return e=>{if(!e)return"";let t=o?.find(i=>typeof i.Version=="number"&&i.Version.toString()===e);return t?`${t.Version}: ${this.#n.transform(t.Time,"medium")}`:""}}next(){this.#o.navigate(["options"],{relativeTo:this.#i.parent})}back(){this.#e.isFileRestore()?this.#o.navigate(["encryption"],{relativeTo:this.#i.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=N({type:n,selectors:[["app-select-files"]],features:[me([q])],decls:13,vars:3,consts:()=>{let o;o=$localize`Select files`;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let t;t=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let i;i=$localize`Select an option...`;let r;return r=$localize`Path`,[["formRef",""],o,e,t,r,[3,"submit","formGroup"],[1,"title-30"],[1,"indeterminate","primary"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],["value","Version",3,"cleared","options","isClearable"],["type","text","placeholder",i,"formControlName","selectedOption"],[1,"custom-option"],[3,"rootPath","backupSettings","multiSelect","showFiles"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]]},template:function(e,t){if(e&1){let i=x();s(0,"form",5,0),E("submit",function(){return C(i),R(t.next())}),s(2,"h3",6),T(3,1),a(),w(4,Ae,1,0,"spk-progress-bar",7)(5,xe,5,4),s(6,"div",8)(7,"button",9),E("click",function(){return C(i),R(t.back())}),u(8,2),l(9,"spk-icon"),F(),a(),s(10,"button",10),u(11,3),l(12,"spk-icon"),F(),a()()()}e&2&&(m("formGroup",t.selectFilesForm),S(4),G(t.versionOptionsLoading()?4:5),S(5),ue(t.isFileRestore()?"Back":"Exit"),Fe(8))},dependencies:[Ie,D,M,L,$,v,y,A,q,J,k,h,fe,de],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 O=class n{#t=p(d);#e=p(I);backupId=_(null);backup=_(null);destinationTargetUrl=_(null);selectFilesForm=De();optionsForm=ye();encryptionForm=$e();optionsFormSignal=H(this.optionsForm.valueChanges);selectFilesFormSignal=H(this.selectFilesForm.valueChanges);selectOptionSignal=H(this.selectFilesForm.controls.selectedOption.valueChanges);versionOptionsLoading=_(!1);versionOptions=_([]);isSubmitting=_(!1);isDraft=_(!1);isFileRestore=_(!1);init(o,e=!1,t=!1){this.backupId.set(o),this.isFileRestore.set(e),this.isDraft.set(t),e&&this.#t.navigate(["/restore-from-files/destination"]),e||this.getBackup(o,!0)}updateTargetUrl(o){this.destinationTargetUrl.set(o)}submit(){this.isSubmitting.set(!0);let o=this.backupId(),e=this.optionsForm.value,t=this.selectFilesForm.value,i=this.versionOptions()?.find(r=>r.Version===t.selectedOption);this.#e.postApiV1BackupByIdRestore({id:o??"",requestBody:{paths:t.filesToRestore?.split("\0").map(r=>`${r}*`)??[],passphrase:t.passphrase??null,time:i?.Time,restore_path:e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!0}}).pipe(f(()=>this.isSubmitting.set(!1))).subscribe({next:()=>this.exit(),error:r=>{console.error("restore error",r)}})}exit(){this.#o(),this.#t.navigate(["/"])}getVersionOptions(){this.versionOptions()}getBackup(o,e=!1){this.versionOptionsLoading.set(!0),se([this.#e.getApiV1BackupById({id:o}),this.#e.getApiV1BackupByIdFilesets({id:o}).pipe(le(3))]).pipe(ae(1),f(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([t,i])=>{this.versionOptions.set(i),this.backup.set(t)}})}#o(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||n)};static \u0275prov=_e({token:n,factory:n.\u0275fac,providedIn:"root"})};var V=new b,ye=()=>V.group({restoreFrom:V.control("orignal"),restoreFromPath:V.control(""),handleExisting:V.control("overwrite"),permissions:V.control(!1)}),oe=class n{#t=p(O);#e=p(d);#o=p(P);optionsForm=this.#t.optionsForm;optionsFormSignal=this.#t.optionsFormSignal;isSubmitting=this.#t.isSubmitting;goBack(){this.#e.navigate(["select-files"],{relativeTo:this.#o.parent})}submit(){this.#t.submit()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=N({type:n,selectors:[["app-advanced-options-settings"]],decls:39,vars:6,consts:()=>{let o;o=$localize`Restore options`;let e;e=$localize`Where do you want to restore files from?`;let t;t=$localize` Original location ${"\uFFFD#9\uFFFD\uFFFD/#9\uFFFD"}:TAG_INPUT:`;let i;i=$localize` Pick location ${"\uFFFD#12\uFFFD\uFFFD/#12\uFFFD"}:TAG_INPUT:`;let r;r=$localize`How do you want to handle existing files?`;let c;c=$localize` Overwrite ${"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"}:TAG_INPUT:`;let W;W=$localize` Save different versions with timestamp in file name ${"\uFFFD#25\uFFFD\uFFFD/#25\uFFFD"}:TAG_INPUT:`;let X;X=$localize`Permissions`;let z;z=$localize` Restore read/write permissions ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let ie;ie=$localize`${"\uFFFD#35\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#35\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let ne;return ne=$localize`${"\uFFFD#38\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_SPK_ICON: Submit `,[["formRef",""],o,e,t,i,r,c,W,X,z,ie,ne,[3,"submit","formGroup"],[1,"title-30"],[3,"disallowToggle"],["title",""],[1,"raised","primary"],["type","radio","name","restoreFrom","value","orignal","formControlName","restoreFrom"],["type","radio","name","restoreFrom","value","pickLocation","formControlName","restoreFrom"],[3,"disabled"],["for","path"],["type","text","id","path","formControlName","restoreFromPath"],["type","radio","name","handleExisting","value","overwrite","formControlName","handleExisting"],["type","radio","name","handleExisting","value","saveTimestamp","formControlName","handleExisting"],[1,"primary","raised"],["type","checkbox","formControlName","permissions"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"]]},template:function(e,t){if(e&1){let i=x();s(0,"form",12,0),E("submit",function(){return C(i),R(t.submit())}),s(2,"h3",13),T(3,1),a(),s(4,"app-toggle-card",14),Y(5,15),T(6,2),U(),s(7,"spk-radio",16),u(8,3),l(9,"input",17),F(),a(),s(10,"spk-radio",16),u(11,4),l(12,"input",18),F(),a(),s(13,"app-file-tree",19)(14,"label",20),K(15,"Path"),a(),l(16,"input",21),a()(),s(17,"app-toggle-card",14),Y(18,15),T(19,5),U(),s(20,"spk-radio",16),u(21,6),l(22,"input",22),F(),a(),s(23,"spk-radio",16),u(24,7),l(25,"input",23),F(),a()(),s(26,"app-toggle-card"),Y(27,15),T(28,8),U(),s(29,"spk-toggle",24),u(30,9),l(31,"input",25),F(),a()(),s(32,"div",26)(33,"button",27),E("click",function(){return C(i),R(t.goBack())}),u(34,10),l(35,"spk-icon"),F(),a(),s(36,"button",28),u(37,11),l(38,"spk-icon"),F(),a()()()}if(e&2){let i;m("formGroup",t.optionsForm),S(4),m("disallowToggle",!0),S(9),m("disabled",((i=t.optionsFormSignal())==null?null:i.restoreFrom)!=="pickLocation"),S(4),m("disallowToggle",!0),S(19),ce("loader",t.isSubmitting())}},dependencies:[v,D,M,Ne,Pe,L,$,y,A,he,J,Ce,Oe,k,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{ye as a,oe as b,$e as c,Z as d,De as e,te as f,O as g};
@@ -0,0 +1 @@
1
+ import{b as u}from"./chunk-KLIPTMVG.js";import{D as p,Lc as r,N as a,R as l,X as m,sa as i}from"./chunk-DTPZU6NP.js";var d=class n{#s=m(u);isLoaded=i(!1);systemInfo=i(null);filterGroups=i(null);backendModules=r(()=>this.systemInfo()?.BackendModules??[]);allOptionsGrouped=r(()=>{let e={displayName:"Default",options:this.systemInfo()?.Options?.map(this.#e)??[]},s=this.systemInfo()?.GenericModules?.map(t=>({displayName:t.DisplayName??t.Key,options:t.Options?.map(this.#e)??[]}))??[],o=this.systemInfo()?.CompressionModules?.map(t=>({displayName:t.DisplayName??t.Key,options:t.Options?.map(this.#e)??[]}))??[];return[e,...s,...o]});allOptions=r(()=>this.allOptionsGrouped().reduce((e,s)=>[...e,...s.options],[]));preload(e=!1){let s=this.#s.getApiV1Systeminfo().pipe(a(o=>{this.systemInfo.set(o)}),p(()=>this.isLoaded.set(!0)));if(e)return s;s.subscribe()}preloadFilterGroups(e=!1){let s=this.#s.getApiV1SysteminfoFiltergroups().pipe(a(o=>{this.filterGroups.set(o)}),p(()=>this.isLoaded.set(!0)));if(e)return s;s.subscribe()}#e(e){return{name:e.Name,type:e.Type,shortDescription:e.ShortDescription??void 0,longDescription:e.LongDescription??void 0,options:e.ValidValues}}static \u0275fac=function(s){return new(s||n)};static \u0275prov=l({token:n,factory:n.\u0275fac,providedIn:"root"})};export{d as a};
@@ -0,0 +1 @@
1
+ import{c as a,d as b,e as c}from"./chunk-M5YHW43W.js";import"./chunk-Q67EYU7V.js";import"./chunk-DNHLTHLR.js";import"./chunk-N5K6ODRA.js";import"./chunk-RCP6EKCC.js";import"./chunk-3HJFVNAL.js";import"./chunk-LFPZBC5Y.js";import"./chunk-CK5N2PPF.js";import"./chunk-4IJQ7AAQ.js";import"./chunk-AIOUSVMR.js";import"./chunk-THUAAYGA.js";import"./chunk-ECH6I3YN.js";import"./chunk-KLIPTMVG.js";import"./chunk-V5GVLIPJ.js";import"./chunk-2HS3CYRN.js";import"./chunk-DTPZU6NP.js";import"./chunk-C6Q5SG76.js";export{a as createDestinationForm,b as createDestinationFormGroup,c as default};
@@ -0,0 +1,6 @@
1
+ import{a as Ve}from"./chunk-Q67EYU7V.js";import{a as kt,b as Wt}from"./chunk-DNHLTHLR.js";import{a as U}from"./chunk-N5K6ODRA.js";import{a as qt}from"./chunk-RCP6EKCC.js";import{a as ut}from"./chunk-3HJFVNAL.js";import{a as lt}from"./chunk-LFPZBC5Y.js";import{a as Qe}from"./chunk-CK5N2PPF.js";import{a as Ue,b as oe,c as Te,d as ie,e as he,f as pt,g as Ht,h as De,i as Re,l as ct,m as Ee,n as xe,o as jt,p as ye,q,r as mt,s as Pe}from"./chunk-4IJQ7AAQ.js";import{a as fe,c as J}from"./chunk-AIOUSVMR.js";import{a as ee,b as rt,d as Kt,e as zt,g as Me,l as te,n as Xt,o as at,r as ne,x as Le,y as st}from"./chunk-ECH6I3YN.js";import{b as Ge}from"./chunk-KLIPTMVG.js";import{c as Bt}from"./chunk-V5GVLIPJ.js";import{ia as Vt}from"./chunk-2HS3CYRN.js";import{A as Tt,Ab as s,Bb as a,Cb as m,D as Xe,Db as X,Eb as H,Fb as He,Gb as v,Lc as b,Mb as g,Mc as it,Nb as C,Ob as I,Pb as Et,Qa as l,Qb as yt,R as Ie,Rb as we,Sb as y,Tb as c,Wb as me,X as $,Xa as ge,Yb as Lt,Zb as V,ca as T,cc as Ce,da as h,db as Z,dc as Se,ec as ue,fc as S,gc as Pt,ha as Gt,hc as z,ib as _,ic as Ut,kc as et,l as ft,lc as tt,mc as nt,nc as At,oa as ht,oc as Nt,p as ze,pa as Dt,pc as Ot,rb as u,rc as ot,sa as N,sc as je,tb as Ne,uc as We,wb as D,xb as le,yb as pe,yc as qe,zb as ce}from"./chunk-DTPZU6NP.js";import{a as A,c as bt}from"./chunk-C6Q5SG76.js";var _t=class e{fromString(n){if(!n)return null;let t=n.match(/(\d+)([smhDWMY])/);return t&&{value:parseInt(t[1]),unit:t[2]}}toString(n,t){return`${n}${t}`}static \u0275fac=function(t){return new(t||e)};static \u0275prov=Ie({token:e,factory:e.\u0275fac,providedIn:"root"})};var Ae=class e{#e=$(Ge);s3Providers=U(this.getS3Config("Providers"));s3Regions=U(this.getS3Config("Regions"));s3RegionHosts=U(this.getS3Config("RegionHosts"));s3StorageClasses=U(this.getS3Config("StorageClasses"));storjSatellites=U(this.getStorjConfig("Satellites"));storjAuthenticationMethods=U(this.getStorjConfig("AuthenticationMethods"));openstackProviders=U(this.getOpenstackConfig("Providers"));openstackVersions=U(this.getOpenstackConfig("Versions"));gcsLocations=U(this.getGcsConfig("Locations"));gcsStorageClasses=U(this.getGcsConfig("StorageClasses"));getS3Config(n){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-getconfig",requestBody:{"s3-config":n}}).pipe(ze(t=>this.#t(t)))}createS3IamUser(n,t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"CanCreateUser","s3-username":n,"s3-password":t}})}createS3PolicyIAM(n){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"GetPolicyDoc",path:n}})}getStorjConfig(n){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"storj-getconfig",requestBody:{"storj-config":n}}).pipe(ze(t=>this.#t(t)))}getOpenstackConfig(n){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"openstack-getconfig",requestBody:{"openstack-config":n}}).pipe(ze(t=>this.#t(t)))}getGcsConfig(n){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"gcs-getconfig",requestBody:{"gcs-config":n}}).pipe(ze(t=>this.#t(t)))}#t(n){return(n.Result&&typeof n.Result=="object"&&Object.entries(n.Result).map(([t,o])=>({key:t,value:o})))??[]}static \u0275fac=function(t){return new(t||e)};static \u0275prov=Ie({token:e,factory:e.\u0275fac,providedIn:"root"})};function ve(e){return e==null?"":":"+e.toString()}function Q(e){return e==null?"":e.startsWith("/")?e:"/"+e}function R(e,n){let t={},o={};return n.searchParams.forEach((i,r)=>{ke.find(p=>p.key===e)?.dynamicFields?.includes(r)?o[r]=decodeURIComponent(i):t[r]=decodeURIComponent(i)}),{advanced:t,dynamic:o}}function x(e,n=!1){let t=e.map(([i,r])=>`${i}=${r?encodeURIComponent(r.toString()):""}`).join("&");return t?(n?"":"?")+t:""}function dt(e){let n=e.destinationType,t=ke.find(o=>o.customKey===n||o.key===n);if(!t)throw new Error("Invalid destination type");return t?.mapper.to(e)??""}function $t(e){let n=URL.canParse(e),t=e.split("://")[0],o=e.split("://")[1],i="http://"+o;if(o.startsWith("%")&&t==="file")return ke.find(r=>r.customKey===t||r.key===t)?.mapper.from(t,new URL("http://localhost"),e);try{let r=new URL(i);return ke.find(p=>p.customKey===t||p.key===t)?.mapper.from(t,r,e)}catch(r){console.error("Error while parsing target path",r)}if(!n)throw new Error("Invalid target path");return null}var F=new q,ke=[{key:"file",displayName:"File system",description:"Store backups on your local file system.",customFields:{path:{type:"FolderTree",name:"path",shortDescription:"File path",longDescription:"The path to store the backup",formElement:e=>F.control(e??"")}},mapper:{to:e=>{let n=x([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${e.custom.path}${n}`},from:(e,n,t)=>{let i=t.startsWith("file:///")?t.split("file:///")[1]:t.split("file://")[1],r=i.startsWith("%"),f=i.slice(1).startsWith(":\\")||r?i:"/"+i;return A({destinationType:e,custom:{path:f}},R(e,n))}}},{key:"ssh",displayName:"SSH",description:"Store backups in SSH.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"The server to connect to",formElement:e=>F.control(e??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"The port to connect to",formElement:e=>F.control(e??"",[Te.required,Te.max(65535)])},path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:e=>F.control(e??"")}},dynamicFields:["auth-username"],advancedFields:[{type:"FileTree",name:"ssh-keyfile",accepts:".key,",shortDescription:"This is a path to a private key file locally on the machine",longDescription:"This is a path to a private key file locally on the machine"}],mapper:{to:e=>{let n=x([...Object.entries(e.advanced),...Object.entries(e.dynamic)]),{port:t,server:o,path:i}=e.custom;return`${e.destinationType}://${o+ve(t)+Q(i)+n}`},from:(e,n,t)=>A({destinationType:e,custom:{server:n.hostname,port:n.port,path:n.pathname}},R(e,n))}},{key:"s3",displayName:"S3 compatible bucket",description:"Store backups in any S3 compatible bucket.",customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:e=>F.control(e??"")},path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:e=>F.control(e??"")}},dynamicFields:[{name:"s3-server-name",shortDescription:"Server",type:"NonValidatedSelectableString",loadOptions:e=>e.get(Ae).s3Providers},"use-ssl","auth-username","auth-password"],advancedFields:[{name:"s3-client",type:"Enumeration",options:["aws","minio"]},{name:"s3-storage-class",type:"NonValidatedSelectableString",loadOptions:e=>e.get(Ae).s3StorageClasses}],mapper:{to:e=>{let{bucket:n,path:t}=e.custom,o=x([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n+Q(t)+o}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.pathname,bucket:n.hostname}},R(e,n))}},{key:"gcs",displayName:"Google Cloud Storage",description:"Store backups in Google Cloud Storage.",oauthField:"authid",customFields:{path:{type:"Path",name:"path",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:e=>F.control(e??"")}},dynamicFields:[{name:"gcs-location",type:"NonValidatedSelectableString",loadOptions:e=>e.get(Ae).gcsLocations},{name:"gcs-storage-class",type:"NonValidatedSelectableString",loadOptions:e=>e.get(Ae).gcsStorageClasses},"authid"],mapper:{to:e=>{let n=x([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${e.custom.path}${n}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.hostname+n.pathname}},R(e,n))}},{key:"googledrive",displayName:"Google Drive",description:"Store backups in Google Drive.",oauthField:"authid",customFields:{path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:e=>F.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=e.custom.path,t=x([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.hostname+n.pathname}},R(e,n))}},{key:"pcloud",displayName:"pCloud",description:"Store backups in pCloud.",oauthField:"authid",customFields:{server:{type:"Enumeration",name:"server",loadOptions:()=>N([{key:"pCloud Global",value:"api.pcloud.com"},{key:"pCloud Europe",value:"eapi.pcloud.com"}]),shortDescription:"Server",longDescription:"Server",formElement:e=>F.control(e??"")},path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:e=>F.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=e.custom.path,t=x([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>{let o=n.pathname.replace(/^\//,"");return A({destinationType:e,custom:{server:n.hostname,path:o}},R(e,n))}}},{key:"azure",displayName:"Azure Blob Storage",description:"Store backups in Azure Blob Storage.",customFields:{path:{type:"String",name:"path",shortDescription:"Container name",longDescription:"Container name",formElement:e=>F.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Account name"},{name:"auth-password",shortDescription:"Access key"}],mapper:{to:e=>{let n=e.custom.path,t=x([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.hostname+n.pathname}},R(e,n))}},{key:"onedrivev2",displayName:"OneDrive",description:"Store backups in OneDrive.",oauthField:"authid",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>F.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=e.custom.path,t=x([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.hostname+n.pathname}},R(e,n))}},{key:"od4b",displayName:"OneDrive Business",description:"Store backups in OneDrive Business.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:e=>F.control(e??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:e=>F.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>F.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Account name"},{name:"auth-password",shortDescription:"Access key"}],mapper:{to:e=>{let n=x([...Object.entries(e.advanced),...Object.entries(e.dynamic)]),{port:t,server:o,path:i}=e.custom;return`${e.destinationType}://${o+ve(t)+Q(i)+n}`},from:(e,n,t)=>A({destinationType:e,custom:{server:n.hostname,port:n.port,path:n.pathname}},R(e,n))}},{key:"mssp",displayName:"Microsoft SharePoint",description:"Store backups in Microsoft SharePoint.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:e=>F.control(e??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:e=>F.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>F.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Account name"},{name:"auth-password",shortDescription:"Access key"}],mapper:{to:e=>{let n=x([...Object.entries(e.advanced),...Object.entries(e.dynamic)]),{port:t,server:o,path:i}=e.custom;return`${e.destinationType}://${o+ve(t)+Q(i)+n}`},from:(e,n,t)=>A({destinationType:e,custom:{server:n.hostname,port:n.port,path:n.pathname}},R(e,n))}},{key:"sharepoint",displayName:"Microsoft SharePoint v2",description:"Store backups in Microsoft SharePoint.",oauthField:"authid",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>F.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=e.custom.path,t=x([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.hostname+n.pathname}},R(e,n))}},{key:"dropbox",displayName:"Dropbox",description:"Store backups in Dropbox.",oauthField:"authid",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>F.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=e.custom.path,t=x([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.hostname+n.pathname}},R(e,n))}},{key:"box",displayName:"Box.com",description:"Store backups in Box.com.",oauthField:"authid",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>F.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=e.custom.path,t=x([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.hostname+n.pathname}},R(e,n))}},{key:"jottacloud",displayName:"Jottacloud",description:"Store backups in Jottacloud.",oauthField:"authid",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>F.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=e.custom.path,t=x([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.hostname+n.pathname}},R(e,n))}},{key:"b2",displayName:"B2 Cloud Storage",description:"Store backups in B2 Cloud Storage.",customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:e=>F.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path in the bucket",longDescription:"Path in the bucket",formElement:e=>F.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Application ID"},{name:"auth-password",shortDescription:"Application Key"}],mapper:{to:e=>{let{bucket:n,path:t}=e.custom,o=x([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n+Q(t)+o}`},from:(e,n,t)=>A({destinationType:e,custom:{bucket:n.hostname,path:n.pathname}},R(e,n))}},{key:"e2",displayName:"IDrive e2",description:"Store backups in IDrive e2.",customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:e=>F.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path in the bucket",longDescription:"Path in the bucket",formElement:e=>F.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Access ID"},{name:"auth-password",shortDescription:"Access Secret"}],mapper:{to:e=>{let{bucket:n,path:t}=e.custom,o=x([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n+Q(t)+o}`},from:(e,n,t)=>A({destinationType:e,custom:{bucket:n.hostname,path:n.pathname}},R(e,n))}},{key:"mega",displayName:"Mega.nz",description:"Store backups in Mega.nz.",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>F.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:e=>{let n=e.custom.path,t=x([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.hostname+n.pathname}},R(e,n))}},{key:"msgroup",displayName:"Microsoft Office 365 Group",description:"Store backups in Microsoft Office 365 Group.",oauthField:"authid",customFields:{groupEmail:{type:"Email",name:"groupEmail",shortDescription:"Group email",longDescription:"Group email",formElement:e=>F.control(e??"",[Te.email])},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>F.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=e.custom.path,t=x([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.hostname+n.pathname}},R(e,n))}},{key:"cloudfiles",displayName:"Rackspace CloudFiles",description:"Store backups in Rackspace CloudFiles.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:e=>F.control(e??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:e=>F.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>F.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:e=>{let n=x([...Object.entries(e.advanced),...Object.entries(e.dynamic)]),{port:t,server:o,path:i}=e.custom;return`${e.destinationType}://${o+ve(t)+Q(i)+n}`},from:(e,n,t)=>A({destinationType:e,custom:{server:n.hostname,port:n.port,path:n.pathname}},R(e,n))}},{key:"rclone",displayName:"Rclone",description:"Store backups in Rclone.",dynamicFields:[{name:"rclone-local-repository",shortDescription:"Local repository",defaultValue:""},{name:"rclone-remote-repository",shortDescription:"Remote repository",defaultValue:""},{name:"rclone-remote-path",shortDescription:"Path on remote repository",defaultValue:""}],mapper:{to:e=>{let n=e.dynamic["rclone-remote-repository"],t=e.dynamic["rclone-remote-path"],o=Object.entries(e.dynamic).filter(([r])=>!["rclone-remote-repository","rclone-remote-path"].includes(r)),i=x([...Object.entries(e.advanced),...o]);return`${e.destinationType}://${n}/${t+i}`},from:(e,n,t)=>{let{advanced:o,dynamic:i}=R(e,n);return A({destinationType:e,dynamic:A({"rclone-remote-repository":n.hostname,"rclone-remote-path":n.pathname},i)},o)}}},{key:"openstack",displayName:"OpenStack Object Storage",description:"Store backups in OpenStack Object Storage.",customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket",longDescription:"Bucket",formElement:e=>F.control(e??"")}},dynamicFields:[{name:"openstack-authuri",shortDescription:"Auth URI",type:"Enumeration",loadOptions:e=>e.get(Ae).openstackProviders},{name:"openstack-version",shortDescription:"Version",type:"Enumeration",loadOptions:e=>e.get(Ae).openstackVersions},{name:"openstack-domain-name",shortDescription:"Domain name"},{name:"openstack-tenant-name",shortDescription:"Tenant name"},{name:"openstack-region",shortDescription:"Region"}],mapper:{to:e=>{let n=x([...Object.entries(e.advanced),...Object.entries(e.dynamic)]),{bucket:t}=e.custom;return`${e.destinationType}://${t+n}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.pathname,bucket:n.hostname}},R(e,n))}},{key:"webdav",displayName:"WebDAV",description:"Store backups in WebDAV.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:e=>F.control(e??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:e=>F.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>F.control(e??"")}},dynamicFields:[{name:"use-ssl",shortDescription:"Use SSL"},{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:e=>{let{port:n,server:t,path:o}=e.custom,i=e.dynamic["use-ssl"],r=x([...Object.entries(e.advanced),...Object.entries(e.dynamic).filter(([p])=>p!=="use-ssl")]);return`${e.destinationType}${i?"s":""}://${t+ve(n)+Q(o)+r}`},from:(e,n,t)=>A({destinationType:e,custom:{server:n.hostname,port:n.port,path:n.pathname}},R(e,n))}},{key:"aftp",displayName:"FTP",description:"Store backups in FTP.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:e=>F.control(e??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:e=>F.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>F.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:e=>{let{port:n,server:t,path:o}=e.custom,i=x([...Object.entries(e.advanced),...Object.entries(e.dynamic).filter(([r])=>r!=="use-ssl")]);return`${e.destinationType}://${t+ve(n)+Q(o)+i}`},from:(e,n,t)=>A({destinationType:e,custom:{server:n.hostname,port:n.port,path:n.pathname}},R(e,n))}},{key:"sia",displayName:"Sia Decentrilized Cloud",description:"Store backups in Sia Decentrilized Cloud.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:e=>F.control(e??"")}},dynamicFields:["sia-targetpath","sia-password","sia-redundancy"],mapper:{to:e=>{let n=e.custom.server,t=e.dynamic["sia-targetpath"],o=x([...Object.entries(e.advanced),...Object.entries(e.dynamic).filter(([i])=>i!=="sia-targetpath")]);return`${e.destinationType}://${n+Q(t)+o}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.pathname}},R(e,n))}},{key:"cos",displayName:"Tencent COS",description:"Store backups in Tencent COS.",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>F.control(e??"")}},dynamicFields:[{name:"cos-bucket",shortDescription:"Bucket",order:1},{name:"cos-region",shortDescription:"Region",order:2},{name:"cos-app-id",shortDescription:"COS App Id",order:3},{name:"cos-secret-id",shortDescription:"COS Secret Id",order:4},{name:"cos-secret-key",shortDescription:"COS Secret Key",order:5}],mapper:{to:e=>{let n=e.custom.path,t=x([...Object.entries(e.advanced),...Object.entries(e.dynamic).filter(([o])=>o!=="cos-targetpath")]);return`${e.destinationType}://${n+t}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.pathname}},R(e,n))}},{key:"tahoe",displayName:"Tahoe LAFS",description:"Store backups in Tahoe LAFS.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:e=>F.control(e??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:e=>F.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>F.control(e??"")},username:{type:"String",name:"username",shortDescription:"Username",longDescription:"Username",formElement:e=>F.control(e??"")},password:{type:"Password",name:"password",shortDescription:"Password",longDescription:"Password",formElement:e=>F.control(e??"")}},dynamicFields:[{name:"use-ssl",shortDescription:"Use SSL"}],mapper:{to:e=>{let{port:n,server:t,path:o,username:i,password:r}=e.custom,p={"auth-username":i,"auth-password":r},f=e.dynamic["use-ssl"],k=x([...Object.entries(e.advanced),...Object.entries(e.dynamic).filter(([d])=>d!=="use-ssl"),...Object.entries(p)]);return`${e.destinationType}${f?"s":""}://${t+ve(n)+Q(o)+k}`},from:(e,n,t)=>A({destinationType:e,custom:{server:n.hostname,port:n.port,path:n.pathname}},R(e,n))}},{key:"cifs",displayName:"CIFS",description:"Store backups in CIFS.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:e=>F.control(e??"")},share:{type:"String",name:"share",shortDescription:"Share Name",longDescription:"Share Name",formElement:e=>F.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>F.control(e??"")}},dynamicFields:["transport","auth-username","auth-password","auth-domain"],mapper:{to:e=>{let{share:n,server:t,path:o,username:i,password:r}=e.custom,p={"auth-username":i,"auth-password":r},f=x([...Object.entries(e.advanced),...Object.entries(p)]);return`${e.destinationType}://${t+Q(n)+Q(o)+f}`},from:(e,n,t)=>{let o=n.pathname.split("/")[1],i=n.pathname.split("/").slice(2).join("/");return A({destinationType:e,custom:{server:n.hostname,share:o,path:i}},R(e,n))}}},{key:"storj",customKey:"storjAccessGrant",displayName:"Storj Access Grant",description:"Store backups in Storj Access Grant.",dynamicFields:[{name:"storj-shared-access",shortDescription:"Access Grant"},{name:"storj-bucket",shortDescription:"Bucket"},{name:"storj-folder",shortDescription:"Path on server"}],mapper:{to:e=>`storj://storj.io/config?storj-auth-method=Access%20grant&storj-satellite=us1.storj.io%3A7777&storj-api-key&storj-secret&${x([...Object.entries(e.advanced),...Object.entries(e.dynamic)],!0)}`,from:(e,n,t)=>A({destinationType:e},R(e,n))}},{key:"storj",customKey:"storjApiKey",displayName:"Storj API Key",description:"Store backups in Storj API Key.",dynamicFields:[{name:"storj-satellite",shortDescription:"Satellite",type:"Enumeration",loadOptions:e=>e.get(Ae).storjSatellites},{name:"storj-api-key",shortDescription:"API Key"},{name:"storj-secret",shortDescription:"Secret"},{name:"storj-bucket",shortDescription:"Bucket"},{name:"storj-folder",shortDescription:"Path on server"}],mapper:{to:e=>`storj://storj.io/config?storj-auth-method=API%20key&${x([...Object.entries(e.advanced),...Object.entries(e.dynamic)],!0)}`,from:(e,n,t)=>A({destinationType:e},R(e,n))}}];var Qt=/[a-zA-Z0-9_\-\+\.!@#$%^&*?_~()-]/,Ft=class e{generate(n,t=Qt){let o;do o=this.generatePassword(n,t);while(this.calculatePasswordStrength(o)<5);return o}generatePassword(n,t=Qt){let o=this;return Array.apply(null,{length:n}).map(()=>{let i;for(;;)if(i=String.fromCharCode(o.#e()),t.test(i))return i},this).join("")}calculatePasswordStrength(n){let t=1;return n.length>=8&&t++,n.match(/[a-z]/)&&n.match(/[A-Z]/)&&t++,n.match(/\d+/)&&t++,n.match(/.[!,@,#,$,%,^,&,*,?,_,~,(,),-]/)&&t++,Math.min(t,5)}#e(){if(window.crypto&&window.crypto.getRandomValues){let n=new Uint8Array(1);return window.crypto.getRandomValues(n),n[0]}else if(window.msCrypto&&window.msCrypto.getRandomValues){let n=new Uint8Array(1);return window.msCrypto.getRandomValues(n),n[0]}else return Math.floor(Math.random()*256)}static \u0275fac=function(t){return new(t||e)};static \u0275prov=Ie({token:e,factory:e.\u0275fac,providedIn:"root"})};var sn=["formRef"];function ln(e,n){if(e&1&&S(0),e&2){let t=n.$implicit;z(" ",t.DisplayName," ")}}function pn(e,n){if(e&1&&m(0,"spk-progress-bar",37),e&2){let t=c(3);Ne("error",t.calculatePasswordStrength()===1)("warn",t.calculatePasswordStrength()===2)("primary",t.calculatePasswordStrength()===4)("success",t.calculatePasswordStrength()===5),u("value",t.calculatePasswordStrength()*(100/5))}}function cn(e,n){e&1&&(s(0,"span",32),I(1,9),a())}function mn(e,n){e&1&&(g(0,7,1),m(1,"spk-icon"),C())}function un(e,n){e&1&&(g(0,7,2),m(1,"spk-icon"),C())}function _n(e,n){e&1&&(g(0,10,1),m(1,"spk-icon",39),C())}function dn(e,n){e&1&&(g(0,10,2),m(1,"spk-icon"),C())}function Fn(e,n){if(e&1){let t=v();s(0,"button",38),y("click",function(){T(t);let i=c(3);return h(i.copyPassword())}),g(1,10),_(2,_n,2,0)(3,dn,2,0),C(),a()}if(e&2){let t=c(3);l(2),D(t.copiedPassword()?2:3)}}function gn(e,n){e&1&&(s(0,"spk-alert",36),I(1,11),a())}function Cn(e,n){if(e&1){let t=v();s(0,"div",27)(1,"spk-form-field")(2,"label",28),g(3,6),m(4,"sup"),C(),a(),m(5,"input",29),a(),_(6,pn,1,9,"spk-progress-bar",30),s(7,"spk-form-field"),m(8,"input",31),_(9,cn,2,0,"span",32),a(),s(10,"div",33)(11,"button",34),y("click",function(){T(t);let i=c(2);return h(i.showPassword.set(!i.showPassword()))}),g(12,7),_(13,mn,2,0)(14,un,2,0),C(),a(),s(15,"button",34),y("click",function(){T(t);let i=c(2);return h(i.generatePassword())}),g(16,8),m(17,"spk-icon"),C(),a(),_(18,Fn,4,1,"button",35),a(),_(19,gn,2,0,"spk-alert",36),a()}if(e&2){let t=c(2);l(5),u("type",t.showPassword()?"text":"password"),l(),D(t.generalForm.value.password?6:-1),l(2),u("type",t.showPassword()?"text":"password"),l(),D(t.generalForm.value.repeatPassword&&t.generalForm.value.repeatPassword!==t.generalForm.value.password?9:-1),l(4),D(t.showPassword()?13:14),l(5),D(t.showCopyPassword()?18:-1),l(),D(t.generalForm.value.password&&t.generalForm.value.password===t.generalForm.value.repeatPassword?19:-1)}}function Sn(e,n){if(e&1&&(s(0,"spk-select",24)(1,"label",25),I(2,5),a(),m(3,"input",26),_(4,ln,1,1,"ng-template"),a(),_(5,Cn,20,7,"div",27)),e&2){let t=c();u("options",t.encryptionOptions())("isClearable",!1),l(5),D(t.encryptionFieldSignal()!==""?5:-1)}}function fn(e,n){if(e&1&&(s(0,"button",22),g(1,12),m(2,"spk-icon"),C(),a()),e&2){let t=c();u("disabled",t.generalForm.invalid)}}function Tn(e,n){if(e&1&&(s(0,"spk-tooltip",23)(1,"button",22),g(2,13),m(3,"spk-icon"),C(),a()()),e&2){let t=c();u("disabled",!(t.showCopyPassword()&&!t.copiedPassword())),l(),u("disabled",t.generalForm.invalid||t.showCopyPassword()&&!t.copiedPassword())}}var Be=new q,Yt=(e={name:"",description:"",encryption:"",password:"",repeatPassword:""})=>Be.group({name:Be.control(e.name,[Te.required]),description:Be.control(e.description),encryption:Be.control(e.encryption,[Wt()]),password:Be.control(e.password,[kt(n=>n?.value.encryption!=="",[Te.required])]),repeatPassword:Be.control(e.repeatPassword,[kt(n=>n?.value.encryption!=="",[Te.required])])}),Mt={Key:"",DisplayName:"None"},It=class e{#e=$(J);#t=$(fe);#o=$(Ft);#i=$(re);#n=$(lt);formRef=ge.required("formRef");generalForm=this.#i.generalForm;generalFormSignal=this.#i.generalFormSignal;encryptionFieldSignal=this.#i.encryptionFieldSignal;encryptionOptions=this.#i.encryptionOptions;isNew=this.#i.isNew;showPassword=N(!1);copiedPassword=N(!1);showCopyPassword=N(!1);encryptionEffect=it(()=>{this.encryptionFieldSignal()===""&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});calculatePasswordStrength=b(()=>{let t=this.generalFormSignal()?.password??"";return this.#o.calculatePasswordStrength(t)});ngOnInit(){this.formRef().nativeElement.focus()}exit(){this.#i.exit()}async copyPassword(){let n=this.generalForm.controls.password.value;await this.#r(n??""),this.copiedPassword.set(!0)}async#r(n){try{await navigator.clipboard.writeText(n)}catch{try{let o=document.createElement("textarea");o.value=n,document.body.appendChild(o),o.select(),document.execCommand("copy"),document.body.removeChild(o)}catch(o){console.error("Failed to copy text: ",o)}}}displayFn(){let n=this.#n.systemInfo()?.EncryptionModules??[];return t=>{let o=[Mt,...n].find(i=>i.Key===t);return o?`${o.DisplayName}`:""}}generatePassword(){this.copiedPassword.set(!1);let n=this.#o.generate(16);this.generalForm.controls.password.setValue(n),this.generalForm.controls.repeatPassword.setValue(n),this.showCopyPassword.set(!0)}next(){this.#e.navigate(["destination"],{relativeTo:this.#t.parent})}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=Z({type:e,selectors:[["app-general"]],viewQuery:function(t,o){t&1&&Ce(o.formRef,sn,5),t&2&&Se()},decls:20,vars:3,consts:()=>{let n;n=$localize`Your backup name`;let t;t=$localize`Your backup description`;let o;o=$localize`General backup settings`;let i;i=$localize` Backup name ${"\uFFFD#7\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#7\uFFFD"}:CLOSE_SUPERSCRIPT:`;let r;r=$localize`Backup description`;let p;p=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: Exit `;let f;f=$localize`Encryption`;let k;k=$localize`Encryption`;let d;d=$localize`Password`;let G;G=$localize`Repeat password`;let B;B=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let O;O=$localize`${"\uFFFD*13:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SPK_ICON:eye-slash${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: hide ${"\uFFFD/*13:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*14:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SPK_ICON:eye${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: show ${"\uFFFD/*14:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,O=we(O);let K;K=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: Generate password `;let ae;ae=$localize`Passwords do not match`;let W;W=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SPK_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copied password ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SPK_ICON_1:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copy password ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,W=we(W);let E;E=$localize` Tip: Be sure to save your password. If you loose it you will lose access to your backups. `;let P;P=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let L;return L=$localize` Continue ${"\uFFFD#3\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[["formRef",""],o,i,r,p,k,B,O,K,ae,W,E,P,L,["autocomplete","off",3,"submit","formGroup"],[1,"title-30"],["for","backupName"],["type","text","tabindex","1","placeholder",n,"formControlName","name"],["for","backupDescription"],["id","backupDescription","tabindex","2","placeholder",t,"formControlName","description"],[1,"form-actions"],["type","button","spk-button","",3,"click"],["spk-button","","type","submit",1,"raised","primary",3,"disabled"],["message","Remember to copy the password",1,"primary",3,"disabled"],["value","Key","label","DisplayName",3,"options","isClearable"],["for","encryption"],["type","text","id","encryption","tabindex","3","placeholder",f,"formControlName","encryption"],[1,"passwords"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",d,"formControlName","password",3,"type"],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",G,"formControlName","repeatPassword",3,"type"],["error",""],[1,"password-actions"],["spk-button","","type","button",1,"small",3,"click"],["spk-button","","type","button",1,"small","copy"],["type","primary"],[1,"raised",3,"value"],["spk-button","","type","button",1,"small","copy",3,"click"],[1,"spk-success"]]},template:function(t,o){if(t&1){let i=v();s(0,"form",14,0),y("submit",function(){return T(i),h(o.next())}),s(2,"h3",15),I(3,1),a(),s(4,"spk-form-field")(5,"label",16),g(6,2),m(7,"sup"),C(),a(),m(8,"input",17),a(),s(9,"spk-form-field")(10,"label",18),I(11,3),a(),m(12,"textarea",19),a(),_(13,Sn,6,3),s(14,"div",20)(15,"button",21),y("click",function(){return T(i),h(o.exit())}),g(16,4),m(17,"spk-icon"),C(),a(),_(18,fn,3,1,"button",22)(19,Tn,4,2,"spk-tooltip",23),a()()}t&2&&(u("formGroup",o.generalForm),l(13),D(o.isNew()?13:-1),l(5),D(o.encryptionFieldSignal()===""?18:19))},dependencies:[Pe,De,oe,ie,he,Ee,ye,te,ne,Me,ee,at,rt,st],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}sup[_ngcontent-%COMP%]{padding:0 .125rem;color:var(--error-500)}.passwords[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.password-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.copy[_ngcontent-%COMP%] spk-icon.spk-success[_ngcontent-%COMP%]{color:var(--success-500)}"],changeDetection:0})};var hn=["formRef"],Dn=()=>["encryption-module","--no-encryption","--exclude-files-attributes","--skip-files-larger-than","dblock-size","no-encryption"];function En(e,n){e&1&&(g(0,2,1),m(1,"spk-icon",13),C())}function yn(e,n){e&1&&(s(0,"p",13),I(1,7),a())}var Ke=new q,Zt=["Bytes","KB","MB","GB","TB","PB"],Pn=[{value:"",name:$localize`Keep all backups`},{value:"time",name:$localize`Delete backups that are older than`},{value:"versions",name:$localize`Keep a specific number of backups`},{value:"smart",name:$localize`Smart backup retention`},{value:"custom",name:$localize`Custom backup retention`}],An=1024*1024*1024*2,Nn=1024*1024*5,Jt=(e={remoteVolumeSize:50,size:"MB",backupRetention:"",advancedOptions:[]})=>Ke.group({remoteVolumeSize:Ke.group({size:Ke.control(e.remoteVolumeSize),unit:Ke.control(e.size)}),backupRetention:Ke.control(e.backupRetention),advancedOptions:Ke.group({})}),Rt=class e{#e=$(re);#t=$(J);#o=$(fe);formRef=ge.required("formRef");optionsForm=this.#e.optionsForm;selectedOptions=this.#e.selectedOptions;nonSelectedOptions=this.#e.nonSelectedOptions;isSubmitting=this.#e.isSubmitting;settings=this.#e.settings;sizeOptions=N(Zt);retentionOptions=N(Pn);volumeSizeSignal=U(this.optionsForm.controls.remoteVolumeSize.get("size")?.valueChanges.pipe(Tt(300))??ft(null));volumeUnitSignal=U(this.optionsForm.controls.remoteVolumeSize.get("unit")?.valueChanges.pipe(Tt(300))??ft(null));exceededVolumeSize=b(()=>{let n=this.volumeSizeSignal()??this.optionsForm.controls.remoteVolumeSize.get("size")?.value,t=this.volumeUnitSignal()??this.optionsForm.controls.remoteVolumeSize.get("unit")?.value;if(n==null||t===null||t===void 0)return!1;let o=n*Math.pow(1024,Zt.indexOf(t));return o>An||o<Nn});goBack(){this.#t.navigate(["schedule"],{relativeTo:this.#o.parent})}submit(){this.#e.submit()}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=Z({type:e,selectors:[["app-advanced-options-settings"]],viewQuery:function(t,o){t&1&&Ce(o.formRef,hn,5),t&2&&Se()},decls:30,vars:12,consts:()=>{let n;n=$localize`Select an option...`;let t;t=$localize`Options`;let o;o=$localize` Remote volume size ${"\uFFFD*9:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SPK_ICON:warning${"\uFFFD/#1:1\uFFFD"}:CLOSE_TAG_SPK_ICON:${"\uFFFD/*9:1\uFFFD"}:CLOSE_BLOCK_IF:`;let i;i=$localize` The backups will be split up into multiple files called volumes. Here you can set the maximum size of the individual volume files. ${"\uFFFD#16\uFFFD"}:START_LINK: Read more ${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:arrow-square-out${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON:${"\uFFFD/#16\uFFFD"}:CLOSE_LINK:`;let r;r=$localize`Backup retention`;let p;p=$localize`${"\uFFFD#26\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#26\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let f;f=$localize`${"\uFFFD#29\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#29\uFFFD"}:CLOSE_TAG_SPK_ICON: Submit `;let k;return k=$localize` The chosen size is outside the recommended range. This may cause performance issues, excessively large temporary files or other problems. `,[["formRef",""],t,o,i,r,p,f,k,[3,"submit","formGroup"],[1,"title-30"],[1,"remote-volume-wrap"],["formGroupName","remoteVolumeSize",1,"row-inputs"],["for","size"],[1,"warning"],["type","number","id","size","formControlName","size"],["placeholder",n,3,"options","inlineSearch"],["type","text","formControlName","unit"],["href","https://forum.duplicati.com/t/choosing-sizes-in-duplicati/17683","target","_blank",1,"spk-primary"],["suffix",""],["value","value","label","name",3,"options","inlineSearch"],["type","text","formControlName","backupRetention"],[3,"optionsChange","options","hiddenOptions"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"]]},template:function(t,o){if(t&1){let i=v();s(0,"form",8,0),y("submit",function(){return T(i),h(o.submit())}),s(2,"h3",9),I(3,1),a(),s(4,"div",10)(5,"div",11)(6,"spk-form-field")(7,"label",12),g(8,2),_(9,En,2,0,"spk-icon",13),C(),a(),m(10,"input",14),a(),s(11,"spk-select",15),m(12,"input",16),a()(),_(13,yn,2,0,"p",13),s(14,"p"),g(15,3),s(16,"a",17),m(17,"spk-icon",18),a(),C(),a()(),s(18,"spk-select",19)(19,"label",12),I(20,4),a(),m(21,"input",20),a(),s(22,"app-options-list",21),nt("optionsChange",function(p){return T(i),tt(o.settings,p)||(o.settings=p),h(p)}),a(),s(23,"div",22)(24,"button",23),y("click",function(){return T(i),h(o.goBack())}),g(25,5),m(26,"spk-icon"),C(),a(),s(27,"button",24),g(28,6),m(29,"spk-icon"),C(),a()()()}t&2&&(u("formGroup",o.optionsForm),l(9),D(o.exceededVolumeSize()?9:-1),l(2),u("options",o.sizeOptions())("inlineSearch",!0),l(2),D(o.exceededVolumeSize()?13:-1),l(5),u("options",o.retentionOptions())("inlineSearch",!0),l(4),et("options",o.settings),u("hiddenOptions",ot(11,Dn)),l(5),Ne("loader",o.isSubmitting()))},dependencies:[Pe,De,oe,Re,ie,he,Ee,ye,xe,qt,Me,ee,te,ne],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}.form-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.form-column[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.form-column[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{font-size:1rem}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}.form-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 2.5rem;gap:.5rem;align-items:flex-end}.remote-volume-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.remote-volume-wrap[_ngcontent-%COMP%] p.warning[_ngcontent-%COMP%]{color:#7d7d00}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.advanced-option[_ngcontent-%COMP%]{display:grid;gap:.5rem;grid-template-columns:1fr 1fr 40px;align-items:flex-end}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}spk-select[_ngcontent-%COMP%]{--miw: p2r(120)}"],changeDetection:0})};var On=["formRef"];function kn(e,n){if(e&1){let t=v();s(0,"div",26)(1,"spk-form-field")(2,"label",27),I(3,8),a(),s(4,"input",28,1),y("focus",function(){T(t);let i=ue(5);return h(i.showPicker())}),a(),s(6,"spk-icon",29),S(7,"clock"),a()(),s(8,"spk-form-field"),m(9,"label",30),s(10,"input",31,2),y("focus",function(){T(t);let i=ue(11);return h(i.showPicker())}),a(),s(12,"spk-icon",29),S(13,"calendar"),a()()(),X(14,32),s(15,"div",33)(16,"spk-form-field")(17,"label",34),I(18,9),a(),m(19,"input",35),a(),s(20,"spk-select",36),m(21,"input",37),a()(),s(22,"app-toggle-card",38),X(23,39),I(24,10),H(),s(25,"div",40)(26,"spk-toggle",21),g(27,11),m(28,"input",41),C(),a(),s(29,"spk-toggle",21),g(30,12),m(31,"input",42),C(),a(),s(32,"spk-toggle",21),g(33,13),m(34,"input",43),C(),a(),s(35,"spk-toggle",21),g(36,14),m(37,"input",44),C(),a(),s(38,"spk-toggle",21),g(39,15),m(40,"input",45),C(),a(),s(41,"spk-toggle",21),g(42,16),m(43,"input",46),C(),a(),s(44,"spk-toggle",21),g(45,17),m(46,"input",47),C(),a()()(),H()}if(e&2){let t=c();l(20),u("options",t.unitOptions)("isClearable",!1),l(2),u("disallowToggle",!0)}}var j=new q,en=[{key:"s",label:$localize`Seconds`},{key:"m",label:$localize`Minutes`},{key:"h",label:$localize`Hours`},{key:"D",label:$localize`Days`},{key:"W",label:$localize`Weeks`},{key:"M",label:$localize`Months`},{key:"Y",label:$localize`Years`}],tn=(e={autoRun:!0,nextTime:{time:"13:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!1,tue:!1,wed:!1,thu:!1,fri:!1,sat:!1,sun:!1}}})=>j.group({autoRun:j.control(e.autoRun),nextTime:j.group({time:j.control(e.nextTime.time),date:j.control(e.nextTime.date)}),runAgain:j.group({repeatValue:j.control(e.runAgain.repeatValue),repeatUnit:j.control(e.runAgain.repeatUnit),allowedDays:j.group({mon:j.control(e.runAgain.allowedDays.mon),tue:j.control(e.runAgain.allowedDays.tue),wed:j.control(e.runAgain.allowedDays.wed),thu:j.control(e.runAgain.allowedDays.thu),fri:j.control(e.runAgain.allowedDays.fri),sat:j.control(e.runAgain.allowedDays.sat),sun:j.control(e.runAgain.allowedDays.sun)})})}),xt=class e{#e=$(re);#t=$(J);#o=$(fe);formRef=ge.required("formRef");scheduleForm=this.#e.scheduleForm;scheduleFormSignal=this.#e.scheduleFormSignal;unitOptions=en;displayFn(n){let t=en.find(o=>o.key===n);return t?`${t.label}`:""}goBack(){this.#t.navigate(["source-data"],{relativeTo:this.#o.parent})}next(){this.#t.navigate(["options"],{relativeTo:this.#o.parent})}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=Z({type:e,selectors:[["app-schedule"]],viewQuery:function(t,o){t&1&&Ce(o.formRef,On,5),t&2&&Se()},decls:18,vars:2,consts:()=>{let n;n=$localize`Schedule`;let t;t=$localize` Automatically run backups ${"\uFFFD#7\uFFFD\uFFFD/#7\uFFFD"}:TAG_INPUT:`;let o;o=$localize`If a date was missed, the job will run as soon as possible.`;let i;i=$localize`${"\uFFFD#14\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let r;r=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let p;p=$localize`Next time`;let f;f=$localize`Run again every`;let k;k=$localize`Allowed days`;let d;d=$localize` Monday ${"\uFFFD#28\uFFFD\uFFFD/#28\uFFFD"}:TAG_INPUT:`;let G;G=$localize` Tuesday ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let B;B=$localize` Wednesday ${"\uFFFD#34\uFFFD\uFFFD/#34\uFFFD"}:TAG_INPUT:`;let O;O=$localize` Thursday ${"\uFFFD#37\uFFFD\uFFFD/#37\uFFFD"}:TAG_INPUT:`;let K;K=$localize` Friday ${"\uFFFD#40\uFFFD\uFFFD/#40\uFFFD"}:TAG_INPUT:`;let ae;ae=$localize` Saturday ${"\uFFFD#43\uFFFD\uFFFD/#43\uFFFD"}:TAG_INPUT:`;let W;return W=$localize` Sunday ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`,[["formRef",""],["timeRef",""],["dateRef",""],n,t,o,i,r,p,f,k,d,G,B,O,K,ae,W,[3,"submit","formGroup"],[1,"title-30"],[1,"toggle-wrap"],[1,"raised","primary"],["type","checkbox","formControlName","autoRun"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],["formGroupName","nextTime",1,"row-inputs"],["for","time"],["type","time","id","time","formControlName","time",3,"focus"],["suffix",""],["for","date"],["type","date","id","date","formControlName","date",3,"focus"],["formGroupName","runAgain"],[1,"row-inputs"],["for","repeatValue"],["type","number","id","repeatValue","formControlName","repeatValue"],["value","key","label","label",3,"options","isClearable"],["type","text","id","repeatUnit","formControlName","repeatUnit"],["formGroupName","allowedDays",3,"disallowToggle"],["title",""],[1,"days-wrap"],["type","checkbox","formControlName","mon"],["type","checkbox","formControlName","tue"],["type","checkbox","formControlName","wed"],["type","checkbox","formControlName","thu"],["type","checkbox","formControlName","fri"],["type","checkbox","formControlName","sat"],["type","checkbox","formControlName","sun"]]},template:function(t,o){if(t&1){let i=v();s(0,"form",18,0),y("submit",function(){return T(i),h(o.next())}),s(2,"h3",19),I(3,3),a(),s(4,"div",20)(5,"spk-toggle",21),g(6,4),m(7,"input",22),C(),a(),s(8,"p"),I(9,5),a()(),_(10,kn,47,3),s(11,"div",23)(12,"button",24),y("click",function(){return T(i),h(o.goBack())}),g(13,6),m(14,"spk-icon"),C(),a(),s(15,"button",25),g(16,7),m(17,"spk-icon"),C(),a()()()}if(t&2){let i;u("formGroup",o.scheduleForm),l(10),D((i=o.scheduleFormSignal())!=null&&i.autoRun?10:-1)}},dependencies:[Pe,De,oe,Re,Ue,ie,he,Ee,ye,xe,te,Le,ee,Me,ne,Ve],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}.toggle-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.days-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};function $n(e,n){if(e&1){let t=v();s(0,"spk-select",0)(1,"input",4),y("ngModelChange",function(i){T(t);let r=c(2);return h(r.updateStateExpression(i))}),a()()}if(e&2){let t,o=c(2);u("options",o.fileGroupOptions())("isClearable",!1),l(),u("ngModel",(t=o.pathState())==null?null:t.expression)}}function In(e,n){if(e&1){let t=v();s(0,"spk-form-field")(1,"input",4),y("ngModelChange",function(i){T(t);let r=c(2);return h(r.updateStateExpression(i))}),a()()}if(e&2){let t,o=c(2);l(),u("ngModel",(t=o.pathState())==null?null:t.expression)}}function Mn(e,n){if(e&1){let t=v();s(0,"spk-select",0)(1,"input",1),y("ngModelChange",function(i){T(t);let r=c();return h(r.updateStateType(i))}),a()(),_(2,$n,2,3,"spk-select",0)(3,In,2,1,"spk-form-field"),s(4,"div",2),y("click",function(){T(t);let i=c();return h(i.removeFilter())}),s(5,"spk-icon",3),S(6,"x-circle"),a()()}if(e&2){let t,o,i=c();u("options",i.expressionOptions())("isClearable",!1),l(),u("ngModel",(t=i.pathState())==null?null:t.type),l(),D(((o=i.pathState())==null?null:o.type)==="-FileGroup"||((o=i.pathState())==null?null:o.type)==="+FileGroup"?2:3)}}var nn=[{key:"Excludes folders where name contains",value:"-FolderNameIncludes"},{key:"Excludes folder",value:"-Folder"},{key:"Excludes files where name contains",value:"-FileNameIncludes"},{key:"Excludes file extension",value:"-Extension"},{key:"Excludes files where name matches regex",value:"-Regex"},{key:"Includes files where name matches regex",value:"+Regex"},{key:"Excludes file group",value:"-FileGroup"},{key:"Includes expression",value:"+Expression"},{key:"Excludes expression",value:"-Expression"},{key:"None",value:"-Unknown"}],Rn=[{key:"Applications",value:"Applications"},{key:"CacheFiles",value:"Cache Files"},{key:"TemporaryFiles",value:"Temporary Files"},{key:"OperatingSystem",value:"Operating System"},{key:"SystemFiles",value:"System Files"},{key:"DefaultExcludes",value:"Standard Excludes"}],gt=class e{path=Dt.required();osType=Dt();pathChange=ht();remove=ht();expressionOptions=N(nn);fileGroupOptions=N(Rn);pathState=N(null);typeState=b(()=>{let n=this.pathState();return n?n.type:null});pathEffect=it(()=>{let n=this.path(),t=n.slice(1),o=n.startsWith("-")?"-":"+",i=this.osType()==="Windows",r=i?"\\":"/",p=t.startsWith("%");return t===""?this.pathState.set({type:"-Unknown",path:"___none___",expression:""}):p&&t.endsWith(r)||i&&t.slice(2).startsWith("\\")&&t.endsWith("\\")||t.startsWith(r)&&t.endsWith(r)?this.pathState.set({type:`${o}Folder`,path:t,expression:t}):t.startsWith("*")&&t.endsWith(`*${r}`)?this.pathState.set({type:`${o}FolderNameIncludes`,path:t,expression:t.slice(1,-2)}):t.startsWith("[.*")&&t.endsWith(`[^\\${r}]*]`)?this.pathState.set({type:`${o}FileNameIncludes`,path:t,expression:t.slice(3,-7)}):t.startsWith("{")&&t.endsWith("}")?this.pathState.set({type:`${o}FileGroup`,path:t,expression:t.slice(1,-1)}):t.startsWith("[")&&t.endsWith("]")?this.pathState.set({type:`${o}Regex`,path:t,expression:t.slice(1,-1)}):t.startsWith("*.")?this.pathState.set({type:`${o}Extension`,path:t,expression:t.slice(2)}):this.pathState.set({type:`${o}Expression`,path:t,expression:t})});updateStateType(n){this.pathState.update(t=>(t.type=n,t.path=this.#t(t),t)),this.#e()}updateStateExpression(n){this.pathState.update(t=>(t.expression=n,t.path=this.#t(t),t)),this.#e()}#e(){setTimeout(()=>this.pathChange.emit(this.pathState().path))}#t(n){let t=n.type.slice(0,1),o=n.type.slice(1),i=this.osType()==="Windows",r=i?"\\":"/",f=i&&!n.expression.startsWith("%")?n.expression.slice(2):n.expression,k=n.path.startsWith("%");if(o==="Unknown")return`${t}${n.expression}`;if(o==="Folder"){let d=k||f.startsWith(r),G=f.endsWith(r);return G&&d?`${t}${n.expression}`:G?`${t}${n.expression}${r}`:d?`${t}${r}${n.expression}`:`${t}${r}${n.expression}${r}`}return o==="FolderNameIncludes"?`${t}*${n.expression}*${r}`:o==="FileNameIncludes"?`${t}[.*${n.expression}[^\\${r}]*]`:o==="FileGroup"?`${t}{${n.expression}}`:o==="Regex"?`${t}[${n.expression}]`:o==="Extension"?`${t}*.${n.expression}`:`${t}${n.expression}`}removeFilter(){this.remove.emit()}displayFn(n){let t=nn.find(o=>o.value===n);return t?t.key:""}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=Z({type:e,selectors:[["app-filter"]],inputs:{path:[1,"path"],osType:[1,"osType"]},outputs:{pathChange:"pathChange",remove:"remove"},decls:1,vars:1,consts:()=>{let n;return n=$localize`Select an option...`,[["value","value","label","key",3,"options","isClearable"],["type","text","placeholder",n,3,"ngModelChange","ngModel"],[1,"filter-removal",3,"click"],[1,"spk-primary"],["type","text",3,"ngModelChange","ngModel"]]},template:function(t,o){t&1&&_(0,Mn,7,4),t&2&&D(o.pathState()?0:-1)},dependencies:[mt,oe,ie,Ht,ee,te,ne],styles:["[_nghost-%COMP%]{display:grid;grid-template-columns:13.125rem 1fr 1.875rem;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] spk-select[_ngcontent-%COMP%]{--miw: initial}[_nghost-%COMP%] spk-form-field[_ngcontent-%COMP%]{min-width:110px}[_nghost-%COMP%] spk-form-field[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{min-width:110px}[_nghost-%COMP%] .filter-removal[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;justify-content:center;height:2.5rem;flex:0 0}"],changeDetection:0})};var xn=["formRef"];function vn(e,n){if(e&1){let t=v();s(0,"app-filter",42),y("pathChange",function(i){let r=T(t).$index,p=c(2);return h(p.patchPathAt(i,r))})("remove",function(){let i=T(t).$index,r=c(2);return h(r.removePathAt(i))}),a()}if(e&2){let t,o=n.$implicit,i=c(2);u("path",o)("osType",(t=i.osType())!==null&&t!==void 0?t:"")}}function wn(e,n){if(e&1&&pe(0,vn,1,2,"app-filter",41,le),e&2){let t=c();ce(t.pathArray())}}function bn(e,n){if(e&1&&(s(0,"div",40)(1,"spk-form-field"),m(2,"input",43),a(),s(3,"spk-select",44),m(4,"input",45),a()()),e&2){let t=c();l(3),u("options",t.sizeOptions())("isClearable",!1)}}var $e=new q,Gn=["Bytes","KB","MB","GB","TB","PB"],on=(e={path:"",filters:[],excludes:{hidden:!1,system:!1,temporary:!1,filesLargerThan:null}})=>$e.group({path:$e.control(e.path),excludes:$e.group({hidden:$e.control(e.excludes.hidden),system:$e.control(e.excludes.system),temporary:$e.control(e.excludes.temporary),filesLargerThan:$e.group({size:$e.control(null),unit:$e.control(null)})})}),vt=class e{#e=$(re);#t=$(J);#o=$(fe);formRef=ge.required("formRef");sourceDataForm=this.#e.sourceDataForm;sourceDataFormSignal=this.#e.sourceDataFormSignal;newPathCtrl=new pt("");filesLargerThan=b(()=>this.sourceDataFormSignal()?.excludes?.filesLargerThan?.size!==null);sizeOptions=N(Gn);osType=this.#e.osType;pathSignal=U(this.sourceDataForm.controls.path.valueChanges);pathArray=b(()=>this.pathSignal()?.split("\0").filter(n=>n.startsWith("-")||n.startsWith("+")||n==="___none___")??[]);addFilter(n="-*"){let t=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(`${t}\0${n}`)}patchPathAt(n,t){let i=this.sourceDataForm.controls.path.value.split("\0").filter(p=>!p.startsWith("-")&&!p.startsWith("+")).join("\0"),r=this.pathArray().map((p,f)=>f===t?`${n}`:`${p}`).join("\0");this.sourceDataForm.controls.path.setValue(`${i}\0${r}`)}removePathAt(n){let o=this.sourceDataForm.controls.path.value.split("\0").filter(r=>!r.startsWith("-")&&!r.startsWith("+")).join("\0"),i=this.pathArray().filter((r,p)=>p!==n).join("\0");this.sourceDataForm.controls.path.setValue(`${o}\0${i}`)}getPath(){return this.sourceDataForm.value.path??null}toggleFilesLargerThan(){this.sourceDataForm.controls.excludes.value.filesLargerThan?.size===null?this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:50,unit:"MB"}):this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:null,unit:null})}addNewPath(){let n=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(`${n}\0${this.newPathCtrl.value}`),this.newPathCtrl.setValue("")}goBack(){this.#t.navigate(["destination"],{relativeTo:this.#o.parent})}next(){this.#t.navigate(["schedule"],{relativeTo:this.#o.parent})}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=Z({type:e,selectors:[["app-source-data"]],viewQuery:function(t,o){t&1&&Ce(o.formRef,xn,5),t&2&&Se()},decls:55,vars:12,consts:()=>{let n;n=$localize`Path`;let t;t=$localize`Add a direct path`;let o;o=$localize`Hidden files`;let i;i=$localize`System files`;let r;r=$localize`Temporary files`;let p;p=$localize`Source Data`;let f;f=$localize`Folder path`;let k;k=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let d;d=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let G;G=$localize`Source Data`;let B;B=$localize`Add Path`;let O;O=$localize`Add a path directly from your machine.`;let K;K=$localize`Filters`;let ae;ae=$localize`Customize your filters.`;let W;W=$localize`Add filter`;let E;E=$localize`Exclude`;let P;P=$localize`Choose if there’s any files you want to exclude.`;let L;L=$localize` Hidden files ${"\uFFFD#45\uFFFD\uFFFD/#45\uFFFD"}:TAG_INPUT:`;let M;M=$localize` System files ${"\uFFFD#48\uFFFD\uFFFD/#48\uFFFD"}:TAG_INPUT:`;let Y;Y=$localize` Temporary files ${"\uFFFD#51\uFFFD\uFFFD/#51\uFFFD"}:TAG_INPUT:`;let de;de=$localize` Files larger than `;let se;return se=$localize`Select an option...`,[["formRef",""],p,f,k,d,G,B,O,K,ae,W,E,P,L,M,Y,de,[3,"submit","formGroup"],[1,"left"],[1,"title-30"],[1,"fill",3,"multiSelect","startingPath","showFiles"],["for","path"],["type","text","id","path","tabindex","4","placeholder",n,"formControlName","path"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],[1,"right"],[3,"disallowToggle"],["title",""],["description",""],[1,"row-inputs"],["type","text","placeholder",t,3,"formControl"],["spk-button","","type","button",1,"raised","primary",3,"click"],["type","button","spk-button","","action","",3,"click"],["formGroupName","excludes",3,"disallowToggle"],[1,"raised","primary"],["type","checkbox","placeholder",o,"formControlName","hidden"],["type","checkbox","placeholder",i,"formControlName","system"],["type","checkbox","placeholder",r,"formControlName","temporary"],[1,"raised","primary",3,"click"],["formGroupName","filesLargerThan",1,"row-inputs"],[3,"path","osType"],[3,"pathChange","remove","path","osType"],["type","number","formControlName","size"],[3,"options","isClearable"],["type","text","formControlName","unit","placeholder",se]]},template:function(t,o){if(t&1){let i=v();s(0,"form",17,0),y("submit",function(){return T(i),h(o.next())}),s(2,"div",18)(3,"h3",19),I(4,1),a(),s(5,"app-file-tree",20)(6,"label",21),I(7,2),a(),m(8,"input",22),a(),s(9,"div",23)(10,"button",24),y("click",function(){return T(i),h(o.goBack())}),g(11,3),m(12,"spk-icon"),C(),a(),s(13,"button",25),g(14,4),m(15,"spk-icon"),C(),a()()(),s(16,"div",26)(17,"h3",19),I(18,5),a(),s(19,"app-toggle-card",27),X(20,28),I(21,6),H(),s(22,"p",29),I(23,7),a(),s(24,"div",30)(25,"spk-form-field"),m(26,"input",31),a(),s(27,"button",32),y("click",function(){return T(i),h(o.addNewPath())}),s(28,"spk-icon"),S(29,"plus"),a()()()(),s(30,"app-toggle-card",27),X(31,28),I(32,8),H(),s(33,"p",29),I(34,9),a(),s(35,"button",33),y("click",function(){return T(i),h(o.addFilter())}),I(36,10),a(),_(37,wn,2,0),a(),s(38,"app-toggle-card",34),X(39,28),I(40,11),H(),s(41,"p",29),I(42,12),a(),s(43,"spk-toggle",35),g(44,13),m(45,"input",36),C(),a(),s(46,"spk-toggle",35),g(47,14),m(48,"input",37),C(),a(),s(49,"spk-toggle",35),g(50,15),m(51,"input",38),C(),a(),s(52,"spk-toggle",39),y("click",function(){return T(i),h(o.toggleFilesLargerThan())}),I(53,16),a(),_(54,bn,5,2,"div",40),a()()()}if(t&2){let i;u("formGroup",o.sourceDataForm),l(5),u("multiSelect",!0)("startingPath",o.getPath())("showFiles",!0),l(14),u("disallowToggle",!0),l(7),u("formControl",o.newPathCtrl),l(4),u("disallowToggle",!0),l(7),D((i=o.pathSignal())!=null&&i.length?37:-1),l(),u("disallowToggle",!0),l(14),Ne("active",o.filesLargerThan()),l(2),D(o.filesLargerThan()?54:-1)}},dependencies:[mt,De,oe,Re,Ue,ie,he,Pe,ct,Ee,ye,xe,te,ee,Me,Le,ne,ut,Ve,gt],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;width:100%;flex:1 0;overflow:hidden}form[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;flex:1 0;overflow:hidden}.right[_ngcontent-%COMP%], .left[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:1.5rem}.left[_ngcontent-%COMP%]{padding:2.5rem;overflow:hidden;border-right:1px solid var(--base-level-40)}.right[_ngcontent-%COMP%]{padding:2.5rem 1.5rem;overflow:auto}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.row-inputs[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content;gap:.5rem}"],changeDetection:0})};var _e=new q,re=class e{#e=$(J);#t=$(lt);#o=$(Ge);#i=$(_t);generalForm=Yt();sourceDataForm=on();scheduleForm=tn();destinationForm=rn();optionsForm=Jt();settings=N([]);isDraft=N(!1);backupId=N(null);isSubmitting=N(!1);finishedLoading=N(!1);backupDefaults=N(null);isNew=b(()=>this.backupId()==="new");osType=b(()=>this.#t.systemInfo()?.OSType);selectedOptions=N([]);selectedAdvancedFormPair=N([]);destinationFormPair=N({oauthField:null,custom:[],dynamic:[],advanced:[]});notSelectedAdvancedFormPair=b(()=>{let n=this.destinationFormPair()?.advanced??[],t=this.selectedAdvancedFormPair()??[];return n.filter(o=>t.findIndex(i=>i.name===o.name)===-1)});selectedHttpOptions=N([]);notSelectedHttpOptions=b(()=>{let n=this.httpOptions(),t=this.selectedHttpOptions()??[];return n.filter(o=>t.findIndex(i=>i.name===o.name)===-1)});sourceDataFormSignal=U(this.sourceDataForm.valueChanges);destinationFormSignal=U(this.destinationForm.valueChanges);generalFormSignal=U(this.generalForm.valueChanges);encryptionFieldSignal=U(this.generalForm.controls.encryption.valueChanges);scheduleFormSignal=U(this.scheduleForm.valueChanges);destinationOptions=b(()=>this.#t.backendModules()??[]);httpOptions=b(()=>this.#t.systemInfo()?.GenericModules?.find(n=>n.Key==="http-options")?.Options?.map(this.#n)??[]);advancedOptions=b(()=>this.#t.systemInfo()?.Options?.map(this.#n)??[]);#n(n){return{name:n.Name,type:n.Type,shortDescription:n.ShortDescription??void 0,longDescription:n.LongDescription??void 0,options:n.ValidValues}}encryptionOptions=b(()=>{let n=this.#t.systemInfo()?.EncryptionModules??[];return[Mt,...n]});nonSelectedOptions=b(()=>this.advancedOptions().sort((n,t)=>n?.name&&t?.name?n?.name.localeCompare(t?.name):0).filter(n=>this.selectedOptions()?.findIndex(t=>t.name===n.name)===-1));addAdvancedFormPairByName(n,t,o){let i=this.notSelectedAdvancedFormPair().find(r=>r.name===n);i&&this.addAdvancedFormPair(i,t,o)}addHttpOptionByName(n,t,o){let i=this.notSelectedHttpOptions().find(r=>r.name===n);i&&this.addHttpOption(i,t,o)}addAdvancedFormPair(n,t,o){let i=this.destinationForm.controls.destinations.controls.at(t)?.controls.advanced,r=o??n.defaultValue;this.createFormField(i,n,r),this.selectedAdvancedFormPair.set([...this.selectedAdvancedFormPair(),n])}addHttpOption(n,t,o){let i=this.destinationForm.controls.destinations.controls.at(t)?.controls.advanced,r=o??n.defaultValue;this.createFormField(i,n,r),this.selectedHttpOptions.set([...this.selectedHttpOptions(),n])}removeAdvancedFormPair(n,t){this.destinationForm.controls.destinations.controls.at(t)?.controls.advanced.removeControl(n.name),this.selectedAdvancedFormPair().findIndex(i=>i.name===n.name)!==-1?this.selectedAdvancedFormPair.update(i=>(i=i.filter(r=>r.name!==n.name),i)):this.selectedHttpOptions.update(i=>(i=i.filter(r=>r.name!==n.name),i))}removeHttpOption(n,t){this.destinationForm.controls.destinations.controls.at(t)?.controls.advanced.removeControl(n.name),this.selectedHttpOptions.update(o=>(o=o.filter(i=>i.name!==n.name),o))}submit(){this.isSubmitting.set(!0);let n=this.#l(),t=this.backupId();t==="new"||!t||this.isDraft()?this.#o.postApiV1Backups({requestBody:n}).pipe(Xe(()=>this.isSubmitting.set(!1))).subscribe({next:o=>{this.exit()},error:o=>{}}):this.#o.putApiV1BackupById({id:t,requestBody:n}).pipe(Xe(()=>this.isSubmitting.set(!1))).subscribe({next:o=>{this.exit()},error:o=>{}})}exit(){this.#c(),this.#e.navigate(["/"])}updateFieldsFromTargetUrl(n){this.#r(),setTimeout(()=>{this.#s(n)})}#r(){this.destinationFormPair.set({oauthField:null,custom:[],dynamic:[],advanced:[]}),this.selectedAdvancedFormPair.set([]),this.selectedHttpOptions.set([]),this.destinationForm.controls.destinations.clear(),this.destinationForm.reset()}mapSourceDataToForm(n){let t=n.Sources??"",o=n.Filters?.map(d=>`${d.Include?"":"-"}${d.Expression}`)??[],i=n.Settings?.find(d=>d.Name==="--exclude-files-attributes")?.Value??"",r=n.Settings?.find(d=>d.Name==="--skip-files-larger-than")??null,p=r?.Value.replace(/[0-9]/g,"")??null,f=r?.Value.replace(/[^0-9]/g,"")??null,k={path:[...t,...o].join("\0"),excludes:{hiddenFiles:i.includes("hidden"),systemFiles:i.includes("system"),tempFiles:i.includes("temporary"),filesLargerThan:p&&f?{size:parseInt(f),unit:p.toUpperCase()}:null}};this.sourceDataForm.patchValue(k)}mapDestinationToForm(n){let t=n.TargetURL?$t(n.TargetURL):null;t&&this.addDestinationFormGroup(t.destinationType,{custom:t.custom,dynamic:t.dynamic,advanced:t.advanced},!0)}#s(n){let t=$t(n);t&&this.addDestinationFormGroup(t.destinationType,{custom:t.custom,dynamic:t.dynamic,advanced:t.advanced},!0)}mapGeneralToForm(n){let t=n.Settings?.find(r=>r.Name==="encryption-module"),o=t?.Value&&t.Value.length?t.Value:"",i={name:n.Name??"",description:n.Description??""};o&&o!==""&&(i.encryption=o),this.generalForm.patchValue(i)}mapScheduleToForm(n){if(!n){this.scheduleForm.patchValue({autoRun:!1});return}let t=this.#i.fromString(n.Repeat)??null,i={nextTime:this.#p(n.Time),runAgain:{repeatValue:t?.value??1,repeatUnit:t?.unit??"D",allowedDays:{mon:n.AllowedDays?.includes("mon")??!1,tue:n.AllowedDays?.includes("tue")??!1,wed:n.AllowedDays?.includes("wed")??!1,thu:n.AllowedDays?.includes("thu")??!1,fri:n.AllowedDays?.includes("fri")??!1,sat:n.AllowedDays?.includes("sat")??!1,sun:n.AllowedDays?.includes("sun")??!1}}};this.scheduleForm.patchValue(i)}mapOptionsToForms(n){let t=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than"],o=n.Settings?.filter(i=>![...t,"dblock-size"].includes(i.Name));this.settings.set(o??[]),o?.forEach(i=>{if(i.Name==="encryption-module")return this.generalForm.controls.encryption.setValue(i.Value??"");if(i.Name==="dblock-size"){let r=i.Value?.replace(/[^0-9]/g,""),p=i.Value?.replace(/[0-9]/g,"");return this.optionsForm.controls.remoteVolumeSize.setValue({size:r?parseInt(r):null,unit:p?p.toUpperCase():null})}})}getCurrentTargetUrl(){return this.#a(this.destinationForm.controls.destinations)}#l(){let n=this.generalForm.value,t=this.scheduleForm.value,o=this.sourceDataForm.value,r=this.destinationForm.value.destinations?.length?this.#a(this.destinationForm.controls.destinations):[],p=null;t.runAgain?.repeatUnit&&t.runAgain?.repeatValue&&(p=this.#i.toString(t.runAgain.repeatValue,t.runAgain.repeatUnit));let f=t.runAgain?.allowedDays?Object.entries(t.runAgain?.allowedDays).filter(([O,K])=>K).map(([O,K])=>O):[],k=o.path?.split("\0")??[],d=this.mapFormsToSettings(),G=Object.entries(o.excludes??{}).filter(([O,K])=>K&&O!=="filesLargerThan").map(([O])=>O),B=o.excludes?.filesLargerThan;return G.length&&d.push({Name:"--exclude-files-attributes",Value:G.join(",")}),B&&B.size!==null&&B.unit!==null&&d.push({Name:"--skip-files-larger-than",Value:`${B.size}${B.unit}`}),{Backup:{Name:n.name,Description:n.description,TargetURL:r[0]??null,Sources:k.filter(O=>!O.startsWith("-")),Settings:d,Filters:k.filter(O=>O.startsWith("-")).map((O,K)=>({Order:K,Include:!1,Expression:O.slice(1)}))},Schedule:t.autoRun?{Repeat:p,Time:t.nextTime?.date?new Date(`${t.nextTime.date}T${t.nextTime?.time||"00:00:00"}`).toISOString():null,AllowedDays:f}:null}}mapFormsToSettings(n=[]){let t=this.optionsForm.value,o=this.generalForm.value,i=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than"],r=[{Name:"--no-encryption",Value:"True"}];o.encryption!==""&&(r=[{Name:"encryption-module",Value:o.encryption??null},{Name:"passphrase",Value:o.password??null}]);let p=t.remoteVolumeSize?.size?{Name:"dblock-size",Value:`${t.remoteVolumeSize.size}${t.remoteVolumeSize.unit.toLowerCase()}`}:{Name:"dblock-size",Value:"50mb"},f=[...n,...i],k=this.settings().filter(d=>!f.includes(d.Name)).map(d=>{let G=d.Value;return typeof d.Value=="number"&&(G=d.Value.toString()),typeof d.Value=="boolean"&&(G=d.Value?"True":"False"),{Name:d.Name,Value:G}});return[...r,p,...k]}#a(n){return n.controls.map(t=>dt(t.value))}#p(n){if(!n||n?.indexOf("T")===-1)return{time:n??"13:00"};let t=new Date(n),o={time:`${(""+t.getHours()).padStart(2,"0")}:${(""+t.getMinutes()).padStart(2,"0")}`};return n.indexOf("T")!==-1&&(o.date=t.toISOString().split("T")[0]),o}removeOptionFromFormGroup(n){let t=n.name;t&&(this.optionsForm.controls.advancedOptions.removeControl(t),this.selectedOptions.update(o=>(o=o.filter(i=>i.name!==t),o)))}addOptionToFormGroup(n,t){let o=this.optionsForm.controls.advancedOptions;this.createFormField(o,n,t??n.defaultValue),this.selectedOptions.update(i=>(i.push(n),i))}addFreeTextOption(n,t,o){let i=this.optionsForm.controls.advancedOptions,r=A({name:n,type:"String",defaultValue:t},o);this.createFormField(i,r,t),this.selectedOptions.update(p=>(p.push(r),p))}createFormField(n,t,o){if(t.type==="String"||t.type==="FileTree"||t.type==="FolderTree"||t.type==="Password"||t.type==="Enumeration"||t.type==="NonValidatedSelectableString"||t.type==="Path"){n.addControl(t.name,_e.control(o));return}if(t.type==="Size"){let i=(o??"").replace(/[0-9]/g,""),r=(o??"").replace(/[^0-9]/g,"");n.addControl(t.name,_e.group({size:_e.control(r?parseInt(r):50),unit:_e.control(i?i.toUpperCase():"MB")}));return}if(t.type==="Integer"){n.addControl(t.name,_e.control(o?parseInt(o):0));return}if(t.type==="Boolean"){n.addControl(t.name,_e.control(o==="true"||o==="True"));return}if(t.type==="Flags"){n.addControl(t.name,_e.control(o??""));return}if(t.type==="Timespan"){n.addControl(t.name,_e.control(o,[Te.pattern(/([-+]?\d{1,3}[smhDWMY])+/)]));return}}addDestinationFormGroup(n,t,o=!1){let i=ke.find(E=>E.customKey===n||E.key===n),r=i?.key,p=this.destinationOptions().find(E=>E.Key===r),f=this.httpOptions();if(!p||!p.Options)return;let k=i&&i.oauthField?i.oauthField:null,d=i&&i.customFields?i.customFields:{},G=i&&i.dynamicFields?i.dynamicFields:[],B=i&&i.advancedFields?i.advancedFields:[],O=i&&i.ignoredAdvancedFields?i.ignoredAdvancedFields:[];this.destinationFormPair.set({oauthField:k,custom:[],dynamic:[],advanced:[]});let K=_e.group({}),ae=_e.group({}),W=_e.group({});d&&Object.entries(d).forEach(([E,P],L)=>{let de=P,{formElement:M}=de,Y=bt(de,["formElement"]);K.addControl(E,M(t?.custom[E])),this.destinationFormPair.update(se=>(se.custom.push(A({order:900+L},Y)),se))});for(let E=0;E<p.Options.length;E++){let P=p.Options[E];if(P.Deprecated)continue;let L=G.find(M=>M===P.Name||M.name===P.Name);if(L){let M=L&&typeof L!="string",Y=M?L?.defaultValue??P.DefaultValue:P.DefaultValue,de={name:P.Name,type:P.Type,shortDescription:P.ShortDescription??void 0,longDescription:P.LongDescription??void 0,options:P.ValidValues,order:900+E},se=M?A(A({},de),L):de,Je=t?.dynamic[P.Name]??Y??P.DefaultValue;this.createFormField(ae,se,Je),this.destinationFormPair.update(be=>(be.dynamic.push(se),be))}else{if(O.find(Fe=>Fe===P.Name))continue;let Y=B.find(Fe=>Fe===P.Name||Fe.name===P.Name),de=Y&&typeof Y!="string",se=t?.advanced[P.Name],w=se??P.DefaultValue,Je={name:P.Name,type:P.Type,shortDescription:P.ShortDescription??void 0,longDescription:P.LongDescription??void 0,options:P.ValidValues,defaultValue:w,order:900+E},be=de?A(A({},Je),Y):Je;o&&se&&(this.createFormField(W,be,w),this.selectedAdvancedFormPair.update(Fe=>(Fe.push(be),Fe))),this.destinationFormPair.update(Fe=>(Fe.advanced.push(be),Fe))}}for(let E=0;E<f.length;E++){let P=f[E],L=t?.advanced[P.name],M=L??P.defaultValue;o&&L&&(this.createFormField(W,P,M),this.selectedHttpOptions.update(Y=>(Y.push(P),Y)))}this.destinationFormPair.update(E=>({oauthField:E.oauthField,custom:E.custom.sort((P,L)=>P.order-L.order),dynamic:E.dynamic.sort((P,L)=>P.order-L.order),advanced:E.advanced.sort((P,L)=>P.order-L.order)})),this.destinationForm.controls.destinations.push(an({key:i?.customKey??n,customGroup:K,dynamicGroup:ae,advancedGroup:W}))}#c(){this.generalForm.reset(),this.destinationForm.controls.destinations.clear(),this.destinationForm.reset(),this.sourceDataForm.reset(),this.scheduleForm.reset(),this.optionsForm.reset()}static \u0275fac=function(t){return new(t||e)};static \u0275prov=Ie({token:e,factory:e.\u0275fac,providedIn:"root"})};var Ln=["formRef"],Un=(e,n,t,o)=>({index:e,formView:n,formGroupName:"custom",destinationType:t,oauthField:o}),St=e=>({$implicit:e}),Vn=(e,n,t,o)=>({index:e,formView:n,formGroupName:"dynamic",destinationType:t,oauthField:o}),Bn=(e,n,t,o)=>({index:e,formView:n,formGroupName:"advanced",destinationType:t,oauthField:o}),Kn=(e,n,t,o)=>({index:e,formView:n,formGroupName:"advanced",asHttpOptions:!0,destinationType:t,oauthField:o}),zn=()=>({maxWidth:"700px",width:"100%"});function Xn(e,n){e&1&&(g(0,5,2),m(1,"spk-icon"),C())}function Hn(e,n){e&1&&I(0,5,3)}function jn(e,n){if(e&1){let t=v();g(0,5,1),s(1,"button",21),y("click",function(){T(t);let i=c();return h(i.testDestination())}),_(2,Xn,2,0)(3,Hn,1,0),a(),C()}if(e&2){let t=c();l(),Ne("success",t.successfulTest()),l(),D(t.successfulTest()?2:3)}}function Wn(e,n){if(e&1){let t=v();s(0,"p",27),y("click",function(){T(t);let i=c();return h(i.removeDestinationFormGroup(i.destinationCount()-1))}),g(1,8),m(2,"span",28),C(),a()}}function qn(e,n){if(e&1){let t=v();s(0,"div",34),y("click",function(){let i=T(t).$implicit,r=c(2);return h(r.addDestinationFormGroup(i.key))}),s(1,"h3"),S(2),a(),s(3,"p"),S(4),a()()}if(e&2){let t=n.$implicit;l(2),Pt(t.displayName),l(2),Pt(t.description)}}function Qn(e,n){if(e&1){let t=v();s(0,"button",35,1),y("click",function(){let i=T(t).$implicit,r=c(2);return h(r.addDestinationFormGroup(i.key))}),S(2),a()}if(e&2){let t=n.$implicit;l(2),z(" ",t.displayName," ")}}function Yn(e,n){if(e&1&&(s(0,"div",29),pe(1,qn,5,2,"div",30,le),a(),s(3,"spk-menu",31)(4,"button",32),I(5,9),a(),X(6,20),pe(7,Qn,3,1,"button",33,le),H(),a()),e&2){let t=c();l(),ce(t.destinationTypeOptionsFocused()),l(2),u("searchable",!0),l(4),ce(t.destinationTypeOptionsNotFocused())}}function Zn(e,n){e&1&&He(0)}function Jn(e,n){if(e&1&&_(0,Zn,1,0,"ng-container",40),e&2){let t,o=n.$implicit,i=n.$index;c();let r=ue(29),p=c();u("ngTemplateOutlet",r)("ngTemplateOutletContext",je(7,St,We(2,Un,i,o,(t=p.destinationFormSignal())==null||t.destinations==null||t.destinations[0]==null?null:t.destinations[0].destinationType,p.destinationFormPair().oauthField)))}}function eo(e,n){e&1&&He(0)}function to(e,n){if(e&1&&_(0,eo,1,0,"ng-container",40),e&2){let t,o=n.$implicit,i=n.$index;c();let r=ue(29),p=c();u("ngTemplateOutlet",r)("ngTemplateOutletContext",je(7,St,We(2,Vn,i,o,(t=p.destinationFormSignal())==null||t.destinations==null||t.destinations[0]==null?null:t.destinations[0].destinationType,p.destinationFormPair().oauthField)))}}function no(e,n){if(e&1){let t=v();g(0,10,1),s(1,"button",35,1),y("click",function(){let i=T(t).$implicit,r=c(2);return h(r.addAdvancedFormPair(i,0))}),a(),C()}if(e&2){let t=n.$implicit;l(),Et(t.name),yt(0)}}function oo(e,n){e&1&&He(0)}function io(e,n){if(e&1&&_(0,oo,1,0,"ng-container",40),e&2){let t,o=n.$implicit,i=n.$index;c();let r=ue(29),p=c();u("ngTemplateOutlet",r)("ngTemplateOutletContext",je(7,St,We(2,Bn,i,o,(t=p.destinationFormSignal())==null||t.destinations==null||t.destinations[0]==null?null:t.destinations[0].destinationType,p.destinationFormPair().oauthField)))}}function ro(e,n){if(e&1){let t=v();g(0,11,1),s(1,"button",35,1),y("click",function(){let i=T(t).$implicit,r=c(2);return h(r.addHttpOption(i,0))}),a(),C()}if(e&2){let t=n.$implicit;l(),Et(t.name),yt(0)}}function ao(e,n){e&1&&He(0)}function so(e,n){if(e&1&&_(0,ao,1,0,"ng-container",40),e&2){let t,o=n.$implicit,i=n.$index;c();let r=ue(29),p=c();u("ngTemplateOutlet",r)("ngTemplateOutletContext",je(7,St,We(2,Kn,i,o,(t=p.destinationFormSignal())==null||t.destinations==null||t.destinations[0]==null?null:t.destinations[0].destinationType,p.destinationFormPair().oauthField)))}}function lo(e,n){if(e&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),S(2,"question"),a()()),e&2){let t=c(2).$implicit;u("message",t.formView.longDescription)}}function po(e,n){if(e&1&&(s(0,"app-file-tree",43)(1,"label",47),S(2),_(3,lo,3,1,"spk-tooltip",48),a(),m(4,"input",49),a()),e&2){let t,o=c().$implicit,i=c(2);u("startingPath",i.getFormFieldValue(0,o.formGroupName,o.formView.name))("accepts",o.formView.accepts)("showFiles",!0)("hideShortcuts",!0)("showHiddenNodes",!0)("selectFiles",!0),l(),V("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),l(),z(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),l(),D(o.formView.longDescription?3:-1),l(),V("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),me("formControlName",o.formView.name)}}function co(e,n){if(e&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),S(2,"question"),a()()),e&2){let t=c(2).$implicit;u("message",t.formView.longDescription)}}function mo(e,n){if(e&1&&(s(0,"app-file-tree",44)(1,"label",47),S(2),_(3,co,3,1,"spk-tooltip",48),a(),m(4,"input",49),a()),e&2){let t,o=c().$implicit,i=c(2);u("hideShortcuts",!0)("startingPath",i.getFormFieldValue(0,o.formGroupName,o.formView.name)),l(),V("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),l(),z(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),l(),D(o.formView.longDescription?3:-1),l(),V("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),me("formControlName",o.formView.name)}}function uo(e,n){if(e&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),S(2,"question"),a()()),e&2){let t=c(2).$implicit;u("message",t.formView.longDescription)}}function _o(e,n){e&1&&(s(0,"spk-icon",51),S(1,"link"),a())}function Fo(e,n){e&1&&(s(0,"spk-icon",51),S(1,"envelope"),a())}function go(e,n){e&1&&(s(0,"spk-icon",51),S(1,"textbox"),a())}function Co(e,n){if(e&1&&(s(0,"spk-form-field")(1,"label",47),S(2),_(3,uo,3,1,"spk-tooltip",48),a(),m(4,"input",50),_(5,_o,2,0,"spk-icon",51)(6,Fo,2,0,"spk-icon",51)(7,go,2,0,"spk-icon",51),a()),e&2){let t,o=c().$implicit;l(),V("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),l(),z(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),l(),D(o.formView.longDescription?3:-1),l(),V("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),me("formControlName",o.formView.name),u("type",o.formView.type==="Email"?"email":"text"),l(),D(o.formView.type==="Path"?5:o.formView.type==="Email"?6:7)}}function So(e,n){if(e&1){let t=v();s(0,"span",55),y("click",function(){T(t);let i=c(2).$implicit,r=c(2);return h(r.oauthStartTokenCreation(i.destinationType))}),S(1,"AuthID"),a()}}function fo(e,n){e&1&&(s(0,"spk-icon",51),S(1,"password"),a())}function To(e,n){if(e&1){let t=v();s(0,"spk-icon",56),y("click",function(){T(t);let i=c(2).$implicit;return h(i.formView.showPassword=!i.formView.showPassword)}),S(1," eye "),a()}}function ho(e,n){if(e&1){let t=v();s(0,"spk-icon",56),y("click",function(){T(t);let i=c(2).$implicit;return h(i.formView.showPassword=!i.formView.showPassword)}),S(1," eye-slash "),a()}}function Do(e,n){if(e&1&&(s(0,"spk-form-field")(1,"label",47),S(2),a(),m(3,"input",52),_(4,So,2,0,"span",53)(5,fo,2,0,"spk-icon",51)(6,To,2,0,"spk-icon",54)(7,ho,2,0,"spk-icon",54),a()),e&2){let t,o=c().$implicit;l(),V("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),l(),z(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),l(),V("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),me("formControlName",o.formView.name),u("type",o.formView.showPassword?"text":"password"),l(),D(o.oauthField===o.formView.name?4:5),l(2),D(o.formView.showPassword?6:7)}}function Eo(e,n){if(e&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),S(2,"question"),a()()),e&2){let t=c(3).$implicit;u("message",t.formView.longDescription)}}function yo(e,n){if(e&1&&S(0),e&2){let t=n.$implicit;z(" ",t," ")}}function Po(e,n){if(e&1&&(s(0,"spk-select",57)(1,"label",47),S(2),_(3,Eo,3,1,"spk-tooltip",48),a(),m(4,"input",49),a(),_(5,yo,1,1,"ng-template",null,3,qe)),e&2){let t,o=ue(6);c();let i=Ot(0),r=c().$implicit;u("options",i)("isClearable",!1)("optionTemplate",o),l(),V("for","destination-",r.formGroupName,"-",r.index,"-",r.asHttpOptions?"http":"other",""),l(),z(" ",(t=r.formView.shortDescription)!==null&&t!==void 0?t:r.formView.name," "),l(),D(r.formView.longDescription?3:-1),l(),V("id","destination-",r.formGroupName,"-",r.index,"-",r.asHttpOptions?"http":"other",""),me("formControlName",r.formView.name)}}function Ao(e,n){if(e&1&&(At(0),_(1,Po,7,14)),e&2){let t=c().$implicit,o=Nt(t.formView.loadOptions?t.formView.loadOptions(c(2).injector)():t.formView.options);l(),D(o?1:-1)}}function No(e,n){if(e&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),S(2,"question"),a()()),e&2){let t=c(3).$implicit;u("message",t.formView.longDescription)}}function Oo(e,n){if(e&1&&S(0),e&2){let t=n.$implicit;Ut(" ",t.key," ",t.value?"("+t.value+")":""," ")}}function ko(e,n){if(e&1&&(s(0,"spk-select",59)(1,"label",47),S(2),_(3,No,3,1,"spk-tooltip",48),a(),m(4,"input",49),a(),_(5,Oo,1,2,"ng-template",null,4,qe)),e&2){let t,o=ue(6);c();let i=Ot(0),r=c().$implicit;u("options",i)("asFreeText",!0)("inlineSearch",!0)("optionTemplate",o),l(),V("for","destination-",r.formGroupName,"-",r.index,"-",r.asHttpOptions?"http":"other",""),l(),z(" ",(t=r.formView.shortDescription)!==null&&t!==void 0?t:r.formView.name," "),l(),D(r.formView.longDescription?3:-1),l(),V("id","destination-",r.formGroupName,"-",r.index,"-",r.asHttpOptions?"http":"other",""),me("formControlName",r.formView.name)}}function $o(e,n){e&1&&m(0,"spk-progress-bar",58)}function Io(e,n){if(e&1&&(At(0),_(1,ko,7,15)(2,$o,1,0,"spk-progress-bar",58)),e&2){let t=c().$implicit,o=Nt(t.formView.loadOptions?t.formView.loadOptions(c(2).injector)():t.formView.options);l(),D(o?1:2)}}function Mo(e,n){if(e&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),S(2,"question"),a()()),e&2){let t=c(2).$implicit;u("message",t.formView.longDescription)}}function Ro(e,n){if(e&1&&(s(0,"div",45)(1,"label",47),S(2),_(3,Mo,3,1,"spk-tooltip",48),a(),s(4,"div",60)(5,"spk-form-field"),m(6,"input",61),s(7,"spk-icon",51),S(8,"resize"),a()(),s(9,"spk-select",62),m(10,"input",63),a()()()),e&2){let t,o=c().$implicit,i=c(2);u("formGroupName",o.formView.name),l(),V("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),l(),z(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),l(),D(o.formView.longDescription?3:-1),l(3),V("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),l(3),u("options",i.sizeOptions())("inlineSearch",!0)}}function xo(e,n){if(e&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),S(2,"question"),a()()),e&2){let t=c(2).$implicit;u("message",t.formView.longDescription)}}function vo(e,n){if(e&1&&(s(0,"spk-form-field")(1,"label",47),S(2),_(3,xo,3,1,"spk-tooltip",48),a(),m(4,"input",64),s(5,"spk-icon",51),S(6,"numpad"),a()()),e&2){let t,o=c().$implicit;l(),V("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),l(),z(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),l(),D(o.formView.longDescription?3:-1),l(),V("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),me("formControlName",o.formView.name)}}function wo(e,n){if(e&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),S(2,"question"),a()()),e&2){let t=c(2).$implicit;u("message",t.formView.longDescription)}}function bo(e,n){if(e&1&&(s(0,"spk-toggle",46)(1,"label",47),S(2),_(3,wo,3,1,"spk-tooltip",48),a(),m(4,"input",65),a()),e&2){let t,o=c().$implicit;l(),V("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),l(),z(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),l(),D(o.formView.longDescription?3:-1),l(),V("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),me("formControlName",o.formView.name)}}function Go(e,n){if(e&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),S(2,"question"),a()()),e&2){let t=c(2).$implicit;u("message",t.formView.longDescription)}}function Lo(e,n){if(e&1&&S(0),e&2){let t=n.$implicit;z(" ",t," ")}}function Uo(e,n){if(e&1&&(s(0,"spk-select",66)(1,"label",47),S(2),_(3,Go,3,1,"spk-tooltip",48),a(),m(4,"input",67),a(),_(5,Lo,1,1,"ng-template",null,4,qe)),e&2){let t,o=ue(6),i=c().$implicit;u("options",i.formView.options)("selectMultiple",!0)("optionTemplate",o),l(),Lt("for","destination-",i.formGroupName,"-",i.index,""),l(),z(" ",(t=i.formView.shortDescription)!==null&&t!==void 0?t:i.formView.name," "),l(),D(i.formView.longDescription?3:-1),l(),me("formControlName",i.formView.name)}}function Vo(e,n){if(e&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),S(2,"question"),a()()),e&2){let t=c(2).$implicit;u("message",t.formView.longDescription)}}function Bo(e,n){if(e&1&&(s(0,"spk-form-field")(1,"label",47),S(2),_(3,Vo,3,1,"spk-tooltip",48),a(),m(4,"input",49),a()),e&2){let t,o=c().$implicit;l(),V("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),l(),z(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),l(),D(o.formView.longDescription?3:-1),l(),V("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),me("formControlName",o.formView.name)}}function Ko(e,n){if(e&1){let t=v();s(0,"button",68),y("click",function(){T(t);let i=c().$implicit,r=c(2);return h(r.removeFormView(i.formView,0))}),s(1,"spk-icon"),S(2,"x-circle"),a()()}}function zo(e,n){if(e&1&&(s(0,"div",41),X(1,42),_(2,po,5,17,"app-file-tree",43)(3,mo,5,13,"app-file-tree",44)(4,Co,8,13,"spk-form-field")(5,Do,8,13,"spk-form-field")(6,Ao,2,2)(7,Io,3,2)(8,Ro,11,13,"div",45)(9,vo,7,11,"spk-form-field")(10,bo,5,11,"spk-toggle",46)(11,Uo,7,9)(12,Bo,5,11,"spk-form-field"),H(),_(13,Ko,3,0,"button",32),a()),e&2){let t=n.$implicit;Ne("single-field",t.formGroupName!=="advanced"),l(),u("formGroupName",t.formGroupName),l(),D(t.formView.type==="FileTree"?2:t.formView.type==="FolderTree"?3:t.formView.type==="String"||t.formView.type==="Path"||t.formView.type==="Email"?4:t.formView.type==="Password"?5:t.formView.type==="Enumeration"?6:t.formView.type==="NonValidatedSelectableString"?7:t.formView.type==="Size"?8:t.formView.type==="Integer"?9:t.formView.type==="Boolean"?10:t.formView.type==="Flags"?11:t.formView.type==="Timespan"?12:-1),l(11),D(t.formGroupName==="advanced"?13:-1)}}function Xo(e,n){if(e&1&&(X(0,22)(1,36),pe(2,Jn,1,9,"ng-container",null,le),pe(4,to,1,9,"ng-container",null,le),s(6,"app-toggle-card",37),X(7,38),g(8,10),s(9,"spk-menu",31)(10,"button",39),m(11,"spk-icon"),a(),X(12,20),pe(13,no,3,1,"button",33,le),H(),a(),C(),H(),pe(15,io,1,9,"ng-container",null,le),a(),s(17,"app-toggle-card",37),X(18,38),g(19,11),s(20,"spk-menu",31)(21,"button",39),m(22,"spk-icon"),a(),X(23,20),pe(24,ro,3,1,"button",33,le),H(),a(),C(),H(),pe(26,so,1,9,"ng-container",null,le),a(),_(28,zo,14,5,"ng-template",null,2,qe),H()()),e&2){let t=c();l(2),ce(t.destinationFormPair().custom),l(2),ce(t.destinationFormPair().dynamic),l(2),u("disallowToggle",!0),l(3),u("searchable",!0),l(),u("disabled",t.notSelectedAdvancedFormPair().length===0),l(3),ce(t.notSelectedAdvancedFormPair()),l(2),ce(t.selectedAdvancedFormPair()),l(2),u("disallowToggle",!0),l(3),u("searchable",!0),l(),u("disabled",t.notSelectedHttpOptions().length===0),l(3),ce(t.notSelectedHttpOptions()),l(2),ce(t.selectedHttpOptions())}}function Ho(e,n){if(e&1){let t=v();s(0,"spk-dialog",69),nt("isOpenChange",function(i){T(t);let r=c();return tt(r.targetUrlDialogOpen,i)||(r.targetUrlDialogOpen=i),h(i)}),s(1,"header",70)(2,"h2"),I(3,12),a(),s(4,"spk-alert",71),I(5,13),a()(),s(6,"div",72)(7,"spk-form-field"),m(8,"textarea",73),a()(),s(9,"footer",74)(10,"button",24),y("click",function(){T(t);let i=c();return h(i.closeTargetUrlDialog(!1))}),S(11,"Cancel"),a(),s(12,"button",75),y("click",function(){T(t);let i=c();return h(i.closeTargetUrlDialog(!0))}),g(13,14),m(14,"spk-icon"),C(),a()()()}if(e&2){let t=c();et("isOpen",t.targetUrlDialogOpen),u("options",ot(3,zn)),l(8),u("formControl",t.targetUrlCtrl)}}var jo=["Bytes","KB","MB","GB","TB","PB"],Ct=new q,rn=(e={destinations:[]})=>Ct.group({destinations:Ct.array(e.destinations)}),an=({key:e,customGroup:n,dynamicGroup:t,advancedGroup:o})=>Ct.group({destinationType:Ct.control(e),custom:n,dynamic:t,advanced:o}),wt=class e{#e=$(J);#t=$(fe);#o=$(Bt);#i=$(Ge);#n=$(re);#r=$(zt);injector=$(Gt);formRef=ge.required("formRef");destinationForm=this.#n.destinationForm;destinationFormPair=this.#n.destinationFormPair;selectedAdvancedFormPair=this.#n.selectedAdvancedFormPair;notSelectedAdvancedFormPair=this.#n.notSelectedAdvancedFormPair;selectedHttpOptions=this.#n.selectedHttpOptions;notSelectedHttpOptions=this.#n.notSelectedHttpOptions;destinationOptions=this.#n.destinationOptions;destinationFormSignal=this.#n.destinationFormSignal;destinationCount=b(()=>this.destinationFormSignal()?.destinations?.length??0);sizeOptions=N(jo);successfulTest=N(!1);destinationTypeOptionsInFocus=N(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=N(ke.map(n=>({key:n.customKey??n.key,customKey:n.customKey??null,displayName:n.displayName,description:n.description})));destinationTypeOptionsFocused=b(()=>{let n=this.destinationTypeOptionsInFocus(),t=this.destinationTypeOptions();return n.map(o=>t.find(i=>i.key===o))});destinationTypeOptionsNotFocused=b(()=>{let n=this.destinationTypeOptionsInFocus();return this.destinationTypeOptions().filter(o=>!n.includes(o.key))});getFormFieldValue(n,t,o){return((this.destinationForm.controls.destinations.controls?.[n]).controls?.[t]).controls[o].value}addDestinationFormGroup(n){this.#n.addDestinationFormGroup(n)}addAdvancedFormPair(n,t){this.#n.addAdvancedFormPair(n,t)}removeFormView(n,t){this.#n.removeAdvancedFormPair(n,t)}addHttpOption(n,t){this.#n.addHttpOption(n,t)}targetUrl=b(()=>this.#n.getCurrentTargetUrl()[0]);targetUrlCtrl=new pt;targetUrlInitial=N(null);targetUrlDialogOpen=N(!1);openTargetUrlDialog(){let t=this.#n.getCurrentTargetUrl()[0];this.targetUrlCtrl.setValue(t),this.targetUrlInitial.set(t),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(n=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl.value,o=this.targetUrlInitial();!n||t===o||this.#n.updateFieldsFromTargetUrl(this.targetUrlCtrl.value)}testDestination(n=0){let o=this.#n.getCurrentTargetUrl()[n];o&&this.#i.postApiV1RemoteoperationTest({requestBody:{path:o}}).subscribe({next:()=>{this.successfulTest.set(!0),setTimeout(()=>{this.successfulTest.set(!1)},3e3)},error:i=>{let r=i.error.error.Error;if(r==="missing-folder"&&this.#r.open(Qe,{data:{title:$localize`Create folder`,message:$localize`The remote destination folder does not exist, do you want to create it?`},closed:p=>{p&&this.#i.postApiV1RemoteoperationCreate({requestBody:{path:o}}).subscribe()}}),r.startsWith("incorrect-cert:")){let p=r.split("incorrect-cert:")[1];this.#r.open(Qe,{maxWidth:"500px",data:{title:$localize`Trust the certificate`,message:$localize`The server is using a certificate that is not trusted.
2
+ If this is a self-signed certificate, you can choose to trust this certificate.
3
+ The server reported the certificate hash: ${p}`,confirmText:"Trust the certificate",cancelText:"Cancel"},closed:f=>{f&&this.#n.addHttpOptionByName("accept-specified-ssl-hash",p)}})}if(r.startsWith("incorrect-host-key:")){let p=r.split('incorrect-host-key:"')[1].split('",')[0],f=r.split('accepted-host-key:"')[1].split('",')[0];f?this.#r.open(Qe,{maxWidth:"500px",data:{title:$localize`The host key has changed`,message:$localize`The host key has changed, please check with the server administrator if this is correct,
4
+ otherwise you could be the victim of a MAN-IN-THE-MIDDLE attack.
5
+ Do you want to REPLACE your CURRENT host key ${f}
6
+ with the REPORTED host key: ${p}?`,confirmText:$localize`Approve`,cancelText:$localize`Cancel`},closed:k=>{k&&this.#n.addAdvancedFormPairByName("ssh-fingerprint",n,p)}}):this.#r.open(Qe,{maxWidth:"500px",data:{title:$localize`Approve host key?`,message:$localize`No certificate was specified, please verify that the reported host key is correct: ${p}`,confirmText:"Approve",cancelText:"Cancel"},closed:k=>{k&&this.#n.addAdvancedFormPairByName("ssh-fingerprint",n,p)}})}}})}mapToTargetUrl(n){return dt(n.value)}removeDestinationFormGroup(n){this.destinationForm.controls.destinations.removeAt(n)}displayFn(n){let t=this.destinationOptions().find(o=>o.Key===n);return t?`${t.DisplayName}`:""}goBack(){this.#e.navigate(["general"],{relativeTo:this.#t.parent})}next(){this.#e.navigate(["source-data"],{relativeTo:this.#t.parent})}#s=N("https://duplicati-oauth-handler.appspot.com/").asReadonly();#l=N(Math.random().toString(36).substring(2)+Math.random().toString(36).substring(2)).asReadonly();#a=N(!1);#p=N(null);keyCreation(){}oauthStartTokenCreation(n){this.#a.set(!0);let t=450,o=600,i=this.#s()+"?type="+n+"&token="+this.#l(),r=screen.width/2-t/2,p=screen.height/2-o/2,f=window.open(i,"_blank","height="+o+",width="+t+",menubar=0,status=0,titlebar=0,toolbar=0,left="+r+",top="+p);f?.addEventListener("blur",k=>{console.log("event blur",k)}),f?.addEventListener("beforeunload",k=>{console.log("event beforeunload",k),this.#o.get(this.#s()+"fetch?callback=JSON_CALLBACK",{params:{token:this.#l()}}).pipe(Xe(()=>this.#a.set(!1))).subscribe({next:d=>{console.log("res",d),d?.authid&&this.#p.set(d.authid)}})})}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=Z({type:e,selectors:[["app-destination"]],viewQuery:function(t,o){t&1&&Ce(o.formRef,Ln,5),t&2&&Se()},decls:24,vars:6,consts:()=>{let n;n=$localize` Backup destination ${"\uFFFD#5\uFFFD"}:START_TAG_DIV:${"\uFFFD*6:1\uFFFD"}:START_BLOCK_IF_1:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON:${"\uFFFD*2:2\uFFFD"}:START_BLOCK_IF: Connected ${"[\uFFFD#1:2\uFFFD|\uFFFD#9\uFFFD|\uFFFD#12\uFFFD]"}:START_TAG_SPK_ICON:check${"[\uFFFD/#1:2\uFFFD|\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD]"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/*2:2\uFFFD|\uFFFD/*6:1\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*3:3\uFFFD"}:START_BLOCK_ELSE: Test destination ${"\uFFFD/*3:3\uFFFD"}:CLOSE_BLOCK_ELSE:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*2:2\uFFFD|\uFFFD/*6:1\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD#7\uFFFD"}:START_TAG_SPK_MENU:${"\uFFFD#8\uFFFD"}:START_TAG_BUTTON_1:${"[\uFFFD#1:2\uFFFD|\uFFFD#9\uFFFD|\uFFFD#12\uFFFD]"}:START_TAG_SPK_ICON:dots-three-vertical${"[\uFFFD/#1:2\uFFFD|\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD]"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#10\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD#11\uFFFD"}:START_TAG_BUTTON_2:${"[\uFFFD#1:2\uFFFD|\uFFFD#9\uFFFD|\uFFFD#12\uFFFD]"}:START_TAG_SPK_ICON:link${"[\uFFFD/#1:2\uFFFD|\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD]"}:CLOSE_TAG_SPK_ICON: Edit target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SPK_MENU:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_DIV:`,n=we(n);let t;t=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let o;o=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let i;i=$localize` Want to select another destination? ${"\uFFFD#2\uFFFD"}:START_TAG_SPAN:Click here${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPAN:`;let r;r=$localize`Other destinations`;let p;p=$localize` Advanced options ${"\uFFFD#9\uFFFD"}:START_TAG_SPK_MENU:${"\uFFFD#10\uFFFD"}:START_TAG_BUTTON: Add advanced option ${"\uFFFD#11\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/#10\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#12\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD*14:1\uFFFD"}:START_BLOCK_FOR:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON_1: ${"\uFFFD0:1\uFFFD"}:INTERPOLATION: ${"[\uFFFD/#10\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/*14:1\uFFFD"}:CLOSE_BLOCK_FOR:${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_MENU:`,p=we(p);let f;f=$localize` Http options ${"\uFFFD#20\uFFFD"}:START_TAG_SPK_MENU:${"\uFFFD#21\uFFFD"}:START_TAG_BUTTON: Add http option ${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/#21\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#23\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD*25:1\uFFFD"}:START_BLOCK_FOR:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON_1: ${"\uFFFD0:1\uFFFD"}:INTERPOLATION: ${"[\uFFFD/#21\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/*25:1\uFFFD"}:CLOSE_BLOCK_FOR:${"\uFFFD/#23\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#20\uFFFD"}:CLOSE_TAG_SPK_MENU:`,f=we(f);let k;k=$localize`Select an option...`;let d;d=$localize`Edit target URL`;let G;G=$localize` Be careful, this will overwrite everything you have in your destination. `;let B;return B=$localize` Override target URL ${"\uFFFD#14\uFFFD"}:START_TAG_SPK_ICON:swap${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[["formRef",""],["option",""],["fieldTemplate",""],["enumOptionTemplate",""],["optionTemplate",""],n,t,o,i,r,p,f,d,G,B,[3,"submit","formGroup"],[1,"title-30"],[1,"actions"],["spk-button","","type","button",1,"small",3,"success"],["spk-button","","type","button",1,"small"],["menu",""],["spk-button","","type","button",1,"small",3,"click"],["formArrayName","destinations"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],[3,"isOpen","options"],[3,"click"],[1,"spk-primary"],[1,"most-common-destinations"],[1,"tile"],[3,"searchable"],["spk-button","","type","button",1,"outlined"],["type","button"],[1,"tile",3,"click"],["type","button",3,"click"],["formGroupName","0"],[3,"disallowToggle"],["title",""],["spk-button","","type","button",1,"outlined","small",3,"disabled"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"field-row"],[3,"formGroupName"],[3,"startingPath","accepts","showFiles","hideShortcuts","showHiddenNodes","selectFiles"],[3,"hideShortcuts","startingPath"],[1,"form-column",3,"formGroupName"],[1,"primary","raised"],[3,"for"],[1,"primary",3,"message"],["type","text",3,"id","formControlName"],[3,"type","id","formControlName"],["prefix",""],["autocomplete","off",3,"type","id","formControlName"],["prefix","",1,"link"],["suffix","",1,"clickable"],["prefix","",1,"link",3,"click"],["suffix","",1,"clickable",3,"click"],[3,"options","isClearable","optionTemplate"],[1,"indeterminate","primary"],["label","key","value","value",3,"options","asFreeText","inlineSearch","optionTemplate"],[1,"form-row"],["type","number","formControlName","size",3,"id"],["placeholder",k,3,"options","inlineSearch"],["type","text","formControlName","unit"],["type","number",3,"id","formControlName"],["type","checkbox",3,"id","formControlName"],[1,"primary","raised",3,"options","selectMultiple","optionTemplate"],["type","text","id","text",3,"formControlName"],["spk-button","","type","button",1,"outlined",3,"click"],[3,"isOpenChange","isOpen","options"],["header",""],[1,"warning"],["content",""],["id","targetUrl","autocomplete","off",3,"formControl"],["footer",""],["spk-button","","type","submit",1,"raised","primary",3,"click"]]},template:function(t,o){if(t&1){let i=v();s(0,"form",15,0),y("submit",function(){return T(i),h(o.next())}),s(2,"header")(3,"h3",16),g(4,5),s(5,"div",17),_(6,jn,4,3,"button",18),s(7,"spk-menu")(8,"button",19),m(9,"spk-icon"),a(),X(10,20),s(11,"button",21),y("click",function(){return T(i),h(o.openTargetUrlDialog())}),m(12,"spk-icon"),a(),H(),a()(),C(),a(),_(13,Wn,3,0,"p"),a(),_(14,Yn,9,1)(15,Xo,30,6,"ng-container",22),s(16,"div",23)(17,"button",24),y("click",function(){return T(i),h(o.goBack())}),g(18,6),m(19,"spk-icon"),C(),a(),s(20,"button",25),g(21,7),m(22,"spk-icon"),C(),a()()(),_(23,Ho,15,4,"spk-dialog",26)}if(t&2){let i;u("formGroup",o.destinationForm),l(6),D(o.destinationCount()>0?6:-1),l(7),D(o.destinationCount()>0?13:-1),l(),D(o.destinationCount()===0?14:-1),l(),D(!((i=o.destinationFormSignal())==null||i.destinations==null)&&i.destinations.length?15:-1),l(8),D(o.targetUrlDialogOpen()?23:-1)}},dependencies:[Pe,De,oe,Re,Ue,ie,he,ct,Ee,ye,xe,jt,Vt,te,Xt,ee,Le,st,Kt,rt,ne,at,Ve,ut],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] spk-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;padding-bottom:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.form-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.form-column[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.form-column[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{font-size:1rem}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 1fr;gap:.5rem;align-items:flex-end}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-500)}.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-level-40);border-radius:var(--shape-3);box-shadow:var(--shadow-1);background-color:var(--base-level-20);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-500)}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}spk-select[_ngcontent-%COMP%]{--miw: p2r(120)}"],changeDetection:0})};export{dt as a,ke as b,rn as c,an as d,wt as e,Yt as f,Mt as g,It as h,Jt as i,Rt as j,tn as k,xt as l,on as m,vt as n,re as o};
@@ -0,0 +1 @@
1
+ import{a,b}from"./chunk-L4B5RE7R.js";import"./chunk-Q67EYU7V.js";import"./chunk-N5K6ODRA.js";import"./chunk-3HJFVNAL.js";import"./chunk-LFPZBC5Y.js";import"./chunk-RDRLCN5M.js";import"./chunk-GEEPH37P.js";import"./chunk-XL5J65PI.js";import"./chunk-WZG34QS3.js";import"./chunk-4IJQ7AAQ.js";import"./chunk-TYO44G6M.js";import"./chunk-AIOUSVMR.js";import"./chunk-THUAAYGA.js";import"./chunk-ECH6I3YN.js";import"./chunk-KLIPTMVG.js";import"./chunk-V5GVLIPJ.js";import"./chunk-2HS3CYRN.js";import"./chunk-DTPZU6NP.js";import"./chunk-C6Q5SG76.js";export{a as createRestoreOptionsForm,b as default};
@@ -0,0 +1 @@
1
+ import{f as a,g as b,h as c}from"./chunk-M5YHW43W.js";import"./chunk-Q67EYU7V.js";import"./chunk-DNHLTHLR.js";import"./chunk-N5K6ODRA.js";import"./chunk-RCP6EKCC.js";import"./chunk-3HJFVNAL.js";import"./chunk-LFPZBC5Y.js";import"./chunk-CK5N2PPF.js";import"./chunk-4IJQ7AAQ.js";import"./chunk-AIOUSVMR.js";import"./chunk-THUAAYGA.js";import"./chunk-ECH6I3YN.js";import"./chunk-KLIPTMVG.js";import"./chunk-V5GVLIPJ.js";import"./chunk-2HS3CYRN.js";import"./chunk-DTPZU6NP.js";import"./chunk-C6Q5SG76.js";export{b as NONE_OPTION,a as createGeneralForm,c as default};
@@ -1,2 +1,2 @@
1
- import{b as B}from"./chunk-KLIPTMVG.js";import{a as D,u as U}from"./chunk-R3DRARWT.js";import"./chunk-V5GVLIPJ.js";import{pa as R}from"./chunk-2HS3CYRN.js";import{Ab as o,Bb as a,Cb as u,D as S,Gb as v,Na as T,Ob as p,Qa as l,Sb as A,Tb as c,X as O,ca as M,da as L,db as f,fc as _,gc as g,ib as E,kc as $,lc as k,mc as y,rb as m,sa as d,sb as P,tb as h,vc as G,wb as b,xb as N,xc as w,yb as x,zb as I}from"./chunk-DTPZU6NP.js";import"./chunk-C6Q5SG76.js";function X(s,n){if(s&1&&(o(0,"tr")(1,"td",10)(2,"code"),u(3,"ol",11),a()()()),s&2){let e=c().$implicit,t=c();l(),P("grid-column","1 / -1")("height","auto"),l(2),m("innerHTML",t.breakIntoLines(e.Exception),T)}}function z(s,n){if(s&1){let e=v();o(0,"tr",7),A("click",function(){let i=M(e).$index,r=c();return L(r.toggleRow(i))}),o(1,"td"),_(2),G(3,"date"),a(),o(4,"td",8),_(5),a(),o(6,"td"),_(7),a(),o(8,"td")(9,"button",9)(10,"spk-icon"),_(11,"caret-down"),a()()()(),E(12,X,4,5,"tr")}if(s&2){let e=n.$implicit,t=n.$index,i=c();l(2),g(w(3,6,e.Timestamp,"MMM dd. hh:mm")),l(3),g(e.BackupID>=0?e.BackupID:"-"),l(2),g(e.Message),l(2),h("rotated-icon",t===i.openRowIndex()),l(3),b(t===i.openRowIndex()?12:-1)}}var F=["BackupID","Timestamp","Message","actions"],C=class s{#e=O(B);displayedColumns=d(F);logsLoading=d(!0);openRowIndex=d(null);logs=d([]);ngOnInit(){this.init()}init(){this.#e.getApiV1LogdataLog().pipe(S(()=>this.logsLoading.set(!1))).subscribe({next:n=>{this.logs.set(n)}})}toggleRow(n){this.openRowIndex.set(n===this.openRowIndex()?null:n)}breakIntoLines(n){let e=n.split(`
1
+ import{a as D,u as U}from"./chunk-ECH6I3YN.js";import{b as B}from"./chunk-KLIPTMVG.js";import"./chunk-V5GVLIPJ.js";import{pa as R}from"./chunk-2HS3CYRN.js";import{Ab as o,Bb as a,Cb as u,D as S,Gb as v,Na as T,Ob as p,Qa as l,Sb as A,Tb as c,X as O,ca as M,da as L,db as f,fc as _,gc as g,ib as E,kc as $,lc as k,mc as y,rb as m,sa as d,sb as P,tb as h,vc as G,wb as b,xb as N,xc as w,yb as x,zb as I}from"./chunk-DTPZU6NP.js";import"./chunk-C6Q5SG76.js";function X(s,n){if(s&1&&(o(0,"tr")(1,"td",10)(2,"code"),u(3,"ol",11),a()()()),s&2){let e=c().$implicit,t=c();l(),P("grid-column","1 / -1")("height","auto"),l(2),m("innerHTML",t.breakIntoLines(e.Exception),T)}}function z(s,n){if(s&1){let e=v();o(0,"tr",7),A("click",function(){let i=M(e).$index,r=c();return L(r.toggleRow(i))}),o(1,"td"),_(2),G(3,"date"),a(),o(4,"td",8),_(5),a(),o(6,"td"),_(7),a(),o(8,"td")(9,"button",9)(10,"spk-icon"),_(11,"caret-down"),a()()()(),E(12,X,4,5,"tr")}if(s&2){let e=n.$implicit,t=n.$index,i=c();l(2),g(w(3,6,e.Timestamp,"MMM dd. hh:mm")),l(3),g(e.BackupID>=0?e.BackupID:"-"),l(2),g(e.Message),l(2),h("rotated-icon",t===i.openRowIndex()),l(3),b(t===i.openRowIndex()?12:-1)}}var F=["BackupID","Timestamp","Message","actions"],C=class s{#e=O(B);displayedColumns=d(F);logsLoading=d(!0);openRowIndex=d(null);logs=d([]);ngOnInit(){this.init()}init(){this.#e.getApiV1LogdataLog().pipe(S(()=>this.logsLoading.set(!1))).subscribe({next:n=>{this.logs.set(n)}})}toggleRow(n){this.openRowIndex.set(n===this.openRowIndex()?null:n)}breakIntoLines(n){let e=n.split(`
2
2
  `),t="";for(let i=0;i<e.length;i++)t+=`<li>${e[i]}</li>`;return t}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=f({type:s,selectors:[["app-logs"]],decls:15,vars:2,consts:()=>{let n;n=$localize`Timestamp`;let e;e=$localize`Backup ID`;let t;t=$localize`Message`;let i;return i=$localize`No data available`,[n,e,t,i,[3,"dataChange","data","loading"],["table-header",""],["table-no-rows",""],[3,"click"],[1,"id"],["spk-button","","type","button",1,"outlined","small"],[2,"white-space","pre-wrap"],[1,"line-numbers-ol",3,"innerHTML"]]},template:function(e,t){e&1&&(o(0,"h3"),_(1,"Logs"),a(),o(2,"spk-table",4),y("dataChange",function(r){return k(t.logs,r)||(t.logs=r),r}),o(3,"tr",5)(4,"th"),p(5,0),a(),o(6,"th"),p(7,1),a(),o(8,"th"),p(9,2),a(),u(10,"th"),a(),x(11,z,13,9,null,null,N),o(13,"div",6),p(14,3),a()()),e&2&&(l(2),$("data",t.logs),m("loading",t.logsLoading()),l(9),I(t.logs()))},dependencies:[U,R,D],styles:["[_nghost-%COMP%]{display:block}h3[_ngcontent-%COMP%]{font:var(--title-30);margin:0 0 1.25rem}spk-table[_ngcontent-%COMP%]{--table-columns: auto auto 1fr auto}spk-table[_ngcontent-%COMP%] td.id[_ngcontent-%COMP%]{justify-content:center}spk-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:has(code){padding:1rem .75rem;overflow:hidden}spk-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:has(code) code[_ngcontent-%COMP%]{background-color:var(--grey-800);color:var(--grey-100);padding:2.5rem 2.5rem 2.5rem 1.5rem;border-radius:var(--shape-3);overflow:auto;white-space:pre}"],changeDetection:0})};export{C as default};
@@ -0,0 +1 @@
1
+ import{i as a,j as b}from"./chunk-M5YHW43W.js";import"./chunk-Q67EYU7V.js";import"./chunk-DNHLTHLR.js";import"./chunk-N5K6ODRA.js";import"./chunk-RCP6EKCC.js";import"./chunk-3HJFVNAL.js";import"./chunk-LFPZBC5Y.js";import"./chunk-CK5N2PPF.js";import"./chunk-4IJQ7AAQ.js";import"./chunk-AIOUSVMR.js";import"./chunk-THUAAYGA.js";import"./chunk-ECH6I3YN.js";import"./chunk-KLIPTMVG.js";import"./chunk-V5GVLIPJ.js";import"./chunk-2HS3CYRN.js";import"./chunk-DTPZU6NP.js";import"./chunk-C6Q5SG76.js";export{a as createOptionsForm,b as default};
@@ -1 +1 @@
1
- import{a as u}from"./chunk-R3DRARWT.js";import{Ab as o,Bb as n,Qa as g,Sb as h,Ub as _,Vb as a,_a as d,db as p,fc as s,ib as m,pa as r,tb as f,wb as C}from"./chunk-DTPZU6NP.js";var v=[[["","title",""]],[["","description",""]],[["","action",""]],"*"],P=["[title]","[description]","[action]","*"];function M(e,l){e&1&&s(0,"Title")}function T(e,l){e&1&&(o(0,"spk-icon"),s(1,"caret-down"),n())}var c=class e{isActive=d(!1);disallowToggle=r(!1);ngOnInit(){this.disallowToggle()&&this.isActive.set(!0)}toggle(){this.isActive.set(!this.isActive())}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=p({type:e,selectors:[["app-toggle-card"]],hostVars:2,hostBindings:function(t,i){t&2&&f("active",i.isActive())},inputs:{isActive:[1,"isActive"],disallowToggle:[1,"disallowToggle"]},outputs:{isActive:"isActiveChange"},ngContentSelectors:P,decls:11,vars:1,consts:[[1,"title"],[3,"click"],[1,"actions"],[1,"content"]],template:function(t,i){t&1&&(_(v),o(0,"header")(1,"div",0)(2,"h3",1),h("click",function(){return i.disallowToggle()||i.toggle()}),a(3,0,null,M,1,0),m(5,T,2,0,"spk-icon"),n(),a(6,1),n(),o(7,"div",2),a(8,2),n()(),o(9,"div",3),a(10,3),n()),t&2&&(g(5),C(i.disallowToggle()?-1:5))},dependencies:[u],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;border-radius:var(--shape-3);background-color:var(--base-level-20)}.active[_nghost-%COMP%] .content[_ngcontent-%COMP%]{max-height:1000px;transition:max-height 1s linear;padding:0 1rem 1rem}.active[_nghost-%COMP%] spk-icon[_ngcontent-%COMP%]{transform:rotate(180deg)}[_nghost-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;font:var(--paragraph-10);cursor:pointer;-webkit-user-select:none;user-select:none}[_nghost-%COMP%] spk-icon[_ngcontent-%COMP%]{transform:rotate(0);transform-origin:center;transition:transform .2s ease}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem}header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;flex:1 0}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]:empty{display:none}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0 1rem;overflow:hidden;max-height:0;transition:max-height .25s linear,padding .25s linear}.content[_ngcontent-%COMP%]:empty{display:none}"],changeDetection:0})};export{c as a};
1
+ import{a as u}from"./chunk-ECH6I3YN.js";import{Ab as o,Bb as n,Qa as g,Sb as h,Ub as _,Vb as a,_a as d,db as p,fc as s,ib as m,pa as r,tb as f,wb as C}from"./chunk-DTPZU6NP.js";var v=[[["","title",""]],[["","description",""]],[["","action",""]],"*"],P=["[title]","[description]","[action]","*"];function M(e,l){e&1&&s(0,"Title")}function T(e,l){e&1&&(o(0,"spk-icon"),s(1,"caret-down"),n())}var c=class e{isActive=d(!1);disallowToggle=r(!1);ngOnInit(){this.disallowToggle()&&this.isActive.set(!0)}toggle(){this.isActive.set(!this.isActive())}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=p({type:e,selectors:[["app-toggle-card"]],hostVars:2,hostBindings:function(t,i){t&2&&f("active",i.isActive())},inputs:{isActive:[1,"isActive"],disallowToggle:[1,"disallowToggle"]},outputs:{isActive:"isActiveChange"},ngContentSelectors:P,decls:11,vars:1,consts:[[1,"title"],[3,"click"],[1,"actions"],[1,"content"]],template:function(t,i){t&1&&(_(v),o(0,"header")(1,"div",0)(2,"h3",1),h("click",function(){return i.disallowToggle()||i.toggle()}),a(3,0,null,M,1,0),m(5,T,2,0,"spk-icon"),n(),a(6,1),n(),o(7,"div",2),a(8,2),n()(),o(9,"div",3),a(10,3),n()),t&2&&(g(5),C(i.disallowToggle()?-1:5))},dependencies:[u],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;border-radius:var(--shape-3);background-color:var(--base-level-20)}.active[_nghost-%COMP%] .content[_ngcontent-%COMP%]{max-height:1000px;transition:max-height 1s linear;padding:0 1rem 1rem}.active[_nghost-%COMP%] spk-icon[_ngcontent-%COMP%]{transform:rotate(180deg)}[_nghost-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;font:var(--paragraph-10);cursor:pointer;-webkit-user-select:none;user-select:none}[_nghost-%COMP%] spk-icon[_ngcontent-%COMP%]{transform:rotate(0);transform-origin:center;transition:transform .2s ease}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem}header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;flex:1 0}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]:empty{display:none}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0 1rem;overflow:hidden;max-height:0;transition:max-height .25s linear,padding .25s linear}.content[_ngcontent-%COMP%]:empty{display:none}"],changeDetection:0})};export{c as a};
@@ -1 +1 @@
1
- import{c as M}from"./chunk-OQEGPSC6.js";import"./chunk-KLIPTMVG.js";import"./chunk-AIOUSVMR.js";import"./chunk-THUAAYGA.js";import{g as h}from"./chunk-R3DRARWT.js";import"./chunk-V5GVLIPJ.js";import"./chunk-2HS3CYRN.js";import{Ab as t,Bb as i,Cb as g,Ob as l,Qa as u,Ub as C,Vb as c,X as m,db as s,fc as O,ib as _,wb as f}from"./chunk-DTPZU6NP.js";import"./chunk-C6Q5SG76.js";var v=["*",[["","footer",""]]],T=["*","[footer]"],r=class n{static \u0275fac=function(e){return new(e||n)};static \u0275cmp=s({type:n,selectors:[["app-custom-card"]],ngContentSelectors:T,decls:11,vars:0,consts:[[1,"card"],["src","/assets/noise/auth-noise.svg",1,"noise"],[1,"header-title"],["src","/assets/duplicati/duplicati.svg","alt",""],[1,"bg"]],template:function(e,a){e&1&&(C(v),t(0,"div",0),g(1,"img",1),t(2,"header")(3,"div",2),g(4,"img",3),O(5," Duplicati "),i()(),t(6,"main"),c(7),t(8,"footer"),c(9,1),i()()(),g(10,"div",4))},styles:['[_nghost-%COMP%]{height:100vh;width:100vw;display:flex;align-items:center;justify-content:center;background-color:var(--base-level-20)}body.dark [_nghost-%COMP%] .card[_ngcontent-%COMP%]:before{background:radial-gradient(rgba(var(--primary-rgb-900),1),#0000 60%)}.card[_ngcontent-%COMP%]{max-width:480px;width:100%;position:relative;z-index:100;background-color:var(--base-level-10);border-radius:var(--shape-5);box-shadow:var(--box-shadow-40);border:1px solid var(--base-level-30);overflow:hidden}.card[_ngcontent-%COMP%]:before{content:"";position:absolute;height:480px;transform:translateY(-285px);left:0;right:0;z-index:-2;background:radial-gradient(rgba(var(--primary-rgb-100),1),#0000 60%)}.card[_ngcontent-%COMP%] img.noise[_ngcontent-%COMP%]{position:absolute;height:480px;width:100%;transform:translateY(-285px);left:0;right:0;z-index:-1;mask-image:radial-gradient(#000,#0000 60%)}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;padding:2rem 2rem 0;gap:12px;position:relative;z-index:10}.header-title[_ngcontent-%COMP%]{font:var(--title-30);display:flex;align-items:center;gap:10px}.header-title[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{height:28px;filter:drop-shadow(0 2px 3px rgba(0,0,0,.3))}main[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;padding:2rem;gap:2.5rem;position:relative;z-index:10}main[_ngcontent-%COMP%] footer[_ngcontent-%COMP%]{font:var(--paragraph-40);color:var(--base-level-60R);text-align:center;text-wrap:balance}.bg[_ngcontent-%COMP%]{position:fixed;inset:0;width:100vw;height:100vh;background-image:url(/assets/backgrounds/base-bg.svg);background-size:cover;background-position:center;background-repeat:no-repeat}body.dark[_ngcontent-%COMP%] .bg[_ngcontent-%COMP%]{opacity:1}footer[_ngcontent-%COMP%]:empty{display:none}'],changeDetection:0})};function x(n,o){n&1&&(t(0,"h3"),l(1,0),i())}function y(n,o){n&1&&(t(0,"h3"),l(1,1),i(),t(2,"button",3),l(3,2),i())}var d=class n{#e=m(M);isLoggingOut=this.#e.isLoggingOut;ngOnInit(){this.#e.logout()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=s({type:n,selectors:[["app-logout"]],decls:3,vars:1,consts:()=>{let o;o=$localize`Logging out...`;let e;e=$localize`You have successfully logged out your being redirected to login page.`;let a;return a=$localize`Go to login page`,[o,e,a,["spk-button","","routerLink","/",1,"raised","primary"]]},template:function(e,a){e&1&&(t(0,"app-custom-card"),_(1,x,2,0,"h3")(2,y,4,0),i()),e&2&&(u(),f(a.isLoggingOut()?1:2))},dependencies:[r,h],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};export{d as default};
1
+ import{c as M}from"./chunk-TYO44G6M.js";import"./chunk-AIOUSVMR.js";import"./chunk-THUAAYGA.js";import{g as h}from"./chunk-ECH6I3YN.js";import"./chunk-KLIPTMVG.js";import"./chunk-V5GVLIPJ.js";import"./chunk-2HS3CYRN.js";import{Ab as t,Bb as i,Cb as g,Ob as l,Qa as u,Ub as C,Vb as c,X as m,db as s,fc as O,ib as _,wb as f}from"./chunk-DTPZU6NP.js";import"./chunk-C6Q5SG76.js";var v=["*",[["","footer",""]]],T=["*","[footer]"],r=class n{static \u0275fac=function(e){return new(e||n)};static \u0275cmp=s({type:n,selectors:[["app-custom-card"]],ngContentSelectors:T,decls:11,vars:0,consts:[[1,"card"],["src","/assets/noise/auth-noise.svg",1,"noise"],[1,"header-title"],["src","/assets/duplicati/duplicati.svg","alt",""],[1,"bg"]],template:function(e,a){e&1&&(C(v),t(0,"div",0),g(1,"img",1),t(2,"header")(3,"div",2),g(4,"img",3),O(5," Duplicati "),i()(),t(6,"main"),c(7),t(8,"footer"),c(9,1),i()()(),g(10,"div",4))},styles:['[_nghost-%COMP%]{height:100vh;width:100vw;display:flex;align-items:center;justify-content:center;background-color:var(--base-level-20)}body.dark [_nghost-%COMP%] .card[_ngcontent-%COMP%]:before{background:radial-gradient(rgba(var(--primary-rgb-900),1),#0000 60%)}.card[_ngcontent-%COMP%]{max-width:480px;width:100%;position:relative;z-index:100;background-color:var(--base-level-10);border-radius:var(--shape-5);box-shadow:var(--box-shadow-40);border:1px solid var(--base-level-30);overflow:hidden}.card[_ngcontent-%COMP%]:before{content:"";position:absolute;height:480px;transform:translateY(-285px);left:0;right:0;z-index:-2;background:radial-gradient(rgba(var(--primary-rgb-100),1),#0000 60%)}.card[_ngcontent-%COMP%] img.noise[_ngcontent-%COMP%]{position:absolute;height:480px;width:100%;transform:translateY(-285px);left:0;right:0;z-index:-1;mask-image:radial-gradient(#000,#0000 60%)}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;padding:2rem 2rem 0;gap:12px;position:relative;z-index:10}.header-title[_ngcontent-%COMP%]{font:var(--title-30);display:flex;align-items:center;gap:10px}.header-title[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{height:28px;filter:drop-shadow(0 2px 3px rgba(0,0,0,.3))}main[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;padding:2rem;gap:2.5rem;position:relative;z-index:10}main[_ngcontent-%COMP%] footer[_ngcontent-%COMP%]{font:var(--paragraph-40);color:var(--base-level-60R);text-align:center;text-wrap:balance}.bg[_ngcontent-%COMP%]{position:fixed;inset:0;width:100vw;height:100vh;background-image:url(/assets/backgrounds/base-bg.svg);background-size:cover;background-position:center;background-repeat:no-repeat}body.dark[_ngcontent-%COMP%] .bg[_ngcontent-%COMP%]{opacity:1}footer[_ngcontent-%COMP%]:empty{display:none}'],changeDetection:0})};function x(n,o){n&1&&(t(0,"h3"),l(1,0),i())}function y(n,o){n&1&&(t(0,"h3"),l(1,1),i(),t(2,"button",3),l(3,2),i())}var d=class n{#e=m(M);isLoggingOut=this.#e.isLoggingOut;ngOnInit(){this.#e.logout()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=s({type:n,selectors:[["app-logout"]],decls:3,vars:1,consts:()=>{let o;o=$localize`Logging out...`;let e;e=$localize`You have successfully logged out your being redirected to login page.`;let a;return a=$localize`Go to login page`,[o,e,a,["spk-button","","routerLink","/",1,"raised","primary"]]},template:function(e,a){e&1&&(t(0,"app-custom-card"),_(1,x,2,0,"h3")(2,y,4,0),i()),e&2&&(u(),f(a.isLoggingOut()?1:2))},dependencies:[r,h],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};export{d as default};
@@ -1 +1 @@
1
- import{a as m}from"./chunk-BRABR4TV.js";import{b as N}from"./chunk-KLIPTMVG.js";import{C as o,D as h,Lc as u,N as d,R as l,X as r,l as c,sa as s,v as f,y as p}from"./chunk-DTPZU6NP.js";var v=class n{#e=r(N);#n=r(m);serverState=u(()=>{let t=this.#n.serverState();return t?.LastNotificationUpdateID&&this.updateLastNotificationEventId(t?.LastNotificationUpdateID),t});#o=s(-1);#s=s(!1);#t=s([]);#i=s([]);notifications=this.#t.asReadonly();init(){this.notifications().length===0&&this.getNotifications()}updateLastNotificationEventId(t){this.#o()!==t&&(this.#o.set(t),this.getNotifications())}getNotifications(){this.#s.set(!0),this.#e.getApiV1Notifications().pipe(o(1),d(t=>this.#t.set(t)),h(()=>this.#s.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(p(()=>c(e))));f(i).pipe(o(1)).subscribe({next:e=>{let b=e.filter(a=>a!=null&&"ID"in a);this.#t.set(b),this.#i.set([])},error:()=>{this.#t.set(this.#i()),this.#i.set([])}})}static \u0275fac=function(i){return new(i||n)};static \u0275prov=l({token:n,factory:n.\u0275fac,providedIn:"root"})};export{v as a};
1
+ import{a as m}from"./chunk-XL5J65PI.js";import{b as N}from"./chunk-KLIPTMVG.js";import{C as o,D as h,Lc as u,N as d,R as l,X as r,l as c,sa as s,v as f,y as p}from"./chunk-DTPZU6NP.js";var v=class n{#e=r(N);#n=r(m);serverState=u(()=>{let t=this.#n.serverState();return t?.LastNotificationUpdateID&&this.updateLastNotificationEventId(t?.LastNotificationUpdateID),t});#o=s(-1);#s=s(!1);#t=s([]);#i=s([]);notifications=this.#t.asReadonly();init(){this.notifications().length===0&&this.getNotifications()}updateLastNotificationEventId(t){this.#o()!==t&&(this.#o.set(t),this.getNotifications())}getNotifications(){this.#s.set(!0),this.#e.getApiV1Notifications().pipe(o(1),d(t=>this.#t.set(t)),h(()=>this.#s.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(p(()=>c(e))));f(i).pipe(o(1)).subscribe({next:e=>{let b=e.filter(a=>a!=null&&"ID"in a);this.#t.set(b),this.#i.set([])},error:()=>{this.#t.set(this.#i()),this.#i.set([])}})}static \u0275fac=function(i){return new(i||n)};static \u0275prov=l({token:n,factory:n.\u0275fac,providedIn:"root"})};export{v as a};
@@ -0,0 +1 @@
1
+ import{a as le}from"./chunk-3HJFVNAL.js";import{a as Y}from"./chunk-LFPZBC5Y.js";import{a as ee,b as te,d as ie,g as ne,i as oe,r as re}from"./chunk-4IJQ7AAQ.js";import{a as U,g as X,l as j,n as H,r as Z,w as J,x as Q,y as W}from"./chunk-ECH6I3YN.js";import{Ab as a,Bb as p,Cb as P,Db as E,Eb as N,Gb as S,Lc as M,Mb as v,Nb as L,Ob as q,Qa as l,Sb as C,Tb as s,X as B,Yb as d,_a as G,ca as u,da as g,db as K,ec as D,fc as m,gc as b,hc as F,ib as x,pa as $,rb as c,sa as O,wb as f,xb as y,yb as k,yc as A,zb as h}from"./chunk-DTPZU6NP.js";import{a as w,b as I}from"./chunk-C6Q5SG76.js";function pe(n,o){if(n&1){let e=S();a(0,"button",14),C("click",function(){u(e);let i=s();return g(i.addFreeTextSetting())}),v(1,5),P(2,"spk-icon"),L(),p()}}function se(n,o){if(n&1){let e=S();a(0,"button",16,0),C("click",function(){let i=u(e).$implicit,r=s(2);return g(r.addSetting(i))}),m(2),p()}if(n&2){let e=o.$implicit;l(2),b(e.name)}}function _e(n,o){if(n&1&&(a(0,"h3",7),m(1),p(),k(2,se,3,1,"button",15,y)),n&2){let e=o.$implicit;l(),b(e.displayName),l(),h(e.options)}}function me(n,o){n&1&&(a(0,"div",12),m(1,"Add a setting above to get started."),p())}function ce(n,o){if(n&1){let e=S();a(0,"div",17)(1,"label"),m(2),p(),a(3,"div",22)(4,"spk-form-field")(5,"input",23),C("ngModelChange",function(i){u(e);let r=s().$implicit,_=s();return g(_.updateFreeTextSettingName(r,i))}),p(),a(6,"spk-icon",24),m(7,"rectangle-dashed"),p()(),a(8,"spk-form-field")(9,"input",23),C("ngModelChange",function(i){u(e);let r=s().$implicit,_=s();return g(_.updateSettingValue(r,i))}),p(),a(10,"spk-icon",24),m(11,"textbox"),p()()()()}if(n&2){let e=s().$implicit;l(2),F(" ",e.FormView.shortDescription," "),l(3),c("ngModel",e.Name),l(4),c("ngModel",e.Value())}}function de(n,o){if(n&1&&(a(0,"spk-tooltip",26)(1,"spk-icon"),m(2,"question"),p()()),n&2){let e=s(2).$implicit;c("message",e.FormView.longDescription)}}function ue(n,o){if(n&1){let e=S();a(0,"app-file-tree",18)(1,"label",25),m(2),x(3,de,3,1,"spk-tooltip",26),p(),a(4,"input",27),C("ngModelChange",function(i){u(e);let r=s().$implicit,_=s();return g(_.updateSettingValue(r,i))}),p()()}if(n&2){let e=s(),t=e.$implicit,i=e.$index;c("startingPath",t.Value())("accepts",t.FormView.accepts)("showFiles",!0)("showHiddenNodes",!0)("selectFiles",!0),l(),d("for","destination-",t.Name,"-",i,""),l(),F(" ",t.FormView.shortDescription," "),l(),f(t.FormView.longDescription?3:-1),l(),d("id","destination-",t.Name,"-",i,""),c("ngModel",t.Value())}}function ge(n,o){if(n&1&&(a(0,"spk-tooltip",26)(1,"spk-icon"),m(2,"question"),p()()),n&2){let e=s(2).$implicit;c("message",e.FormView.longDescription)}}function Ce(n,o){if(n&1){let e=S();a(0,"app-file-tree",19)(1,"label",25),m(2),x(3,ge,3,1,"spk-tooltip",26),p(),a(4,"input",27),C("ngModelChange",function(i){u(e);let r=s().$implicit,_=s();return g(_.updateSettingValue(r,i))}),p()()}if(n&2){let e=s(),t=e.$implicit,i=e.$index;c("startingPath",t.Value()),l(),d("for","destination-",t.Name,"-",i,""),l(),F(" ",t.FormView.shortDescription," "),l(),f(t.FormView.longDescription?3:-1),l(),d("id","destination-",t.Name,"-",i,""),c("ngModel",t.Value())}}function xe(n,o){if(n&1&&(a(0,"spk-tooltip",26)(1,"spk-icon"),m(2,"question"),p()()),n&2){let e=s(2).$implicit;c("message",e.FormView.longDescription)}}function Se(n,o){n&1&&(a(0,"spk-icon",24),m(1,"link"),p())}function fe(n,o){n&1&&(a(0,"spk-icon",24),m(1,"textbox"),p())}function Fe(n,o){if(n&1){let e=S();a(0,"spk-form-field")(1,"label",25),m(2),x(3,xe,3,1,"spk-tooltip",26),p(),a(4,"input",27),C("ngModelChange",function(i){u(e);let r=s().$implicit,_=s();return g(_.updateSettingValue(r,i))}),p(),x(5,Se,2,0,"spk-icon",24)(6,fe,2,0,"spk-icon",24),p()}if(n&2){let e=s(),t=e.$implicit,i=e.$index;l(),d("for","destination-",t.Name,"-",i,""),l(),F(" ",t.FormView.shortDescription," "),l(),f(t.FormView.longDescription?3:-1),l(),d("id","destination-",t.Name,"-",i,""),c("ngModel",t.Value()),l(),f(t.FormView.type==="Path"?5:6)}}function Te(n,o){if(n&1){let e=S();a(0,"spk-icon",30),C("click",function(){u(e);let i=s(2).$implicit;return g(i.showPassword=!i.showPassword)}),m(1," eye "),p()}}function Oe(n,o){if(n&1){let e=S();a(0,"spk-icon",30),C("click",function(){u(e);let i=s(2).$implicit;return g(i.showPassword=!i.showPassword)}),m(1," eye-slash "),p()}}function Ve(n,o){if(n&1){let e=S();a(0,"spk-form-field")(1,"label",25),m(2),p(),a(3,"input",28),C("ngModelChange",function(i){u(e);let r=s().$implicit,_=s();return g(_.updateSettingValue(r,i))}),p(),a(4,"spk-icon",24),m(5,"password"),p(),x(6,Te,2,0,"spk-icon",29)(7,Oe,2,0,"spk-icon",29),p()}if(n&2){let e=s(),t=e.$implicit,i=e.$index;l(),d("for","destination-",t.Name,"-",i,""),l(),F(" ",t.FormView.shortDescription," "),l(),d("id","destination-",t.Name,"-",i,""),c("type",t.showPassword?"text":"password")("ngModel",t.Value()),l(3),f(t.showPassword?6:7)}}function we(n,o){if(n&1&&(a(0,"spk-tooltip",26)(1,"spk-icon"),m(2,"question"),p()()),n&2){let e=s(2).$implicit;c("message",e.FormView.longDescription)}}function Ie(n,o){if(n&1&&m(0),n&2){let e=o.$implicit;F(" ",e," ")}}function ye(n,o){if(n&1){let e=S();a(0,"spk-select",31)(1,"label",25),m(2),x(3,we,3,1,"spk-tooltip",26),p(),a(4,"input",27),C("ngModelChange",function(i){u(e);let r=s().$implicit,_=s();return g(_.updateSettingValue(r,i))}),p()(),x(5,Ie,1,1,"ng-template",null,1,A)}if(n&2){let e=D(6),t=s(),i=t.$implicit,r=t.$index;c("options",i.FormView.options)("isClearable",!1)("optionTemplate",e),l(),d("for","destination-",i.Name,"-",r,""),l(),F(" ",i.FormView.shortDescription," "),l(),f(i.FormView.longDescription?3:-1),l(),d("id","destination-",i.Name,"-",r,""),c("ngModel",i.Value())}}function ke(n,o){if(n&1&&(a(0,"spk-tooltip",26)(1,"spk-icon"),m(2,"question"),p()()),n&2){let e=s(2).$implicit;c("message",e.FormView.longDescription)}}function he(n,o){if(n&1){let e=S();a(0,"div",17)(1,"label",25),m(2),x(3,ke,3,1,"spk-tooltip",26),p(),a(4,"div",22)(5,"spk-form-field")(6,"input",32),C("ngModelChange",function(i){u(e);let r=s().$implicit,_=s();return g(_.updateSizeSetting(r,i,"size"))}),p(),a(7,"spk-icon",24),m(8,"resize"),p()(),a(9,"spk-select",33)(10,"input",23),C("ngModelChange",function(i){u(e);let r=s().$implicit,_=s();return g(_.updateSizeSetting(r,i,"unit"))}),p()()()()}if(n&2){let e=s(),t=e.$implicit,i=e.$index,r=s();l(),d("for","destination-",t.Name,"-",i,""),l(),F(" ",t.FormView.shortDescription," "),l(),f(t.FormView.longDescription?3:-1),l(3),d("id","destination-",t.Name,"-",i,""),c("ngModel",t.size()),l(3),c("options",r.sizeOptions())("isClearable",!1),l(),c("ngModel",t.unit())}}function Ne(n,o){if(n&1&&(a(0,"spk-tooltip",26)(1,"spk-icon"),m(2,"question"),p()()),n&2){let e=s(2).$implicit;c("message",e.FormView.longDescription)}}function Me(n,o){if(n&1){let e=S();a(0,"spk-form-field")(1,"label",25),m(2),x(3,Ne,3,1,"spk-tooltip",26),p(),a(4,"input",32),C("ngModelChange",function(i){u(e);let r=s().$implicit,_=s();return g(_.updateSettingValue(r,i))}),p(),a(5,"spk-icon",24),m(6,"numpad"),p()()}if(n&2){let e=s(),t=e.$implicit,i=e.$index;l(),d("for","destination-",t.Name,"-",i,""),l(),F(" ",t.FormView.shortDescription," "),l(),f(t.FormView.longDescription?3:-1),l(),d("id","destination-",t.Name,"-",i,""),c("ngModel",t.Value())}}function $e(n,o){if(n&1&&(a(0,"spk-tooltip",26)(1,"spk-icon"),m(2,"question"),p()()),n&2){let e=s(2).$implicit;c("message",e.FormView.longDescription)}}function Pe(n,o){if(n&1){let e=S();a(0,"spk-toggle",20)(1,"label",25),m(2),x(3,$e,3,1,"spk-tooltip",26),p(),a(4,"input",34),C("ngModelChange",function(i){u(e);let r=s().$implicit,_=s();return g(_.updateSettingValue(r,i))}),p()()}if(n&2){let e=s(),t=e.$implicit,i=e.$index;l(),d("for","destination-",t.Name,"-",i,""),l(),F(" ",t.FormView.shortDescription," "),l(),f(t.FormView.longDescription?3:-1),l(),d("id","destination-",t.Name,"-",i,""),c("ngModel",t.Value())}}function Ee(n,o){if(n&1&&(a(0,"spk-tooltip",26)(1,"spk-icon"),m(2,"question"),p()()),n&2){let e=s(2).$implicit;c("message",e.FormView.longDescription)}}function ve(n,o){if(n&1&&m(0),n&2){let e=o.$implicit;F(" ",e," ")}}function Le(n,o){if(n&1){let e=S();a(0,"spk-select",35)(1,"label",25),m(2),x(3,Ee,3,1,"spk-tooltip",26),p(),a(4,"input",36),C("ngModelChange",function(i){u(e);let r=s().$implicit,_=s();return g(_.updateSettingValue(r,i))}),p()(),x(5,ve,1,1,"ng-template",null,2,A)}if(n&2){let e=D(6),t=s(),i=t.$implicit,r=t.$index;c("options",i.FormView.options)("selectMultiple",!0)("optionTemplate",e),l(),d("for","destination-",i.Name,"-",r,""),l(),F(" ",i.FormView.shortDescription," "),l(),f(i.FormView.longDescription?3:-1),l(),c("ngModel",i.Value())}}function De(n,o){if(n&1&&(a(0,"spk-tooltip",26)(1,"spk-icon"),m(2,"question"),p()()),n&2){let e=s(2).$implicit;c("message",e.FormView.longDescription)}}function be(n,o){if(n&1){let e=S();a(0,"spk-form-field")(1,"label",25),m(2),x(3,De,3,1,"spk-tooltip",26),p(),a(4,"input",27),C("ngModelChange",function(i){u(e);let r=s().$implicit,_=s();return g(_.updateSettingValue(r,i))}),p()()}if(n&2){let e=s(),t=e.$implicit,i=e.$index;l(),d("for","destination-",t.Name,"-",i,""),l(),F(" ",t.FormView.shortDescription," "),l(),f(t.FormView.longDescription?3:-1),l(),d("id","destination-",t.Name,"-",i,""),c("ngModel",t.Value())}}function Ae(n,o){if(n&1){let e=S();a(0,"div",13),x(1,ce,12,3,"div",17)(2,ue,5,14,"app-file-tree",18)(3,Ce,5,10,"app-file-tree",19)(4,Fe,7,10,"spk-form-field")(5,Ve,8,10,"spk-form-field")(6,ye,7,12)(7,he,11,12,"div",17)(8,Me,7,9,"spk-form-field")(9,Pe,5,9,"spk-toggle",20)(10,Le,7,9)(11,be,5,9,"spk-form-field"),a(12,"button",21),C("click",function(){let i=u(e).$implicit,r=s();return g(r.removeSetting(i))}),a(13,"spk-icon"),m(14,"x-bold"),p()()()}if(n&2){let e=o.$implicit;l(),f(e.FormView.type==="FreeText"?1:e.FormView.type==="FileTree"?2:e.FormView.type==="FolderTree"?3:e.FormView.type==="String"||e.FormView.type==="Path"||e.FormView.type==="Decimal"?4:e.FormView.type==="Password"?5:e.FormView.type==="Enumeration"?6:e.FormView.type==="Size"?7:e.FormView.type==="Integer"?8:e.FormView.type==="Boolean"?9:e.FormView.type==="Flags"?10:e.FormView.type==="Timespan"?11:-1)}}var ze=["Bytes","KB","MB","GB","TB","PB"],ae=class n{#e=B(Y);options=G.required();hiddenOptions=$([]);hasFreeTextSettings=$(!1);allOptionsGrouped=this.#e.allOptionsGrouped;allOptions=this.#e.allOptions;sizeOptions=O(ze);selectedSettings=M(()=>{let o=this.hiddenOptions();return this.options().map(t=>{let i=this.allOptions().find(r=>r.name===t.Name);if(i&&!o.includes(i.name)){if(i.type==="Size"){let T=t.Value?.replace(/[0-9]/g,""),V=t.Value?.replace(/[^0-9]/g,""),z=O(T&&T!==""?T:"MB"),R=O(V&&V!==""?parseInt(V):"");return I(w({},t),{Value:M(()=>R()+z()),unit:z,size:R,FormView:i})}let r=t.Value??"";i.type==="Boolean"&&(r=r&&r.toLowerCase()==="true"||!1),i.type==="Integer"&&(r=parseInt(r)||0);let _=O(r);return I(w({},t),{Value:_,FormView:i})}else if(this.hasFreeTextSettings())return I(w({},t),{Value:O(t.Value),FormView:{name:t.Name,type:"FreeText",shortDescription:"Custom settings argument",longDescription:"Custom settings argument"}});return null}).filter(t=>t!==null)});nonSelectedOptionsGrouped=M(()=>{let o=this.options().map(t=>t.Name),e=this.hiddenOptions();return this.allOptionsGrouped().map(t=>I(w({},t),{options:t.options.filter(i=>!o.includes(i.name)&&!e.includes(i.name))})).filter(t=>t.options.length>0)});addFreeTextSetting(){this.hasFreeTextSettings()&&this.options.update(o=>[...o,{Filter:null,Name:"",Value:""}])}addSetting(o){this.options.update(e=>{let t=o.defaultValue??"";return o.type==="Boolean"&&(t=t.toLowerCase()==="true"||!1),o.type==="Integer"&&(t=parseInt(t)||0),[...e,{Name:o.name,Value:t}]})}updateSettingValue(o,e){this.options.update(t=>{let i=[...t],r=i.findIndex(_=>_.Name===o.Name);return o.FormView.type==="Boolean"?(i[r].Value=e?"True":"False",i):o.FormView.type==="Integer"?(i[r].Value=e.toString(),i):(i[r].Value=e,i)})}updateFreeTextSettingName(o,e){this.options.update(t=>{let i=[...t],r=i.findIndex(_=>_.Name===o.Name);return i[r].Name=e,i})}updateSizeSetting(o,e,t){let i=o;this.options.update(r=>{let _=[...r],T=_.findIndex(V=>V.Name===i.Name);return t==="size"&&(_[T].Value=`${e}${i.unit()}`),t==="unit"&&(_[T].Value=`${i.size()}${e}`),_})}removeSetting(o){this.options.update(e=>e.filter(t=>t.Name!==o.Name))}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=K({type:n,selectors:[["app-options-list"]],inputs:{options:[1,"options"],hiddenOptions:[1,"hiddenOptions"],hasFreeTextSettings:[1,"hasFreeTextSettings"]},outputs:{options:"optionsChange"},decls:16,vars:4,consts:()=>{let o;o=$localize`Advanced options`;let e;e=$localize` Add advanced option ${"\uFFFD#9\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let t;t=$localize` New custom option ${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:pen${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let i;return i=$localize`Select an item...`,[["option",""],["enumOptionTemplate",""],["optionTemplate",""],o,e,t,[3,"disallowToggle"],["title",""],[1,"actions"],["spk-button","","type","button",1,"outlined","small"],[3,"searchable"],["menu",""],[1,"placeholder"],[1,"field-row"],["spk-button","","type","button",1,"outlined","small",3,"click"],["type","button"],["type","button",3,"click"],[1,"form-column"],[3,"startingPath","accepts","showFiles","showHiddenNodes","selectFiles"],[3,"startingPath"],[1,"primary","raised"],["spk-button","","type","button",1,"outlined","remove-btn",3,"click"],[1,"form-row"],["type","text",3,"ngModelChange","ngModel"],["prefix",""],[3,"for"],[1,"primary",3,"message"],["type","text",3,"ngModelChange","id","ngModel"],["autocomplete","off",3,"ngModelChange","type","id","ngModel"],["suffix","",1,"clickable"],["suffix","",1,"clickable",3,"click"],[3,"options","isClearable","optionTemplate"],["type","number",3,"ngModelChange","id","ngModel"],["placeholder",i,3,"options","isClearable"],["type","checkbox",3,"ngModelChange","id","ngModel"],[1,"primary","raised",3,"options","selectMultiple","optionTemplate"],["type","text","id","text",3,"ngModelChange","ngModel"]]},template:function(e,t){e&1&&(a(0,"spk-toggle-card",6),E(1,7)(2),q(3,3),N(),a(4,"div",8),x(5,pe,3,0,"button",9),a(6,"spk-menu",10)(7,"button",9),v(8,4),P(9,"spk-icon"),L(),p(),E(10,11),k(11,_e,4,1,null,null,y),N(),p()(),N(),x(13,me,2,0,"div",12),k(14,Ae,15,1,"div",13,y),p()),e&2&&(c("disallowToggle",!0),l(5),f(t.hasFreeTextSettings()?5:-1),l(),c("searchable",!0),l(5),h(t.nonSelectedOptionsGrouped()),l(2),f(t.selectedSettings().length===0?13:-1),l(),h(t.selectedSettings()))},dependencies:[re,te,oe,ee,ie,ne,le,J,j,X,H,W,U,Z,Q],styles:["[_nghost-%COMP%]{display:block}spk-select[_ngcontent-%COMP%]{--miw: p2r(120)}spk-toggle[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{font-size:1rem}.placeholder[_ngcontent-%COMP%]{color:var(--base-level-60R);text-align:center;padding:2rem 1rem}.field-row[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:1fr 2.5rem;gap:.5rem}.field-row[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{align-self:flex-end}.form-column[_ngcontent-%COMP%]{display:flex;gap:.25rem;flex-direction:column}.form-column[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.form-column[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{font-size:1rem}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;justify-content:flex-end}"],changeDetection:0})};export{ae as a};
@@ -1 +1 @@
1
- import{a as S}from"./chunk-GEEPH37P.js";import{a as B}from"./chunk-BRABR4TV.js";import{a as z}from"./chunk-WZG34QS3.js";import{b as m,c as h}from"./chunk-KLIPTMVG.js";import{D as u,L as f,Lc as d,Mc as P,R as k,X as o,l as p,p as g,sa as n}from"./chunk-DTPZU6NP.js";import{a as l,b as a}from"./chunk-C6Q5SG76.js";var $={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_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_DownloadingRemoteFiles:$localize`Downloading files …`,Restore_PostRestoreVerify:$localize`Verifying restored files …`,Restore_Complete:$localize`Restore complete!`,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!`,Error:$localize`Error!`},_=class r{#i=o(S);#a=o(h);#r=o(m);#o=o(z);#e=o(B);#t=n(!1);#l=n(null);statusData=this.#l.asReadonly();serverState=d(()=>{let e=this.#e.serverState();return e?(e.ProposedSchedule=e.ProposedSchedule?.map(i=>a(l({},i),{backup:i.Item1?this.#o.getBackupById(i.Item1):null})),e):null});isFetching=this.#t.asReadonly();connectionStatus=this.#e.connectionStatus;setConnectionMethod(e){this.#e.setConnectionMethod(e)}pollingInterval;#p=P(()=>{let e=this.#e.serverState();e?.ActiveTask&&this.pollingInterval===void 0?this.pollingInterval=setInterval(()=>{this.#n()},1e3):e?.ActiveTask||this.stopPollingProgress()});stopPollingProgress(){clearInterval(this.pollingInterval)}#n(){this.#t.set(!0),this.#a.getApiV1Progressstate().pipe(f(e=>{let i=e.TaskID??null;return i===null?p(e):this.#r.getApiV1TaskByTaskid({taskid:i}).pipe(g(t=>a(l({},e),{task:t??null})))}),u(()=>this.#t.set(!1))).subscribe({next:e=>{let i=e.TaskID??null,t=e.BackupID??null;i!==null&&t!==null&&(e.backup=this.#o.getBackupById(t)),this.#l.set(a(l({},e),{progress:this.#s(e),statusText:this.#c(e),actionText:e.backup?.Backup?.Name??$localize`Running task`}))},error:e=>{e.status===404&&this.stopPollingProgress()}})}#s(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,s=e.TotalFileCount-e.ProcessedFileCount,c=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"||e.Phase==="Backup_WaitForUpload"?i=1:e.OverallProgress>0&&(i=e.OverallProgress);return i}#c(e){let i="Running \u2026";if(e.task&&e&&(i=e.Phase?$[e.Phase]:"Running \u2026",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,s=e.TotalFileCount-e.ProcessedFileCount,c=e.TotalFileSize-e.ProcessedFileSize-t,R=e.BackendSpeed<0?"":` at ${this.#i.transform(e.BackendSpeed)}/s`;i=`${e.Phase==="Restore_DownloadingRemoteFiles"?"Restoring: ":""}${s} files (${this.#i.transform(c)}) to go ${R}`}return i}static \u0275fac=function(i){return new(i||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};export{_ as a};
1
+ import{a as S}from"./chunk-GEEPH37P.js";import{a as B}from"./chunk-XL5J65PI.js";import{a as z}from"./chunk-WZG34QS3.js";import{b as m,c as h}from"./chunk-KLIPTMVG.js";import{D as u,L as f,Lc as d,Mc as P,R as k,X as o,l as p,p as g,sa as n}from"./chunk-DTPZU6NP.js";import{a as l,b as a}from"./chunk-C6Q5SG76.js";var $={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_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_DownloadingRemoteFiles:$localize`Downloading files …`,Restore_PostRestoreVerify:$localize`Verifying restored files …`,Restore_Complete:$localize`Restore complete!`,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!`,Error:$localize`Error!`},_=class r{#i=o(S);#a=o(h);#r=o(m);#o=o(z);#e=o(B);#t=n(!1);#l=n(null);statusData=this.#l.asReadonly();serverState=d(()=>{let e=this.#e.serverState();return e?(e.ProposedSchedule=e.ProposedSchedule?.map(i=>a(l({},i),{backup:i.Item1?this.#o.getBackupById(i.Item1):null})),e):null});isFetching=this.#t.asReadonly();connectionStatus=this.#e.connectionStatus;setConnectionMethod(e){this.#e.setConnectionMethod(e)}pollingInterval;#p=P(()=>{let e=this.#e.serverState();e?.ActiveTask&&this.pollingInterval===void 0?this.pollingInterval=setInterval(()=>{this.#n()},1e3):e?.ActiveTask||this.stopPollingProgress()});stopPollingProgress(){clearInterval(this.pollingInterval)}#n(){this.#t.set(!0),this.#a.getApiV1Progressstate().pipe(f(e=>{let i=e.TaskID??null;return i===null?p(e):this.#r.getApiV1TaskByTaskid({taskid:i}).pipe(g(t=>a(l({},e),{task:t??null})))}),u(()=>this.#t.set(!1))).subscribe({next:e=>{let i=e.TaskID??null,t=e.BackupID??null;i!==null&&t!==null&&(e.backup=this.#o.getBackupById(t)),this.#l.set(a(l({},e),{progress:this.#s(e),statusText:this.#c(e),actionText:e.backup?.Backup?.Name??$localize`Running task`}))},error:e=>{e.status===404&&this.stopPollingProgress()}})}#s(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,s=e.TotalFileCount-e.ProcessedFileCount,c=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"||e.Phase==="Backup_WaitForUpload"?i=1:e.OverallProgress>0&&(i=e.OverallProgress);return i}#c(e){let i="Running \u2026";if(e.task&&e&&(i=e.Phase?$[e.Phase]:"Running \u2026",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,s=e.TotalFileCount-e.ProcessedFileCount,c=e.TotalFileSize-e.ProcessedFileSize-t,R=e.BackendSpeed<0?"":` at ${this.#i.transform(e.BackendSpeed)}/s`;i=`${e.Phase==="Restore_DownloadingRemoteFiles"?"Restoring: ":""}${s} files (${this.#i.transform(c)}) to go ${R}`}return i}static \u0275fac=function(i){return new(i||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};export{_ as a};