@duplicati/ngclient 0.0.221 → 0.0.225

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/chunk-2EX5HS5X.js +1 -0
  2. package/{chunk-IQL3REGJ.js → chunk-2KD757N6.js} +1 -1
  3. package/{chunk-OPHQNXYO.js → chunk-2YUSBRXY.js} +1 -1
  4. package/{chunk-F2ZC26DC.js → chunk-35FMFK4I.js} +1 -1
  5. package/{chunk-IG7XUEED.js → chunk-3DHD6GQL.js} +1 -1
  6. package/{chunk-IRT2UBDI.js → chunk-3HYQMG65.js} +1 -1
  7. package/{chunk-3L3SRTPU.js → chunk-3PARK7B7.js} +1 -1
  8. package/chunk-3V25RAVK.js +1 -0
  9. package/{chunk-ELCA5MKF.js → chunk-4ISFDBI3.js} +1 -1
  10. package/chunk-5FQ7HESA.js +1 -0
  11. package/chunk-5QGFYH2A.js +3 -0
  12. package/chunk-5UJN5SN4.js +2 -0
  13. package/{chunk-BLSV7CNZ.js → chunk-6DX35WDO.js} +1 -1
  14. package/{chunk-77IXQ4GU.js → chunk-6WX2UOAN.js} +1 -1
  15. package/{chunk-N2GI5QYJ.js → chunk-7VQ67PEZ.js} +1 -1
  16. package/{chunk-XBAZKJ47.js → chunk-A23UTI46.js} +1 -1
  17. package/chunk-AR5SEBWX.js +1 -0
  18. package/{chunk-EKVZKEQJ.js → chunk-B4QFOJXL.js} +1 -1
  19. package/{chunk-TCXCC5BM.js → chunk-BPHX6VXP.js} +1 -1
  20. package/{chunk-VKQQDCUN.js → chunk-CJKZ27FM.js} +1 -1
  21. package/{chunk-YCJYEQF7.js → chunk-COEGVUM3.js} +1 -1
  22. package/chunk-CQJRBQ6I.js +1 -0
  23. package/{chunk-736PM4LG.js → chunk-E4CYVUYG.js} +1 -1
  24. package/chunk-EBKOJDCT.js +1 -0
  25. package/chunk-EVEI25GQ.js +2 -0
  26. package/{chunk-TVFRVP7K.js → chunk-EXAZ4QZR.js} +1 -1
  27. package/chunk-G7TNRWOU.js +1 -0
  28. package/{chunk-23SRH7FI.js → chunk-GA3CAVSK.js} +1 -1
  29. package/chunk-GKAMSAN5.js +1 -0
  30. package/{chunk-JPCUISZG.js → chunk-GNKCBZMS.js} +1 -1
  31. package/{chunk-N2AU7VKX.js → chunk-HDDAGHHE.js} +1 -1
  32. package/chunk-HLHUPBCV.js +1 -0
  33. package/chunk-HPXIWKIK.js +1 -0
  34. package/chunk-HS3UDQIJ.js +1 -0
  35. package/chunk-HWOUAWOE.js +1 -0
  36. package/chunk-IDJ52K34.js +1 -0
  37. package/chunk-ITN4L52Q.js +1 -0
  38. package/chunk-J7GH3G72.js +1 -0
  39. package/chunk-JBX7YYME.js +1 -0
  40. package/chunk-JCXT6U5P.js +1 -0
  41. package/{chunk-JP2Z2HMH.js → chunk-JNZJE3GC.js} +1 -1
  42. package/chunk-K5XGRFWJ.js +4 -0
  43. package/chunk-KGK4RY3J.js +1 -0
  44. package/{chunk-DSYNIXJF.js → chunk-KNSQLQC6.js} +1 -1
  45. package/chunk-KUNX5APQ.js +1 -0
  46. package/chunk-KX3UP3HV.js +1 -0
  47. package/chunk-KZYRTI62.js +1 -0
  48. package/chunk-LXTSZI4K.js +1 -0
  49. package/chunk-MKI54WTC.js +1 -0
  50. package/chunk-MSIH2OJ5.js +1 -0
  51. package/{chunk-FDYBIC4O.js → chunk-N5XYG3QW.js} +1 -1
  52. package/{chunk-LE24LKH7.js → chunk-NE255HQN.js} +1 -1
  53. package/chunk-NQAD2FBX.js +1 -0
  54. package/chunk-NUV5LHQV.js +1 -0
  55. package/{chunk-RGFJ5UMA.js → chunk-O2HQIEE4.js} +1 -1
  56. package/chunk-O2L2FRYE.js +11 -0
  57. package/chunk-OP7MDR2B.js +1 -0
  58. package/chunk-OSGHJCUU.js +1 -0
  59. package/chunk-OYU6OBKA.js +1 -0
  60. package/{chunk-5KJPC3V5.js → chunk-P2EIEVFT.js} +1 -1
  61. package/{chunk-6JS7B4FW.js → chunk-PDZNQW6F.js} +1 -1
  62. package/{chunk-IMQUTGIK.js → chunk-PEOYNJJM.js} +1 -1
  63. package/chunk-PMF4FTBF.js +1 -0
  64. package/{chunk-CAQ3XMFP.js → chunk-PNQ5BDQN.js} +1 -1
  65. package/{chunk-ACTJSKQZ.js → chunk-PNRFCYAE.js} +1 -1
  66. package/{chunk-GW34KK5A.js → chunk-POVWDK74.js} +1 -1
  67. package/chunk-QW23XWNE.js +1 -0
  68. package/{chunk-PIGMTUUT.js → chunk-SKLSR5GH.js} +1 -1
  69. package/chunk-T7RMSUHE.js +1 -0
  70. package/chunk-TSVSMVY4.js +1 -0
  71. package/chunk-TV7OB7Y4.js +1 -0
  72. package/{chunk-QDDVZ4CR.js → chunk-TWWAK5M6.js} +1 -1
  73. package/{chunk-BKEJZADV.js → chunk-TXCVGOPN.js} +1 -1
  74. package/{chunk-F3JYPWPK.js → chunk-UIVZWXBK.js} +1 -1
  75. package/chunk-UNQKMTFM.js +1 -0
  76. package/{chunk-KZTFESBJ.js → chunk-V2M5YF4E.js} +1 -1
  77. package/{chunk-O2SMJYPC.js → chunk-V2UO7ES2.js} +1 -1
  78. package/{chunk-OLWLWDXZ.js → chunk-VOXTAZLZ.js} +1 -1
  79. package/{chunk-FD5CKX3J.js → chunk-VQLI7RDY.js} +1 -1
  80. package/chunk-VTOEFKZG.js +1 -0
  81. package/chunk-VZNLMGYP.js +2 -0
  82. package/chunk-XUCXLLB4.js +1 -0
  83. package/{chunk-GKGMP6VF.js → chunk-XWML36YQ.js} +1 -1
  84. package/chunk-Y47NRSCA.js +1 -0
  85. package/{chunk-ZC23RK4J.js → chunk-YF6JHIN5.js} +1 -1
  86. package/{chunk-ANSV4G2K.js → chunk-YS4B2B5N.js} +1 -1
  87. package/{chunk-FBU3EBFO.js → chunk-ZGQ2WCM2.js} +1 -1
  88. package/chunk-ZSAEIKEB.js +1 -0
  89. package/chunk-ZXBKGNJU.js +1 -0
  90. package/index.html +1 -1
  91. package/main-S64CL44W.js +1 -0
  92. package/package.json +1 -1
  93. package/chunk-43WATFQS.js +0 -11
  94. package/chunk-4E7D5F6K.js +0 -1
  95. package/chunk-4J6L5OV3.js +0 -1
  96. package/chunk-5JGSXUKD.js +0 -1
  97. package/chunk-5YE4H57F.js +0 -1
  98. package/chunk-5ZRRLJA4.js +0 -1
  99. package/chunk-6NVCDJR6.js +0 -1
  100. package/chunk-ACTATISC.js +0 -1
  101. package/chunk-APSPCDGV.js +0 -1
  102. package/chunk-AXQQEOTT.js +0 -1
  103. package/chunk-BMACDVWX.js +0 -1
  104. package/chunk-COI6UMB5.js +0 -1
  105. package/chunk-CZVTBPNE.js +0 -1
  106. package/chunk-DE4JIJWO.js +0 -1
  107. package/chunk-DHFLXFWF.js +0 -1
  108. package/chunk-E4NQOMJX.js +0 -1
  109. package/chunk-ESLC5LVP.js +0 -1
  110. package/chunk-F3ETZKLK.js +0 -1
  111. package/chunk-FR5RTIOE.js +0 -1
  112. package/chunk-G2BDKU26.js +0 -2
  113. package/chunk-I5DD3Q6J.js +0 -1
  114. package/chunk-JPMKWWZP.js +0 -1
  115. package/chunk-JSZIISFS.js +0 -1
  116. package/chunk-MTL3FBSM.js +0 -1
  117. package/chunk-NPFPMA4P.js +0 -1
  118. package/chunk-O56QUSSI.js +0 -2
  119. package/chunk-OCUE5GMT.js +0 -1
  120. package/chunk-OJVUCHRP.js +0 -1
  121. package/chunk-OL7ADIFI.js +0 -1
  122. package/chunk-PPSQGUOL.js +0 -3
  123. package/chunk-QQWV3FEH.js +0 -1
  124. package/chunk-RDLRXAJU.js +0 -1
  125. package/chunk-SACQFUJE.js +0 -1
  126. package/chunk-TISQKN7N.js +0 -1
  127. package/chunk-TQTOIWBK.js +0 -4
  128. package/chunk-TWAHUXIN.js +0 -1
  129. package/chunk-TZ7MW3NZ.js +0 -2
  130. package/chunk-UTXZPAY6.js +0 -1
  131. package/chunk-UZ4POLDC.js +0 -1
  132. package/chunk-WJBMMY2Y.js +0 -1
  133. package/chunk-XPVATEBM.js +0 -1
  134. package/chunk-XWTB7XRI.js +0 -1
  135. package/chunk-YMFI2Q2X.js +0 -1
  136. package/chunk-YPNN5FBK.js +0 -1
  137. package/chunk-YWBZLU6M.js +0 -1
  138. package/chunk-YYD2JU6T.js +0 -1
  139. package/chunk-ZNYN6ES6.js +0 -1
  140. package/main-IUT3IXX4.js +0 -1
@@ -1 +1 @@
1
- import{a as tt}from"./chunk-TZ7MW3NZ.js";import{k as Ze,n as et}from"./chunk-43WATFQS.js";import{a as ce}from"./chunk-UZ4POLDC.js";import{a as Qe}from"./chunk-YCJYEQF7.js";import{a as A}from"./chunk-IMQUTGIK.js";import{b as Ee}from"./chunk-IQL3REGJ.js";import{b as Ke}from"./chunk-E4NQOMJX.js";import{a as Z}from"./chunk-YYD2JU6T.js";import{B as Q,H as _e,L as Ue,M as Ye,P as He,V as je,W as qe,b as Ve,c as V,e as J,f as z,i as Je,j as X,l as ze,p as U,q as Y,r as H,s as Xe,t as j,v as q,z as le}from"./chunk-VKQQDCUN.js";import{d as K}from"./chunk-DSYNIXJF.js";import{b,d as $}from"./chunk-NPFPMA4P.js";import{ha as ae}from"./chunk-ZC23RK4J.js";import{$b as E,A as De,Ac as me,Cb as O,D as oe,Db as r,Eb as a,F as P,Fb as d,Fc as Se,Gc as We,Hc as Be,I as be,Jb as G,Kb as k,L as $e,M as ne,Mb as D,Qc as h,Sa as c,Tb as m,Ub as S,V as Ae,Vb as F,Wb as de,Xb as pe,Zb as N,_ as p,da as I,ea as M,g as Me,gb as B,kc as xe,lb as ve,m as Le,nc as y,pa as _,pc as Ge,qc as ke,ra as W,sc as ie,tc as se,uc as re,w as ue,wb as T,x as ye,xb as g,zc as we}from"./chunk-TQTOIWBK.js";function _t(i,t){i&1&&(r(0,"p"),F(1,3),a())}function ct(i,t){i&1&&(r(0,"sh-form-field")(1,"label",11),F(2,4),a(),d(3,"input",12),a())}var ot=new H,st=()=>ot.group({passphrase:ot.control("")}),Te=class i{#e=p(K);#t=p(v);#i=p($);#n=p(b);encryptionForm=this.#t.encryptionForm;creatingTemporaryBackup=_(!1);settings=_([]);hasEncryptedBackup=h(()=>{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,o=[];e?o.push({Name:"--passphrase",Value:e}):o.push({Name:"--no-encryption",Value:"true"}),this.settings().forEach(n=>{let s=n.Name?.trim();s&&s!=="--"&&(s.startsWith("--")||(s=`--${s}`),o.push({Name:s,Value:n.Value??""}))}),this.#e.postApiV1Backups({requestBody:{Backup:{TargetURL:t,Settings:o}},temporary:!0}).pipe(P(()=>this.creatingTemporaryBackup.set(!1))).subscribe({next:n=>{let s=n.ID;this.#i.navigate([`/restore-draft/${s}`])},error:n=>{console.error(n)}})}back(){this.#t.isFileRestore()?this.#i.navigate(["destination"],{relativeTo:this.#n.parent}):this.#t.exit()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=B({type:i,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 o;o=$localize`${"\uFFFD#13\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#13\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let n;n=$localize`The backup does not contain encrypted files.`;let s;s=$localize`Enter backup passphrase if defined.`;let l;return l=$localize`Password`,[t,e,o,n,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","autocomplete","disabled","placeholder",s,"formControlName","passphrase"]]},template:function(e,o){e&1&&(r(0,"form",5),N("submit",function(){return o.next()}),T(1,_t,2,0,"p"),T(2,ct,4,0,"sh-form-field"),r(3,"sh-toggle-card"),G(4,6),F(5,0),k(),r(6,"app-options-list",7),re("optionsChange",function(s){return se(o.settings,s)||(o.settings=s),s}),a()(),r(7,"div",8)(8,"button",9),N("click",function(){return o.back()}),m(9,1),d(10,"sh-icon"),S(),a(),r(11,"button",10),m(12,2),d(13,"sh-icon"),S(),a()()()),e&2&&(O("formGroup",o.encryptionForm),c(),g(o.hasEncryptedBackup()?-1:1),c(),g(o.hasEncryptedBackup()||o.showEncryptionField()?2:-1),c(4),ie("options",o.settings),O("hasFreeTextSettings",!0))},dependencies:[j,X,V,J,z,Y,U,_e,q,Q,je,tt],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 rt=()=>({standalone:!0});function ut(i,t){i&1&&d(0,"sh-progress-bar",13)}function dt(i,t){if(i&1&&(y(0),Se(1,"bytes")),i&2){let e=E().$implicit;Ge(" (",We(1,1,e.FileSizes),") ")}}function pt(i,t){i&1&&(r(0,"span",20),F(1,4),a())}function mt(i,t){if(i&1&&(r(0,"div",19),y(1),Se(2,"date"),T(3,dt,2,3),T(4,pt,2,0,"span",20),a()),i&2){let e=t.$implicit;c(),ke(" ",e.Version,": ",Be(2,4,e.Time,"medium")," "),c(2),g(e.FileSizes?3:-1),c(),g(e.IsFullBackup===!1?4:-1)}}function St(i,t){i&1&&d(0,"sh-progress-bar",13)}function Et(i,t){i&1&&(r(0,"sh-icon",28),y(1,"spinner"),a())}function Tt(i,t){i&1&&(r(0,"sh-icon"),y(1,"magnifying-glass"),a())}function gt(i,t){if(i&1){let e=D();r(0,"button",31),N("click",function(){I(e);let n=E(4);return M(n.clearSearch())}),r(1,"sh-icon"),y(2,"x-circle"),a(),r(3,"span"),F(4,8),a()()}}function Ft(i,t){i&1&&(r(0,"span"),F(1,9),a())}function Ct(i,t){if(i&1&&(r(0,"span"),F(1,10),a()),i&2){let e=E(5);c(),de(e.searchResults().length),pe(1)}}function Ot(i,t){if(i&1&&(r(0,"div",30),T(1,Ft,2,0,"span")(2,Ct,2,1,"span"),a()),i&2){let e=E(4);c(),g(e.searchResults().length===0?1:2)}}function Nt(i,t){if(i&1){let e=D();r(0,"div",24)(1,"sh-form-field")(2,"label",25),F(3,6),a(),r(4,"input",26),re("ngModelChange",function(n){I(e);let s=E(3);return se(s.searchQuery,n)||(s.searchQuery=n),M(n)}),N("keydown.enter",function(n){I(e);let s=E(3);return n.preventDefault(),M(s.performSearch())}),a()(),r(5,"button",27),N("click",function(){I(e);let n=E(3);return M(n.performSearch())}),T(6,Et,2,0,"sh-icon",28)(7,Tt,2,0,"sh-icon"),r(8,"span"),F(9,7),a()(),T(10,gt,5,0,"button",29),a(),T(11,Ot,3,1,"div",30)}if(i&2){let e=E(3);c(4),ie("ngModel",e.searchQuery),O("ngModelOptions",me(6,rt)),c(),O("disabled",e.isSearching()||!e.searchQuery().trim()),c(),g(e.isSearching()?6:7),c(4),g(e.isSearchMode()?10:-1),c(),g(e.isSearchMode()&&!e.isSearching()?11:-1)}}function ht(i,t){if(i&1){let e=D();T(0,Nt,12,7),r(1,"app-file-tree",21),N("hasExtendedData",function(n){I(e);let s=E(2);return M(s.extendedDataType.set(n))}),r(2,"label",22),F(3,5),a(),d(4,"input",23),a()}if(i&2){let e=E(2);g(e.canSearch()?0:-1),c(),O("rootPaths",e.rootPaths())("initialNodes",e.initialNodes())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)("loadExtendedData",!0)("searchMode",e.isSearchMode())("searchResults",e.searchResults())}}function ft(i,t){if(i&1){let e=D();r(0,"sh-select",17),N("cleared",function(){I(e);let n=E();return M(n.abortLoading())}),r(1,"input",18),re("ngModelChange",function(n){I(e);let s=E();return se(s.selectOption,n)||(s.selectOption=n),M(n)}),a(),ve(2,mt,5,7,"ng-template"),a(),T(3,St,1,0,"sh-progress-bar",13),T(4,ht,5,9)}if(i&2){let e=E();O("options",e.versionOptions())("isClearable",!1),c(),ie("ngModel",e.selectOption),O("ngModelOptions",me(6,rt)),c(2),g(e.isRepairing()||e.versionOptionsLoading()||e.loadingRootPath()?3:-1),c(),g(e.showFileTree()?4:-1)}}var Fe=new H,at=()=>Fe.group({filesToRestore:Fe.control(""),passphrase:Fe.control(null)}),Ce=class i{#e=p(K);#t=p(v);#i=p(Ke);#n=p(Z);#o=p($);#s=p(b);#a=p(ae);#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=h(()=>this.#t.backup()?.Backup?.IsTemporary??!0);showFileTree=_(!1);backupSettings=_(null);rootPaths=_([]);initialNodes=_([]);loadingRootPath=_(!1);isRepairing=h(()=>this.#r().length>0);loadedVersions=_({});canSearch=h(()=>this.#n.hasV2ListOperations());searchQuery=_("");isSearching=_(!1);searchResults=_([]);hasSearched=_(!1);isSearchMode=h(()=>this.searchQuery().length>0&&this.hasSearched());loadingEffect=W(()=>{if(this.versionOptionsLoading())return;let e=this.versionOptions();if(e&&e?.length>0){let o=e[0].Version;this.selectOption.set(o.toString())}});backupSettingsEffect=W(()=>{let t=this.backupId(),e=this.selectOption(),o=this.isRepairing(),n=this.loadedVersions();if(!e||!t)return;let l=this.versionOptions()?.find(x=>x.Version===parseInt(e))?.Time??null;if(!l)return;let u=`${t}+${l}`,R=n[u];if(this.needsDatabaseRepair()&&(!R||o))return;let L={id:t+"",time:l};this.backupSettings.set(L),this.getRootPath(L)});repairEffect=W(()=>{if(!this.needsDatabaseRepair())return;let t=this.selectOption(),e=this.versionOptions();if(t){let o=e.find(l=>l.Version===parseInt(t));if(o===void 0)return;let n=this.backupId(),s=`${n}+${o.Time}`;if(this.#_===s||(this.#_=s,this.#r().includes(s)))return;this.#r.update(l=>[...l,s]),this.#e.postApiV1BackupByIdRepairupdate({id:n,requestBody:{only_paths:!0,time:o.Time}}).pipe(ne(this.abortLoading$),P(()=>{this.#_=null})).subscribe(l=>{let u=l.ID;this.#i.waitForTaskToComplete(u).pipe(oe(1)).subscribe(()=>{this.#r.update(R=>R.filter(L=>L!==s)),this.loadedVersions.update(R=>(R[s]=!0,R))})})}});getRootPath(t){let e={id:t.id+"",time:t.time,prefixOnly:!0,folderContents:!1},o=t.id+"";this.isRepairing()||this.#l===o||(this.#l=o,this.loadingRootPath.set(!0),this.showFileTree.set(!1),this.#n.hasV2ListOperations()?this.#e.postApiV2BackupListFolder({requestBody:{BackupId:t.id,Time:t.time,Paths:null,PageSize:0,Page:0,ReturnExtended:!0}}).pipe(ne(this.abortLoading$),P(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1),this.#l=null})).subscribe({next:n=>{let s=(n.Data??[]).find(u=>u.Metadata&&u.Metadata.ExtType&&u.Metadata.ExtType.length>0);s&&this.extendedDataType.set(s.Metadata.ExtType);let l=(n.Data??[]).map(u=>u.Path??"");l.length>0?(this.initialNodes.set([]),this.rootPaths.set(l)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}):this.#e.getApiV1BackupByIdFiles(e).pipe(ne(this.abortLoading$),P(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1)})).subscribe({next:n=>{let s=n.Files.map(l=>l.Path??"");s.length>0?(this.initialNodes.set([]),this.rootPaths.set(s)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}))}abortLoading$=new Me;abortLoading(){this.showFileTree.set(!1),this.loadingRootPath.set(!1),this.abortLoading$.next(!0)}displayFn(){let t=this.versionOptions();return e=>{if(!e)return"";let o=t?.find(n=>typeof n.Version=="number"&&n.Version.toString()===e);return o?`${o.Version}: ${this.#a.transform(o.Time,"medium")}`:""}}next(){this.#o.navigate(["options"],{relativeTo:this.#s.parent})}back(){this.#t.isFileRestore()?this.#o.navigate(["encryption"],{relativeTo:this.#s.parent}):this.#t.exit()}performSearch(){let t=this.searchQuery().trim(),e=this.backupSettings();if(!t||!e)return;let n=this.versionOptions()?.find(s=>s.Version===parseInt(this.selectOption()??""))?.Version;n!=null&&(this.isSearching.set(!0),this.searchResults.set([]),this.hasSearched.set(!0),this.#e.postApiV2BackupSearch({requestBody:{BackupId:e.id,Time:null,Version:[n],Filters:[t],Paths:null,PageSize:1e3,Page:0,ReturnExtended:!0}}).pipe(ne(this.abortLoading$),P(()=>this.isSearching.set(!1))).subscribe({next:s=>{this.searchResults.set(s.Data??[])},error:()=>{this.searchResults.set([])}}))}clearSearch(){this.searchQuery.set(""),this.searchResults.set([]),this.hasSearched.set(!1)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=B({type:i,selectors:[["app-select-files"]],features:[we([ae])],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 o;o=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let n;n=$localize`Select an option...`;let s;s=$localize`(partial)`;let l;l=$localize`Path`;let u;u=$localize`Enter search term...`;let R;R=$localize`Search files`;let L;L=$localize`Search`;let x;x=$localize`Clear`;let ee;ee=$localize`0 results found`;let te;return te=$localize`Found ${"\uFFFD0\uFFFD"}:INTERPOLATION: result(s)`,[["formRef",""],t,e,o,s,l,R,L,x,ee,te,[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",n,3,"ngModelChange","ngModel","ngModelOptions"],[1,"custom-option"],[1,"partial"],[3,"hasExtendedData","rootPaths","initialNodes","backupSettings","multiSelect","showFiles","loadExtendedData","searchMode","searchResults"],["for","path"],["type","text","id","path","formControlName","filesToRestore"],[1,"search-container"],["for","search"],["type","text","id","search","placeholder",u,3,"ngModelChange","keydown.enter","ngModel","ngModelOptions"],["shButton","","type","button",1,"small",3,"click","disabled"],[1,"spinner"],["shButton","","type","button",1,"small","secondary"],[1,"search-results-info"],["shButton","","type","button",1,"small","secondary",3,"click"]]},template:function(e,o){e&1&&(r(0,"form",11,0),N("submit",function(){return o.next()}),r(2,"h3",12),F(3,1),a(),T(4,ut,1,0,"sh-progress-bar",13)(5,ft,5,7),r(6,"div",14)(7,"button",15),N("click",function(){return o.back()}),m(8,2),d(9,"sh-icon"),S(),a(),r(10,"button",16),m(11,3),d(12,"sh-icon"),S(),a()()()),e&2&&(O("formGroup",o.selectFilesForm),c(4),g(o.versionOptionsLoading()?4:5),c(5),de(o.isFileRestore()?"Back":"Exit"),pe(8))},dependencies:[Xe,X,V,J,z,Je,j,Y,U,ce,Q,_e,q,He,Ue,ae,Qe],styles:["[_nghost-%COMP%]{display:block;margin-top:2.5rem}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}.search-container[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.search-container[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%]{flex:1}.search-results-info[_ngcontent-%COMP%]{color:var(--base-8);font-size:var(--small)}"],changeDetection:0})};var v=class i{#e=p($);#t=p(b);#i=p(Z);#n=p(le);#o=p(K);backupId=_(null);backup=_(null);destinationTargetUrl=_(null);destinationTestSignal=_(null);selectFilesForm=at();optionsForm=lt();encryptionForm=st();optionsFormSignal=Ee(this.optionsForm.valueChanges);selectFilesFormSignal=Ee(this.selectFilesForm.valueChanges);selectOption=_(null);versionOptionsLoading=_(!1);versionOptions=_([]);isSubmitting=_(!1);isFileRestore=_(!1);isFullWidthPage=_(!1);extendedDataType=_(null);alternateRestorePath=_(null);alternateRestorePathSourcePrefix=_(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,e){this.alternateRestorePath.set(t),this.alternateRestorePathSourcePrefix.set(e)}submit(){this.isSubmitting.set(!0);let t=this.backupId();this.backup()?.Backup?.IsTemporary??!1?this.#o.postApiV1BackupByIdCopytotemp({id:this.backupId()??""}).subscribe({next:o=>{this.#s(o.ID??"")},error:o=>this.showErrorDialog($localize`An error occurred while copying the backup to a temporary location: ${o.message}`)}):this.#s(t??"")}showErrorDialog(t){this.#n.open(A,{data:{title:$localize`Error occured`,message:t,confirmText:$localize`OK`,cancelText:void 0},closed:e=>{}})}#s(t){let e=this.optionsForm.value,o=this.selectFilesForm.value,n=this.selectOption(),s=this.versionOptions()?.find(l=>l.Version===(n&&parseInt(n)));this.#o.postApiV1BackupByIdRestore({id:t??"",requestBody:{paths:o.filesToRestore?.split("\0").map(l=>l.endsWith("/")||l.endsWith("\\")?`${l}*`:l)??[],passphrase:o.passphrase??null,time:s?.Time,restore_path:this.alternateRestorePath()??e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!e.includeMetadata,source_prefix:this.alternateRestorePathSourcePrefix(),connection_string_id:null}}).pipe(P(()=>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.#n.open(A,{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.#o.postApiV2BackupListFilesets({requestBody:{BackupId:t}}).pipe(De(o=>{let n=o?.error?.body?.StatusCode??o?.error?.requestBody?.StatusCode;return n==="EncryptedStorageNoPassphrase"||n==="FolderMissing"||n==="EmptyRemoteFolder"||e===0?Le(()=>o):ye(1e3).pipe($e(()=>this.loadFilesetsWithRetryv2(t,e-1)))}))}getBackup(){let t=this.backupId();this.versionOptionsLoading.set(!0),this.#i.hasV2ListOperations()?ue([this.#o.getApiV1BackupById({id:t}),this.loadFilesetsWithRetryv2(t)]).pipe(oe(1),P(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([e,o])=>{if(o.Error)throw new Error(o.Error);if(!(e.Backup?.IsTemporary??!0)&&e?.Backup?.DBPathExists===!1){this.#n.open(A,{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:s=>{this.#e.navigate(["/backup",t,"database"])}});return}this.versionOptions.set((o.Data??[]).map(s=>({Version:s.Version??-1,IsFullBackup:s.IsFullBackup??void 0,Time:s.Time??"<missing>",FileCount:s.FileCount??void 0,FileSizes:s.FileSizes??void 0}))),this.backup.set(e)},error:e=>{let o=e?.error?.body?.StatusCode??e?.error?.requestBody?.StatusCode,n=o==="EncryptedStorageNoPassphrase",s=o==="FolderMissing",l=o==="EmptyRemoteFolder",u=$localize`An error occurred while loading the backup filesets: ${e.message}`;n&&(u=$localize`The remote storage is encrypted. Please enter the passphrase to access the backup.`),s&&(u=$localize`The backup storage folder was not found.`),l&&(u=$localize`The backup storage folder does not contain any filesets.`),this.#n.open(A,{data:{title:$localize`Failed to load backup filesets`,message:u,confirmText:$localize`OK`,cancelText:void 0},closed:R=>{this.#e.navigate([n?"/restore-from-files/encryption":"/restore-from-files/destination"])}})}}):ue([this.#o.getApiV1BackupById({id:t}),this.#o.getApiV1BackupByIdFilesets({id:t}).pipe(be(3))]).pipe(oe(1),P(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([e,o])=>{this.versionOptions.set(o.map(n=>({Version:n.Version??-1,IsFullBackup:(n.IsFullBackup??1)==1,Time:n.Time??"<missing>",FileCount:n.FileCount??void 0,FileSizes:n.FileSizes??void 0}))),this.backup.set(e)}})}#a(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=Ae({token:i,factory:i.\u0275fac,providedIn:"root"})};function Rt(i,t){if(i&1){let e=D();r(0,"sh-radio",27),m(1,6),d(2,"input",31),S(),a(),r(3,"sh-radio",27),m(4,7),r(5,"input",32),N("click",function(){I(e);let n=E(2);return M(n.chooseCustomRemoteDestination())}),a(),S(),a()}}function Pt(i,t){if(i&1){let e=D();r(0,"sh-radio",27),m(1,8),d(2,"input",31),S(),a(),r(3,"sh-radio",27),m(4,9),r(5,"input",32),N("click",function(){I(e);let n=E(2);return M(n.chooseCustomRemoteDestination())}),a(),S(),a()}}function It(i,t){if(i&1&&(r(0,"app-file-tree",29)(1,"label",33),y(2,"Path"),a(),d(3,"input",34),a()),i&2){let e,o=E(2);O("disabled",((e=o.optionsFormSignal())==null?null:e.restoreFrom)!=="pickLocation")("enableCreateFolder",!0)}}function Mt(i,t){if(i&1&&(r(0,"app-file-tree",30)(1,"label",33),y(2,"Path"),a(),d(3,"input",34),a()),i&2){let e=E(2);O("customRemoteMode",e.extendedDataType())("backupId",e.backupId())("sourcePrefix",e.remoteCustomSourcePrefix())("destinationUrl",e.customDestinationUrl())}}function Lt(i,t){if(i&1&&(T(0,Rt,6,0)(1,Pt,6,0),r(2,"sh-radio",27),m(3,5),d(4,"input",28),S(),a(),T(5,It,4,2,"app-file-tree",29),T(6,Mt,4,4,"app-file-tree",30)),i&2){let e,o=E();g(o.extendedDataType()==="o365"?0:o.extendedDataType()==="gsuite"?1:-1),c(5),g(((e=o.optionsFormSignal())==null?null:e.restoreFrom)==="pickLocation"?5:-1),c(),g(o.showCustomRemoteRestoreTree()?6:-1)}}function yt(i,t){if(i&1&&(r(0,"sh-radio",27),m(1,10),d(2,"input",35),S(),a(),r(3,"sh-radio",27),m(4,11),d(5,"input",28),S(),a(),r(6,"app-file-tree",29)(7,"label",33),y(8,"Path"),a(),d(9,"input",34),a()),i&2){let e,o=E();c(6),O("disabled",((e=o.optionsFormSignal())==null?null:e.restoreFrom)!=="pickLocation")("enableCreateFolder",!0)}}function Dt(i,t){i&1&&(r(0,"app-toggle-card",22),G(1,23),F(2,12),k(),r(3,"sh-toggle",27),m(4,13),d(5,"input",36),S(),a()()),i&2&&O("disableToggle",!0)}function bt(i,t){i&1&&(r(0,"app-toggle-card",22),G(1,23),F(2,14),k(),r(3,"sh-radio",27),m(4,15),d(5,"input",37),S(),a(),r(6,"sh-radio",27),m(7,16),d(8,"input",38),S(),a()(),r(9,"app-toggle-card"),G(10,23),F(11,17),k(),r(12,"sh-toggle",39),m(13,18),d(14,"input",40),S(),a(),r(15,"sh-toggle",39),m(16,19),d(17,"input",41),S(),a()()),i&2&&O("disableToggle",!0)}var w=new H,lt=()=>w.group({restoreFrom:w.control("original"),restoreFromPath:w.control(""),handleExisting:w.control("saveTimestamp"),permissions:w.control(!1),includeMetadata:w.control(!0),customRemoteIgnoreExisting:w.control(!1)}),Oe=class i{#e=p(v);#t=p($);#i=p(b);#n=p(Z);#o=p(le);optionsForm=this.#e.optionsForm;optionsFormSignal=this.#e.optionsFormSignal;isSubmitting=this.#e.isSubmitting;extendedData=this.#e.extendedDataType;remoteCustomTargetUrl=_(null);backupId=h(()=>this.#e.backup()?.Backup?.ID??null);extendedDataType=h(()=>{let t=this.#e.extendedDataType();return t==="o365"?"o365":t==="gsuite"?"gsuite":null});remoteCustomSourceEntry=h(()=>this.#e.backup()?.Backup?.Sources?.filter(t=>t.startsWith("@")&&(t.includes("|office365://")||t.includes("|googleworkspace://")))[0]??null);remoteCustomSourceUrl=h(()=>this.remoteCustomSourceEntry()?.split("|")[1]??null);remoteCustomSourcePrefix=h(()=>this.remoteCustomSourceEntry()?.split("|")[0]??null);customDestinationUrl=h(()=>{let t=this.optionsFormSignal()?.restoreFrom,e=this.extendedDataType()!==null;return t==="same-custom"&&e?this.remoteCustomSourceUrl():t==="other-custom"&&e?this.remoteCustomTargetUrl():null});showCustomRemoteRestoreTree=h(()=>!!(this.optionsFormSignal()?.restoreFrom==="same-custom"&&this.customDestinationUrl()&&this.backupId()||this.optionsFormSignal()?.restoreFrom==="other-custom"&&this.customDestinationUrl()));isCustomRemoteRestore=h(()=>{let t=this.optionsFormSignal()?.restoreFrom;return t==="same-custom"||t==="other-custom"});chooseCustomRemoteDestination(){let t=this.extendedDataType()==="o365"?"office365://":"googleworkspace://";return this.#o.open(et,{maxWidth:"700px",maxHeight:"80vh",width:"100%",closeOnOutsideClick:!1,data:{targetUrlModel:this.remoteCustomTargetUrl()||this.remoteCustomSourceUrl()||t,moduleType:"RestoreDestinationProvider",askToCreate:!0,expectedResult:"any",suppressErrorDialogs:!0,backupId:this.backupId(),sourcePrefix:this.remoteCustomSourcePrefix()}}).closed.subscribe(o=>{o&&(this.remoteCustomTargetUrl.set(o),this.optionsForm.controls.restoreFrom.setValue("other-custom"))}),!1}#s=W(()=>{let t=this.optionsFormSignal()?.restoreFrom;this.extendedDataType()!=null&&(t==="original"||t===void 0)&&(this.optionsForm.controls.restoreFrom.setValue("pickLocation"),this.optionsForm.controls.handleExisting.setValue("overwrite")),this.extendedDataType()==null&&(t==="same-custom"||t==="other-custom")&&(this.optionsForm.controls.restoreFrom.setValue("original"),this.optionsForm.controls.handleExisting.setValue("saveTimestamp"))});goBack(){this.#t.navigate(["select-files"],{relativeTo:this.#i.parent})}submit(){let t=this.#e.selectFilesFormSignal()?.filesToRestore??[];if(t.length>0&&this.optionsFormSignal()?.restoreFrom=="original"&&(t[0].includes("/")?"/":"\\")!==this.#n.systemInfo()?.DirectorySeparator){this.#o.open(A,{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:n=>{n&&this.#e.submit()}});return}if(this.optionsFormSignal()?.restoreFrom==="same-custom"||this.optionsFormSignal()?.restoreFrom==="other-custom"){let o=this.optionsFormSignal()?.restoreFromPath;if(o&&o.startsWith("/")&&(o=o.substring(1)),!o||o.trim()===""){this.#o.open(A,{data:{title:$localize`No path specified`,message:this.extendedDataType()==="gsuite"?$localize`Please choose a path to restore to in the Google Workspace account.`:$localize`Please choose a path to restore to in the Microsoft 365 tenant.`,confirmText:$localize`OK`,cancelText:void 0}});return}let n=this.optionsFormSignal()?.customRemoteIgnoreExisting,s=this.customDestinationUrl()?.substring(this.customDestinationUrl().indexOf("?")),l=this.extendedDataType()==="gsuite"?`@googleworkspace://${encodeURIComponent(o)}${s}&google-ignore-existing=${n?"true":"false"}`:`@office365://${encodeURIComponent(o)}${s}&office365-ignore-existing=${n?"true":"false"}`;this.#e.setAlternateRestorePath(l,this.remoteCustomSourcePrefix()),this.optionsForm.controls.includeMetadata.setValue(!0),this.optionsForm.controls.permissions.setValue(!0)}else this.#e.setAlternateRestorePath(null,null);this.#e.submit()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=B({type:i,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 o;o=$localize`${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let n;n=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `;let s;s=$localize` Local file system ${"\uFFFD#4\uFFFD\uFFFD/#4\uFFFD"}:TAG_INPUT:`;let l;l=$localize` Same Microsoft 365 Tenant ${"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"}:TAG_INPUT:`;let u;u=$localize` Different Microsoft 365 Tenant ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let R;R=$localize` Same Google Workspace Account ${"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"}:TAG_INPUT:`;let L;L=$localize` Different Google Workspace Account ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let x;x=$localize` Original location ${"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"}:TAG_INPUT:`;let ee;ee=$localize` Pick location ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let te;te=$localize`Restore settings`;let f;f=$localize` Ignore existing resources in the destination ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let Ne;Ne=$localize`How do you want to handle existing files?`;let he;he=$localize` Overwrite ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let fe;fe=$localize` Save different versions with timestamp in file name ${"\uFFFD#8\uFFFD\uFFFD/#8\uFFFD"}:TAG_INPUT:`;let Re;Re=$localize`Metadata settings`;let Pe;Pe=$localize` Restore file metadata ${"\uFFFD#14\uFFFD\uFFFD/#14\uFFFD"}:TAG_INPUT:`;let Ie;return Ie=$localize` Restore read/write permissions ${"\uFFFD#17\uFFFD\uFFFD/#17\uFFFD"}:TAG_INPUT:`,[["formRef",""],t,e,o,n,s,l,u,R,L,x,ee,te,f,Ne,he,fe,Re,Pe,Ie,[3,"submit","formGroup"],[1,"title-30"],[3,"disableToggle"],["title",""],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],[1,"raised","primary"],["type","radio","name","restoreFrom","value","pickLocation","formControlName","restoreFrom"],[3,"disabled","enableCreateFolder"],[3,"customRemoteMode","backupId","sourcePrefix","destinationUrl"],["type","radio","name","restoreFrom","value","same-custom","formControlName","restoreFrom"],["type","radio","name","restoreFrom","value","other-custom","formControlName","restoreFrom",3,"click"],["for","path"],["type","text","id","path","formControlName","restoreFromPath"],["type","radio","name","restoreFrom","value","original","formControlName","restoreFrom"],["type","checkbox","formControlName","customRemoteIgnoreExisting"],["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,o){e&1&&(r(0,"form",20,0),N("submit",function(){return o.submit()}),r(2,"h3",21),F(3,1),a(),r(4,"app-toggle-card",22),G(5,23),F(6,2),k(),T(7,Lt,7,3)(8,yt,10,2),a(),T(9,Dt,6,1,"app-toggle-card",22)(10,bt,18,1),r(11,"div",24)(12,"button",25),N("click",function(){return o.goBack()}),m(13,3),d(14,"sh-icon"),S(),a(),r(15,"button",26),m(16,4),d(17,"sh-icon"),S(),a()()()),e&2&&(O("formGroup",o.optionsForm),c(4),O("disableToggle",!0),c(3),g(o.extendedDataType()!==null?7:8),c(2),g(o.isCustomRemoteRestore()?9:10),c(6),xe("loading",o.isSubmitting()))},dependencies:[j,X,V,Ve,ze,J,z,Y,U,Ze,ce,qe,Ye,Q,q],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{lt as a,Oe as b,st as c,Te as d,at as e,Ce as f,v as g};
1
+ import{a as tt}from"./chunk-VZNLMGYP.js";import{k as Ze,n as et}from"./chunk-O2L2FRYE.js";import{a as ce}from"./chunk-2EX5HS5X.js";import{a as Qe}from"./chunk-COEGVUM3.js";import{b as Ee}from"./chunk-2KD757N6.js";import{b as Ke}from"./chunk-OP7MDR2B.js";import{a as A}from"./chunk-PEOYNJJM.js";import{a as Z}from"./chunk-NUV5LHQV.js";import{B as Q,H as _e,L as Ue,M as Ye,P as He,V as je,W as qe,b as Ve,c as V,e as J,f as z,i as Je,j as X,l as ze,p as U,q as Y,r as H,s as Xe,t as j,v as q,z as le}from"./chunk-CJKZ27FM.js";import{d as K}from"./chunk-KNSQLQC6.js";import{b,d as $}from"./chunk-CQJRBQ6I.js";import{ha as ae}from"./chunk-YF6JHIN5.js";import{$ as p,Ac as we,B as De,Bc as me,Db as O,E as oe,Eb as r,Fb as a,G as P,Gb as d,Gc as Se,Hc as We,Ic as Be,J as be,Kb as G,Lb as k,M as $e,N as ne,Nb as D,Rc as h,Ta as c,Ub as m,Vb as S,W as Ae,Wb as F,Xb as de,Yb as pe,_b as N,ac as E,ea as I,fa as M,g as Me,hb as B,lc as xe,m as Le,mb as ve,oc as y,qa as _,qc as Ge,rc as ke,sa as W,tc as ie,uc as se,vc as re,w as ue,x as ye,xb as T,yb as g}from"./chunk-K5XGRFWJ.js";function _t(i,t){i&1&&(r(0,"p"),F(1,3),a())}function ct(i,t){i&1&&(r(0,"sh-form-field")(1,"label",11),F(2,4),a(),d(3,"input",12),a())}var ot=new H,st=()=>ot.group({passphrase:ot.control("")}),Te=class i{#e=p(K);#t=p(v);#i=p($);#n=p(b);encryptionForm=this.#t.encryptionForm;creatingTemporaryBackup=_(!1);settings=_([]);hasEncryptedBackup=h(()=>{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,o=[];e?o.push({Name:"--passphrase",Value:e}):o.push({Name:"--no-encryption",Value:"true"}),this.settings().forEach(n=>{let s=n.Name?.trim();s&&s!=="--"&&(s.startsWith("--")||(s=`--${s}`),o.push({Name:s,Value:n.Value??""}))}),this.#e.postApiV1Backups({requestBody:{Backup:{TargetURL:t,Settings:o}},temporary:!0}).pipe(P(()=>this.creatingTemporaryBackup.set(!1))).subscribe({next:n=>{let s=n.ID;this.#i.navigate([`/restore-draft/${s}`])},error:n=>{console.error(n)}})}back(){this.#t.isFileRestore()?this.#i.navigate(["destination"],{relativeTo:this.#n.parent}):this.#t.exit()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=B({type:i,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 o;o=$localize`${"\uFFFD#13\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#13\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let n;n=$localize`The backup does not contain encrypted files.`;let s;s=$localize`Enter backup passphrase if defined.`;let l;return l=$localize`Password`,[t,e,o,n,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","autocomplete","disabled","placeholder",s,"formControlName","passphrase"]]},template:function(e,o){e&1&&(r(0,"form",5),N("submit",function(){return o.next()}),T(1,_t,2,0,"p"),T(2,ct,4,0,"sh-form-field"),r(3,"sh-toggle-card"),G(4,6),F(5,0),k(),r(6,"app-options-list",7),re("optionsChange",function(s){return se(o.settings,s)||(o.settings=s),s}),a()(),r(7,"div",8)(8,"button",9),N("click",function(){return o.back()}),m(9,1),d(10,"sh-icon"),S(),a(),r(11,"button",10),m(12,2),d(13,"sh-icon"),S(),a()()()),e&2&&(O("formGroup",o.encryptionForm),c(),g(o.hasEncryptedBackup()?-1:1),c(),g(o.hasEncryptedBackup()||o.showEncryptionField()?2:-1),c(4),ie("options",o.settings),O("hasFreeTextSettings",!0))},dependencies:[j,X,V,J,z,Y,U,_e,q,Q,je,tt],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 rt=()=>({standalone:!0});function ut(i,t){i&1&&d(0,"sh-progress-bar",13)}function dt(i,t){if(i&1&&(y(0),Se(1,"bytes")),i&2){let e=E().$implicit;Ge(" (",We(1,1,e.FileSizes),") ")}}function pt(i,t){i&1&&(r(0,"span",20),F(1,4),a())}function mt(i,t){if(i&1&&(r(0,"div",19),y(1),Se(2,"date"),T(3,dt,2,3),T(4,pt,2,0,"span",20),a()),i&2){let e=t.$implicit;c(),ke(" ",e.Version,": ",Be(2,4,e.Time,"medium")," "),c(2),g(e.FileSizes?3:-1),c(),g(e.IsFullBackup===!1?4:-1)}}function St(i,t){i&1&&d(0,"sh-progress-bar",13)}function Et(i,t){i&1&&(r(0,"sh-icon",28),y(1,"spinner"),a())}function Tt(i,t){i&1&&(r(0,"sh-icon"),y(1,"magnifying-glass"),a())}function gt(i,t){if(i&1){let e=D();r(0,"button",31),N("click",function(){I(e);let n=E(4);return M(n.clearSearch())}),r(1,"sh-icon"),y(2,"x-circle"),a(),r(3,"span"),F(4,8),a()()}}function Ft(i,t){i&1&&(r(0,"span"),F(1,9),a())}function Ct(i,t){if(i&1&&(r(0,"span"),F(1,10),a()),i&2){let e=E(5);c(),de(e.searchResults().length),pe(1)}}function Ot(i,t){if(i&1&&(r(0,"div",30),T(1,Ft,2,0,"span")(2,Ct,2,1,"span"),a()),i&2){let e=E(4);c(),g(e.searchResults().length===0?1:2)}}function Nt(i,t){if(i&1){let e=D();r(0,"div",24)(1,"sh-form-field")(2,"label",25),F(3,6),a(),r(4,"input",26),re("ngModelChange",function(n){I(e);let s=E(3);return se(s.searchQuery,n)||(s.searchQuery=n),M(n)}),N("keydown.enter",function(n){I(e);let s=E(3);return n.preventDefault(),M(s.performSearch())}),a()(),r(5,"button",27),N("click",function(){I(e);let n=E(3);return M(n.performSearch())}),T(6,Et,2,0,"sh-icon",28)(7,Tt,2,0,"sh-icon"),r(8,"span"),F(9,7),a()(),T(10,gt,5,0,"button",29),a(),T(11,Ot,3,1,"div",30)}if(i&2){let e=E(3);c(4),ie("ngModel",e.searchQuery),O("ngModelOptions",me(6,rt)),c(),O("disabled",e.isSearching()||!e.searchQuery().trim()),c(),g(e.isSearching()?6:7),c(4),g(e.isSearchMode()?10:-1),c(),g(e.isSearchMode()&&!e.isSearching()?11:-1)}}function ht(i,t){if(i&1){let e=D();T(0,Nt,12,7),r(1,"app-file-tree",21),N("hasExtendedData",function(n){I(e);let s=E(2);return M(s.extendedDataType.set(n))}),r(2,"label",22),F(3,5),a(),d(4,"input",23),a()}if(i&2){let e=E(2);g(e.canSearch()?0:-1),c(),O("rootPaths",e.rootPaths())("initialNodes",e.initialNodes())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)("loadExtendedData",!0)("searchMode",e.isSearchMode())("searchResults",e.searchResults())}}function ft(i,t){if(i&1){let e=D();r(0,"sh-select",17),N("cleared",function(){I(e);let n=E();return M(n.abortLoading())}),r(1,"input",18),re("ngModelChange",function(n){I(e);let s=E();return se(s.selectOption,n)||(s.selectOption=n),M(n)}),a(),ve(2,mt,5,7,"ng-template"),a(),T(3,St,1,0,"sh-progress-bar",13),T(4,ht,5,9)}if(i&2){let e=E();O("options",e.versionOptions())("isClearable",!1),c(),ie("ngModel",e.selectOption),O("ngModelOptions",me(6,rt)),c(2),g(e.isRepairing()||e.versionOptionsLoading()||e.loadingRootPath()?3:-1),c(),g(e.showFileTree()?4:-1)}}var Fe=new H,at=()=>Fe.group({filesToRestore:Fe.control(""),passphrase:Fe.control(null)}),Ce=class i{#e=p(K);#t=p(v);#i=p(Ke);#n=p(Z);#o=p($);#s=p(b);#a=p(ae);#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=h(()=>this.#t.backup()?.Backup?.IsTemporary??!0);showFileTree=_(!1);backupSettings=_(null);rootPaths=_([]);initialNodes=_([]);loadingRootPath=_(!1);isRepairing=h(()=>this.#r().length>0);loadedVersions=_({});canSearch=h(()=>this.#n.hasV2ListOperations());searchQuery=_("");isSearching=_(!1);searchResults=_([]);hasSearched=_(!1);isSearchMode=h(()=>this.searchQuery().length>0&&this.hasSearched());loadingEffect=W(()=>{if(this.versionOptionsLoading())return;let e=this.versionOptions();if(e&&e?.length>0){let o=e[0].Version;this.selectOption.set(o.toString())}});backupSettingsEffect=W(()=>{let t=this.backupId(),e=this.selectOption(),o=this.isRepairing(),n=this.loadedVersions();if(!e||!t)return;let l=this.versionOptions()?.find(x=>x.Version===parseInt(e))?.Time??null;if(!l)return;let u=`${t}+${l}`,R=n[u];if(this.needsDatabaseRepair()&&(!R||o))return;let L={id:t+"",time:l};this.backupSettings.set(L),this.getRootPath(L)});repairEffect=W(()=>{if(!this.needsDatabaseRepair())return;let t=this.selectOption(),e=this.versionOptions();if(t){let o=e.find(l=>l.Version===parseInt(t));if(o===void 0)return;let n=this.backupId(),s=`${n}+${o.Time}`;if(this.#_===s||(this.#_=s,this.#r().includes(s)))return;this.#r.update(l=>[...l,s]),this.#e.postApiV1BackupByIdRepairupdate({id:n,requestBody:{only_paths:!0,time:o.Time}}).pipe(ne(this.abortLoading$),P(()=>{this.#_=null})).subscribe(l=>{let u=l.ID;this.#i.waitForTaskToComplete(u).pipe(oe(1)).subscribe(()=>{this.#r.update(R=>R.filter(L=>L!==s)),this.loadedVersions.update(R=>(R[s]=!0,R))})})}});getRootPath(t){let e={id:t.id+"",time:t.time,prefixOnly:!0,folderContents:!1},o=t.id+"";this.isRepairing()||this.#l===o||(this.#l=o,this.loadingRootPath.set(!0),this.showFileTree.set(!1),this.#n.hasV2ListOperations()?this.#e.postApiV2BackupListFolder({requestBody:{BackupId:t.id,Time:t.time,Paths:null,PageSize:0,Page:0,ReturnExtended:!0}}).pipe(ne(this.abortLoading$),P(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1),this.#l=null})).subscribe({next:n=>{let s=(n.Data??[]).find(u=>u.Metadata&&u.Metadata.ExtType&&u.Metadata.ExtType.length>0);s&&this.extendedDataType.set(s.Metadata.ExtType);let l=(n.Data??[]).map(u=>u.Path??"");l.length>0?(this.initialNodes.set([]),this.rootPaths.set(l)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}):this.#e.getApiV1BackupByIdFiles(e).pipe(ne(this.abortLoading$),P(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1)})).subscribe({next:n=>{let s=n.Files.map(l=>l.Path??"");s.length>0?(this.initialNodes.set([]),this.rootPaths.set(s)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}))}abortLoading$=new Me;abortLoading(){this.showFileTree.set(!1),this.loadingRootPath.set(!1),this.abortLoading$.next(!0)}displayFn(){let t=this.versionOptions();return e=>{if(!e)return"";let o=t?.find(n=>typeof n.Version=="number"&&n.Version.toString()===e);return o?`${o.Version}: ${this.#a.transform(o.Time,"medium")}`:""}}next(){this.#o.navigate(["options"],{relativeTo:this.#s.parent})}back(){this.#t.isFileRestore()?this.#o.navigate(["encryption"],{relativeTo:this.#s.parent}):this.#t.exit()}performSearch(){let t=this.searchQuery().trim(),e=this.backupSettings();if(!t||!e)return;let n=this.versionOptions()?.find(s=>s.Version===parseInt(this.selectOption()??""))?.Version;n!=null&&(this.isSearching.set(!0),this.searchResults.set([]),this.hasSearched.set(!0),this.#e.postApiV2BackupSearch({requestBody:{BackupId:e.id,Time:null,Version:[n],Filters:[t],Paths:null,PageSize:1e3,Page:0,ReturnExtended:!0}}).pipe(ne(this.abortLoading$),P(()=>this.isSearching.set(!1))).subscribe({next:s=>{this.searchResults.set(s.Data??[])},error:()=>{this.searchResults.set([])}}))}clearSearch(){this.searchQuery.set(""),this.searchResults.set([]),this.hasSearched.set(!1)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=B({type:i,selectors:[["app-select-files"]],features:[we([ae])],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 o;o=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let n;n=$localize`Select an option...`;let s;s=$localize`(partial)`;let l;l=$localize`Path`;let u;u=$localize`Enter search term...`;let R;R=$localize`Search files`;let L;L=$localize`Search`;let x;x=$localize`Clear`;let ee;ee=$localize`0 results found`;let te;return te=$localize`Found ${"\uFFFD0\uFFFD"}:INTERPOLATION: result(s)`,[["formRef",""],t,e,o,s,l,R,L,x,ee,te,[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",n,3,"ngModelChange","ngModel","ngModelOptions"],[1,"custom-option"],[1,"partial"],[3,"hasExtendedData","rootPaths","initialNodes","backupSettings","multiSelect","showFiles","loadExtendedData","searchMode","searchResults"],["for","path"],["type","text","id","path","formControlName","filesToRestore"],[1,"search-container"],["for","search"],["type","text","id","search","placeholder",u,3,"ngModelChange","keydown.enter","ngModel","ngModelOptions"],["shButton","","type","button",1,"small",3,"click","disabled"],[1,"spinner"],["shButton","","type","button",1,"small","secondary"],[1,"search-results-info"],["shButton","","type","button",1,"small","secondary",3,"click"]]},template:function(e,o){e&1&&(r(0,"form",11,0),N("submit",function(){return o.next()}),r(2,"h3",12),F(3,1),a(),T(4,ut,1,0,"sh-progress-bar",13)(5,ft,5,7),r(6,"div",14)(7,"button",15),N("click",function(){return o.back()}),m(8,2),d(9,"sh-icon"),S(),a(),r(10,"button",16),m(11,3),d(12,"sh-icon"),S(),a()()()),e&2&&(O("formGroup",o.selectFilesForm),c(4),g(o.versionOptionsLoading()?4:5),c(5),de(o.isFileRestore()?"Back":"Exit"),pe(8))},dependencies:[Xe,X,V,J,z,Je,j,Y,U,ce,Q,_e,q,He,Ue,ae,Qe],styles:["[_nghost-%COMP%]{display:block;margin-top:2.5rem}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}.search-container[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.search-container[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%]{flex:1}.search-results-info[_ngcontent-%COMP%]{color:var(--base-8);font-size:var(--small)}"],changeDetection:0})};var v=class i{#e=p($);#t=p(b);#i=p(Z);#n=p(le);#o=p(K);backupId=_(null);backup=_(null);destinationTargetUrl=_(null);destinationTestSignal=_(null);selectFilesForm=at();optionsForm=lt();encryptionForm=st();optionsFormSignal=Ee(this.optionsForm.valueChanges);selectFilesFormSignal=Ee(this.selectFilesForm.valueChanges);selectOption=_(null);versionOptionsLoading=_(!1);versionOptions=_([]);isSubmitting=_(!1);isFileRestore=_(!1);isFullWidthPage=_(!1);extendedDataType=_(null);alternateRestorePath=_(null);alternateRestorePathSourcePrefix=_(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,e){this.alternateRestorePath.set(t),this.alternateRestorePathSourcePrefix.set(e)}submit(){this.isSubmitting.set(!0);let t=this.backupId();this.backup()?.Backup?.IsTemporary??!1?this.#o.postApiV1BackupByIdCopytotemp({id:this.backupId()??""}).subscribe({next:o=>{this.#s(o.ID??"")},error:o=>this.showErrorDialog($localize`An error occurred while copying the backup to a temporary location: ${o.message}`)}):this.#s(t??"")}showErrorDialog(t){this.#n.open(A,{data:{title:$localize`Error occured`,message:t,confirmText:$localize`OK`,cancelText:void 0},closed:e=>{}})}#s(t){let e=this.optionsForm.value,o=this.selectFilesForm.value,n=this.selectOption(),s=this.versionOptions()?.find(l=>l.Version===(n&&parseInt(n)));this.#o.postApiV1BackupByIdRestore({id:t??"",requestBody:{paths:o.filesToRestore?.split("\0").map(l=>l.endsWith("/")||l.endsWith("\\")?`${l}*`:l)??[],passphrase:o.passphrase??null,time:s?.Time,restore_path:this.alternateRestorePath()??e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!e.includeMetadata,source_prefix:this.alternateRestorePathSourcePrefix(),connection_string_id:null}}).pipe(P(()=>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.#n.open(A,{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.#o.postApiV2BackupListFilesets({requestBody:{BackupId:t}}).pipe(De(o=>{let n=o?.error?.body?.StatusCode??o?.error?.requestBody?.StatusCode;return n==="EncryptedStorageNoPassphrase"||n==="FolderMissing"||n==="EmptyRemoteFolder"||e===0?Le(()=>o):ye(1e3).pipe($e(()=>this.loadFilesetsWithRetryv2(t,e-1)))}))}getBackup(){let t=this.backupId();this.versionOptionsLoading.set(!0),this.#i.hasV2ListOperations()?ue([this.#o.getApiV1BackupById({id:t}),this.loadFilesetsWithRetryv2(t)]).pipe(oe(1),P(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([e,o])=>{if(o.Error)throw new Error(o.Error);if(!(e.Backup?.IsTemporary??!0)&&e?.Backup?.DBPathExists===!1){this.#n.open(A,{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:s=>{this.#e.navigate(["/backup",t,"database"])}});return}this.versionOptions.set((o.Data??[]).map(s=>({Version:s.Version??-1,IsFullBackup:s.IsFullBackup??void 0,Time:s.Time??"<missing>",FileCount:s.FileCount??void 0,FileSizes:s.FileSizes??void 0}))),this.backup.set(e)},error:e=>{let o=e?.error?.body?.StatusCode??e?.error?.requestBody?.StatusCode,n=o==="EncryptedStorageNoPassphrase",s=o==="FolderMissing",l=o==="EmptyRemoteFolder",u=$localize`An error occurred while loading the backup filesets: ${e.message}`;n&&(u=$localize`The remote storage is encrypted. Please enter the passphrase to access the backup.`),s&&(u=$localize`The backup storage folder was not found.`),l&&(u=$localize`The backup storage folder does not contain any filesets.`),this.#n.open(A,{data:{title:$localize`Failed to load backup filesets`,message:u,confirmText:$localize`OK`,cancelText:void 0},closed:R=>{this.#e.navigate([n?"/restore-from-files/encryption":"/restore-from-files/destination"])}})}}):ue([this.#o.getApiV1BackupById({id:t}),this.#o.getApiV1BackupByIdFilesets({id:t}).pipe(be(3))]).pipe(oe(1),P(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([e,o])=>{this.versionOptions.set(o.map(n=>({Version:n.Version??-1,IsFullBackup:(n.IsFullBackup??1)==1,Time:n.Time??"<missing>",FileCount:n.FileCount??void 0,FileSizes:n.FileSizes??void 0}))),this.backup.set(e)}})}#a(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=Ae({token:i,factory:i.\u0275fac,providedIn:"root"})};function Rt(i,t){if(i&1){let e=D();r(0,"sh-radio",27),m(1,6),d(2,"input",31),S(),a(),r(3,"sh-radio",27),m(4,7),r(5,"input",32),N("click",function(){I(e);let n=E(2);return M(n.chooseCustomRemoteDestination())}),a(),S(),a()}}function Pt(i,t){if(i&1){let e=D();r(0,"sh-radio",27),m(1,8),d(2,"input",31),S(),a(),r(3,"sh-radio",27),m(4,9),r(5,"input",32),N("click",function(){I(e);let n=E(2);return M(n.chooseCustomRemoteDestination())}),a(),S(),a()}}function It(i,t){if(i&1&&(r(0,"app-file-tree",29)(1,"label",33),y(2,"Path"),a(),d(3,"input",34),a()),i&2){let e,o=E(2);O("disabled",((e=o.optionsFormSignal())==null?null:e.restoreFrom)!=="pickLocation")("enableCreateFolder",!0)("resolvePaths",!0)}}function Mt(i,t){if(i&1&&(r(0,"app-file-tree",30)(1,"label",33),y(2,"Path"),a(),d(3,"input",34),a()),i&2){let e=E(2);O("customRemoteMode",e.extendedDataType())("backupId",e.backupId())("sourcePrefix",e.remoteCustomSourcePrefix())("destinationUrl",e.customDestinationUrl())}}function Lt(i,t){if(i&1&&(T(0,Rt,6,0)(1,Pt,6,0),r(2,"sh-radio",27),m(3,5),d(4,"input",28),S(),a(),T(5,It,4,3,"app-file-tree",29),T(6,Mt,4,4,"app-file-tree",30)),i&2){let e,o=E();g(o.extendedDataType()==="o365"?0:o.extendedDataType()==="gsuite"?1:-1),c(5),g(((e=o.optionsFormSignal())==null?null:e.restoreFrom)==="pickLocation"?5:-1),c(),g(o.showCustomRemoteRestoreTree()?6:-1)}}function yt(i,t){if(i&1&&(r(0,"sh-radio",27),m(1,10),d(2,"input",35),S(),a(),r(3,"sh-radio",27),m(4,11),d(5,"input",28),S(),a(),r(6,"app-file-tree",29)(7,"label",33),y(8,"Path"),a(),d(9,"input",34),a()),i&2){let e,o=E();c(6),O("disabled",((e=o.optionsFormSignal())==null?null:e.restoreFrom)!=="pickLocation")("enableCreateFolder",!0)("resolvePaths",!0)}}function Dt(i,t){i&1&&(r(0,"app-toggle-card",22),G(1,23),F(2,12),k(),r(3,"sh-toggle",27),m(4,13),d(5,"input",36),S(),a()()),i&2&&O("disableToggle",!0)}function bt(i,t){i&1&&(r(0,"app-toggle-card",22),G(1,23),F(2,14),k(),r(3,"sh-radio",27),m(4,15),d(5,"input",37),S(),a(),r(6,"sh-radio",27),m(7,16),d(8,"input",38),S(),a()(),r(9,"app-toggle-card"),G(10,23),F(11,17),k(),r(12,"sh-toggle",39),m(13,18),d(14,"input",40),S(),a(),r(15,"sh-toggle",39),m(16,19),d(17,"input",41),S(),a()()),i&2&&O("disableToggle",!0)}var w=new H,lt=()=>w.group({restoreFrom:w.control("original"),restoreFromPath:w.control(""),handleExisting:w.control("saveTimestamp"),permissions:w.control(!1),includeMetadata:w.control(!0),customRemoteIgnoreExisting:w.control(!1)}),Oe=class i{#e=p(v);#t=p($);#i=p(b);#n=p(Z);#o=p(le);optionsForm=this.#e.optionsForm;optionsFormSignal=this.#e.optionsFormSignal;isSubmitting=this.#e.isSubmitting;extendedData=this.#e.extendedDataType;remoteCustomTargetUrl=_(null);backupId=h(()=>this.#e.backup()?.Backup?.ID??null);extendedDataType=h(()=>{let t=this.#e.extendedDataType();return t==="o365"?"o365":t==="gsuite"?"gsuite":null});remoteCustomSourceEntry=h(()=>this.#e.backup()?.Backup?.Sources?.filter(t=>t.startsWith("@")&&(t.includes("|office365://")||t.includes("|googleworkspace://")))[0]??null);remoteCustomSourceUrl=h(()=>this.remoteCustomSourceEntry()?.split("|")[1]??null);remoteCustomSourcePrefix=h(()=>this.remoteCustomSourceEntry()?.split("|")[0]??null);customDestinationUrl=h(()=>{let t=this.optionsFormSignal()?.restoreFrom,e=this.extendedDataType()!==null;return t==="same-custom"&&e?this.remoteCustomSourceUrl():t==="other-custom"&&e?this.remoteCustomTargetUrl():null});showCustomRemoteRestoreTree=h(()=>!!(this.optionsFormSignal()?.restoreFrom==="same-custom"&&this.customDestinationUrl()&&this.backupId()||this.optionsFormSignal()?.restoreFrom==="other-custom"&&this.customDestinationUrl()));isCustomRemoteRestore=h(()=>{let t=this.optionsFormSignal()?.restoreFrom;return t==="same-custom"||t==="other-custom"});chooseCustomRemoteDestination(){let t=this.extendedDataType()==="o365"?"office365://":"googleworkspace://";return this.#o.open(et,{maxWidth:"700px",maxHeight:"80vh",width:"100%",closeOnOutsideClick:!1,data:{targetUrlModel:this.remoteCustomTargetUrl()||this.remoteCustomSourceUrl()||t,moduleType:"RestoreDestinationProvider",askToCreate:!0,expectedResult:"any",suppressErrorDialogs:!0,backupId:this.backupId(),sourcePrefix:this.remoteCustomSourcePrefix()}}).closed.subscribe(o=>{o&&(this.remoteCustomTargetUrl.set(o),this.optionsForm.controls.restoreFrom.setValue("other-custom"))}),!1}#s=W(()=>{let t=this.optionsFormSignal()?.restoreFrom;this.extendedDataType()!=null&&(t==="original"||t===void 0)&&(this.optionsForm.controls.restoreFrom.setValue("pickLocation"),this.optionsForm.controls.handleExisting.setValue("overwrite")),this.extendedDataType()==null&&(t==="same-custom"||t==="other-custom")&&(this.optionsForm.controls.restoreFrom.setValue("original"),this.optionsForm.controls.handleExisting.setValue("saveTimestamp"))});goBack(){this.#t.navigate(["select-files"],{relativeTo:this.#i.parent})}submit(){let t=this.#e.selectFilesFormSignal()?.filesToRestore??[];if(t.length>0&&this.optionsFormSignal()?.restoreFrom=="original"&&(t[0].includes("/")?"/":"\\")!==this.#n.systemInfo()?.DirectorySeparator){this.#o.open(A,{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:n=>{n&&this.#e.submit()}});return}if(this.optionsFormSignal()?.restoreFrom==="same-custom"||this.optionsFormSignal()?.restoreFrom==="other-custom"){let o=this.optionsFormSignal()?.restoreFromPath;if(o&&o.startsWith("/")&&(o=o.substring(1)),!o||o.trim()===""){this.#o.open(A,{data:{title:$localize`No path specified`,message:this.extendedDataType()==="gsuite"?$localize`Please choose a path to restore to in the Google Workspace account.`:$localize`Please choose a path to restore to in the Microsoft 365 tenant.`,confirmText:$localize`OK`,cancelText:void 0}});return}let n=this.optionsFormSignal()?.customRemoteIgnoreExisting,s=this.customDestinationUrl()?.substring(this.customDestinationUrl().indexOf("?")),l=this.extendedDataType()==="gsuite"?`@googleworkspace://${encodeURIComponent(o)}${s}&google-ignore-existing=${n?"true":"false"}`:`@office365://${encodeURIComponent(o)}${s}&office365-ignore-existing=${n?"true":"false"}`;this.#e.setAlternateRestorePath(l,this.remoteCustomSourcePrefix()),this.optionsForm.controls.includeMetadata.setValue(!0),this.optionsForm.controls.permissions.setValue(!0)}else this.#e.setAlternateRestorePath(null,null);this.#e.submit()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=B({type:i,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 o;o=$localize`${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let n;n=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `;let s;s=$localize` Local file system ${"\uFFFD#4\uFFFD\uFFFD/#4\uFFFD"}:TAG_INPUT:`;let l;l=$localize` Same Microsoft 365 Tenant ${"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"}:TAG_INPUT:`;let u;u=$localize` Different Microsoft 365 Tenant ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let R;R=$localize` Same Google Workspace Account ${"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"}:TAG_INPUT:`;let L;L=$localize` Different Google Workspace Account ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let x;x=$localize` Original location ${"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"}:TAG_INPUT:`;let ee;ee=$localize` Pick location ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let te;te=$localize`Restore settings`;let f;f=$localize` Ignore existing resources in the destination ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let Ne;Ne=$localize`How do you want to handle existing files?`;let he;he=$localize` Overwrite ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let fe;fe=$localize` Save different versions with timestamp in file name ${"\uFFFD#8\uFFFD\uFFFD/#8\uFFFD"}:TAG_INPUT:`;let Re;Re=$localize`Metadata settings`;let Pe;Pe=$localize` Restore file metadata ${"\uFFFD#14\uFFFD\uFFFD/#14\uFFFD"}:TAG_INPUT:`;let Ie;return Ie=$localize` Restore read/write permissions ${"\uFFFD#17\uFFFD\uFFFD/#17\uFFFD"}:TAG_INPUT:`,[["formRef",""],t,e,o,n,s,l,u,R,L,x,ee,te,f,Ne,he,fe,Re,Pe,Ie,[3,"submit","formGroup"],[1,"title-30"],[3,"disableToggle"],["title",""],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],[1,"raised","primary"],["type","radio","name","restoreFrom","value","pickLocation","formControlName","restoreFrom"],[3,"disabled","enableCreateFolder","resolvePaths"],[3,"customRemoteMode","backupId","sourcePrefix","destinationUrl"],["type","radio","name","restoreFrom","value","same-custom","formControlName","restoreFrom"],["type","radio","name","restoreFrom","value","other-custom","formControlName","restoreFrom",3,"click"],["for","path"],["type","text","id","path","formControlName","restoreFromPath"],["type","radio","name","restoreFrom","value","original","formControlName","restoreFrom"],["type","checkbox","formControlName","customRemoteIgnoreExisting"],["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,o){e&1&&(r(0,"form",20,0),N("submit",function(){return o.submit()}),r(2,"h3",21),F(3,1),a(),r(4,"app-toggle-card",22),G(5,23),F(6,2),k(),T(7,Lt,7,3)(8,yt,10,3),a(),T(9,Dt,6,1,"app-toggle-card",22)(10,bt,18,1),r(11,"div",24)(12,"button",25),N("click",function(){return o.goBack()}),m(13,3),d(14,"sh-icon"),S(),a(),r(15,"button",26),m(16,4),d(17,"sh-icon"),S(),a()()()),e&2&&(O("formGroup",o.optionsForm),c(4),O("disableToggle",!0),c(3),g(o.extendedDataType()!==null?7:8),c(2),g(o.isCustomRemoteRestore()?9:10),c(6),xe("loading",o.isSubmitting()))},dependencies:[j,X,V,Ve,ze,J,z,Y,U,Ze,ce,qe,Ye,Q,q],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{lt as a,Oe as b,st as c,Te as d,at as e,Ce as f,v as g};
@@ -1 +1 @@
1
- import{a as w}from"./chunk-YYD2JU6T.js";import{J as k,v as D}from"./chunk-VKQQDCUN.js";import"./chunk-DSYNIXJF.js";import"./chunk-N2AU7VKX.js";import{aa as A}from"./chunk-ZC23RK4J.js";import"./chunk-OPHQNXYO.js";import{$b as a,Ab as I,Bb as v,Bc as m,Cb as f,Cc as F,Db as r,Eb as l,Jc as $,Lb as g,Mb as M,Qc as R,Sa as c,Vb as N,Zb as E,_ as O,da as T,ea as h,gb as x,ic as C,jc as P,kc as y,lb as p,nc as s,oc as b,pa as _,wb as d,xb as u}from"./chunk-TQTOIWBK.js";import"./chunk-7CGTOI24.js";var Y=e=>({children:e,level:0}),L=e=>({$implicit:e}),j=(e,t)=>({children:e,level:t}),V=(e,t)=>t.id;function z(e,t){if(e&1&&(r(0,"sh-icon"),s(1,"caret-down"),l()),e&2){let n=a().$implicit;y("open",n.isOpen())}}function B(e,t){e&1&&(r(0,"sh-icon"),s(1,"dot"),l())}function J(e,t){e&1&&g(0)}function U(e,t){if(e&1&&p(0,J,1,0,"ng-container",3),e&2){let n=a().$implicit,o=a().$implicit;a();let i=C(3);f("ngTemplateOutlet",i)("ngTemplateOutletContext",m(5,L,F(2,j,n.children,o.level+1)))}}function X(e,t){if(e&1){let n=M();r(0,"div",4,1),E("click",function(){let i=T(n).$implicit,G=a(2);return h(i.children.length>0&&G.toggleNode(i))}),d(2,z,2,2,"sh-icon",5)(3,B,2,0,"sh-icon"),r(4,"div",6),s(5),l()(),d(6,U,1,7,"ng-container")}if(e&2){let n=t.$implicit;y("cannot-toggle",n.children.length===0)("open",n.isOpen()),c(2),u(n.children.length>0?2:3),c(3),b(n.text),c(),u(n.isOpen()?6:-1)}}function q(e,t){if(e&1&&(r(0,"sh-list"),I(1,X,7,7,null,null,V),l()),e&2){let n=t.$implicit;P("padding-left",n.level*.25,"rem"),c(),v(n.children)}}function H(e,t){e&1&&g(0)}var S=class e{#e=O(w);treeStructure=R(()=>{let t=this.#e.systemInfo();return this.processObject(t,0)});toggleNode(t){t.isOpen.update(n=>!n)}processObject(t,n){let o=[];for(let i in t)typeof t[i]=="object"?o.push({id:i,text:i,children:this.processObject(t[i],n+1),level:n,isOpen:_(!1)}):o.push({id:i,text:`${i}: ${t[i]}`,children:[],level:n,isOpen:_(!1)});return o}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=x({type:e,selectors:[["app-server-settings"]],decls:5,vars:6,consts:()=>{let t;return t=$localize`System info`,[["recursiveTree",""],["treeNode",""],t,[4,"ngTemplateOutlet","ngTemplateOutletContext"],["action","",3,"click"],[3,"open"],[1,"text"]]},template:function(n,o){if(n&1&&(r(0,"h3"),N(1,2),l(),p(2,q,3,2,"ng-template",null,0,$)(4,H,1,0,"ng-container",3)),n&2){let i=C(3);c(4),f("ngTemplateOutlet",i)("ngTemplateOutletContext",m(4,L,m(2,Y,o.treeStructure())))}},dependencies:[k,D,A],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;padding:0 2.5rem}h3[_ngcontent-%COMP%]{font:var(--title-30);margin:0 0 1.25rem}sh-icon[_ngcontent-%COMP%]{font-size:1rem}sh-list[_ngcontent-%COMP%]{padding:0}sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]{padding:0}sh-list[_ngcontent-%COMP%] [action].cannot-toggle[_ngcontent-%COMP%]{cursor:initial}"],changeDetection:0})};export{S as default};
1
+ import{a as w}from"./chunk-NUV5LHQV.js";import{J as k,v as D}from"./chunk-CJKZ27FM.js";import"./chunk-KNSQLQC6.js";import"./chunk-HDDAGHHE.js";import{aa as A}from"./chunk-YF6JHIN5.js";import"./chunk-2YUSBRXY.js";import{$ as O,Bb as I,Cb as v,Cc as m,Db as f,Dc as F,Eb as r,Fb as l,Kc as $,Mb as g,Nb as M,Rc as R,Ta as c,Wb as N,_b as E,ac as a,ea as T,fa as h,hb as x,jc as C,kc as P,lc as y,mb as p,oc as s,pc as b,qa as _,xb as d,yb as u}from"./chunk-K5XGRFWJ.js";import"./chunk-7CGTOI24.js";var Y=e=>({children:e,level:0}),L=e=>({$implicit:e}),j=(e,t)=>({children:e,level:t}),V=(e,t)=>t.id;function z(e,t){if(e&1&&(r(0,"sh-icon"),s(1,"caret-down"),l()),e&2){let n=a().$implicit;y("open",n.isOpen())}}function B(e,t){e&1&&(r(0,"sh-icon"),s(1,"dot"),l())}function J(e,t){e&1&&g(0)}function U(e,t){if(e&1&&p(0,J,1,0,"ng-container",3),e&2){let n=a().$implicit,o=a().$implicit;a();let i=C(3);f("ngTemplateOutlet",i)("ngTemplateOutletContext",m(5,L,F(2,j,n.children,o.level+1)))}}function X(e,t){if(e&1){let n=M();r(0,"div",4,1),E("click",function(){let i=T(n).$implicit,G=a(2);return h(i.children.length>0&&G.toggleNode(i))}),d(2,z,2,2,"sh-icon",5)(3,B,2,0,"sh-icon"),r(4,"div",6),s(5),l()(),d(6,U,1,7,"ng-container")}if(e&2){let n=t.$implicit;y("cannot-toggle",n.children.length===0)("open",n.isOpen()),c(2),u(n.children.length>0?2:3),c(3),b(n.text),c(),u(n.isOpen()?6:-1)}}function q(e,t){if(e&1&&(r(0,"sh-list"),I(1,X,7,7,null,null,V),l()),e&2){let n=t.$implicit;P("padding-left",n.level*.25,"rem"),c(),v(n.children)}}function H(e,t){e&1&&g(0)}var S=class e{#e=O(w);treeStructure=R(()=>{let t=this.#e.systemInfo();return this.processObject(t,0)});toggleNode(t){t.isOpen.update(n=>!n)}processObject(t,n){let o=[];for(let i in t)typeof t[i]=="object"?o.push({id:i,text:i,children:this.processObject(t[i],n+1),level:n,isOpen:_(!1)}):o.push({id:i,text:`${i}: ${t[i]}`,children:[],level:n,isOpen:_(!1)});return o}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=x({type:e,selectors:[["app-server-settings"]],decls:5,vars:6,consts:()=>{let t;return t=$localize`System info`,[["recursiveTree",""],["treeNode",""],t,[4,"ngTemplateOutlet","ngTemplateOutletContext"],["action","",3,"click"],[3,"open"],[1,"text"]]},template:function(n,o){if(n&1&&(r(0,"h3"),N(1,2),l(),p(2,q,3,2,"ng-template",null,0,$)(4,H,1,0,"ng-container",3)),n&2){let i=C(3);c(4),f("ngTemplateOutlet",i)("ngTemplateOutletContext",m(4,L,m(2,Y,o.treeStructure())))}},dependencies:[k,D,A],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;padding:0 2.5rem}h3[_ngcontent-%COMP%]{font:var(--title-30);margin:0 0 1.25rem}sh-icon[_ngcontent-%COMP%]{font-size:1rem}sh-list[_ngcontent-%COMP%]{padding:0}sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]{padding:0}sh-list[_ngcontent-%COMP%] [action].cannot-toggle[_ngcontent-%COMP%]{cursor:initial}"],changeDetection:0})};export{S as default};
@@ -1 +1 @@
1
- import{a as K}from"./chunk-736PM4LG.js";import"./chunk-6Q6SSTBK.js";import{a as z}from"./chunk-IMQUTGIK.js";import"./chunk-ANSV4G2K.js";import"./chunk-E4NQOMJX.js";import"./chunk-YYD2JU6T.js";import"./chunk-6JS7B4FW.js";import{B as U,H as x,I as V,W as j,b as E,c as A,e as y,f as R,j as b,p as B,q as $,r as v,t as G,v as k,x as L,z as w}from"./chunk-VKQQDCUN.js";import{d as J}from"./chunk-DSYNIXJF.js";import{d as O,e as M}from"./chunk-NPFPMA4P.js";import"./chunk-O2SMJYPC.js";import"./chunk-N2AU7VKX.js";import"./chunk-ZC23RK4J.js";import"./chunk-OPHQNXYO.js";import{Ac as N,Cb as p,Db as a,Eb as i,F as T,Fb as u,Sa as l,Tb as D,Ub as h,Vb as _,Yb as I,Zb as d,_ as s,gb as f,kc as P,pa as c,wb as C,xb as S}from"./chunk-TQTOIWBK.js";import"./chunk-7CGTOI24.js";var X=()=>["/"];function H(m,o){m&1&&(a(0,"sh-form-field")(1,"label",14),_(2,3),i(),u(3,"input",15),i())}var F=new v,g=class m{#t=s(L);#o=s(w);#i=s(J);#n=s(K);#e=s(O);isImporting=c(!1);isSecureFile=c(!1);isValid=c(!1);importForm=F.group({config:F.control(""),cmdline:F.control(!1),import_metadata:F.control(!1),direct:F.control(!1),passphrase:F.control("")});selectedFile=c([]);onFileDropped(o){let e=o[0];if(e){let t=new FileReader;this.isSecureFile.set(e.type!=="application/json"),t.onload=this.#r.bind(this),t.readAsArrayBuffer(e)}}#r(o){let e=o.target?.result;this.isSecureFile.set(this.#a(e)!=="json"),this.importForm.patchValue({config:this.#s(e)}),this.isValid.set(this.importForm.value.config!=="")}#a(o){let e=new Uint8Array(o);if(e.length>=5&&e[0]===65&&e[1]===69&&e[2]===83&&e[4]===0)return"aes";try{let t=new TextDecoder().decode(o),n=JSON.parse(t);if(typeof n=="object"&&n!==null)return"json"}catch{}return"unknown"}#s(o){let e=new Uint8Array(o),t=e.byteLength,n="";for(let r=0;r<t;r++)n+=String.fromCharCode(e[r]);return btoa(n)}submit(){this.isImporting.set(!0);let o=this.importForm.value.direct??!1;this.#i.postApiV1BackupsImport({requestBody:this.importForm.value}).pipe(T(()=>this.isImporting.set(!1))).subscribe({next:e=>{if(o){this.#t.success("Backup imported successfully."),this.#e.navigate(["/"]);return}let t=this.#n.addDraftBackup(e.data);this.#e.navigate(["/backup-draft",t])},error:e=>{let t=e.message||$localize`Unknown error`;this.#o.open(z,{data:{title:$localize`Failed to import backup`,message:t,confirmText:$localize`OK`,cancelText:void 0}})}})}static \u0275fac=function(e){return new(e||m)};static \u0275cmp=f({type:m,selectors:[["app-import"]],decls:19,vars:8,consts:()=>{let o;o=$localize` Import backup configuration ${"\uFFFD#3\uFFFD"}:START_TAG_DIV:${"\uFFFD#4\uFFFD"}:START_TAG_BUTTON:${"[\uFFFD#5\uFFFD|\uFFFD#7\uFFFD]"}:START_TAG_SH_ICON:arrow-left${"[\uFFFD/#5\uFFFD|\uFFFD/#7\uFFFD]"}:CLOSE_TAG_SH_ICON: Back ${"[\uFFFD/#4\uFFFD|\uFFFD/#6\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#6\uFFFD"}:START_TAG_BUTTON_1:${"[\uFFFD#5\uFFFD|\uFFFD#7\uFFFD]"}:START_TAG_SH_ICON:download-simple${"[\uFFFD/#5\uFFFD|\uFFFD/#7\uFFFD]"}:CLOSE_TAG_SH_ICON: Import ${"[\uFFFD/#4\uFFFD|\uFFFD/#6\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_DIV:`,o=I(o);let e;e=$localize`Import Metadata`;let t;t=$localize`Save now`;let n;return n=$localize`Passphrase`,[o,e,t,n,[1,"actions"],["shButton","","type","button",1,"outlined",3,"routerLink"],["shButton","","type","submit",1,"raised","primary",3,"click","disabled"],["autocomplete","off",3,"formGroup"],["accept",".json,.aes",3,"filesChange","files"],[1,"primary","raised"],["for","importMetadata"],["type","checkbox","formControlName","import_metadata"],["for","direct"],["type","checkbox","formControlName","direct"],["for","passphrase"],["type","password","autocomplete","disabled","formControlName","passphrase"]]},template:function(e,t){e&1&&(a(0,"header")(1,"h3"),D(2,0),a(3,"div",4)(4,"button",5),u(5,"sh-icon"),i(),a(6,"button",6),d("click",function(){return t.submit()}),u(7,"sh-icon"),i()(),h(),i()(),a(8,"form",7)(9,"sh-file-upload",8),d("filesChange",function(r){return t.onFileDropped(r)}),i(),C(10,H,4,0,"sh-form-field"),a(11,"sh-toggle",9)(12,"label",10),_(13,1),i(),u(14,"input",11),i(),a(15,"sh-toggle",9)(16,"label",12),_(17,2),i(),u(18,"input",13),i()()),e&2&&(l(4),p("routerLink",N(7,X)),l(2),P("loading",t.isImporting()),p("disabled",t.isImporting()||!t.isValid()),l(2),p("formGroup",t.importForm),l(),p("files",t.selectedFile()),l(),S(t.isSecureFile()?10:-1))},dependencies:[G,b,A,E,y,R,$,B,M,x,k,U,j,V],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:3rem}h3[_ngcontent-%COMP%]{font:var(--title-30);display:flex;align-items:center;justify-content:space-between}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;max-width:31.25rem}sh-file-upload[_ngcontent-%COMP%]{width:100%}"],changeDetection:0})};export{g as default};
1
+ import{a as K}from"./chunk-E4CYVUYG.js";import"./chunk-6Q6SSTBK.js";import"./chunk-YS4B2B5N.js";import"./chunk-OP7MDR2B.js";import{a as z}from"./chunk-PEOYNJJM.js";import"./chunk-NUV5LHQV.js";import"./chunk-PDZNQW6F.js";import{B as U,H as x,I as V,W as j,b as E,c as A,e as y,f as R,j as b,p as B,q as $,r as v,t as G,v as k,x as L,z as w}from"./chunk-CJKZ27FM.js";import{d as J}from"./chunk-KNSQLQC6.js";import{d as O,e as M}from"./chunk-CQJRBQ6I.js";import"./chunk-V2UO7ES2.js";import"./chunk-HDDAGHHE.js";import"./chunk-YF6JHIN5.js";import"./chunk-2YUSBRXY.js";import{$ as s,Bc as N,Db as p,Eb as a,Fb as i,G as T,Gb as u,Ta as l,Ub as D,Vb as h,Wb as _,Zb as I,_b as d,hb as f,lc as P,qa as c,xb as C,yb as S}from"./chunk-K5XGRFWJ.js";import"./chunk-7CGTOI24.js";var X=()=>["/"];function H(m,o){m&1&&(a(0,"sh-form-field")(1,"label",14),_(2,3),i(),u(3,"input",15),i())}var F=new v,g=class m{#t=s(L);#o=s(w);#i=s(J);#n=s(K);#e=s(O);isImporting=c(!1);isSecureFile=c(!1);isValid=c(!1);importForm=F.group({config:F.control(""),cmdline:F.control(!1),import_metadata:F.control(!1),direct:F.control(!1),passphrase:F.control("")});selectedFile=c([]);onFileDropped(o){let e=o[0];if(e){let t=new FileReader;this.isSecureFile.set(e.type!=="application/json"),t.onload=this.#r.bind(this),t.readAsArrayBuffer(e)}}#r(o){let e=o.target?.result;this.isSecureFile.set(this.#a(e)!=="json"),this.importForm.patchValue({config:this.#s(e)}),this.isValid.set(this.importForm.value.config!=="")}#a(o){let e=new Uint8Array(o);if(e.length>=5&&e[0]===65&&e[1]===69&&e[2]===83&&e[4]===0)return"aes";try{let t=new TextDecoder().decode(o),n=JSON.parse(t);if(typeof n=="object"&&n!==null)return"json"}catch{}return"unknown"}#s(o){let e=new Uint8Array(o),t=e.byteLength,n="";for(let r=0;r<t;r++)n+=String.fromCharCode(e[r]);return btoa(n)}submit(){this.isImporting.set(!0);let o=this.importForm.value.direct??!1;this.#i.postApiV1BackupsImport({requestBody:this.importForm.value}).pipe(T(()=>this.isImporting.set(!1))).subscribe({next:e=>{if(o){this.#t.success("Backup imported successfully."),this.#e.navigate(["/"]);return}let t=this.#n.addDraftBackup(e.data);this.#e.navigate(["/backup-draft",t])},error:e=>{let t=e.message||$localize`Unknown error`;this.#o.open(z,{data:{title:$localize`Failed to import backup`,message:t,confirmText:$localize`OK`,cancelText:void 0}})}})}static \u0275fac=function(e){return new(e||m)};static \u0275cmp=f({type:m,selectors:[["app-import"]],decls:19,vars:8,consts:()=>{let o;o=$localize` Import backup configuration ${"\uFFFD#3\uFFFD"}:START_TAG_DIV:${"\uFFFD#4\uFFFD"}:START_TAG_BUTTON:${"[\uFFFD#5\uFFFD|\uFFFD#7\uFFFD]"}:START_TAG_SH_ICON:arrow-left${"[\uFFFD/#5\uFFFD|\uFFFD/#7\uFFFD]"}:CLOSE_TAG_SH_ICON: Back ${"[\uFFFD/#4\uFFFD|\uFFFD/#6\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#6\uFFFD"}:START_TAG_BUTTON_1:${"[\uFFFD#5\uFFFD|\uFFFD#7\uFFFD]"}:START_TAG_SH_ICON:download-simple${"[\uFFFD/#5\uFFFD|\uFFFD/#7\uFFFD]"}:CLOSE_TAG_SH_ICON: Import ${"[\uFFFD/#4\uFFFD|\uFFFD/#6\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_DIV:`,o=I(o);let e;e=$localize`Import Metadata`;let t;t=$localize`Save now`;let n;return n=$localize`Passphrase`,[o,e,t,n,[1,"actions"],["shButton","","type","button",1,"outlined",3,"routerLink"],["shButton","","type","submit",1,"raised","primary",3,"click","disabled"],["autocomplete","off",3,"formGroup"],["accept",".json,.aes",3,"filesChange","files"],[1,"primary","raised"],["for","importMetadata"],["type","checkbox","formControlName","import_metadata"],["for","direct"],["type","checkbox","formControlName","direct"],["for","passphrase"],["type","password","autocomplete","disabled","formControlName","passphrase"]]},template:function(e,t){e&1&&(a(0,"header")(1,"h3"),D(2,0),a(3,"div",4)(4,"button",5),u(5,"sh-icon"),i(),a(6,"button",6),d("click",function(){return t.submit()}),u(7,"sh-icon"),i()(),h(),i()(),a(8,"form",7)(9,"sh-file-upload",8),d("filesChange",function(r){return t.onFileDropped(r)}),i(),C(10,H,4,0,"sh-form-field"),a(11,"sh-toggle",9)(12,"label",10),_(13,1),i(),u(14,"input",11),i(),a(15,"sh-toggle",9)(16,"label",12),_(17,2),i(),u(18,"input",13),i()()),e&2&&(l(4),p("routerLink",N(7,X)),l(2),P("loading",t.isImporting()),p("disabled",t.isImporting()||!t.isValid()),l(2),p("formGroup",t.importForm),l(),p("files",t.selectedFile()),l(),S(t.isSecureFile()?10:-1))},dependencies:[G,b,A,E,y,R,$,B,M,x,k,U,j,V],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:3rem}h3[_ngcontent-%COMP%]{font:var(--title-30);display:flex;align-items:center;justify-content:space-between}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;max-width:31.25rem}sh-file-upload[_ngcontent-%COMP%]{width:100%}"],changeDetection:0})};export{g as default};
@@ -0,0 +1 @@
1
+ import{b as W}from"./chunk-KZYRTI62.js";import{a as G}from"./chunk-TSVSMVY4.js";import"./chunk-2KD757N6.js";import"./chunk-OP7MDR2B.js";import"./chunk-PEOYNJJM.js";import"./chunk-NUV5LHQV.js";import"./chunk-PDZNQW6F.js";import{B as I,D as x,Y as A,v as w,y as $}from"./chunk-CJKZ27FM.js";import"./chunk-KNSQLQC6.js";import{d as R}from"./chunk-CQJRBQ6I.js";import"./chunk-V2UO7ES2.js";import"./chunk-HDDAGHHE.js";import"./chunk-YF6JHIN5.js";import"./chunk-2YUSBRXY.js";import{$ as d,Ab as m,Bb as p,Bc as N,Cb as f,Db as S,Eb as e,Fb as t,Gb as v,Ta as a,Wb as s,_b as C,hb as y,lc as k,oc as _,pc as u,qa as E,sa as L,tc as h,uc as M,vc as P}from"./chunk-K5XGRFWJ.js";import"./chunk-7CGTOI24.js";var D=()=>({maxWidth:"520px",width:"100%"});function z(r,i){if(r&1&&(e(0,"div",11)(1,"sh-icon",26),_(2,"check-circle"),t(),e(3,"span"),_(4),t()()),r&2){let o=i.$implicit;a(4),u(o)}}function J(r,i){if(r&1&&(e(0,"div",11)(1,"sh-icon",26),_(2,"check-circle"),t(),e(3,"span"),_(4),t()()),r&2){let o=i.$implicit;a(4),u(o)}}var T=class r{#n=d(G);#e=d(R);#t=d(W);hoveringConnect=E(!1);skipDialogOpen=E(!1);hasConnectionLink=E(!1);primaryBenefits=[$localize`Zero-configuration cloud storage`,$localize`Centralized backup reporting and monitoring`,$localize`Remote management from the dashboard`,$localize`Notifcations if backups stop running`];secondaryBenefits=[$localize`Get notified if your backups stop working`,$localize`Access AI powered troubleshooting`,$localize`View all backups from one place`];#i=L(()=>{let i=this.#t.state();i=="unknown"||i=="inactive"||this.setWelcomeShown()});setWelcomeShown(){this.#n.setShownWelcomePage().subscribe(()=>{this.#e.navigate([""])})}openSkipDialog(){this.skipDialogOpen.set(!0)}connect(){let i=this.hasConnectionLink()?"/welcome/connect/link":"/welcome/connect/logon";this.#e.navigate([i])}static \u0275fac=function(o){return new(o||r)};static \u0275cmp=y({type:r,selectors:[["app-select"]],decls:36,vars:7,consts:()=>{let i;i=$localize`Proceed without connecting to console`;let o;o=$localize`Connect to console`;let n;n=$localize`Consolidate all your backup reports in one place.`;let c;c=$localize`I have a connection link`;let l;l=$localize`Are you sure?`;let O;O=$localize`Cancel`;let b;return b=$localize`Proceed without connecting`,[i,o,n,c,l,O,b,[1,"left"],[1,"actionables"],[1,"without-connecting",3,"click"],[1,"benefits"],[1,"benefit"],["shButton","",1,"connect","outlined","primary",3,"mouseenter","mouseleave","click"],[1,"action"],[1,"connection-link-label"],[1,"primary","raised","connection-link-check",3,"checkedChange","checked"],[3,"shTooltip"],[1,"right"],["src","assets/images/console.avif","alt",""],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],[1,"dialog-benefits-header"],[1,"dialog-benefits"],["footer",""],["type","button","shButton","",1,"outlined",3,"click"],[1,"primary"]]},template:function(o,n){o&1&&(e(0,"section",7)(1,"div",8)(2,"div",9),C("click",function(){return n.openSkipDialog()}),s(3,0),t(),e(4,"div",10),p(5,z,5,1,"div",11,m),t(),e(7,"button",12),C("mouseenter",function(){return n.hoveringConnect.set(!0)})("mouseleave",function(){return n.hoveringConnect.set(!1)})("click",function(){return n.connect()}),e(8,"div",13)(9,"h2"),s(10,1),t(),e(11,"p"),s(12,2),t()()(),e(13,"div",14)(14,"sh-checkbox",15),P("checkedChange",function(l){return M(n.hasConnectionLink,l)||(n.hasConnectionLink=l),l}),t(),e(15,"span"),s(16,3),t(),e(17,"sh-icon",16),_(18," information "),t()()()(),e(19,"section",17),v(20,"img",18),t(),e(21,"sh-dialog",19),P("isOpenChange",function(l){return M(n.skipDialogOpen,l)||(n.skipDialogOpen=l),l}),e(22,"header",20)(23,"h3"),s(24,4),t()(),e(25,"div",21)(26,"h4",22),_(27," You can use Duplicati without a Console connection, but connecting to the Console will expand the capabilities of Duplicati. "),t(),e(28,"div",23),p(29,J,5,1,"div",11,m),t()(),e(31,"footer",24)(32,"button",25),C("click",function(){return n.skipDialogOpen.set(!1)}),s(33,5),t(),e(34,"button",25),C("click",function(){return n.setWelcomeShown()}),s(35,6),t()()()),o&2&&(a(5),f(n.primaryBenefits),a(9),h("checked",n.hasConnectionLink),a(3),S("shTooltip","Connection links are used for Enterprise and large-scale installations"),a(2),k("hovering",n.hoveringConnect()),a(2),h("isOpen",n.skipDialogOpen),S("options",N(6,D)),a(8),f(n.secondaryBenefits))},dependencies:[I,x,$,w,A],styles:["[_nghost-%COMP%]{display:grid;grid-template-columns:1fr 2fr;grid-template-rows:1fr;height:100vh;overflow:hidden;padding:2rem}@media only screen and (max-width:768px){[_nghost-%COMP%]{display:flex;flex-direction:column-reverse;height:auto;padding:4rem 1rem;gap:2rem}}.left[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-end;justify-content:center}@media only screen and (max-width:768px){.left[_ngcontent-%COMP%]{align-items:flex-start}}.left[_ngcontent-%COMP%] .actionables[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:1rem}@media only screen and (max-width:768px){.left[_ngcontent-%COMP%] .actionables[_ngcontent-%COMP%]{width:100%}}.left[_ngcontent-%COMP%] .actionables[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:100%}.left[_ngcontent-%COMP%] .actionables[_ngcontent-%COMP%] sh-divider[_ngcontent-%COMP%]{width:100%}.left[_ngcontent-%COMP%] .actionables[_ngcontent-%COMP%] .benefits[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem;padding:1.5rem 0}.left[_ngcontent-%COMP%] .actionables[_ngcontent-%COMP%] .benefits[_ngcontent-%COMP%] .benefit[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;color:var(--base-11)}.left[_ngcontent-%COMP%] .actionables[_ngcontent-%COMP%] .benefits[_ngcontent-%COMP%] .benefit[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:1.25rem;flex-shrink:0}.left[_ngcontent-%COMP%] .actionables[_ngcontent-%COMP%] .benefits[_ngcontent-%COMP%] .benefit[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:.875rem}.right[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;padding:2rem 2rem 2rem 0}.right.hovering[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{border-color:var(--primary-8)}.right[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:90%;max-height:90%;object-fit:contain;border:1px solid var(--base-3);border-radius:var(--shape-2);box-shadow:var(--box-shadow-20);transition:border-color .2s ease-in-out}.connect[_ngcontent-%COMP%]{height:auto;padding:2rem}.without-connecting[_ngcontent-%COMP%]{text-decoration:underline;cursor:pointer;margin:0}.without-connecting[_ngcontent-%COMP%]:hover{color:var(--primary-8)}.dialog-benefits-header[_ngcontent-%COMP%]{margin-bottom:1rem}.dialog-benefits[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;margin-bottom:2rem}.dialog-benefits[_ngcontent-%COMP%] .benefit[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;gap:.5rem;color:var(--base-11)}.dialog-benefits[_ngcontent-%COMP%] .benefit[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:1.25rem;flex-shrink:0}.dialog-benefits[_ngcontent-%COMP%] .benefit[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:.875rem}.connection-link-label[_ngcontent-%COMP%]{display:flex;flex-direction:row;gap:.5rem}"],changeDetection:0})};export{T as default};
@@ -1 +1 @@
1
- import{a as u}from"./chunk-GKGMP6VF.js";import{_ as p,jb as m}from"./chunk-TQTOIWBK.js";var c=class s{#n=p(u);transform(r,t=!1,...d){if(!r)return"";let n=/^\s*(?:(\d+)\.)?(\d{1,2}):(\d{2}):(\d{2})(?:\.\d+)?\s*$/.exec(r);if(!n)return"";let e=parseInt(n[1]??"0",10),i=parseInt(n[2],10),o=parseInt(n[3],10),a=parseInt(n[4],10);return t?`${e?`${e}d `:""}${i}h ${o}m ${a}s`:this.#n.duration({days:e,hours:i,minutes:o,seconds:a}).humanize()}static \u0275fac=function(t){return new(t||s)};static \u0275pipe=m({name:"durationFormat",type:s,pure:!0})};export{c as a};
1
+ import{a as u}from"./chunk-XWML36YQ.js";import{$ as p,kb as m}from"./chunk-K5XGRFWJ.js";var c=class s{#n=p(u);transform(r,t=!1,...d){if(!r)return"";let n=/^\s*(?:(\d+)\.)?(\d{1,2}):(\d{2}):(\d{2})(?:\.\d+)?\s*$/.exec(r);if(!n)return"";let e=parseInt(n[1]??"0",10),i=parseInt(n[2],10),o=parseInt(n[3],10),a=parseInt(n[4],10);return t?`${e?`${e}d `:""}${i}h ${o}m ${a}s`:this.#n.duration({days:e,hours:i,minutes:o,seconds:a}).humanize()}static \u0275fac=function(t){return new(t||s)};static \u0275pipe=m({name:"durationFormat",type:s,pure:!0})};export{c as a};
@@ -1 +1 @@
1
- import{a as s}from"./chunk-GKGMP6VF.js";import{ha as o}from"./chunk-ZC23RK4J.js";import{_ as e,jb as i}from"./chunk-TQTOIWBK.js";var m=class n{#t=e(s);#r=e(o);convertTimestamp(t){let r=/^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})Z$/.exec(t);if(r){let[a,p,f,c,d,u,h]=r;return`${p}-${f}-${c}T${d}:${u}:${h}Z`}return t}transform(t,r=!1,...a){return t?r?this.#r.transform(t,"short"):(this.#t.locale(),typeof t=="string"&&(t=this.convertTimestamp(t)),this.#t(t).fromNow()):"N/A"}static \u0275fac=function(r){return new(r||n)};static \u0275pipe=i({name:"relativeTime",type:n,pure:!0})};export{m as a};
1
+ import{a as s}from"./chunk-XWML36YQ.js";import{ha as o}from"./chunk-YF6JHIN5.js";import{$ as e,kb as i}from"./chunk-K5XGRFWJ.js";var m=class n{#t=e(s);#r=e(o);convertTimestamp(t){let r=/^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})Z$/.exec(t);if(r){let[a,p,f,c,d,u,h]=r;return`${p}-${f}-${c}T${d}:${u}:${h}Z`}return t}transform(t,r=!1,...a){return t?r?this.#r.transform(t,"short"):(this.#t.locale(),typeof t=="string"&&(t=this.convertTimestamp(t)),this.#t(t).fromNow()):"N/A"}static \u0275fac=function(r){return new(r||n)};static \u0275pipe=i({name:"relativeTime",type:n,pure:!0})};export{m as a};