@duplicati/ngclient 0.0.220 → 0.0.223

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 (125) hide show
  1. package/assets/dest-icons/drime.png +0 -0
  2. package/{chunk-22AR7ES3.js → chunk-22JSUCD3.js} +1 -1
  3. package/{chunk-EADZVBRA.js → chunk-2CKH2RVA.js} +1 -1
  4. package/{chunk-IQL3REGJ.js → chunk-2KD757N6.js} +1 -1
  5. package/{chunk-X276XFCH.js → chunk-2VLJLCTO.js} +1 -1
  6. package/{chunk-OPHQNXYO.js → chunk-2YUSBRXY.js} +1 -1
  7. package/{chunk-RRDLQLTM.js → chunk-35ZRBDWM.js} +1 -1
  8. package/{chunk-NHS6CQO2.js → chunk-3BIHFX4H.js} +1 -1
  9. package/chunk-3D6EL52D.js +1 -0
  10. package/chunk-4IRGFIAU.js +1 -0
  11. package/chunk-4J64RICN.js +1 -0
  12. package/{chunk-DSYNIXJF.js → chunk-5E3B4AEF.js} +1 -1
  13. package/{chunk-ANSV4G2K.js → chunk-5W4BSVZJ.js} +1 -1
  14. package/chunk-6JGOGUIX.js +1 -0
  15. package/chunk-6RIKNAXD.js +1 -0
  16. package/{chunk-KDV2OE64.js → chunk-6V4CDRLK.js} +1 -1
  17. package/{chunk-P4R3ERID.js → chunk-7AXKIK5Z.js} +1 -1
  18. package/{chunk-RLWICOKH.js → chunk-7SP45FHP.js} +1 -1
  19. package/chunk-AFHEXZUZ.js +1 -0
  20. package/{chunk-RJ2JM7C7.js → chunk-AXG7WHBS.js} +1 -1
  21. package/{chunk-WOKYULBU.js → chunk-AXLO5KWF.js} +1 -1
  22. package/{chunk-EKVZKEQJ.js → chunk-B4QFOJXL.js} +1 -1
  23. package/{chunk-TCXCC5BM.js → chunk-BPHX6VXP.js} +1 -1
  24. package/{chunk-GN7AO4B6.js → chunk-CEDH3C4K.js} +1 -1
  25. package/{chunk-VKQQDCUN.js → chunk-CJKZ27FM.js} +1 -1
  26. package/{chunk-YCJYEQF7.js → chunk-COEGVUM3.js} +1 -1
  27. package/chunk-CQJRBQ6I.js +1 -0
  28. package/{chunk-5RNU5BNO.js → chunk-CUYURNCQ.js} +1 -1
  29. package/{chunk-ELCA5MKF.js → chunk-CWBB6FON.js} +1 -1
  30. package/{chunk-PXI3UZ4R.js → chunk-DT3A5ZZG.js} +1 -1
  31. package/{chunk-ACTJSKQZ.js → chunk-EAVDZEBJ.js} +1 -1
  32. package/{chunk-FD5CKX3J.js → chunk-F5RBSCC2.js} +1 -1
  33. package/{chunk-ZP3QZ43W.js → chunk-FNWC6U3F.js} +1 -1
  34. package/{chunk-QDDVZ4CR.js → chunk-FQINMZH2.js} +1 -1
  35. package/chunk-FXBX5QMR.js +1 -0
  36. package/{chunk-23SRH7FI.js → chunk-GA3CAVSK.js} +1 -1
  37. package/chunk-GBSP3YAH.js +2 -0
  38. package/{chunk-2J2554EV.js → chunk-GBUTPGY5.js} +1 -1
  39. package/{chunk-JPCUISZG.js → chunk-GNKCBZMS.js} +1 -1
  40. package/{chunk-N2AU7VKX.js → chunk-HDDAGHHE.js} +1 -1
  41. package/{chunk-ZYRB2TUK.js → chunk-HDGXP6C6.js} +1 -1
  42. package/chunk-HLHUPBCV.js +1 -0
  43. package/chunk-HPXIWKIK.js +1 -0
  44. package/chunk-HWOUAWOE.js +1 -0
  45. package/{chunk-IFSZJSGH.js → chunk-JB26UVQP.js} +1 -1
  46. package/chunk-JLANSXSK.js +1 -0
  47. package/chunk-JYRKUYG6.js +1 -0
  48. package/chunk-K5XGRFWJ.js +4 -0
  49. package/{chunk-XXVDL5TR.js → chunk-KI2HT2TI.js} +1 -1
  50. package/{chunk-37ODVJFS.js → chunk-LNKXSLIG.js} +1 -1
  51. package/chunk-MJPEKJ3T.js +2 -0
  52. package/{chunk-RGFJ5UMA.js → chunk-N3TVNDVH.js} +1 -1
  53. package/chunk-NDOIWI7D.js +1 -0
  54. package/chunk-NFATJ2CP.js +1 -0
  55. package/{chunk-UCHK3SHH.js → chunk-O5RZGVMD.js} +1 -1
  56. package/chunk-OETM3ZQK.js +1 -0
  57. package/chunk-OQGMZ5Z4.js +1 -0
  58. package/{chunk-M3PW6DLD.js → chunk-PDGW22XJ.js} +1 -1
  59. package/{chunk-IMQUTGIK.js → chunk-PEOYNJJM.js} +1 -1
  60. package/{chunk-CAQ3XMFP.js → chunk-PNQ5BDQN.js} +1 -1
  61. package/chunk-PVSB5UU6.js +1 -0
  62. package/chunk-QGAOYLQU.js +1 -0
  63. package/chunk-QLW7KAXY.js +1 -0
  64. package/chunk-QZEIAQ3M.js +1 -0
  65. package/chunk-R6FKSUPU.js +1 -0
  66. package/{chunk-FBU3EBFO.js → chunk-RDT3GMNM.js} +1 -1
  67. package/{chunk-UTXZPAY6.js → chunk-RM2KGG7J.js} +1 -1
  68. package/chunk-RTGUYIWH.js +11 -0
  69. package/{chunk-PIGMTUUT.js → chunk-SKLSR5GH.js} +1 -1
  70. package/{chunk-EDLHTWBA.js → chunk-SL34UKL5.js} +1 -1
  71. package/{chunk-4OJPTRZJ.js → chunk-SZLRIYOM.js} +1 -1
  72. package/chunk-TI76HSL2.js +1 -0
  73. package/{chunk-5KJPC3V5.js → chunk-TOV6NJCD.js} +1 -1
  74. package/chunk-TPKKLIFK.js +1 -0
  75. package/{chunk-IG7XUEED.js → chunk-UOMUNAOT.js} +1 -1
  76. package/chunk-UXIWNORE.js +1 -0
  77. package/{chunk-KZTFESBJ.js → chunk-V2M5YF4E.js} +1 -1
  78. package/{chunk-O2SMJYPC.js → chunk-V2UO7ES2.js} +1 -1
  79. package/{chunk-6JS7B4FW.js → chunk-VNXFTYQQ.js} +1 -1
  80. package/{chunk-4E7D5F6K.js → chunk-WJVFREPL.js} +1 -1
  81. package/{chunk-NX35OQ3V.js → chunk-WKQ3ICDB.js} +1 -1
  82. package/{chunk-BZXBH4CN.js → chunk-WULWYGYR.js} +1 -1
  83. package/chunk-X5W2K6AN.js +2 -0
  84. package/{chunk-GKGMP6VF.js → chunk-XWML36YQ.js} +1 -1
  85. package/{chunk-BKEJZADV.js → chunk-XXXS73XL.js} +1 -1
  86. package/{chunk-ZC23RK4J.js → chunk-YF6JHIN5.js} +1 -1
  87. package/{chunk-7C2YZVSQ.js → chunk-YFA6MJ2B.js} +1 -1
  88. package/{chunk-IRT2UBDI.js → chunk-YKF5ZW55.js} +1 -1
  89. package/{chunk-I6MIXWIT.js → chunk-ZKIZ7IIA.js} +1 -1
  90. package/{chunk-BLSV7CNZ.js → chunk-ZTENLO77.js} +1 -1
  91. package/{chunk-XDBSTUYC.js → chunk-ZYYLNYSK.js} +1 -1
  92. package/index.html +1 -1
  93. package/main-NENDDABN.js +1 -0
  94. package/package.json +1 -1
  95. package/chunk-3RCF6UT4.js +0 -1
  96. package/chunk-4J6L5OV3.js +0 -1
  97. package/chunk-4OA2FFS5.js +0 -1
  98. package/chunk-ACTATISC.js +0 -1
  99. package/chunk-AIAUP7OE.js +0 -1
  100. package/chunk-BACKG7KA.js +0 -1
  101. package/chunk-C3PQFWVO.js +0 -1
  102. package/chunk-C6PICAXB.js +0 -1
  103. package/chunk-DJXLNIMV.js +0 -11
  104. package/chunk-DSZ644JT.js +0 -1
  105. package/chunk-EPIYGHPM.js +0 -1
  106. package/chunk-EXMYBMGI.js +0 -1
  107. package/chunk-GRE6GKVP.js +0 -2
  108. package/chunk-N3NJW75G.js +0 -1
  109. package/chunk-NKUA7I47.js +0 -2
  110. package/chunk-NPFPMA4P.js +0 -1
  111. package/chunk-OHYENIPP.js +0 -1
  112. package/chunk-PG4G4RLP.js +0 -1
  113. package/chunk-QOWXL7ZL.js +0 -1
  114. package/chunk-QZQS7M3D.js +0 -1
  115. package/chunk-TQTOIWBK.js +0 -4
  116. package/chunk-VC55KFAX.js +0 -1
  117. package/chunk-XEG3CP74.js +0 -1
  118. package/chunk-XWTB7XRI.js +0 -1
  119. package/chunk-YWBZLU6M.js +0 -1
  120. package/chunk-YWUUX3S6.js +0 -1
  121. package/chunk-ZEFSBETQ.js +0 -2
  122. package/chunk-ZHQI6LYB.js +0 -1
  123. package/chunk-ZNYN6ES6.js +0 -1
  124. package/chunk-ZNYRWXQR.js +0 -1
  125. package/main-7J2QXC6H.js +0 -1
@@ -1 +1 @@
1
- import{a as tt}from"./chunk-GRE6GKVP.js";import{k as Ze,n as et}from"./chunk-DJXLNIMV.js";import{a as ce}from"./chunk-VC55KFAX.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-AIAUP7OE.js";import{a as Z}from"./chunk-C6PICAXB.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 f,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 L,g as Le,gb as B,kc as xe,lb as ve,m as Me,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=f(()=>{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 L(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),L(n)}),N("keydown.enter",function(n){I(e);let s=E(3);return n.preventDefault(),L(s.performSearch())}),a()(),r(5,"button",27),N("click",function(){I(e);let n=E(3);return L(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 ft(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 L(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 ht(i,t){if(i&1){let e=D();r(0,"sh-select",17),N("cleared",function(){I(e);let n=E();return L(n.abortLoading())}),r(1,"input",18),re("ngModelChange",function(n){I(e);let s=E();return se(s.selectOption,n)||(s.selectOption=n),L(n)}),a(),ve(2,mt,5,7,"ng-template"),a(),T(3,St,1,0,"sh-progress-bar",13),T(4,ft,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=f(()=>this.#t.backup()?.Backup?.IsTemporary??!0);showFileTree=_(!1);backupSettings=_(null);rootPaths=_([]);initialNodes=_([]);loadingRootPath=_(!1);isRepairing=f(()=>this.#r().length>0);loadedVersions=_({});canSearch=f(()=>this.#n.hasV2ListOperations());searchQuery=_("");isSearching=_(!1);searchResults=_([]);hasSearched=_(!1);isSearchMode=f(()=>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 M={id:t+"",time:l};this.backupSettings.set(M),this.getRootPath(M)});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(M=>M!==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 Le;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 M;M=$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,M,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,ht,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?Me(()=>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 L(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 L(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 Lt(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 Mt(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,Lt,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=f(()=>this.#e.backup()?.Backup?.ID??null);extendedDataType=f(()=>{let t=this.#e.extendedDataType();return t==="o365"?"o365":t==="gsuite"?"gsuite":null});remoteCustomSourceEntry=f(()=>this.#e.backup()?.Backup?.Sources?.filter(t=>t.startsWith("@")&&(t.includes("|office365://")||t.includes("|googleworkspace://")))[0]??null);remoteCustomSourceUrl=f(()=>this.remoteCustomSourceEntry()?.split("|")[1]??null);remoteCustomSourcePrefix=f(()=>this.remoteCustomSourceEntry()?.split("|")[0]??null);customDestinationUrl=f(()=>{let t=this.optionsFormSignal()?.restoreFrom,e=this.extendedDataType()!==null;return t==="same-custom"&&e?this.remoteCustomSourceUrl():t==="other-custom"&&e?this.remoteCustomTargetUrl():null});showCustomRemoteRestoreTree=f(()=>!!(this.optionsFormSignal()?.restoreFrom==="same-custom"&&this.customDestinationUrl()&&this.backupId()||this.optionsFormSignal()?.restoreFrom==="other-custom"&&this.customDestinationUrl()));isCustomRemoteRestore=f(()=>{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 Office 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 Office 365 Tenant ${"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"}:TAG_INPUT:`;let u;u=$localize` Different Office 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 M;M=$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 h;h=$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 fe;fe=$localize` Overwrite ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let he;he=$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,M,x,ee,te,h,Ne,fe,he,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,Mt,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-MJPEKJ3T.js";import{k as Ze,n as et}from"./chunk-RTGUYIWH.js";import{a as ce}from"./chunk-TPKKLIFK.js";import{a as Qe}from"./chunk-COEGVUM3.js";import{a as A}from"./chunk-PEOYNJJM.js";import{b as Ee}from"./chunk-2KD757N6.js";import{b as Ke}from"./chunk-AFHEXZUZ.js";import{a as Z}from"./chunk-JYRKUYG6.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-5E3B4AEF.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-C6PICAXB.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-JYRKUYG6.js";import{J as k,v as D}from"./chunk-CJKZ27FM.js";import"./chunk-5E3B4AEF.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};
@@ -0,0 +1,2 @@
1
+ import{a as ge,c as fe,d as xe}from"./chunk-TPKKLIFK.js";import{h as Ce}from"./chunk-X5W2K6AN.js";import{a as ue}from"./chunk-JYRKUYG6.js";import{B as le,H as _e,K as se,P as pe,V as me,W as ce,Y as de,b as ee,c as te,e as ne,i as ie,k as oe,s as ae,v as re}from"./chunk-CJKZ27FM.js";import{aa as Z}from"./chunk-YF6JHIN5.js";import{$ as j,$c as Y,Bb as A,Bc as W,Cb as D,Cc as T,Db as p,Eb as _,Fb as s,Gb as b,Kb as R,Kc as v,Lb as M,Mb as f,Nb as x,Rc as H,Ta as l,Ub as k,Vb as G,Wb as Q,Xc as J,_b as C,ac as r,ea as d,fa as u,hb as q,jc as g,lc as B,mb as S,oc as c,pc as z,qa as P,qc as U,wc as K,xb as F,xc as N,yb as h,yc as O,zb as $}from"./chunk-K5XGRFWJ.js";import{a as L,b as E}from"./chunk-7CGTOI24.js";var Te=[{name:"send-mail-to",type:"Email"},{name:"send-mail-from",type:"Email"},{name:"log-file",type:"FileTree"},{name:"compression-extension-file",type:"FileTree"},{name:"dbpath",type:"FileTree"},{name:"restore-path",type:"FileTree"},{name:"gpg-program-path",type:"FileTree"}];var Fe=()=>({updateOn:"blur"}),y=t=>({formView:t}),w=t=>({$implicit:t});function he(t,i){if(t&1){let e=x();_(0,"button",14),C("click",function(){d(e);let n=r();return u(n.showTextArea.set(!1))}),k(1,6),b(2,"sh-icon"),G(),s()}}function ye(t,i){if(t&1){let e=x();_(0,"button",18,1),C("click",function(){let n=d(e).$implicit,a=r(3);return u(a.addSetting(n))}),_(2,"div",19),c(3),_(4,"p"),c(5),s()()()}if(t&2){let e=i.$implicit;B("deprecated",e.deprecatedDescription),l(3),U(" ",e.shortDescription," "),l(2),z(e.name)}}function we(t,i){if(t&1&&(_(0,"h3",10),c(1),s(),A(2,ye,6,4,"button",17,$)),t&2){let e=i.$implicit;l(),z(e.displayName),l(),D(e.options)}}function Ve(t,i){if(t&1){let e=x();_(0,"sh-menu")(1,"button",20)(2,"sh-icon"),c(3,"dots-three-vertical"),s()(),R(4,16),_(5,"button",14),C("click",function(){d(e);let n=r(2);return u(n.addFreeTextSetting())}),k(6,8),b(7,"sh-icon"),G(),s(),_(8,"button",21),C("click",function(){d(e);let n=r(2);return u(n.showTextArea.set(!0))}),_(9,"sh-icon"),c(10,"link"),s(),c(11," Edit contents as text "),s(),M(),s()}}function Le(t,i){if(t&1&&(_(0,"sh-menu",15)(1,"button",12),k(2,7),b(3,"sh-icon"),G(),s(),R(4,16),A(5,we,4,1,null,null,$),M(),s(),F(7,Ve,12,0,"sh-menu")),t&2){let e=r();p("searchable",!0),l(5),D(e.nonSelectedOptionsGrouped()),l(2),h(e.hasFreeTextSettings()?7:-1)}}function Ie(t,i){if(t&1){let e=x();_(0,"textarea",22),C("ngModelChange",function(n){d(e);let a=r();return u(a.updateSettingsFromText(n))}),s()}if(t&2){let e=r();p("ngModel",e.settingsAsText())("ngModelOptions",W(2,Fe))}}function be(t,i){t&1&&(_(0,"div",23),c(1,"Add a setting above to get started."),s())}function Me(t,i){t&1&&(_(0,"sh-icon",31),c(1," warning-octagon "),s())}function Ne(t,i){if(t&1&&(_(0,"sh-icon",32),c(1,"archive"),s()),t&2){let e=r(2).$implicit;p("shTooltip",e.FormView.deprecatedDescription)}}function ve(t,i){if(t&1&&(_(0,"sh-icon",33),c(1,"question"),s()),t&2){let e=r(2).$implicit;p("shTooltip",e.FormView.longDescription)}}function Ee(t,i){if(t&1&&(F(0,Me,2,0,"sh-icon",31),_(1,"span"),c(2),s(),F(3,Ne,2,1,"sh-icon",32)(4,ve,2,1,"sh-icon",33)),t&2){let e=r().$implicit,o=O(1);h(o?0:-1),l(),B("deprecated",e.FormView.deprecatedDescription),l(),z(e.FormView.shortDescription),l(),h(e.FormView.deprecatedDescription?3:e.FormView.longDescription?4:-1)}}function Pe(t,i){t&1&&f(0)}function $e(t,i){if(t&1){let e=x();_(0,"div",25)(1,"label"),S(2,Pe,1,0,"ng-container",34),s(),_(3,"div")(4,"sh-form-field")(5,"input",35),C("ngModelChange",function(n){d(e);let a=r().$implicit,m=r(2);return u(m.updateFreeTextSettingName(a,n))}),s(),_(6,"sh-icon",36),c(7,"rectangle-dashed"),s()()(),_(8,"div")(9,"sh-form-field")(10,"input",35),C("ngModelChange",function(n){d(e);let a=r().$implicit,m=r(2);return u(m.updateSettingValue(a,n))}),s(),_(11,"sh-icon",36),c(12,"textbox"),s()()()()}if(t&2){let e=r().$implicit,o=g(3);l(2),p("ngTemplateOutlet",o),l(3),p("ngModel",e.Name),l(5),p("ngModel",e.Value())}}function Ae(t,i){t&1&&f(0)}function De(t,i){if(t&1){let e=x();_(0,"app-file-tree",26)(1,"label",37),S(2,Ae,1,0,"ng-container",34),s(),_(3,"input",38),C("ngModelChange",function(n){d(e);let a=r().$implicit,m=r(2);return u(m.updateSettingValue(a,n))}),s()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);p("startingPath",e.Value())("accepts",e.FormView.accepts)("showFiles",!0)("showHiddenNodes",!0)("selectFiles",!0)("resolvePaths",!0),l(),p("for",n),l(),p("ngTemplateOutlet",o),l(),p("id",n)("ngModel",e.Value())}}function Re(t,i){if(t&1){let e=x();_(0,"app-file-tree",27),b(1,"label",37),_(2,"input",38),C("ngModelChange",function(n){d(e);let a=r().$implicit,m=r(2);return u(m.updateSettingValue(a,n))}),s()()}if(t&2){let e=r().$implicit,o=O(0);p("startingPath",e.Value())("resolvePaths",!0),l(),p("for",o),l(),p("id",o)("ngModel",e.Value())}}function ke(t,i){t&1&&f(0)}function Ge(t,i){t&1&&f(0)}function Be(t,i){t&1&&(_(0,"sh-icon",36),c(1,"link"),s())}function ze(t,i){t&1&&(_(0,"sh-icon",36),c(1,"hard-drives"),s())}function Ue(t,i){t&1&&(_(0,"sh-icon",36),c(1,"jar"),s())}function Ke(t,i){t&1&&(_(0,"sh-icon",36),c(1,"envelope"),s())}function He(t,i){t&1&&(_(0,"sh-icon",36),c(1,"textbox"),s())}function Je(t,i){if(t&1){let e=x();_(0,"sh-form-field")(1,"label",37),S(2,ke,1,0,"ng-container",34)(3,Ge,1,0,"ng-container",39),s(),_(4,"input",40),C("ngModelChange",function(n){d(e);let a=r().$implicit,m=r(2);return u(m.updateSettingValue(a,n))}),s(),F(5,Be,2,0,"sh-icon",36)(6,ze,2,0,"sh-icon",36)(7,Ue,2,0,"sh-icon",36)(8,Ke,2,0,"sh-icon",36)(9,He,2,0,"sh-icon",36),s()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);l(),p("for",n),l(),p("ngTemplateOutlet",o),l(),p("ngTemplateOutlet",a)("ngTemplateOutletContext",T(10,w,T(8,y,e.FormView))),l(),p("type",e.FormView.type==="Email"?"email":"text")("id",n)("ngModel",e.Value()),l(),h(e.FormView.type==="Path"?5:e.FormView.type==="Hostname"?6:e.FormView.type==="Bucketname"?7:e.FormView.type==="Email"?8:9)}}function Xe(t,i){t&1&&f(0)}function je(t,i){t&1&&f(0)}function qe(t,i){if(t&1){let e=x();_(0,"sh-icon",43),C("click",function(){d(e);let n=r(2).$implicit;return u(n.showPassword=!n.showPassword)}),c(1," eye "),s()}}function Qe(t,i){if(t&1){let e=x();_(0,"sh-icon",43),C("click",function(){d(e);let n=r(2).$implicit;return u(n.showPassword=!n.showPassword)}),c(1," eye-slash "),s()}}function We(t,i){if(t&1){let e=x();_(0,"sh-form-field")(1,"label",37),S(2,Xe,1,0,"ng-container",34)(3,je,1,0,"ng-container",39),s(),_(4,"input",41),C("ngModelChange",function(n){d(e);let a=r().$implicit,m=r(2);return u(m.updateSettingValue(a,n))}),s(),_(5,"sh-icon",36),c(6,"password"),s(),F(7,qe,2,0,"sh-icon",42)(8,Qe,2,0,"sh-icon",42),s()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);l(),p("for",n),l(),p("ngTemplateOutlet",o),l(),p("ngTemplateOutlet",a)("ngTemplateOutletContext",T(10,w,T(8,y,e.FormView))),l(),p("type",e.showPassword?"text":"password")("id",n)("ngModel",e.Value()),l(3),h(e.showPassword?7:8)}}function Ye(t,i){t&1&&f(0)}function Ze(t,i){t&1&&f(0)}function et(t,i){if(t&1&&c(0),t&2){let e=i.$implicit;U(" ",e," ")}}function tt(t,i){if(t&1){let e=x();_(0,"sh-select",44)(1,"label",37),S(2,Ye,1,0,"ng-container",34)(3,Ze,1,0,"ng-container",39),s(),_(4,"input",38),C("ngModelChange",function(n){d(e);let a=r().$implicit,m=r(2);return u(m.updateSettingValue(a,n))}),s()(),S(5,et,1,1,"ng-template",null,3,v)}if(t&2){let e=g(6),o=r().$implicit,n=g(3),a=O(0);r(2);let m=g(10);p("options",o.FormView.options)("isClearable",!1)("optionTemplate",e),l(),p("for",a),l(),p("ngTemplateOutlet",n),l(),p("ngTemplateOutlet",m)("ngTemplateOutletContext",T(11,w,T(9,y,o.FormView))),l(),p("id",a)("ngModel",o.Value())}}function nt(t,i){t&1&&f(0)}function it(t,i){t&1&&f(0)}function ot(t,i){if(t&1){let e=x();_(0,"app-size",45),C("ngModelChange",function(n){d(e);let a=r().$implicit,m=r(2);return u(m.updateSettingValue(a,n))}),_(1,"label",37),S(2,nt,1,0,"ng-container",34)(3,it,1,0,"ng-container",39),s()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);p("inputType",e.Name)("ngModel",e.Value())("customId",n),l(),p("for",n),l(),p("ngTemplateOutlet",o),l(),p("ngTemplateOutlet",a)("ngTemplateOutletContext",T(9,w,T(7,y,e.FormView)))}}function at(t,i){t&1&&f(0)}function rt(t,i){t&1&&f(0)}function lt(t,i){if(t&1){let e=x();_(0,"sh-form-field")(1,"label",37),S(2,at,1,0,"ng-container",34)(3,rt,1,0,"ng-container",39),s(),_(4,"input",46),C("ngModelChange",function(n){d(e);let a=r().$implicit,m=r(2);return u(m.updateSettingValue(a,n))}),s(),_(5,"sh-icon",36),c(6,"numpad"),s()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);l(),p("for",n),l(),p("ngTemplateOutlet",o),l(),p("ngTemplateOutlet",a)("ngTemplateOutletContext",T(8,w,T(6,y,e.FormView))),l(),p("id",n)("ngModel",e.Value())}}function _t(t,i){t&1&&f(0)}function st(t,i){t&1&&f(0)}function pt(t,i){if(t&1){let e=x();_(0,"sh-toggle",29)(1,"label",37),S(2,_t,1,0,"ng-container",34)(3,st,1,0,"ng-container",39),s(),_(4,"input",47),C("ngModelChange",function(n){d(e);let a=r().$implicit,m=r(2);return u(m.updateSettingValue(a,n))}),s()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);l(),p("for",n),l(),p("ngTemplateOutlet",o),l(),p("ngTemplateOutlet",a)("ngTemplateOutletContext",T(8,w,T(6,y,e.FormView))),l(),p("id",n)("ngModel",e.Value())}}function mt(t,i){t&1&&f(0)}function ct(t,i){t&1&&f(0)}function dt(t,i){if(t&1&&c(0),t&2){let e=i.$implicit;U(" ",e," ")}}function ut(t,i){if(t&1){let e=x();_(0,"sh-select",48)(1,"label",37),S(2,mt,1,0,"ng-container",34)(3,ct,1,0,"ng-container",39),s(),_(4,"input",49),C("ngModelChange",function(n){d(e);let a=r().$implicit,m=r(2);return u(m.updateSettingValue(a,n))}),s()(),S(5,dt,1,1,"ng-template",null,4,v)}if(t&2){let e=g(6),o=r().$implicit,n=g(3),a=O(0);r(2);let m=g(10);p("options",o.FormView.options)("selectMultiple",!0)("optionTemplate",e),l(),p("for",a),l(),p("ngTemplateOutlet",n),l(),p("ngTemplateOutlet",m)("ngTemplateOutletContext",T(10,w,T(8,y,o.FormView))),l(),p("ngModel",o.Value())}}function Ct(t,i){t&1&&f(0)}function gt(t,i){t&1&&f(0)}function ft(t,i){if(t&1){let e=x();_(0,"app-timespan",45),C("ngModelChange",function(n){d(e);let a=r().$implicit,m=r(2);return u(m.updateSettingValue(a,n))}),_(1,"label",37),S(2,Ct,1,0,"ng-container",34)(3,gt,1,0,"ng-container",39),s()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);p("inputType",e.Name)("ngModel",e.Value())("customId",n),l(),p("for",n),l(),p("ngTemplateOutlet",o),l(),p("ngTemplateOutlet",a)("ngTemplateOutletContext",T(9,w,T(7,y,e.FormView)))}}function xt(t,i){if(t&1){let e=x();K(0)(1),S(2,Ee,5,5,"ng-template",null,2,v),_(4,"div",24),F(5,$e,13,3,"div",25)(6,De,4,10,"app-file-tree",26)(7,Re,3,5,"app-file-tree",27)(8,Je,10,12,"sh-form-field")(9,We,9,12,"sh-form-field")(10,tt,7,13)(11,ot,4,11,"app-size",28)(12,lt,7,10,"sh-form-field")(13,pt,5,10,"sh-toggle",29)(14,ut,7,12)(15,ft,4,11,"app-timespan",28),_(16,"button",30),C("click",function(){let n=d(e).$implicit,a=r(2);return u(a.removeSetting(n))}),_(17,"sh-icon"),c(18,"x-bold"),s()()()}if(t&2){let e=i.$implicit,o=i.$index,n=r(2);N("destination-"+e.Name+o),l(),N(n.inAppOptions(e.Name)),l(3),B("align-remove-start",e.FormView.type==="FolderTree"||e.FormView.type==="FileTree"||e.FormView.type==="Boolean"),l(),h(e.FormView.type==="FreeText"?5:e.FormView.type==="FileTree"?6:e.FormView.type==="FolderTree"?7:e.FormView.type==="String"||e.FormView.type==="Path"||e.FormView.type==="Decimal"||e.FormView.type==="Email"||e.FormView.type==="Hostname"||e.FormView.type==="Bucketname"?8:e.FormView.type==="Password"?9:e.FormView.type==="Enumeration"?10:e.FormView.type==="Size"?11:e.FormView.type==="Integer"?12:e.FormView.type==="Boolean"?13:e.FormView.type==="Flags"?14:e.FormView.type==="Timespan"||e.FormView.type==="DateTime"?15:-1)}}function Tt(t,i){if(t&1&&(F(0,be,2,0,"div",23),A(1,xt,19,5,null,null,$)),t&2){let e=r();h(e.selectedSettings().length===0?0:-1),l(),D(e.selectedSettings())}}function St(t,i){if(t&1&&(_(0,"sh-icon",50),c(1,"x-circle"),s()),t&2){r();let e=O(0);p("shTooltip",(e==null?null:e.message)??"Invalid value")}}function Ot(t,i){if(t&1&&(_(0,"sh-icon",32),c(1,"warning"),s()),t&2){r();let e=O(0);p("shTooltip",(e==null?null:e.message)??"Invalid value")}}function Ft(t,i){if(t&1&&(K(0),F(1,St,2,1,"sh-icon",50)(2,Ot,2,1,"sh-icon",32)),t&2){r();let e=O(0),o=r().$implicit,n=N(o.formView.validate(e));l(),h((n==null?null:n.type)==="error"?1:(n==null?null:n.type)==="warning"?2:-1)}}function ht(t,i){if(t&1&&(K(0),F(1,Ft,3,2)),t&2){let e=r().$implicit,n=(N(e.Value())??"").toString().trim()==="";l(),h(!n&&e.formView.validate?1:-1)}}function yt(t,i){if(t&1&&F(0,ht,2,2),t&2){let e=i.$implicit;h(e.Value?0:-1)}}var Se=class t{#e=j(ue);options=Y.required();hiddenOptions=J([]);hasFreeTextSettings=J(!1);applicationOptions=J();showTextArea=P(!1);allOptionsGrouped=this.#e.allOptionsGrouped;allOptions=this.#e.allOptions;selectedSettings=H(()=>{let i=this.hiddenOptions();return this.options().map(n=>{let a=this.allOptions().find(V=>V.name===n.Name?.replace("--","")),m=n.Value??"";if(a&&i.includes(a.name))return null;if(a){if(a.type==="Boolean"&&(m=this.isTrue(m)),a.type==="Integer"&&(m=parseInt(m)||0),a.type==="Enumeration"&&a.options){let I=m?.trim().toLowerCase(),X=a.options.find(Oe=>(Oe??"").trim().toLocaleLowerCase()===I);X&&(m=X)}let V=Te.find(I=>I.name===a?.name);return V&&(a=L(L({},a),V)),E(L({},n),{Value:P(m),FormView:a})}else if(this.hasFreeTextSettings())return E(L({},n),{Value:P(m),FormView:{name:n.Name,type:"FreeText",shortDescription:"Custom settings argument",longDescription:"Custom settings argument"}});return null}).filter(n=>n!==null)});nonSelectedOptionsGrouped=H(()=>{let i=this.options().map(o=>o.Name?.replace("--","")),e=this.hiddenOptions();return this.allOptionsGrouped().map(o=>E(L({},o),{options:o.options.filter(n=>!i.includes(n.name)&&!e.includes(n.name))})).filter(o=>o.options.length>0)});settingsAsText=H(()=>this.selectedSettings().map(i=>{let e=i.Value(),o="";return typeof e=="boolean"?o=this.isTrue(e)?"True":"False":(typeof e=="number"||e!=null)&&(o=e.toString()),`${i.Name??""}=${o}`}).join(`
2
+ `));updateSettingsFromText(i){if(typeof i!="string")return;let e=Ce(i);this.options.update(()=>e)}isTrue(i){if(typeof i=="boolean")return i;if(typeof i=="string"){let e=i.toLowerCase();return e==="true"||e==="1"||e==="yes"||e==="on"}return!1}inAppOptions(i){let e=this.applicationOptions()?.findIndex(o=>o.Name?.replace("--","")===i);return e===void 0?!1:e>-1}addFreeTextSetting(){this.hasFreeTextSettings()&&this.options.update(i=>[...i,{Filter:null,Name:"",Value:""}])}addSetting(i){this.options.update(e=>{let o=i.defaultValue??"";return i.type==="Boolean"&&(o=this.isTrue(o)),i.type==="Integer"&&(o=parseInt(o)||0),[...e,{Name:i.name,Value:o}]})}updateSettingValue(i,e){this.options.update(o=>{let n=[...o],a=n.findIndex(m=>m.Name===i.Name);if(i.FormView.type==="Boolean")return n[a].Value=this.isTrue(e)?"True":"False",n;if(i.FormView.type==="Integer")return n[a].Value=e.toString(),n;if(i.FormView.type==="Enumeration"&&i.FormView.options){let m=e?.trim().toLowerCase()??"",V=i.FormView.options.find(I=>(I??"").trim().toLocaleLowerCase()===m);if(V)return n[a].Value=V,n}return n[a].Value=e,n})}updateFreeTextSettingName(i,e){this.options.update(o=>{let n=[...o],a=n.findIndex(m=>m.Name===i.Name);return n[a].Name=e,n})}removeSetting(i){this.options.update(e=>e.filter(o=>o.Name!==i.Name))}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=q({type:t,selectors:[["app-options-list"]],inputs:{options:[1,"options"],hiddenOptions:[1,"hiddenOptions"],hasFreeTextSettings:[1,"hasFreeTextSettings"],applicationOptions:[1,"applicationOptions"]},outputs:{options:"optionsChange"},decls:11,vars:4,consts:()=>{let i;i=$localize`Advanced options`;let e;e=$localize` Show editor ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let o;o=$localize` Add advanced option ${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON:`;let n;n=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:pen${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: New custom option `;let a;return a=$localize`By adding this option it will override the matching global option`,[["validateTemplate",""],["option",""],["defaultLabel",""],["enumOptionTemplate",""],["optionTemplate",""],i,e,o,n,[3,"disableToggle","isActive"],["title",""],[1,"actions"],["shButton","","type","button",1,"outlined","small"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModel","ngModelOptions"],["shButton","","type","button",1,"outlined","small",3,"click"],[3,"searchable"],["menu",""],["type","button",3,"deprecated"],["type","button",3,"click"],[1,"option-col"],["shButton","","type","button",1,"small"],["shButton","","type","button",1,"small",3,"click"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModelChange","ngModel","ngModelOptions"],[1,"placeholder"],[1,"field-row"],[1,"form-column"],[3,"startingPath","accepts","showFiles","showHiddenNodes","selectFiles","resolvePaths"],[3,"startingPath","resolvePaths"],[3,"inputType","ngModel","customId"],[1,"primary","raised"],["shButton","","type","button",1,"outlined","small","remove-btn",3,"click"],["shTooltip",a,1,"error"],[1,"warn",3,"shTooltip"],[1,"primary",3,"shTooltip"],[4,"ngTemplateOutlet"],["type","text",3,"ngModelChange","ngModel"],["prefix",""],[3,"for"],["type","text",3,"ngModelChange","id","ngModel"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"ngModelChange","type","id","ngModel"],["autocomplete","new-password",3,"ngModelChange","type","id","ngModel"],["suffix","",1,"clickable"],["suffix","",1,"clickable",3,"click"],[3,"options","isClearable","optionTemplate"],[3,"ngModelChange","inputType","ngModel","customId"],["type","number",3,"ngModelChange","id","ngModel"],["type","checkbox",3,"ngModelChange","id","ngModel"],[1,"primary","raised",3,"options","selectMultiple","optionTemplate"],["type","text","id","text",3,"ngModelChange","ngModel"],[1,"error",3,"shTooltip"]]},template:function(e,o){e&1&&(_(0,"sh-toggle-card",9),R(1,10)(2),Q(3,5),M(),_(4,"div",11),F(5,he,3,0,"button",12)(6,Le,8,2),s(),M(),F(7,Ie,1,3,"textarea",13)(8,Tt,3,1),s(),S(9,yt,1,1,"ng-template",null,0,v)),e&2&&(p("disableToggle",!0)("isActive",!0),l(5),h(o.showTextArea()?5:6),l(2),h(o.showTextArea()?7:8))},dependencies:[ae,te,oe,ee,ne,ie,ge,fe,xe,Z,me,_e,le,se,de,re,pe,ce],styles:["[_nghost-%COMP%]{display:block}sh-select[_ngcontent-%COMP%]{--miw: p2r(120)}sh-toggle[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:1rem}.placeholder[_ngcontent-%COMP%]{color:var(--base-9);text-align:center;padding:2rem 1rem}.field-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;position:relative;z-index:1;max-width:32.5rem;width:100%}.field-row[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{align-self:flex-end}.field-row[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]:first-child{max-width:28rem;width:100%}.field-row.align-remove-start[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{align-self:flex-start}.option-col[_ngcontent-%COMP%]{display:flex;flex-direction:column}.option-col[_ngcontent-%COMP%] .fill[_ngcontent-%COMP%]{color:var(--base-12)}.form-column[_ngcontent-%COMP%]{display:flex;gap:.25rem;flex-direction:column}label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}sh-icon[_ngcontent-%COMP%]{font-size:1rem}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;justify-content:flex-end}.deprecated[_ngcontent-%COMP%]{text-decoration:line-through}.raw-text-area[_ngcontent-%COMP%]{min-height:12rem;white-space:pre}"],changeDetection:0})};export{Se as a};
@@ -1 +1 @@
1
- import{d}from"./chunk-DSYNIXJF.js";import{F as n,Qc as s,V as o,_ as r,pa as l,ra as g}from"./chunk-TQTOIWBK.js";var u=[{value:"Disabled",label:$localize`Disabled`},{value:"Verbose",label:$localize`Verbose`},{value:"ExplicitOnly",label:$localize`Explicit only`},{value:"Profiling",label:$localize`Profiling`},{value:"Retry",label:$localize`Retry`},{value:"Information",label:$localize`Information`},{value:"DryRun",label:$localize`Dry run`},{value:"Warning",label:$localize`Warning`},{value:"Error",label:$localize`Error`}],v=class a{#l=r(d);#e=l([]);LOG_LEVELS=u;logLevel=l("Disabled");logLevelByLabel=s(()=>u.find(e=>e.value===this.logLevel())?.label);whenFilter=l(null);backupIdFilter=l(null);id=l(0);logs=s(()=>this.whenFilter()&&this.backupIdFilter()?this.#e().filter(e=>e.BackupID===this.backupIdFilter()&&new Date(e.When).getTime()>=this.whenFilter()&&e.BackupID===this.backupIdFilter()):this.#e());timerInterval;logsLoading=l(!1);isPolling=l(!1);pagination=l({offset:0,pagesize:100});logLevelEffect=g(()=>{this.isPolling()?(this.#e.set([]),this.id.set(0),queueMicrotask(()=>this.loadLogs()),this.timerInterval&&clearInterval(this.timerInterval),this.timerInterval=setInterval(()=>{this.loadLogs()},3e3)):this.clearPolling()});setWhenFilter(e){this.whenFilter.set(e)}setBackupIdFilter(e){this.backupIdFilter.set(e)}loadLogs(){this.logsLoading.set(!0),this.#l.getApiV1LogdataPoll({id:this.id(),level:this.logLevel(),pagesize:this.pagination().pagesize}).pipe(n(()=>this.logsLoading.set(!1))).subscribe({next:e=>{let i=e.reverse(),t=this.#i(i);t>0&&this.id.set(t),this.#e.set([...i,...this.#e()])}})}updateLogLevel(e){this.logLevel.set(e),e==="Disabled"&&this.clearPolling()}#i(e){return e.reduce((i,t)=>Math.max(i,t.ID),0)}destroy(){this.logLevel.set("Disabled"),this.clearPolling()}clearPolling(){this.timerInterval&&clearInterval(this.timerInterval),this.timerInterval=void 0}static \u0275fac=function(i){return new(i||a)};static \u0275prov=o({token:a,factory:a.\u0275fac,providedIn:"root"})};export{v as a};
1
+ import{d}from"./chunk-5E3B4AEF.js";import{$ as r,G as n,Rc as s,W as o,qa as l,sa as g}from"./chunk-K5XGRFWJ.js";var u=[{value:"Disabled",label:$localize`Disabled`},{value:"Verbose",label:$localize`Verbose`},{value:"ExplicitOnly",label:$localize`Explicit only`},{value:"Profiling",label:$localize`Profiling`},{value:"Retry",label:$localize`Retry`},{value:"Information",label:$localize`Information`},{value:"DryRun",label:$localize`Dry run`},{value:"Warning",label:$localize`Warning`},{value:"Error",label:$localize`Error`}],v=class a{#l=r(d);#e=l([]);LOG_LEVELS=u;logLevel=l("Disabled");logLevelByLabel=s(()=>u.find(e=>e.value===this.logLevel())?.label);whenFilter=l(null);backupIdFilter=l(null);id=l(0);logs=s(()=>this.whenFilter()&&this.backupIdFilter()?this.#e().filter(e=>e.BackupID===this.backupIdFilter()&&new Date(e.When).getTime()>=this.whenFilter()&&e.BackupID===this.backupIdFilter()):this.#e());timerInterval;logsLoading=l(!1);isPolling=l(!1);pagination=l({offset:0,pagesize:100});logLevelEffect=g(()=>{this.isPolling()?(this.#e.set([]),this.id.set(0),queueMicrotask(()=>this.loadLogs()),this.timerInterval&&clearInterval(this.timerInterval),this.timerInterval=setInterval(()=>{this.loadLogs()},3e3)):this.clearPolling()});setWhenFilter(e){this.whenFilter.set(e)}setBackupIdFilter(e){this.backupIdFilter.set(e)}loadLogs(){this.logsLoading.set(!0),this.#l.getApiV1LogdataPoll({id:this.id(),level:this.logLevel(),pagesize:this.pagination().pagesize}).pipe(n(()=>this.logsLoading.set(!1))).subscribe({next:e=>{let i=e.reverse(),t=this.#i(i);t>0&&this.id.set(t),this.#e.set([...i,...this.#e()])}})}updateLogLevel(e){this.logLevel.set(e),e==="Disabled"&&this.clearPolling()}#i(e){return e.reduce((i,t)=>Math.max(i,t.ID),0)}destroy(){this.logLevel.set("Disabled"),this.clearPolling()}clearPolling(){this.timerInterval&&clearInterval(this.timerInterval),this.timerInterval=void 0}static \u0275fac=function(i){return new(i||a)};static \u0275prov=o({token:a,factory:a.\u0275fac,providedIn:"root"})};export{v as a};
@@ -0,0 +1 @@
1
+ import{a as ne}from"./chunk-MJPEKJ3T.js";import{q as ee}from"./chunk-RTGUYIWH.js";import"./chunk-PNQ5BDQN.js";import{d as Z}from"./chunk-TPKKLIFK.js";import"./chunk-X5W2K6AN.js";import"./chunk-6Q6SSTBK.js";import"./chunk-COEGVUM3.js";import"./chunk-QGAOYLQU.js";import"./chunk-RM2KGG7J.js";import"./chunk-PEOYNJJM.js";import"./chunk-QZEIAQ3M.js";import"./chunk-2KD757N6.js";import"./chunk-AFHEXZUZ.js";import"./chunk-JYRKUYG6.js";import"./chunk-VNXFTYQQ.js";import{B as j,H as Q,P as q,c as X,e as W,i as z,k as V,s as H,v as Y}from"./chunk-CJKZ27FM.js";import"./chunk-5E3B4AEF.js";import{b as U,d as J}from"./chunk-CQJRBQ6I.js";import"./chunk-V2UO7ES2.js";import"./chunk-HDDAGHHE.js";import"./chunk-YF6JHIN5.js";import"./chunk-2YUSBRXY.js";import{$ as C,Bc as D,Db as m,Eb as i,Fb as a,Gb as P,Nb as g,Ta as p,Ub as N,Vb as E,Wb as l,Yc as K,_b as f,ac as c,ea as O,fa as S,hb as $,hc as v,ic as B,lc as x,qa as w,tc as d,uc as T,vc as u,xb as L,yb as G}from"./chunk-K5XGRFWJ.js";import"./chunk-7CGTOI24.js";var te=["formRef"],ie=()=>["--skip-files-larger-than","encryption-module","no-encryption","--no-encryption","--dbpath","--exclude-files-attributes","keep-time","keep-versions","retention-policy"];function oe(s,r){s&1&&(i(0,"p"),l(1,4),a())}function ae(s,r){if(s&1){let n=g();i(0,"p"),l(1,5),a(),i(2,"app-timespan",21),u("ngModelChange",function(o){O(n);let t=c();return T(t.optionsFields.backupRetentionTime,o)||(t.optionsFields.backupRetentionTime=o),S(o)}),i(3,"label",22),l(4,6),a()()}if(s&2){let n=c();p(2),m("customId","backupRetentionTime"),d("ngModel",n.optionsFields.backupRetentionTime)}}function se(s,r){if(s&1){let n=g();i(0,"p"),l(1,7),a(),i(2,"sh-form-field")(3,"label",23),l(4,8),a(),i(5,"input",24),u("ngModelChange",function(o){O(n);let t=c();return T(t.optionsFields.backupRetentionVersions,o)||(t.optionsFields.backupRetentionVersions=o),S(o)}),a()()}if(s&2){let n=c();p(5),d("ngModel",n.optionsFields.backupRetentionVersions)}}function _e(s,r){s&1&&(i(0,"p"),l(1,9),a())}function le(s,r){if(s&1){let n=g();i(0,"p"),l(1,10),a(),i(2,"sh-form-field")(3,"p"),l(4,11),a(),i(5,"label",25),l(6,12),a(),i(7,"input",26),u("ngModelChange",function(o){O(n);let t=c();return T(t.optionsFields.backupRetentionCustom,o)||(t.optionsFields.backupRetentionCustom=o),S(o)}),a()()}if(s&2){let n=c();p(7),d("ngModel",n.optionsFields.backupRetentionCustom)}}var re=[{value:"all",name:$localize`Keep all backups`},{value:"time",name:$localize`Delete backups that are older than`},{value:"versions",name:$localize`Keep a specific number of backups`},{value:"smart",name:$localize`Smart backup retention`},{value:"custom",name:$localize`Custom backup retention`}],h=class s{#e=C(ee);#n=C(J);#t=C(U);formRef=K.required("formRef");isSubmitting=this.#e.isSubmitting;settings=this.#e.settings;optionsFields=this.#e.optionsFields;applicationOptions=this.#e.applicationOptions;retentionOptions=w(re);goBack(){this.#n.navigate(["schedule"],{relativeTo:this.#t.parent})}submit(){switch(this.#e.validateBeforeSubmit()){case"general":this.#n.navigate(["general"],{relativeTo:this.#t.parent});return;case"destination":this.#n.navigate(["destination"],{relativeTo:this.#t.parent});return;case"source":this.#n.navigate(["source-data"],{relativeTo:this.#t.parent});return}this.#e.submit()}static \u0275fac=function(n){return new(n||s)};static \u0275cmp=$({type:s,selectors:[["app-advanced-options-settings"]],viewQuery:function(n,e){n&1&&v(e.formRef,te,5),n&2&&B()},decls:20,vars:12,consts:()=>{let r;r=$localize`Options`;let n;n=$localize`Backup retention`;let e;e=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `;let t;t=$localize`Nothing will be deleted. The backup size will grow with each change.`;let M;M=$localize`If at least one newer backup is found, all backups older than this date are deleted.`;let I;I=$localize`Time to keep versions`;let R;R=$localize`Once there are more backups than the specified number, the oldest backups are deleted.`;let b;b=$localize`Number of versions`;let y;y=$localize` Over time backups will be deleted automatically. There will remain one backup for each of the last 7 days, each of the last 4 weeks, each of the last 12 months. There will always be at least one remaining backup. `;let A;A=$localize` Enter a retention strategy manually. Placeholders are D/W/Y for days/weeks/years and U for unlimited. The syntax is: 7D:1D,4W:1W,36M:1M. This example keeps one backup for each of the next 7 days, one for each of the next 4 weeks, and one for each of the next 36 months. This can also be written as 1W:1D,1M:1W,3Y:1M. `;let k;k=$localize`Once there are more backups than the specified number, the oldest backups are deleted.`;let F;return F=$localize`Retention expression`,[r,n,e,o,t,M,I,R,b,y,A,k,F,[1,"title-30"],["value","value","label","name",3,"options","inlineSearch","isClearable"],["for","size"],["type","text",3,"ngModelChange","ngModel"],[3,"optionsChange","options","applicationOptions","hasFreeTextSettings","hiddenOptions"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click"],[3,"ngModelChange","customId","ngModel"],["for","backupRetentionTime"],["for","backupRetentionVersions"],["type","number","id","backupRetentionVersions",3,"ngModelChange","ngModel"],["for","backupRetentionCustom"],["type","text","id","backupRetentionCustom",3,"ngModelChange","ngModel"]]},template:function(n,e){n&1&&(i(0,"section")(1,"h3",13),l(2,0),a(),i(3,"sh-select",14)(4,"label",15),l(5,1),a(),i(6,"input",16),u("ngModelChange",function(t){return T(e.optionsFields.backupRetention,t)||(e.optionsFields.backupRetention=t),t}),a()(),L(7,oe,2,0,"p")(8,ae,5,2)(9,se,6,1)(10,_e,2,0,"p")(11,le,8,1),i(12,"app-options-list",17),u("optionsChange",function(t){return T(e.settings,t)||(e.settings=t),t}),a(),i(13,"div",18)(14,"button",19),f("click",function(){return e.goBack()}),N(15,2),P(16,"sh-icon"),E(),a(),i(17,"button",20),f("click",function(){return e.submit()}),N(18,3),P(19,"sh-icon"),E(),a()()()),n&2&&(p(3),m("options",e.retentionOptions())("inlineSearch",!0)("isClearable",!1),p(3),d("ngModel",e.optionsFields.backupRetention),p(),G(e.optionsFields.backupRetention()==="all"?7:e.optionsFields.backupRetention()==="time"?8:e.optionsFields.backupRetention()==="versions"?9:e.optionsFields.backupRetention()==="smart"?10:e.optionsFields.backupRetention()==="custom"?11:-1),p(5),d("options",e.settings),m("applicationOptions",e.applicationOptions())("hasFreeTextSettings",!0)("hiddenOptions",D(11,ie)),p(5),x("loading",e.isSubmitting()))},dependencies:[H,X,V,W,z,ne,Z,j,Y,q,Q],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:37.5rem;padding:2.5rem}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.form-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 2.5rem;gap:.5rem;align-items:flex-end}.remote-volume-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.remote-volume-wrap[_ngcontent-%COMP%] p.warning[_ngcontent-%COMP%]{color:#7d7d00}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.advanced-option[_ngcontent-%COMP%]{display:grid;gap:.5rem;grid-template-columns:1fr 1fr 2.5rem;align-items:flex-end}sh-select[_ngcontent-%COMP%]{--miw: p2r(120)}"],changeDetection:0})};export{h as default};
@@ -0,0 +1 @@
1
+ import{e as a,f as b}from"./chunk-KI2HT2TI.js";import"./chunk-MJPEKJ3T.js";import"./chunk-RTGUYIWH.js";import"./chunk-PNQ5BDQN.js";import"./chunk-TPKKLIFK.js";import"./chunk-X5W2K6AN.js";import"./chunk-6Q6SSTBK.js";import"./chunk-COEGVUM3.js";import"./chunk-QGAOYLQU.js";import"./chunk-RM2KGG7J.js";import"./chunk-PEOYNJJM.js";import"./chunk-QZEIAQ3M.js";import"./chunk-2KD757N6.js";import"./chunk-AFHEXZUZ.js";import"./chunk-JYRKUYG6.js";import"./chunk-VNXFTYQQ.js";import"./chunk-CJKZ27FM.js";import"./chunk-5E3B4AEF.js";import"./chunk-CQJRBQ6I.js";import"./chunk-V2UO7ES2.js";import"./chunk-HDDAGHHE.js";import"./chunk-YF6JHIN5.js";import"./chunk-2YUSBRXY.js";import"./chunk-K5XGRFWJ.js";import"./chunk-7CGTOI24.js";export{a as createRestoreSelectFilesForm,b as default};
@@ -1,3 +1,3 @@
1
- import{a as Ce}from"./chunk-GRE6GKVP.js";import{a as pe}from"./chunk-IFSZJSGH.js";import"./chunk-QDDVZ4CR.js";import"./chunk-BLSV7CNZ.js";import"./chunk-I6MIXWIT.js";import{l as ge,q as b}from"./chunk-DJXLNIMV.js";import"./chunk-CAQ3XMFP.js";import"./chunk-VC55KFAX.js";import"./chunk-ZEFSBETQ.js";import{b as _e}from"./chunk-RJ2JM7C7.js";import"./chunk-WOKYULBU.js";import"./chunk-TCXCC5BM.js";import"./chunk-GKGMP6VF.js";import{a as de}from"./chunk-6Q6SSTBK.js";import"./chunk-YCJYEQF7.js";import"./chunk-OHYENIPP.js";import"./chunk-UTXZPAY6.js";import"./chunk-IMQUTGIK.js";import"./chunk-ANSV4G2K.js";import"./chunk-BACKG7KA.js";import{b as A}from"./chunk-IQL3REGJ.js";import"./chunk-AIAUP7OE.js";import{a as ue}from"./chunk-C6PICAXB.js";import"./chunk-6JS7B4FW.js";import{B as oe,G as ie,H as ae,L as se,P as re,Y as le,c as H,e as z,f as W,j,p as Q,q as Y,r as Z,s as ee,t as te,v as ne}from"./chunk-VKQQDCUN.js";import{b as ce,d as me}from"./chunk-DSYNIXJF.js";import{b as K,d as J,e as X}from"./chunk-NPFPMA4P.js";import"./chunk-O2SMJYPC.js";import"./chunk-N2AU7VKX.js";import"./chunk-ZC23RK4J.js";import"./chunk-OPHQNXYO.js";import{$b as F,Ac as V,Cb as C,Db as m,Eb as a,Fb as r,Mb as G,Qc as q,Sa as d,Tb as _,Ub as p,V as L,Vb as B,Wb as U,Xb as x,Zb as I,_ as u,da as h,ea as S,gb as R,kc as v,pa as E,ra as $,sc as M,tc as D,uc as O,wb as y,xb as k,zc as w}from"./chunk-TQTOIWBK.js";import"./chunk-7CGTOI24.js";var f=class c{#e=new Map;saveState(t){let e=de();return this.#e.set(e,t),e}getState(t){return this.#e.get(t)}static \u0275fac=function(e){return new(e||c)};static \u0275prov=L({token:c,factory:c.\u0275fac,providedIn:"root"})};var he=()=>["backup"];function Se(c,t){c&1&&r(0,"sh-progress-bar",10)}function Te(c,t){if(c&1){let e=G();m(0,"form",11)(1,"sh-select",12)(2,"label",13),_(3,1),r(4,"sh-icon",14),p(),a(),r(5,"input",15),a(),m(6,"sh-form-field")(7,"label",16),_(8,2),r(9,"sh-icon",17),p(),a(),r(10,"textarea",18),a(),m(11,"sh-form-field")(12,"label",19),_(13,3),r(14,"sh-icon",20),p(),a(),r(15,"textarea",21),a()(),m(16,"sh-divider"),B(17,4),a(),m(18,"form",11)(19,"sh-form-field")(20,"label",22),_(21,5),r(22,"sh-icon",23),p(),a(),r(23,"input",24),a(),m(24,"sh-form-field")(25,"label",25),_(26,6),r(27,"sh-icon",26),p(),a(),r(28,"input",27),a(),m(29,"app-filters",28),O("filtersChange",function(i){h(e);let s=F();return D(s.filters,i)||(s.filters=i),S(i)}),I("filtersChange",function(i){h(e);let s=F();return S(s.updateFilters(i))}),a()(),m(30,"app-options-list",29),O("optionsChange",function(i){h(e);let s=F();return D(s.settings,i)||(s.settings=i),S(i)}),a(),m(31,"div",30)(32,"button",31),I("click",function(){h(e);let i=F();return S(i.submit())}),_(33,7),r(34,"sh-icon"),p(),a()()}if(c&2){let e=F();C("formGroup",e.baseCmdForm),d(),C("options",e.commandOptions()??V(11,he))("inlineSearch",!0),d(17),C("formGroup",e.standardFields),d(11),M("filters",e.filters),C("osType",e.osType()??""),d(),M("options",e.settings),C("hasFreeTextSettings",!0),d(2),v("loading",e.isSubmitting()),d(2),U(e.baseCmdForm.value.command),x(33)}}var l=new Z,P=class c{#e=u(b);#n=u(me);#o=u(J);#t=u(K);#a=u(ce);#s=u(_e);#i=u(f);#r=u(ue);osType=q(()=>this.#r.systemInfo()?.OSType);#l=A(this.#t.params);commandOptions=A(this.#a.getApiV1Commandline());isSubmitting=E(!1);optionsFields=this.#e.optionsFields;standardFields=l.group({"backup-id":l.control(""),"backup-name":l.control(""),dbpath:l.control(""),filters:l.array([])});baseCmdForm=l.group({command:l.control("backup"),targetUrl:l.control(""),arguments:l.control("")});finishedLoading=this.#e.finishedLoading;backupId=this.#e.backupId;filters=E([]);settings=this.#e.settings;updateFilters(t){this.standardFields.controls.filters.clear(),t.forEach(e=>this.standardFields.controls.filters.push(l.control(e))),this.filters.set(t)}#m=$(()=>{let t=this.#l()?.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){if(this.standardFields.patchValue({dbpath:t.DBPath,"backup-id":t.ID,"backup-name":t.Name}),this.standardFields.controls.filters.clear(),t.Filters&&t.Filters.length){let e=t.Filters.map(n=>`${n.Include?"":"-"}${n.Expression}`);e.forEach(n=>{this.standardFields.controls.filters.push(l.control(n))}),this.filters.set(e)}else this.filters.set([])}submit(){this.#s.resumeDialogCheck(()=>this.#c())}#c(){this.isSubmitting.set(!0);let t=this.updateUrl(),e=this.baseCmdForm.value,n=e.targetUrl??"",i=(e.arguments??"").split(`
1
+ import{a as Ce}from"./chunk-MJPEKJ3T.js";import{a as pe}from"./chunk-JB26UVQP.js";import"./chunk-FQINMZH2.js";import"./chunk-ZTENLO77.js";import"./chunk-ZKIZ7IIA.js";import{l as ge,q as b}from"./chunk-RTGUYIWH.js";import"./chunk-PNQ5BDQN.js";import"./chunk-TPKKLIFK.js";import"./chunk-X5W2K6AN.js";import{b as _e}from"./chunk-AXG7WHBS.js";import"./chunk-AXLO5KWF.js";import"./chunk-BPHX6VXP.js";import"./chunk-XWML36YQ.js";import{a as de}from"./chunk-6Q6SSTBK.js";import"./chunk-COEGVUM3.js";import"./chunk-QGAOYLQU.js";import"./chunk-RM2KGG7J.js";import"./chunk-PEOYNJJM.js";import"./chunk-5W4BSVZJ.js";import"./chunk-QZEIAQ3M.js";import{b as A}from"./chunk-2KD757N6.js";import"./chunk-AFHEXZUZ.js";import{a as ue}from"./chunk-JYRKUYG6.js";import"./chunk-VNXFTYQQ.js";import{B as oe,G as ie,H as ae,L as se,P as re,Y as le,c as H,e as z,f as W,j,p as Q,q as Y,r as Z,s as ee,t as te,v as ne}from"./chunk-CJKZ27FM.js";import{b as ce,d as me}from"./chunk-5E3B4AEF.js";import{b as K,d as J,e as X}from"./chunk-CQJRBQ6I.js";import"./chunk-V2UO7ES2.js";import"./chunk-HDDAGHHE.js";import"./chunk-YF6JHIN5.js";import"./chunk-2YUSBRXY.js";import{$ as u,Ac as w,Bc as V,Db as C,Eb as m,Fb as a,Gb as r,Nb as G,Rc as q,Ta as d,Ub as _,Vb as p,W as L,Wb as B,Xb as U,Yb as x,_b as I,ac as F,ea as h,fa as S,hb as R,lc as v,qa as E,sa as $,tc as M,uc as D,vc as O,xb as y,yb as k}from"./chunk-K5XGRFWJ.js";import"./chunk-7CGTOI24.js";var f=class c{#e=new Map;saveState(t){let e=de();return this.#e.set(e,t),e}getState(t){return this.#e.get(t)}static \u0275fac=function(e){return new(e||c)};static \u0275prov=L({token:c,factory:c.\u0275fac,providedIn:"root"})};var he=()=>["backup"];function Se(c,t){c&1&&r(0,"sh-progress-bar",10)}function Te(c,t){if(c&1){let e=G();m(0,"form",11)(1,"sh-select",12)(2,"label",13),_(3,1),r(4,"sh-icon",14),p(),a(),r(5,"input",15),a(),m(6,"sh-form-field")(7,"label",16),_(8,2),r(9,"sh-icon",17),p(),a(),r(10,"textarea",18),a(),m(11,"sh-form-field")(12,"label",19),_(13,3),r(14,"sh-icon",20),p(),a(),r(15,"textarea",21),a()(),m(16,"sh-divider"),B(17,4),a(),m(18,"form",11)(19,"sh-form-field")(20,"label",22),_(21,5),r(22,"sh-icon",23),p(),a(),r(23,"input",24),a(),m(24,"sh-form-field")(25,"label",25),_(26,6),r(27,"sh-icon",26),p(),a(),r(28,"input",27),a(),m(29,"app-filters",28),O("filtersChange",function(i){h(e);let s=F();return D(s.filters,i)||(s.filters=i),S(i)}),I("filtersChange",function(i){h(e);let s=F();return S(s.updateFilters(i))}),a()(),m(30,"app-options-list",29),O("optionsChange",function(i){h(e);let s=F();return D(s.settings,i)||(s.settings=i),S(i)}),a(),m(31,"div",30)(32,"button",31),I("click",function(){h(e);let i=F();return S(i.submit())}),_(33,7),r(34,"sh-icon"),p(),a()()}if(c&2){let e=F();C("formGroup",e.baseCmdForm),d(),C("options",e.commandOptions()??V(11,he))("inlineSearch",!0),d(17),C("formGroup",e.standardFields),d(11),M("filters",e.filters),C("osType",e.osType()??""),d(),M("options",e.settings),C("hasFreeTextSettings",!0),d(2),v("loading",e.isSubmitting()),d(2),U(e.baseCmdForm.value.command),x(33)}}var l=new Z,P=class c{#e=u(b);#n=u(me);#o=u(J);#t=u(K);#a=u(ce);#s=u(_e);#i=u(f);#r=u(ue);osType=q(()=>this.#r.systemInfo()?.OSType);#l=A(this.#t.params);commandOptions=A(this.#a.getApiV1Commandline());isSubmitting=E(!1);optionsFields=this.#e.optionsFields;standardFields=l.group({"backup-id":l.control(""),"backup-name":l.control(""),dbpath:l.control(""),filters:l.array([])});baseCmdForm=l.group({command:l.control("backup"),targetUrl:l.control(""),arguments:l.control("")});finishedLoading=this.#e.finishedLoading;backupId=this.#e.backupId;filters=E([]);settings=this.#e.settings;updateFilters(t){this.standardFields.controls.filters.clear(),t.forEach(e=>this.standardFields.controls.filters.push(l.control(e))),this.filters.set(t)}#m=$(()=>{let t=this.#l()?.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){if(this.standardFields.patchValue({dbpath:t.DBPath,"backup-id":t.ID,"backup-name":t.Name}),this.standardFields.controls.filters.clear(),t.Filters&&t.Filters.length){let e=t.Filters.map(n=>`${n.Include?"":"-"}${n.Expression}`);e.forEach(n=>{this.standardFields.controls.filters.push(l.control(n))}),this.filters.set(e)}else this.filters.set([])}submit(){this.#s.resumeDialogCheck(()=>this.#c())}#c(){this.isSubmitting.set(!0);let t=this.updateUrl(),e=this.baseCmdForm.value,n=e.targetUrl??"",i=(e.arguments??"").split(`
2
2
  `)??[],s=[n,...i].filter(o=>o.length>0),g=this.standardFields.value,T=g.filters??[],N=[e.command,...s,`--backup-name=${g["backup-name"]}`,`--dbpath=${g.dbpath}`,`--backup-id=${g["backup-id"]}`,...T.filter(o=>o).map(o=>o.startsWith("-")?`--exclude=${o?.slice(1)}`:`--include=${o}`),...this.#e.mapFormsToSettings(["backup-id","backup-name","dbpath"]).map(o=>`${o.Name.startsWith("--")?"":"--"}${o.Name}=${o.Value}`),"--disable-module=console-password-input"];this.#n.postApiV1Commandline({requestBody:N}).subscribe({next:o=>{o.Status==="OK"&&this.#o.navigate(["backup",this.backupId(),"commandline",o.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??[],i=this.settings(),s=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:i});return this.#o.navigate([],{relativeTo:this.#t,queryParams:{state:s},replaceUrl:!0}),s}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(i=>{this.standardFields.controls.filters.push(l.control(i))}),this.filters.set(n.filters)),n.options&&n.options.length>0&&this.settings.set(n.options))}static \u0275fac=function(e){return new(e||c)};static \u0275cmp=R({type:c,selectors:[["app-commandline"]],features:[w([b])],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 i;i=$localize` Commandline Arguments ${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON:`;let s;s=$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 T;T=$localize` Backup Name ${"\uFFFD#27\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#27\uFFFD"}:CLOSE_TAG_SH_ICON:`;let N;return N=$localize`${"\uFFFD#34\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#34\uFFFD"}:CLOSE_TAG_SH_ICON: Run "${"\uFFFD0\uFFFD"}:INTERPOLATION:" command now `,[t,e,n,i,s,g,T,N,[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,"filtersChange","filters","osType"],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["shButton","",1,"raised","primary",3,"click"]]},template:function(e,n){e&1&&(r(0,"app-status-bar"),m(1,"section")(2,"div",8)(3,"button",9),_(4,0),r(5,"sh-icon"),p(),a()(),y(6,Se,1,0,"sh-progress-bar",10)(7,Te,35,12),a()),e&2&&(d(6),k(n.finishedLoading()?7:6))},dependencies:[ee,j,H,z,W,pe,Ce,ge,te,Y,Q,X,ae,oe,ie,re,se,ne,le],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{a}from"./chunk-MJPEKJ3T.js";import"./chunk-TPKKLIFK.js";import"./chunk-X5W2K6AN.js";import"./chunk-COEGVUM3.js";import"./chunk-PEOYNJJM.js";import"./chunk-JYRKUYG6.js";import"./chunk-CJKZ27FM.js";import"./chunk-5E3B4AEF.js";import"./chunk-HDDAGHHE.js";import"./chunk-YF6JHIN5.js";import"./chunk-2YUSBRXY.js";import"./chunk-K5XGRFWJ.js";import"./chunk-7CGTOI24.js";export{a as OptionsListComponent};
@@ -0,0 +1 @@
1
+ import"./chunk-7CGTOI24.js";var o=[{path:"",loadComponent:()=>import("./chunk-TOV6NJCD.js"),children:[{path:"",redirectTo:"stored",pathMatch:"full"},{path:"stored",loadComponent:()=>import("./chunk-CWBB6FON.js")},{path:"live",loadComponent:()=>import("./chunk-4J64RICN.js")}]}],t=o;export{t as default};
@@ -1 +1 @@
1
- import{g as pe}from"./chunk-XXVDL5TR.js";import"./chunk-GRE6GKVP.js";import{b as ue,c as de,m as Se,q as Ee,r as Ce}from"./chunk-DJXLNIMV.js";import"./chunk-CAQ3XMFP.js";import"./chunk-VC55KFAX.js";import{c as Te,d as ge}from"./chunk-ZEFSBETQ.js";import"./chunk-6Q6SSTBK.js";import"./chunk-YCJYEQF7.js";import"./chunk-OHYENIPP.js";import"./chunk-UTXZPAY6.js";import{a as M}from"./chunk-IMQUTGIK.js";import"./chunk-BACKG7KA.js";import"./chunk-IQL3REGJ.js";import"./chunk-AIAUP7OE.js";import"./chunk-C6PICAXB.js";import"./chunk-6JS7B4FW.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,v as oe,w as re,y as ae,z as se}from"./chunk-VKQQDCUN.js";import"./chunk-DSYNIXJF.js";import{b as j,d as q}from"./chunk-NPFPMA4P.js";import"./chunk-O2SMJYPC.js";import"./chunk-N2AU7VKX.js";import"./chunk-ZC23RK4J.js";import"./chunk-OPHQNXYO.js";import{$b as l,Ac as K,Cb as D,Db as r,Eb as a,Fb as O,Jb as V,Kb as W,Mb as S,Qc as $,Sa as T,Tb as E,Ub as C,Vb as I,Xc as w,Yb as z,Zb as u,_ as m,da as _,ea as c,gb as B,gc as J,ha as v,hc as X,nc as y,pa as N,sc as f,tc as R,uc as h,vc as P,wb as p,wc as A,xb as F,xc as L,zc as H}from"./chunk-TQTOIWBK.js";import"./chunk-7CGTOI24.js";var Fe=["formRef"],Oe=["testUrl"],me=()=>({maxWidth:"700px",width:"100%"});function Re(o,i){if(o&1){let e=S();r(0,"button",24),u("click",function(){_(e);let t=l();return c(t.openTargetUrlDialog())}),E(1,5),O(2,"sh-icon"),C(),a()}}function Ne(o,i){if(o&1){let e=S();r(0,"button",24),u("click",function(){_(e);let t=l(2);return c(t.copyTargetUrl())}),E(1,7),O(2,"sh-icon"),C(),a()}}function De(o,i){if(o&1){let e=S();r(0,"sh-menu")(1,"button",15)(2,"sh-icon"),y(3,"dots-three-vertical"),a()(),V(4,25),r(5,"button",24),u("click",function(){_(e);let t=l();return c(t.openTargetUrlDialog())}),E(6,6),O(7,"sh-icon"),C(),a(),p(8,Ne,3,0,"button",15),W(),a()}if(o&2){l();let e=L(0);T(8),F(e?8:-1)}}function Ie(o,i){if(o&1){let e=S();r(0,"app-destination-list-item",17)(1,"button",20),u("click",function(){_(e);let t=l();return c(t.removeDestination())}),I(2,8),a()()}if(o&2){l();let e=L(12);D("destination",e)}}function fe(o,i){if(o&1){let e=S();r(0,"app-destination-list",26),u("setDestination",function(t){_(e);let s=l();return c(s.setDestination(t))}),a()}}function he(o,i){if(o&1){let e=S();r(0,"app-single-destination",27),h("targetUrlChange",function(t){_(e);let s=l();return R(s.targetUrlModel,t)||(s.targetUrlModel=t),c(t)}),a()}if(o&2){let e=l();f("targetUrl",e.targetUrlModel)}}function Me(o,i){o&1&&(E(0,4,1),O(1,"sh-icon",22),C())}function ye(o,i){o&1&&(E(0,4,2),O(1,"sh-icon"),C())}function Pe(o,i){if(o&1){let e=S();r(0,"sh-dialog",28),h("isOpenChange",function(t){_(e);let s=l();return R(s.targetUrlDialogOpen,t)||(s.targetUrlDialogOpen=t),c(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){_(e);let s=l();return R(s.targetUrlCtrl,t)||(s.targetUrlCtrl=t),c(t)}),a()()(),r(10,"footer",34)(11,"button",20),u("click",function(){_(e);let t=l();return c(t.closeTargetUrlDialog(!1))}),y(12,"Cancel"),a(),r(13,"button",35),u("click",function(){_(e);let t=l();return c(t.closeTargetUrlDialog(!0))}),E(14,11),O(15,"sh-icon"),C(),a()()()}if(o&2){let e=l();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([Ee])],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=S();P(0),r(1,"form",12,0),u("submit",function(){return 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 _(t),R(n.targetUrlModel,g)||(n.targetUrlModel=g),c(g)})("testSignalChange",function(g){return _(t),R(n.testSignal,g)||(n.testSignal=g),c(g)}),a(),P(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),u("click",function(){return 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,ye,2,0,"sh-icon"),C(),a()()(),p(24,Pe,16,4,"sh-dialog",23)}if(e&2){let t=A(!!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=A(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:[Ce,de,ue,ie,ne,Q,Y,Z,te,ee,le,_e,ce,oe,ae,re,Se],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-KI2HT2TI.js";import"./chunk-MJPEKJ3T.js";import{b as ue,c as de,m as Se,q as Ee,r as Ce}from"./chunk-RTGUYIWH.js";import"./chunk-PNQ5BDQN.js";import"./chunk-TPKKLIFK.js";import{c as Te,d as ge}from"./chunk-X5W2K6AN.js";import"./chunk-6Q6SSTBK.js";import"./chunk-COEGVUM3.js";import"./chunk-QGAOYLQU.js";import"./chunk-RM2KGG7J.js";import{a as M}from"./chunk-PEOYNJJM.js";import"./chunk-QZEIAQ3M.js";import"./chunk-2KD757N6.js";import"./chunk-AFHEXZUZ.js";import"./chunk-JYRKUYG6.js";import"./chunk-VNXFTYQQ.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,v as oe,w as re,y as ae,z as se}from"./chunk-CJKZ27FM.js";import"./chunk-5E3B4AEF.js";import{b as j,d as q}from"./chunk-CQJRBQ6I.js";import"./chunk-V2UO7ES2.js";import"./chunk-HDDAGHHE.js";import"./chunk-YF6JHIN5.js";import"./chunk-2YUSBRXY.js";import{$ as m,Ac as H,Bc as K,Db as D,Eb as r,Fb as a,Gb as O,Kb as V,Lb as W,Nb as S,Rc as $,Ta as T,Ub as E,Vb as C,Wb as I,Yc as w,Zb as z,_b as u,ac as l,ea as _,fa as c,hb as B,hc as J,ia as v,ic as X,oc as y,qa as N,tc as f,uc as R,vc as h,wc as P,xb as p,xc as A,yb as F,yc as L}from"./chunk-K5XGRFWJ.js";import"./chunk-7CGTOI24.js";var Fe=["formRef"],Oe=["testUrl"],me=()=>({maxWidth:"700px",width:"100%"});function Re(o,i){if(o&1){let e=S();r(0,"button",24),u("click",function(){_(e);let t=l();return c(t.openTargetUrlDialog())}),E(1,5),O(2,"sh-icon"),C(),a()}}function Ne(o,i){if(o&1){let e=S();r(0,"button",24),u("click",function(){_(e);let t=l(2);return c(t.copyTargetUrl())}),E(1,7),O(2,"sh-icon"),C(),a()}}function De(o,i){if(o&1){let e=S();r(0,"sh-menu")(1,"button",15)(2,"sh-icon"),y(3,"dots-three-vertical"),a()(),V(4,25),r(5,"button",24),u("click",function(){_(e);let t=l();return c(t.openTargetUrlDialog())}),E(6,6),O(7,"sh-icon"),C(),a(),p(8,Ne,3,0,"button",15),W(),a()}if(o&2){l();let e=L(0);T(8),F(e?8:-1)}}function Ie(o,i){if(o&1){let e=S();r(0,"app-destination-list-item",17)(1,"button",20),u("click",function(){_(e);let t=l();return c(t.removeDestination())}),I(2,8),a()()}if(o&2){l();let e=L(12);D("destination",e)}}function fe(o,i){if(o&1){let e=S();r(0,"app-destination-list",26),u("setDestination",function(t){_(e);let s=l();return c(s.setDestination(t))}),a()}}function he(o,i){if(o&1){let e=S();r(0,"app-single-destination",27),h("targetUrlChange",function(t){_(e);let s=l();return R(s.targetUrlModel,t)||(s.targetUrlModel=t),c(t)}),a()}if(o&2){let e=l();f("targetUrl",e.targetUrlModel)}}function Me(o,i){o&1&&(E(0,4,1),O(1,"sh-icon",22),C())}function ye(o,i){o&1&&(E(0,4,2),O(1,"sh-icon"),C())}function Pe(o,i){if(o&1){let e=S();r(0,"sh-dialog",28),h("isOpenChange",function(t){_(e);let s=l();return R(s.targetUrlDialogOpen,t)||(s.targetUrlDialogOpen=t),c(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){_(e);let s=l();return R(s.targetUrlCtrl,t)||(s.targetUrlCtrl=t),c(t)}),a()()(),r(10,"footer",34)(11,"button",20),u("click",function(){_(e);let t=l();return c(t.closeTargetUrlDialog(!1))}),y(12,"Cancel"),a(),r(13,"button",35),u("click",function(){_(e);let t=l();return c(t.closeTargetUrlDialog(!0))}),E(14,11),O(15,"sh-icon"),C(),a()()()}if(o&2){let e=l();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([Ee])],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=S();P(0),r(1,"form",12,0),u("submit",function(){return 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 _(t),R(n.targetUrlModel,g)||(n.targetUrlModel=g),c(g)})("testSignalChange",function(g){return _(t),R(n.testSignal,g)||(n.testSignal=g),c(g)}),a(),P(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),u("click",function(){return 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,ye,2,0,"sh-icon"),C(),a()()(),p(24,Pe,16,4,"sh-dialog",23)}if(e&2){let t=A(!!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=A(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:[Ce,de,ue,ie,ne,Q,Y,Z,te,ee,le,_e,ce,oe,ae,re,Se],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 +1 @@
1
- import{B as y}from"./chunk-VKQQDCUN.js";import{$b as r,Db as i,Eb as o,Mb as C,Qc as D,Sa as n,Vc as b,Wc as T,Zb as g,da as u,ea as _,gb as x,nc as l,oc as m,wb as s,xb as d}from"./chunk-TQTOIWBK.js";import{a as f}from"./chunk-7CGTOI24.js";function v(t,a){if(t&1&&(i(0,"p"),l(1),o()),t&2){let e=r();n(),m(e._data().message)}}function S(t,a){if(t&1){let e=C();i(0,"button",5),g("click",function(){u(e);let p=r();return _(p.close("cancel"))}),l(1),o()}if(t&2){let e=r();n(),m(e._data().cancelText)}}function k(t,a){if(t&1){let e=C();i(0,"button",6),g("click",function(){u(e);let p=r();return _(p.close("confirm"))}),l(1),o()}if(t&2){let e=r();n(),m(e._data().confirmText)}}var w={title:$localize`Are you sure?`,confirmText:void 0,cancelText:$localize`Cancel`},h=class t{data=T();_data=D(()=>f(f({},w),this.data()));closed=b();close(a="confirm"){this.closed.emit(a==="confirm")}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=x({type:t,selectors:[["app-confirm-dialog"]],inputs:{data:[1,"data"]},outputs:{closed:"closed"},decls:8,vars:4,consts:[["header",""],["content",""],["footer",""],["shButton","",1,""],["shButton","",1,"raised","primary"],["shButton","",1,"",3,"click"],["shButton","",1,"raised","primary",3,"click"]],template:function(e,c){e&1&&(i(0,"header",0)(1,"h3"),l(2),o()(),i(3,"div",1),s(4,v,2,1,"p"),o(),i(5,"footer",2),s(6,S,2,1,"button",3),s(7,k,2,1,"button",4),o()),e&2&&(n(2),m(c._data().title),n(2),d(c._data().message?4:-1),n(2),d(c._data().cancelText?6:-1),n(),d(c._data().confirmText?7:-1))},dependencies:[y],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};export{h as a};
1
+ import{B as y}from"./chunk-CJKZ27FM.js";import{Eb as i,Fb as o,Nb as C,Rc as D,Ta as n,Wc as b,Xc as T,_b as g,ac as r,ea as u,fa as _,hb as x,oc as l,pc as m,xb as s,yb as d}from"./chunk-K5XGRFWJ.js";import{a as f}from"./chunk-7CGTOI24.js";function v(t,a){if(t&1&&(i(0,"p"),l(1),o()),t&2){let e=r();n(),m(e._data().message)}}function S(t,a){if(t&1){let e=C();i(0,"button",5),g("click",function(){u(e);let p=r();return _(p.close("cancel"))}),l(1),o()}if(t&2){let e=r();n(),m(e._data().cancelText)}}function k(t,a){if(t&1){let e=C();i(0,"button",6),g("click",function(){u(e);let p=r();return _(p.close("confirm"))}),l(1),o()}if(t&2){let e=r();n(),m(e._data().confirmText)}}var w={title:$localize`Are you sure?`,confirmText:void 0,cancelText:$localize`Cancel`},h=class t{data=T();_data=D(()=>f(f({},w),this.data()));closed=b();close(a="confirm"){this.closed.emit(a==="confirm")}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=x({type:t,selectors:[["app-confirm-dialog"]],inputs:{data:[1,"data"]},outputs:{closed:"closed"},decls:8,vars:4,consts:[["header",""],["content",""],["footer",""],["shButton","",1,""],["shButton","",1,"raised","primary"],["shButton","",1,"",3,"click"],["shButton","",1,"raised","primary",3,"click"]],template:function(e,c){e&1&&(i(0,"header",0)(1,"h3"),l(2),o()(),i(3,"div",1),s(4,v,2,1,"p"),o(),i(5,"footer",2),s(6,S,2,1,"button",3),s(7,k,2,1,"button",4),o()),e&2&&(n(2),m(c._data().title),n(2),d(c._data().message?4:-1),n(2),d(c._data().cancelText?6:-1),n(),d(c._data().confirmText?7:-1))},dependencies:[y],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};export{h as a};
@@ -1 +1 @@
1
- import{b as s}from"./chunk-6Q6SSTBK.js";import{V as c}from"./chunk-TQTOIWBK.js";import{a as i}from"./chunk-7CGTOI24.js";var d=/[a-zA-Z0-9_\-\+\.!@#$%^&*?_~()-]/,m=class n{generate(r,t=d){let a;do a=this.generatePassword(r,t);while(this.calculatePasswordStrength(a)<5);return a}generatePassword(r,t=d){return Array.apply(null,{length:r}).map(()=>{let a;for(;;)if(a=String.fromCharCode(s()),t.test(a))return a},this).join("")}calculatePasswordStrength(r){let t=1;return r.length>=8&&t++,r.match(/[a-z]/)&&r.match(/[A-Z]/)&&t++,r.match(/\d+/)&&t++,r.match(/.[!,@,#,$,%,^,&,*,?,_,~,(,),-]/)&&t++,Math.min(t,5)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};function y(n,r,t="conditional"){return a=>{if(!a.parent)return null;let e=null;if(n(a.parent)&&(e=(Array.isArray(r)?r:[r]).find(l=>l(a)!==null)??null),t&&e){let o={};o[t]=e,e=o}return e}}function F(){return n=>(n.parent&&Object.values(n.parent.controls).forEach(r=>{r!==n&&r.updateValueAndValidity()}),null)}function C(n,r,t,a="conditional"){return e=>{if(!e.parent)return null;let o={},l=e.parent.get(n);if(!l)return console.warn("Conditional field not found"),null;if(Array.isArray(r)?l.value?.includes(r):l.value===r){let f=Array.isArray(t)?t:[t];for(let A of f){let u=A(e),p=o||{};if(u!==null){o=i(i({},p),u);break}}}return o}}export{m as a,y as b,F as c,C as d};
1
+ import{b as s}from"./chunk-6Q6SSTBK.js";import{W as c}from"./chunk-K5XGRFWJ.js";import{a as i}from"./chunk-7CGTOI24.js";var d=/[a-zA-Z0-9_\-\+\.!@#$%^&*?_~()-]/,m=class n{generate(r,t=d){let a;do a=this.generatePassword(r,t);while(this.calculatePasswordStrength(a)<5);return a}generatePassword(r,t=d){return Array.apply(null,{length:r}).map(()=>{let a;for(;;)if(a=String.fromCharCode(s()),t.test(a))return a},this).join("")}calculatePasswordStrength(r){let t=1;return r.length>=8&&t++,r.match(/[a-z]/)&&r.match(/[A-Z]/)&&t++,r.match(/\d+/)&&t++,r.match(/.[!,@,#,$,%,^,&,*,?,_,~,(,),-]/)&&t++,Math.min(t,5)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};function y(n,r,t="conditional"){return a=>{if(!a.parent)return null;let e=null;if(n(a.parent)&&(e=(Array.isArray(r)?r:[r]).find(l=>l(a)!==null)??null),t&&e){let o={};o[t]=e,e=o}return e}}function F(){return n=>(n.parent&&Object.values(n.parent.controls).forEach(r=>{r!==n&&r.updateValueAndValidity()}),null)}function C(n,r,t,a="conditional"){return e=>{if(!e.parent)return null;let o={},l=e.parent.get(n);if(!l)return console.warn("Conditional field not found"),null;if(Array.isArray(r)?l.value?.includes(r):l.value===r){let f=Array.isArray(t)?t:[t];for(let A of f){let u=A(e),p=o||{};if(u!==null){o=i(i({},p),u);break}}}return o}}export{m as a,y as b,F as c,C as d};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-ZKIZ7IIA.js";import"./chunk-AXG7WHBS.js";import"./chunk-AXLO5KWF.js";import"./chunk-BPHX6VXP.js";import"./chunk-XWML36YQ.js";import"./chunk-6Q6SSTBK.js";import"./chunk-COEGVUM3.js";import"./chunk-PEOYNJJM.js";import"./chunk-5W4BSVZJ.js";import"./chunk-AFHEXZUZ.js";import"./chunk-JYRKUYG6.js";import"./chunk-VNXFTYQQ.js";import"./chunk-CJKZ27FM.js";import"./chunk-5E3B4AEF.js";import"./chunk-CQJRBQ6I.js";import"./chunk-V2UO7ES2.js";import"./chunk-HDDAGHHE.js";import"./chunk-YF6JHIN5.js";import"./chunk-2YUSBRXY.js";import"./chunk-K5XGRFWJ.js";import"./chunk-7CGTOI24.js";export{a as BackupProgressComponent};
@@ -0,0 +1 @@
1
+ import{a as p}from"./chunk-RM2KGG7J.js";import{a as R}from"./chunk-PEOYNJJM.js";import{a as b}from"./chunk-QZEIAQ3M.js";import{a as f,b as d}from"./chunk-AFHEXZUZ.js";import{a as m}from"./chunk-JYRKUYG6.js";import{z as u}from"./chunk-CJKZ27FM.js";import{d as h}from"./chunk-5E3B4AEF.js";import{$ as s,Rc as a,W as g,qa as o,sa as n}from"./chunk-K5XGRFWJ.js";var S=class l{#c=s(p);#g=s(u);#t=s(h);#o=s(m);#l=s(f);#n=s(d);#u=s(b);constructor(){this.#l.subscribe("remotecontrol")}repeatRegisterTimer=null;#s=null;#r=0;#h=5;#m=2e3;pendingRefresh=!1;state=o("unknown");claimUrl=o(null);registerUrl=o("");customRegisterUrl=o("");status=a(()=>{let e=this.state();return e==="connecting"?$localize`Console connection is enabled but not connected`:e==="connected"?$localize`Connected to console`:e==="registering"?$localize`Registering machine...`:e==="registeringfaulted"?$localize`Registration failed`:e==="registered"?$localize`Registered, waiting for accept`:e==="disabled"?$localize`Console connection is configured but not enabled`:e==="unknown"?$localize`...loading...`:$localize`Console connection is not set up`});sysInfoEffect=n(()=>{let e=this.#o.systemInfo();e&&this.registerUrl.set(e.RemoteControlRegistrationUrl??"")});remoteEffect=n(()=>{let e=this.#l.remoteControlState();e&&this.#e(e)});pendingRefreshEffect=n(()=>{this.#n.isConnectionMethodSet()&&this.pendingRefresh&&(this.pendingRefresh=!1,this.refreshRemoteControlStatus())});#a=a(()=>{let e=this.#n.getConnectionMethod()==="websocket",i=this.#o.hasWsRemoteControl();return e&&i});#f(e){e.RegistrationUrl&&this.claimUrl.set(e.RegistrationUrl),e.IsConnected?this.state.set("connected"):e.IsEnabled?this.state.set("connecting"):e.CanEnable?this.state.set("disabled"):e.IsRegisteringFaulted?this.state.set("registeringfaulted"):e.IsRegistering?e.RegistrationUrl!=null&&e.RegistrationUrl.trim().length>0?this.state.set("registered"):this.state.set("registering"):this.state.set("inactive")}#e(e){if(this.#r=0,this.#f(e),this.#a())return;let i=this.state();this.repeatRegisterTimer!==null&&(clearTimeout(this.repeatRegisterTimer),this.repeatRegisterTimer=null),i==="registering"&&(this.repeatRegisterTimer=setTimeout(()=>{this.#t.postApiV1RemotecontrolRegisterWait().subscribe({next:t=>this.#e(t),error:t=>this.#i(t)})},5e3)),(i==="connecting"||i==="registered")&&(this.repeatRegisterTimer=setTimeout(()=>{this.#t.getApiV1RemotecontrolStatus().subscribe({next:t=>this.#e(t),error:t=>this.#i(t)})},5e3)),e.IsRegistering&&e.CanEnable&&this.#t.deleteApiV1RemotecontrolRegister().subscribe({next:t=>this.#e(t)})}#i(e){if(this.#s!==null&&(clearTimeout(this.#s),this.#s=null),this.#r>=this.#h){this.state.set("registeringfaulted"),this.#r=0;return}let i=this.#m*Math.pow(2,this.#r);this.#r++,this.#s=setTimeout(()=>{this.#s=null,this.#t.getApiV1RemotecontrolStatus().subscribe({next:t=>this.#e(t),error:t=>this.#i(t)})},i)}refreshRemoteControlStatus(){if(!this.#a()){if(!this.#n.isConnectionMethodSet()){this.pendingRefresh=!0;return}this.#t.getApiV1RemotecontrolStatus().subscribe({next:e=>this.#e(e),error:e=>this.#i(e)})}}beginRemoteRegistration(e=!1){this.state.set("registering"),this.#t.postApiV1RemotecontrolRegister({requestBody:{RegistrationUrl:e?this.customRegisterUrl():this.registerUrl()}}).subscribe({next:i=>this.#e(i),error:i=>this.#i(i)})}cancelRemoteRegistration(){this.#t.deleteApiV1RemotecontrolRegister().subscribe({next:e=>this.#e(e),error:e=>this.#i(e)})}enableRemoteControl(){this.#t.postApiV1RemotecontrolEnable().subscribe({next:e=>this.#e(e),error:e=>this.#i(e)})}disableRemoteControl(){this.#t.postApiV1RemotecontrolDisable().subscribe({next:e=>this.#e(e),error:e=>this.#i(e)})}deleteRemoteControl(){let e=this;this.#g.open(R,{data:{title:$localize`Confirm delete`,message:$localize`Are you sure you want to delete the console registration?`,confirmText:$localize`Delete registration`,cancelText:$localize`Cancel`},closed:i=>{i&&e.#t.deleteApiV1RemotecontrolRegistration().subscribe({next:t=>e.#e(t),error:t=>e.#i(t)})}})}openConsole(e="/app/machines",i){let t=this.#u.serverSettings(),C=this.#o.systemInfo(),r="https://app.duplicati.com",c=C?.RemoteControlDashboardUrl??"";if(c.length>0&&(r=c),t&&t["remote-control-dashboard-url"]&&(r=t["remote-control-dashboard-url"]),r=new URL(r).origin+e,i){let y=new URLSearchParams(i);r+=`?${y.toString()}`}this.#c.open(r,"_blank")}static \u0275fac=function(i){return new(i||l)};static \u0275prov=g({token:l,factory:l.\u0275fac,providedIn:"root"})};export{S as a};
@@ -0,0 +1 @@
1
+ import{a as Sn}from"./chunk-JB26UVQP.js";import{a as gn}from"./chunk-FQINMZH2.js";import"./chunk-ZTENLO77.js";import"./chunk-ZKIZ7IIA.js";import{c as re,l as pn}from"./chunk-X5W2K6AN.js";import{b as dn}from"./chunk-AXG7WHBS.js";import{a as Tn}from"./chunk-AXLO5KWF.js";import"./chunk-BPHX6VXP.js";import"./chunk-XWML36YQ.js";import"./chunk-6Q6SSTBK.js";import"./chunk-COEGVUM3.js";import{a as En}from"./chunk-QGAOYLQU.js";import"./chunk-RM2KGG7J.js";import"./chunk-PEOYNJJM.js";import{a as Cn}from"./chunk-5W4BSVZJ.js";import"./chunk-QZEIAQ3M.js";import"./chunk-2KD757N6.js";import{b as Fn}from"./chunk-AFHEXZUZ.js";import"./chunk-JYRKUYG6.js";import"./chunk-VNXFTYQQ.js";import{A as tn,B as le,C as on,E as _n,G as an,K as ln,L as rn,S as cn,T as sn,v as ae,z as nn}from"./chunk-CJKZ27FM.js";import{d as un}from"./chunk-5E3B4AEF.js";import{e as _e}from"./chunk-CQJRBQ6I.js";import"./chunk-V2UO7ES2.js";import"./chunk-HDDAGHHE.js";import"./chunk-YF6JHIN5.js";import"./chunk-2YUSBRXY.js";import{$ as L,Bb as V,Bc as j,Cb as U,Cc as R,Db as E,Eb as o,Fb as i,G as Q,Gb as C,Gc as D,Hc as b,Ic as x,Kb as N,Kc as oe,Lb as M,Mb as $,Nb as h,Qa as J,Rc as q,Ta as a,Ub as u,Vb as F,Wb as d,Xb as k,Yb as H,Zb as K,_b as I,ac as l,ea as m,fa as O,hb as Qe,jc as W,lc as A,mb as P,nb as Ye,oc as T,qa as G,qc as S,sa as qe,tc as Y,ub as Ze,uc as Z,vb as en,vc as ee,wc as ne,xb as p,xc as te,yb as g,yc as ie,zb as z}from"./chunk-K5XGRFWJ.js";import"./chunk-7CGTOI24.js";var On=()=>[_e,import("./chunk-V2M5YF4E.js").then(e=>e.NgTemplateOutlet),le,ae,_n,sn,cn,import("./chunk-PVSB5UU6.js").then(e=>e.BackupProgressComponent),import("./chunk-HPXIWKIK.js").then(e=>e.DurationFormatPipe),import("./chunk-HLHUPBCV.js").then(e=>e.BytesPipe),import("./chunk-HWOUAWOE.js").then(e=>e.RelativeTimePipe)],Nn=()=>["/add-backup"],Mn=()=>["/restore"],mn=e=>({$implicit:e}),In=()=>["/backup/new"],Pn=e=>["/backup",e],Dn=e=>["/restore",e],fn=e=>["/backup",e,"export"],$n=e=>["/backup",e,"delete"],Rn=e=>["/backup",e,"database"],hn=e=>["/backup",e,"commandline"],An=e=>["/backup",e,"log"];function Ln(e,t){e&1&&d(0,11,1)}function xn(e,t){e&1&&d(0,11,2)}function yn(e,t){if(e&1&&d(0,11,3),e&2){let n=l(2);k(n.timeType()),H(0)}}function kn(e,t){if(e&1){let n=h();o(0,"button",64),I("click",function(){let c=m(n).$implicit,s=l(3);return O(s.sortByColumn.set(c.value))}),d(1,15),i()}if(e&2){let n=t.$implicit,_=l(3);A("active",_.orderBy()===n.value),a(),k(n.label),H(1)}}function Hn(e,t){if(e&1&&(o(0,"sh-menu",61)(1,"button",62),u(2,14),C(3,"strong")(4,"sh-icon"),F(),i(),N(5,63),V(6,kn,2,3,"button",65,z),M(),i()),e&2){let n=l(2);a(4),k(n.orderBy()),H(2),a(2),U(n.sortOrderOptions())}}function Gn(e,t){if(e&1){let n=h();o(0,"div",57)(1,"sh-button-group",58),ee("valueChange",function(c){m(n);let s=l();return Z(s.viewMode,c)||(s.viewMode=c),O(c)}),o(2,"button",59),u(3,9),C(4,"sh-icon"),F(),i(),o(5,"button",60),u(6,10),C(7,"sh-icon"),F(),i()(),o(8,"sh-menu",61)(9,"button",62),u(10,11),o(11,"strong"),p(12,Ln,1,0)(13,xn,1,0)(14,yn,1,1),i(),C(15,"sh-icon"),F(),i(),N(16,63),o(17,"button",64),I("click",function(){m(n);let c=l();return O(c.setTimeType("relative"))}),d(18,12),i(),o(19,"button",64),I("click",function(){m(n);let c=l();return O(c.setTimeType("actual"))}),d(20,13),i(),M(),i(),p(21,Hn,8,1,"sh-menu",61),i()}if(e&2){let n=l();a(),Y("value",n.viewMode),a(11),g(n.timeType()=="relative"?12:n.timeType()=="actual"?13:14),a(9),g(n.viewMode()==="list"?21:-1)}}function bn(e,t){if(e&1){let n=h();o(0,"div",70)(1,"div",53)(2,"h3"),T(3),o(4,"sh-chip"),C(5,"img",72),T(6),i()()(),o(7,"div",73)(8,"sh-chip",74),d(9,16),i()(),o(10,"div",57)(11,"button",75),I("click",function(){m(n);let c=l().$implicit,s=l(4);return O(s.openInConsole(c))}),u(12,17),C(13,"sh-icon"),F(),i()(),C(14,"app-backup-progress",76),i()}if(e&2){let n=l().$implicit,_=l(4);a(3),S(" ",n.Backup.Name??_.MISSING_BACKUP_NAME," "),a(2),E("src",_.getBackendIcon(n.Backup.TargetURL),J),a(),S(" ",_.getBackendType(n.Backup.TargetURL)," "),a(8),E("backupId",n.Backup.ID)}}function Bn(e,t){if(e&1&&(o(0,"p")(1,"span"),d(2,23),i(),T(3),D(4,"relativeTime"),i()),e&2){l();let n=ie(5),_=l(6);a(3),S(" ",x(4,1,n,_.timeType()==="actual")," ")}}function vn(e,t){if(e&1&&(T(0),D(1,"durationFormat")),e&2){let n=l(3).$implicit,_=l(4);S(" ",x(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupDuration,_.timeType()==="actual")," ")}}function wn(e,t){e&1&&(N(0),T(1,"-"),M())}function Xn(e,t){if(e&1&&(T(0),D(1,"bytes")),e&2){let n=l(3).$implicit;S(" ",b(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.SourceFilesSize)," ")}}function Jn(e,t){e&1&&(N(0),T(1,"-"),M())}function zn(e,t){if(e&1&&(T(0),D(1,"bytes")),e&2){let n=l(3).$implicit;S(" ",b(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.TargetFilesSize)," ")}}function Vn(e,t){e&1&&(N(0),T(1,"-"),M())}function Un(e,t){if(e&1&&(o(0,"p")(1,"span"),d(2,19),i(),T(3),D(4,"relativeTime"),i(),ne(5),p(6,Bn,5,4,"p"),o(7,"p")(8,"span"),d(9,20),i(),p(10,vn,2,4)(11,wn,2,0,"ng-container"),i(),o(12,"p")(13,"span"),d(14,21),i(),p(15,Xn,2,3)(16,Jn,2,0,"ng-container"),i(),o(17,"p")(18,"span"),d(19,22),i(),p(20,zn,2,3)(21,Vn,2,0,"ng-container"),i()),e&2){let n=l(2).$implicit,_=l(4);a(3),S(" ",x(4,5,n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupFinished,_.timeType()==="actual")," "),a(2);let c=te(_.scheduledTimes()[n.Backup.ID??""]);a(),g(c?6:-1),a(4),g(n.Backup.Metadata!=null&&n.Backup.Metadata.LastBackupDuration?10:11),a(5),g(n.Backup.Metadata!=null&&n.Backup.Metadata.SourceFilesSize?15:16),a(5),g(n.Backup.Metadata!=null&&n.Backup.Metadata.TargetFilesSize?20:21)}}function Kn(e,t){if(e&1&&C(0,"app-backup-progress",76),e&2){let n=l(2).$implicit;E("backupId",n.Backup.ID)}}function Wn(e,t){e&1&&(o(0,"sh-chip",74),d(1,24),i())}function jn(e,t){e&1&&$(0)}function qn(e,t){if(e&1&&(o(0,"div",71)(1,"div",53)(2,"h3"),T(3),o(4,"sh-chip"),C(5,"img",72),T(6),i()(),p(7,Un,22,9)(8,Kn,1,1,"app-backup-progress",76),i(),o(9,"div",73)(10,"sh-chip",77),d(11,18),i(),p(12,Wn,2,0,"sh-chip",74),i(),o(13,"div",57),P(14,jn,1,0,"ng-container",78),i()()),e&2){let n=l().$implicit,_=l(4),c=W(33);a(3),S(" ",n.Backup.Name??_.MISSING_BACKUP_NAME," "),a(2),E("src",_.getBackendIcon(n.Backup.TargetURL),J),a(),S(" ",_.getBackendType(n.Backup.TargetURL)," "),a(),g(_.runningBackupId()!==n.Backup.ID?7:8);let s=_.getBackupVersionCount(n);a(4),k(s)(s),H(11),a(),g(n.Backup.ExternalID?12:-1),a(2),E("ngTemplateOutlet",c)("ngTemplateOutletContext",R(9,mn,n))}}function Qn(e,t){if(e&1&&p(0,bn,15,4,"div",70)(1,qn,15,11,"div",71),e&2){let n=t.$implicit;g(n.Backup.ExternalID?0:1)}}function Yn(e,t){if(e&1&&V(0,Qn,2,1,null,null,z),e&2){let n=l(3);U(n.backups())}}function Zn(e,t){e&1&&(o(0,"div",69),u(1,25),o(2,"button",79),C(3,"sh-icon"),i(),F(),i()),e&2&&(a(2),E("routerLink",j(1,In)))}function et(e,t){if(e&1&&(o(0,"div",68),p(1,Yn,2,0)(2,Zn,4,2,"div",69),i()),e&2){let n=l(2);A("fallback",n.backups().length===0),a(),g(n.backups().length?1:2)}}function nt(e,t){e&1&&(u(0,26,1),$(1),F())}function tt(e,t){e&1&&(u(0,27,1),$(1),F())}function it(e,t){e&1&&(u(0,28,1),$(1),F())}function ot(e,t){e&1&&(u(0,29,1),$(1),F())}function _t(e,t){e&1&&(u(0,30,1),$(1),F())}function at(e,t){e&1&&(u(0,31,1),$(1),F())}function lt(e,t){e&1&&(u(0,32,1),$(1),F())}function rt(e,t){if(e&1&&(T(0),D(1,"relativeTime")),e&2){let n=l().$implicit,_=l(3);S(" ",x(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupFinished,_.timeType()==="actual")," ")}}function ct(e,t){e&1&&(N(0),T(1,"-"),M())}function st(e,t){if(e&1&&(T(0),D(1,"relativeTime")),e&2){l();let n=ie(11),_=l(3);S(" ",x(1,1,n,_.timeType()==="actual")," ")}}function ut(e,t){e&1&&(N(0),T(1,"-"),M())}function Ft(e,t){if(e&1&&(T(0),D(1,"durationFormat")),e&2){let n=l().$implicit,_=l(3);S(" ",x(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupDuration,_.timeType()==="actual")," ")}}function Ct(e,t){e&1&&(N(0),T(1,"-"),M())}function Tt(e,t){if(e&1&&(T(0),D(1,"bytes")),e&2){let n=l().$implicit;S(" ",b(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.SourceFilesSize)," ")}}function dt(e,t){e&1&&(N(0),T(1,"-"),M())}function Et(e,t){if(e&1&&(T(0),D(1,"bytes")),e&2){let n=l().$implicit;S(" ",b(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.TargetFilesSize)," ")}}function pt(e,t){e&1&&(N(0),T(1,"-"),M())}function gt(e,t){e&1&&$(0)}function St(e,t){if(e&1&&(o(0,"tr")(1,"td"),T(2),i(),o(3,"td")(4,"sh-chip",90),C(5,"img",72),T(6),i()(),o(7,"td"),p(8,rt,2,4)(9,ct,2,0,"ng-container"),i(),o(10,"td"),ne(11),p(12,st,2,4)(13,ut,2,0,"ng-container"),i(),o(14,"td"),p(15,Ft,2,4)(16,Ct,2,0,"ng-container"),i(),o(17,"td"),p(18,Tt,2,3)(19,dt,2,0,"ng-container"),i(),o(20,"td"),p(21,Et,2,3)(22,pt,2,0,"ng-container"),i(),o(23,"td")(24,"span"),d(25,35),i()(),o(26,"td"),P(27,gt,1,0,"ng-container",78),i()()),e&2){let n=t.$implicit,_=l(3),c=W(33);a(2),S(" ",n.Backup.Name??_.MISSING_BACKUP_NAME," "),a(3),E("src",_.getBackendIcon(n.Backup.TargetURL),J),a(),S(" ",_.getBackendType(n.Backup.TargetURL)," "),a(2),g(n.Backup.Metadata!=null&&n.Backup.Metadata.LastBackupFinished?8:9),a(3);let s=te(_.scheduledTimes()[n.Backup.ID??""]);a(),g(s?12:13),a(3),g(n.Backup.Metadata!=null&&n.Backup.Metadata.LastBackupDuration?15:16),a(3),g(n.Backup.Metadata!=null&&n.Backup.Metadata.SourceFilesSize?18:19),a(3),g(n.Backup.Metadata!=null&&n.Backup.Metadata.TargetFilesSize?21:22);let f=_.getBackupVersionCount(n);a(4),k(f)(f),H(25),a(2),E("ngTemplateOutlet",c)("ngTemplateOutletContext",R(13,mn,n))}}function mt(e,t){if(e&1){let n=h();o(0,"sh-table",80),ee("sortByColumnChange",function(c){m(n);let s=l(2);return Z(s.sortByColumn,c)||(s.sortByColumn=c),O(c)}),o(1,"tr",81)(2,"th",82),u(3,26),P(4,nt,2,0,"ng-container",83),F(),i(),o(5,"th",84),u(6,27),P(7,tt,2,0,"ng-container",83),F(),i(),o(8,"th",85),u(9,28),P(10,it,2,0,"ng-container",83),F(),i(),o(11,"th",86),u(12,29),P(13,ot,2,0,"ng-container",83),F(),i(),o(14,"th",87),u(15,30),P(16,_t,2,0,"ng-container",83),F(),i(),o(17,"th",88),u(18,31),P(19,at,2,0,"ng-container",83),F(),i(),o(20,"th",89),u(21,32),P(22,lt,2,0,"ng-container",83),F(),i(),o(23,"th"),d(24,33),i(),o(25,"th"),d(26,34),i()(),V(27,St,28,15,"tr",null,z),i()}if(e&2){let n=l(2),_=W(35);E("data",n.backups())("loading",n.backupsLoading()),Y("sortByColumn",n.sortByColumn),a(4),E("ngTemplateOutlet",_),a(3),E("ngTemplateOutlet",_),a(3),E("ngTemplateOutlet",_),a(3),E("ngTemplateOutlet",_),a(3),E("ngTemplateOutlet",_),a(3),E("ngTemplateOutlet",_),a(3),E("ngTemplateOutlet",_),a(5),U(n.backups())}}function Ot(e,t){if(e&1&&p(0,et,3,3,"div",66)(1,mt,29,10,"sh-table",67),e&2){let n=l();g(n.viewMode()==="list"?0:n.viewMode()==="details"?1:-1)}}function Nt(e,t){e&1&&(o(0,"div",91),C(1,"sh-progress-bar",92),o(2,"div",53)(3,"h3"),d(4,36),i()()())}function Mt(e,t){if(e&1){let n=h();o(0,"button",94),I("click",function(){m(n);let c=l(3);return O(c.abort())}),u(1,38),C(2,"sh-icon"),F(),i()}if(e&2){let n=l(3);A("small",n.viewMode()==="details")}}function It(e,t){if(e&1){let n=h();o(0,"button",94),I("click",function(){m(n);let c=l(3);return O(c.stop())}),u(1,39),C(2,"sh-icon"),F(),i()}if(e&2){let n=l(3);A("small",n.viewMode()==="details")}}function Pt(e,t){e&1&&(u(0,37,1),C(1,"sh-icon"),F())}function Dt(e,t){e&1&&(u(0,37,2),C(1,"sh-icon"),F())}function ft(e,t){if(e&1){let n=h();p(0,Mt,3,2,"button",93)(1,It,3,2,"button",93),o(2,"button",94),I("click",function(){m(n);let c=l(2);return O(c.pauseResume())}),u(3,37),p(4,Pt,2,0)(5,Dt,2,0),F(),i()}if(e&2){let n=l(2);g(n.isStopping()?0:1),a(2),A("small",n.viewMode()==="details")("loading",n.isResuming()),a(2),g(n.clientIsRunning()?4:5)}}function $t(e,t){e&1&&d(0,40,1)}function Rt(e,t){e&1&&(o(0,"sh-icon"),T(1,"check"),i())}function ht(e,t){e&1&&(o(0,"sh-icon"),T(1,"dots-three-vertical"),i())}function At(e,t){if(e&1){let n=h();o(0,"button",94),I("click",function(){m(n);let c=l().$implicit,s=l();return O(s.startBackup(c.Backup.ID))}),u(1,40),C(2,"sh-icon"),p(3,$t,1,0),F(),i(),o(4,"button",95)(5,"sh-icon"),T(6,"pencil-simple"),i()(),o(7,"sh-menu")(8,"button",96),p(9,Rt,2,0,"sh-icon")(10,ht,2,0,"sh-icon"),i(),N(11,63),o(12,"h3",97),T(13,"Operations"),i(),o(14,"button",98),u(15,41),C(16,"sh-icon"),F(),i(),o(17,"button",98),u(18,42),C(19,"sh-icon"),F(),i(),o(20,"button",98),u(21,43),C(22,"sh-icon"),F(),i(),C(23,"sh-divider"),o(24,"h3",97),d(25,44),i(),o(26,"button",98),u(27,45),C(28,"sh-icon"),F(),i(),o(29,"button",64),I("click",function(){m(n);let c=l().$implicit,s=l();return O(s.verifyFiles(c.Backup.ID))}),u(30,46),C(31,"sh-icon"),F(),i(),o(32,"button",64),I("click",function(){m(n);let c=l().$implicit,s=l();return O(s.compressBackup(c.Backup.ID))}),u(33,47),C(34,"sh-icon"),F(),i(),o(35,"button",98),u(36,48),C(37,"sh-icon"),F(),i(),C(38,"sh-divider"),o(39,"h3",97),d(40,49),i(),o(41,"button",98),u(42,50),C(43,"sh-icon"),F(),i(),M(),i()}if(e&2){let n=l().$implicit,_=l();A("loading",_.startingBackup()===n.Backup.ID),a(3),g(_.viewMode()==="list"?3:-1),a(),E("routerLink",R(15,Pn,n.Backup.ID)),a(4),A("loading",_.loadingId()===n.Backup.ID)("success",_.successId()===n.Backup.ID),a(),g(_.successId()===n.Backup.ID?9:10),a(5),E("routerLink",R(17,Dn,n.Backup.ID)),a(3),E("routerLink",R(19,fn,n.Backup.ID)),a(3),E("routerLink",R(21,$n,n.Backup.ID)),a(6),E("routerLink",R(23,Rn,n.Backup.ID)),a(9),E("routerLink",R(25,hn,n.Backup.ID)),a(6),E("routerLink",R(27,An,n.Backup.ID))}}function Lt(e,t){if(e&1&&p(0,ft,6,6)(1,At,44,29),e&2){let n=t.$implicit,_=l();g(_.runningBackupId()===n.Backup.ID?0:1)}}function xt(e,t){e&1&&(o(0,"sh-icon",99),T(1,"funnel-simple"),i(),o(2,"sh-icon",100),T(3,"sort-ascending"),i(),o(4,"sh-icon",101),T(5,"sort-descending"),i())}var yt={file:{Display:$localize`Local`,Icon:null}},ce=class e{#t=L(un);#n=L(dn);#e=L(Tn);#o=L(En);#_=L(Fn);#a=L(nn);MISSING_BACKUP_NAME=$localize`Backup name missing`;sortOrderOptions=this.#e.orderByOptions;orderBy=this.#e.orderBy;backups=this.#e.backups;backupsLoading=this.#e.backupsLoading;startingBackup=this.#e.startingBackup;deletingBackup=this.#e.deletingBackup;runningBackupId=this.#n.runningBackupId;timeType=this.#e.timeType;clientIsRunning=this.#n.clientIsRunning;isResuming=this.#n.isResuming;runningTask=q(()=>this.#n.serverState()?.ActiveTask?.Item1);isStopping=q(()=>this.runningTask()==this.#i());scheduledTimes=q(()=>{let t=this.#_.serverState()?.ProposedSchedule??[],n=this.#e.backups(),_={};return n.forEach(c=>{let s=c.Backup?.ID;if(s){var f=t.find(y=>y.Item1==s);f?.Item2?_[s]=f.Item2:c.Schedule?.Time&&(_[s]=c.Schedule.Time)}}),_});#i=G(-1);viewMode=Cn("viewMode","list");sortByColumn=G(this.#e.orderBy());loadingId=G(null);successId=G(null);sortEffect=qe(()=>this.#e.setOrderBy(this.sortByColumn()));ngOnInit(){this.#e.getBackups(!0)}openInConsole(t){let n=t.Backup.ExternalID?.split(":")[1];if(!n){console.error("Backup does not have an external ID");return}this.#o.openConsole("/app/machines/configurations/"+n)}setOrderBy(t){this.#e.setOrderBy(t)}setTimeType(t){this.#e.setTimeType(t)}startBackup(t){this.#n.resumeDialogCheck(()=>this.#e.startBackup(t))}openPauseDialog(){this.#a.open(gn,{maxWidth:"550px",width:"100%"})}pauseResume(){if(this.clientIsRunning()){this.openPauseDialog();return}this.#n.pauseResume().subscribe()}stop(){let t=this.runningTask();t&&(this.#i.set(t),this.#t.postApiV1TaskByTaskidStop({taskid:t}).subscribe())}abort(){let t=this.runningTask();t&&this.#t.postApiV1TaskByTaskidAbort({taskid:t}).subscribe()}getBackendIcon(t){return t?re(t).icon??"database":""}getBackendType(t){if(!t)return"";let n=re(t);if(!n)return"";let _=yt[n.key];if(_?.Display)return _.Display;if(n.key==="s3"){let c="http://null?"+t.split("?")[1],f=new URL(c).searchParams.get("s3-server-name")?.toLowerCase()??"";for(let[y,B]of Object.entries(pn))if(f.endsWith(y))return B}return n.displayName}getBackupVersionCount(t){return parseInt(t?.Backup?.Metadata?.BackupListCount??"",10)||0}verifyFiles(t){this.loadingId.set(t),this.#t.postApiV1BackupByIdVerify({id:t}).pipe(Q(()=>this.loadingId.set(null))).subscribe({next:()=>{this.successId.set(t),setTimeout(()=>this.successId.set(null),2e3)}})}compressBackup(t){this.loadingId.set(t),this.#t.postApiV1BackupByIdCompact({id:t}).pipe(Q(()=>this.loadingId.set(null))).subscribe({next:()=>{this.successId.set(t),setTimeout(()=>this.successId.set(null),2e3)}})}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=Qe({type:e,selectors:[["app-home"]],decls:36,vars:6,consts:()=>{let t;t=$localize`Backups`;let n;n=$localize`Keep your data safe at your chosen destination.`;let _;_=$localize` Create ${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON:`;let c;c=$localize`Restores`;let s;s=$localize`Recover your files from any backup set.`;let f;f=$localize` Start ${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON:`;let y;y=$localize`My backups`;let B;B=$localize`${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:rows${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON: List `;let se;se=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:list${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: Details `;let ue;ue=$localize` Time: ${"\uFFFD#11\uFFFD"}:START_TAG_STRONG:${"\uFFFD*12:1\uFFFD"}:START_BLOCK_IF: Relative ${"\uFFFD/*12:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*13:2\uFFFD"}:START_BLOCK_ELSE_IF: Actual ${"\uFFFD/*13:2\uFFFD"}:CLOSE_BLOCK_ELSE_IF:${"\uFFFD*14:3\uFFFD"}:START_BLOCK_ELSE: ${"\uFFFD0:3\uFFFD"}:INTERPOLATION: ${"\uFFFD/*14:3\uFFFD"}:CLOSE_BLOCK_ELSE:${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:clock${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON:`;let Fe;Fe=$localize`Relative time`;let Ce;Ce=$localize`Actual time`;let Te;Te=$localize` Order by: ${"\uFFFD#3\uFFFD"}:START_TAG_STRONG:${"\uFFFD0\uFFFD"}:INTERPOLATION:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:arrows-down-up${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON:`;let de;de=$localize` ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let Ee;Ee=$localize`Externally managed`;let pe;pe=$localize` Edit in console ${"\uFFFD#13\uFFFD"}:START_TAG_SH_ICON:arrow-up-right${"\uFFFD/#13\uFFFD"}:CLOSE_TAG_SH_ICON:`;let v;v=$localize`{VAR_PLURAL, plural, =0 {No version yet} =1 {1 Version} other {{INTERPOLATION} Versions}}`,v=K(v,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let ge;ge=$localize` ${v}:ICU@@6502601490918455200: `;let Se;Se=$localize`Last successful backup:`;let me;me=$localize`Duration:`;let Oe;Oe=$localize`Source:`;let Ne;Ne=$localize`Destination:`;let Me;Me=$localize`Next scheduled run:`;let Ie;Ie=$localize`Externally managed`;let Pe;Pe=$localize` No backups found ${"\uFFFD#2\uFFFD"}:START_TAG_BUTTON: Click to create one now ${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_BUTTON:`;let De;De=$localize` Backup ${"\uFFFD*4:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*4:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let fe;fe=$localize` Type ${"\uFFFD*7:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*7:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let $e;$e=$localize` Last backup ${"\uFFFD*10:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*10:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Re;Re=$localize` Next run ${"\uFFFD*13:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*13:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let he;he=$localize` Duration ${"\uFFFD*16:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*16:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Ae;Ae=$localize` Source ${"\uFFFD*19:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*19:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Le;Le=$localize` Destination ${"\uFFFD*22:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*22:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let xe;xe=$localize`Version`;let ye;ye=$localize`Actions`;let w;w=$localize`{VAR_PLURAL, plural, =0 {No versions} =1 {1 Version} other {{INTERPOLATION} Versions}}`,w=K(w,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let ke;ke=$localize` ${w}:ICU@@3521773141017690117: `;let He;He=$localize`Loading backups...`;let X;X=$localize`${"\uFFFD*4:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:pause${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Pause ${"\uFFFD/*4:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*5:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:play${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Resume ${"\uFFFD/*5:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,X=K(X);let Ge;Ge=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:skull${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Abort `;let be;be=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:stop${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Stop `;let Be;Be=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:play-circle${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD*3:1\uFFFD"}:START_BLOCK_IF: Start ${"\uFFFD/*3:1\uFFFD"}:CLOSE_BLOCK_IF:`;let ve;ve=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:clock-counter-clockwise${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON: Restore `;let we;we=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:export${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Export `;let Xe;Xe=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:x-circle${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON: Delete `;let Je;Je=$localize`Advanced`;let ze;ze=$localize`${"\uFFFD#28\uFFFD"}:START_TAG_SH_ICON:database${"\uFFFD/#28\uFFFD"}:CLOSE_TAG_SH_ICON: Database `;let Ve;Ve=$localize`${"\uFFFD#31\uFFFD"}:START_TAG_SH_ICON:check-square-offset${"\uFFFD/#31\uFFFD"}:CLOSE_TAG_SH_ICON: Verify files `;let Ue;Ue=$localize`${"\uFFFD#34\uFFFD"}:START_TAG_SH_ICON:file-archive${"\uFFFD/#34\uFFFD"}:CLOSE_TAG_SH_ICON: Compress now `;let Ke;Ke=$localize`${"\uFFFD#37\uFFFD"}:START_TAG_SH_ICON:terminal-window${"\uFFFD/#37\uFFFD"}:CLOSE_TAG_SH_ICON: Commandline `;let We;We=$localize`Reporting`;let je;return je=$localize`${"\uFFFD#43\uFFFD"}:START_TAG_SH_ICON:notepad${"\uFFFD/#43\uFFFD"}:CLOSE_TAG_SH_ICON: Log `,[["actions",""],["sortIcons",""],t,n,_,c,s,f,y,B,se,ue,Fe,Ce,Te,de,Ee,pe,ge,Se,me,Oe,Ne,Me,Ie,Pe,De,fe,$e,Re,he,Ae,Le,xe,ye,ke,He,X,Ge,be,Be,ve,we,Xe,Je,ze,Ve,Ue,Ke,We,je,[1,"type-a","actionable",3,"keydown.enter","keydown.space","routerLink"],["src","assets/images/backup.png","alt","","width","48px"],[1,"text"],["type","button","tabindex","-1","shButton",""],["src","assets/images/restore.png","alt","","width","48px"],[1,"content"],[1,"actions"],[1,"small","type-b",3,"valueChange","value"],["value","list"],["value","details"],[1,"table-overview"],["type","button","shButton","",1,"small"],["menu",""],["type","button",3,"click"],["type","button",3,"active"],[1,"backups",3,"fallback"],[1,"type-b",3,"data","loading","sortByColumn"],[1,"backups"],[1,"no-backups"],[1,"backup","externaly-managed"],[1,"backup"],["alt","",1,"provider-icon",3,"src"],[1,"tags"],[1,"simple","primary"],["type","button","shButton","",3,"click"],[3,"backupId"],[1,"simple","success"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["shButton","",1,"primary","raised",3,"routerLink"],[1,"type-b",3,"sortByColumnChange","data","loading","sortByColumn"],["thead",""],["shSort","name"],[4,"ngTemplateOutlet"],["shSort","type"],["shSort","lastrun"],["shSort","nextrun"],["shSort","duration"],["shSort","sourcesize"],["shSort","destinationsize"],[1,"small"],[1,"loading-list"],[1,"indeterminate","primary"],["shButton","",3,"small"],["shButton","",3,"click"],["type","button","shButton","",3,"routerLink"],["type","button","shButton",""],["title",""],["type","button",3,"routerLink"],[1,"filter"],[1,"asc"],[1,"desc"]]},template:function(n,_){n&1&&(C(0,"app-status-bar"),o(1,"section")(2,"header")(3,"sh-card",51),I("keydown.enter",function(s){return s.target.click()})("keydown.space",function(s){return s.target.click()}),C(4,"img",52),o(5,"div",53)(6,"h3"),d(7,2),i(),o(8,"p"),d(9,3),i()(),o(10,"button",54),u(11,4),C(12,"sh-icon"),F(),i()(),o(13,"sh-card",51),I("keydown.enter",function(s){return s.target.click()})("keydown.space",function(s){return s.target.click()}),C(14,"img",55),o(15,"div",53)(16,"h3"),d(17,5),i(),o(18,"p"),d(19,6),i()(),o(20,"button",54),u(21,7),C(22,"sh-icon"),F(),i()()(),o(23,"div",56)(24,"h2"),N(25),d(26,8),M(),p(27,Gn,22,3,"div",57),i(),Ye(28,Ot,2,1)(29,Nt,5,0),Ze(30,28,On,null,29),i()(),P(32,Lt,2,1,"ng-template",null,0,oe)(34,xt,6,0,"ng-template",null,1,oe)),n&2&&(a(3),E("routerLink",j(4,Nn)),a(10),E("routerLink",j(5,Mn)),a(14),g(_.backups().length>0?27:-1),a(3),en(!_.backupsLoading()))},dependencies:[_e,Sn,on,le,ae,an,ln,rn,tn],styles:["[_nghost-%COMP%]{display:block}h2[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:2rem 0}header[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;padding:0 2rem;gap:1rem}@media only screen and (max-width:768px){header[_ngcontent-%COMP%]{grid-template-columns:1fr}}sh-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem}sh-card[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:.25rem}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.content[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{padding:0 2rem}@media only screen and (max-width:768px){.content[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:.5rem}}sh-menu[_ngcontent-%COMP%]{color:red}.backups[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:0 2rem;gap:.5rem}.backups.fallback[_ngcontent-%COMP%]{justify-content:center;align-items:center;padding:4rem;border:1px solid var(--base-4);background:var(--base-2);border-radius:var(--shape-2);width:calc(100% - 4rem);margin:0 auto}.no-backups[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;align-items:center}.backup[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:2rem;gap:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10)}@media only screen and (max-width:768px){.backup[_ngcontent-%COMP%]{flex-direction:column;align-items:flex-start}}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;width:100%;max-width:40%}@media only screen and (max-width:768px){.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{max-width:initial}}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{color:var(--base-8)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font:var(--paragraph-30);color:var(--base-8)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--base-12)}.backup[_ngcontent-%COMP%] .tags[_ngcontent-%COMP%]{display:flex;align-items:center;flex-direction:column;gap:.5rem}.provider-icon[_ngcontent-%COMP%]{width:1.25rem;height:1.25rem}.actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.sortable[_ngcontent-%COMP%]{-webkit-user-select:none;user-select:none}.sortable[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{margin-left:.5rem;font-size:1rem;justify-self:flex-end;display:none}.sortable[_ngcontent-%COMP%]:not(.sort-asc):not(.sort-desc) sh-icon.filter[_ngcontent-%COMP%]{display:block}.sortable.sort-asc[_ngcontent-%COMP%] sh-icon.asc[_ngcontent-%COMP%]{display:block;color:var(--base-12)}.sortable.sort-desc[_ngcontent-%COMP%] sh-icon.desc[_ngcontent-%COMP%]{display:block;color:var(--base-12)}.actionable[_ngcontent-%COMP%]{cursor:pointer}.actionable[_ngcontent-%COMP%]:after{transition:inset .1s linear}.actionable[_ngcontent-%COMP%]:hover{--card-shp: 0}"],changeDetection:0})};export{ce as default};
@@ -0,0 +1 @@
1
+ import{b as d}from"./chunk-2KD757N6.js";import{a as h,b as E}from"./chunk-AFHEXZUZ.js";import{d as v}from"./chunk-5E3B4AEF.js";import{$ as s,B as g,Rc as n,W as l,qa as u,sa as p}from"./chunk-K5XGRFWJ.js";import{a as o}from"./chunk-7CGTOI24.js";var C="shown-welcome-page-v1",_="hide-console-connection-status",f="use-out-of-process-controller",O="disable-console-control",A="disable-tray-icon-login",S="server-listen-interface",b="allowed-hostnames",R="server-passphrase",T="update-channel",N="startup-delay",D="usage-reporter-level",L="power-mode-provider",m=class i{#t=s(v);#r=s(h);#s=s(E);#n=d(this.#t.getApiV1Serversettings());#e=u(void 0);serverSettings=n(()=>this.#e()||this.#n());#o=p(()=>{let e=this.#r.serverSettings();e&&this.#e.set(e)});constructor(){this.#r.subscribe("serversettings")}isConsoleConnectionStatusHidden=n(()=>{let e=this.serverSettings();return e?e[_]==="True":!1});isControllerIpcEnabled=n(()=>{let e=this.serverSettings();return e?e[f]==="True":!1});refreshServerSettings(){this.#s.getConnectionMethod()!=="websocket"&&this.#t.getApiV1Serversettings().subscribe({next:e=>{this.#e.set(e)}})}#i(e,t){var r=o({},e);for(let[a,c]of Object.entries(t))c===null?delete r[a]:r[a]=c;return r}patchServerSettings(e){let t=o({},this.serverSettings());return this.#e.set(this.#i(this.serverSettings()??{},e)),this.#t.patchApiV1Serversettings({requestBody:e}).pipe(g(r=>{throw this.#e.set(t),r}))}patchServerSetting(e,t){let r={};return r[e]=t,this.patchServerSettings(r)}setShownWelcomePage(){return this.patchServerSetting(C,"true")}setHideConsoleConnectionStatus(e){return this.patchServerSetting(_,e?"True":"False")}setControllerIpcState(e){return this.patchServerSetting(f,e?"True":"False")}setDisableTrayIconLogin(e){return this.patchServerSetting(A,e?"True":"False")}setDisableConsoleControl(e){return this.patchServerSetting(O,e?"True":"False")}setRemoteAccessInterface(e){return this.patchServerSetting(S,e)}setRemoteAccessAllowedHostnames(e){var t={[b]:e};return this.serverSettings()?.[S]==="loopback"&&(t[S]="any"),this.patchServerSettings(t)}setRemoteAccessPassword(e){return this.patchServerSetting(R,e)}setUpdateChannel(e){return this.patchServerSetting(T,e)}setStartupDelay(e){return this.patchServerSetting(N,e)}setUsageReporterLevel(e){return this.patchServerSetting(D,e)}setPowerModeProvider(e){return this.patchServerSetting(L,e)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=l({token:i,factory:i.\u0275fac,providedIn:"root"})};export{m as a};
@@ -0,0 +1 @@
1
+ import"./chunk-7CGTOI24.js";var o=[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"destination",loadComponent:()=>import("./chunk-PDGW22XJ.js")},{path:"encryption",loadComponent:()=>import("./chunk-6JGOGUIX.js")},{path:"select-files",loadComponent:()=>import("./chunk-NFATJ2CP.js")},{path:"options",loadComponent:()=>import("./chunk-3D6EL52D.js")},{path:":taskid/progress",loadComponent:()=>import("./chunk-ZYYLNYSK.js")}],t=o;export{t as default};
@@ -1 +1 @@
1
- import{e as P}from"./chunk-6JS7B4FW.js";import{B as E}from"./chunk-VKQQDCUN.js";import"./chunk-DSYNIXJF.js";import{e as T}from"./chunk-NPFPMA4P.js";import"./chunk-O2SMJYPC.js";import"./chunk-N2AU7VKX.js";import"./chunk-ZC23RK4J.js";import"./chunk-OPHQNXYO.js";import{Db as i,Eb as a,Gb as r,Hb as l,Ib as c,Sa as C,Vb as d,_ as u,ac as h,bc as m,gb as g,nc as b,wb as f,xb as O}from"./chunk-TQTOIWBK.js";import"./chunk-7CGTOI24.js";var S=["*",[["","footer",""]]],L=["*","[footer]"],s=class t{static \u0275fac=function(e){return new(e||t)};static \u0275cmp=g({type:t,selectors:[["app-custom-card"]],ngContentSelectors:L,decls:11,vars:0,consts:[[1,"card"],["src","/assets/noise/auth-noise.svg",1,"noise"],[1,"header-title"],["src","/assets/duplicati/duplicati.svg","alt",""],[1,"bg"]],template:function(e,o){e&1&&(h(S),r(0,"div",0),c(1,"img",1),r(2,"header")(3,"div",2),c(4,"img",3),b(5," Duplicati "),l()(),r(6,"main"),m(7),r(8,"footer"),m(9,1),l()()(),c(10,"div",4))},styles:['[_nghost-%COMP%]{height:100vh;width:100vw;display:flex;align-items:center;justify-content:center;background-color:var(--base-2)}body.dark [_nghost-%COMP%] .card[_ngcontent-%COMP%]:before{background:radial-gradient(rgba(var(--primary-rgb-900),1),#0000 60%)}.card[_ngcontent-%COMP%]{max-width:30rem;width:100%;position:relative;z-index:100;background-color:var(--base-1);border-radius:var(--shape-5);box-shadow:var(--box-shadow-40);border:1px solid var(--base-3);overflow:hidden}.card[_ngcontent-%COMP%]:before{content:"";position:absolute;height:30rem;transform:translateY(-17.8125rem);left:0;right:0;z-index:-2;background:radial-gradient(rgb(from var(--primary-1) r g b/1),#0000 60%)}.card[_ngcontent-%COMP%] img.noise[_ngcontent-%COMP%]{position:absolute;height:30rem;width:100%;transform:translateY(-17.8125rem);left:0;right:0;z-index:-1;-webkit-mask-image:radial-gradient(#000,#0000 60%);mask-image:radial-gradient(#000,#0000 60%)}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;padding:2rem 2rem 0;gap:.75rem;position:relative;z-index:10}.header-title[_ngcontent-%COMP%]{font:var(--title-30);display:flex;align-items:center;gap:.625rem}.header-title[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{height:1.75rem;filter:drop-shadow(0 2px 3px rgba(0,0,0,.3))}main[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;padding:2rem;gap:2.5rem;position:relative;z-index:10}main[_ngcontent-%COMP%] footer[_ngcontent-%COMP%]{font:var(--paragraph-40);color:var(--base-9);text-align:center;text-wrap:balance}.bg[_ngcontent-%COMP%]{position:fixed;inset:0;width:100vw;height:100vh;background-image:url(/assets/backgrounds/base-bg.svg);background-size:cover;background-position:center;background-repeat:no-repeat}body.dark[_ngcontent-%COMP%] .bg[_ngcontent-%COMP%]{opacity:1}footer[_ngcontent-%COMP%]:empty{display:none}'],changeDetection:0})};function v(t,n){t&1&&(i(0,"h3"),d(1,0),a())}function N(t,n){t&1&&(i(0,"h3"),d(1,1),a(),i(2,"button",3),d(3,2),a())}var p=class t{#e=u(P);isLoggingOut=this.#e.isLoggingOut;ngOnInit(){this.#e.logout()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=g({type:t,selectors:[["app-logout"]],decls:3,vars:1,consts:()=>{let n;n=$localize`Logging out...`;let e;e=$localize`You have successfully logged out your being redirected to login page.`;let o;return o=$localize`Go to login page`,[n,e,o,["shButton","","routerLink","/",1,"raised","primary"]]},template:function(e,o){e&1&&(i(0,"app-custom-card"),f(1,v,2,0,"h3")(2,N,4,0),a()),e&2&&(C(),O(o.isLoggingOut()?1:2))},dependencies:[s,E,T],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};export{p as default};
1
+ import{e as P}from"./chunk-VNXFTYQQ.js";import{B as E}from"./chunk-CJKZ27FM.js";import"./chunk-5E3B4AEF.js";import{e as T}from"./chunk-CQJRBQ6I.js";import"./chunk-V2UO7ES2.js";import"./chunk-HDDAGHHE.js";import"./chunk-YF6JHIN5.js";import"./chunk-2YUSBRXY.js";import{$ as u,Eb as i,Fb as a,Hb as r,Ib as l,Jb as c,Ta as C,Wb as d,bc as h,cc as m,hb as g,oc as b,xb as f,yb as O}from"./chunk-K5XGRFWJ.js";import"./chunk-7CGTOI24.js";var S=["*",[["","footer",""]]],L=["*","[footer]"],s=class t{static \u0275fac=function(e){return new(e||t)};static \u0275cmp=g({type:t,selectors:[["app-custom-card"]],ngContentSelectors:L,decls:11,vars:0,consts:[[1,"card"],["src","/assets/noise/auth-noise.svg",1,"noise"],[1,"header-title"],["src","/assets/duplicati/duplicati.svg","alt",""],[1,"bg"]],template:function(e,o){e&1&&(h(S),r(0,"div",0),c(1,"img",1),r(2,"header")(3,"div",2),c(4,"img",3),b(5," Duplicati "),l()(),r(6,"main"),m(7),r(8,"footer"),m(9,1),l()()(),c(10,"div",4))},styles:['[_nghost-%COMP%]{height:100vh;width:100vw;display:flex;align-items:center;justify-content:center;background-color:var(--base-2)}body.dark [_nghost-%COMP%] .card[_ngcontent-%COMP%]:before{background:radial-gradient(rgba(var(--primary-rgb-900),1),#0000 60%)}.card[_ngcontent-%COMP%]{max-width:30rem;width:100%;position:relative;z-index:100;background-color:var(--base-1);border-radius:var(--shape-5);box-shadow:var(--box-shadow-40);border:1px solid var(--base-3);overflow:hidden}.card[_ngcontent-%COMP%]:before{content:"";position:absolute;height:30rem;transform:translateY(-17.8125rem);left:0;right:0;z-index:-2;background:radial-gradient(rgb(from var(--primary-1) r g b/1),#0000 60%)}.card[_ngcontent-%COMP%] img.noise[_ngcontent-%COMP%]{position:absolute;height:30rem;width:100%;transform:translateY(-17.8125rem);left:0;right:0;z-index:-1;-webkit-mask-image:radial-gradient(#000,#0000 60%);mask-image:radial-gradient(#000,#0000 60%)}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;padding:2rem 2rem 0;gap:.75rem;position:relative;z-index:10}.header-title[_ngcontent-%COMP%]{font:var(--title-30);display:flex;align-items:center;gap:.625rem}.header-title[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{height:1.75rem;filter:drop-shadow(0 2px 3px rgba(0,0,0,.3))}main[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;padding:2rem;gap:2.5rem;position:relative;z-index:10}main[_ngcontent-%COMP%] footer[_ngcontent-%COMP%]{font:var(--paragraph-40);color:var(--base-9);text-align:center;text-wrap:balance}.bg[_ngcontent-%COMP%]{position:fixed;inset:0;width:100vw;height:100vh;background-image:url(/assets/backgrounds/base-bg.svg);background-size:cover;background-position:center;background-repeat:no-repeat}body.dark[_ngcontent-%COMP%] .bg[_ngcontent-%COMP%]{opacity:1}footer[_ngcontent-%COMP%]:empty{display:none}'],changeDetection:0})};function v(t,n){t&1&&(i(0,"h3"),d(1,0),a())}function N(t,n){t&1&&(i(0,"h3"),d(1,1),a(),i(2,"button",3),d(3,2),a())}var p=class t{#e=u(P);isLoggingOut=this.#e.isLoggingOut;ngOnInit(){this.#e.logout()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=g({type:t,selectors:[["app-logout"]],decls:3,vars:1,consts:()=>{let n;n=$localize`Logging out...`;let e;e=$localize`You have successfully logged out your being redirected to login page.`;let o;return o=$localize`Go to login page`,[n,e,o,["shButton","","routerLink","/",1,"raised","primary"]]},template:function(e,o){e&1&&(i(0,"app-custom-card"),f(1,v,2,0,"h3")(2,N,4,0),a()),e&2&&(C(),O(o.isLoggingOut()?1:2))},dependencies:[s,E,T],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};export{p as default};