@duplicati/ngclient 0.0.203 → 0.0.204

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ import"./chunk-7CGTOI24.js";var o=[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-OINQP25T.js")},{path:"destination",loadComponent:()=>import("./chunk-F6H5V7OU.js")},{path:"source-data",loadComponent:()=>import("./chunk-RNYUAYNZ.js")},{path:"schedule",loadComponent:()=>import("./chunk-PXULEZKF.js")},{path:"options",loadComponent:()=>import("./chunk-ZORSGUCK.js")}];export{o as default};
@@ -1 +1 @@
1
- import{a as Ze}from"./chunk-OL7C46LY.js";import{h as Ke,m as Qe}from"./chunk-P3D2ZP6W.js";import{d as re}from"./chunk-HRHF3TYJ.js";import{a as je}from"./chunk-SZUNW4JO.js";import{a as D}from"./chunk-HSHF5HR7.js";import{b as _e}from"./chunk-VDSX2M4H.js";import{b as qe}from"./chunk-ZU6T3TW3.js";import{a as K}from"./chunk-HUZXJWCG.js";import{B as j,H as ze,L as Je,M as Xe,P as Ue,V as Ye,W as He,b as we,c as B,e as V,f as W,i as Be,j as z,l as Ve,p as J,q as X,r as U,s as We,t as Y,u as H,z as se}from"./chunk-UNMDSCAN.js";import{c as q}from"./chunk-CFNARBNK.js";import{b as M,d as L}from"./chunk-I27PVH6D.js";import{fa as ne}from"./chunk-7AVOHYTE.js";import{$ as P,Ab as a,Bb as p,C as Q,Cc as le,Dc as ke,E as R,Ec as xe,Fb as b,Gb as v,H as Pe,Ib as A,K as Ie,L as ee,Mc as N,Pa as d,Pb as m,Qb as T,R as Me,Rb as O,Sb as De,Tb as ye,Vb as C,W as c,Xb as f,aa as I,cb as w,g as Ce,gc as $e,hb as Le,jc as G,la as _,lc as be,m as Ne,mc as ve,na as x,oc as te,pc as ie,qc as oe,sb as g,tb as E,v as ae,w as he,wc as Ae,xc as Ge,yb as F,z as Re,zb as r}from"./chunk-26Z7TPJB.js";function rt(s,t){s&1&&(r(0,"p"),O(1,3),a())}function at(s,t){s&1&&(r(0,"sh-form-field")(1,"label",11),O(2,4),a(),p(3,"input",12),a())}var et=new U,ot=()=>et.group({passphrase:et.control("")}),ce=class s{#e=c(q);#t=c(y);#n=c(L);#o=c(M);encryptionForm=this.#t.encryptionForm;creatingTemporaryBackup=_(!1);settings=_([]);hasEncryptedBackup=N(()=>{let t=this.#t.destinationTestSignal();return t==="testing"||typeof t=="string"?!0:t?.containsEncryptedBackupFiles??!0});showEncryptionField=_(!1);next(){let t=this.#t.destinationTargetUrl();if(!t)throw new Error("No target URL");this.creatingTemporaryBackup.set(!0);let e=this.encryptionForm.value?.passphrase??null,i=[];e?i.push({Name:"--passphrase",Value:e}):i.push({Name:"--no-encryption",Value:"true"}),this.settings().forEach(o=>{let n=o.Name?.trim();n&&n!=="--"&&(n.startsWith("--")||(n=`--${n}`),i.push({Name:n,Value:o.Value??""}))}),this.#e.postApiV1Backups({requestBody:{Backup:{TargetURL:t,Settings:i}},temporary:!0}).pipe(R(()=>this.creatingTemporaryBackup.set(!1))).subscribe({next:o=>{let n=o.ID;this.#n.navigate([`/restore-draft/${n}`])},error:o=>{console.error(o)}})}back(){this.#t.isFileRestore()?this.#n.navigate(["destination"],{relativeTo:this.#o.parent}):this.#t.exit()}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=w({type:s,selectors:[["app-restore-encryption"]],decls:14,vars:5,consts:()=>{let t;t=$localize`Advanced options`;let e;e=$localize`${"\uFFFD#10\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let i;i=$localize`${"\uFFFD#13\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#13\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let o;o=$localize`The backup does not contain encrypted files.`;let n;n=$localize`Enter backup passphrase if defined.`;let l;return l=$localize`Password`,[t,e,i,o,l,[3,"submit","formGroup"],["title",""],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],["for","password"],["type","password","id","password","placeholder",n,"formControlName","passphrase"]]},template:function(e,i){e&1&&(r(0,"form",5),C("submit",function(){return i.next()}),g(1,rt,2,0,"p"),g(2,at,4,0,"sh-form-field"),r(3,"sh-toggle-card"),b(4,6),O(5,0),v(),r(6,"app-options-list",7),oe("optionsChange",function(n){return ie(i.settings,n)||(i.settings=n),n}),a()(),r(7,"div",8)(8,"button",9),C("click",function(){return i.back()}),m(9,1),p(10,"sh-icon"),T(),a(),r(11,"button",10),m(12,2),p(13,"sh-icon"),T(),a()()()),e&2&&(F("formGroup",i.encryptionForm),d(),E(i.hasEncryptedBackup()?-1:1),d(),E(i.hasEncryptedBackup()||i.showEncryptionField()?2:-1),d(4),te("options",i.settings),F("hasFreeTextSettings",!0))},dependencies:[Y,z,B,V,W,X,J,ze,H,j,Ye,Ze],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var lt=()=>({standalone:!0});function _t(s,t){s&1&&p(0,"sh-progress-bar",8)}function ct(s,t){if(s&1&&(G(0),le(1,"bytes")),s&2){let e=f().$implicit;be(" (",ke(1,1,e.FileSizes),") ")}}function pt(s,t){s&1&&(r(0,"span",16),O(1,4),a())}function ut(s,t){if(s&1&&(r(0,"div",15),G(1),le(2,"date"),g(3,ct,2,3),g(4,pt,2,0,"span",16),a()),s&2){let e=t.$implicit;d(),ve(" ",e.Version,": ",xe(2,4,e.Time,"medium")," "),d(2),E(e.FileSizes?3:-1),d(),E(e.IsFullBackup===!1?4:-1)}}function dt(s,t){s&1&&p(0,"sh-progress-bar",8)}function mt(s,t){if(s&1){let e=A();r(0,"app-file-tree",17),C("hasExtendedData",function(o){P(e);let n=f(2);return I(n.extendedDataType.set(o))}),r(1,"label",18),O(2,5),a(),p(3,"input",19),a()}if(s&2){let e=f(2);F("rootPaths",e.rootPaths())("initialNodes",e.initialNodes())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)("loadExtendedData",!0)}}function Tt(s,t){if(s&1){let e=A();r(0,"sh-select",12),C("cleared",function(){P(e);let o=f();return I(o.abortLoading())}),r(1,"input",13),oe("ngModelChange",function(o){P(e);let n=f();return ie(n.selectOption,o)||(n.selectOption=o),I(o)}),a(),Le(2,ut,5,7,"ng-template"),a(),g(3,dt,1,0,"sh-progress-bar",8),g(4,mt,4,6,"app-file-tree",14)}if(s&2){let e=f();F("options",e.versionOptions())("isClearable",!1),d(),te("ngModel",e.selectOption),F("ngModelOptions",Ge(6,lt)),d(2),E(e.isRepairing()||e.versionOptionsLoading()||e.loadingRootPath()?3:-1),d(),E(e.showFileTree()?4:-1)}}var ue=new U,nt=()=>ue.group({filesToRestore:ue.control(""),passphrase:ue.control(null)}),de=class s{#e=c(q);#t=c(y);#n=c(qe);#o=c(K);#i=c(L);#s=c(M);#a=c(ne);#l=null;#_=null;#r=_([]);selectFilesForm=this.#t.selectFilesForm;selectFilesFormSignal=this.#t.selectFilesFormSignal;selectOption=this.#t.selectOption;backupId=this.#t.backupId;versionOptionsLoading=this.#t.versionOptionsLoading;versionOptions=this.#t.versionOptions;isFileRestore=this.#t.isFileRestore;extendedDataType=this.#t.extendedDataType;needsDatabaseRepair=N(()=>this.#t.backup()?.Backup?.IsTemporary??!0);showFileTree=_(!1);backupSettings=_(null);rootPaths=_([]);initialNodes=_([]);loadingRootPath=_(!1);isRepairing=N(()=>this.#r().length>0);loadedVersions=_({});loadingEffect=x(()=>{if(this.versionOptionsLoading())return;let e=this.versionOptions();if(e&&e?.length>0){let i=e[0].Version;this.selectOption.set(i.toString())}});backupSettingsEffect=x(()=>{let t=this.backupId(),e=this.selectOption(),i=this.isRepairing(),o=this.loadedVersions();if(!e||!t)return;let l=this.versionOptions()?.find(Z=>Z.Version===parseInt(e))?.Time??null;if(!l)return;let u=`${t}+${l}`,h=o[u];if(this.needsDatabaseRepair()&&(!h||i))return;let $={id:t+"",time:l};this.backupSettings.set($),this.getRootPath($)});repairEffect=x(()=>{if(!this.needsDatabaseRepair())return;let t=this.selectOption(),e=this.versionOptions();if(t){let i=e.find(l=>l.Version===parseInt(t));if(i===void 0)return;let o=this.backupId(),n=`${o}+${i.Time}`;if(this.#_===n||(this.#_=n,this.#r().includes(n)))return;this.#r.update(l=>[...l,n]),this.#e.postApiV1BackupByIdRepairupdate({id:o,requestBody:{only_paths:!0,time:i.Time}}).pipe(ee(this.abortLoading$),R(()=>{this.#_=null})).subscribe(l=>{let u=l.ID;this.#n.waitForTaskToComplete(u).pipe(Q(1)).subscribe(()=>{this.#r.update(h=>h.filter($=>$!==n)),this.loadedVersions.update(h=>(h[n]=!0,h))})})}});getRootPath(t){let e={id:t.id+"",time:t.time,prefixOnly:!0,folderContents:!1},i=t.id+"";this.isRepairing()||this.#l===i||(this.#l=i,this.loadingRootPath.set(!0),this.showFileTree.set(!1),this.#o.hasV2ListOperations()?this.#e.postApiV2BackupListFolder({requestBody:{BackupId:t.id,Time:t.time,Paths:null,PageSize:0,Page:0}}).pipe(ee(this.abortLoading$),R(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1),this.#l=null})).subscribe({next:o=>{let n=(o.Data??[]).map(l=>l.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}):this.#e.getApiV1BackupByIdFiles(e).pipe(ee(this.abortLoading$),R(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1)})).subscribe({next:o=>{let n=o.Files.map(l=>l.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}))}abortLoading$=new Ce;abortLoading(){this.showFileTree.set(!1),this.loadingRootPath.set(!1),this.abortLoading$.next(!0)}displayFn(){let t=this.versionOptions();return e=>{if(!e)return"";let i=t?.find(o=>typeof o.Version=="number"&&o.Version.toString()===e);return i?`${i.Version}: ${this.#a.transform(i.Time,"medium")}`:""}}next(){this.#i.navigate(["options"],{relativeTo:this.#s.parent})}back(){this.#t.isFileRestore()?this.#i.navigate(["encryption"],{relativeTo:this.#s.parent}):this.#t.exit()}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=w({type:s,selectors:[["app-select-files"]],features:[Ae([ne])],decls:13,vars:3,consts:()=>{let t;t=$localize`Select files`;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let o;o=$localize`Select an option...`;let n;n=$localize`(partial)`;let l;return l=$localize`Path`,[["formRef",""],t,e,i,n,l,[3,"submit","formGroup"],[1,"title-30"],[1,"indeterminate","primary"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],["value","Version",3,"cleared","options","isClearable"],["type","text","placeholder",o,3,"ngModelChange","ngModel","ngModelOptions"],[3,"rootPaths","initialNodes","backupSettings","multiSelect","showFiles","loadExtendedData"],[1,"custom-option"],[1,"partial"],[3,"hasExtendedData","rootPaths","initialNodes","backupSettings","multiSelect","showFiles","loadExtendedData"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]]},template:function(e,i){if(e&1){let o=A();r(0,"form",6,0),C("submit",function(){return P(o),I(i.next())}),r(2,"h3",7),O(3,1),a(),g(4,_t,1,0,"sh-progress-bar",8)(5,Tt,5,7),r(6,"div",9)(7,"button",10),C("click",function(){return P(o),I(i.back())}),m(8,2),p(9,"sh-icon"),T(),a(),r(10,"button",11),m(11,3),p(12,"sh-icon"),T(),a()()()}e&2&&(F("formGroup",i.selectFilesForm),d(4),E(i.versionOptionsLoading()?4:5),d(5),De(i.isFileRestore()?"Back":"Exit"),ye(8))},dependencies:[We,z,B,V,W,Be,Y,X,J,re,j,H,Ue,Je,ne,je],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.partial[_ngcontent-%COMP%]{color:var(--base-9);font-style:italic}"],changeDetection:0})};var y=class s{#e=c(L);#t=c(M);#n=c(K);#o=c(se);#i=c(q);backupId=_(null);backup=_(null);destinationTargetUrl=_(null);destinationTestSignal=_(null);selectFilesForm=nt();optionsForm=st();encryptionForm=ot();optionsFormSignal=_e(this.optionsForm.valueChanges);selectFilesFormSignal=_e(this.selectFilesForm.valueChanges);selectOption=_(null);versionOptionsLoading=_(!1);versionOptions=_([]);isSubmitting=_(!1);isFileRestore=_(!1);isFullWidthPage=_(!1);extendedDataType=_(null);alternateRestorePath=_(null);init(t,e=!1){this.backupId.set(t),this.isFileRestore.set(e),this.alternateRestorePath.set(null),this.extendedDataType.set(null),e&&this.#e.navigate(["/restore-from-files/destination"]),e||this.getBackup()}updateTargetUrl(t){this.destinationTargetUrl.set(t)}setAlternateRestorePath(t){this.alternateRestorePath.set(t)}submit(){this.isSubmitting.set(!0);let t=this.backupId();this.backup()?.Backup?.IsTemporary??!1?this.#i.postApiV1BackupByIdCopytotemp({id:this.backupId()??""}).subscribe({next:i=>{this.#s(i.ID??"")},error:i=>this.showErrorDialog($localize`An error occurred while copying the backup to a temporary location: ${i.message}`)}):this.#s(t??"")}showErrorDialog(t){this.#o.open(D,{data:{title:$localize`Error occured`,message:t,confirmText:$localize`OK`,cancelText:void 0},closed:e=>{}})}#s(t){let e=this.optionsForm.value,i=this.selectFilesForm.value,o=this.selectOption(),n=this.versionOptions()?.find(l=>l.Version===(o&&parseInt(o)));this.#i.postApiV1BackupByIdRestore({id:t??"",requestBody:{paths:i.filesToRestore?.split("\0").map(l=>l.endsWith("/")||l.endsWith("\\")?`${l}*`:l)??[],passphrase:i.passphrase??null,time:n?.Time,restore_path:this.alternateRestorePath()??e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!e.includeMetadata}}).pipe(R(()=>this.isSubmitting.set(!1))).subscribe({next:l=>{this.#e.navigate([`./${l.ID}`,"progress"],{relativeTo:this.#t})},error:l=>{console.error("restore error",l)}})}exit(){this.#o.open(D,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:t=>{t&&(this.#a(),this.#e.navigate(["/"]))}})}getVersionOptions(){this.versionOptions()}loadFilesetsWithRetryv2(t,e=2){return this.#i.postApiV2BackupListFilesets({requestBody:{BackupId:t}}).pipe(Re(i=>{let o=i?.error?.body?.StatusCode??i?.error?.requestBody?.StatusCode;return o==="EncryptedStorageNoPassphrase"||o==="FolderMissing"||o==="EmptyRemoteFolder"||e===0?Ne(()=>i):he(1e3).pipe(Ie(()=>this.loadFilesetsWithRetryv2(t,e-1)))}))}getBackup(){let t=this.backupId();this.versionOptionsLoading.set(!0),this.#n.hasV2ListOperations()?ae([this.#i.getApiV1BackupById({id:t}),this.loadFilesetsWithRetryv2(t)]).pipe(Q(1),R(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([e,i])=>{if(i.Error)throw new Error(i.Error);if(!(e.Backup?.IsTemporary??!0)&&e?.Backup?.DBPathExists===!1){this.#o.open(D,{data:{title:$localize`Missing Local Database`,message:$localize`The local database for this backup is missing. Please repair or recreate the local database before restoring.`,confirmText:$localize`OK`,cancelText:void 0},closed:n=>{this.#e.navigate(["/backup",t,"database"])}});return}this.versionOptions.set((i.Data??[]).map(n=>({Version:n.Version??-1,IsFullBackup:n.IsFullBackup??void 0,Time:n.Time??"<missing>",FileCount:n.FileCount??void 0,FileSizes:n.FileSizes??void 0}))),this.backup.set(e)},error:e=>{let i=e?.error?.body?.StatusCode??e?.error?.requestBody?.StatusCode,o=i==="EncryptedStorageNoPassphrase",n=i==="FolderMissing",l=i==="EmptyRemoteFolder",u=$localize`An error occurred while loading the backup filesets: ${e.message}`;o&&(u=$localize`The remote storage is encrypted. Please enter the passphrase to access the backup.`),n&&(u=$localize`The backup storage folder was not found.`),l&&(u=$localize`The backup storage folder does not contain any filesets.`),this.#o.open(D,{data:{title:$localize`Failed to load backup filesets`,message:u,confirmText:$localize`OK`,cancelText:void 0},closed:h=>{this.#e.navigate([o?"/restore-from-files/encryption":"/restore-from-files/destination"])}})}}):ae([this.#i.getApiV1BackupById({id:t}),this.#i.getApiV1BackupByIdFilesets({id:t}).pipe(Pe(3))]).pipe(Q(1),R(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([e,i])=>{this.versionOptions.set(i.map(o=>({Version:o.Version??-1,IsFullBackup:(o.IsFullBackup??1)==1,Time:o.Time??"<missing>",FileCount:o.FileCount??void 0,FileSizes:o.FileSizes??void 0}))),this.backup.set(e)}})}#a(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||s)};static \u0275prov=Me({token:s,factory:s.\u0275fac,providedIn:"root"})};function St(s,t){if(s&1&&(r(0,"app-file-tree",29)(1,"label",31),G(2,"Path"),a(),p(3,"input",32),a()),s&2){let e,i=f(2);F("disabled",((e=i.optionsFormSignal())==null?null:e.restoreFrom)!=="pickLocation")("enableCreateFolder",!0)}}function Ft(s,t){if(s&1&&(r(0,"app-file-tree",30)(1,"label",31),G(2,"Path"),a(),p(3,"input",32),a()),s&2){let e=f(2);F("office365Mode",!0)("backupId",e.backupId())("destinationUrl",e.office365destinationUrl())}}function gt(s,t){if(s&1){let e=A();r(0,"sh-radio",25),m(1,5),p(2,"input",26),T(),a(),r(3,"sh-radio",25),m(4,6),r(5,"input",27),C("click",function(){P(e);let o=f();return I(o.chooseOfficeTenant())}),a(),T(),a(),r(6,"sh-radio",25),m(7,7),p(8,"input",28),T(),a(),g(9,St,4,2,"app-file-tree",29),g(10,Ft,4,3,"app-file-tree",30)}if(s&2){let e,i=f();d(9),E(((e=i.optionsFormSignal())==null?null:e.restoreFrom)==="pickLocation"?9:-1),d(),E(i.showOffice365RestoreTree()?10:-1)}}function Et(s,t){if(s&1&&(r(0,"sh-radio",25),m(1,8),p(2,"input",33),T(),a(),r(3,"sh-radio",25),m(4,9),p(5,"input",28),T(),a(),r(6,"app-file-tree",29)(7,"label",31),G(8,"Path"),a(),p(9,"input",32),a()),s&2){let e,i=f();d(6),F("disabled",((e=i.optionsFormSignal())==null?null:e.restoreFrom)!=="pickLocation")("enableCreateFolder",!0)}}function Ot(s,t){s&1&&(r(0,"app-toggle-card",20),b(1,21),O(2,10),v(),r(3,"sh-toggle",25),m(4,11),p(5,"input",34),T(),a()()),s&2&&F("disallowToggle",!0)}function ft(s,t){s&1&&(r(0,"app-toggle-card",20),b(1,21),O(2,12),v(),r(3,"sh-radio",25),m(4,13),p(5,"input",35),T(),a(),r(6,"sh-radio",25),m(7,14),p(8,"input",36),T(),a()(),r(9,"app-toggle-card"),b(10,21),O(11,15),v(),r(12,"sh-toggle",37),m(13,16),p(14,"input",38),T(),a(),r(15,"sh-toggle",37),m(16,17),p(17,"input",39),T(),a()()),s&2&&F("disallowToggle",!0)}var k=new U,st=()=>k.group({restoreFrom:k.control("original"),restoreFromPath:k.control(""),handleExisting:k.control("saveTimestamp"),permissions:k.control(!1),includeMetadata:k.control(!0),officeIgnoreExisting:k.control(!1)}),me=class s{#e=c(y);#t=c(L);#n=c(M);#o=c(K);#i=c(se);optionsForm=this.#e.optionsForm;optionsFormSignal=this.#e.optionsFormSignal;isSubmitting=this.#e.isSubmitting;extendedData=this.#e.extendedDataType;office365CustomTargetUrl=_(null);backupId=N(()=>this.#e.backup()?.Backup?.ID??null);hasOffice365Data=N(()=>this.extendedData()==="o365");office365SourceUrl=N(()=>{let t=this.#e.backup()?.Backup?.Sources?.filter(i=>i.startsWith("@")&&i.includes("|office365"))[0];if(!t)return null;let e=t.split("|");return e.length>=2?e[1]:null});office365destinationUrl=N(()=>{let t=this.optionsFormSignal()?.restoreFrom,e=this.hasOffice365Data();return t==="same-o365"&&e?this.office365SourceUrl():t==="other-o365"&&e?this.office365CustomTargetUrl():null});showOffice365RestoreTree=N(()=>!!(this.optionsFormSignal()?.restoreFrom==="same-o365"&&this.office365destinationUrl()&&this.backupId()||this.optionsFormSignal()?.restoreFrom==="other-o365"&&this.office365destinationUrl()));isOffice365Restore=N(()=>{let t=this.optionsFormSignal()?.restoreFrom;return t==="same-o365"||t==="other-o365"});chooseOfficeTenant(){return this.#i.open(Qe,{maxWidth:"700px",maxHeight:"80vh",width:"100%",closeOnOutsideClick:!1,data:{targetUrlModel:this.office365CustomTargetUrl()||this.office365SourceUrl()||"office365://",moduleType:"RestoreDestinationProvider",askToCreate:!0,expectedResult:"any",suppressErrorDialogs:!0}}).closed.subscribe(e=>{e&&(this.office365CustomTargetUrl.set(e),this.optionsForm.controls.restoreFrom.setValue("other-o365"))}),!1}#s=x(()=>{let t=this.optionsFormSignal()?.restoreFrom;this.hasOffice365Data()&&(t==="original"||t===void 0)&&(this.optionsForm.controls.restoreFrom.setValue("pickLocation"),this.optionsForm.controls.handleExisting.setValue("overwrite")),!this.hasOffice365Data()&&(t==="same-o365"||t==="other-o365")&&(this.optionsForm.controls.restoreFrom.setValue("original"),this.optionsForm.controls.handleExisting.setValue("saveTimestamp"))});goBack(){this.#t.navigate(["select-files"],{relativeTo:this.#n.parent})}submit(){let t=this.#e.selectFilesFormSignal()?.filesToRestore??[];if(t.length>0&&this.optionsFormSignal()?.restoreFrom=="original"&&(t[0].includes("/")?"/":"\\")!==this.#o.systemInfo()?.DirectorySeparator){this.#i.open(D,{data:{title:$localize`Confirm target folder`,message:$localize`This backup was created on another operating system. Restoring files without specifying a destination folder can cause files to be restored in unexpected places. Are you sure you want to continue without choosing a destination folder?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:o=>{o&&this.#e.submit()}});return}if(this.optionsFormSignal()?.restoreFrom==="same-o365"||this.optionsFormSignal()?.restoreFrom==="other-o365"){let i=this.optionsFormSignal()?.restoreFromPath;if(i&&i.startsWith("/")&&(i=i.substring(1)),!i||i.trim()===""){this.#i.open(D,{data:{title:$localize`No path specified`,message:$localize`Please choose a path to restore to in the Office 365 tenant.`,confirmText:$localize`OK`,cancelText:void 0}});return}let o=this.optionsFormSignal()?.officeIgnoreExisting,n=this.office365destinationUrl()?.substring(this.office365destinationUrl().indexOf("?")),l=`@office365://${i}${n}&office365-ignore-existing=${o?"true":"false"}`;this.#e.setAlternateRestorePath(l),this.optionsForm.controls.includeMetadata.setValue(!0),this.optionsForm.controls.permissions.setValue(!0)}else this.#e.setAlternateRestorePath(null);this.#e.submit()}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=w({type:s,selectors:[["app-advanced-options-settings"]],decls:18,vars:6,consts:()=>{let t;t=$localize`Restore options`;let e;e=$localize`Where do you want to restore files to?`;let i;i=$localize`${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `;let n;n=$localize` Same Office 365 Tenant ${"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"}:TAG_INPUT:`;let l;l=$localize` Different Office 365 Tenant ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let u;u=$localize` Local file system ${"\uFFFD#8\uFFFD\uFFFD/#8\uFFFD"}:TAG_INPUT:`;let h;h=$localize` Original location ${"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"}:TAG_INPUT:`;let $;$=$localize` Pick location ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let Z;Z=$localize`Restore settings`;let Te;Te=$localize` Ignore existing resources in the destination ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let Se;Se=$localize`How do you want to handle existing files?`;let Fe;Fe=$localize` Overwrite ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let ge;ge=$localize` Save different versions with timestamp in file name ${"\uFFFD#8\uFFFD\uFFFD/#8\uFFFD"}:TAG_INPUT:`;let Ee;Ee=$localize`Metadata settings`;let Oe;Oe=$localize` Restore file metadata ${"\uFFFD#14\uFFFD\uFFFD/#14\uFFFD"}:TAG_INPUT:`;let fe;return fe=$localize` Restore read/write permissions ${"\uFFFD#17\uFFFD\uFFFD/#17\uFFFD"}:TAG_INPUT:`,[["formRef",""],t,e,i,o,n,l,u,h,$,Z,Te,Se,Fe,ge,Ee,Oe,fe,[3,"submit","formGroup"],[1,"title-30"],[3,"disallowToggle"],["title",""],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],[1,"raised","primary"],["type","radio","name","restoreFrom","value","same-o365","formControlName","restoreFrom"],["type","radio","name","restoreFrom","value","other-o365","formControlName","restoreFrom",3,"click"],["type","radio","name","restoreFrom","value","pickLocation","formControlName","restoreFrom"],[3,"disabled","enableCreateFolder"],[3,"office365Mode","backupId","destinationUrl"],["for","path"],["type","text","id","path","formControlName","restoreFromPath"],["type","radio","name","restoreFrom","value","original","formControlName","restoreFrom"],["type","checkbox","formControlName","officeIgnoreExisting"],["type","radio","name","handleExisting","value","overwrite","formControlName","handleExisting"],["type","radio","name","handleExisting","value","saveTimestamp","formControlName","handleExisting"],[1,"primary","raised"],["type","checkbox","formControlName","includeMetadata"],["type","checkbox","formControlName","permissions"]]},template:function(e,i){if(e&1){let o=A();r(0,"form",18,0),C("submit",function(){return P(o),I(i.submit())}),r(2,"h3",19),O(3,1),a(),r(4,"app-toggle-card",20),b(5,21),O(6,2),v(),g(7,gt,11,2)(8,Et,10,2),a(),g(9,Ot,6,1,"app-toggle-card",20)(10,ft,18,1),r(11,"div",22)(12,"button",23),C("click",function(){return P(o),I(i.goBack())}),m(13,3),p(14,"sh-icon"),T(),a(),r(15,"button",24),m(16,4),p(17,"sh-icon"),T(),a()()()}e&2&&(F("formGroup",i.optionsForm),d(4),F("disallowToggle",!0),d(3),E(i.hasOffice365Data()?7:8),d(2),E(i.isOffice365Restore()?9:10),d(6),$e("loader",i.isSubmitting()))},dependencies:[Y,z,B,we,Ve,V,W,X,J,Ke,re,He,Xe,j,H],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};export{st as a,me as b,ot as c,ce as d,nt as e,de as f,y as g};
1
+ import{a as Ze}from"./chunk-TXFTUL4R.js";import{h as Ke,m as Qe}from"./chunk-TN6HBIUN.js";import{d as re}from"./chunk-K34VOGDF.js";import{a as je}from"./chunk-SZUNW4JO.js";import{a as D}from"./chunk-HSHF5HR7.js";import{b as _e}from"./chunk-VDSX2M4H.js";import{b as qe}from"./chunk-ZU6T3TW3.js";import{a as K}from"./chunk-HUZXJWCG.js";import{B as j,H as ze,L as Je,M as Xe,P as Ue,V as Ye,W as He,b as we,c as B,e as V,f as W,i as Be,j as z,l as Ve,p as J,q as X,r as U,s as We,t as Y,u as H,z as se}from"./chunk-UNMDSCAN.js";import{c as q}from"./chunk-CFNARBNK.js";import{b as M,d as L}from"./chunk-I27PVH6D.js";import{fa as ne}from"./chunk-7AVOHYTE.js";import{$ as P,Ab as a,Bb as p,C as Q,Cc as le,Dc as ke,E as R,Ec as xe,Fb as b,Gb as v,H as Pe,Ib as A,K as Ie,L as ee,Mc as O,Pa as d,Pb as m,Qb as T,R as Me,Rb as f,Sb as De,Tb as ye,Vb as N,W as c,Xb as C,aa as I,cb as w,g as Ce,gc as $e,hb as Le,jc as G,la as _,lc as be,m as Ne,mc as ve,na as x,oc as te,pc as ie,qc as oe,sb as g,tb as F,v as ae,w as he,wc as Ae,xc as Ge,yb as E,z as Re,zb as r}from"./chunk-26Z7TPJB.js";function rt(s,t){s&1&&(r(0,"p"),f(1,3),a())}function at(s,t){s&1&&(r(0,"sh-form-field")(1,"label",11),f(2,4),a(),p(3,"input",12),a())}var et=new U,ot=()=>et.group({passphrase:et.control("")}),ce=class s{#e=c(q);#t=c(y);#n=c(L);#o=c(M);encryptionForm=this.#t.encryptionForm;creatingTemporaryBackup=_(!1);settings=_([]);hasEncryptedBackup=O(()=>{let t=this.#t.destinationTestSignal();return t==="testing"||typeof t=="string"?!0:t?.containsEncryptedBackupFiles??!0});showEncryptionField=_(!1);next(){let t=this.#t.destinationTargetUrl();if(!t)throw new Error("No target URL");this.creatingTemporaryBackup.set(!0);let e=this.encryptionForm.value?.passphrase??null,i=[];e?i.push({Name:"--passphrase",Value:e}):i.push({Name:"--no-encryption",Value:"true"}),this.settings().forEach(o=>{let n=o.Name?.trim();n&&n!=="--"&&(n.startsWith("--")||(n=`--${n}`),i.push({Name:n,Value:o.Value??""}))}),this.#e.postApiV1Backups({requestBody:{Backup:{TargetURL:t,Settings:i}},temporary:!0}).pipe(R(()=>this.creatingTemporaryBackup.set(!1))).subscribe({next:o=>{let n=o.ID;this.#n.navigate([`/restore-draft/${n}`])},error:o=>{console.error(o)}})}back(){this.#t.isFileRestore()?this.#n.navigate(["destination"],{relativeTo:this.#o.parent}):this.#t.exit()}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=w({type:s,selectors:[["app-restore-encryption"]],decls:14,vars:5,consts:()=>{let t;t=$localize`Advanced options`;let e;e=$localize`${"\uFFFD#10\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let i;i=$localize`${"\uFFFD#13\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#13\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let o;o=$localize`The backup does not contain encrypted files.`;let n;n=$localize`Enter backup passphrase if defined.`;let l;return l=$localize`Password`,[t,e,i,o,l,[3,"submit","formGroup"],["title",""],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],["for","password"],["type","password","id","password","placeholder",n,"formControlName","passphrase"]]},template:function(e,i){e&1&&(r(0,"form",5),N("submit",function(){return i.next()}),g(1,rt,2,0,"p"),g(2,at,4,0,"sh-form-field"),r(3,"sh-toggle-card"),b(4,6),f(5,0),v(),r(6,"app-options-list",7),oe("optionsChange",function(n){return ie(i.settings,n)||(i.settings=n),n}),a()(),r(7,"div",8)(8,"button",9),N("click",function(){return i.back()}),m(9,1),p(10,"sh-icon"),T(),a(),r(11,"button",10),m(12,2),p(13,"sh-icon"),T(),a()()()),e&2&&(E("formGroup",i.encryptionForm),d(),F(i.hasEncryptedBackup()?-1:1),d(),F(i.hasEncryptedBackup()||i.showEncryptionField()?2:-1),d(4),te("options",i.settings),E("hasFreeTextSettings",!0))},dependencies:[Y,z,B,V,W,X,J,ze,H,j,Ye,Ze],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var lt=()=>({standalone:!0});function _t(s,t){s&1&&p(0,"sh-progress-bar",8)}function ct(s,t){if(s&1&&(G(0),le(1,"bytes")),s&2){let e=C().$implicit;be(" (",ke(1,1,e.FileSizes),") ")}}function pt(s,t){s&1&&(r(0,"span",16),f(1,4),a())}function ut(s,t){if(s&1&&(r(0,"div",15),G(1),le(2,"date"),g(3,ct,2,3),g(4,pt,2,0,"span",16),a()),s&2){let e=t.$implicit;d(),ve(" ",e.Version,": ",xe(2,4,e.Time,"medium")," "),d(2),F(e.FileSizes?3:-1),d(),F(e.IsFullBackup===!1?4:-1)}}function dt(s,t){s&1&&p(0,"sh-progress-bar",8)}function mt(s,t){if(s&1){let e=A();r(0,"app-file-tree",17),N("hasExtendedData",function(o){P(e);let n=C(2);return I(n.extendedDataType.set(o))}),r(1,"label",18),f(2,5),a(),p(3,"input",19),a()}if(s&2){let e=C(2);E("rootPaths",e.rootPaths())("initialNodes",e.initialNodes())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)("loadExtendedData",!0)}}function Tt(s,t){if(s&1){let e=A();r(0,"sh-select",12),N("cleared",function(){P(e);let o=C();return I(o.abortLoading())}),r(1,"input",13),oe("ngModelChange",function(o){P(e);let n=C();return ie(n.selectOption,o)||(n.selectOption=o),I(o)}),a(),Le(2,ut,5,7,"ng-template"),a(),g(3,dt,1,0,"sh-progress-bar",8),g(4,mt,4,6,"app-file-tree",14)}if(s&2){let e=C();E("options",e.versionOptions())("isClearable",!1),d(),te("ngModel",e.selectOption),E("ngModelOptions",Ge(6,lt)),d(2),F(e.isRepairing()||e.versionOptionsLoading()||e.loadingRootPath()?3:-1),d(),F(e.showFileTree()?4:-1)}}var ue=new U,nt=()=>ue.group({filesToRestore:ue.control(""),passphrase:ue.control(null)}),de=class s{#e=c(q);#t=c(y);#n=c(qe);#o=c(K);#i=c(L);#s=c(M);#a=c(ne);#l=null;#_=null;#r=_([]);selectFilesForm=this.#t.selectFilesForm;selectFilesFormSignal=this.#t.selectFilesFormSignal;selectOption=this.#t.selectOption;backupId=this.#t.backupId;versionOptionsLoading=this.#t.versionOptionsLoading;versionOptions=this.#t.versionOptions;isFileRestore=this.#t.isFileRestore;extendedDataType=this.#t.extendedDataType;needsDatabaseRepair=O(()=>this.#t.backup()?.Backup?.IsTemporary??!0);showFileTree=_(!1);backupSettings=_(null);rootPaths=_([]);initialNodes=_([]);loadingRootPath=_(!1);isRepairing=O(()=>this.#r().length>0);loadedVersions=_({});loadingEffect=x(()=>{if(this.versionOptionsLoading())return;let e=this.versionOptions();if(e&&e?.length>0){let i=e[0].Version;this.selectOption.set(i.toString())}});backupSettingsEffect=x(()=>{let t=this.backupId(),e=this.selectOption(),i=this.isRepairing(),o=this.loadedVersions();if(!e||!t)return;let l=this.versionOptions()?.find(Z=>Z.Version===parseInt(e))?.Time??null;if(!l)return;let u=`${t}+${l}`,h=o[u];if(this.needsDatabaseRepair()&&(!h||i))return;let $={id:t+"",time:l};this.backupSettings.set($),this.getRootPath($)});repairEffect=x(()=>{if(!this.needsDatabaseRepair())return;let t=this.selectOption(),e=this.versionOptions();if(t){let i=e.find(l=>l.Version===parseInt(t));if(i===void 0)return;let o=this.backupId(),n=`${o}+${i.Time}`;if(this.#_===n||(this.#_=n,this.#r().includes(n)))return;this.#r.update(l=>[...l,n]),this.#e.postApiV1BackupByIdRepairupdate({id:o,requestBody:{only_paths:!0,time:i.Time}}).pipe(ee(this.abortLoading$),R(()=>{this.#_=null})).subscribe(l=>{let u=l.ID;this.#n.waitForTaskToComplete(u).pipe(Q(1)).subscribe(()=>{this.#r.update(h=>h.filter($=>$!==n)),this.loadedVersions.update(h=>(h[n]=!0,h))})})}});getRootPath(t){let e={id:t.id+"",time:t.time,prefixOnly:!0,folderContents:!1},i=t.id+"";this.isRepairing()||this.#l===i||(this.#l=i,this.loadingRootPath.set(!0),this.showFileTree.set(!1),this.#o.hasV2ListOperations()?this.#e.postApiV2BackupListFolder({requestBody:{BackupId:t.id,Time:t.time,Paths:null,PageSize:0,Page:0}}).pipe(ee(this.abortLoading$),R(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1),this.#l=null})).subscribe({next:o=>{let n=(o.Data??[]).map(l=>l.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}):this.#e.getApiV1BackupByIdFiles(e).pipe(ee(this.abortLoading$),R(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1)})).subscribe({next:o=>{let n=o.Files.map(l=>l.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}))}abortLoading$=new Ce;abortLoading(){this.showFileTree.set(!1),this.loadingRootPath.set(!1),this.abortLoading$.next(!0)}displayFn(){let t=this.versionOptions();return e=>{if(!e)return"";let i=t?.find(o=>typeof o.Version=="number"&&o.Version.toString()===e);return i?`${i.Version}: ${this.#a.transform(i.Time,"medium")}`:""}}next(){this.#i.navigate(["options"],{relativeTo:this.#s.parent})}back(){this.#t.isFileRestore()?this.#i.navigate(["encryption"],{relativeTo:this.#s.parent}):this.#t.exit()}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=w({type:s,selectors:[["app-select-files"]],features:[Ae([ne])],decls:13,vars:3,consts:()=>{let t;t=$localize`Select files`;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let o;o=$localize`Select an option...`;let n;n=$localize`(partial)`;let l;return l=$localize`Path`,[["formRef",""],t,e,i,n,l,[3,"submit","formGroup"],[1,"title-30"],[1,"indeterminate","primary"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],["value","Version",3,"cleared","options","isClearable"],["type","text","placeholder",o,3,"ngModelChange","ngModel","ngModelOptions"],[3,"rootPaths","initialNodes","backupSettings","multiSelect","showFiles","loadExtendedData"],[1,"custom-option"],[1,"partial"],[3,"hasExtendedData","rootPaths","initialNodes","backupSettings","multiSelect","showFiles","loadExtendedData"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]]},template:function(e,i){if(e&1){let o=A();r(0,"form",6,0),N("submit",function(){return P(o),I(i.next())}),r(2,"h3",7),f(3,1),a(),g(4,_t,1,0,"sh-progress-bar",8)(5,Tt,5,7),r(6,"div",9)(7,"button",10),N("click",function(){return P(o),I(i.back())}),m(8,2),p(9,"sh-icon"),T(),a(),r(10,"button",11),m(11,3),p(12,"sh-icon"),T(),a()()()}e&2&&(E("formGroup",i.selectFilesForm),d(4),F(i.versionOptionsLoading()?4:5),d(5),De(i.isFileRestore()?"Back":"Exit"),ye(8))},dependencies:[We,z,B,V,W,Be,Y,X,J,re,j,H,Ue,Je,ne,je],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.partial[_ngcontent-%COMP%]{color:var(--base-9);font-style:italic}"],changeDetection:0})};var y=class s{#e=c(L);#t=c(M);#n=c(K);#o=c(se);#i=c(q);backupId=_(null);backup=_(null);destinationTargetUrl=_(null);destinationTestSignal=_(null);selectFilesForm=nt();optionsForm=st();encryptionForm=ot();optionsFormSignal=_e(this.optionsForm.valueChanges);selectFilesFormSignal=_e(this.selectFilesForm.valueChanges);selectOption=_(null);versionOptionsLoading=_(!1);versionOptions=_([]);isSubmitting=_(!1);isFileRestore=_(!1);isFullWidthPage=_(!1);extendedDataType=_(null);alternateRestorePath=_(null);init(t,e=!1){this.backupId.set(t),this.isFileRestore.set(e),this.alternateRestorePath.set(null),this.extendedDataType.set(null),e&&this.#e.navigate(["/restore-from-files/destination"]),e||this.getBackup()}updateTargetUrl(t){this.destinationTargetUrl.set(t)}setAlternateRestorePath(t){this.alternateRestorePath.set(t)}submit(){this.isSubmitting.set(!0);let t=this.backupId();this.backup()?.Backup?.IsTemporary??!1?this.#i.postApiV1BackupByIdCopytotemp({id:this.backupId()??""}).subscribe({next:i=>{this.#s(i.ID??"")},error:i=>this.showErrorDialog($localize`An error occurred while copying the backup to a temporary location: ${i.message}`)}):this.#s(t??"")}showErrorDialog(t){this.#o.open(D,{data:{title:$localize`Error occured`,message:t,confirmText:$localize`OK`,cancelText:void 0},closed:e=>{}})}#s(t){let e=this.optionsForm.value,i=this.selectFilesForm.value,o=this.selectOption(),n=this.versionOptions()?.find(l=>l.Version===(o&&parseInt(o)));this.#i.postApiV1BackupByIdRestore({id:t??"",requestBody:{paths:i.filesToRestore?.split("\0").map(l=>l.endsWith("/")||l.endsWith("\\")?`${l}*`:l)??[],passphrase:i.passphrase??null,time:n?.Time,restore_path:this.alternateRestorePath()??e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!e.includeMetadata}}).pipe(R(()=>this.isSubmitting.set(!1))).subscribe({next:l=>{this.#e.navigate([`./${l.ID}`,"progress"],{relativeTo:this.#t})},error:l=>{console.error("restore error",l)}})}exit(){this.#o.open(D,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:t=>{t&&(this.#a(),this.#e.navigate(["/"]))}})}getVersionOptions(){this.versionOptions()}loadFilesetsWithRetryv2(t,e=2){return this.#i.postApiV2BackupListFilesets({requestBody:{BackupId:t}}).pipe(Re(i=>{let o=i?.error?.body?.StatusCode??i?.error?.requestBody?.StatusCode;return o==="EncryptedStorageNoPassphrase"||o==="FolderMissing"||o==="EmptyRemoteFolder"||e===0?Ne(()=>i):he(1e3).pipe(Ie(()=>this.loadFilesetsWithRetryv2(t,e-1)))}))}getBackup(){let t=this.backupId();this.versionOptionsLoading.set(!0),this.#n.hasV2ListOperations()?ae([this.#i.getApiV1BackupById({id:t}),this.loadFilesetsWithRetryv2(t)]).pipe(Q(1),R(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([e,i])=>{if(i.Error)throw new Error(i.Error);if(!(e.Backup?.IsTemporary??!0)&&e?.Backup?.DBPathExists===!1){this.#o.open(D,{data:{title:$localize`Missing Local Database`,message:$localize`The local database for this backup is missing. Please repair or recreate the local database before restoring.`,confirmText:$localize`OK`,cancelText:void 0},closed:n=>{this.#e.navigate(["/backup",t,"database"])}});return}this.versionOptions.set((i.Data??[]).map(n=>({Version:n.Version??-1,IsFullBackup:n.IsFullBackup??void 0,Time:n.Time??"<missing>",FileCount:n.FileCount??void 0,FileSizes:n.FileSizes??void 0}))),this.backup.set(e)},error:e=>{let i=e?.error?.body?.StatusCode??e?.error?.requestBody?.StatusCode,o=i==="EncryptedStorageNoPassphrase",n=i==="FolderMissing",l=i==="EmptyRemoteFolder",u=$localize`An error occurred while loading the backup filesets: ${e.message}`;o&&(u=$localize`The remote storage is encrypted. Please enter the passphrase to access the backup.`),n&&(u=$localize`The backup storage folder was not found.`),l&&(u=$localize`The backup storage folder does not contain any filesets.`),this.#o.open(D,{data:{title:$localize`Failed to load backup filesets`,message:u,confirmText:$localize`OK`,cancelText:void 0},closed:h=>{this.#e.navigate([o?"/restore-from-files/encryption":"/restore-from-files/destination"])}})}}):ae([this.#i.getApiV1BackupById({id:t}),this.#i.getApiV1BackupByIdFilesets({id:t}).pipe(Pe(3))]).pipe(Q(1),R(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([e,i])=>{this.versionOptions.set(i.map(o=>({Version:o.Version??-1,IsFullBackup:(o.IsFullBackup??1)==1,Time:o.Time??"<missing>",FileCount:o.FileCount??void 0,FileSizes:o.FileSizes??void 0}))),this.backup.set(e)}})}#a(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||s)};static \u0275prov=Me({token:s,factory:s.\u0275fac,providedIn:"root"})};function St(s,t){if(s&1&&(r(0,"app-file-tree",29)(1,"label",31),G(2,"Path"),a(),p(3,"input",32),a()),s&2){let e,i=C(2);E("disabled",((e=i.optionsFormSignal())==null?null:e.restoreFrom)!=="pickLocation")("enableCreateFolder",!0)}}function Et(s,t){if(s&1&&(r(0,"app-file-tree",30)(1,"label",31),G(2,"Path"),a(),p(3,"input",32),a()),s&2){let e=C(2);E("office365Mode",!0)("backupId",e.backupId())("sourcePrefix",e.office365SourcePrefix())("destinationUrl",e.office365destinationUrl())}}function gt(s,t){if(s&1){let e=A();r(0,"sh-radio",25),m(1,5),p(2,"input",26),T(),a(),r(3,"sh-radio",25),m(4,6),r(5,"input",27),N("click",function(){P(e);let o=C();return I(o.chooseOfficeTenant())}),a(),T(),a(),r(6,"sh-radio",25),m(7,7),p(8,"input",28),T(),a(),g(9,St,4,2,"app-file-tree",29),g(10,Et,4,4,"app-file-tree",30)}if(s&2){let e,i=C();d(9),F(((e=i.optionsFormSignal())==null?null:e.restoreFrom)==="pickLocation"?9:-1),d(),F(i.showOffice365RestoreTree()?10:-1)}}function Ft(s,t){if(s&1&&(r(0,"sh-radio",25),m(1,8),p(2,"input",33),T(),a(),r(3,"sh-radio",25),m(4,9),p(5,"input",28),T(),a(),r(6,"app-file-tree",29)(7,"label",31),G(8,"Path"),a(),p(9,"input",32),a()),s&2){let e,i=C();d(6),E("disabled",((e=i.optionsFormSignal())==null?null:e.restoreFrom)!=="pickLocation")("enableCreateFolder",!0)}}function ft(s,t){s&1&&(r(0,"app-toggle-card",20),b(1,21),f(2,10),v(),r(3,"sh-toggle",25),m(4,11),p(5,"input",34),T(),a()()),s&2&&E("disallowToggle",!0)}function Ot(s,t){s&1&&(r(0,"app-toggle-card",20),b(1,21),f(2,12),v(),r(3,"sh-radio",25),m(4,13),p(5,"input",35),T(),a(),r(6,"sh-radio",25),m(7,14),p(8,"input",36),T(),a()(),r(9,"app-toggle-card"),b(10,21),f(11,15),v(),r(12,"sh-toggle",37),m(13,16),p(14,"input",38),T(),a(),r(15,"sh-toggle",37),m(16,17),p(17,"input",39),T(),a()()),s&2&&E("disallowToggle",!0)}var k=new U,st=()=>k.group({restoreFrom:k.control("original"),restoreFromPath:k.control(""),handleExisting:k.control("saveTimestamp"),permissions:k.control(!1),includeMetadata:k.control(!0),officeIgnoreExisting:k.control(!1)}),me=class s{#e=c(y);#t=c(L);#n=c(M);#o=c(K);#i=c(se);optionsForm=this.#e.optionsForm;optionsFormSignal=this.#e.optionsFormSignal;isSubmitting=this.#e.isSubmitting;extendedData=this.#e.extendedDataType;office365CustomTargetUrl=_(null);backupId=O(()=>this.#e.backup()?.Backup?.ID??null);hasOffice365Data=O(()=>this.extendedData()==="o365");office365SourceEntry=O(()=>this.#e.backup()?.Backup?.Sources?.filter(t=>t.startsWith("@")&&t.includes("|office365"))[0]??null);office365SourceUrl=O(()=>this.office365SourceEntry()?.split("|")[1]??null);office365SourcePrefix=O(()=>this.office365SourceEntry()?.split("|")[0]??null);office365destinationUrl=O(()=>{let t=this.optionsFormSignal()?.restoreFrom,e=this.hasOffice365Data();return t==="same-o365"&&e?this.office365SourceUrl():t==="other-o365"&&e?this.office365CustomTargetUrl():null});showOffice365RestoreTree=O(()=>!!(this.optionsFormSignal()?.restoreFrom==="same-o365"&&this.office365destinationUrl()&&this.backupId()||this.optionsFormSignal()?.restoreFrom==="other-o365"&&this.office365destinationUrl()));isOffice365Restore=O(()=>{let t=this.optionsFormSignal()?.restoreFrom;return t==="same-o365"||t==="other-o365"});chooseOfficeTenant(){return this.#i.open(Qe,{maxWidth:"700px",maxHeight:"80vh",width:"100%",closeOnOutsideClick:!1,data:{targetUrlModel:this.office365CustomTargetUrl()||this.office365SourceUrl()||"office365://",moduleType:"RestoreDestinationProvider",askToCreate:!0,expectedResult:"any",suppressErrorDialogs:!0,backupId:this.backupId(),sourcePrefix:this.office365SourcePrefix()}}).closed.subscribe(e=>{e&&(this.office365CustomTargetUrl.set(e),this.optionsForm.controls.restoreFrom.setValue("other-o365"))}),!1}#s=x(()=>{let t=this.optionsFormSignal()?.restoreFrom;this.hasOffice365Data()&&(t==="original"||t===void 0)&&(this.optionsForm.controls.restoreFrom.setValue("pickLocation"),this.optionsForm.controls.handleExisting.setValue("overwrite")),!this.hasOffice365Data()&&(t==="same-o365"||t==="other-o365")&&(this.optionsForm.controls.restoreFrom.setValue("original"),this.optionsForm.controls.handleExisting.setValue("saveTimestamp"))});goBack(){this.#t.navigate(["select-files"],{relativeTo:this.#n.parent})}submit(){let t=this.#e.selectFilesFormSignal()?.filesToRestore??[];if(t.length>0&&this.optionsFormSignal()?.restoreFrom=="original"&&(t[0].includes("/")?"/":"\\")!==this.#o.systemInfo()?.DirectorySeparator){this.#i.open(D,{data:{title:$localize`Confirm target folder`,message:$localize`This backup was created on another operating system. Restoring files without specifying a destination folder can cause files to be restored in unexpected places. Are you sure you want to continue without choosing a destination folder?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:o=>{o&&this.#e.submit()}});return}if(this.optionsFormSignal()?.restoreFrom==="same-o365"||this.optionsFormSignal()?.restoreFrom==="other-o365"){let i=this.optionsFormSignal()?.restoreFromPath;if(i&&i.startsWith("/")&&(i=i.substring(1)),!i||i.trim()===""){this.#i.open(D,{data:{title:$localize`No path specified`,message:$localize`Please choose a path to restore to in the Office 365 tenant.`,confirmText:$localize`OK`,cancelText:void 0}});return}let o=this.optionsFormSignal()?.officeIgnoreExisting,n=this.office365destinationUrl()?.substring(this.office365destinationUrl().indexOf("?")),l=`@office365://${i}${n}&office365-ignore-existing=${o?"true":"false"}`;this.#e.setAlternateRestorePath(l),this.optionsForm.controls.includeMetadata.setValue(!0),this.optionsForm.controls.permissions.setValue(!0)}else this.#e.setAlternateRestorePath(null);this.#e.submit()}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=w({type:s,selectors:[["app-advanced-options-settings"]],decls:18,vars:6,consts:()=>{let t;t=$localize`Restore options`;let e;e=$localize`Where do you want to restore files to?`;let i;i=$localize`${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `;let n;n=$localize` Same Office 365 Tenant ${"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"}:TAG_INPUT:`;let l;l=$localize` Different Office 365 Tenant ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let u;u=$localize` Local file system ${"\uFFFD#8\uFFFD\uFFFD/#8\uFFFD"}:TAG_INPUT:`;let h;h=$localize` Original location ${"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"}:TAG_INPUT:`;let $;$=$localize` Pick location ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let Z;Z=$localize`Restore settings`;let Te;Te=$localize` Ignore existing resources in the destination ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let Se;Se=$localize`How do you want to handle existing files?`;let Ee;Ee=$localize` Overwrite ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let ge;ge=$localize` Save different versions with timestamp in file name ${"\uFFFD#8\uFFFD\uFFFD/#8\uFFFD"}:TAG_INPUT:`;let Fe;Fe=$localize`Metadata settings`;let fe;fe=$localize` Restore file metadata ${"\uFFFD#14\uFFFD\uFFFD/#14\uFFFD"}:TAG_INPUT:`;let Oe;return Oe=$localize` Restore read/write permissions ${"\uFFFD#17\uFFFD\uFFFD/#17\uFFFD"}:TAG_INPUT:`,[["formRef",""],t,e,i,o,n,l,u,h,$,Z,Te,Se,Ee,ge,Fe,fe,Oe,[3,"submit","formGroup"],[1,"title-30"],[3,"disallowToggle"],["title",""],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],[1,"raised","primary"],["type","radio","name","restoreFrom","value","same-o365","formControlName","restoreFrom"],["type","radio","name","restoreFrom","value","other-o365","formControlName","restoreFrom",3,"click"],["type","radio","name","restoreFrom","value","pickLocation","formControlName","restoreFrom"],[3,"disabled","enableCreateFolder"],[3,"office365Mode","backupId","sourcePrefix","destinationUrl"],["for","path"],["type","text","id","path","formControlName","restoreFromPath"],["type","radio","name","restoreFrom","value","original","formControlName","restoreFrom"],["type","checkbox","formControlName","officeIgnoreExisting"],["type","radio","name","handleExisting","value","overwrite","formControlName","handleExisting"],["type","radio","name","handleExisting","value","saveTimestamp","formControlName","handleExisting"],[1,"primary","raised"],["type","checkbox","formControlName","includeMetadata"],["type","checkbox","formControlName","permissions"]]},template:function(e,i){if(e&1){let o=A();r(0,"form",18,0),N("submit",function(){return P(o),I(i.submit())}),r(2,"h3",19),f(3,1),a(),r(4,"app-toggle-card",20),b(5,21),f(6,2),v(),g(7,gt,11,2)(8,Ft,10,2),a(),g(9,ft,6,1,"app-toggle-card",20)(10,Ot,18,1),r(11,"div",22)(12,"button",23),N("click",function(){return P(o),I(i.goBack())}),m(13,3),p(14,"sh-icon"),T(),a(),r(15,"button",24),m(16,4),p(17,"sh-icon"),T(),a()()()}e&2&&(E("formGroup",i.optionsForm),d(4),E("disallowToggle",!0),d(3),F(i.hasOffice365Data()?7:8),d(2),F(i.isOffice365Restore()?9:10),d(6),$e("loader",i.isSubmitting()))},dependencies:[Y,z,B,we,Ve,V,W,X,J,Ke,re,He,Xe,j,H],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};export{st as a,me as b,ot as c,ce as d,nt as e,de as f,y as g};
@@ -1 +1 @@
1
- import{e as a,f as b}from"./chunk-K6G7ALTG.js";import"./chunk-OL7C46LY.js";import"./chunk-P3D2ZP6W.js";import"./chunk-HRHF3TYJ.js";import"./chunk-IMHM7ISI.js";import"./chunk-6LAXPU22.js";import"./chunk-6Q6SSTBK.js";import"./chunk-SZUNW4JO.js";import"./chunk-TL4WOQKT.js";import"./chunk-7LTHH6OG.js";import"./chunk-HSHF5HR7.js";import"./chunk-D6IP567E.js";import"./chunk-VDSX2M4H.js";import"./chunk-ZU6T3TW3.js";import"./chunk-HUZXJWCG.js";import"./chunk-7TWUW4XJ.js";import"./chunk-UNMDSCAN.js";import"./chunk-CFNARBNK.js";import"./chunk-I27PVH6D.js";import"./chunk-5VE6P5U5.js";import"./chunk-PO3L6MKW.js";import"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.js";import"./chunk-26Z7TPJB.js";import"./chunk-7CGTOI24.js";export{a as createRestoreSelectFilesForm,b as default};
1
+ import{e as a,f as b}from"./chunk-4I55TVYE.js";import"./chunk-TXFTUL4R.js";import"./chunk-TN6HBIUN.js";import"./chunk-K34VOGDF.js";import"./chunk-IMHM7ISI.js";import"./chunk-6LAXPU22.js";import"./chunk-6Q6SSTBK.js";import"./chunk-SZUNW4JO.js";import"./chunk-TL4WOQKT.js";import"./chunk-7LTHH6OG.js";import"./chunk-HSHF5HR7.js";import"./chunk-D6IP567E.js";import"./chunk-VDSX2M4H.js";import"./chunk-ZU6T3TW3.js";import"./chunk-HUZXJWCG.js";import"./chunk-7TWUW4XJ.js";import"./chunk-UNMDSCAN.js";import"./chunk-CFNARBNK.js";import"./chunk-I27PVH6D.js";import"./chunk-5VE6P5U5.js";import"./chunk-PO3L6MKW.js";import"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.js";import"./chunk-26Z7TPJB.js";import"./chunk-7CGTOI24.js";export{a as createRestoreSelectFilesForm,b as default};
@@ -1 +1 @@
1
- import{g as pe}from"./chunk-K6G7ALTG.js";import"./chunk-OL7C46LY.js";import{i as de,j as Se,k as Ee,l as ue,p as Ce}from"./chunk-P3D2ZP6W.js";import"./chunk-HRHF3TYJ.js";import{b as Te,c as ge}from"./chunk-IMHM7ISI.js";import"./chunk-6LAXPU22.js";import"./chunk-6Q6SSTBK.js";import"./chunk-SZUNW4JO.js";import"./chunk-TL4WOQKT.js";import"./chunk-7LTHH6OG.js";import{a as M}from"./chunk-HSHF5HR7.js";import"./chunk-D6IP567E.js";import"./chunk-VDSX2M4H.js";import"./chunk-ZU6T3TW3.js";import"./chunk-HUZXJWCG.js";import"./chunk-7TWUW4XJ.js";import{B as le,H as _e,K as ce,c as Q,e as Y,f as Z,g as ee,i as te,j as ne,s as ie,u as oe,w as re,y as ae,z as se}from"./chunk-UNMDSCAN.js";import"./chunk-CFNARBNK.js";import{b as j,d as q}from"./chunk-I27PVH6D.js";import"./chunk-5VE6P5U5.js";import"./chunk-PO3L6MKW.js";import"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.js";import{$ as l,Ab as a,Bb as O,Fb as V,Gb as W,Ib as E,Mc as $,Pa as T,Pb as u,Qb as C,Rb as I,Sc as w,Ub as z,Vb as d,W as m,Xb as c,aa as _,cb as B,cc as J,da as v,dc as X,jc as P,la as N,oc as f,pc as R,qc as h,rc as A,sb as p,sc as y,tb as F,tc as L,wc as H,xc as K,yb as D,zb as r}from"./chunk-26Z7TPJB.js";import"./chunk-7CGTOI24.js";var Fe=["formRef"],Oe=["testUrl"],me=()=>({maxWidth:"700px",width:"100%"});function Re(o,i){if(o&1){let e=E();r(0,"button",24),d("click",function(){l(e);let t=c();return _(t.openTargetUrlDialog())}),u(1,5),O(2,"sh-icon"),C(),a()}}function Ne(o,i){if(o&1){let e=E();r(0,"button",24),d("click",function(){l(e);let t=c(2);return _(t.copyTargetUrl())}),u(1,7),O(2,"sh-icon"),C(),a()}}function De(o,i){if(o&1){let e=E();r(0,"sh-menu")(1,"button",15)(2,"sh-icon"),P(3,"dots-three-vertical"),a()(),V(4,25),r(5,"button",24),d("click",function(){l(e);let t=c();return _(t.openTargetUrlDialog())}),u(6,6),O(7,"sh-icon"),C(),a(),p(8,Ne,3,0,"button",15),W(),a()}if(o&2){c();let e=L(0);T(8),F(e?8:-1)}}function Ie(o,i){if(o&1){let e=E();r(0,"app-destination-list-item",17)(1,"button",20),d("click",function(){l(e);let t=c();return _(t.removeDestination())}),I(2,8),a()()}if(o&2){c();let e=L(12);D("destination",e)}}function fe(o,i){if(o&1){let e=E();r(0,"app-destination-list",26),d("setDestination",function(t){l(e);let s=c();return _(s.setDestination(t))}),a()}}function he(o,i){if(o&1){let e=E();r(0,"app-single-destination",27),h("targetUrlChange",function(t){l(e);let s=c();return R(s.targetUrlModel,t)||(s.targetUrlModel=t),_(t)}),a()}if(o&2){let e=c();f("targetUrl",e.targetUrlModel)}}function Me(o,i){o&1&&(u(0,4,1),O(1,"sh-icon",22),C())}function Pe(o,i){o&1&&(u(0,4,2),O(1,"sh-icon"),C())}function Ae(o,i){if(o&1){let e=E();r(0,"sh-dialog",28),h("isOpenChange",function(t){l(e);let s=c();return R(s.targetUrlDialogOpen,t)||(s.targetUrlDialogOpen=t),_(t)}),r(1,"header",29)(2,"div",30)(3,"h2"),I(4,9),a(),r(5,"sh-alert",31),I(6,10),a()()(),r(7,"div",32)(8,"sh-form-field")(9,"textarea",33),h("ngModelChange",function(t){l(e);let s=c();return R(s.targetUrlCtrl,t)||(s.targetUrlCtrl=t),_(t)}),a()()(),r(10,"footer",34)(11,"button",20),d("click",function(){l(e);let t=c();return _(t.closeTargetUrlDialog(!1))}),P(12,"Cancel"),a(),r(13,"button",35),d("click",function(){l(e);let t=c();return _(t.closeTargetUrlDialog(!0))}),u(14,11),O(15,"sh-icon"),C(),a()()()}if(o&2){let e=c();f("isOpen",e.targetUrlDialogOpen),D("options",K(3,me)),T(9),f("ngModel",e.targetUrlCtrl)}}var x=class o{#i=m(q);#o=m(j);#n=m(se);injector=m(v);#e=m(pe);formRef=w.required("formRef");testUrlComponent=w.required("testUrl");testSignal=this.#e.destinationTestSignal;targetUrlModel=this.#e.destinationTargetUrl;targetUrlCtrl=N(null);targetUrlInitial=N(null);targetUrlDialogOpen=N(!1);toggleNewDestination=N(!0);selectedDestinationType=$(()=>{let i=this.#e.destinationTargetUrl();return i?Te(i):null});selectedDestinationTypeOption=$(()=>{let i=this.selectedDestinationType();return i?{key:i.customKey??i.key,customKey:i.customKey??null,displayName:i.displayName,description:i.description,icon:i.icon}:null});copyTargetUrl(){navigator.clipboard.writeText(this.#e.destinationTargetUrl()??"")}openTargetUrlDialog(){let i=this.#e.destinationTargetUrl();this.targetUrlCtrl.set(i),this.targetUrlInitial.set(i),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(i=!1){this.targetUrlDialogOpen.set(!1);let e=this.targetUrlCtrl(),n=this.targetUrlInitial();!i||e===n||!e||this.#e.updateTargetUrl(e)}setDestination(i){let e=ge(i??"");if(e){if(e.mapper.default){let n=e.mapper.default("");this.#e.updateTargetUrl(n);return}this.#e.updateTargetUrl(`${i}://`)}}removeDestination(){this.#e.updateTargetUrl(null)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let i=this.testSignal();if(i===null){this.#n.open(M,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:n=>{n?this.testUrlComponent()?.testDestination(!1)?.then(t=>{t.action==="success"&&t.containsBackup?this.#t():this.#n.open(M,{data:{title:$localize`Test did not succeed`,message:t.errorMessage??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#t()}});return}let e=typeof i=="string"?null:i;if(e?.action!=="success"||!e.containsBackup){this.#n.open(M,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Edit destination`,cancelText:$localize`Yes, continue`},closed:n=>{n||this.#t()}});return}this.#t()}#t(){this.#i.navigate(["encryption"],{relativeTo:this.#o.parent})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=B({type:o,selectors:[["app-restore-destination"]],viewQuery:function(e,n){e&1&&J(n.formRef,Fe,5)(n.testUrlComponent,Oe,5),e&2&&X(2)},features:[H([Ce])],decls:25,vars:15,consts:()=>{let i;i=$localize`Backup destination`;let e;e=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let n;n=$localize`${"\uFFFD*22:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*22:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*23:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*23:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,n=z(n);let t;t=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Set target URL `;let s;s=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: Edit target URL `;let g;g=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:copy${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Copy URL to clipboard `;let U;U=$localize`Change`;let G;G=$localize`Edit target URL`;let b;b=$localize`Be careful, this will overwrite everything you have in your destination.`;let k;return k=$localize` Override target URL ${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],["testUrl",""],i,e,n,t,s,g,U,G,b,k,[3,"submit"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small"],[3,"targetUrlChange","testSignalChange","targetUrl","testSignal","suppressErrorDialogs","askToCreate","testExpectation","moduleType"],[1,"current-destination",3,"destination"],[3,"targetUrl"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click"],["menu",""],[3,"setDestination"],[3,"targetUrlChange","targetUrl"],[3,"isOpenChange","isOpen","options"],["header",""],[1,"target-dialog-header"],[1,"warn"],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(e,n){if(e&1){let t=E();A(0),r(1,"form",12,0),d("submit",function(){return l(t),_(n.next())}),r(3,"header")(4,"h3",13)(5,"span"),I(6,2),a(),r(7,"div",14),p(8,Re,3,0,"button",15)(9,De,9,1,"sh-menu"),a()(),r(10,"app-test-url",16,1),h("targetUrlChange",function(g){return l(t),R(n.targetUrlModel,g)||(n.targetUrlModel=g),_(g)})("testSignalChange",function(g){return l(t),R(n.testSignal,g)||(n.testSignal=g),_(g)}),a(),A(12),p(13,Ie,3,1,"app-destination-list-item",17),a(),p(14,fe,1,0,"app-destination-list"),p(15,he,1,1,"app-single-destination",18),r(16,"div",19)(17,"button",20),d("click",function(){return l(t),_(n.goBack())}),u(18,3),O(19,"sh-icon"),C(),a(),r(20,"button",21),u(21,4),p(22,Me,2,0,"sh-icon",22)(23,Pe,2,0,"sh-icon"),C(),a()()(),p(24,Ae,16,4,"sh-dialog",23)}if(e&2){let t=y(!!n.targetUrlModel());T(8),F(t?9:8),T(2),f("targetUrl",n.targetUrlModel)("testSignal",n.testSignal),D("suppressErrorDialogs",!1)("askToCreate",!1)("testExpectation","containsBackup")("moduleType","Backend"),T(2);let s=y(n.selectedDestinationTypeOption());T(),F(s?13:-1),T(),F(t?-1:14),T(),F(t?15:-1),T(5),D("disabled",n.testSignal()=="testing"||!t),T(2),F(n.testSignal()=="testing"?22:23),T(2),F(n.targetUrlDialogOpen()?24:-1)}},dependencies:[Ee,Se,de,ie,ne,Q,Y,Z,te,ee,le,_e,ce,oe,ae,re,ue],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}pre[_ngcontent-%COMP%]{white-space:pre-wrap}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.field-row.single-field[_ngcontent-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-8)}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-8)}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}.target-dialog-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:.5rem}"],changeDetection:0})};export{x as default};
1
+ import{g as pe}from"./chunk-4I55TVYE.js";import"./chunk-TXFTUL4R.js";import{i as de,j as Se,k as ue,l as Ee,p as Ce}from"./chunk-TN6HBIUN.js";import"./chunk-K34VOGDF.js";import{b as Te,c as ge}from"./chunk-IMHM7ISI.js";import"./chunk-6LAXPU22.js";import"./chunk-6Q6SSTBK.js";import"./chunk-SZUNW4JO.js";import"./chunk-TL4WOQKT.js";import"./chunk-7LTHH6OG.js";import{a as M}from"./chunk-HSHF5HR7.js";import"./chunk-D6IP567E.js";import"./chunk-VDSX2M4H.js";import"./chunk-ZU6T3TW3.js";import"./chunk-HUZXJWCG.js";import"./chunk-7TWUW4XJ.js";import{B as le,H as _e,K as ce,c as Q,e as Y,f as Z,g as ee,i as te,j as ne,s as ie,u as oe,w as re,y as ae,z as se}from"./chunk-UNMDSCAN.js";import"./chunk-CFNARBNK.js";import{b as j,d as q}from"./chunk-I27PVH6D.js";import"./chunk-5VE6P5U5.js";import"./chunk-PO3L6MKW.js";import"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.js";import{$ as l,Ab as a,Bb as O,Fb as V,Gb as W,Ib as u,Mc as $,Pa as T,Pb as E,Qb as C,Rb as I,Sc as w,Ub as z,Vb as d,W as m,Xb as c,aa as _,cb as B,cc as J,da as v,dc as X,jc as P,la as N,oc as f,pc as R,qc as h,rc as A,sb as p,sc as y,tb as F,tc as L,wc as H,xc as K,yb as D,zb as r}from"./chunk-26Z7TPJB.js";import"./chunk-7CGTOI24.js";var Fe=["formRef"],Oe=["testUrl"],me=()=>({maxWidth:"700px",width:"100%"});function Re(o,i){if(o&1){let e=u();r(0,"button",24),d("click",function(){l(e);let t=c();return _(t.openTargetUrlDialog())}),E(1,5),O(2,"sh-icon"),C(),a()}}function Ne(o,i){if(o&1){let e=u();r(0,"button",24),d("click",function(){l(e);let t=c(2);return _(t.copyTargetUrl())}),E(1,7),O(2,"sh-icon"),C(),a()}}function De(o,i){if(o&1){let e=u();r(0,"sh-menu")(1,"button",15)(2,"sh-icon"),P(3,"dots-three-vertical"),a()(),V(4,25),r(5,"button",24),d("click",function(){l(e);let t=c();return _(t.openTargetUrlDialog())}),E(6,6),O(7,"sh-icon"),C(),a(),p(8,Ne,3,0,"button",15),W(),a()}if(o&2){c();let e=L(0);T(8),F(e?8:-1)}}function Ie(o,i){if(o&1){let e=u();r(0,"app-destination-list-item",17)(1,"button",20),d("click",function(){l(e);let t=c();return _(t.removeDestination())}),I(2,8),a()()}if(o&2){c();let e=L(12);D("destination",e)}}function fe(o,i){if(o&1){let e=u();r(0,"app-destination-list",26),d("setDestination",function(t){l(e);let s=c();return _(s.setDestination(t))}),a()}}function he(o,i){if(o&1){let e=u();r(0,"app-single-destination",27),h("targetUrlChange",function(t){l(e);let s=c();return R(s.targetUrlModel,t)||(s.targetUrlModel=t),_(t)}),a()}if(o&2){let e=c();f("targetUrl",e.targetUrlModel)}}function Me(o,i){o&1&&(E(0,4,1),O(1,"sh-icon",22),C())}function Pe(o,i){o&1&&(E(0,4,2),O(1,"sh-icon"),C())}function Ae(o,i){if(o&1){let e=u();r(0,"sh-dialog",28),h("isOpenChange",function(t){l(e);let s=c();return R(s.targetUrlDialogOpen,t)||(s.targetUrlDialogOpen=t),_(t)}),r(1,"header",29)(2,"div",30)(3,"h2"),I(4,9),a(),r(5,"sh-alert",31),I(6,10),a()()(),r(7,"div",32)(8,"sh-form-field")(9,"textarea",33),h("ngModelChange",function(t){l(e);let s=c();return R(s.targetUrlCtrl,t)||(s.targetUrlCtrl=t),_(t)}),a()()(),r(10,"footer",34)(11,"button",20),d("click",function(){l(e);let t=c();return _(t.closeTargetUrlDialog(!1))}),P(12,"Cancel"),a(),r(13,"button",35),d("click",function(){l(e);let t=c();return _(t.closeTargetUrlDialog(!0))}),E(14,11),O(15,"sh-icon"),C(),a()()()}if(o&2){let e=c();f("isOpen",e.targetUrlDialogOpen),D("options",K(3,me)),T(9),f("ngModel",e.targetUrlCtrl)}}var x=class o{#i=m(q);#o=m(j);#n=m(se);injector=m(v);#e=m(pe);formRef=w.required("formRef");testUrlComponent=w.required("testUrl");testSignal=this.#e.destinationTestSignal;targetUrlModel=this.#e.destinationTargetUrl;targetUrlCtrl=N(null);targetUrlInitial=N(null);targetUrlDialogOpen=N(!1);toggleNewDestination=N(!0);selectedDestinationType=$(()=>{let i=this.#e.destinationTargetUrl();return i?Te(i):null});selectedDestinationTypeOption=$(()=>{let i=this.selectedDestinationType();return i?{key:i.customKey??i.key,customKey:i.customKey??null,displayName:i.displayName,description:i.description,icon:i.icon}:null});copyTargetUrl(){navigator.clipboard.writeText(this.#e.destinationTargetUrl()??"")}openTargetUrlDialog(){let i=this.#e.destinationTargetUrl();this.targetUrlCtrl.set(i),this.targetUrlInitial.set(i),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(i=!1){this.targetUrlDialogOpen.set(!1);let e=this.targetUrlCtrl(),n=this.targetUrlInitial();!i||e===n||!e||this.#e.updateTargetUrl(e)}setDestination(i){let e=ge(i??"");if(e){if(e.mapper.default){let n=e.mapper.default("");this.#e.updateTargetUrl(n);return}this.#e.updateTargetUrl(`${i}://`)}}removeDestination(){this.#e.updateTargetUrl(null)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let i=this.testSignal();if(i===null){this.#n.open(M,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:n=>{n?this.testUrlComponent()?.testDestination(!1)?.then(t=>{t.action==="success"&&t.containsBackup?this.#t():this.#n.open(M,{data:{title:$localize`Test did not succeed`,message:t.errorMessage??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#t()}});return}let e=typeof i=="string"?null:i;if(e?.action!=="success"||!e.containsBackup){this.#n.open(M,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Edit destination`,cancelText:$localize`Yes, continue`},closed:n=>{n||this.#t()}});return}this.#t()}#t(){this.#i.navigate(["encryption"],{relativeTo:this.#o.parent})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=B({type:o,selectors:[["app-restore-destination"]],viewQuery:function(e,n){e&1&&J(n.formRef,Fe,5)(n.testUrlComponent,Oe,5),e&2&&X(2)},features:[H([Ce])],decls:25,vars:17,consts:()=>{let i;i=$localize`Backup destination`;let e;e=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let n;n=$localize`${"\uFFFD*22:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*22:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*23:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*23:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,n=z(n);let t;t=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Set target URL `;let s;s=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: Edit target URL `;let g;g=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:copy${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Copy URL to clipboard `;let U;U=$localize`Change`;let b;b=$localize`Edit target URL`;let G;G=$localize`Be careful, this will overwrite everything you have in your destination.`;let k;return k=$localize` Override target URL ${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],["testUrl",""],i,e,n,t,s,g,U,b,G,k,[3,"submit"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small"],[3,"targetUrlChange","testSignalChange","targetUrl","testSignal","backupId","sourcePrefix","suppressErrorDialogs","askToCreate","testExpectation","moduleType"],[1,"current-destination",3,"destination"],[3,"targetUrl"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click"],["menu",""],[3,"setDestination"],[3,"targetUrlChange","targetUrl"],[3,"isOpenChange","isOpen","options"],["header",""],[1,"target-dialog-header"],[1,"warn"],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(e,n){if(e&1){let t=u();A(0),r(1,"form",12,0),d("submit",function(){return l(t),_(n.next())}),r(3,"header")(4,"h3",13)(5,"span"),I(6,2),a(),r(7,"div",14),p(8,Re,3,0,"button",15)(9,De,9,1,"sh-menu"),a()(),r(10,"app-test-url",16,1),h("targetUrlChange",function(g){return l(t),R(n.targetUrlModel,g)||(n.targetUrlModel=g),_(g)})("testSignalChange",function(g){return l(t),R(n.testSignal,g)||(n.testSignal=g),_(g)}),a(),A(12),p(13,Ie,3,1,"app-destination-list-item",17),a(),p(14,fe,1,0,"app-destination-list"),p(15,he,1,1,"app-single-destination",18),r(16,"div",19)(17,"button",20),d("click",function(){return l(t),_(n.goBack())}),E(18,3),O(19,"sh-icon"),C(),a(),r(20,"button",21),E(21,4),p(22,Me,2,0,"sh-icon",22)(23,Pe,2,0,"sh-icon"),C(),a()()(),p(24,Ae,16,4,"sh-dialog",23)}if(e&2){let t=y(!!n.targetUrlModel());T(8),F(t?9:8),T(2),f("targetUrl",n.targetUrlModel)("testSignal",n.testSignal),D("backupId",null)("sourcePrefix",null)("suppressErrorDialogs",!1)("askToCreate",!1)("testExpectation","containsBackup")("moduleType","Backend"),T(2);let s=y(n.selectedDestinationTypeOption());T(),F(s?13:-1),T(),F(t?-1:14),T(),F(t?15:-1),T(5),D("disabled",n.testSignal()=="testing"||!t),T(2),F(n.testSignal()=="testing"?22:23),T(2),F(n.targetUrlDialogOpen()?24:-1)}},dependencies:[ue,Se,de,ie,ne,Q,Y,Z,te,ee,le,_e,ce,oe,ae,re,Ee],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}pre[_ngcontent-%COMP%]{white-space:pre-wrap}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.field-row.single-field[_ngcontent-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-8)}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-8)}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}.target-dialog-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:.5rem}"],changeDetection:0})};export{x as default};
@@ -1,3 +1,3 @@
1
- import{a as Ee}from"./chunk-OL7C46LY.js";import{a as Ne}from"./chunk-EE27B3OV.js";import"./chunk-Q74O3CWJ.js";import{h as Te,p as A}from"./chunk-P3D2ZP6W.js";import"./chunk-HRHF3TYJ.js";import"./chunk-IMHM7ISI.js";import"./chunk-6LAXPU22.js";import{b as he}from"./chunk-BFTGDQ4K.js";import"./chunk-QHBOEY2O.js";import"./chunk-NK5WD6WE.js";import"./chunk-B62TPRVG.js";import"./chunk-6Q6SSTBK.js";import"./chunk-SZUNW4JO.js";import"./chunk-TL4WOQKT.js";import"./chunk-7LTHH6OG.js";import"./chunk-HSHF5HR7.js";import"./chunk-5LBG6MOL.js";import"./chunk-D6IP567E.js";import{b as D}from"./chunk-VDSX2M4H.js";import"./chunk-ZU6T3TW3.js";import"./chunk-HUZXJWCG.js";import"./chunk-7TWUW4XJ.js";import{B as ue,G as de,H as _e,L as pe,P as Ce,Y as ge,c as Z,e as ee,f as te,j as ne,n as oe,o as ie,p as ae,q as se,r as re,s as le,t as ce,u as me}from"./chunk-UNMDSCAN.js";import{b as Fe,c as Se}from"./chunk-CFNARBNK.js";import{b as W,d as Q,e as Y}from"./chunk-I27PVH6D.js";import"./chunk-5VE6P5U5.js";import"./chunk-PO3L6MKW.js";import"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.js";import{$ as E,Ab as o,Bb as a,Fb as I,Gb as M,Ib as v,Pa as u,Pb as p,Qb as C,R as b,Rb as O,Sb as x,Tb as w,Vb as K,W as _,Xb as N,aa as f,cb as R,gc as J,la as L,na as $,oc as X,pc as q,qc as V,sb as k,tb as G,ub as B,vc as H,wb as y,wc as z,xb as U,xc as j,yb as F,zb as l}from"./chunk-26Z7TPJB.js";import"./chunk-7CGTOI24.js";var T=class s{#e=new Map;saveState(t){let e=crypto.randomUUID();return this.#e.set(e,t),e}getState(t){return this.#e.get(t)}static \u0275fac=function(e){return new(e||s)};static \u0275prov=b({token:s,factory:s.\u0275fac,providedIn:"root"})};var Ie=()=>["backup"];function Me(s,t){s&1&&a(0,"sh-progress-bar",11)}function Oe(s,t){if(s&1&&(l(0,"sh-form-field"),a(1,"input",35),o()),s&2){let e=t.$implicit,n=t.$index;u(),F("id",H("filter-",n))("formControl",e)}}function De(s,t){if(s&1){let e=v();l(0,"form",12)(1,"sh-select",13)(2,"label",14),p(3,1),a(4,"sh-icon",15),C(),o(),a(5,"input",16),o(),l(6,"sh-form-field")(7,"label",17),p(8,2),a(9,"sh-icon",18),C(),o(),a(10,"textarea",19),o(),l(11,"sh-form-field")(12,"label",20),p(13,3),a(14,"sh-icon",21),C(),o(),a(15,"textarea",22),o()(),l(16,"sh-divider"),O(17,4),o(),l(18,"form",12)(19,"sh-form-field")(20,"label",23),p(21,5),a(22,"sh-icon",24),C(),o(),a(23,"input",25),o(),l(24,"sh-form-field")(25,"label",26),p(26,6),a(27,"sh-icon",27),C(),o(),a(28,"input",28),o(),l(29,"app-toggle-card",29),I(30,30),O(31,7),M(),I(32,31),y(33,Oe,2,3,"sh-form-field",null,B),M(),o()(),l(35,"app-options-list",32),V("optionsChange",function(r){E(e);let m=N();return q(m.settings,r)||(m.settings=r),f(r)}),o(),l(36,"div",33)(37,"button",34),K("click",function(){E(e);let r=N();return f(r.submit())}),p(38,8),a(39,"sh-icon"),C(),o()()}if(s&2){let e=N();F("formGroup",e.baseCmdForm),u(),F("options",e.commandOptions()??j(10,Ie))("inlineSearch",!0),u(17),F("formGroup",e.standardFields),u(11),F("disallowToggle",!0),u(4),U(e.standardFields.controls.filters.controls),u(2),X("options",e.settings),F("hasFreeTextSettings",!0),u(2),J("loader",e.isSubmitting()),u(2),x(e.baseCmdForm.value.command),w(38)}}var c=new re,P=class s{#e=_(A);#n=_(Se);#o=_(Q);#t=_(W);#a=_(Fe);#s=_(he);#i=_(T);#r=D(this.#t.params);commandOptions=D(this.#a.getApiV1Commandline());isSubmitting=L(!1);optionsFields=this.#e.optionsFields;standardFields=c.group({"backup-id":c.control(""),"backup-name":c.control(""),dbpath:c.control(""),filters:c.array([])});baseCmdForm=c.group({command:c.control("backup"),targetUrl:c.control(""),arguments:c.control("")});finishedLoading=this.#e.finishedLoading;backupId=this.#e.backupId;settings=this.#e.settings;#c=$(()=>{let t=this.#r()?.id;this.#e.backupId.set(t),this.getBackup(t)});getBackup(t){this.#n.getApiV1BackupById({id:t}).subscribe({next:e=>{this.#e.mapScheduleToForm(e.Schedule??null),e.Backup&&(this.#e.mapGeneralToForm(e.Backup),this.mapStandardFieldsToForm(e.Backup),this.mapBaseCmdToForm(e.Backup),this.#e.mapOptionsToForms(e.Backup,!0)),this.applyStateFromUrl(),this.#e.finishedLoading.set(!0)}})}mapStandardFieldsToForm(t){this.standardFields.patchValue({dbpath:t.DBPath,"backup-id":t.ID,"backup-name":t.Name}),t.Filters&&t.Filters.length&&t.Filters.map(e=>{this.standardFields.controls.filters.push(c.control(`${e.Include?"":"-"}${e.Expression}`))})}submit(){this.#s.resumeDialogCheck(()=>this.#l())}#l(){this.isSubmitting.set(!0);let t=this.updateUrl(),e=this.baseCmdForm.value,n=e.targetUrl??"",r=(e.arguments??"").split(`
1
+ import{a as Ee}from"./chunk-TXFTUL4R.js";import{a as Ne}from"./chunk-EE27B3OV.js";import"./chunk-Q74O3CWJ.js";import{h as Te,p as A}from"./chunk-TN6HBIUN.js";import"./chunk-K34VOGDF.js";import"./chunk-IMHM7ISI.js";import"./chunk-6LAXPU22.js";import{b as he}from"./chunk-BFTGDQ4K.js";import"./chunk-QHBOEY2O.js";import"./chunk-NK5WD6WE.js";import"./chunk-B62TPRVG.js";import"./chunk-6Q6SSTBK.js";import"./chunk-SZUNW4JO.js";import"./chunk-TL4WOQKT.js";import"./chunk-7LTHH6OG.js";import"./chunk-HSHF5HR7.js";import"./chunk-5LBG6MOL.js";import"./chunk-D6IP567E.js";import{b as D}from"./chunk-VDSX2M4H.js";import"./chunk-ZU6T3TW3.js";import"./chunk-HUZXJWCG.js";import"./chunk-7TWUW4XJ.js";import{B as ue,G as de,H as _e,L as pe,P as Ce,Y as ge,c as Z,e as ee,f as te,j as ne,n as oe,o as ie,p as ae,q as se,r as re,s as le,t as ce,u as me}from"./chunk-UNMDSCAN.js";import{b as Fe,c as Se}from"./chunk-CFNARBNK.js";import{b as W,d as Q,e as Y}from"./chunk-I27PVH6D.js";import"./chunk-5VE6P5U5.js";import"./chunk-PO3L6MKW.js";import"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.js";import{$ as E,Ab as o,Bb as a,Fb as I,Gb as M,Ib as v,Pa as u,Pb as p,Qb as C,R as b,Rb as O,Sb as x,Tb as w,Vb as K,W as _,Xb as N,aa as f,cb as R,gc as J,la as L,na as $,oc as X,pc as q,qc as V,sb as k,tb as G,ub as B,vc as H,wb as y,wc as z,xb as U,xc as j,yb as F,zb as l}from"./chunk-26Z7TPJB.js";import"./chunk-7CGTOI24.js";var T=class s{#e=new Map;saveState(t){let e=crypto.randomUUID();return this.#e.set(e,t),e}getState(t){return this.#e.get(t)}static \u0275fac=function(e){return new(e||s)};static \u0275prov=b({token:s,factory:s.\u0275fac,providedIn:"root"})};var Ie=()=>["backup"];function Me(s,t){s&1&&a(0,"sh-progress-bar",11)}function Oe(s,t){if(s&1&&(l(0,"sh-form-field"),a(1,"input",35),o()),s&2){let e=t.$implicit,n=t.$index;u(),F("id",H("filter-",n))("formControl",e)}}function De(s,t){if(s&1){let e=v();l(0,"form",12)(1,"sh-select",13)(2,"label",14),p(3,1),a(4,"sh-icon",15),C(),o(),a(5,"input",16),o(),l(6,"sh-form-field")(7,"label",17),p(8,2),a(9,"sh-icon",18),C(),o(),a(10,"textarea",19),o(),l(11,"sh-form-field")(12,"label",20),p(13,3),a(14,"sh-icon",21),C(),o(),a(15,"textarea",22),o()(),l(16,"sh-divider"),O(17,4),o(),l(18,"form",12)(19,"sh-form-field")(20,"label",23),p(21,5),a(22,"sh-icon",24),C(),o(),a(23,"input",25),o(),l(24,"sh-form-field")(25,"label",26),p(26,6),a(27,"sh-icon",27),C(),o(),a(28,"input",28),o(),l(29,"app-toggle-card",29),I(30,30),O(31,7),M(),I(32,31),y(33,Oe,2,3,"sh-form-field",null,B),M(),o()(),l(35,"app-options-list",32),V("optionsChange",function(r){E(e);let m=N();return q(m.settings,r)||(m.settings=r),f(r)}),o(),l(36,"div",33)(37,"button",34),K("click",function(){E(e);let r=N();return f(r.submit())}),p(38,8),a(39,"sh-icon"),C(),o()()}if(s&2){let e=N();F("formGroup",e.baseCmdForm),u(),F("options",e.commandOptions()??j(10,Ie))("inlineSearch",!0),u(17),F("formGroup",e.standardFields),u(11),F("disallowToggle",!0),u(4),U(e.standardFields.controls.filters.controls),u(2),X("options",e.settings),F("hasFreeTextSettings",!0),u(2),J("loader",e.isSubmitting()),u(2),x(e.baseCmdForm.value.command),w(38)}}var c=new re,P=class s{#e=_(A);#n=_(Se);#o=_(Q);#t=_(W);#a=_(Fe);#s=_(he);#i=_(T);#r=D(this.#t.params);commandOptions=D(this.#a.getApiV1Commandline());isSubmitting=L(!1);optionsFields=this.#e.optionsFields;standardFields=c.group({"backup-id":c.control(""),"backup-name":c.control(""),dbpath:c.control(""),filters:c.array([])});baseCmdForm=c.group({command:c.control("backup"),targetUrl:c.control(""),arguments:c.control("")});finishedLoading=this.#e.finishedLoading;backupId=this.#e.backupId;settings=this.#e.settings;#c=$(()=>{let t=this.#r()?.id;this.#e.backupId.set(t),this.getBackup(t)});getBackup(t){this.#n.getApiV1BackupById({id:t}).subscribe({next:e=>{this.#e.mapScheduleToForm(e.Schedule??null),e.Backup&&(this.#e.mapGeneralToForm(e.Backup),this.mapStandardFieldsToForm(e.Backup),this.mapBaseCmdToForm(e.Backup),this.#e.mapOptionsToForms(e.Backup,!0)),this.applyStateFromUrl(),this.#e.finishedLoading.set(!0)}})}mapStandardFieldsToForm(t){this.standardFields.patchValue({dbpath:t.DBPath,"backup-id":t.ID,"backup-name":t.Name}),t.Filters&&t.Filters.length&&t.Filters.map(e=>{this.standardFields.controls.filters.push(c.control(`${e.Include?"":"-"}${e.Expression}`))})}submit(){this.#s.resumeDialogCheck(()=>this.#l())}#l(){this.isSubmitting.set(!0);let t=this.updateUrl(),e=this.baseCmdForm.value,n=e.targetUrl??"",r=(e.arguments??"").split(`
2
2
  `)??[],m=[n,...r].filter(i=>i.length>0),g=this.standardFields.value,S=g.filters??[],h=[e.command,...m,`--backup-name=${g["backup-name"]}`,`--dbpath=${g.dbpath}`,`--backup-id=${g["backup-id"]}`,...S.filter(i=>i).map(i=>i.startsWith("-")?`--exclude=${i?.slice(1)}`:`--include=${i}`),...this.#e.mapFormsToSettings(["backup-id","backup-name","dbpath"]).map(i=>`${i.Name.startsWith("--")?"":"--"}${i.Name}=${i.Value}`),"--disable-module=console-password-input"];this.#n.postApiV1Commandline({requestBody:h}).subscribe({next:i=>{i.Status==="OK"&&this.#o.navigate(["backup",this.backupId(),"commandline",i.ID],{queryParams:{state:t}})},error:()=>{this.isSubmitting.set(!1)}})}mapBaseCmdToForm(t){let e=t.TargetURL??null;e&&this.baseCmdForm.patchValue({targetUrl:e??"",arguments:t.Sources?.join(`
3
3
  `)??""})}updateUrl(){let t=this.baseCmdForm.value,e=this.standardFields.value,n=e.filters??[],r=this.settings(),m=this.#i.saveState({command:t.command,targetUrl:t.targetUrl,arguments:t.arguments,backupId:e["backup-id"],backupName:e["backup-name"],dbpath:e.dbpath,filters:n,options:r});return this.#o.navigate([],{relativeTo:this.#t,queryParams:{state:m},replaceUrl:!0}),m}applyStateFromUrl(){let e=this.#t.snapshot.queryParams.state;if(!e)return;let n=this.#i.getState(e);n&&(this.baseCmdForm.patchValue({command:n.command,targetUrl:n.targetUrl,arguments:n.arguments}),this.standardFields.patchValue({"backup-id":n.backupId,"backup-name":n.backupName,dbpath:n.dbpath}),n.filters&&(this.standardFields.controls.filters.clear(),n.filters.forEach(r=>{this.standardFields.controls.filters.push(c.control(r))})),n.options&&n.options.length>0&&this.settings.set(n.options))}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=R({type:s,selectors:[["app-commandline"]],features:[z([A])],decls:8,vars:1,consts:()=>{let t;t=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let e;e=$localize` Command ${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON:`;let n;n=$localize` TargetUrl ${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON:`;let r;r=$localize` Commandline Arguments ${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON:`;let m;m=$localize`Advanced options`;let g;g=$localize` Backup ID ${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON:`;let S;S=$localize` Backup Name ${"\uFFFD#27\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#27\uFFFD"}:CLOSE_TAG_SH_ICON:`;let h;h=$localize`Filters`;let i;return i=$localize`${"\uFFFD#39\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#39\uFFFD"}:CLOSE_TAG_SH_ICON: Run "${"\uFFFD0\uFFFD"}:INTERPOLATION:" command now `,[t,e,n,r,m,g,S,h,i,[1,"back"],["type","button","shButton","","routerLink","/",1,"small"],[1,"indeterminate","primary"],[3,"formGroup"],["placeholder","Select a command...",3,"options","inlineSearch"],["for","command"],["shTooltip","Choose the command to execute"],["type","text","id","command","formControlName","command"],["for","targetUrl"],["shTooltip","Enter the URL of the backup target"],["id","targetUrl","autocomplete","off","formControlName","targetUrl"],["for","arguments"],["shTooltip","Enter one argument per line without quotes (e.g., *.txt)"],["id","arguments","autocomplete","off","rows","5","formControlName","arguments","placeholder","Enter one argument per line without quotes (e.g., *.txt)",1,"arguments"],["for","backup-id"],["shTooltip","The ID of the backup configuration this run belongs to (can be empty)"],["id","backup-id","formControlName","backup-id"],["for","backup-name"],["shTooltip","The optional name of the backup"],["id","backup-name","formControlName","backup-name"],[3,"disallowToggle"],["title",""],["content","","formGroupName","filters"],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["shButton","",1,"raised","primary",3,"click"],[3,"id","formControl"]]},template:function(e,n){e&1&&(a(0,"app-status-bar"),l(1,"section")(2,"div",9)(3,"button",10),p(4,0),a(5,"sh-icon"),C(),o()(),k(6,Me,1,0,"sh-progress-bar",11)(7,De,40,11),o()),e&2&&(u(6),G(n.finishedLoading()?7:6))},dependencies:[le,ne,Z,ee,te,Ne,Ee,Te,ce,oe,se,ae,ie,Y,_e,ue,de,Ce,pe,me,ge],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;max-width:40rem;padding:2.5rem;gap:1.25rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.arguments[_ngcontent-%COMP%]{min-height:6rem;white-space:pre}"],changeDetection:0})};export{P as default};
@@ -0,0 +1 @@
1
+ import"./chunk-7CGTOI24.js";var o=[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"destination",loadComponent:()=>import("./chunk-5I4CGX7S.js")},{path:"encryption",loadComponent:()=>import("./chunk-UNZWYG3U.js")},{path:"select-files",loadComponent:()=>import("./chunk-5FCREC3N.js")},{path:"options",loadComponent:()=>import("./chunk-YN3R7XGF.js")},{path:":taskid/progress",loadComponent:()=>import("./chunk-IFP4WWLK.js")}],t=o;export{t as default};
@@ -1 +1 @@
1
- import{a}from"./chunk-OL7C46LY.js";import"./chunk-HRHF3TYJ.js";import"./chunk-IMHM7ISI.js";import"./chunk-HSHF5HR7.js";import"./chunk-HUZXJWCG.js";import"./chunk-UNMDSCAN.js";import"./chunk-CFNARBNK.js";import"./chunk-PO3L6MKW.js";import"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.js";import"./chunk-26Z7TPJB.js";import"./chunk-7CGTOI24.js";export{a as OptionsListComponent};
1
+ import{a}from"./chunk-TXFTUL4R.js";import"./chunk-K34VOGDF.js";import"./chunk-IMHM7ISI.js";import"./chunk-HSHF5HR7.js";import"./chunk-HUZXJWCG.js";import"./chunk-UNMDSCAN.js";import"./chunk-CFNARBNK.js";import"./chunk-PO3L6MKW.js";import"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.js";import"./chunk-26Z7TPJB.js";import"./chunk-7CGTOI24.js";export{a as OptionsListComponent};
@@ -0,0 +1 @@
1
+ import{i as pe,j as Ce,k as Se,l as me,p as Ne}from"./chunk-TN6HBIUN.js";import"./chunk-K34VOGDF.js";import{b as ue,c as Te}from"./chunk-IMHM7ISI.js";import"./chunk-6LAXPU22.js";import"./chunk-6Q6SSTBK.js";import"./chunk-TL4WOQKT.js";import"./chunk-7LTHH6OG.js";import{a as A}from"./chunk-HSHF5HR7.js";import"./chunk-D6IP567E.js";import"./chunk-VDSX2M4H.js";import"./chunk-ZU6T3TW3.js";import"./chunk-HUZXJWCG.js";import"./chunk-7TWUW4XJ.js";import{B as ce,H as ge,K as de,c as Y,e as Z,f as ee,g as te,i as ne,j as ie,r as oe,s as ae,u as re,w as se,y as le,z as _e}from"./chunk-UNMDSCAN.js";import"./chunk-CFNARBNK.js";import{b as q,d as Q}from"./chunk-I27PVH6D.js";import"./chunk-5VE6P5U5.js";import"./chunk-PO3L6MKW.js";import"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.js";import{$ as l,Ab as s,Bb as p,Fb as V,Gb as K,Ib as C,Mc as R,Pa as g,Pb as N,Qb as E,Rb as D,Sc as w,Vb as T,W as I,Xb as c,aa as _,cb as v,cc as z,da as B,dc as J,gc as X,jc as y,la as O,oc as F,pc as f,qc as P,rc as W,sb as S,sc as H,tb as m,tc as U,xc as j,yb as h,zb as r}from"./chunk-26Z7TPJB.js";import"./chunk-7CGTOI24.js";var Ee=["formRef"],Ie=["testUrl"],he=()=>({maxWidth:"700px",width:"100%"});function De(o,i){if(o&1){let e=C();r(0,"button",27),T("click",function(){l(e);let n=c();return _(n.openTargetUrlDialog())}),N(1,6),p(2,"sh-icon"),E(),s()}}function fe(o,i){if(o&1){let e=C();r(0,"button",27),T("click",function(){l(e);let n=c(2);return _(n.copyTargetUrl())}),N(1,8),p(2,"sh-icon"),E(),s()}}function Oe(o,i){if(o&1){let e=C();r(0,"sh-menu")(1,"button",19)(2,"sh-icon"),y(3,"dots-three-vertical"),s()(),V(4,28),r(5,"button",27),T("click",function(){l(e);let n=c();return _(n.openTargetUrlDialog())}),N(6,7),p(7,"sh-icon"),E(),s(),S(8,fe,3,0,"button",19),K(),s()}if(o&2){c();let e=U(0);g(8),m(e?8:-1)}}function Fe(o,i){if(o&1){let e=C();r(0,"app-destination-list",29),T("setDestination",function(n){l(e);let a=c();return _(a.setDestination(n))}),s()}}function Pe(o,i){if(o&1){let e=C();r(0,"app-single-destination",30),P("targetUrlChange",function(n){l(e);let a=c();return f(a.targetUrlModel,n)||(a.targetUrlModel=n),_(n)}),s()}if(o&2){let e=c();F("targetUrl",e.targetUrlModel),h("useBackupState",!0)}}function Ae(o,i){o&1&&(r(0,"h2"),D(1,11),s())}function Me(o,i){o&1&&(r(0,"h2"),D(1,12),s())}function ye(o,i){if(o&1){let e=C();r(0,"sh-dialog",31),P("isOpenChange",function(n){l(e);let a=c();return f(a.targetUrlDialogOpen,n)||(a.targetUrlDialogOpen=n),_(n)}),r(1,"header",32)(2,"div",33),S(3,Ae,2,0,"h2")(4,Me,2,0,"h2"),r(5,"sh-alert",34),D(6,9),s()()(),r(7,"div",35)(8,"sh-form-field")(9,"textarea",36),P("ngModelChange",function(n){l(e);let a=c();return f(a.targetUrlCtrl,n)||(a.targetUrlCtrl=n),_(n)}),s()()(),r(10,"footer",37)(11,"button",22),T("click",function(){l(e);let n=c();return _(n.closeTargetUrlDialog(!1))}),y(12,"Cancel"),s(),r(13,"button",38),T("click",function(){l(e);let n=c();return _(n.closeTargetUrlDialog(!0))}),N(14,10),p(15,"sh-icon"),E(),s()()()}if(o&2){let e=c(),t=U(0);F("isOpen",e.targetUrlDialogOpen),h("options",j(4,he)),g(3),m(t?4:3),g(6),F("ngModel",e.targetUrlCtrl)}}var M=new oe,je=(o={destinations:[]})=>M.group({destinations:M.array(o.destinations)}),qe=({key:o,customGroup:i,dynamicGroup:e,advancedGroup:t})=>M.group({destinationType:M.control(o),custom:i,dynamic:e,advanced:t}),$=class o{#i=I(Q);#o=I(q);#e=I(Ne);#n=I(_e);injector=I(B);formRef=w.required("formRef");testUrlComponent=w.required("testUrl");testSignal=this.#e.targetUrlTestSignal;targetUrlModel=this.#e.targetUrlModel;targetUrlCtrl=O(null);targetUrlInitial=O(null);targetUrlDialogOpen=O(!1);toggleNewDestination=O(!0);isNew=this.#e.isNew;backupId=this.#e.backupId;selectedDestinationType=R(()=>{let i=this.targetUrlModel();return i?ue(i)??null:null});selectedDestinationTypeOption=R(()=>{let i=this.selectedDestinationType();return i?{key:i.customKey??i.key,customKey:i.customKey??null,displayName:i.displayName,description:i.description,icon:i.icon}:null});copyTargetUrl(){navigator.clipboard.writeText(this.targetUrlModel()??"")}openTargetUrlDialog(){let i=this.targetUrlModel();this.targetUrlCtrl.set(i),this.targetUrlInitial.set(i),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(i=!1){this.targetUrlDialogOpen.set(!1);let e=this.targetUrlCtrl(),t=this.targetUrlInitial();!i||e===t||!e||this.#e.setTargetUrl(e)}setDestination(i){let e=Te(i??"");if(e){if(e.mapper.default){let t=e.mapper.default(this.#e.backupName()??"");this.#e.setTargetUrl(t,!0);return}this.#e.setTargetUrl(`${i}://`,!0)}}removeDestination(){this.#e.setTargetUrl(null,!0)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let i=this.#e.isNew(),e=this.testSignal();if(!i){this.#t();return}if(e===null){this.#n.open(A,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:n=>{n?this.testUrlComponent()?.testDestination(!1)?.then(a=>{a.action==="success"&&!a.containsBackup&&!a.anyFilesFound?this.#t():this.#n.open(A,{data:{title:$localize`Test did not succeed`,message:a.errorMessage??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#t()}});return}let t=typeof e=="string"?null:e;if(t?.action!=="success"||t.containsBackup||t.anyFilesFound){this.#n.open(A,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Yes, continue`,cancelText:$localize`Cancel`},closed:n=>{n&&this.#t()}});return}this.#t()}#t(){this.#e.shouldAutoSave()&&this.#e.submit(!0),this.#i.navigate(["source-data"],{relativeTo:this.#o.parent})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=v({type:o,selectors:[["app-destination"]],viewQuery:function(e,t){e&1&&z(t.formRef,Ee,5)(t.testUrlComponent,Ie,5),e&2&&J(2)},decls:28,vars:17,consts:()=>{let i;i=$localize`Backup destination`;let e;e=$localize`Change`;let t;t=$localize`${"\uFFFD#23\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#23\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let n;n=$localize`${"\uFFFD#26\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#26\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let a;a=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Set target URL `;let d;d=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: Edit target URL `;let x;x=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:copy${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Copy URL to clipboard `;let L;L=$localize`Be careful, this will overwrite everything you have in your destination.`;let G;G=$localize` Override target URL ${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON:`;let b;b=$localize`Set target URL`;let k;return k=$localize`Edit target URL`,[["formRef",""],["testUrl",""],i,e,t,n,a,d,x,L,G,b,k,["autocomplete","off",3,"submit"],[2,"position","absolute","left","-9999px","width","1px","height","1px","overflow","hidden"],["type","text","name","fake_email","tabindex","-1"],["type","password","name","fake_password","tabindex","-1"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small"],[3,"targetUrlChange","testSignalChange","targetUrl","testSignal","backupId","sourcePrefix","suppressErrorDialogs","askToCreate","testExpectation","moduleType"],[1,"current-destination",3,"targetUrl"],["shButton","","type","button",3,"click"],[3,"targetUrl","useBackupState"],[1,"form-actions"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click"],["menu",""],[3,"setDestination"],[3,"targetUrlChange","targetUrl","useBackupState"],[3,"isOpenChange","isOpen","options"],["header",""],[1,"target-dialog-header"],[1,"warn"],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(e,t){if(e&1){let n=C();W(0),r(1,"form",13,0),T("submit",function(){return l(n),_(t.next())}),r(3,"div",14),p(4,"input",15)(5,"input",16),s(),r(6,"header")(7,"h3",17)(8,"span"),D(9,2),s(),r(10,"div",18),S(11,De,3,0,"button",19)(12,Oe,9,1,"sh-menu"),s()(),r(13,"app-test-url",20,1),P("targetUrlChange",function(d){return l(n),f(t.targetUrlModel,d)||(t.targetUrlModel=d),_(d)})("testSignalChange",function(d){return l(n),f(t.testSignal,d)||(t.testSignal=d),_(d)}),s(),r(15,"app-destination-list-item",21)(16,"button",22),T("click",function(){return l(n),_(t.removeDestination())}),D(17,3),s()()(),S(18,Fe,1,0,"app-destination-list"),S(19,Pe,1,2,"app-single-destination",23),r(20,"div",24)(21,"button",22),T("click",function(){return l(n),_(t.goBack())}),N(22,4),p(23,"sh-icon"),E(),s(),r(24,"button",25),N(25,5),p(26,"sh-icon"),E(),s()()(),S(27,ye,16,5,"sh-dialog",26)}if(e&2){let n=H(!!t.targetUrlModel());g(11),m(n?12:11),g(2),F("targetUrl",t.targetUrlModel)("testSignal",t.testSignal),h("backupId",t.backupId())("sourcePrefix",null)("suppressErrorDialogs",!1)("askToCreate",!0)("testExpectation",t.isNew()?"destinationEmpty":"any")("moduleType","Backend"),g(2),h("targetUrl",t.targetUrlModel()),g(3),m(n?-1:18),g(),m(n?19:-1),g(5),X("loading",t.testSignal()=="testing"),h("disabled",t.testSignal()=="testing"||!n),g(3),m(t.targetUrlDialogOpen()?27:-1)}},dependencies:[Se,Ce,pe,me,ae,ie,Y,Z,ee,ne,te,ce,ge,de,re,le,se],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem;padding:2.5rem 2.5rem 0}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;height:100%;padding:0 0 2.5rem}.current-destination[_ngcontent-%COMP%]{margin:1rem 0 0}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}.target-dialog-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:.5rem}"],changeDetection:0})};export{je as createDestinationForm,qe as createDestinationFormGroup,$ as default};
@@ -1 +1 @@
1
- import{a as K}from"./chunk-ZHGDQABC.js";import"./chunk-MMEFBZO4.js";import{g as q}from"./chunk-K6G7ALTG.js";import"./chunk-OL7C46LY.js";import{b as Z}from"./chunk-C25WT56X.js";import"./chunk-P3D2ZP6W.js";import"./chunk-HRHF3TYJ.js";import"./chunk-IMHM7ISI.js";import"./chunk-6LAXPU22.js";import"./chunk-GRVTXORM.js";import{b as V}from"./chunk-BFTGDQ4K.js";import"./chunk-B62TPRVG.js";import"./chunk-6Q6SSTBK.js";import{a as j}from"./chunk-SZUNW4JO.js";import"./chunk-TL4WOQKT.js";import"./chunk-7LTHH6OG.js";import"./chunk-HSHF5HR7.js";import"./chunk-5LBG6MOL.js";import"./chunk-D6IP567E.js";import"./chunk-VDSX2M4H.js";import{b as H}from"./chunk-ZU6T3TW3.js";import"./chunk-HUZXJWCG.js";import"./chunk-7TWUW4XJ.js";import{C as W,L as X,O as z,u as J}from"./chunk-UNMDSCAN.js";import{c as B}from"./chunk-CFNARBNK.js";import{b as w}from"./chunk-I27PVH6D.js";import"./chunk-5VE6P5U5.js";import"./chunk-PO3L6MKW.js";import{ka as k}from"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.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-26Z7TPJB.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-ZHGDQABC.js";import"./chunk-MMEFBZO4.js";import{g as q}from"./chunk-4I55TVYE.js";import"./chunk-TXFTUL4R.js";import{b as Z}from"./chunk-C25WT56X.js";import"./chunk-TN6HBIUN.js";import"./chunk-K34VOGDF.js";import"./chunk-IMHM7ISI.js";import"./chunk-6LAXPU22.js";import"./chunk-GRVTXORM.js";import{b as V}from"./chunk-BFTGDQ4K.js";import"./chunk-B62TPRVG.js";import"./chunk-6Q6SSTBK.js";import{a as j}from"./chunk-SZUNW4JO.js";import"./chunk-TL4WOQKT.js";import"./chunk-7LTHH6OG.js";import"./chunk-HSHF5HR7.js";import"./chunk-5LBG6MOL.js";import"./chunk-D6IP567E.js";import"./chunk-VDSX2M4H.js";import{b as H}from"./chunk-ZU6T3TW3.js";import"./chunk-HUZXJWCG.js";import"./chunk-7TWUW4XJ.js";import{C as W,L as X,O as z,u as J}from"./chunk-UNMDSCAN.js";import{c as B}from"./chunk-CFNARBNK.js";import{b as w}from"./chunk-I27PVH6D.js";import"./chunk-5VE6P5U5.js";import"./chunk-PO3L6MKW.js";import{ka as k}from"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.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-26Z7TPJB.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};
@@ -0,0 +1 @@
1
+ import{a as He}from"./chunk-HSHF5HR7.js";import{a as je}from"./chunk-HUZXJWCG.js";import{A as ke,B as de,H as J,J as $e,K as Be,L as Ve,P as We,W as Ge,a as ae,c as G,e as z,i as j,k as ce,s as H,u as Ie,y as Ae,z as Le}from"./chunk-UNMDSCAN.js";import{c as ze}from"./chunk-CFNARBNK.js";import{_ as we}from"./chunk-7AVOHYTE.js";import{$ as b,Ab as c,Bb as oe,E as ue,Fb as Ee,Gb as Me,Gc as xe,Hb as pe,Ib as A,Mc as D,Pa as g,Pb as Pe,Qb as be,Qc as Re,Rb as I,Rc as f,Sb as K,Sc as _e,Tb as Q,Vb as y,W as ee,Xb as h,Yb as W,Zb as v,aa as N,cb as V,cc as Ne,dc as Se,ec as ge,fc as re,gc as R,hb as q,jc as E,kc as ve,l as me,la as C,lc as Oe,mc as Fe,na as x,oc as L,p as X,pc as k,qc as $,rb as te,sb as O,tb as F,ub as Te,v as fe,wb as ne,wc as se,xb as ie,xc as ye,yb as P,yc as le,z as Ce,zb as a,zc as De}from"./chunk-26Z7TPJB.js";import{a as Y,b as Z}from"./chunk-7CGTOI24.js";var Ze=[[["label"]],[["","prefix",""]],[["","suffix",""]]],et=["label","[prefix]","[suffix]"];function tt(o,t){if(o&1&&E(0),o&2){let e=t.$implicit,n=h();Fe("",e.label,"",n.hasPerSecond()?"/s":"")}}var nt=["throttle-upload","throttle-download"],it=[{value:"B",label:"Bytes"},{value:"KB",label:"KB"},{value:"MB",label:"MB"},{value:"GB",label:"GB"},{value:"TB",label:"TB"},{value:"PB",label:"PB"}],ot=o=>{if(!o||typeof o!="string"||o.length===0)return{size:0,unit:"MB"};let t=o.match(/^(\d+)(bytes|kb|mb|gb|tb|pb|b|kib|mib|gib|tib|pib)$/i);return t&&(t[2].toUpperCase()==="B"||t[2].toUpperCase()==="BYTES")?{size:1,unit:"KB"}:{size:t?parseInt(t[1],10):0,unit:t?t[2].toUpperCase():"MB"}},Je=class o{customId=f();inputType=f();timespan=C(0);unit=C("MB");sizeOptions=C(it);readonly=C(!1);hasPerSecond=D(()=>{let t=this.inputType();return t&&nt.includes(t)});onChange=()=>{};onTouched=()=>{};onChangeEffect=x(()=>{this.onChange(this.getValue())});writeValue(t){if(t){let e=ot(t);e?queueMicrotask(()=>{this.timespan.set(e.size),this.unit.set(e.unit)}):(this.timespan.set(0),this.unit.set("MB"))}else this.timespan.set(0),this.unit.set("MB")}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.readonly.set(t)}getValue(){return`${this.timespan()}${this.unit()}`}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=V({type:o,selectors:[["app-size"]],inputs:{customId:[1,"customId"],inputType:[1,"inputType"]},features:[se([{provide:ae,useExisting:o,multi:!0}])],ngContentSelectors:et,decls:9,vars:10,consts:[[1,"label"],["type","number",3,"ngModelChange","id","ngModel","disabled"],["value","value","label","label",3,"options","readonly","isClearable"],["type","text",3,"ngModelChange","ngModel"]],template:function(e,n){e&1&&(W(Ze),a(0,"div",0),v(1,0,["ngProjectAs","label",5,["label"]]),c(),a(2,"sh-form-field")(3,"input",1),$("ngModelChange",function(r){return k(n.timespan,r)||(n.timespan=r),r}),c(),v(4,1),v(5,2),c(),a(6,"sh-select",2)(7,"input",3),$("ngModelChange",function(r){return k(n.unit,r)||(n.unit=r),r}),c(),q(8,tt,1,2,"ng-template"),c()),e&2&&(g(2),te("readonly",n.readonly()||void 0),g(),P("id",n.customId()),L("ngModel",n.timespan),P("disabled",n.readonly()),g(3),re("--miw",0),P("options",n.sizeOptions())("readonly",n.readonly())("isClearable",!1),g(),L("ngModel",n.unit))},dependencies:[We,J,H,G,ce,z,j],styles:['[_nghost-%COMP%]{display:grid;grid-template-areas:"label label" "input unit";grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{grid-area:label;grid-column:1/-1}[_nghost-%COMP%] sh-form-field[_ngcontent-%COMP%]{grid-area:input}[_nghost-%COMP%] sh-select[_ngcontent-%COMP%]{grid-area:unit}'],changeDetection:0})};var rt=["treeContainer"],st=["formRef"],lt=[[["label"]],[["label"]],[["input"]]],at=["label","label","input"],ct=o=>({children:o,level:0}),Ke=o=>({$implicit:o}),dt=(o,t)=>({children:o,level:t}),ut=()=>({maxWidth:"700px",width:"100%"}),pt=(o,t)=>t.id;function gt(o,t){if(o&1){let e=A();a(0,"sh-button-group",10)(1,"button",20),y("click",function(){b(e);let i=h();return N(i.pathDiscoveryMethod.set("browse"))}),I(2,4),c(),a(3,"button",20),y("click",function(){b(e);let i=h();return N(i.pathDiscoveryMethod.set("path"))}),I(4,5),c()()}if(o&2){let e=h();g(),R("active",e.pathDiscoveryMethod()==="browse"),g(2),R("active",e.pathDiscoveryMethod()==="path")}}function _t(o,t){o&1&&oe(0,"sh-progress-bar",13)}function ht(o,t){o&1&&(a(0,"sh-icon",25),E(1,"caret-down"),c())}function mt(o,t){o&1&&oe(0,"sh-icon",25)}function ft(o,t){o&1&&(a(0,"sh-icon",25),E(1,"spinner"),c())}function Ct(o,t){o&1&&(a(0,"sh-icon",25),E(1,"caret-right"),c())}function Tt(o,t){o&1&&(a(0,"sh-icon",23),E(1,"folder-open"),c())}function Et(o,t){o&1&&(a(0,"sh-icon",23),E(1,"folder-user"),c())}function Mt(o,t){o&1&&(a(0,"sh-icon",23),E(1,"file"),c())}function Pt(o,t){o&1&&(a(0,"sh-icon",23),E(1,"folder"),c())}function bt(o,t){if(o&1&&(O(0,ht,2,0,"sh-icon",25)(1,mt,1,0,"sh-icon",25)(2,ft,2,0,"sh-icon",25)(3,Ct,2,0,"sh-icon",25),O(4,Tt,2,0,"sh-icon",23)(5,Et,2,0,"sh-icon",23)(6,Mt,2,0,"sh-icon",23)(7,Pt,2,0,"sh-icon",23)),o&2){let e=h(2).$implicit,n=h(2);F(e.children.length?0:e.cls==="file"?1:e.id===n.isLoading()?2:3),g(4),F(e.children.length?4:e.id==="%HOME%"?5:e.cls==="file"?6:7)}}function Nt(o,t){o&1&&(a(0,"sh-icon",23),E(1,"desktop-tower"),c())}function St(o,t){o&1&&pe(0)}function vt(o,t){if(o&1&&q(0,St,1,0,"ng-container",14),o&2){let e=h(2).$implicit,n=h().$implicit;h();let i=ge(7);P("ngTemplateOutlet",i)("ngTemplateOutletContext",le(5,Ke,De(2,dt,e.children,n.level+1)))}}function Ot(o,t){if(o&1){let e=A();a(0,"div",21,3),y("click",function(){b(e);let i=h().$implicit,r=h(2);return N(r.toggleNode(i.id,i))}),a(2,"div",22),O(3,bt,8,2)(4,Nt,2,0,"sh-icon",23),c(),a(5,"div",24),y("click",function(i){b(e);let r=h().$implicit,d=h(2);return N(d.toggleSelectedNode(i,r))}),E(6),c()(),O(7,vt,1,7,"ng-container")}if(o&2){let e=h().$implicit,n=h().$implicit,i=h();R("accepted",e.accepted===!0)("active",e.evalState===i.TreeEvalEnum.Included)("indeterminate",e.isIndeterminate)("open",e.children.length)("usually-hidden",e.hidden)("root",n.level===0)("loading",i.isLoading()===e.id),g(2),R("file",e.cls==="file"),g(),F(e.id!=="/"?3:4),g(3),Oe(" ",e.text," "),g(),F(e.children.length>0?7:-1)}}function Ft(o,t){if(o&1&&O(0,Ot,8,19),o&2){let e=t.$implicit,n=h(2);F(e.hidden&&n._showHiddenNodes()||!e.hidden?0:-1)}}function yt(o,t){if(o&1&&(a(0,"sh-list"),ne(1,Ft,1,1,null,null,pt),c()),o&2){let e=t.$implicit;re("padding-left",e.level*.25,"rem"),g(),ie(e.children)}}function Dt(o,t){o&1&&pe(0)}function xt(o,t){if(o&1){let e=A();a(0,"sh-toggle",26),y("click",function(){b(e);let i=h();return N(i._showHiddenNodes.set(!i._showHiddenNodes()))}),I(1,6),c()}if(o&2){let e=h();R("active",e._showHiddenNodes()),g(),K(e.showFiles()?"files":"folders"),Q(1)}}function Rt(o,t){if(o&1){let e=A();a(0,"button",27),y("click",function(){b(e);let i=h();return N(i.openCreateFolderDialog())}),I(1,7),c()}if(o&2){let e=h();P("disabled",!e.isCurrentPathFolder())}}function wt(o,t){if(o&1){let e=A();a(0,"sh-dialog",28),$("isOpenChange",function(i){b(e);let r=h();return k(r.createFolderDialogOpen,i)||(r.createFolderDialogOpen=i),N(i)}),a(1,"header",29)(2,"h2"),I(3,8),c()(),a(4,"div",30)(5,"div"),E(6," Folder will be created under "),a(7,"pre"),E(8),c()(),a(9,"sh-form-field")(10,"textarea",31),$("ngModelChange",function(i){b(e);let r=h();return k(r.createFolderPath,i)||(r.createFolderPath=i),N(i)}),c()()(),a(11,"footer",32)(12,"button",33),y("click",function(){b(e);let i=h();return N(i.closeCreateFolderDialog(!1))}),E(13,"Cancel"),c(),a(14,"button",34),y("click",function(){b(e);let i=h();return N(i.closeCreateFolderDialog(!0))}),Pe(15,9),oe(16,"sh-icon"),be(),c()()()}if(o&2){let e,n=h();L("isOpen",n.createFolderDialogOpen),P("options",ye(5,ut)),g(8),ve(n.currentPath()),g(2),L("ngModel",n.createFolderPath),g(4),P("disabled",!((e=n.createFolderPath())!=null&&e.length))}}var Qe=(r=>(r[r.ExcludedByParent=-2]="ExcludedByParent",r[r.Excluded=-1]="Excluded",r[r.None=0]="None",r[r.Included=1]="Included",r[r.IncludedByParent=2]="IncludedByParent",r))(Qe||{}),S="/",he=class o{#e=ee(ze);#i=ee(je);#d=ee(Le);multiSelect=f(!1);disabled=f(!1);showFiles=f(!1);selectFiles=f(!1);accepts=f(null);startingPath=f(null);rootPaths=f([]);initialNodes=f([]);backupSettings=f(null);pathRefreshTrigger=f(!1);showHiddenNodes=f(!1);enableCreateFolder=f(!1);hideShortcuts=f(!1);office365Mode=f(!1);backupId=f("");sourcePrefix=f("");destinationUrl=f("");loadExtendedData=f(!0);hasExtendedData=Re();_showHiddenNodes=C(!1);createFolderDialogOpen=C(!1);createFolderPath=C(null);treeContainerRef=_e("treeContainer");formRef=_e("formRef");pathDiscoveryMethod=C("browse");isLoading=C(null);currentPath=C("");#o=C(null);treeSearchQuery=C("");treeNodes=C([]);pathDelimiter=D(()=>this.#i.systemInfo()?.DirectorySeparator??"");filterGroups=this.#i.filterGroups();isByBackupSettings=D(()=>{let t=this.backupSettings();return!(t===void 0||t?.id===void 0||t?.time===void 0)});searchableTreeNodes=D(()=>{let t=this.treeSearchQuery();return t?this.treeNodes().filter(e=>e.text?.toLowerCase().includes(t.toLowerCase())):this.treeNodes()});TreeEvalEnum=Qe;treeStructure=D(()=>{let t=this.showHiddenNodes(),e=this.currentPath().split("\0").filter(u=>u!==""&&u!==S),n=structuredClone(e);for(let u=0;u<n.length;u++){let T=n[u].slice(1);if(T.startsWith("{")&&T.endsWith("}")){let m=T.slice(1,-1),_=this.filterGroups?.FilterGroups[m];if(_&&_.length){let w=_.map(M=>`-${M}`);n.splice(u,1,...w)}}}let i=this.searchableTreeNodes(),r=this.rootPaths(),d=this.accepts(),l=this.pathDelimiter(),s=[];return r.length>0?s=r.map(u=>{let p=this.#r(n,u,"folder",null);return{id:u,resolvedpath:u,text:u,parentPath:"",children:[],evalState:p,isIndeterminate:!1,cls:this.#t(u,l)?"folder":"file"}}):s=[{id:S,resolvedpath:S,text:$localize`Computer`,parentPath:"",children:[],evalState:0,isIndeterminate:!1,cls:"folder"}],s.map(u=>{let p=new Map;if(!u.id)return;let T=u.id;d&&(u.accepted=!0),p.set(T,u);let m=r.length>0?i.filter(_=>_.parentPath.startsWith(T)):i;for(let _ of m){if(!_.id)continue;let w=_.id;if(!_.cls||p.has(w))continue;let M=p.get(_.parentPath),U=_.hidden===!0&&t?0:this.#r(n,w,_.cls,M),B=Z(Y({},_),{isIndeterminate:this.isIndeterminate(n,w),evalState:U,children:[]});d&&(B.accepted=this.matchAccepts(d,B)),p.set(w,B),M&&M.children.push(B)}return u}),s});#u(t){let e=this.pathDelimiter();return t?t.endsWith(e)||t===S?t:t+e:S}#r(t,e,n,i){if(i&&i.evalState===-1)return-2;let r=0,d=this.pathDelimiter(),l=t.filter(p=>!p.startsWith("-")&&!p.startsWith("+")),s=t.filter(p=>p.startsWith("-")||p.startsWith("+")),u=this.multiSelect();if(l.length===0)return r;for(let p=0;p<l.length;p++){let T=l[p];if(e===T){r=1;break}if(!u||!this.#t(T,d))continue;if(e?.startsWith(T)){r=1;break}}if(s.length===0)return r;for(let p=0;p<s.length;p++){let T=s[p],m=T.slice(1),_=T.startsWith("-")?-1:1;if(this.#t(m,d)){if(n!=="folder")continue;if(e===m){r=_;break}}if(m.startsWith("*")&&m.endsWith(`*${d}`)){if(n!=="folder")continue;let M=m.slice(1,-2);if(M==="")break;if(e?.includes(M+d)){r=_;break}}if(m.startsWith("[.*")&&m.endsWith(`[^\\${d}]*]`)){if(n!=="file")continue;let M=m.slice(3,-7);if(new RegExp(M).test(e)){r=_;break}}if(m.startsWith("[")&&m.endsWith("]")){let M=m.slice(1,-1),U=this.translateCSharpRegex(M);if(new RegExp(`${U}`).test(e)){r=_;break}}if(m.startsWith("*.")){if(n!=="file"||m.replace("*.","").length===0)continue;if(this.#s(e,m,!0)){r=_;break}}if(m==="")continue;if(m===e){r=_;break}if(this.#s(e,m,!0)){r=_;break}}return r}translateCSharpRegex(t){let e=t;e=e.replace(/^@/,"");let n=/\(\?<(?<name>\w+)>(?<pattern>[^)]+)\)/g;return e=e.replace(n,(i,r,d)=>`(${d})`),e=e.replace(/\\/g,"\\\\"),e}isIndeterminate(t,e){return t.filter(n=>!n.startsWith("-")&&this.#t(n,this.pathDelimiter())).some(n=>n.startsWith(e))}isCurrentPathFolder(){let t=this.currentPath();return t?t.endsWith(this.pathDelimiter())||t.startsWith("%")&&t.endsWith("%")&&!t.includes(this.pathDelimiter()):!1}#s(t,e,n=!1){let i=e.replace(/\*/g,".*").replace(/\?/g,".").replace(/\[!([^\]]+)\]/g,"[^$1]");return new RegExp(`${i}${n?"$":""}`).test(t)}showHiddenNodesEffect=x(()=>this._showHiddenNodes.set(this.showHiddenNodes()));pathDiscoveryMethodEffect=x(()=>{let t=this.pathDiscoveryMethod(),e=this.#o();if(t==="browse"&&e){let n=e.value;if(n==null||n==="")return;this.currentPath.set(n)}});matchAccepts(t,e){if(!t||e.cls==="folder"||e.id===S)return!0;let n=t.split(",");if(n.length===0)return!0;let i="."+e.id.slice(e.id.indexOf("."));return i?n.some(r=>i.endsWith(r)):!1}currentPathEffect=x(()=>{let t=this.#o();t&&(t.value=this.currentPath(),t.dispatchEvent(new Event("input")))});inputValueChangeAbortController=null;inputRefEffect=x(()=>{let t=this.formRef()?.nativeElement?.querySelector("input");t&&(this.#p(t),this.inputValueChangeAbortController&&this.inputValueChangeAbortController.abort(),this.inputValueChangeAbortController=new AbortController,t.addEventListener("inputValueChanged",e=>{this.currentPath.set(e.detail.value)},{signal:this.inputValueChangeAbortController.signal}),this.#o.set(t),t.autocomplete="off")});ngOnInit(){let t=this.startingPath();if(t)this.currentPath.set(t),this.#m(t);else{let e=this.rootPaths(),n=this.initialNodes();e&&e.length>0?(n&&n.length>0&&this.treeNodes.set(n.map(i=>({id:i.id,leaf:i.leaf,cls:i.cls,text:this.#c(i.text,i?.Metadata),iconCls:i.iconCls,fileSize:i.fileSize,resolvedpath:i.resolvedpath,parentPath:this.getParentPath(i.id??"")}))),this.#n(null,e[0])):this.#n(null,S)}}getParentPath(t){let e=this.pathDelimiter(),n=t.split(e);return n.length<=1?S:(n.pop(),n.length!==0&&n.pop(),n.join(e)+e)}toggleSelectedNode(t,e){if(e.id===S||(t.stopPropagation(),e.evalState===-2))return;if(this.selectFiles()&&e.cls==="folder"){this.toggleNode(e.id,e);return}if(this.accepts()&&!e.accepted)return;let i=this.currentPath().split("\0").filter(s=>s!==""&&s!==S),d=this.isChildOfSelected(e)?`-${e.id}`:e.id,l=this.#t(e.id,this.pathDelimiter());if(this.multiSelect())if(i.includes(e.id))this.currentPath.set(i.filter(s=>s!==e.id&&!(l&&s.startsWith(d))).join("\0"));else if(i.some(s=>s==d))this.currentPath.set(i.filter(s=>s!==d).join("\0"));else{let s=l?i.filter(u=>!u.startsWith(e.id)):i;this.currentPath.set([...s,d].join("\0"))}else i.includes(e.id)?this.currentPath.set(i.filter(s=>s!==e.id).join("\0")):this.currentPath.set(e.id)}isChildOfSelected(t){return this.currentPath().split("\0").filter(n=>n!==""&&n!==S&&this.#t(n,this.pathDelimiter())).some(n=>t.id?.startsWith(n)||`-${t.id}`.startsWith(n))}toggleNode(t,e=null){e?.cls==="folder"&&(e?.children.length?this.treeNodes.update(n=>n.filter(i=>!i.id?.startsWith(e.id)||i.id===e.id)):this.#n(e,t))}openCreateFolderDialog(){return this.createFolderPath.set(null),this.createFolderDialogOpen.set(!0),!1}closeCreateFolderDialog(t){if(t&&this.createFolderPath()?.length&&this.isCurrentPathFolder()){let e=this.createFolderPath()?.trim();if(e){let n=this.currentPath(),i=this.#u(e),r=n+i;this.#e.postApiV1RemoteoperationCreate({requestBody:{path:"file://"+r}}).subscribe({next:()=>{this.currentPath.set(r),this.#n(null,n),setTimeout(()=>{this.#l()},500),this.createFolderDialogOpen.set(!1)},error:d=>{let l=d?.message?.match(/user-information\s*:\s*(.*?)(?:\s*,|$)/i),s=l?l[1]:d?.message||$localize`An error occurred while trying to create the folder.`;this.#d.open(He,{data:{title:$localize`Cannot create folder`,message:s,confirmText:$localize`OK`,cancelText:void 0}})}})}}else this.createFolderDialogOpen.set(!1);return!1}#l(){setTimeout(()=>{let e=this.treeContainerRef()?.nativeElement?.querySelector(".active");e&&e.scrollIntoView({behavior:"smooth",block:"center"})},100)}#p(t){return Object.defineProperty(t,"value",{configurable:!0,get(){return Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").get.call(this)},set(e){return Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").set.call(this,e),this.dispatchEvent(new CustomEvent("inputValueChanged",{bubbles:!0,cancelable:!0,detail:{value:e}})),e}}),t}#g(t){return this.#e.postApiV1Filesystem({showHidden:!0,requestBody:{path:t},onlyFolders:!this.showFiles()})}#_(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"office365",requestBody:{"backup-id":this.backupId()??"","source-prefix":this.sourcePrefix()??"",operation:"ListDestinationRestoreTargets",url:this.destinationUrl()??"",path:t??"/"}}).pipe(X(e=>{let n=e.Result;return Object.keys(n).map(i=>({Path:i,Metadata:JSON.parse(n[i])}))}))}#h(t){let e=this.backupSettings();if(this.#i.hasV2ListOperations())return this.#e.postApiV2BackupListFolder({requestBody:{BackupId:e.id,Time:e.time,Paths:t?[t]:null,PageSize:0,Page:0,ReturnExtended:this.office365Mode()||this.loadExtendedData()}}).pipe(X(n=>n.Data??[]));{let n={id:e.id+"",prefixOnly:!1,folderContents:!0,time:e.time,filter:t?"@"+t:void 0};return this.#e.getApiV1BackupByIdFiles(n).pipe(X(i=>i.Files??[]))}}#a(t){return this.office365Mode()?this.#_(t):this.isByBackupSettings()?this.#h(t):this.#g(t)}#m(t){let e=this.pathDelimiter(),i=t.split("\0").filter(l=>!l.startsWith("-")&&!l.startsWith("+")&&!l.startsWith("@")).filter(Boolean).map(l=>{let s=l.split(e);return s.at(-1)!==""&&s.pop(),s}),r=[S];i.forEach(l=>{l.forEach((s,u)=>{let p=l.slice(0,u+1).join(e)+e;p===""||p===e||r.includes(p)||r.push(p)})});let d=r.map(l=>(this.isLoading.set(l),this.#a(l).pipe(X(s=>({status:"success",value:s,url:l})),Ce(s=>me({status:"error",value:s,url:l})))));fe(d).pipe(ue(()=>this.isLoading.set(null))).subscribe({next:l=>{let s=l.filter(p=>p.status==="success"),u=l.filter(p=>p.status==="error");this.treeNodes.update(p=>{let T=s.flatMap(_=>Array.isArray(_.value)?_.value.map(w=>Z(Y({},w),{parentPath:_.url})):[]),m=[...new Map([...p,...T].map(_=>[_.id,_])).values()];return this.#l(),this.hideShortcuts()?m.filter(_=>!_.id.startsWith("%")):m})}})}#c(t,e){if(e){let n=e["o365:Name"]||e["o365:DisplayName"]||e["gsuite:Name"]||e["gsuite:DisplayName"];if(n)return n}return t}#f(t){t&&t.ExtType&&t.ExtType.length>0&&this.hasExtendedData.emit(t.ExtType)}#t(t,e){return t.startsWith("%")&&t.endsWith("%")||t.endsWith(e)}#n(t=null,e=S){let n=this.pathDelimiter();this.isLoading.set(e),this.#a(e).pipe(ue(()=>this.isLoading.set(null))).subscribe({next:i=>{let r=this.isByBackupSettings()||this.office365Mode()?i.map(d=>(this.#f(d.Metadata),{text:this.#c(d.Path.split(n).filter(s=>s!=="").pop(),d.Metadata),id:d.Path,cls:this.#t(d.Path,n)?"folder":"file",leaf:t!==null,resolvedpath:d.Path,hidden:!1})):i;this.treeNodes.update(d=>{let l=r.map(u=>{let p=this.#t(u.id,n)?"folder":"file";return Z(Y({},u),{cls:p,parentPath:e})}),s=[...new Map([...d,...l].map(u=>[u.id,u])).values()];return this.hideShortcuts()?s.filter(u=>!u.id.startsWith("%")):s})}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=V({type:o,selectors:[["app-file-tree"]],viewQuery:function(e,n){e&1&&Ne(n.treeContainerRef,rt,5)(n.formRef,st,5),e&2&&Se(2)},hostVars:2,hostBindings:function(e,n){e&2&&R("disabled",n.disabled())},inputs:{multiSelect:[1,"multiSelect"],disabled:[1,"disabled"],showFiles:[1,"showFiles"],selectFiles:[1,"selectFiles"],accepts:[1,"accepts"],startingPath:[1,"startingPath"],rootPaths:[1,"rootPaths"],initialNodes:[1,"initialNodes"],backupSettings:[1,"backupSettings"],pathRefreshTrigger:[1,"pathRefreshTrigger"],showHiddenNodes:[1,"showHiddenNodes"],enableCreateFolder:[1,"enableCreateFolder"],hideShortcuts:[1,"hideShortcuts"],office365Mode:[1,"office365Mode"],backupId:[1,"backupId"],sourcePrefix:[1,"sourcePrefix"],destinationUrl:[1,"destinationUrl"],loadExtendedData:[1,"loadExtendedData"]},outputs:{hasExtendedData:"hasExtendedData"},ngContentSelectors:at,decls:18,vars:17,consts:()=>{let t;t=$localize` Browse path `;let e;e=$localize` Manually type path `;let n;n=$localize` Show hidden ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let i;i=$localize` Create folder `;let r;r=$localize`Enter new folder path`;let d;return d=$localize` Create folder ${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:folder-plus${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["treeContainer",""],["recursiveTree",""],["formRef",""],["treeNode",""],t,e,n,i,r,d,[1,"type-b","small"],[1,"section"],[1,"browse-files"],[1,"indeterminate","primary"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"footer"],[1,"primary","raised","browse-files-toggle",3,"active"],["shButton","","type","button",1,"small","create-folder",3,"disabled"],[1,"form-field"],[3,"isOpen","options"],["type","button",3,"click"],["action","",3,"click"],[1,"icon"],[1,"primary"],[1,"text",3,"click"],[1,"small"],[1,"primary","raised","browse-files-toggle",3,"click"],["shButton","","type","button",1,"small","create-folder",3,"click","disabled"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click","disabled"]]},template:function(e,n){if(e&1&&(W(lt),O(0,gt,5,4,"sh-button-group",10),a(1,"div",11),v(2,0,["ngProjectAs","label",5,["label"]]),a(3,"div",12,0),O(5,_t,1,0,"sh-progress-bar",13),q(6,yt,3,2,"ng-template",null,1,xe)(8,Dt,1,0,"ng-container",14),c(),a(9,"div",15),O(10,xt,2,3,"sh-toggle",16),O(11,Rt,2,1,"button",17),c()(),a(12,"div",18,2)(14,"sh-form-field"),v(15,1,["ngProjectAs","label",5,["label"]]),v(16,2,["ngProjectAs","input",5,["input"]]),c()(),O(17,wt,17,6,"sh-dialog",19)),e&2){let i=ge(7);F(!n.multiSelect()&&!n.office365Mode()?0:-1),g(),R("hidden",n.pathDiscoveryMethod()!=="browse"),g(2),R("visualize-accepted",n.accepts()),g(2),F(n.isLoading()!=null?5:-1),g(3),P("ngTemplateOutlet",i)("ngTemplateOutletContext",le(15,Ke,le(13,ct,n.treeStructure()))),g(2),F(!n.accepts()&&!n.isByBackupSettings()&&!n.office365Mode()?10:-1),g(),F(n.enableCreateFolder()&&!n.office365Mode()?11:-1),g(),R("hidden",n.pathDiscoveryMethod()!=="path"),g(5),F(n.createFolderDialogOpen()?17:-1)}},dependencies:[de,ke,Ge,Ie,J,$e,Ve,Ae,we,H,G,z,j],styles:['[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem}.disabled[_nghost-%COMP%]{opacity:.5;-webkit-user-select:none;user-select:none;pointer-events:none;position:relative}.disabled[_nghost-%COMP%]:before{content:"";position:absolute;inset:0;background:transparent}.fill[_nghost-%COMP%]{height:auto;overflow:hidden;flex:1 0}.fill[_nghost-%COMP%] .section[_ngcontent-%COMP%]{height:auto;overflow:hidden;flex:1 0;display:grid;grid-template-columns:1fr auto;grid-template-rows:auto 1fr;grid-template-areas:"label toggle" "tree tree"}.fill[_nghost-%COMP%] .browse-files[_ngcontent-%COMP%]{resize:none;height:initial;grid-area:tree}.fill[_nghost-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.fill[_nghost-%COMP%] sh-toggle[_ngcontent-%COMP%]{grid-area:toggle;flex-direction:row-reverse}.section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.form-field.hidden[_ngcontent-%COMP%]{display:none}.browse-files[_ngcontent-%COMP%]{display:flex;gap:.5rem;padding:.5rem 1rem;height:12.5rem;border:1px solid var(--base-4);border-radius:var(--shape-3);overflow:auto;resize:vertical;background:var(--base-1);position:relative}.browse-files[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]:not(.accepted){opacity:.5}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action].accepted[_ngcontent-%COMP%]{opacity:1}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%]{--list-active-bg: var(--base-3);gap:.125rem;padding:0;height:min-content;min-width:min-content}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]{padding:0;gap:0;border:1px solid transparent}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].active[_ngcontent-%COMP%]{border-color:transparent;--list-active-bg: var(--primary-2)}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].indeterminate[_ngcontent-%COMP%]{border-color:var(--primary-4)}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].usually-hidden[_ngcontent-%COMP%]{opacity:.6}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%]{gap:.25rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]:has(sh-icon:nth-child(2)){width:3rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:1.5rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].loading[_ngcontent-%COMP%]{opacity:.7}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;height:100%;width:max-content;display:flex;align-items:center}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:3rem;gap:.25rem;height:1.5rem;display:flex;align-items:center;justify-content:center;cursor:pointer}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon.file[_ngcontent-%COMP%]{width:3rem;padding:0 .25rem}.browse-files-toggle[_ngcontent-%COMP%]{color:var(--base-9)}.hidden[_ngcontent-%COMP%]{display:none}.footer[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:space-between;align-items:center}'],changeDetection:0})};var It=[[["label"]],[["","prefix",""]],[["","suffix",""]]],At=["label","[prefix]","[suffix]"];function Lt(o,t){if(o&1){let e=A();a(0,"button",7),y("click",function(){let i=b(e).$implicit,r=h();return N(r.updateUnit(i.value))}),I(1,1),c()}if(o&2){let e=t.$implicit;g(),K(e.label),Q(1)}}var kt=[{value:"s",label:$localize`Seconds`},{value:"m",label:$localize`Minutes`},{value:"h",label:$localize`Hours`}],$t=[{value:"Y",label:$localize`Years`},{value:"M",label:$localize`Months`},{value:"W",label:$localize`Weeks`},{value:"D",label:$localize`Days`}],Bt=["retry-delay","web-timeout","read-write-timeout","run-script-timeout","list-timeout","short-timeout"],Ye=class o{customId=f();inputType=f();timespan=C(0);#e="D";unit=C(this.#e);unitLabel=D(()=>{let t=this.timeOptions(),e=t.findIndex(n=>n.value===this.unit());return t[e]?.label??this.unit()});isShortTime=D(()=>{let t=this.inputType();return t&&Bt.includes(t.replace("--",""))});timeOptions=D(()=>this.isShortTime()?kt:$t);readonly=C(!1);onChange=()=>{};onTouched=()=>{};onChangeEffect=x(()=>{this.onChange(this.getValue())});inputTypeEffect=x(()=>{let t=this.timeOptions(),e=this.isShortTime()?"s":"D";this.#e=e,this.unit.set(e)});updateUnit(t){this.unit.set(t)}writeValue(t){let e=this.isShortTime();if(t){let n=e?/(\d+)([smh])/i:/^(\d+)([YMWD])$/i,i=t.match(n);i?(this.timespan.set(parseInt(i[1],10)),this.unit.set(i[2])):(this.timespan.set(0),this.unit.set(this.#e))}else this.timespan.set(0),this.unit.set(this.#e)}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.readonly.set(t)}getValue(){return`${this.timespan()}${this.unit()}`}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=V({type:o,selectors:[["app-timespan"]],inputs:{customId:[1,"customId"],inputType:[1,"inputType"]},features:[se([{provide:ae,useExisting:o,multi:!0}])],ngContentSelectors:At,decls:11,vars:6,consts:()=>{let t;t=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let e;return e=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION:`,[t,e,["type","number",3,"ngModelChange","id","ngModel","disabled"],[3,"openIndicator"],["shButton","","type","button",1,"trigger"],["menu",""],["shButton","","type","button",1,"small"],["shButton","","type","button",1,"small",3,"click"]]},template:function(e,n){e&1&&(W(It),v(0,0,["ngProjectAs","label",5,["label"]]),a(1,"sh-form-field")(2,"input",2),$("ngModelChange",function(r){return k(n.timespan,r)||(n.timespan=r),r}),c(),v(3,1),v(4,2),c(),a(5,"sh-menu",3)(6,"button",4),I(7,0),c(),Ee(8,5),ne(9,Lt,2,1,"button",6,Te),Me(),c()),e&2&&(g(),te("readonly",n.readonly()||void 0),g(),P("id",n.customId()),L("ngModel",n.timespan),P("disabled",n.readonly()),g(3),P("openIndicator",!0),g(2),K(n.unitLabel()),Q(7),g(2),ie(n.timeOptions()))},dependencies:[Be,J,H,G,ce,z,j,de],styles:['[_nghost-%COMP%]{display:grid;grid-template-areas:"label label" "input unit";grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{grid-area:label;grid-column:1/-1}[_nghost-%COMP%] sh-form-field[_ngcontent-%COMP%]{grid-area:input}[_nghost-%COMP%] sh-menu[_ngcontent-%COMP%]{grid-area:unit}[_nghost-%COMP%] sh-menu[_ngcontent-%COMP%] button.trigger[_ngcontent-%COMP%]{width:100%}'],changeDetection:0})};export{it as a,ot as b,Je as c,he as d,Ye as e};
@@ -1 +1 @@
1
- import{g as C}from"./chunk-K6G7ALTG.js";import"./chunk-OL7C46LY.js";import{a as k}from"./chunk-EE27B3OV.js";import"./chunk-Q74O3CWJ.js";import{p as w}from"./chunk-P3D2ZP6W.js";import"./chunk-HRHF3TYJ.js";import"./chunk-IMHM7ISI.js";import"./chunk-6LAXPU22.js";import"./chunk-BFTGDQ4K.js";import"./chunk-QHBOEY2O.js";import"./chunk-NK5WD6WE.js";import"./chunk-B62TPRVG.js";import"./chunk-6Q6SSTBK.js";import"./chunk-SZUNW4JO.js";import"./chunk-TL4WOQKT.js";import"./chunk-7LTHH6OG.js";import"./chunk-HSHF5HR7.js";import"./chunk-5LBG6MOL.js";import"./chunk-D6IP567E.js";import{b as u}from"./chunk-VDSX2M4H.js";import"./chunk-ZU6T3TW3.js";import"./chunk-HUZXJWCG.js";import"./chunk-7TWUW4XJ.js";import{M as W,R as y}from"./chunk-UNMDSCAN.js";import"./chunk-CFNARBNK.js";import{a as A,b as $,c as M,d as I,e as G,f as v}from"./chunk-I27PVH6D.js";import"./chunk-5VE6P5U5.js";import"./chunk-PO3L6MKW.js";import"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.js";import{Ab as n,Bb as s,Pa as r,Pb as F,Qb as l,W as c,Xb as O,cb as D,gc as L,la as f,na as P,sb as E,tb as g,wc as N,xc as R,yb as _,yc as p,zb as o}from"./chunk-26Z7TPJB.js";import"./chunk-7CGTOI24.js";var b=()=>["/restore-from-files/destination"],x=()=>["/restore-from-files/encryption"],H=()=>["/restore-from-files/select-files"],J=()=>["/restore-from-files/options"],X=t=>["/restore",t,"select-files"],z=t=>["/restore",t,"options"];function B(t,i){t&1&&(o(0,"div",7),F(1,0),s(2,"sh-radio"),l(),n(),o(3,"div",7),F(4,1),s(5,"sh-radio"),l(),n(),o(6,"div",8),F(7,2),s(8,"sh-radio"),l(),n(),o(9,"div",8),F(10,3),s(11,"sh-radio"),l(),n()),t&2&&(_("routerLink",R(4,b)),r(3),_("routerLink",R(5,x)),r(3),_("routerLink",R(6,H)),r(3),_("routerLink",R(7,J)))}function U(t,i){if(t&1&&(o(0,"div",7),F(1,4),s(2,"sh-radio"),l(),n(),o(3,"div",7),F(4,5),s(5,"sh-radio"),l(),n()),t&2){let e=O(2);_("routerLink",p(2,X,e.backupId())),r(3),_("routerLink",p(4,z,e.backupId()))}}function j(t,i){if(t&1&&(o(0,"sh-stepper",6),E(1,B,12,8)(2,U,6,6),n()),t&2){let e=O();r(),g(e.isFileRestore()?1:2)}}var h=class t{#e=c($);#i=c(I);#t=c(C);#o=u(this.#e.params);#n=u(this.#e.url);#s=u(this.#e.children[0].url);backupId=this.#t.backupId;isFileRestore=this.#t.isFileRestore;isProgressPage=f(!1);paramsChanged=P(()=>{let i=this.#s(),e=this.#o()?.id,a=!!this.#n()?.find(S=>S.path==="restore-from-files"),T=!!i?.find(S=>S.path==="progress");this.isProgressPage.set(T),this.#t.init(e,a)});ngOnInit(){this.#i.events.subscribe(i=>{if(i instanceof A){let e=i.urlAfterRedirects;this.isProgressPage.set(e.includes("progress"))}})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=D({type:t,selectors:[["app-restore-flow"]],hostVars:2,hostBindings:function(e,a){e&2&&L("full-width",a.isProgressPage())},features:[N([C,w])],decls:4,vars:1,consts:()=>{let i;i=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_RADIO: Destination `;let e;e=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_RADIO: Encryption `;let a;a=$localize`${"\uFFFD#8\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_SH_RADIO: Select files `;let T;T=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `;let S;S=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_RADIO: Select files `;let m;return m=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `,[i,e,a,T,S,m,[1,"primary"],["step","","routerLinkActive","active",3,"routerLink"],["step","","routerLinkActive","active",1,"inactive",3,"routerLink"]]},template:function(e,a){e&1&&(s(0,"app-status-bar"),E(1,j,3,1,"sh-stepper",6),o(2,"section"),s(3,"router-outlet"),n()),e&2&&(r(),g(a.isProgressPage()?-1:1))},dependencies:[y,W,k,M,G,v],styles:["[_nghost-%COMP%]{display:block}.full-width[_nghost-%COMP%] section[_ngcontent-%COMP%]{max-width:62.5rem}sh-stepper[_ngcontent-%COMP%]{max-width:31.25rem;margin:2.5rem auto}section[_ngcontent-%COMP%]{max-width:31.25rem;margin:0 auto 2.5rem}.inactive[_ngcontent-%COMP%]{pointer-events:none;opacity:.5}"],changeDetection:0})};export{h as default};
1
+ import{g as C}from"./chunk-4I55TVYE.js";import"./chunk-TXFTUL4R.js";import{a as k}from"./chunk-EE27B3OV.js";import"./chunk-Q74O3CWJ.js";import{p as w}from"./chunk-TN6HBIUN.js";import"./chunk-K34VOGDF.js";import"./chunk-IMHM7ISI.js";import"./chunk-6LAXPU22.js";import"./chunk-BFTGDQ4K.js";import"./chunk-QHBOEY2O.js";import"./chunk-NK5WD6WE.js";import"./chunk-B62TPRVG.js";import"./chunk-6Q6SSTBK.js";import"./chunk-SZUNW4JO.js";import"./chunk-TL4WOQKT.js";import"./chunk-7LTHH6OG.js";import"./chunk-HSHF5HR7.js";import"./chunk-5LBG6MOL.js";import"./chunk-D6IP567E.js";import{b as u}from"./chunk-VDSX2M4H.js";import"./chunk-ZU6T3TW3.js";import"./chunk-HUZXJWCG.js";import"./chunk-7TWUW4XJ.js";import{M as W,R as y}from"./chunk-UNMDSCAN.js";import"./chunk-CFNARBNK.js";import{a as A,b as $,c as M,d as I,e as G,f as v}from"./chunk-I27PVH6D.js";import"./chunk-5VE6P5U5.js";import"./chunk-PO3L6MKW.js";import"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.js";import{Ab as n,Bb as s,Pa as r,Pb as F,Qb as l,W as c,Xb as O,cb as D,gc as L,la as f,na as P,sb as E,tb as g,wc as N,xc as R,yb as _,yc as p,zb as o}from"./chunk-26Z7TPJB.js";import"./chunk-7CGTOI24.js";var b=()=>["/restore-from-files/destination"],x=()=>["/restore-from-files/encryption"],H=()=>["/restore-from-files/select-files"],J=()=>["/restore-from-files/options"],X=t=>["/restore",t,"select-files"],z=t=>["/restore",t,"options"];function B(t,i){t&1&&(o(0,"div",7),F(1,0),s(2,"sh-radio"),l(),n(),o(3,"div",7),F(4,1),s(5,"sh-radio"),l(),n(),o(6,"div",8),F(7,2),s(8,"sh-radio"),l(),n(),o(9,"div",8),F(10,3),s(11,"sh-radio"),l(),n()),t&2&&(_("routerLink",R(4,b)),r(3),_("routerLink",R(5,x)),r(3),_("routerLink",R(6,H)),r(3),_("routerLink",R(7,J)))}function U(t,i){if(t&1&&(o(0,"div",7),F(1,4),s(2,"sh-radio"),l(),n(),o(3,"div",7),F(4,5),s(5,"sh-radio"),l(),n()),t&2){let e=O(2);_("routerLink",p(2,X,e.backupId())),r(3),_("routerLink",p(4,z,e.backupId()))}}function j(t,i){if(t&1&&(o(0,"sh-stepper",6),E(1,B,12,8)(2,U,6,6),n()),t&2){let e=O();r(),g(e.isFileRestore()?1:2)}}var h=class t{#e=c($);#i=c(I);#t=c(C);#o=u(this.#e.params);#n=u(this.#e.url);#s=u(this.#e.children[0].url);backupId=this.#t.backupId;isFileRestore=this.#t.isFileRestore;isProgressPage=f(!1);paramsChanged=P(()=>{let i=this.#s(),e=this.#o()?.id,a=!!this.#n()?.find(S=>S.path==="restore-from-files"),T=!!i?.find(S=>S.path==="progress");this.isProgressPage.set(T),this.#t.init(e,a)});ngOnInit(){this.#i.events.subscribe(i=>{if(i instanceof A){let e=i.urlAfterRedirects;this.isProgressPage.set(e.includes("progress"))}})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=D({type:t,selectors:[["app-restore-flow"]],hostVars:2,hostBindings:function(e,a){e&2&&L("full-width",a.isProgressPage())},features:[N([C,w])],decls:4,vars:1,consts:()=>{let i;i=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_RADIO: Destination `;let e;e=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_RADIO: Encryption `;let a;a=$localize`${"\uFFFD#8\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_SH_RADIO: Select files `;let T;T=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `;let S;S=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_RADIO: Select files `;let m;return m=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `,[i,e,a,T,S,m,[1,"primary"],["step","","routerLinkActive","active",3,"routerLink"],["step","","routerLinkActive","active",1,"inactive",3,"routerLink"]]},template:function(e,a){e&1&&(s(0,"app-status-bar"),E(1,j,3,1,"sh-stepper",6),o(2,"section"),s(3,"router-outlet"),n()),e&2&&(r(),g(a.isProgressPage()?-1:1))},dependencies:[y,W,k,M,G,v],styles:["[_nghost-%COMP%]{display:block}.full-width[_nghost-%COMP%] section[_ngcontent-%COMP%]{max-width:62.5rem}sh-stepper[_ngcontent-%COMP%]{max-width:31.25rem;margin:2.5rem auto}section[_ngcontent-%COMP%]{max-width:31.25rem;margin:0 auto 2.5rem}.inactive[_ngcontent-%COMP%]{pointer-events:none;opacity:.5}"],changeDetection:0})};export{h as default};