@duplicati/ngclient 0.0.192 → 0.0.193

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.
@@ -0,0 +1 @@
1
+ import"./chunk-7CGTOI24.js";var o=[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"destination",loadComponent:()=>import("./chunk-7BMCHZU3.js")},{path:"encryption",loadComponent:()=>import("./chunk-XR7KQQO4.js")},{path:"select-files",loadComponent:()=>import("./chunk-XFDHZX44.js")},{path:"options",loadComponent:()=>import("./chunk-4CELGWVJ.js")},{path:":taskid/progress",loadComponent:()=>import("./chunk-ATPBBNLG.js")}],t=o;export{t as default};
@@ -1 +1 @@
1
- import{a as Ue}from"./chunk-4VEFX5WQ.js";import{a as Ye}from"./chunk-O4OTZE5N.js";import{d as se}from"./chunk-WIVARGP6.js";import{a as Je}from"./chunk-FK7JFD5B.js";import{a as L}from"./chunk-5DJAX2HH.js";import{b as _e}from"./chunk-DW332N2S.js";import{b as Xe}from"./chunk-NNCQNVQC.js";import{a as U}from"./chunk-TELPJYLN.js";import{B as X,H as we,L as Be,M as xe,P as Ve,V as We,W as ze,b as ve,c as G,e as k,f as w,i as Ae,j as B,l as Ge,p as x,q as V,r as W,s as ke,t as z,u as J,z as ne}from"./chunk-HPNLQHW6.js";import{c as Y}from"./chunk-BGTK25UG.js";import{b as h,d as R}from"./chunk-A4LPGPDU.js";import{fa as oe}from"./chunk-OTPG7USH.js";import{$ as N,Ab as l,Bb as c,C as j,Cc as ae,Dc as $e,E as O,Ec as De,Fb as D,Gb as v,H as Ce,Ib as q,K as Ne,L as Z,Mc as le,Pa as d,Pb as S,Qb as g,R as fe,Rb as E,Sb as Re,Tb as Pe,Vb as C,W as _,Xb as A,aa as f,cb as y,g as Ee,gc as Ie,hb as he,jc as K,la as p,lc as Le,m as me,mc as Me,na as M,oc as ee,pc as te,qc as ie,sb as b,tb as $,v as re,w as Fe,wc as ye,xc as be,yb as T,z as Oe,zb as r}from"./chunk-T2WO6CVD.js";var He=new W,Ke=()=>He.group({passphrase:He.control("")}),pe=class a{#t=_(Y);#e=_(P);#n=_(R);#o=_(h);encryptionForm=this.#e.encryptionForm;creatingTemporaryBackup=p(!1);settings=p([]);next(){let i=this.#e.destinationTargetUrl();if(!i)throw new Error("No target URL");this.creatingTemporaryBackup.set(!0);let e=this.encryptionForm.value?.passphrase??null,t=[];e?t.push({Name:"--passphrase",Value:e}):t.push({Name:"--no-encryption",Value:"true"}),this.settings().forEach(o=>{let n=o.Name?.trim();n&&n!=="--"&&(n.startsWith("--")||(n=`--${n}`),t.push({Name:n,Value:o.Value??""}))}),this.#t.postApiV1Backups({requestBody:{Backup:{TargetURL:i,Settings:t}},temporary:!0}).pipe(O(()=>this.creatingTemporaryBackup.set(!1))).subscribe({next:o=>{let n=o.ID;this.#n.navigate([`/restore-draft/${n}`])},error:o=>{console.error(o)}})}back(){this.#e.isFileRestore()?this.#n.navigate(["destination"],{relativeTo:this.#o.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=y({type:a,selectors:[["app-restore-encryption"]],decls:16,vars:3,consts:()=>{let i;i=$localize`Enter backup passphrase if defined.`;let e;e=$localize`Password`;let t;t=$localize`Advanced options`;let o;o=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let n;return n=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `,[e,t,o,n,[3,"submit","formGroup"],["for","password"],["type","password","id","password","placeholder",i,"formControlName","passphrase"],["title",""],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"]]},template:function(e,t){e&1&&(r(0,"form",4),C("submit",function(){return t.next()}),r(1,"sh-form-field")(2,"label",5),E(3,0),l(),c(4,"input",6),l(),r(5,"sh-toggle-card"),D(6,7),E(7,1),v(),r(8,"app-options-list",8),ie("optionsChange",function(n){return te(t.settings,n)||(t.settings=n),n}),l()(),r(9,"div",9)(10,"button",10),C("click",function(){return t.back()}),S(11,2),c(12,"sh-icon"),g(),l(),r(13,"button",11),S(14,3),c(15,"sh-icon"),g(),l()()()),e&2&&(T("formGroup",t.encryptionForm),d(8),ee("options",t.settings),T("hasFreeTextSettings",!0))},dependencies:[z,B,G,k,w,V,x,we,J,X,We,Ue],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 et=()=>({standalone:!0});function tt(a,i){a&1&&c(0,"sh-progress-bar",8)}function it(a,i){if(a&1&&(K(0),ae(1,"bytes")),a&2){let e=A().$implicit;Le(" (",$e(1,1,e.FileSizes),") ")}}function ot(a,i){a&1&&(r(0,"span",16),E(1,4),l())}function nt(a,i){if(a&1&&(r(0,"div",15),K(1),ae(2,"date"),b(3,it,2,3),b(4,ot,2,0,"span",16),l()),a&2){let e=i.$implicit;d(),Me(" ",e.Version,": ",De(2,4,e.Time,"medium")," "),d(2),$(e.FileSizes?3:-1),d(),$(e.IsFullBackup===!1?4:-1)}}function st(a,i){a&1&&c(0,"sh-progress-bar",8)}function rt(a,i){if(a&1&&(r(0,"app-file-tree",14)(1,"label",17),E(2,5),l(),c(3,"input",18),l()),a&2){let e=A(2);T("rootPaths",e.rootPaths())("initialNodes",e.initialNodes())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)}}function at(a,i){if(a&1){let e=q();r(0,"sh-select",12),C("cleared",function(){N(e);let o=A();return f(o.abortLoading())}),r(1,"input",13),ie("ngModelChange",function(o){N(e);let n=A();return te(n.selectOption,o)||(n.selectOption=o),f(o)}),l(),he(2,nt,5,7,"ng-template"),l(),b(3,st,1,0,"sh-progress-bar",8),b(4,rt,4,5,"app-file-tree",14)}if(a&2){let e=A();T("options",e.versionOptions())("isClearable",!1),d(),ee("ngModel",e.selectOption),T("ngModelOptions",be(6,et)),d(2),$(e.isRepairing()||e.versionOptionsLoading()||e.loadingRootPath()?3:-1),d(),$(e.showFileTree()?4:-1)}}var ue=new W,Qe=()=>ue.group({filesToRestore:ue.control(""),passphrase:ue.control(null)}),de=class a{#t=_(Y);#e=_(P);#n=_(Xe);#o=_(U);#i=_(R);#s=_(h);#l=_(oe);#a=null;#_=null;#r=p([]);selectFilesForm=this.#e.selectFilesForm;selectFilesFormSignal=this.#e.selectFilesFormSignal;selectOption=this.#e.selectOption;backupId=this.#e.backupId;versionOptionsLoading=this.#e.versionOptionsLoading;versionOptions=this.#e.versionOptions;isFileRestore=this.#e.isFileRestore;needsDatabaseRepair=le(()=>this.#e.backup()?.Backup?.IsTemporary??!0);showFileTree=p(!1);backupSettings=p(null);rootPaths=p([]);initialNodes=p([]);loadingRootPath=p(!1);isRepairing=le(()=>this.#r().length>0);loadedVersions=p({});loadingEffect=M(()=>{if(this.versionOptionsLoading())return;let e=this.versionOptions();if(e&&e?.length>0){let t=e[0].Version;this.selectOption.set(t.toString())}});backupSettingsEffect=M(()=>{let i=this.backupId(),e=this.selectOption(),t=this.isRepairing(),o=this.loadedVersions();if(!e||!i)return;let s=this.versionOptions()?.find(Q=>Q.Version===parseInt(e))?.Time??null;if(!s)return;let u=`${i}+${s}`,F=o[u];if(this.needsDatabaseRepair()&&(!F||t))return;let I={id:i+"",time:s};this.backupSettings.set(I),this.getRootPath(I)});repairEffect=M(()=>{if(!this.needsDatabaseRepair())return;let i=this.selectOption(),e=this.versionOptions();if(i){let t=e.find(s=>s.Version===parseInt(i));if(t===void 0)return;let o=this.backupId(),n=`${o}+${t.Time}`;if(this.#_===n||(this.#_=n,this.#r().includes(n)))return;this.#r.update(s=>[...s,n]),this.#t.postApiV1BackupByIdRepairupdate({id:o,requestBody:{only_paths:!0,time:t.Time}}).pipe(Z(this.abortLoading$),O(()=>{this.#_=null})).subscribe(s=>{let u=s.ID;this.#n.waitForTaskToComplete(u).pipe(j(1)).subscribe(()=>{this.#r.update(F=>F.filter(I=>I!==n)),this.loadedVersions.update(F=>(F[n]=!0,F))})})}});getRootPath(i){let e={id:i.id+"",time:i.time,prefixOnly:!0,folderContents:!1},t=i.id+"";this.isRepairing()||this.#a===t||(this.#a=t,this.loadingRootPath.set(!0),this.showFileTree.set(!1),this.#o.hasV2ListOperations()?this.#t.postApiV2BackupListFolder({requestBody:{BackupId:i.id,Time:i.time,Paths:null,PageSize:0,Page:0}}).pipe(Z(this.abortLoading$),O(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1),this.#a=null})).subscribe({next:o=>{let n=(o.Data??[]).map(s=>s.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}):this.#t.getApiV1BackupByIdFiles(e).pipe(Z(this.abortLoading$),O(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1)})).subscribe({next:o=>{let n=o.Files.map(s=>s.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}))}abortLoading$=new Ee;abortLoading(){this.showFileTree.set(!1),this.loadingRootPath.set(!1),this.abortLoading$.next(!0)}displayFn(){let i=this.versionOptions();return e=>{if(!e)return"";let t=i?.find(o=>typeof o.Version=="number"&&o.Version.toString()===e);return t?`${t.Version}: ${this.#l.transform(t.Time,"medium")}`:""}}next(){this.#i.navigate(["options"],{relativeTo:this.#s.parent})}back(){this.#e.isFileRestore()?this.#i.navigate(["encryption"],{relativeTo:this.#s.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=y({type:a,selectors:[["app-select-files"]],features:[ye([oe])],decls:13,vars:3,consts:()=>{let i;i=$localize`Select files`;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let t;t=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let o;o=$localize`Select an option...`;let n;n=$localize`(partial)`;let s;return s=$localize`Path`,[["formRef",""],i,e,t,n,s,[3,"submit","formGroup"],[1,"title-30"],[1,"indeterminate","primary"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],["value","Version",3,"cleared","options","isClearable"],["type","text","placeholder",o,3,"ngModelChange","ngModel","ngModelOptions"],[3,"rootPaths","initialNodes","backupSettings","multiSelect","showFiles"],[1,"custom-option"],[1,"partial"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]]},template:function(e,t){if(e&1){let o=q();r(0,"form",6,0),C("submit",function(){return N(o),f(t.next())}),r(2,"h3",7),E(3,1),l(),b(4,tt,1,0,"sh-progress-bar",8)(5,at,5,7),r(6,"div",9)(7,"button",10),C("click",function(){return N(o),f(t.back())}),S(8,2),c(9,"sh-icon"),g(),l(),r(10,"button",11),S(11,3),c(12,"sh-icon"),g(),l()()()}e&2&&(T("formGroup",t.selectFilesForm),d(4),$(t.versionOptionsLoading()?4:5),d(5),Re(t.isFileRestore()?"Back":"Exit"),Pe(8))},dependencies:[ke,B,G,k,w,Ae,z,V,x,se,X,J,Ve,Be,oe,Je],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.partial[_ngcontent-%COMP%]{color:var(--base-9);font-style:italic}"],changeDetection:0})};var P=class a{#t=_(R);#e=_(h);#n=_(U);#o=_(ne);#i=_(Y);backupId=p(null);backup=p(null);destinationTargetUrl=p(null);selectFilesForm=Qe();optionsForm=Ze();encryptionForm=Ke();optionsFormSignal=_e(this.optionsForm.valueChanges);selectFilesFormSignal=_e(this.selectFilesForm.valueChanges);selectOption=p(null);versionOptionsLoading=p(!1);versionOptions=p([]);isSubmitting=p(!1);isFileRestore=p(!1);isFullWidthPage=p(!1);#s=p("");#l=p(null);#a=null;testSignal=this.#s.asReadonly();testErrorMessage=this.#l.asReadonly();#_=M(()=>{let i=this.destinationTargetUrl(),e=this.#s(),t=this.#a;this.#a=i,!(e==="testing"||t===null||t===i)&&(this.#s.set(""),this.#l.set(null))});init(i,e=!1){this.backupId.set(i),this.isFileRestore.set(e),e&&this.#t.navigate(["/restore-from-files/destination"]),e||this.getBackup()}setTestState(i,e){this.#s.set(i),this.#l.set(e??null)}updateTargetUrl(i){this.destinationTargetUrl.set(i)}submit(){this.isSubmitting.set(!0);let i=this.backupId();this.backup()?.Backup?.IsTemporary??!1?this.#i.postApiV1BackupByIdCopytotemp({id:this.backupId()??""}).subscribe({next:t=>{this.#r(t.ID??"")},error:t=>this.showErrorDialog($localize`An error occurred while copying the backup to a temporary location: ${t.message}`)}):this.#r(i??"")}showErrorDialog(i){this.#o.open(L,{data:{title:$localize`Error occured`,message:i,confirmText:$localize`OK`,cancelText:void 0},closed:e=>{}})}#r(i){let e=this.optionsForm.value,t=this.selectFilesForm.value,o=this.selectOption(),n=this.versionOptions()?.find(s=>s.Version===(o&&parseInt(o)));this.#i.postApiV1BackupByIdRestore({id:i??"",requestBody:{paths:t.filesToRestore?.split("\0").map(s=>s.endsWith("/")||s.endsWith("\\")?`${s}*`:s)??[],passphrase:t.passphrase??null,time:n?.Time,restore_path:e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!e.includeMetadata}}).pipe(O(()=>this.isSubmitting.set(!1))).subscribe({next:s=>{this.#t.navigate([`./${s.ID}`,"progress"],{relativeTo:this.#e})},error:s=>{console.error("restore error",s)}})}exit(){this.#o.open(L,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:i=>{i&&(this.#p(),this.#t.navigate(["/"]))}})}getVersionOptions(){this.versionOptions()}loadFilesetsWithRetryv2(i,e=2){return this.#i.postApiV2BackupListFilesets({requestBody:{BackupId:i}}).pipe(Oe(t=>{let o=t?.error?.body?.StatusCode??t?.error?.requestBody?.StatusCode;return o==="EncryptedStorageNoPassphrase"||o==="FolderMissing"||o==="EmptyRemoteFolder"||e===0?me(()=>t):Fe(1e3).pipe(Ne(()=>this.loadFilesetsWithRetryv2(i,e-1)))}))}getBackup(){let i=this.backupId();this.versionOptionsLoading.set(!0),this.#n.hasV2ListOperations()?re([this.#i.getApiV1BackupById({id:i}),this.loadFilesetsWithRetryv2(i)]).pipe(j(1),O(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([e,t])=>{if(t.Error)throw new Error(t.Error);if(!(e.Backup?.IsTemporary??!0)&&e?.Backup?.DBPathExists===!1){this.#o.open(L,{data:{title:$localize`Missing Local Database`,message:$localize`The local database for this backup is missing. Please repair or recreate the local database before restoring.`,confirmText:$localize`OK`,cancelText:void 0},closed:n=>{this.#t.navigate(["/backup",i,"database"])}});return}this.versionOptions.set((t.Data??[]).map(n=>({Version:n.Version??-1,IsFullBackup:n.IsFullBackup??void 0,Time:n.Time??"<missing>",FileCount:n.FileCount??void 0,FileSizes:n.FileSizes??void 0}))),this.backup.set(e)},error:e=>{let t=e?.error?.body?.StatusCode??e?.error?.requestBody?.StatusCode,o=t==="EncryptedStorageNoPassphrase",n=t==="FolderMissing",s=t==="EmptyRemoteFolder",u=$localize`An error occurred while loading the backup filesets: ${e.message}`;o&&(u=$localize`The remote storage is encrypted. Please enter the passphrase to access the backup.`),n&&(u=$localize`The backup storage folder was not found.`),s&&(u=$localize`The backup storage folder does not contain any filesets.`),this.#o.open(L,{data:{title:$localize`Failed to load backup filesets`,message:u,confirmText:$localize`OK`,cancelText:void 0},closed:F=>{this.#t.navigate([o?"/restore-from-files/encryption":"/restore-from-files/destination"])}})}}):re([this.#i.getApiV1BackupById({id:i}),this.#i.getApiV1BackupByIdFilesets({id:i}).pipe(Ce(3))]).pipe(j(1),O(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([e,t])=>{this.versionOptions.set(t.map(o=>({Version:o.Version??-1,IsFullBackup:(o.IsFullBackup??1)==1,Time:o.Time??"<missing>",FileCount:o.FileCount??void 0,FileSizes:o.FileSizes??void 0}))),this.backup.set(e)}})}#p(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||a)};static \u0275prov=fe({token:a,factory:a.\u0275fac,providedIn:"root"})};var H=new W,Ze=()=>H.group({restoreFrom:H.control("original"),restoreFromPath:H.control(""),handleExisting:H.control("saveTimestamp"),permissions:H.control(!1),includeMetadata:H.control(!0)}),Se=class a{#t=_(P);#e=_(R);#n=_(h);#o=_(U);#i=_(ne);optionsForm=this.#t.optionsForm;optionsFormSignal=this.#t.optionsFormSignal;isSubmitting=this.#t.isSubmitting;goBack(){this.#e.navigate(["select-files"],{relativeTo:this.#n.parent})}submit(){let i=this.#t.selectFilesFormSignal()?.filesToRestore??[];if(i.length>0&&this.optionsFormSignal()?.restoreFrom=="original"&&(i[0].includes("/")?"/":"\\")!==this.#o.systemInfo()?.DirectorySeparator){this.#i.open(L,{data:{title:$localize`Confirm target folder`,message:$localize`This backup was created on another operating system. Restoring files without specifying a destination folder can cause files to be restored in unexpected places. Are you sure you want to continue without choosing a destination folder?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:t=>{t&&this.#t.submit()}});return}this.#t.submit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=y({type:a,selectors:[["app-advanced-options-settings"]],decls:42,vars:7,consts:()=>{let i;i=$localize`Restore options`;let e;e=$localize`Where do you want to restore files to?`;let t;t=$localize` Original location ${"\uFFFD#9\uFFFD\uFFFD/#9\uFFFD"}:TAG_INPUT:`;let o;o=$localize` Pick location ${"\uFFFD#12\uFFFD\uFFFD/#12\uFFFD"}:TAG_INPUT:`;let n;n=$localize`How do you want to handle existing files?`;let s;s=$localize` Overwrite ${"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"}:TAG_INPUT:`;let u;u=$localize` Save different versions with timestamp in file name ${"\uFFFD#25\uFFFD\uFFFD/#25\uFFFD"}:TAG_INPUT:`;let F;F=$localize`Metadata settings`;let I;I=$localize` Restore file metadata ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let Q;Q=$localize` Restore read/write permissions ${"\uFFFD#34\uFFFD\uFFFD/#34\uFFFD"}:TAG_INPUT:`;let ge;ge=$localize`${"\uFFFD#38\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let Te;return Te=$localize`${"\uFFFD#41\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#41\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `,[["formRef",""],i,e,t,o,n,s,u,F,I,Q,ge,Te,[3,"submit","formGroup"],[1,"title-30"],[3,"disallowToggle"],["title",""],[1,"raised","primary"],["type","radio","name","restoreFrom","value","original","formControlName","restoreFrom"],["type","radio","name","restoreFrom","value","pickLocation","formControlName","restoreFrom"],[3,"disabled","enableCreateFolder"],["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","includeMetadata"],["type","checkbox","formControlName","permissions"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"]]},template:function(e,t){if(e&1){let o=q();r(0,"form",13,0),C("submit",function(){return N(o),f(t.submit())}),r(2,"h3",14),E(3,1),l(),r(4,"app-toggle-card",15),D(5,16),E(6,2),v(),r(7,"sh-radio",17),S(8,3),c(9,"input",18),g(),l(),r(10,"sh-radio",17),S(11,4),c(12,"input",19),g(),l(),r(13,"app-file-tree",20)(14,"label",21),K(15,"Path"),l(),c(16,"input",22),l()(),r(17,"app-toggle-card",15),D(18,16),E(19,5),v(),r(20,"sh-radio",17),S(21,6),c(22,"input",23),g(),l(),r(23,"sh-radio",17),S(24,7),c(25,"input",24),g(),l()(),r(26,"app-toggle-card"),D(27,16),E(28,8),v(),r(29,"sh-toggle",25),S(30,9),c(31,"input",26),g(),l(),r(32,"sh-toggle",25),S(33,10),c(34,"input",27),g(),l()(),r(35,"div",28)(36,"button",29),C("click",function(){return N(o),f(t.goBack())}),S(37,11),c(38,"sh-icon"),g(),l(),r(39,"button",30),S(40,12),c(41,"sh-icon"),g(),l()()()}if(e&2){let o;T("formGroup",t.optionsForm),d(4),T("disallowToggle",!0),d(9),T("disabled",((o=t.optionsFormSignal())==null?null:o.restoreFrom)!=="pickLocation")("enableCreateFolder",!0),d(4),T("disallowToggle",!0),d(22),Ie("loader",t.isSubmitting())}},dependencies:[z,B,G,ve,Ge,k,w,V,x,Ye,se,ze,xe,X,J],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{Ze as a,Se as b,Ke as c,pe as d,Qe as e,de as f,P as g};
1
+ import{a as Ue}from"./chunk-3SHOBVX6.js";import{a as Ye}from"./chunk-O4OTZE5N.js";import{d as se}from"./chunk-WIVARGP6.js";import{a as Je}from"./chunk-FK7JFD5B.js";import{a as L}from"./chunk-5DJAX2HH.js";import{b as _e}from"./chunk-DW332N2S.js";import{b as Xe}from"./chunk-NNCQNVQC.js";import{a as U}from"./chunk-TELPJYLN.js";import{B as X,H as we,L as Be,M as xe,P as Ve,V as We,W as ze,b as ve,c as G,e as k,f as w,i as Ae,j as B,l as Ge,p as x,q as V,r as W,s as ke,t as z,u as J,z as ne}from"./chunk-HPNLQHW6.js";import{c as Y}from"./chunk-BGTK25UG.js";import{b as h,d as R}from"./chunk-A4LPGPDU.js";import{fa as oe}from"./chunk-OTPG7USH.js";import{$ as N,Ab as l,Bb as c,C as j,Cc as ae,Dc as $e,E as O,Ec as De,Fb as D,Gb as v,H as Ce,Ib as q,K as Ne,L as Z,Mc as le,Pa as d,Pb as S,Qb as g,R as fe,Rb as E,Sb as Re,Tb as Pe,Vb as C,W as _,Xb as A,aa as f,cb as y,g as Ee,gc as Ie,hb as he,jc as K,la as p,lc as Le,m as me,mc as Me,na as M,oc as ee,pc as te,qc as ie,sb as b,tb as $,v as re,w as Fe,wc as ye,xc as be,yb as T,z as Oe,zb as r}from"./chunk-T2WO6CVD.js";var He=new W,Ke=()=>He.group({passphrase:He.control("")}),pe=class a{#t=_(Y);#e=_(P);#n=_(R);#o=_(h);encryptionForm=this.#e.encryptionForm;creatingTemporaryBackup=p(!1);settings=p([]);next(){let i=this.#e.destinationTargetUrl();if(!i)throw new Error("No target URL");this.creatingTemporaryBackup.set(!0);let e=this.encryptionForm.value?.passphrase??null,t=[];e?t.push({Name:"--passphrase",Value:e}):t.push({Name:"--no-encryption",Value:"true"}),this.settings().forEach(o=>{let n=o.Name?.trim();n&&n!=="--"&&(n.startsWith("--")||(n=`--${n}`),t.push({Name:n,Value:o.Value??""}))}),this.#t.postApiV1Backups({requestBody:{Backup:{TargetURL:i,Settings:t}},temporary:!0}).pipe(O(()=>this.creatingTemporaryBackup.set(!1))).subscribe({next:o=>{let n=o.ID;this.#n.navigate([`/restore-draft/${n}`])},error:o=>{console.error(o)}})}back(){this.#e.isFileRestore()?this.#n.navigate(["destination"],{relativeTo:this.#o.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=y({type:a,selectors:[["app-restore-encryption"]],decls:16,vars:3,consts:()=>{let i;i=$localize`Enter backup passphrase if defined.`;let e;e=$localize`Password`;let t;t=$localize`Advanced options`;let o;o=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let n;return n=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `,[e,t,o,n,[3,"submit","formGroup"],["for","password"],["type","password","id","password","placeholder",i,"formControlName","passphrase"],["title",""],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"]]},template:function(e,t){e&1&&(r(0,"form",4),C("submit",function(){return t.next()}),r(1,"sh-form-field")(2,"label",5),E(3,0),l(),c(4,"input",6),l(),r(5,"sh-toggle-card"),D(6,7),E(7,1),v(),r(8,"app-options-list",8),ie("optionsChange",function(n){return te(t.settings,n)||(t.settings=n),n}),l()(),r(9,"div",9)(10,"button",10),C("click",function(){return t.back()}),S(11,2),c(12,"sh-icon"),g(),l(),r(13,"button",11),S(14,3),c(15,"sh-icon"),g(),l()()()),e&2&&(T("formGroup",t.encryptionForm),d(8),ee("options",t.settings),T("hasFreeTextSettings",!0))},dependencies:[z,B,G,k,w,V,x,we,J,X,We,Ue],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 et=()=>({standalone:!0});function tt(a,i){a&1&&c(0,"sh-progress-bar",8)}function it(a,i){if(a&1&&(K(0),ae(1,"bytes")),a&2){let e=A().$implicit;Le(" (",$e(1,1,e.FileSizes),") ")}}function ot(a,i){a&1&&(r(0,"span",16),E(1,4),l())}function nt(a,i){if(a&1&&(r(0,"div",15),K(1),ae(2,"date"),b(3,it,2,3),b(4,ot,2,0,"span",16),l()),a&2){let e=i.$implicit;d(),Me(" ",e.Version,": ",De(2,4,e.Time,"medium")," "),d(2),$(e.FileSizes?3:-1),d(),$(e.IsFullBackup===!1?4:-1)}}function st(a,i){a&1&&c(0,"sh-progress-bar",8)}function rt(a,i){if(a&1&&(r(0,"app-file-tree",14)(1,"label",17),E(2,5),l(),c(3,"input",18),l()),a&2){let e=A(2);T("rootPaths",e.rootPaths())("initialNodes",e.initialNodes())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)}}function at(a,i){if(a&1){let e=q();r(0,"sh-select",12),C("cleared",function(){N(e);let o=A();return f(o.abortLoading())}),r(1,"input",13),ie("ngModelChange",function(o){N(e);let n=A();return te(n.selectOption,o)||(n.selectOption=o),f(o)}),l(),he(2,nt,5,7,"ng-template"),l(),b(3,st,1,0,"sh-progress-bar",8),b(4,rt,4,5,"app-file-tree",14)}if(a&2){let e=A();T("options",e.versionOptions())("isClearable",!1),d(),ee("ngModel",e.selectOption),T("ngModelOptions",be(6,et)),d(2),$(e.isRepairing()||e.versionOptionsLoading()||e.loadingRootPath()?3:-1),d(),$(e.showFileTree()?4:-1)}}var ue=new W,Qe=()=>ue.group({filesToRestore:ue.control(""),passphrase:ue.control(null)}),de=class a{#t=_(Y);#e=_(P);#n=_(Xe);#o=_(U);#i=_(R);#s=_(h);#l=_(oe);#a=null;#_=null;#r=p([]);selectFilesForm=this.#e.selectFilesForm;selectFilesFormSignal=this.#e.selectFilesFormSignal;selectOption=this.#e.selectOption;backupId=this.#e.backupId;versionOptionsLoading=this.#e.versionOptionsLoading;versionOptions=this.#e.versionOptions;isFileRestore=this.#e.isFileRestore;needsDatabaseRepair=le(()=>this.#e.backup()?.Backup?.IsTemporary??!0);showFileTree=p(!1);backupSettings=p(null);rootPaths=p([]);initialNodes=p([]);loadingRootPath=p(!1);isRepairing=le(()=>this.#r().length>0);loadedVersions=p({});loadingEffect=M(()=>{if(this.versionOptionsLoading())return;let e=this.versionOptions();if(e&&e?.length>0){let t=e[0].Version;this.selectOption.set(t.toString())}});backupSettingsEffect=M(()=>{let i=this.backupId(),e=this.selectOption(),t=this.isRepairing(),o=this.loadedVersions();if(!e||!i)return;let s=this.versionOptions()?.find(Q=>Q.Version===parseInt(e))?.Time??null;if(!s)return;let u=`${i}+${s}`,F=o[u];if(this.needsDatabaseRepair()&&(!F||t))return;let I={id:i+"",time:s};this.backupSettings.set(I),this.getRootPath(I)});repairEffect=M(()=>{if(!this.needsDatabaseRepair())return;let i=this.selectOption(),e=this.versionOptions();if(i){let t=e.find(s=>s.Version===parseInt(i));if(t===void 0)return;let o=this.backupId(),n=`${o}+${t.Time}`;if(this.#_===n||(this.#_=n,this.#r().includes(n)))return;this.#r.update(s=>[...s,n]),this.#t.postApiV1BackupByIdRepairupdate({id:o,requestBody:{only_paths:!0,time:t.Time}}).pipe(Z(this.abortLoading$),O(()=>{this.#_=null})).subscribe(s=>{let u=s.ID;this.#n.waitForTaskToComplete(u).pipe(j(1)).subscribe(()=>{this.#r.update(F=>F.filter(I=>I!==n)),this.loadedVersions.update(F=>(F[n]=!0,F))})})}});getRootPath(i){let e={id:i.id+"",time:i.time,prefixOnly:!0,folderContents:!1},t=i.id+"";this.isRepairing()||this.#a===t||(this.#a=t,this.loadingRootPath.set(!0),this.showFileTree.set(!1),this.#o.hasV2ListOperations()?this.#t.postApiV2BackupListFolder({requestBody:{BackupId:i.id,Time:i.time,Paths:null,PageSize:0,Page:0}}).pipe(Z(this.abortLoading$),O(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1),this.#a=null})).subscribe({next:o=>{let n=(o.Data??[]).map(s=>s.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}):this.#t.getApiV1BackupByIdFiles(e).pipe(Z(this.abortLoading$),O(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1)})).subscribe({next:o=>{let n=o.Files.map(s=>s.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}))}abortLoading$=new Ee;abortLoading(){this.showFileTree.set(!1),this.loadingRootPath.set(!1),this.abortLoading$.next(!0)}displayFn(){let i=this.versionOptions();return e=>{if(!e)return"";let t=i?.find(o=>typeof o.Version=="number"&&o.Version.toString()===e);return t?`${t.Version}: ${this.#l.transform(t.Time,"medium")}`:""}}next(){this.#i.navigate(["options"],{relativeTo:this.#s.parent})}back(){this.#e.isFileRestore()?this.#i.navigate(["encryption"],{relativeTo:this.#s.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=y({type:a,selectors:[["app-select-files"]],features:[ye([oe])],decls:13,vars:3,consts:()=>{let i;i=$localize`Select files`;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let t;t=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let o;o=$localize`Select an option...`;let n;n=$localize`(partial)`;let s;return s=$localize`Path`,[["formRef",""],i,e,t,n,s,[3,"submit","formGroup"],[1,"title-30"],[1,"indeterminate","primary"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],["value","Version",3,"cleared","options","isClearable"],["type","text","placeholder",o,3,"ngModelChange","ngModel","ngModelOptions"],[3,"rootPaths","initialNodes","backupSettings","multiSelect","showFiles"],[1,"custom-option"],[1,"partial"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]]},template:function(e,t){if(e&1){let o=q();r(0,"form",6,0),C("submit",function(){return N(o),f(t.next())}),r(2,"h3",7),E(3,1),l(),b(4,tt,1,0,"sh-progress-bar",8)(5,at,5,7),r(6,"div",9)(7,"button",10),C("click",function(){return N(o),f(t.back())}),S(8,2),c(9,"sh-icon"),g(),l(),r(10,"button",11),S(11,3),c(12,"sh-icon"),g(),l()()()}e&2&&(T("formGroup",t.selectFilesForm),d(4),$(t.versionOptionsLoading()?4:5),d(5),Re(t.isFileRestore()?"Back":"Exit"),Pe(8))},dependencies:[ke,B,G,k,w,Ae,z,V,x,se,X,J,Ve,Be,oe,Je],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.partial[_ngcontent-%COMP%]{color:var(--base-9);font-style:italic}"],changeDetection:0})};var P=class a{#t=_(R);#e=_(h);#n=_(U);#o=_(ne);#i=_(Y);backupId=p(null);backup=p(null);destinationTargetUrl=p(null);selectFilesForm=Qe();optionsForm=Ze();encryptionForm=Ke();optionsFormSignal=_e(this.optionsForm.valueChanges);selectFilesFormSignal=_e(this.selectFilesForm.valueChanges);selectOption=p(null);versionOptionsLoading=p(!1);versionOptions=p([]);isSubmitting=p(!1);isFileRestore=p(!1);isFullWidthPage=p(!1);#s=p("");#l=p(null);#a=null;testSignal=this.#s.asReadonly();testErrorMessage=this.#l.asReadonly();#_=M(()=>{let i=this.destinationTargetUrl(),e=this.#s(),t=this.#a;this.#a=i,!(e==="testing"||t===null||t===i)&&(this.#s.set(""),this.#l.set(null))});init(i,e=!1){this.backupId.set(i),this.isFileRestore.set(e),e&&this.#t.navigate(["/restore-from-files/destination"]),e||this.getBackup()}setTestState(i,e){this.#s.set(i),this.#l.set(e??null)}updateTargetUrl(i){this.destinationTargetUrl.set(i)}submit(){this.isSubmitting.set(!0);let i=this.backupId();this.backup()?.Backup?.IsTemporary??!1?this.#i.postApiV1BackupByIdCopytotemp({id:this.backupId()??""}).subscribe({next:t=>{this.#r(t.ID??"")},error:t=>this.showErrorDialog($localize`An error occurred while copying the backup to a temporary location: ${t.message}`)}):this.#r(i??"")}showErrorDialog(i){this.#o.open(L,{data:{title:$localize`Error occured`,message:i,confirmText:$localize`OK`,cancelText:void 0},closed:e=>{}})}#r(i){let e=this.optionsForm.value,t=this.selectFilesForm.value,o=this.selectOption(),n=this.versionOptions()?.find(s=>s.Version===(o&&parseInt(o)));this.#i.postApiV1BackupByIdRestore({id:i??"",requestBody:{paths:t.filesToRestore?.split("\0").map(s=>s.endsWith("/")||s.endsWith("\\")?`${s}*`:s)??[],passphrase:t.passphrase??null,time:n?.Time,restore_path:e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!e.includeMetadata}}).pipe(O(()=>this.isSubmitting.set(!1))).subscribe({next:s=>{this.#t.navigate([`./${s.ID}`,"progress"],{relativeTo:this.#e})},error:s=>{console.error("restore error",s)}})}exit(){this.#o.open(L,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:i=>{i&&(this.#p(),this.#t.navigate(["/"]))}})}getVersionOptions(){this.versionOptions()}loadFilesetsWithRetryv2(i,e=2){return this.#i.postApiV2BackupListFilesets({requestBody:{BackupId:i}}).pipe(Oe(t=>{let o=t?.error?.body?.StatusCode??t?.error?.requestBody?.StatusCode;return o==="EncryptedStorageNoPassphrase"||o==="FolderMissing"||o==="EmptyRemoteFolder"||e===0?me(()=>t):Fe(1e3).pipe(Ne(()=>this.loadFilesetsWithRetryv2(i,e-1)))}))}getBackup(){let i=this.backupId();this.versionOptionsLoading.set(!0),this.#n.hasV2ListOperations()?re([this.#i.getApiV1BackupById({id:i}),this.loadFilesetsWithRetryv2(i)]).pipe(j(1),O(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([e,t])=>{if(t.Error)throw new Error(t.Error);if(!(e.Backup?.IsTemporary??!0)&&e?.Backup?.DBPathExists===!1){this.#o.open(L,{data:{title:$localize`Missing Local Database`,message:$localize`The local database for this backup is missing. Please repair or recreate the local database before restoring.`,confirmText:$localize`OK`,cancelText:void 0},closed:n=>{this.#t.navigate(["/backup",i,"database"])}});return}this.versionOptions.set((t.Data??[]).map(n=>({Version:n.Version??-1,IsFullBackup:n.IsFullBackup??void 0,Time:n.Time??"<missing>",FileCount:n.FileCount??void 0,FileSizes:n.FileSizes??void 0}))),this.backup.set(e)},error:e=>{let t=e?.error?.body?.StatusCode??e?.error?.requestBody?.StatusCode,o=t==="EncryptedStorageNoPassphrase",n=t==="FolderMissing",s=t==="EmptyRemoteFolder",u=$localize`An error occurred while loading the backup filesets: ${e.message}`;o&&(u=$localize`The remote storage is encrypted. Please enter the passphrase to access the backup.`),n&&(u=$localize`The backup storage folder was not found.`),s&&(u=$localize`The backup storage folder does not contain any filesets.`),this.#o.open(L,{data:{title:$localize`Failed to load backup filesets`,message:u,confirmText:$localize`OK`,cancelText:void 0},closed:F=>{this.#t.navigate([o?"/restore-from-files/encryption":"/restore-from-files/destination"])}})}}):re([this.#i.getApiV1BackupById({id:i}),this.#i.getApiV1BackupByIdFilesets({id:i}).pipe(Ce(3))]).pipe(j(1),O(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([e,t])=>{this.versionOptions.set(t.map(o=>({Version:o.Version??-1,IsFullBackup:(o.IsFullBackup??1)==1,Time:o.Time??"<missing>",FileCount:o.FileCount??void 0,FileSizes:o.FileSizes??void 0}))),this.backup.set(e)}})}#p(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||a)};static \u0275prov=fe({token:a,factory:a.\u0275fac,providedIn:"root"})};var H=new W,Ze=()=>H.group({restoreFrom:H.control("original"),restoreFromPath:H.control(""),handleExisting:H.control("saveTimestamp"),permissions:H.control(!1),includeMetadata:H.control(!0)}),Se=class a{#t=_(P);#e=_(R);#n=_(h);#o=_(U);#i=_(ne);optionsForm=this.#t.optionsForm;optionsFormSignal=this.#t.optionsFormSignal;isSubmitting=this.#t.isSubmitting;goBack(){this.#e.navigate(["select-files"],{relativeTo:this.#n.parent})}submit(){let i=this.#t.selectFilesFormSignal()?.filesToRestore??[];if(i.length>0&&this.optionsFormSignal()?.restoreFrom=="original"&&(i[0].includes("/")?"/":"\\")!==this.#o.systemInfo()?.DirectorySeparator){this.#i.open(L,{data:{title:$localize`Confirm target folder`,message:$localize`This backup was created on another operating system. Restoring files without specifying a destination folder can cause files to be restored in unexpected places. Are you sure you want to continue without choosing a destination folder?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:t=>{t&&this.#t.submit()}});return}this.#t.submit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=y({type:a,selectors:[["app-advanced-options-settings"]],decls:42,vars:7,consts:()=>{let i;i=$localize`Restore options`;let e;e=$localize`Where do you want to restore files to?`;let t;t=$localize` Original location ${"\uFFFD#9\uFFFD\uFFFD/#9\uFFFD"}:TAG_INPUT:`;let o;o=$localize` Pick location ${"\uFFFD#12\uFFFD\uFFFD/#12\uFFFD"}:TAG_INPUT:`;let n;n=$localize`How do you want to handle existing files?`;let s;s=$localize` Overwrite ${"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"}:TAG_INPUT:`;let u;u=$localize` Save different versions with timestamp in file name ${"\uFFFD#25\uFFFD\uFFFD/#25\uFFFD"}:TAG_INPUT:`;let F;F=$localize`Metadata settings`;let I;I=$localize` Restore file metadata ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let Q;Q=$localize` Restore read/write permissions ${"\uFFFD#34\uFFFD\uFFFD/#34\uFFFD"}:TAG_INPUT:`;let ge;ge=$localize`${"\uFFFD#38\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let Te;return Te=$localize`${"\uFFFD#41\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#41\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `,[["formRef",""],i,e,t,o,n,s,u,F,I,Q,ge,Te,[3,"submit","formGroup"],[1,"title-30"],[3,"disallowToggle"],["title",""],[1,"raised","primary"],["type","radio","name","restoreFrom","value","original","formControlName","restoreFrom"],["type","radio","name","restoreFrom","value","pickLocation","formControlName","restoreFrom"],[3,"disabled","enableCreateFolder"],["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","includeMetadata"],["type","checkbox","formControlName","permissions"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"]]},template:function(e,t){if(e&1){let o=q();r(0,"form",13,0),C("submit",function(){return N(o),f(t.submit())}),r(2,"h3",14),E(3,1),l(),r(4,"app-toggle-card",15),D(5,16),E(6,2),v(),r(7,"sh-radio",17),S(8,3),c(9,"input",18),g(),l(),r(10,"sh-radio",17),S(11,4),c(12,"input",19),g(),l(),r(13,"app-file-tree",20)(14,"label",21),K(15,"Path"),l(),c(16,"input",22),l()(),r(17,"app-toggle-card",15),D(18,16),E(19,5),v(),r(20,"sh-radio",17),S(21,6),c(22,"input",23),g(),l(),r(23,"sh-radio",17),S(24,7),c(25,"input",24),g(),l()(),r(26,"app-toggle-card"),D(27,16),E(28,8),v(),r(29,"sh-toggle",25),S(30,9),c(31,"input",26),g(),l(),r(32,"sh-toggle",25),S(33,10),c(34,"input",27),g(),l()(),r(35,"div",28)(36,"button",29),C("click",function(){return N(o),f(t.goBack())}),S(37,11),c(38,"sh-icon"),g(),l(),r(39,"button",30),S(40,12),c(41,"sh-icon"),g(),l()()()}if(e&2){let o;T("formGroup",t.optionsForm),d(4),T("disallowToggle",!0),d(9),T("disabled",((o=t.optionsFormSignal())==null?null:o.restoreFrom)!=="pickLocation")("enableCreateFolder",!0),d(4),T("disallowToggle",!0),d(22),Ie("loader",t.isSubmitting())}},dependencies:[z,B,G,ve,Ge,k,w,V,x,Ye,se,ze,xe,X,J],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{Ze as a,Se as b,Ke as c,pe as d,Qe as e,de as f,P as g};
@@ -1,2 +1,2 @@
1
- import{a as xe}from"./chunk-AS6Z56AD.js";import{g as ue}from"./chunk-IW4RDAIN.js";import{c as ge,d as fe}from"./chunk-WIVARGP6.js";import{a as Ce}from"./chunk-TELPJYLN.js";import{B as le,H as _e,K as pe,P as se,V as ce,W as me,Y as de,b as ee,c as te,e as ne,i as ie,k as oe,s as ae,u as re}from"./chunk-HPNLQHW6.js";import{_ as Z}from"./chunk-OTPG7USH.js";import{$ as d,Ab as p,Bb as N,Fb as R,Gb as M,Gc as v,Hb as f,Ib as x,Mc as H,Pa as l,Pb as k,Qb as G,Rb as Q,Rc as J,Uc as Y,Vb as u,W as j,Xb as r,aa as C,cb as q,ec as g,gc as B,hb as S,jc as m,kc as z,la as b,lc as U,rc as K,sb as F,sc as E,tb as h,tc as O,ub as $,wb as A,xb as D,xc as W,yb as s,yc as T,zb as _}from"./chunk-T2WO6CVD.js";import{a as L,b as P}from"./chunk-7CGTOI24.js";var Te=[{name:"send-mail-to",type:"Email"},{name:"send-mail-from",type:"Email"},{name:"log-file",type:"FileTree"},{name:"compression-extension-file",type:"FileTree"},{name:"dbpath",type:"FileTree"},{name:"restore-path",type:"FileTree"},{name:"gpg-program-path",type:"FileTree"}];var Fe=()=>({updateOn:"blur"}),w=t=>({formView:t}),y=t=>({$implicit:t});function he(t,i){if(t&1){let e=x();_(0,"button",14),u("click",function(){d(e);let n=r();return C(n.showTextArea.set(!1))}),k(1,6),N(2,"sh-icon"),G(),p()}}function we(t,i){if(t&1){let e=x();_(0,"button",18,1),u("click",function(){let n=d(e).$implicit,a=r(3);return C(a.addSetting(n))}),_(2,"div",19)(3,"p"),m(4),p(),m(5),p()()}if(t&2){let e=i.$implicit;B("deprecated",e.deprecatedDescription),l(4),z(e.shortDescription),l(),U(" ",e.name," ")}}function ye(t,i){if(t&1&&(_(0,"h3",10),m(1),p(),A(2,we,6,4,"button",17,$)),t&2){let e=i.$implicit;l(),z(e.displayName),l(),D(e.options)}}function Ve(t,i){if(t&1){let e=x();_(0,"sh-menu")(1,"button",20)(2,"sh-icon"),m(3,"dots-three-vertical"),p()(),R(4,16),_(5,"button",14),u("click",function(){d(e);let n=r(2);return C(n.addFreeTextSetting())}),k(6,8),N(7,"sh-icon"),G(),p(),_(8,"button",21),u("click",function(){d(e);let n=r(2);return C(n.showTextArea.set(!0))}),_(9,"sh-icon"),m(10,"link"),p(),m(11," Edit contents as text "),p(),M(),p()}}function Le(t,i){if(t&1&&(_(0,"sh-menu",15)(1,"button",12),k(2,7),N(3,"sh-icon"),G(),p(),R(4,16),A(5,ye,4,1,null,null,$),M(),p(),F(7,Ve,12,0,"sh-menu")),t&2){let e=r();s("searchable",!0),l(5),D(e.nonSelectedOptionsGrouped()),l(2),h(e.hasFreeTextSettings()?7:-1)}}function Ie(t,i){if(t&1){let e=x();_(0,"textarea",22),u("ngModelChange",function(n){d(e);let a=r();return C(a.updateSettingsFromText(n))}),p()}if(t&2){let e=r();s("ngModel",e.settingsAsText())("ngModelOptions",W(2,Fe))}}function Ne(t,i){t&1&&(_(0,"div",23),m(1,"Add a setting above to get started."),p())}function Me(t,i){t&1&&(_(0,"sh-icon",31),m(1," warning-octagon "),p())}function Ee(t,i){if(t&1&&(_(0,"sh-icon",32),m(1,"archive"),p()),t&2){let e=r(2).$implicit;s("shTooltip",e.FormView.deprecatedDescription)}}function ve(t,i){if(t&1&&(_(0,"sh-icon",33),m(1,"question"),p()),t&2){let e=r(2).$implicit;s("shTooltip",e.FormView.longDescription)}}function Pe(t,i){if(t&1&&(F(0,Me,2,0,"sh-icon",31),_(1,"span"),m(2),p(),F(3,Ee,2,1,"sh-icon",32)(4,ve,2,1,"sh-icon",33)),t&2){let e=r().$implicit,o=O(1);h(o?0:-1),l(),B("deprecated",e.FormView.deprecatedDescription),l(),z(e.FormView.shortDescription),l(),h(e.FormView.deprecatedDescription?3:e.FormView.longDescription?4:-1)}}function be(t,i){t&1&&f(0)}function $e(t,i){if(t&1){let e=x();_(0,"div",25)(1,"label"),S(2,be,1,0,"ng-container",34),p(),_(3,"div")(4,"sh-form-field")(5,"input",35),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateFreeTextSettingName(a,n))}),p(),_(6,"sh-icon",36),m(7,"rectangle-dashed"),p()()(),_(8,"div")(9,"sh-form-field")(10,"input",35),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p(),_(11,"sh-icon",36),m(12,"textbox"),p()()()()}if(t&2){let e=r().$implicit,o=g(3);l(2),s("ngTemplateOutlet",o),l(3),s("ngModel",e.Name),l(5),s("ngModel",e.Value())}}function Ae(t,i){t&1&&f(0)}function De(t,i){if(t&1){let e=x();_(0,"app-file-tree",26)(1,"label",37),S(2,Ae,1,0,"ng-container",34),p(),_(3,"input",38),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);s("startingPath",e.Value())("accepts",e.FormView.accepts)("showFiles",!0)("showHiddenNodes",!0)("selectFiles",!0),l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("id",n)("ngModel",e.Value())}}function Re(t,i){if(t&1){let e=x();_(0,"app-file-tree",27),N(1,"label",37),_(2,"input",38),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p()()}if(t&2){let e=r().$implicit,o=O(0);s("startingPath",e.Value()),l(),s("for",o),l(),s("id",o)("ngModel",e.Value())}}function ke(t,i){t&1&&f(0)}function Ge(t,i){t&1&&f(0)}function Be(t,i){t&1&&(_(0,"sh-icon",36),m(1,"link"),p())}function ze(t,i){t&1&&(_(0,"sh-icon",36),m(1,"hard-drives"),p())}function Ue(t,i){t&1&&(_(0,"sh-icon",36),m(1,"jar"),p())}function Ke(t,i){t&1&&(_(0,"sh-icon",36),m(1,"envelope"),p())}function He(t,i){t&1&&(_(0,"sh-icon",36),m(1,"textbox"),p())}function Je(t,i){if(t&1){let e=x();_(0,"sh-form-field")(1,"label",37),S(2,ke,1,0,"ng-container",34)(3,Ge,1,0,"ng-container",39),p(),_(4,"input",40),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p(),F(5,Be,2,0,"sh-icon",36)(6,ze,2,0,"sh-icon",36)(7,Ue,2,0,"sh-icon",36)(8,Ke,2,0,"sh-icon",36)(9,He,2,0,"sh-icon",36),p()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("ngTemplateOutlet",a)("ngTemplateOutletContext",T(10,y,T(8,w,e.FormView))),l(),s("type",e.FormView.type==="Email"?"email":"text")("id",n)("ngModel",e.Value()),l(),h(e.FormView.type==="Path"?5:e.FormView.type==="Hostname"?6:e.FormView.type==="Bucketname"?7:e.FormView.type==="Email"?8:9)}}function Xe(t,i){t&1&&f(0)}function je(t,i){t&1&&f(0)}function qe(t,i){if(t&1){let e=x();_(0,"sh-icon",43),u("click",function(){d(e);let n=r(2).$implicit;return C(n.showPassword=!n.showPassword)}),m(1," eye "),p()}}function Qe(t,i){if(t&1){let e=x();_(0,"sh-icon",43),u("click",function(){d(e);let n=r(2).$implicit;return C(n.showPassword=!n.showPassword)}),m(1," eye-slash "),p()}}function We(t,i){if(t&1){let e=x();_(0,"sh-form-field")(1,"label",37),S(2,Xe,1,0,"ng-container",34)(3,je,1,0,"ng-container",39),p(),_(4,"input",41),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p(),_(5,"sh-icon",36),m(6,"password"),p(),F(7,qe,2,0,"sh-icon",42)(8,Qe,2,0,"sh-icon",42),p()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("ngTemplateOutlet",a)("ngTemplateOutletContext",T(10,y,T(8,w,e.FormView))),l(),s("type",e.showPassword?"text":"password")("id",n)("ngModel",e.Value()),l(3),h(e.showPassword?7:8)}}function Ye(t,i){t&1&&f(0)}function Ze(t,i){t&1&&f(0)}function et(t,i){if(t&1&&m(0),t&2){let e=i.$implicit;U(" ",e," ")}}function tt(t,i){if(t&1){let e=x();_(0,"sh-select",44)(1,"label",37),S(2,Ye,1,0,"ng-container",34)(3,Ze,1,0,"ng-container",39),p(),_(4,"input",38),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p()(),S(5,et,1,1,"ng-template",null,3,v)}if(t&2){let e=g(6),o=r().$implicit,n=g(3),a=O(0);r(2);let c=g(10);s("options",o.FormView.options)("isClearable",!1)("optionTemplate",e),l(),s("for",a),l(),s("ngTemplateOutlet",n),l(),s("ngTemplateOutlet",c)("ngTemplateOutletContext",T(11,y,T(9,w,o.FormView))),l(),s("id",a)("ngModel",o.Value())}}function nt(t,i){t&1&&f(0)}function it(t,i){t&1&&f(0)}function ot(t,i){if(t&1){let e=x();_(0,"app-size",45),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),_(1,"label",37),S(2,nt,1,0,"ng-container",34)(3,it,1,0,"ng-container",39),p()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);s("inputType",e.Name)("ngModel",e.Value())("customId",n),l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("ngTemplateOutlet",a)("ngTemplateOutletContext",T(9,y,T(7,w,e.FormView)))}}function at(t,i){t&1&&f(0)}function rt(t,i){t&1&&f(0)}function lt(t,i){if(t&1){let e=x();_(0,"sh-form-field")(1,"label",37),S(2,at,1,0,"ng-container",34)(3,rt,1,0,"ng-container",39),p(),_(4,"input",46),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p(),_(5,"sh-icon",36),m(6,"numpad"),p()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("ngTemplateOutlet",a)("ngTemplateOutletContext",T(8,y,T(6,w,e.FormView))),l(),s("id",n)("ngModel",e.Value())}}function _t(t,i){t&1&&f(0)}function pt(t,i){t&1&&f(0)}function st(t,i){if(t&1){let e=x();_(0,"sh-toggle",29)(1,"label",37),S(2,_t,1,0,"ng-container",34)(3,pt,1,0,"ng-container",39),p(),_(4,"input",47),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("ngTemplateOutlet",a)("ngTemplateOutletContext",T(8,y,T(6,w,e.FormView))),l(),s("id",n)("ngModel",e.Value())}}function ct(t,i){t&1&&f(0)}function mt(t,i){t&1&&f(0)}function dt(t,i){if(t&1&&m(0),t&2){let e=i.$implicit;U(" ",e," ")}}function Ct(t,i){if(t&1){let e=x();_(0,"sh-select",48)(1,"label",37),S(2,ct,1,0,"ng-container",34)(3,mt,1,0,"ng-container",39),p(),_(4,"input",49),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p()(),S(5,dt,1,1,"ng-template",null,4,v)}if(t&2){let e=g(6),o=r().$implicit,n=g(3),a=O(0);r(2);let c=g(10);s("options",o.FormView.options)("selectMultiple",!0)("optionTemplate",e),l(),s("for",a),l(),s("ngTemplateOutlet",n),l(),s("ngTemplateOutlet",c)("ngTemplateOutletContext",T(10,y,T(8,w,o.FormView))),l(),s("ngModel",o.Value())}}function ut(t,i){t&1&&f(0)}function gt(t,i){t&1&&f(0)}function ft(t,i){if(t&1){let e=x();_(0,"app-timespan",45),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),_(1,"label",37),S(2,ut,1,0,"ng-container",34)(3,gt,1,0,"ng-container",39),p()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);s("inputType",e.Name)("ngModel",e.Value())("customId",n),l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("ngTemplateOutlet",a)("ngTemplateOutletContext",T(9,y,T(7,w,e.FormView)))}}function xt(t,i){if(t&1){let e=x();K(0)(1),S(2,Pe,5,5,"ng-template",null,2,v),_(4,"div",24),F(5,$e,13,3,"div",25)(6,De,4,9,"app-file-tree",26)(7,Re,3,4,"app-file-tree",27)(8,Je,10,12,"sh-form-field")(9,We,9,12,"sh-form-field")(10,tt,7,13)(11,ot,4,11,"app-size",28)(12,lt,7,10,"sh-form-field")(13,st,5,10,"sh-toggle",29)(14,Ct,7,12)(15,ft,4,11,"app-timespan",28),_(16,"button",30),u("click",function(){let n=d(e).$implicit,a=r(2);return C(a.removeSetting(n))}),_(17,"sh-icon"),m(18,"x-bold"),p()()()}if(t&2){let e=i.$implicit,o=i.$index,n=r(2);E("destination-"+e.Name+o),l(),E(n.inAppOptions(e.Name)),l(3),B("align-remove-start",e.FormView.type==="FolderTree"||e.FormView.type==="FileTree"||e.FormView.type==="Boolean"),l(),h(e.FormView.type==="FreeText"?5:e.FormView.type==="FileTree"?6:e.FormView.type==="FolderTree"?7:e.FormView.type==="String"||e.FormView.type==="Path"||e.FormView.type==="Decimal"||e.FormView.type==="Email"||e.FormView.type==="Hostname"||e.FormView.type==="Bucketname"?8:e.FormView.type==="Password"?9:e.FormView.type==="Enumeration"?10:e.FormView.type==="Size"?11:e.FormView.type==="Integer"?12:e.FormView.type==="Boolean"?13:e.FormView.type==="Flags"?14:e.FormView.type==="Timespan"||e.FormView.type==="DateTime"?15:-1)}}function Tt(t,i){if(t&1&&(F(0,Ne,2,0,"div",23),A(1,xt,19,5,null,null,$)),t&2){let e=r();h(e.selectedSettings().length===0?0:-1),l(),D(e.selectedSettings())}}function St(t,i){if(t&1&&(_(0,"sh-icon",50),m(1,"x-circle"),p()),t&2){r();let e=O(0);s("shTooltip",(e==null?null:e.message)??"Invalid value")}}function Ot(t,i){if(t&1&&(_(0,"sh-icon",32),m(1,"warning"),p()),t&2){r();let e=O(0);s("shTooltip",(e==null?null:e.message)??"Invalid value")}}function Ft(t,i){if(t&1&&(K(0),F(1,St,2,1,"sh-icon",50)(2,Ot,2,1,"sh-icon",32)),t&2){r();let e=O(0),o=r().$implicit,n=E(o.formView.validate(e));l(),h((n==null?null:n.type)==="error"?1:(n==null?null:n.type)==="warning"?2:-1)}}function ht(t,i){if(t&1&&(K(0),F(1,Ft,3,2)),t&2){let e=r().$implicit,n=(E(e.Value())??"").toString().trim()==="";l(),h(!n&&e.formView.validate?1:-1)}}function wt(t,i){if(t&1&&F(0,ht,2,2),t&2){let e=i.$implicit;h(e.Value?0:-1)}}var Se=class t{#e=j(Ce);options=Y.required();hiddenOptions=J([]);hasFreeTextSettings=J(!1);applicationOptions=J();showTextArea=b(!1);allOptionsGrouped=this.#e.allOptionsGrouped;allOptions=this.#e.allOptions;selectedSettings=H(()=>{let i=this.hiddenOptions();return this.options().map(n=>{let a=this.allOptions().find(V=>V.name===n.Name?.replace("--","")),c=n.Value??"";if(a&&i.includes(a.name))return null;if(a){if(a.type==="Boolean"&&(c=this.isTrue(c)),a.type==="Integer"&&(c=parseInt(c)||0),a.type==="Enumeration"&&a.options){let I=c?.trim().toLowerCase(),X=a.options.find(Oe=>(Oe??"").trim().toLocaleLowerCase()===I);X&&(c=X)}let V=Te.find(I=>I.name===a?.name);return V&&(a=L(L({},a),V)),P(L({},n),{Value:b(c),FormView:a})}else if(this.hasFreeTextSettings())return P(L({},n),{Value:b(c),FormView:{name:n.Name,type:"FreeText",shortDescription:"Custom settings argument",longDescription:"Custom settings argument"}});return null}).filter(n=>n!==null)});nonSelectedOptionsGrouped=H(()=>{let i=this.options().map(o=>o.Name?.replace("--","")),e=this.hiddenOptions();return this.allOptionsGrouped().map(o=>P(L({},o),{options:o.options.filter(n=>!i.includes(n.name)&&!e.includes(n.name))})).filter(o=>o.options.length>0)});settingsAsText=H(()=>this.selectedSettings().map(i=>{let e=i.Value(),o="";return typeof e=="boolean"?o=this.isTrue(e)?"True":"False":(typeof e=="number"||e!=null)&&(o=e.toString()),`${i.Name??""}=${o}`}).join(`
1
+ import{a as xe}from"./chunk-AS6Z56AD.js";import{g as ue}from"./chunk-DGKNUD3G.js";import{c as ge,d as fe}from"./chunk-WIVARGP6.js";import{a as Ce}from"./chunk-TELPJYLN.js";import{B as le,H as _e,K as pe,P as se,V as ce,W as me,Y as de,b as ee,c as te,e as ne,i as ie,k as oe,s as ae,u as re}from"./chunk-HPNLQHW6.js";import{_ as Z}from"./chunk-OTPG7USH.js";import{$ as d,Ab as p,Bb as N,Fb as R,Gb as M,Gc as v,Hb as f,Ib as x,Mc as H,Pa as l,Pb as k,Qb as G,Rb as Q,Rc as J,Uc as Y,Vb as u,W as j,Xb as r,aa as C,cb as q,ec as g,gc as B,hb as S,jc as m,kc as z,la as b,lc as U,rc as K,sb as F,sc as E,tb as h,tc as O,ub as $,wb as A,xb as D,xc as W,yb as s,yc as T,zb as _}from"./chunk-T2WO6CVD.js";import{a as L,b as P}from"./chunk-7CGTOI24.js";var Te=[{name:"send-mail-to",type:"Email"},{name:"send-mail-from",type:"Email"},{name:"log-file",type:"FileTree"},{name:"compression-extension-file",type:"FileTree"},{name:"dbpath",type:"FileTree"},{name:"restore-path",type:"FileTree"},{name:"gpg-program-path",type:"FileTree"}];var Fe=()=>({updateOn:"blur"}),w=t=>({formView:t}),y=t=>({$implicit:t});function he(t,i){if(t&1){let e=x();_(0,"button",14),u("click",function(){d(e);let n=r();return C(n.showTextArea.set(!1))}),k(1,6),N(2,"sh-icon"),G(),p()}}function we(t,i){if(t&1){let e=x();_(0,"button",18,1),u("click",function(){let n=d(e).$implicit,a=r(3);return C(a.addSetting(n))}),_(2,"div",19)(3,"p"),m(4),p(),m(5),p()()}if(t&2){let e=i.$implicit;B("deprecated",e.deprecatedDescription),l(4),z(e.shortDescription),l(),U(" ",e.name," ")}}function ye(t,i){if(t&1&&(_(0,"h3",10),m(1),p(),A(2,we,6,4,"button",17,$)),t&2){let e=i.$implicit;l(),z(e.displayName),l(),D(e.options)}}function Ve(t,i){if(t&1){let e=x();_(0,"sh-menu")(1,"button",20)(2,"sh-icon"),m(3,"dots-three-vertical"),p()(),R(4,16),_(5,"button",14),u("click",function(){d(e);let n=r(2);return C(n.addFreeTextSetting())}),k(6,8),N(7,"sh-icon"),G(),p(),_(8,"button",21),u("click",function(){d(e);let n=r(2);return C(n.showTextArea.set(!0))}),_(9,"sh-icon"),m(10,"link"),p(),m(11," Edit contents as text "),p(),M(),p()}}function Le(t,i){if(t&1&&(_(0,"sh-menu",15)(1,"button",12),k(2,7),N(3,"sh-icon"),G(),p(),R(4,16),A(5,ye,4,1,null,null,$),M(),p(),F(7,Ve,12,0,"sh-menu")),t&2){let e=r();s("searchable",!0),l(5),D(e.nonSelectedOptionsGrouped()),l(2),h(e.hasFreeTextSettings()?7:-1)}}function Ie(t,i){if(t&1){let e=x();_(0,"textarea",22),u("ngModelChange",function(n){d(e);let a=r();return C(a.updateSettingsFromText(n))}),p()}if(t&2){let e=r();s("ngModel",e.settingsAsText())("ngModelOptions",W(2,Fe))}}function Ne(t,i){t&1&&(_(0,"div",23),m(1,"Add a setting above to get started."),p())}function Me(t,i){t&1&&(_(0,"sh-icon",31),m(1," warning-octagon "),p())}function Ee(t,i){if(t&1&&(_(0,"sh-icon",32),m(1,"archive"),p()),t&2){let e=r(2).$implicit;s("shTooltip",e.FormView.deprecatedDescription)}}function ve(t,i){if(t&1&&(_(0,"sh-icon",33),m(1,"question"),p()),t&2){let e=r(2).$implicit;s("shTooltip",e.FormView.longDescription)}}function Pe(t,i){if(t&1&&(F(0,Me,2,0,"sh-icon",31),_(1,"span"),m(2),p(),F(3,Ee,2,1,"sh-icon",32)(4,ve,2,1,"sh-icon",33)),t&2){let e=r().$implicit,o=O(1);h(o?0:-1),l(),B("deprecated",e.FormView.deprecatedDescription),l(),z(e.FormView.shortDescription),l(),h(e.FormView.deprecatedDescription?3:e.FormView.longDescription?4:-1)}}function be(t,i){t&1&&f(0)}function $e(t,i){if(t&1){let e=x();_(0,"div",25)(1,"label"),S(2,be,1,0,"ng-container",34),p(),_(3,"div")(4,"sh-form-field")(5,"input",35),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateFreeTextSettingName(a,n))}),p(),_(6,"sh-icon",36),m(7,"rectangle-dashed"),p()()(),_(8,"div")(9,"sh-form-field")(10,"input",35),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p(),_(11,"sh-icon",36),m(12,"textbox"),p()()()()}if(t&2){let e=r().$implicit,o=g(3);l(2),s("ngTemplateOutlet",o),l(3),s("ngModel",e.Name),l(5),s("ngModel",e.Value())}}function Ae(t,i){t&1&&f(0)}function De(t,i){if(t&1){let e=x();_(0,"app-file-tree",26)(1,"label",37),S(2,Ae,1,0,"ng-container",34),p(),_(3,"input",38),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);s("startingPath",e.Value())("accepts",e.FormView.accepts)("showFiles",!0)("showHiddenNodes",!0)("selectFiles",!0),l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("id",n)("ngModel",e.Value())}}function Re(t,i){if(t&1){let e=x();_(0,"app-file-tree",27),N(1,"label",37),_(2,"input",38),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p()()}if(t&2){let e=r().$implicit,o=O(0);s("startingPath",e.Value()),l(),s("for",o),l(),s("id",o)("ngModel",e.Value())}}function ke(t,i){t&1&&f(0)}function Ge(t,i){t&1&&f(0)}function Be(t,i){t&1&&(_(0,"sh-icon",36),m(1,"link"),p())}function ze(t,i){t&1&&(_(0,"sh-icon",36),m(1,"hard-drives"),p())}function Ue(t,i){t&1&&(_(0,"sh-icon",36),m(1,"jar"),p())}function Ke(t,i){t&1&&(_(0,"sh-icon",36),m(1,"envelope"),p())}function He(t,i){t&1&&(_(0,"sh-icon",36),m(1,"textbox"),p())}function Je(t,i){if(t&1){let e=x();_(0,"sh-form-field")(1,"label",37),S(2,ke,1,0,"ng-container",34)(3,Ge,1,0,"ng-container",39),p(),_(4,"input",40),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p(),F(5,Be,2,0,"sh-icon",36)(6,ze,2,0,"sh-icon",36)(7,Ue,2,0,"sh-icon",36)(8,Ke,2,0,"sh-icon",36)(9,He,2,0,"sh-icon",36),p()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("ngTemplateOutlet",a)("ngTemplateOutletContext",T(10,y,T(8,w,e.FormView))),l(),s("type",e.FormView.type==="Email"?"email":"text")("id",n)("ngModel",e.Value()),l(),h(e.FormView.type==="Path"?5:e.FormView.type==="Hostname"?6:e.FormView.type==="Bucketname"?7:e.FormView.type==="Email"?8:9)}}function Xe(t,i){t&1&&f(0)}function je(t,i){t&1&&f(0)}function qe(t,i){if(t&1){let e=x();_(0,"sh-icon",43),u("click",function(){d(e);let n=r(2).$implicit;return C(n.showPassword=!n.showPassword)}),m(1," eye "),p()}}function Qe(t,i){if(t&1){let e=x();_(0,"sh-icon",43),u("click",function(){d(e);let n=r(2).$implicit;return C(n.showPassword=!n.showPassword)}),m(1," eye-slash "),p()}}function We(t,i){if(t&1){let e=x();_(0,"sh-form-field")(1,"label",37),S(2,Xe,1,0,"ng-container",34)(3,je,1,0,"ng-container",39),p(),_(4,"input",41),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p(),_(5,"sh-icon",36),m(6,"password"),p(),F(7,qe,2,0,"sh-icon",42)(8,Qe,2,0,"sh-icon",42),p()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("ngTemplateOutlet",a)("ngTemplateOutletContext",T(10,y,T(8,w,e.FormView))),l(),s("type",e.showPassword?"text":"password")("id",n)("ngModel",e.Value()),l(3),h(e.showPassword?7:8)}}function Ye(t,i){t&1&&f(0)}function Ze(t,i){t&1&&f(0)}function et(t,i){if(t&1&&m(0),t&2){let e=i.$implicit;U(" ",e," ")}}function tt(t,i){if(t&1){let e=x();_(0,"sh-select",44)(1,"label",37),S(2,Ye,1,0,"ng-container",34)(3,Ze,1,0,"ng-container",39),p(),_(4,"input",38),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p()(),S(5,et,1,1,"ng-template",null,3,v)}if(t&2){let e=g(6),o=r().$implicit,n=g(3),a=O(0);r(2);let c=g(10);s("options",o.FormView.options)("isClearable",!1)("optionTemplate",e),l(),s("for",a),l(),s("ngTemplateOutlet",n),l(),s("ngTemplateOutlet",c)("ngTemplateOutletContext",T(11,y,T(9,w,o.FormView))),l(),s("id",a)("ngModel",o.Value())}}function nt(t,i){t&1&&f(0)}function it(t,i){t&1&&f(0)}function ot(t,i){if(t&1){let e=x();_(0,"app-size",45),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),_(1,"label",37),S(2,nt,1,0,"ng-container",34)(3,it,1,0,"ng-container",39),p()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);s("inputType",e.Name)("ngModel",e.Value())("customId",n),l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("ngTemplateOutlet",a)("ngTemplateOutletContext",T(9,y,T(7,w,e.FormView)))}}function at(t,i){t&1&&f(0)}function rt(t,i){t&1&&f(0)}function lt(t,i){if(t&1){let e=x();_(0,"sh-form-field")(1,"label",37),S(2,at,1,0,"ng-container",34)(3,rt,1,0,"ng-container",39),p(),_(4,"input",46),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p(),_(5,"sh-icon",36),m(6,"numpad"),p()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("ngTemplateOutlet",a)("ngTemplateOutletContext",T(8,y,T(6,w,e.FormView))),l(),s("id",n)("ngModel",e.Value())}}function _t(t,i){t&1&&f(0)}function pt(t,i){t&1&&f(0)}function st(t,i){if(t&1){let e=x();_(0,"sh-toggle",29)(1,"label",37),S(2,_t,1,0,"ng-container",34)(3,pt,1,0,"ng-container",39),p(),_(4,"input",47),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("ngTemplateOutlet",a)("ngTemplateOutletContext",T(8,y,T(6,w,e.FormView))),l(),s("id",n)("ngModel",e.Value())}}function ct(t,i){t&1&&f(0)}function mt(t,i){t&1&&f(0)}function dt(t,i){if(t&1&&m(0),t&2){let e=i.$implicit;U(" ",e," ")}}function Ct(t,i){if(t&1){let e=x();_(0,"sh-select",48)(1,"label",37),S(2,ct,1,0,"ng-container",34)(3,mt,1,0,"ng-container",39),p(),_(4,"input",49),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p()(),S(5,dt,1,1,"ng-template",null,4,v)}if(t&2){let e=g(6),o=r().$implicit,n=g(3),a=O(0);r(2);let c=g(10);s("options",o.FormView.options)("selectMultiple",!0)("optionTemplate",e),l(),s("for",a),l(),s("ngTemplateOutlet",n),l(),s("ngTemplateOutlet",c)("ngTemplateOutletContext",T(10,y,T(8,w,o.FormView))),l(),s("ngModel",o.Value())}}function ut(t,i){t&1&&f(0)}function gt(t,i){t&1&&f(0)}function ft(t,i){if(t&1){let e=x();_(0,"app-timespan",45),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),_(1,"label",37),S(2,ut,1,0,"ng-container",34)(3,gt,1,0,"ng-container",39),p()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);s("inputType",e.Name)("ngModel",e.Value())("customId",n),l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("ngTemplateOutlet",a)("ngTemplateOutletContext",T(9,y,T(7,w,e.FormView)))}}function xt(t,i){if(t&1){let e=x();K(0)(1),S(2,Pe,5,5,"ng-template",null,2,v),_(4,"div",24),F(5,$e,13,3,"div",25)(6,De,4,9,"app-file-tree",26)(7,Re,3,4,"app-file-tree",27)(8,Je,10,12,"sh-form-field")(9,We,9,12,"sh-form-field")(10,tt,7,13)(11,ot,4,11,"app-size",28)(12,lt,7,10,"sh-form-field")(13,st,5,10,"sh-toggle",29)(14,Ct,7,12)(15,ft,4,11,"app-timespan",28),_(16,"button",30),u("click",function(){let n=d(e).$implicit,a=r(2);return C(a.removeSetting(n))}),_(17,"sh-icon"),m(18,"x-bold"),p()()()}if(t&2){let e=i.$implicit,o=i.$index,n=r(2);E("destination-"+e.Name+o),l(),E(n.inAppOptions(e.Name)),l(3),B("align-remove-start",e.FormView.type==="FolderTree"||e.FormView.type==="FileTree"||e.FormView.type==="Boolean"),l(),h(e.FormView.type==="FreeText"?5:e.FormView.type==="FileTree"?6:e.FormView.type==="FolderTree"?7:e.FormView.type==="String"||e.FormView.type==="Path"||e.FormView.type==="Decimal"||e.FormView.type==="Email"||e.FormView.type==="Hostname"||e.FormView.type==="Bucketname"?8:e.FormView.type==="Password"?9:e.FormView.type==="Enumeration"?10:e.FormView.type==="Size"?11:e.FormView.type==="Integer"?12:e.FormView.type==="Boolean"?13:e.FormView.type==="Flags"?14:e.FormView.type==="Timespan"||e.FormView.type==="DateTime"?15:-1)}}function Tt(t,i){if(t&1&&(F(0,Ne,2,0,"div",23),A(1,xt,19,5,null,null,$)),t&2){let e=r();h(e.selectedSettings().length===0?0:-1),l(),D(e.selectedSettings())}}function St(t,i){if(t&1&&(_(0,"sh-icon",50),m(1,"x-circle"),p()),t&2){r();let e=O(0);s("shTooltip",(e==null?null:e.message)??"Invalid value")}}function Ot(t,i){if(t&1&&(_(0,"sh-icon",32),m(1,"warning"),p()),t&2){r();let e=O(0);s("shTooltip",(e==null?null:e.message)??"Invalid value")}}function Ft(t,i){if(t&1&&(K(0),F(1,St,2,1,"sh-icon",50)(2,Ot,2,1,"sh-icon",32)),t&2){r();let e=O(0),o=r().$implicit,n=E(o.formView.validate(e));l(),h((n==null?null:n.type)==="error"?1:(n==null?null:n.type)==="warning"?2:-1)}}function ht(t,i){if(t&1&&(K(0),F(1,Ft,3,2)),t&2){let e=r().$implicit,n=(E(e.Value())??"").toString().trim()==="";l(),h(!n&&e.formView.validate?1:-1)}}function wt(t,i){if(t&1&&F(0,ht,2,2),t&2){let e=i.$implicit;h(e.Value?0:-1)}}var Se=class t{#e=j(Ce);options=Y.required();hiddenOptions=J([]);hasFreeTextSettings=J(!1);applicationOptions=J();showTextArea=b(!1);allOptionsGrouped=this.#e.allOptionsGrouped;allOptions=this.#e.allOptions;selectedSettings=H(()=>{let i=this.hiddenOptions();return this.options().map(n=>{let a=this.allOptions().find(V=>V.name===n.Name?.replace("--","")),c=n.Value??"";if(a&&i.includes(a.name))return null;if(a){if(a.type==="Boolean"&&(c=this.isTrue(c)),a.type==="Integer"&&(c=parseInt(c)||0),a.type==="Enumeration"&&a.options){let I=c?.trim().toLowerCase(),X=a.options.find(Oe=>(Oe??"").trim().toLocaleLowerCase()===I);X&&(c=X)}let V=Te.find(I=>I.name===a?.name);return V&&(a=L(L({},a),V)),P(L({},n),{Value:b(c),FormView:a})}else if(this.hasFreeTextSettings())return P(L({},n),{Value:b(c),FormView:{name:n.Name,type:"FreeText",shortDescription:"Custom settings argument",longDescription:"Custom settings argument"}});return null}).filter(n=>n!==null)});nonSelectedOptionsGrouped=H(()=>{let i=this.options().map(o=>o.Name?.replace("--","")),e=this.hiddenOptions();return this.allOptionsGrouped().map(o=>P(L({},o),{options:o.options.filter(n=>!i.includes(n.name)&&!e.includes(n.name))})).filter(o=>o.options.length>0)});settingsAsText=H(()=>this.selectedSettings().map(i=>{let e=i.Value(),o="";return typeof e=="boolean"?o=this.isTrue(e)?"True":"False":(typeof e=="number"||e!=null)&&(o=e.toString()),`${i.Name??""}=${o}`}).join(`
2
2
  `));updateSettingsFromText(i){if(typeof i!="string")return;let e=ue(i);this.options.update(()=>e)}isTrue(i){if(typeof i=="boolean")return i;if(typeof i=="string"){let e=i.toLowerCase();return e==="true"||e==="1"||e==="yes"||e==="on"}return!1}inAppOptions(i){let e=this.applicationOptions()?.findIndex(o=>o.Name?.replace("--","")===i);return e===void 0?!1:e>-1}addFreeTextSetting(){this.hasFreeTextSettings()&&this.options.update(i=>[...i,{Filter:null,Name:"",Value:""}])}addSetting(i){this.options.update(e=>{let o=i.defaultValue??"";return i.type==="Boolean"&&(o=this.isTrue(o)),i.type==="Integer"&&(o=parseInt(o)||0),[...e,{Name:i.name,Value:o}]})}updateSettingValue(i,e){this.options.update(o=>{let n=[...o],a=n.findIndex(c=>c.Name===i.Name);if(i.FormView.type==="Boolean")return n[a].Value=this.isTrue(e)?"True":"False",n;if(i.FormView.type==="Integer")return n[a].Value=e.toString(),n;if(i.FormView.type==="Enumeration"&&i.FormView.options){let c=e?.trim().toLowerCase()??"",V=i.FormView.options.find(I=>(I??"").trim().toLocaleLowerCase()===c);if(V)return n[a].Value=V,n}return n[a].Value=e,n})}updateFreeTextSettingName(i,e){this.options.update(o=>{let n=[...o],a=n.findIndex(c=>c.Name===i.Name);return n[a].Name=e,n})}removeSetting(i){this.options.update(e=>e.filter(o=>o.Name!==i.Name))}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=q({type:t,selectors:[["app-options-list"]],inputs:{options:[1,"options"],hiddenOptions:[1,"hiddenOptions"],hasFreeTextSettings:[1,"hasFreeTextSettings"],applicationOptions:[1,"applicationOptions"]},outputs:{options:"optionsChange"},decls:11,vars:3,consts:()=>{let i;i=$localize`Advanced options`;let e;e=$localize` Show editor ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let o;o=$localize` Add advanced option ${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON:`;let n;n=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:pen${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: New custom option `;let a;return a=$localize`By adding this option it will override the matching global option`,[["validateTemplate",""],["option",""],["defaultLabel",""],["enumOptionTemplate",""],["optionTemplate",""],i,e,o,n,[3,"disallowToggle"],["title",""],[1,"actions"],["shButton","","type","button",1,"outlined","small"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModel","ngModelOptions"],["shButton","","type","button",1,"outlined","small",3,"click"],[3,"searchable"],["menu",""],["type","button",3,"deprecated"],["type","button",3,"click"],[1,"option-col"],["shButton","","type","button",1,"small"],["shButton","","type","button",1,"small",3,"click"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModelChange","ngModel","ngModelOptions"],[1,"placeholder"],[1,"field-row"],[1,"form-column"],[3,"startingPath","accepts","showFiles","showHiddenNodes","selectFiles"],[3,"startingPath"],[3,"inputType","ngModel","customId"],[1,"primary","raised"],["shButton","","type","button",1,"outlined","small","remove-btn",3,"click"],["shTooltip",a,1,"error"],[1,"warn",3,"shTooltip"],[1,"primary",3,"shTooltip"],[4,"ngTemplateOutlet"],["type","text",3,"ngModelChange","ngModel"],["prefix",""],[3,"for"],["type","text",3,"ngModelChange","id","ngModel"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"ngModelChange","type","id","ngModel"],["autocomplete","off",3,"ngModelChange","type","id","ngModel"],["suffix","",1,"clickable"],["suffix","",1,"clickable",3,"click"],[3,"options","isClearable","optionTemplate"],[3,"ngModelChange","inputType","ngModel","customId"],["type","number",3,"ngModelChange","id","ngModel"],["type","checkbox",3,"ngModelChange","id","ngModel"],[1,"primary","raised",3,"options","selectMultiple","optionTemplate"],["type","text","id","text",3,"ngModelChange","ngModel"],[1,"error",3,"shTooltip"]]},template:function(e,o){e&1&&(_(0,"sh-toggle-card",9),R(1,10)(2),Q(3,5),M(),_(4,"div",11),F(5,he,3,0,"button",12)(6,Le,8,2),p(),M(),F(7,Ie,1,3,"textarea",13)(8,Tt,3,1),p(),S(9,wt,1,1,"ng-template",null,0,v)),e&2&&(s("disallowToggle",!0),l(5),h(o.showTextArea()?5:6),l(2),h(o.showTextArea()?7:8))},dependencies:[ae,te,oe,ee,ne,ie,fe,ge,xe,Z,ce,_e,le,pe,de,re,se,me],styles:["[_nghost-%COMP%]{display:block}sh-select[_ngcontent-%COMP%]{--miw: p2r(120)}sh-toggle[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:1rem}.placeholder[_ngcontent-%COMP%]{color:var(--base-9);text-align:center;padding:2rem 1rem}.field-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;position:relative;z-index:1;max-width:32.5rem;width:100%}.field-row[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{align-self:flex-end}.field-row[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]:first-child{max-width:28rem;width:100%}.field-row.align-remove-start[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{align-self:flex-start}.option-col[_ngcontent-%COMP%]{display:flex;flex-direction:column}.form-column[_ngcontent-%COMP%]{display:flex;gap:.25rem;flex-direction:column}label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}sh-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}.deprecated[_ngcontent-%COMP%]{text-decoration:line-through}.raw-text-area[_ngcontent-%COMP%]{min-height:12rem;white-space:pre}"],changeDetection:0})};export{Se as a};
@@ -1 +1 @@
1
- import{a,b}from"./chunk-TVPL74LA.js";import"./chunk-4VEFX5WQ.js";import"./chunk-AS6Z56AD.js";import"./chunk-IW4RDAIN.js";import"./chunk-O4OTZE5N.js";import"./chunk-WIVARGP6.js";import"./chunk-FK7JFD5B.js";import"./chunk-5DJAX2HH.js";import"./chunk-DW332N2S.js";import"./chunk-NNCQNVQC.js";import"./chunk-TELPJYLN.js";import"./chunk-DAODMGAD.js";import"./chunk-HPNLQHW6.js";import"./chunk-BGTK25UG.js";import"./chunk-A4LPGPDU.js";import"./chunk-PKPBSTZA.js";import"./chunk-QPTSKQZ2.js";import"./chunk-OTPG7USH.js";import"./chunk-TT3S63BX.js";import"./chunk-T2WO6CVD.js";import"./chunk-7CGTOI24.js";export{a as createRestoreOptionsForm,b as default};
1
+ import{a,b}from"./chunk-2YEG7JK3.js";import"./chunk-3SHOBVX6.js";import"./chunk-AS6Z56AD.js";import"./chunk-DGKNUD3G.js";import"./chunk-O4OTZE5N.js";import"./chunk-WIVARGP6.js";import"./chunk-FK7JFD5B.js";import"./chunk-5DJAX2HH.js";import"./chunk-DW332N2S.js";import"./chunk-NNCQNVQC.js";import"./chunk-TELPJYLN.js";import"./chunk-DAODMGAD.js";import"./chunk-HPNLQHW6.js";import"./chunk-BGTK25UG.js";import"./chunk-A4LPGPDU.js";import"./chunk-PKPBSTZA.js";import"./chunk-QPTSKQZ2.js";import"./chunk-OTPG7USH.js";import"./chunk-TT3S63BX.js";import"./chunk-T2WO6CVD.js";import"./chunk-7CGTOI24.js";export{a as createRestoreOptionsForm,b as default};
@@ -1 +1 @@
1
- import{g as he}from"./chunk-TVPL74LA.js";import{a as Ne,b as pe,c as Ie,d as me,e as De}from"./chunk-MRY5WXEL.js";import"./chunk-4VEFX5WQ.js";import"./chunk-AS6Z56AD.js";import{b as Oe,c as Ce}from"./chunk-IW4RDAIN.js";import{j as Re}from"./chunk-ZAFP5TX6.js";import"./chunk-O4OTZE5N.js";import"./chunk-WIVARGP6.js";import"./chunk-MHRECQ5Y.js";import"./chunk-6Q6SSTBK.js";import"./chunk-FK7JFD5B.js";import"./chunk-KETMZS6P.js";import"./chunk-ME77WZZI.js";import{a as I}from"./chunk-5DJAX2HH.js";import"./chunk-UE5VHUV6.js";import"./chunk-DW332N2S.js";import"./chunk-NNCQNVQC.js";import"./chunk-TELPJYLN.js";import"./chunk-DAODMGAD.js";import{B as de,H as ue,K as Fe,c as oe,e as ae,f as se,g as re,i as _e,j as le,s as ce,u as Te,w as Ee,y as Se,z as ge}from"./chunk-HPNLQHW6.js";import"./chunk-BGTK25UG.js";import{b as ne,d as ie}from"./chunk-A4LPGPDU.js";import"./chunk-PKPBSTZA.js";import"./chunk-QPTSKQZ2.js";import"./chunk-OTPG7USH.js";import"./chunk-TT3S63BX.js";import{$ as T,Ab as r,Bb as d,Fb as K,Gb as j,Ib as C,Mc as A,Pa as l,Pb as S,Qb as g,Rb as p,Sb as P,Sc as te,Tb as $,Ub as Q,Vb as u,W as R,Xb as _,aa as E,cb as H,cc as q,da as X,dc as Y,jc as L,la as N,oc as h,pc as f,qc as M,rc as y,sb as F,sc as x,tb as O,tc as w,wc as Z,xc as ee,yb as D,zb as s}from"./chunk-T2WO6CVD.js";import"./chunk-7CGTOI24.js";var fe=["formRef"],Me=()=>({maxWidth:"700px",width:"100%"});function Ae(o,n){if(o&1){let e=C();s(0,"button",31),u("click",function(){T(e);let t=_();return E(t.testDestination(0,!0))}),p(1,4),r()}if(o&2){let e=_();D("disabled",e.testSignal()=="testing")}}function Pe(o,n){if(o&1){let e=C();s(0,"button",32),u("click",function(){T(e);let t=_();return E(t.openTargetUrlDialog())}),S(1,5),d(2,"sh-icon"),g(),r()}}function $e(o,n){if(o&1){let e=C();s(0,"button",32),u("click",function(){T(e);let t=_(2);return E(t.copyTargetUrl())}),S(1,7),d(2,"sh-icon"),g(),r()}}function Le(o,n){if(o&1){let e=C();s(0,"sh-menu")(1,"button",20)(2,"sh-icon"),L(3,"dots-three-vertical"),r()(),K(4,33),s(5,"button",32),u("click",function(){T(e);let t=_();return E(t.openTargetUrlDialog())}),S(6,6),d(7,"sh-icon"),g(),r(),F(8,$e,3,0,"button",20),j(),r()}if(o&2){_();let e=w(0);l(8),O(e?8:-1)}}function ye(o,n){o&1&&(s(0,"sh-alert"),S(1,8),d(2,"sh-icon",34),g(),r())}function xe(o,n){o&1&&(s(0,"sh-alert",21),S(1,9),d(2,"sh-icon",34),g(),r())}function we(o,n){if(o&1&&(s(0,"sh-alert",22),S(1,10),d(2,"sh-icon",34),g(),r()),o&2){let e=_();l(2),P(e.testErrorMessage()),$(1)}}function Ge(o,n){if(o&1&&(s(0,"sh-alert",23),S(1,11),d(2,"sh-icon",34),g(),r()),o&2){let e=_();l(2),P(e.testErrorMessage()),$(1)}}function be(o,n){if(o&1){let e=C();s(0,"app-destination-list-item",24)(1,"button",27),u("click",function(){T(e);let t=_();return E(t.removeDestination())}),p(2,12),r()()}if(o&2){_();let e=w(15);D("destination",e)}}function Ue(o,n){if(o&1){let e=C();s(0,"app-destination-list",35),u("setDestination",function(t){T(e);let a=_();return E(a.setDestination(t))}),r()}}function ke(o,n){if(o&1){let e=C();s(0,"app-single-destination",36),M("targetUrlChange",function(t){T(e);let a=_();return f(a.targetUrlModel,t)||(a.targetUrlModel=t),E(t)}),r()}if(o&2){let e=_();h("targetUrl",e.targetUrlModel)}}function ve(o,n){o&1&&(S(0,3,1),d(1,"sh-icon",29),g())}function We(o,n){o&1&&(S(0,3,2),d(1,"sh-icon"),g())}function Ve(o,n){if(o&1){let e=C();s(0,"sh-dialog",37),M("isOpenChange",function(t){T(e);let a=_();return f(a.targetUrlDialogOpen,t)||(a.targetUrlDialogOpen=t),E(t)}),s(1,"header",38)(2,"div",39)(3,"h2"),p(4,13),r(),s(5,"sh-alert",22),p(6,14),r()()(),s(7,"div",40)(8,"sh-form-field")(9,"textarea",41),M("ngModelChange",function(t){T(e);let a=_();return f(a.targetUrlCtrl,t)||(a.targetUrlCtrl=t),E(t)}),r()()(),s(10,"footer",42)(11,"button",27),u("click",function(){T(e);let t=_();return E(t.closeTargetUrlDialog(!1))}),L(12,"Cancel"),r(),s(13,"button",43),u("click",function(){T(e);let t=_();return E(t.closeTargetUrlDialog(!0))}),S(14,15),d(15,"sh-icon"),g(),r()()()}if(o&2){let e=_();h("isOpen",e.targetUrlDialogOpen),D("options",ee(3,Me)),l(9),h("ngModel",e.targetUrlCtrl)}}var G=class o{#i=R(ie);#o=R(ne);#t=R(ge);#a=R(Ne);injector=R(X);#e=R(he);#s=R(Ie);formRef=te.required("formRef");targetUrlModel=this.#e.destinationTargetUrl;targetUrlCtrl=N(null);targetUrlInitial=N(null);targetUrlDialogOpen=N(!1);toggleNewDestination=N(!0);testSignal=this.#e.testSignal;testErrorMessage=this.#e.testErrorMessage;destinationTypeOptionsInFocus=N(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=this.#s.destinationTypeOptions;destinationTypeOptionsFocused=A(()=>{let n=this.destinationTypeOptionsInFocus(),e=this.destinationTypeOptions();return n.map(i=>e.find(t=>t.key===i))});selectedDestinationType=A(()=>{let n=this.#e.destinationTargetUrl();return n?Oe(n):null});selectedDestinationTypeOption=A(()=>{let n=this.selectedDestinationType();return n?{key:n.customKey??n.key,customKey:n.customKey??null,displayName:n.displayName,description:n.description,icon:n.icon}:null});copyTargetUrl(){navigator.clipboard.writeText(this.#e.destinationTargetUrl()??"")}openTargetUrlDialog(){let n=this.#e.destinationTargetUrl();this.targetUrlCtrl.set(n),this.targetUrlInitial.set(n),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(n=!1){this.targetUrlDialogOpen.set(!1);let e=this.targetUrlCtrl(),i=this.targetUrlInitial();!n||e===i||!e||this.#e.updateTargetUrl(e)}testDestination(n,e,i){let t=this.#e.destinationTargetUrl();t&&(this.#e.setTestState("testing"),this.#a.testDestination(t,this.#e.backupId(),n,!0,e).subscribe({next:a=>{if(a.action==="success"){this.#e.setTestState("success"),a.containsBackup===!1?(this.#e.setTestState("warning",$localize`The remote destination does not contain any backups. Please check if the destination details are correct.`),e||this.#t.open(I,{data:{title:$localize`Folder contains no backup`,message:$localize`The remote destination does not contain any backups. Please check if the destination details are correct.`,confirmText:$localize`OK`,cancelText:void 0}})):a.anyFilesFound===!1&&(this.#e.setTestState("warning",$localize`The remote destination is empty. Please check if the destination details are correct.`),e||this.#t.open(I,{data:{title:$localize`Folder is empty`,message:$localize`The remote destination is empty. Please check if the destination details are correct.`,confirmText:$localize`OK`,cancelText:void 0}})),i?.();return}if(this.#e.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){i?.();return}let m=t.includes("?");a.action==="trust-cert"&&this.#e.updateTargetUrl(t+`${m?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#e.updateTargetUrl(t+`${m?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,e):i?.()}}))}setDestination(n){let e=Ce(n??"");if(e){if(e.mapper.default){let i=e.mapper.default("");this.#e.updateTargetUrl(i);return}this.#e.updateTargetUrl(`${n}://`)}}removeDestination(){this.#e.updateTargetUrl(null)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let n=this.testSignal();if(n===""){this.#t.open(I,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:e=>{e?this.testDestination(0,!1,()=>{this.testSignal()==="success"?this.#n():this.#t.open(I,{data:{title:$localize`Test did not succeed`,message:this.testErrorMessage()??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#n()}});return}if(n!=="success"){this.#t.open(I,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Yes, continue`,cancelText:$localize`Cancel`},closed:e=>{e&&this.#n()}});return}this.#n()}#n(){this.#i.navigate(["encryption"],{relativeTo:this.#o.parent})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=H({type:o,selectors:[["app-restore-destination"]],viewQuery:function(e,i){e&1&&q(i.formRef,fe,5),e&2&&Y()},features:[Z([Re])],decls:28,vars:11,consts:()=>{let n;n=$localize`Backup destination`;let e;e=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let i;i=$localize`${"\uFFFD*25:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*25:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*26:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*26:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,i=Q(i);let t;t=$localize` Test destination `;let a;a=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Set target URL `;let m;m=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: Edit target URL `;let b;b=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:copy${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Copy URL to clipboard `;let U;U=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Testing connection... `;let k;k=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:check${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Connection tested successfully. `;let v;v=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let W;W=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let V;V=$localize`Change`;let B;B=$localize`Edit target URL`;let z;z=$localize`Be careful, this will overwrite everything you have in your destination.`;let J;return J=$localize` Override target URL ${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],n,e,i,t,a,m,b,U,k,v,W,V,B,z,J,[3,"submit"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small",3,"disabled"],["shButton","","type","button",1,"small"],[1,"success"],[1,"warn"],[1,"error"],[1,"current-destination",3,"destination"],[3,"targetUrl"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click","disabled"],["shButton","","type","button",1,"small",3,"click"],["menu",""],["icon",""],[3,"setDestination"],[3,"targetUrlChange","targetUrl"],[3,"isOpenChange","isOpen","options"],["header",""],[1,"target-dialog-header"],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(e,i){if(e&1){let t=C();y(0),s(1,"form",16,0),u("submit",function(){return T(t),E(i.next())}),s(3,"header")(4,"h3",17)(5,"span"),p(6,1),r(),s(7,"div",18),F(8,Ae,2,1,"button",19),F(9,Pe,3,0,"button",20)(10,Le,9,1,"sh-menu"),r()(),F(11,ye,3,0,"sh-alert")(12,xe,3,0,"sh-alert",21)(13,we,3,1,"sh-alert",22)(14,Ge,3,1,"sh-alert",23),y(15),F(16,be,3,1,"app-destination-list-item",24),r(),F(17,Ue,1,0,"app-destination-list"),F(18,ke,1,1,"app-single-destination",25),s(19,"div",26)(20,"button",27),u("click",function(){return T(t),E(i.goBack())}),S(21,2),d(22,"sh-icon"),g(),r(),s(23,"button",28),S(24,3),F(25,ve,2,0,"sh-icon",29)(26,We,2,0,"sh-icon"),g(),r()()(),F(27,Ve,16,4,"sh-dialog",30)}if(e&2){let t=x(!!i.targetUrlModel());l(8),O(t?8:-1),l(),O(t?10:9),l(2),O(i.testSignal()=="testing"?11:i.testSignal()=="success"?12:i.testSignal()=="warning"?13:i.testSignal()=="error"?14:-1),l(4);let a=x(i.selectedDestinationTypeOption());l(),O(a?16:-1),l(),O(t?-1:17),l(),O(t?18:-1),l(5),D("disabled",i.testSignal()=="testing"||!t),l(2),O(i.testSignal()=="testing"?25:26),l(2),O(i.targetUrlDialogOpen()?27:-1)}},dependencies:[De,me,pe,ce,le,oe,ae,se,_e,re,de,ue,Fe,Te,Se,Ee],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}pre[_ngcontent-%COMP%]{white-space:pre-wrap}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.field-row.single-field[_ngcontent-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-8)}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-8)}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}.target-dialog-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:.5rem}"],changeDetection:0})};export{G as default};
1
+ import{g as he}from"./chunk-2YEG7JK3.js";import{a as Ne,b as pe,c as Ie,d as me,e as De}from"./chunk-G22PSFMM.js";import"./chunk-3SHOBVX6.js";import"./chunk-AS6Z56AD.js";import{b as Oe,c as Ce}from"./chunk-DGKNUD3G.js";import{j as Re}from"./chunk-ZAFP5TX6.js";import"./chunk-O4OTZE5N.js";import"./chunk-WIVARGP6.js";import"./chunk-MHRECQ5Y.js";import"./chunk-6Q6SSTBK.js";import"./chunk-FK7JFD5B.js";import"./chunk-KETMZS6P.js";import"./chunk-ME77WZZI.js";import{a as I}from"./chunk-5DJAX2HH.js";import"./chunk-UE5VHUV6.js";import"./chunk-DW332N2S.js";import"./chunk-NNCQNVQC.js";import"./chunk-TELPJYLN.js";import"./chunk-DAODMGAD.js";import{B as de,H as ue,K as Fe,c as oe,e as ae,f as se,g as re,i as _e,j as le,s as ce,u as Te,w as Ee,y as Se,z as ge}from"./chunk-HPNLQHW6.js";import"./chunk-BGTK25UG.js";import{b as ne,d as ie}from"./chunk-A4LPGPDU.js";import"./chunk-PKPBSTZA.js";import"./chunk-QPTSKQZ2.js";import"./chunk-OTPG7USH.js";import"./chunk-TT3S63BX.js";import{$ as T,Ab as r,Bb as d,Fb as K,Gb as j,Ib as C,Mc as A,Pa as l,Pb as S,Qb as g,Rb as p,Sb as P,Sc as te,Tb as $,Ub as Q,Vb as u,W as R,Xb as _,aa as E,cb as H,cc as q,da as X,dc as Y,jc as L,la as N,oc as h,pc as f,qc as M,rc as y,sb as F,sc as x,tb as O,tc as w,wc as Z,xc as ee,yb as D,zb as s}from"./chunk-T2WO6CVD.js";import"./chunk-7CGTOI24.js";var fe=["formRef"],Me=()=>({maxWidth:"700px",width:"100%"});function Ae(o,n){if(o&1){let e=C();s(0,"button",31),u("click",function(){T(e);let t=_();return E(t.testDestination(0,!0))}),p(1,4),r()}if(o&2){let e=_();D("disabled",e.testSignal()=="testing")}}function Pe(o,n){if(o&1){let e=C();s(0,"button",32),u("click",function(){T(e);let t=_();return E(t.openTargetUrlDialog())}),S(1,5),d(2,"sh-icon"),g(),r()}}function $e(o,n){if(o&1){let e=C();s(0,"button",32),u("click",function(){T(e);let t=_(2);return E(t.copyTargetUrl())}),S(1,7),d(2,"sh-icon"),g(),r()}}function Le(o,n){if(o&1){let e=C();s(0,"sh-menu")(1,"button",20)(2,"sh-icon"),L(3,"dots-three-vertical"),r()(),K(4,33),s(5,"button",32),u("click",function(){T(e);let t=_();return E(t.openTargetUrlDialog())}),S(6,6),d(7,"sh-icon"),g(),r(),F(8,$e,3,0,"button",20),j(),r()}if(o&2){_();let e=w(0);l(8),O(e?8:-1)}}function ye(o,n){o&1&&(s(0,"sh-alert"),S(1,8),d(2,"sh-icon",34),g(),r())}function xe(o,n){o&1&&(s(0,"sh-alert",21),S(1,9),d(2,"sh-icon",34),g(),r())}function we(o,n){if(o&1&&(s(0,"sh-alert",22),S(1,10),d(2,"sh-icon",34),g(),r()),o&2){let e=_();l(2),P(e.testErrorMessage()),$(1)}}function Ge(o,n){if(o&1&&(s(0,"sh-alert",23),S(1,11),d(2,"sh-icon",34),g(),r()),o&2){let e=_();l(2),P(e.testErrorMessage()),$(1)}}function be(o,n){if(o&1){let e=C();s(0,"app-destination-list-item",24)(1,"button",27),u("click",function(){T(e);let t=_();return E(t.removeDestination())}),p(2,12),r()()}if(o&2){_();let e=w(15);D("destination",e)}}function Ue(o,n){if(o&1){let e=C();s(0,"app-destination-list",35),u("setDestination",function(t){T(e);let a=_();return E(a.setDestination(t))}),r()}}function ke(o,n){if(o&1){let e=C();s(0,"app-single-destination",36),M("targetUrlChange",function(t){T(e);let a=_();return f(a.targetUrlModel,t)||(a.targetUrlModel=t),E(t)}),r()}if(o&2){let e=_();h("targetUrl",e.targetUrlModel)}}function ve(o,n){o&1&&(S(0,3,1),d(1,"sh-icon",29),g())}function We(o,n){o&1&&(S(0,3,2),d(1,"sh-icon"),g())}function Ve(o,n){if(o&1){let e=C();s(0,"sh-dialog",37),M("isOpenChange",function(t){T(e);let a=_();return f(a.targetUrlDialogOpen,t)||(a.targetUrlDialogOpen=t),E(t)}),s(1,"header",38)(2,"div",39)(3,"h2"),p(4,13),r(),s(5,"sh-alert",22),p(6,14),r()()(),s(7,"div",40)(8,"sh-form-field")(9,"textarea",41),M("ngModelChange",function(t){T(e);let a=_();return f(a.targetUrlCtrl,t)||(a.targetUrlCtrl=t),E(t)}),r()()(),s(10,"footer",42)(11,"button",27),u("click",function(){T(e);let t=_();return E(t.closeTargetUrlDialog(!1))}),L(12,"Cancel"),r(),s(13,"button",43),u("click",function(){T(e);let t=_();return E(t.closeTargetUrlDialog(!0))}),S(14,15),d(15,"sh-icon"),g(),r()()()}if(o&2){let e=_();h("isOpen",e.targetUrlDialogOpen),D("options",ee(3,Me)),l(9),h("ngModel",e.targetUrlCtrl)}}var G=class o{#i=R(ie);#o=R(ne);#t=R(ge);#a=R(Ne);injector=R(X);#e=R(he);#s=R(Ie);formRef=te.required("formRef");targetUrlModel=this.#e.destinationTargetUrl;targetUrlCtrl=N(null);targetUrlInitial=N(null);targetUrlDialogOpen=N(!1);toggleNewDestination=N(!0);testSignal=this.#e.testSignal;testErrorMessage=this.#e.testErrorMessage;destinationTypeOptionsInFocus=N(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=this.#s.destinationTypeOptions;destinationTypeOptionsFocused=A(()=>{let n=this.destinationTypeOptionsInFocus(),e=this.destinationTypeOptions();return n.map(i=>e.find(t=>t.key===i))});selectedDestinationType=A(()=>{let n=this.#e.destinationTargetUrl();return n?Oe(n):null});selectedDestinationTypeOption=A(()=>{let n=this.selectedDestinationType();return n?{key:n.customKey??n.key,customKey:n.customKey??null,displayName:n.displayName,description:n.description,icon:n.icon}:null});copyTargetUrl(){navigator.clipboard.writeText(this.#e.destinationTargetUrl()??"")}openTargetUrlDialog(){let n=this.#e.destinationTargetUrl();this.targetUrlCtrl.set(n),this.targetUrlInitial.set(n),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(n=!1){this.targetUrlDialogOpen.set(!1);let e=this.targetUrlCtrl(),i=this.targetUrlInitial();!n||e===i||!e||this.#e.updateTargetUrl(e)}testDestination(n,e,i){let t=this.#e.destinationTargetUrl();t&&(this.#e.setTestState("testing"),this.#a.testDestination(t,this.#e.backupId(),n,!0,e).subscribe({next:a=>{if(a.action==="success"){this.#e.setTestState("success"),a.containsBackup===!1?(this.#e.setTestState("warning",$localize`The remote destination does not contain any backups. Please check if the destination details are correct.`),e||this.#t.open(I,{data:{title:$localize`Folder contains no backup`,message:$localize`The remote destination does not contain any backups. Please check if the destination details are correct.`,confirmText:$localize`OK`,cancelText:void 0}})):a.anyFilesFound===!1&&(this.#e.setTestState("warning",$localize`The remote destination is empty. Please check if the destination details are correct.`),e||this.#t.open(I,{data:{title:$localize`Folder is empty`,message:$localize`The remote destination is empty. Please check if the destination details are correct.`,confirmText:$localize`OK`,cancelText:void 0}})),i?.();return}if(this.#e.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){i?.();return}let m=t.includes("?");a.action==="trust-cert"&&this.#e.updateTargetUrl(t+`${m?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#e.updateTargetUrl(t+`${m?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,e):i?.()}}))}setDestination(n){let e=Ce(n??"");if(e){if(e.mapper.default){let i=e.mapper.default("");this.#e.updateTargetUrl(i);return}this.#e.updateTargetUrl(`${n}://`)}}removeDestination(){this.#e.updateTargetUrl(null)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let n=this.testSignal();if(n===""){this.#t.open(I,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:e=>{e?this.testDestination(0,!1,()=>{this.testSignal()==="success"?this.#n():this.#t.open(I,{data:{title:$localize`Test did not succeed`,message:this.testErrorMessage()??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#n()}});return}if(n!=="success"){this.#t.open(I,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Yes, continue`,cancelText:$localize`Cancel`},closed:e=>{e&&this.#n()}});return}this.#n()}#n(){this.#i.navigate(["encryption"],{relativeTo:this.#o.parent})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=H({type:o,selectors:[["app-restore-destination"]],viewQuery:function(e,i){e&1&&q(i.formRef,fe,5),e&2&&Y()},features:[Z([Re])],decls:28,vars:11,consts:()=>{let n;n=$localize`Backup destination`;let e;e=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let i;i=$localize`${"\uFFFD*25:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*25:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*26:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*26:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,i=Q(i);let t;t=$localize` Test destination `;let a;a=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Set target URL `;let m;m=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: Edit target URL `;let b;b=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:copy${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Copy URL to clipboard `;let U;U=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Testing connection... `;let k;k=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:check${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Connection tested successfully. `;let v;v=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let W;W=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let V;V=$localize`Change`;let B;B=$localize`Edit target URL`;let z;z=$localize`Be careful, this will overwrite everything you have in your destination.`;let J;return J=$localize` Override target URL ${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],n,e,i,t,a,m,b,U,k,v,W,V,B,z,J,[3,"submit"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small",3,"disabled"],["shButton","","type","button",1,"small"],[1,"success"],[1,"warn"],[1,"error"],[1,"current-destination",3,"destination"],[3,"targetUrl"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click","disabled"],["shButton","","type","button",1,"small",3,"click"],["menu",""],["icon",""],[3,"setDestination"],[3,"targetUrlChange","targetUrl"],[3,"isOpenChange","isOpen","options"],["header",""],[1,"target-dialog-header"],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(e,i){if(e&1){let t=C();y(0),s(1,"form",16,0),u("submit",function(){return T(t),E(i.next())}),s(3,"header")(4,"h3",17)(5,"span"),p(6,1),r(),s(7,"div",18),F(8,Ae,2,1,"button",19),F(9,Pe,3,0,"button",20)(10,Le,9,1,"sh-menu"),r()(),F(11,ye,3,0,"sh-alert")(12,xe,3,0,"sh-alert",21)(13,we,3,1,"sh-alert",22)(14,Ge,3,1,"sh-alert",23),y(15),F(16,be,3,1,"app-destination-list-item",24),r(),F(17,Ue,1,0,"app-destination-list"),F(18,ke,1,1,"app-single-destination",25),s(19,"div",26)(20,"button",27),u("click",function(){return T(t),E(i.goBack())}),S(21,2),d(22,"sh-icon"),g(),r(),s(23,"button",28),S(24,3),F(25,ve,2,0,"sh-icon",29)(26,We,2,0,"sh-icon"),g(),r()()(),F(27,Ve,16,4,"sh-dialog",30)}if(e&2){let t=x(!!i.targetUrlModel());l(8),O(t?8:-1),l(),O(t?10:9),l(2),O(i.testSignal()=="testing"?11:i.testSignal()=="success"?12:i.testSignal()=="warning"?13:i.testSignal()=="error"?14:-1),l(4);let a=x(i.selectedDestinationTypeOption());l(),O(a?16:-1),l(),O(t?-1:17),l(),O(t?18:-1),l(5),D("disabled",i.testSignal()=="testing"||!t),l(2),O(i.testSignal()=="testing"?25:26),l(2),O(i.targetUrlDialogOpen()?27:-1)}},dependencies:[De,me,pe,ce,le,oe,ae,se,_e,re,de,ue,Fe,Te,Se,Ee],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}pre[_ngcontent-%COMP%]{white-space:pre-wrap}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.field-row.single-field[_ngcontent-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-8)}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-8)}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}.target-dialog-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:.5rem}"],changeDetection:0})};export{G as default};
@@ -1 +1 @@
1
- import{a as K}from"./chunk-VYJNNEM5.js";import"./chunk-JWO4FPWJ.js";import{g as q}from"./chunk-TVPL74LA.js";import"./chunk-4VEFX5WQ.js";import"./chunk-AS6Z56AD.js";import{b as Z}from"./chunk-3C5RKSMK.js";import"./chunk-IW4RDAIN.js";import"./chunk-O4OTZE5N.js";import"./chunk-WIVARGP6.js";import"./chunk-HHYYLYET.js";import{a as V}from"./chunk-WUL6NS6B.js";import"./chunk-LP4W35DJ.js";import"./chunk-6Q6SSTBK.js";import{a as j}from"./chunk-FK7JFD5B.js";import"./chunk-5DJAX2HH.js";import"./chunk-G4VDCGMW.js";import"./chunk-DW332N2S.js";import{b as H}from"./chunk-NNCQNVQC.js";import"./chunk-TELPJYLN.js";import"./chunk-DAODMGAD.js";import{C as W,L as X,O as z,u as J}from"./chunk-HPNLQHW6.js";import{c as B}from"./chunk-BGTK25UG.js";import{b as w}from"./chunk-A4LPGPDU.js";import"./chunk-PKPBSTZA.js";import"./chunk-QPTSKQZ2.js";import{ka as k}from"./chunk-OTPG7USH.js";import"./chunk-TT3S63BX.js";import{Ab as s,Bb as R,Cc as T,Dc as d,Fb as P,Gb as m,Mc as b,Pa as a,Pb as y,Qb as D,Rb as r,Sb as v,Tb as x,W as c,Xb as g,ba as u,ca as f,cb as A,jc as M,la as I,mc as N,sb as O,tb as p,yb as C,zb as o}from"./chunk-T2WO6CVD.js";import"./chunk-7CGTOI24.js";function Q(n,t){n&1&&(o(0,"div",17),u(),o(1,"svg",19),R(2,"circle",20),s(),f(),o(3,"sh-icon",21),r(4,3),s()())}function U(n,t){n&1&&(o(0,"div",18),u(),o(1,"svg",19),R(2,"circle",20),s(),f(),o(3,"sh-icon",22),r(4,4),s()())}function Y(n,t){if(n&1&&(o(0,"sh-card",10),P(1,16),r(2,2),m(),O(3,Q,5,0,"div",17)(4,U,5,0,"div",18),s()),n&2){let e=g();a(3),p(e.restoreResult()=="success"?3:4)}}function ee(n,t){if(n&1&&(M(0),T(1,"number"),T(2,"number")),n&2){let e,i=g(2);N(" ",d(1,2,(e=i.statusData())==null?null:e.ProcessedFileCount)," of ",d(2,4,(e=i.statusData())==null?null:e.TotalFileCount)," ")}}function te(n,t){n&1&&(P(0),r(1,8),m())}function ne(n,t){if(n&1&&(M(0),T(1,"bytes"),T(2,"bytes")),n&2){let e,i=g(2);N(" ",d(1,2,(e=i.statusData())==null?null:e.ProcessedFileSize)," of ",d(2,4,(e=i.statusData())==null?null:e.TotalFileSize)," ")}}function ie(n,t){n&1&&(P(0),r(1,9),m())}function oe(n,t){if(n&1&&(o(0,"sh-card",10)(1,"h3"),y(2,5),R(3,"sh-spinner",23),D(),s(),o(4,"div",24),R(5,"sh-progress-bar",25),o(6,"p")(7,"span"),r(8,6),s(),O(9,ee,3,6)(10,te,2,0,"ng-container"),s(),o(11,"p")(12,"span"),r(13,7),s(),O(14,ne,3,6)(15,ie,2,0,"ng-container"),s()()()),n&2){let e,i,l,E,S=g();a(3),v((e=S.statusData())==null?null:e.statusText),x(2),a(2),C("value",(i=S.statusData())==null?null:i.OverallProgress),a(4),p((l=S.statusData())!=null&&l.ProcessedFileCount?9:10),a(5),p((E=S.statusData())!=null&&E.ProcessedFileSize?14:15)}}var G=class n{#o=c(B);#s=c(H);#t=c(V);#n=c(q);#r=c(w);statusData=this.#t.statusData;backupId=this.#n.backupId;restoreResult=I("");#e=null;lastRestoreStarted=b(()=>{if(this.#e)return this.#e;let t=this.#t.statusData()?.backup?.Backup?.Metadata?.LastRestoreStarted??null;if(!t)return null;let e=this.fixDate(t);return this.#e=e,e});notificationFilterPredicate=()=>{let t=this.lastRestoreStarted();return{predicate:e=>(e.BackupID===this.#n.backupId()&&t&&t.getTime()<=new Date(e.Timestamp).getTime())??!1}};ngOnInit(){let t=this.#r.snapshot.params.taskid?.toString()??"";this.#o.getApiV1TaskByTaskid({taskid:t}).subscribe({next:e=>{if(e.TaskStarted&&(this.#e=new Date(e.TaskStarted)),!e.TaskFinished&&e.ID){this.#_(e.ID);return}this.#i(e)},error:e=>{console.error("Error fetching task:",e),this.restoreResult.set("error"),alert("Failed to fetch task details. Please try again later.")}})}#_(t){this.#s.waitForTaskToComplete(t).subscribe(e=>{this.#i(e)})}#i(t){t.TaskFinished!=null&&this.restoreResult.set(t.Status==="Completed"&&t.ErrorMessage==null?"success":"error")}fixDate(t){return new Date(`${t.slice(0,4)}-${t.slice(4,6)}-${t.slice(6,8)}T${t.slice(9,11)}:${t.slice(11,13)}:${t.slice(13,15)}Z`)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=A({type:n,selectors:[["app-restore-progress"]],decls:12,vars:6,consts:()=>{let t;t=$localize`Notifications`;let e;e=$localize`Logs`;let i;i=$localize`Restore completed`;let l;l=$localize`check-bold`;let E;E=$localize`warning-octagon`;let S;S=$localize` Restore progress: ${"\uFFFD0\uFFFD"}:INTERPOLATION: ${"\uFFFD#3\uFFFD"}:START_TAG_SH_SPINNER:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_SPINNER:`;let h;h=$localize`Files processed:`;let F;F=$localize`Size processed:`;let L;L=$localize`N/A`;let $;return $=$localize`N/A`,[t,e,i,l,E,S,h,F,L,$,[1,"progress","type-a"],[1,"notifications","type-a"],[1,"notification-list"],[3,"notificationFilterPredicate"],[1,"logs","type-a"],[3,"asSimpleList","polling","whenFilter","backupIdFilter"],["title",""],[1,"complete-success"],[1,"complete-failure"],[1,"border-svg"],["cx","50","cy","50","r","45",1,"border-circle"],[1,"success"],[1,"error"],[1,"primary"],[1,"progress-content"],[3,"value"]]},template:function(e,i){if(e&1&&(o(0,"section"),O(1,Y,5,1,"sh-card",10)(2,oe,16,4,"sh-card",10),o(3,"sh-card",11)(4,"h3"),r(5,0),s(),o(6,"div",12),R(7,"app-notifications",13),s()(),o(8,"sh-card",14)(9,"h3"),r(10,1),s(),R(11,"app-logs-live",15),s()()),e&2){let l;a(),p(i.restoreResult()!=""?1:2),a(6),C("notificationFilterPredicate",i.notificationFilterPredicate()),a(4),C("asSimpleList",!0)("polling",i.restoreResult()=="")("whenFilter",(l=i.lastRestoreStarted())==null?null:l.getTime())("backupIdFilter",i.backupId())}},dependencies:[K,X,z,J,W,Z,j,k],styles:['[_nghost-%COMP%]{display:block;padding:0 1.25rem;margin-top:32px}section[_ngcontent-%COMP%]{display:grid;gap:1.25rem;grid-template-columns:2fr 1fr;grid-template-areas:"progress notifications" "logs logs"}section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin-bottom:1rem}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%]{grid-area:progress}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%]:has(.complete-check){display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1.25rem}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%] sh-spinner[_ngcontent-%COMP%]{--spinner-size: 1.25rem;--spinner-thickness: .1875rem}section[_ngcontent-%COMP%] .notifications[_ngcontent-%COMP%]{grid-area:notifications}section[_ngcontent-%COMP%] .logs[_ngcontent-%COMP%]{grid-area:logs}section[_ngcontent-%COMP%] .logs[_ngcontent-%COMP%] app-logs-live[_ngcontent-%COMP%]{max-height:50rem;overflow:auto}.notification-list[_ngcontent-%COMP%]{max-height:15rem;overflow:auto}.complete-success[_ngcontent-%COMP%]{position:relative;width:6.25rem;height:6.25rem;display:flex;justify-content:center;align-items:center;color:var(--success-8)}.complete-success[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:0;animation:_ngcontent-%COMP%_reveal-icon .2s linear forwards;animation-delay:1s}.complete-success[_ngcontent-%COMP%] .border-circle[_ngcontent-%COMP%]{fill:none;stroke:var(--success-8)}.complete-failure[_ngcontent-%COMP%]{position:relative;width:6.25rem;height:6.25rem;display:flex;justify-content:center;align-items:center;color:var(--error-8)}.complete-failure[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:0;animation:_ngcontent-%COMP%_reveal-icon .2s linear forwards;animation-delay:1s}.complete-failure[_ngcontent-%COMP%] .border-circle[_ngcontent-%COMP%]{fill:none;stroke:var(--error-8)}.border-svg[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%}.border-circle[_ngcontent-%COMP%]{fill:none;stroke-width:.3125rem;stroke-dasharray:282.74;stroke-dashoffset:282.74;animation:_ngcontent-%COMP%_draw-border 1.2s linear forwards}@keyframes _ngcontent-%COMP%_draw-border{to{stroke-dashoffset:0}}@keyframes _ngcontent-%COMP%_reveal-icon{to{opacity:1}}.progress-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.progress-content[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{margin-bottom:.75rem}.progress-content[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{margin-right:.25rem}'],changeDetection:0})};export{G as default};
1
+ import{a as K}from"./chunk-VYJNNEM5.js";import"./chunk-JWO4FPWJ.js";import{g as q}from"./chunk-2YEG7JK3.js";import"./chunk-3SHOBVX6.js";import"./chunk-AS6Z56AD.js";import{b as Z}from"./chunk-3C5RKSMK.js";import"./chunk-DGKNUD3G.js";import"./chunk-O4OTZE5N.js";import"./chunk-WIVARGP6.js";import"./chunk-HHYYLYET.js";import{a as V}from"./chunk-WUL6NS6B.js";import"./chunk-LP4W35DJ.js";import"./chunk-6Q6SSTBK.js";import{a as j}from"./chunk-FK7JFD5B.js";import"./chunk-5DJAX2HH.js";import"./chunk-G4VDCGMW.js";import"./chunk-DW332N2S.js";import{b as H}from"./chunk-NNCQNVQC.js";import"./chunk-TELPJYLN.js";import"./chunk-DAODMGAD.js";import{C as W,L as X,O as z,u as J}from"./chunk-HPNLQHW6.js";import{c as B}from"./chunk-BGTK25UG.js";import{b as w}from"./chunk-A4LPGPDU.js";import"./chunk-PKPBSTZA.js";import"./chunk-QPTSKQZ2.js";import{ka as k}from"./chunk-OTPG7USH.js";import"./chunk-TT3S63BX.js";import{Ab as s,Bb as R,Cc as T,Dc as d,Fb as P,Gb as m,Mc as b,Pa as a,Pb as y,Qb as D,Rb as r,Sb as v,Tb as x,W as c,Xb as g,ba as u,ca as f,cb as A,jc as M,la as I,mc as N,sb as O,tb as p,yb as C,zb as o}from"./chunk-T2WO6CVD.js";import"./chunk-7CGTOI24.js";function Q(n,t){n&1&&(o(0,"div",17),u(),o(1,"svg",19),R(2,"circle",20),s(),f(),o(3,"sh-icon",21),r(4,3),s()())}function U(n,t){n&1&&(o(0,"div",18),u(),o(1,"svg",19),R(2,"circle",20),s(),f(),o(3,"sh-icon",22),r(4,4),s()())}function Y(n,t){if(n&1&&(o(0,"sh-card",10),P(1,16),r(2,2),m(),O(3,Q,5,0,"div",17)(4,U,5,0,"div",18),s()),n&2){let e=g();a(3),p(e.restoreResult()=="success"?3:4)}}function ee(n,t){if(n&1&&(M(0),T(1,"number"),T(2,"number")),n&2){let e,i=g(2);N(" ",d(1,2,(e=i.statusData())==null?null:e.ProcessedFileCount)," of ",d(2,4,(e=i.statusData())==null?null:e.TotalFileCount)," ")}}function te(n,t){n&1&&(P(0),r(1,8),m())}function ne(n,t){if(n&1&&(M(0),T(1,"bytes"),T(2,"bytes")),n&2){let e,i=g(2);N(" ",d(1,2,(e=i.statusData())==null?null:e.ProcessedFileSize)," of ",d(2,4,(e=i.statusData())==null?null:e.TotalFileSize)," ")}}function ie(n,t){n&1&&(P(0),r(1,9),m())}function oe(n,t){if(n&1&&(o(0,"sh-card",10)(1,"h3"),y(2,5),R(3,"sh-spinner",23),D(),s(),o(4,"div",24),R(5,"sh-progress-bar",25),o(6,"p")(7,"span"),r(8,6),s(),O(9,ee,3,6)(10,te,2,0,"ng-container"),s(),o(11,"p")(12,"span"),r(13,7),s(),O(14,ne,3,6)(15,ie,2,0,"ng-container"),s()()()),n&2){let e,i,l,E,S=g();a(3),v((e=S.statusData())==null?null:e.statusText),x(2),a(2),C("value",(i=S.statusData())==null?null:i.OverallProgress),a(4),p((l=S.statusData())!=null&&l.ProcessedFileCount?9:10),a(5),p((E=S.statusData())!=null&&E.ProcessedFileSize?14:15)}}var G=class n{#o=c(B);#s=c(H);#t=c(V);#n=c(q);#r=c(w);statusData=this.#t.statusData;backupId=this.#n.backupId;restoreResult=I("");#e=null;lastRestoreStarted=b(()=>{if(this.#e)return this.#e;let t=this.#t.statusData()?.backup?.Backup?.Metadata?.LastRestoreStarted??null;if(!t)return null;let e=this.fixDate(t);return this.#e=e,e});notificationFilterPredicate=()=>{let t=this.lastRestoreStarted();return{predicate:e=>(e.BackupID===this.#n.backupId()&&t&&t.getTime()<=new Date(e.Timestamp).getTime())??!1}};ngOnInit(){let t=this.#r.snapshot.params.taskid?.toString()??"";this.#o.getApiV1TaskByTaskid({taskid:t}).subscribe({next:e=>{if(e.TaskStarted&&(this.#e=new Date(e.TaskStarted)),!e.TaskFinished&&e.ID){this.#_(e.ID);return}this.#i(e)},error:e=>{console.error("Error fetching task:",e),this.restoreResult.set("error"),alert("Failed to fetch task details. Please try again later.")}})}#_(t){this.#s.waitForTaskToComplete(t).subscribe(e=>{this.#i(e)})}#i(t){t.TaskFinished!=null&&this.restoreResult.set(t.Status==="Completed"&&t.ErrorMessage==null?"success":"error")}fixDate(t){return new Date(`${t.slice(0,4)}-${t.slice(4,6)}-${t.slice(6,8)}T${t.slice(9,11)}:${t.slice(11,13)}:${t.slice(13,15)}Z`)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=A({type:n,selectors:[["app-restore-progress"]],decls:12,vars:6,consts:()=>{let t;t=$localize`Notifications`;let e;e=$localize`Logs`;let i;i=$localize`Restore completed`;let l;l=$localize`check-bold`;let E;E=$localize`warning-octagon`;let S;S=$localize` Restore progress: ${"\uFFFD0\uFFFD"}:INTERPOLATION: ${"\uFFFD#3\uFFFD"}:START_TAG_SH_SPINNER:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_SPINNER:`;let h;h=$localize`Files processed:`;let F;F=$localize`Size processed:`;let L;L=$localize`N/A`;let $;return $=$localize`N/A`,[t,e,i,l,E,S,h,F,L,$,[1,"progress","type-a"],[1,"notifications","type-a"],[1,"notification-list"],[3,"notificationFilterPredicate"],[1,"logs","type-a"],[3,"asSimpleList","polling","whenFilter","backupIdFilter"],["title",""],[1,"complete-success"],[1,"complete-failure"],[1,"border-svg"],["cx","50","cy","50","r","45",1,"border-circle"],[1,"success"],[1,"error"],[1,"primary"],[1,"progress-content"],[3,"value"]]},template:function(e,i){if(e&1&&(o(0,"section"),O(1,Y,5,1,"sh-card",10)(2,oe,16,4,"sh-card",10),o(3,"sh-card",11)(4,"h3"),r(5,0),s(),o(6,"div",12),R(7,"app-notifications",13),s()(),o(8,"sh-card",14)(9,"h3"),r(10,1),s(),R(11,"app-logs-live",15),s()()),e&2){let l;a(),p(i.restoreResult()!=""?1:2),a(6),C("notificationFilterPredicate",i.notificationFilterPredicate()),a(4),C("asSimpleList",!0)("polling",i.restoreResult()=="")("whenFilter",(l=i.lastRestoreStarted())==null?null:l.getTime())("backupIdFilter",i.backupId())}},dependencies:[K,X,z,J,W,Z,j,k],styles:['[_nghost-%COMP%]{display:block;padding:0 1.25rem;margin-top:32px}section[_ngcontent-%COMP%]{display:grid;gap:1.25rem;grid-template-columns:2fr 1fr;grid-template-areas:"progress notifications" "logs logs"}section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin-bottom:1rem}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%]{grid-area:progress}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%]:has(.complete-check){display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1.25rem}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%] sh-spinner[_ngcontent-%COMP%]{--spinner-size: 1.25rem;--spinner-thickness: .1875rem}section[_ngcontent-%COMP%] .notifications[_ngcontent-%COMP%]{grid-area:notifications}section[_ngcontent-%COMP%] .logs[_ngcontent-%COMP%]{grid-area:logs}section[_ngcontent-%COMP%] .logs[_ngcontent-%COMP%] app-logs-live[_ngcontent-%COMP%]{max-height:50rem;overflow:auto}.notification-list[_ngcontent-%COMP%]{max-height:15rem;overflow:auto}.complete-success[_ngcontent-%COMP%]{position:relative;width:6.25rem;height:6.25rem;display:flex;justify-content:center;align-items:center;color:var(--success-8)}.complete-success[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:0;animation:_ngcontent-%COMP%_reveal-icon .2s linear forwards;animation-delay:1s}.complete-success[_ngcontent-%COMP%] .border-circle[_ngcontent-%COMP%]{fill:none;stroke:var(--success-8)}.complete-failure[_ngcontent-%COMP%]{position:relative;width:6.25rem;height:6.25rem;display:flex;justify-content:center;align-items:center;color:var(--error-8)}.complete-failure[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:0;animation:_ngcontent-%COMP%_reveal-icon .2s linear forwards;animation-delay:1s}.complete-failure[_ngcontent-%COMP%] .border-circle[_ngcontent-%COMP%]{fill:none;stroke:var(--error-8)}.border-svg[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%}.border-circle[_ngcontent-%COMP%]{fill:none;stroke-width:.3125rem;stroke-dasharray:282.74;stroke-dashoffset:282.74;animation:_ngcontent-%COMP%_draw-border 1.2s linear forwards}@keyframes _ngcontent-%COMP%_draw-border{to{stroke-dashoffset:0}}@keyframes _ngcontent-%COMP%_reveal-icon{to{opacity:1}}.progress-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.progress-content[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{margin-bottom:.75rem}.progress-content[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{margin-right:.25rem}'],changeDetection:0})};export{G as default};
@@ -1 +1 @@
1
- import"./chunk-7CGTOI24.js";var o=[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-4YM23PM6.js")},{path:"destination",loadComponent:()=>import("./chunk-VQP7COG3.js")},{path:"source-data",loadComponent:()=>import("./chunk-VIONVZIF.js")},{path:"schedule",loadComponent:()=>import("./chunk-KEE3H2WJ.js")},{path:"options",loadComponent:()=>import("./chunk-EA7ODJNP.js")}];export{o as default};
1
+ import"./chunk-7CGTOI24.js";var o=[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-4YM23PM6.js")},{path:"destination",loadComponent:()=>import("./chunk-W3543UFN.js")},{path:"source-data",loadComponent:()=>import("./chunk-VIONVZIF.js")},{path:"schedule",loadComponent:()=>import("./chunk-KEE3H2WJ.js")},{path:"options",loadComponent:()=>import("./chunk-ECRDYEF2.js")}];export{o as default};