@duplicati/ngclient 0.0.182 → 0.0.184

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 (55) hide show
  1. package/{chunk-3BGJPVDV.js → chunk-36YDXQGU.js} +1 -1
  2. package/{chunk-KSMDO4WE.js → chunk-4OE4TUF6.js} +1 -1
  3. package/{chunk-TEGY2W63.js → chunk-4UDRQ7SJ.js} +1 -1
  4. package/{chunk-PAMKTLG5.js → chunk-4VCGLPSI.js} +1 -1
  5. package/{chunk-JW4235US.js → chunk-6JEFZ6UK.js} +1 -1
  6. package/{chunk-5YSRDRTE.js → chunk-7E34ZROH.js} +1 -1
  7. package/{chunk-DI73L7JI.js → chunk-BZSP7EIX.js} +1 -1
  8. package/{chunk-SBWCJMHH.js → chunk-CCM6IIS4.js} +1 -1
  9. package/{chunk-YV32N6PE.js → chunk-DUVQ5DQX.js} +1 -1
  10. package/{chunk-3U36LG4E.js → chunk-DWRVQLJL.js} +1 -1
  11. package/{chunk-JGQOVZKK.js → chunk-E7TXHOJI.js} +1 -1
  12. package/{chunk-NDPFWL4Y.js → chunk-ECXAVCLV.js} +1 -1
  13. package/{chunk-PUV7YKEQ.js → chunk-ES756JBG.js} +1 -1
  14. package/{chunk-CR3C6XYB.js → chunk-FHY4QVD4.js} +1 -1
  15. package/{chunk-XADL5RYU.js → chunk-FPDCZ73R.js} +1 -1
  16. package/chunk-FPYNIDJR.js +1 -0
  17. package/chunk-G4SK3PS7.js +1 -0
  18. package/{chunk-XKHIN6T2.js → chunk-GYUN5SXR.js} +1 -1
  19. package/{chunk-ETAHWUMY.js → chunk-I7DKD6VJ.js} +1 -1
  20. package/{chunk-6ALGXRIS.js → chunk-IMDBR2SZ.js} +1 -1
  21. package/{chunk-MXH4QJKB.js → chunk-K5BA43JC.js} +1 -1
  22. package/chunk-KONVFYXE.js +1 -0
  23. package/{chunk-NJ2XZSM6.js → chunk-LZBEKGBK.js} +1 -1
  24. package/{chunk-PCFTQ4BE.js → chunk-MBWEBR5X.js} +1 -1
  25. package/{chunk-QG566HCB.js → chunk-MIXALKMU.js} +1 -1
  26. package/{chunk-FQYMMYS4.js → chunk-NL7JLA2L.js} +1 -1
  27. package/{chunk-JJJ5UALU.js → chunk-NV45UNPE.js} +1 -1
  28. package/{chunk-QZRRXR3V.js → chunk-OG6NP7IP.js} +1 -1
  29. package/{chunk-TT4FAVLM.js → chunk-OKWBFXS6.js} +1 -1
  30. package/{chunk-5QAV2WXY.js → chunk-QASUFPL6.js} +1 -1
  31. package/{chunk-QHQQ5BDV.js → chunk-QNAAXVL5.js} +1 -1
  32. package/{chunk-4N3AWKEK.js → chunk-QQ2F3BER.js} +1 -1
  33. package/{chunk-LDLSFKM4.js → chunk-RFA232NB.js} +1 -1
  34. package/{chunk-YEYDDZIG.js → chunk-RYNESQNU.js} +1 -1
  35. package/{chunk-ZHTPSBYJ.js → chunk-SA6T6NYJ.js} +1 -1
  36. package/{chunk-4NN5ZM73.js → chunk-SAKHOLXS.js} +1 -1
  37. package/chunk-SJWKQCBL.js +1 -0
  38. package/{chunk-LMCAVLBO.js → chunk-SL454JCD.js} +1 -1
  39. package/{chunk-EBQRGLJL.js → chunk-THM235PB.js} +1 -1
  40. package/{chunk-H4TNKM4Y.js → chunk-TYPKT3ZZ.js} +1 -1
  41. package/{chunk-4BAHV6VO.js → chunk-VAXPG4R2.js} +1 -1
  42. package/{chunk-6AJQBDVV.js → chunk-VUOL2M6R.js} +1 -1
  43. package/{chunk-XZ35H3QB.js → chunk-WCU7A255.js} +1 -1
  44. package/{chunk-LFISHZZP.js → chunk-WDMQH4ZC.js} +1 -1
  45. package/{chunk-RXVG6AZW.js → chunk-WRURLVII.js} +1 -1
  46. package/{chunk-2JD6CIZ4.js → chunk-X7WEJAAK.js} +1 -1
  47. package/{chunk-LX37357J.js → chunk-XJXBZISB.js} +1 -1
  48. package/index.html +1 -1
  49. package/main-GZ3TBDRZ.js +1 -0
  50. package/package.json +1 -1
  51. package/chunk-4QGMMHYT.js +0 -1
  52. package/chunk-5QZIKR6A.js +0 -1
  53. package/chunk-AABUGLWU.js +0 -1
  54. package/chunk-VW35MTSI.js +0 -1
  55. package/main-RYFYCW3E.js +0 -1
@@ -1 +1 @@
1
- import{a,b,c}from"./chunk-XADL5RYU.js";import"./chunk-O4OTZE5N.js";import"./chunk-WIVARGP6.js";import"./chunk-MHRECQ5Y.js";import"./chunk-6Q6SSTBK.js";import"./chunk-5DJAX2HH.js";import"./chunk-6ALGXRIS.js";import"./chunk-DW332N2S.js";import"./chunk-AABUGLWU.js";import"./chunk-TELPJYLN.js";import"./chunk-5QZIKR6A.js";import"./chunk-HPNLQHW6.js";import"./chunk-BGTK25UG.js";import"./chunk-A4LPGPDU.js";import"./chunk-PKPBSTZA.js";import"./chunk-QPTSKQZ2.js";import"./chunk-OTPG7USH.js";import"./chunk-TT3S63BX.js";import"./chunk-T2WO6CVD.js";import"./chunk-7CGTOI24.js";export{b as NONE_OPTION,a as createGeneralForm,c as default};
1
+ import{a,b,c}from"./chunk-FPDCZ73R.js";import"./chunk-O4OTZE5N.js";import"./chunk-WIVARGP6.js";import"./chunk-MHRECQ5Y.js";import"./chunk-6Q6SSTBK.js";import"./chunk-5DJAX2HH.js";import"./chunk-IMDBR2SZ.js";import"./chunk-DW332N2S.js";import"./chunk-SJWKQCBL.js";import"./chunk-TELPJYLN.js";import"./chunk-G4SK3PS7.js";import"./chunk-HPNLQHW6.js";import"./chunk-BGTK25UG.js";import"./chunk-A4LPGPDU.js";import"./chunk-PKPBSTZA.js";import"./chunk-QPTSKQZ2.js";import"./chunk-OTPG7USH.js";import"./chunk-TT3S63BX.js";import"./chunk-T2WO6CVD.js";import"./chunk-7CGTOI24.js";export{b as NONE_OPTION,a as createGeneralForm,c as default};
@@ -1 +1 @@
1
- import{a as Q}from"./chunk-LFISHZZP.js";import{a as H}from"./chunk-ME77WZZI.js";import"./chunk-5DJAX2HH.js";import{a as q}from"./chunk-6ALGXRIS.js";import"./chunk-DW332N2S.js";import"./chunk-AABUGLWU.js";import"./chunk-TELPJYLN.js";import"./chunk-5QZIKR6A.js";import{B as X,C as z,H as K,L as j,c as B,e as U,i as G,s as W,u as V,w as J}from"./chunk-HPNLQHW6.js";import"./chunk-BGTK25UG.js";import{d as A,e as I}from"./chunk-A4LPGPDU.js";import"./chunk-PKPBSTZA.js";import"./chunk-QPTSKQZ2.js";import"./chunk-OTPG7USH.js";import"./chunk-TT3S63BX.js";import{$ as m,Ab as l,Bb as T,Bc as $,Ib as f,Mc as O,Pa as a,Pb as S,Qb as P,Rb as p,Rc as v,Ub as D,Vb as h,W as E,Xb as s,aa as F,cb as b,ic as x,jc as d,la as N,na as M,oc as w,pc as L,qc as k,sb as c,tb as _,yb as y,zb as r}from"./chunk-T2WO6CVD.js";import"./chunk-7CGTOI24.js";var Y=(t,n,e,i,o)=>({"loading-state":t,"ready-to-add-link":n,"is-connected":e,"failed-to-connect":i,"is-registered":o});function Z(t,n){t&1&&p(0,0,1)}function ee(t,n){t&1&&p(0,0,2)}function te(t,n){if(t&1){let e=f();r(0,"button",10),h("click",function(){m(e);let o=s(2);return F(o.cancel())}),d(1,"Cancel registration"),l()}}function ne(t,n){if(t&1&&(r(0,"div",7)(1,"p"),S(2,0),c(3,Z,1,0)(4,ee,1,0),P(),l(),T(5,"sh-progress-bar",8),c(6,te,2,0,"button",9),l()),t&2){let e=s();a(3),_(e.state()==="unknown"?3:4),a(3),_((e.registeringCounter()??0)>=5&&e.state()==="registering"?6:-1)}}function ie(t,n){if(t&1){let e=f();r(0,"sh-form-field")(1,"label",11),p(2,1),l(),r(3,"input",12),k("ngModelChange",function(o){m(e);let C=s();return L(C.customRegisterUrl,o)||(C.customRegisterUrl=o),F(o)}),l()(),r(4,"div",13)(5,"button",14),d(6,"Go back"),l(),r(7,"button",15),h("click",function(){m(e);let o=s();return F(o.registerViaCustomUrl())}),p(8,2),l()()}if(t&2){let e=s();a(3),w("ngModel",e.customRegisterUrl),a(4),y("disabled",!e.customRegisterUrlValid())}}function oe(t,n){if(t&1){let e=f();r(0,"p"),p(1,3),l(),T(2,"sh-progress-bar",8),r(3,"button",10),h("click",function(){m(e);let o=s(2);return F(o.retryWhenFaulted())}),d(4,"Cancel"),l()}}function re(t,n){if(t&1){let e=f();r(0,"p"),p(1,4),l(),r(2,"button",10),h("click",function(){m(e);let o=s(2);return F(o.retryWhenFaulted())}),d(3,"Retry"),l()}}function le(t,n){if(t&1&&c(0,oe,5,0)(1,re,4,0),t&2){let e=s();_(e.claimUrl()!==null?0:1)}}function ae(t,n){t&1&&(S(0,5,1),T(1,"p"),P())}function se(t,n){t&1&&(S(0,5,2),T(1,"p"),P())}function ce(t,n){if(t&1){let e=f();r(0,"sh-alert",16),S(1,5),c(2,ae,2,0,"p")(3,se,2,0,"p"),P(),l(),r(4,"button",10),h("click",function(){m(e);let o=s();return F(o.retryWhenFaulted())}),d(5," Retry "),r(6,"sh-icon"),d(7,"arrow-arc-left"),l()()}if(t&2){let e=s();a(2),_(e.typeParam()==="link"?2:3)}}function _e(t,n){t&1&&(r(0,"h3"),d(1,"Successfully connected"),l(),r(2,"p"),d(3,"We're going to redirect you to the home page"),l())}var R=class t{#t=E(A);#i=E(H);#e=E(Q);#n=E(q);isOldOpen=N(!1);typeParam=v.required();state=this.#e.state;claimUrl=this.#e.claimUrl;registerUrl=this.#e.registerUrl;customRegisterUrl=this.#e.customRegisterUrl;additionalReportingUrl=O(()=>{let n=this.#n.serverSettings();return this.#e.state()==="inactive"?"":n&&n["additional-report-url"]||""});copiedReportingUrl=N(!1);customRegisterUrlValid=O(()=>{let n=this.customRegisterUrl(),e=/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/;return!(n.length===0||!e.test(n))});registeringCounter=N(null);didTry=!1;triedFinishConnection=!1;stateEffect=M(()=>{let n=this.#e.registerUrl(),e=this.state(),i=this.typeParam(),o=this.registeringCounter();e==="inactive"&&i==="logon"&&n!==""&&(this.didTry||(this.#e.beginRemoteRegistration(),this.didTry=!0)),e==="registered"&&this.claimUrl()!==null&&(this.triedFinishConnection||(this.triedFinishConnection=!0,this.#o())),e==="registering"?(o===null&&this.registeringCounter.set(0),setTimeout(()=>{this.registeringCounter.set((o??0)+1)},1e3)):this.registeringCounter.set(null),(e==="connected"||e==="disabled"||e==="connecting")&&this.#n.setShownWelcomePage().subscribe(()=>{this.#t.navigate([""])})});ngOnInit(){this.#e.refreshRemoteControlStatus()}#o(){let n=this.#e.claimUrl();this.#i.open(`${n}?closeAfterConnection=true`,"_blank")}registerViaCustomUrl(){this.#e.beginRemoteRegistration(!0)}retryWhenFaulted(){this.#e.cancelRemoteRegistration(),this.customRegisterUrl.set(""),this.didTry=!1,this.triedFinishConnection=!1,this.typeParam()==="logon"&&this.#t.navigate(["/welcome/select"])}cancel(){this.#e.cancelRemoteRegistration()}register(){this.#e.beginRemoteRegistration()}disable(){this.#e.disableRemoteControl()}enable(){this.#e.enableRemoteControl()}delete(){this.#e.deleteRemoteControl()}copyReportingUrl(){let n=this.additionalReportingUrl();n&&(this.copiedReportingUrl.set(!0),setTimeout(()=>this.copiedReportingUrl.set(!1),2e3),navigator.clipboard.writeText(n))}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=b({type:t,selectors:[["app-connect"]],inputs:{typeParam:[1,"typeParam"]},decls:6,vars:13,consts:()=>{let n;n=$localize`${"\uFFFD*3:1\uFFFD"}:START_BLOCK_IF: Loading... ${"\uFFFD/*3:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*4:2\uFFFD"}:START_BLOCK_ELSE: Connecting to console ${"\uFFFD/*4:2\uFFFD"}:CLOSE_BLOCK_ELSE:`;let e;e=$localize`Paste registration URL here`;let i;i=$localize` Connect machine to console `;let o;o=$localize`We're now connecting you to the console`;let C;C=$localize`Something failed during registration we're missing claimUrl, please try again`;let u;return u=$localize` Failed to register ${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_PARAGRAPH: Check if the connection link are correct, alternatively it could be your internet connection or the service might be down ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_PARAGRAPH:${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_PARAGRAPH: There might be a problem with your internet connection or the service might be down, please try again later ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_PARAGRAPH:${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,u=D(u),[n,e,i,o,C,u,[1,"main-card","type-b"],[1,"loader-content"],[1,"primary","indeterminate"],["shButton",""],["shButton","",3,"click"],["for","remoteControlRegisterUrl"],["type","text","id","remoteControlRegisterUrl","name","remoteControlRegisterUrl",3,"ngModelChange","ngModel"],[1,"nav-buttons"],["type","button","shButton","","routerLink","/welcome",1,"raised"],["type","button","shButton","",1,"raised","primary",3,"click","disabled"],[1,"error"]]},template:function(e,i){if(e&1&&(r(0,"sh-card",6),c(1,ne,7,2,"div",7),c(2,ie,9,2),c(3,le,2,1),c(4,ce,8,1),c(5,_e,4,0),l()),e&2){let o=i.state()==="unknown"||i.typeParam()!=="link"&&i.state()==="inactive"||i.state()==="registering",C=i.typeParam()==="link"&&i.state()==="inactive",u=i.state()==="connected"||i.state()==="disabled"||i.state()==="connecting",g=i.state()==="registeringfaulted";x($(7,Y,o,C,u,g,i.state()==="registered")),a(),_(o?1:-1),a(),_(C?2:-1),a(),_(i.state()==="registered"?3:-1),a(),_(g?4:-1),a(),_(u?5:-1)}},dependencies:[I,W,B,U,G,K,X,j,z,J,V],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;min-height:100%;width:100%;flex:1 0;overflow:hidden;padding:2rem}@media only screen and (max-width:768px){[_nghost-%COMP%]{padding:1rem}}.main-card[_ngcontent-%COMP%]{width:100%;height:100%;max-width:31.25rem;max-height:min-content;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:1rem;padding:2rem}.main-card.failed-to-connect[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}.main-card.failed-to-connect[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:100%}.main-card.is-registered[_ngcontent-%COMP%], .main-card.is-connected[_ngcontent-%COMP%]{align-items:center}.loader-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.5rem;width:100%}.loader-content[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{--pb-b: var(--base-3);border:1px solid var(--pb-b)}.field-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%], .field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{flex:1 0}.reporting-url[_ngcontent-%COMP%]{cursor:pointer;-webkit-user-select:none;user-select:none;margin-top:.25rem}.state[_ngcontent-%COMP%]{position:fixed;top:1rem;right:1rem;margin:0;color:var(--base-7);font-size:.75rem}.old[_ngcontent-%COMP%]{display:flex;flex-direction:column;position:relative;gap:.5rem;padding:1rem;border:1px solid var(--base-4);background:var(--base-1);position:fixed;top:0;right:0;bottom:0;width:35rem;transform:translate(100%)}.old.open[_ngcontent-%COMP%]{transform:translate(0)}.old[_ngcontent-%COMP%] .toggle[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:.5rem;cursor:pointer;position:absolute;background-color:var(--base-1);border:1px solid var(--base-4);border-width:.0625rem 0 .0625rem .0625rem;width:2rem;height:2.5rem;border-radius:var(--shape-2) 0 0 var(--shape-2);top:3.75rem;left:-2rem;-webkit-user-select:none;user-select:none}.old[_ngcontent-%COMP%] .toggle[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:1rem}.nav-buttons[_ngcontent-%COMP%]{display:flex;gap:.5rem;flex-direction:row}"],changeDetection:0})};export{R as default};
1
+ import{a as Q}from"./chunk-WDMQH4ZC.js";import{a as H}from"./chunk-ME77WZZI.js";import"./chunk-5DJAX2HH.js";import{a as q}from"./chunk-IMDBR2SZ.js";import"./chunk-DW332N2S.js";import"./chunk-SJWKQCBL.js";import"./chunk-TELPJYLN.js";import"./chunk-G4SK3PS7.js";import{B as X,C as z,H as K,L as j,c as B,e as U,i as G,s as W,u as V,w as J}from"./chunk-HPNLQHW6.js";import"./chunk-BGTK25UG.js";import{d as A,e as I}from"./chunk-A4LPGPDU.js";import"./chunk-PKPBSTZA.js";import"./chunk-QPTSKQZ2.js";import"./chunk-OTPG7USH.js";import"./chunk-TT3S63BX.js";import{$ as m,Ab as l,Bb as T,Bc as $,Ib as f,Mc as O,Pa as a,Pb as S,Qb as P,Rb as p,Rc as v,Ub as D,Vb as h,W as E,Xb as s,aa as F,cb as b,ic as x,jc as d,la as N,na as M,oc as w,pc as L,qc as k,sb as c,tb as _,yb as y,zb as r}from"./chunk-T2WO6CVD.js";import"./chunk-7CGTOI24.js";var Y=(t,n,e,i,o)=>({"loading-state":t,"ready-to-add-link":n,"is-connected":e,"failed-to-connect":i,"is-registered":o});function Z(t,n){t&1&&p(0,0,1)}function ee(t,n){t&1&&p(0,0,2)}function te(t,n){if(t&1){let e=f();r(0,"button",10),h("click",function(){m(e);let o=s(2);return F(o.cancel())}),d(1,"Cancel registration"),l()}}function ne(t,n){if(t&1&&(r(0,"div",7)(1,"p"),S(2,0),c(3,Z,1,0)(4,ee,1,0),P(),l(),T(5,"sh-progress-bar",8),c(6,te,2,0,"button",9),l()),t&2){let e=s();a(3),_(e.state()==="unknown"?3:4),a(3),_((e.registeringCounter()??0)>=5&&e.state()==="registering"?6:-1)}}function ie(t,n){if(t&1){let e=f();r(0,"sh-form-field")(1,"label",11),p(2,1),l(),r(3,"input",12),k("ngModelChange",function(o){m(e);let C=s();return L(C.customRegisterUrl,o)||(C.customRegisterUrl=o),F(o)}),l()(),r(4,"div",13)(5,"button",14),d(6,"Go back"),l(),r(7,"button",15),h("click",function(){m(e);let o=s();return F(o.registerViaCustomUrl())}),p(8,2),l()()}if(t&2){let e=s();a(3),w("ngModel",e.customRegisterUrl),a(4),y("disabled",!e.customRegisterUrlValid())}}function oe(t,n){if(t&1){let e=f();r(0,"p"),p(1,3),l(),T(2,"sh-progress-bar",8),r(3,"button",10),h("click",function(){m(e);let o=s(2);return F(o.retryWhenFaulted())}),d(4,"Cancel"),l()}}function re(t,n){if(t&1){let e=f();r(0,"p"),p(1,4),l(),r(2,"button",10),h("click",function(){m(e);let o=s(2);return F(o.retryWhenFaulted())}),d(3,"Retry"),l()}}function le(t,n){if(t&1&&c(0,oe,5,0)(1,re,4,0),t&2){let e=s();_(e.claimUrl()!==null?0:1)}}function ae(t,n){t&1&&(S(0,5,1),T(1,"p"),P())}function se(t,n){t&1&&(S(0,5,2),T(1,"p"),P())}function ce(t,n){if(t&1){let e=f();r(0,"sh-alert",16),S(1,5),c(2,ae,2,0,"p")(3,se,2,0,"p"),P(),l(),r(4,"button",10),h("click",function(){m(e);let o=s();return F(o.retryWhenFaulted())}),d(5," Retry "),r(6,"sh-icon"),d(7,"arrow-arc-left"),l()()}if(t&2){let e=s();a(2),_(e.typeParam()==="link"?2:3)}}function _e(t,n){t&1&&(r(0,"h3"),d(1,"Successfully connected"),l(),r(2,"p"),d(3,"We're going to redirect you to the home page"),l())}var R=class t{#t=E(A);#i=E(H);#e=E(Q);#n=E(q);isOldOpen=N(!1);typeParam=v.required();state=this.#e.state;claimUrl=this.#e.claimUrl;registerUrl=this.#e.registerUrl;customRegisterUrl=this.#e.customRegisterUrl;additionalReportingUrl=O(()=>{let n=this.#n.serverSettings();return this.#e.state()==="inactive"?"":n&&n["additional-report-url"]||""});copiedReportingUrl=N(!1);customRegisterUrlValid=O(()=>{let n=this.customRegisterUrl(),e=/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/;return!(n.length===0||!e.test(n))});registeringCounter=N(null);didTry=!1;triedFinishConnection=!1;stateEffect=M(()=>{let n=this.#e.registerUrl(),e=this.state(),i=this.typeParam(),o=this.registeringCounter();e==="inactive"&&i==="logon"&&n!==""&&(this.didTry||(this.#e.beginRemoteRegistration(),this.didTry=!0)),e==="registered"&&this.claimUrl()!==null&&(this.triedFinishConnection||(this.triedFinishConnection=!0,this.#o())),e==="registering"?(o===null&&this.registeringCounter.set(0),setTimeout(()=>{this.registeringCounter.set((o??0)+1)},1e3)):this.registeringCounter.set(null),(e==="connected"||e==="disabled"||e==="connecting")&&this.#n.setShownWelcomePage().subscribe(()=>{this.#t.navigate([""])})});ngOnInit(){this.#e.refreshRemoteControlStatus()}#o(){let n=this.#e.claimUrl();this.#i.open(`${n}?closeAfterConnection=true`,"_blank")}registerViaCustomUrl(){this.#e.beginRemoteRegistration(!0)}retryWhenFaulted(){this.#e.cancelRemoteRegistration(),this.customRegisterUrl.set(""),this.didTry=!1,this.triedFinishConnection=!1,this.typeParam()==="logon"&&this.#t.navigate(["/welcome/select"])}cancel(){this.#e.cancelRemoteRegistration()}register(){this.#e.beginRemoteRegistration()}disable(){this.#e.disableRemoteControl()}enable(){this.#e.enableRemoteControl()}delete(){this.#e.deleteRemoteControl()}copyReportingUrl(){let n=this.additionalReportingUrl();n&&(this.copiedReportingUrl.set(!0),setTimeout(()=>this.copiedReportingUrl.set(!1),2e3),navigator.clipboard.writeText(n))}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=b({type:t,selectors:[["app-connect"]],inputs:{typeParam:[1,"typeParam"]},decls:6,vars:13,consts:()=>{let n;n=$localize`${"\uFFFD*3:1\uFFFD"}:START_BLOCK_IF: Loading... ${"\uFFFD/*3:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*4:2\uFFFD"}:START_BLOCK_ELSE: Connecting to console ${"\uFFFD/*4:2\uFFFD"}:CLOSE_BLOCK_ELSE:`;let e;e=$localize`Paste registration URL here`;let i;i=$localize` Connect machine to console `;let o;o=$localize`We're now connecting you to the console`;let C;C=$localize`Something failed during registration we're missing claimUrl, please try again`;let u;return u=$localize` Failed to register ${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_PARAGRAPH: Check if the connection link are correct, alternatively it could be your internet connection or the service might be down ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_PARAGRAPH:${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_PARAGRAPH: There might be a problem with your internet connection or the service might be down, please try again later ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_PARAGRAPH:${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,u=D(u),[n,e,i,o,C,u,[1,"main-card","type-b"],[1,"loader-content"],[1,"primary","indeterminate"],["shButton",""],["shButton","",3,"click"],["for","remoteControlRegisterUrl"],["type","text","id","remoteControlRegisterUrl","name","remoteControlRegisterUrl",3,"ngModelChange","ngModel"],[1,"nav-buttons"],["type","button","shButton","","routerLink","/welcome",1,"raised"],["type","button","shButton","",1,"raised","primary",3,"click","disabled"],[1,"error"]]},template:function(e,i){if(e&1&&(r(0,"sh-card",6),c(1,ne,7,2,"div",7),c(2,ie,9,2),c(3,le,2,1),c(4,ce,8,1),c(5,_e,4,0),l()),e&2){let o=i.state()==="unknown"||i.typeParam()!=="link"&&i.state()==="inactive"||i.state()==="registering",C=i.typeParam()==="link"&&i.state()==="inactive",u=i.state()==="connected"||i.state()==="disabled"||i.state()==="connecting",g=i.state()==="registeringfaulted";x($(7,Y,o,C,u,g,i.state()==="registered")),a(),_(o?1:-1),a(),_(C?2:-1),a(),_(i.state()==="registered"?3:-1),a(),_(g?4:-1),a(),_(u?5:-1)}},dependencies:[I,W,B,U,G,K,X,j,z,J,V],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;min-height:100%;width:100%;flex:1 0;overflow:hidden;padding:2rem}@media only screen and (max-width:768px){[_nghost-%COMP%]{padding:1rem}}.main-card[_ngcontent-%COMP%]{width:100%;height:100%;max-width:31.25rem;max-height:min-content;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:1rem;padding:2rem}.main-card.failed-to-connect[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}.main-card.failed-to-connect[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:100%}.main-card.is-registered[_ngcontent-%COMP%], .main-card.is-connected[_ngcontent-%COMP%]{align-items:center}.loader-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.5rem;width:100%}.loader-content[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{--pb-b: var(--base-3);border:1px solid var(--pb-b)}.field-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%], .field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{flex:1 0}.reporting-url[_ngcontent-%COMP%]{cursor:pointer;-webkit-user-select:none;user-select:none;margin-top:.25rem}.state[_ngcontent-%COMP%]{position:fixed;top:1rem;right:1rem;margin:0;color:var(--base-7);font-size:.75rem}.old[_ngcontent-%COMP%]{display:flex;flex-direction:column;position:relative;gap:.5rem;padding:1rem;border:1px solid var(--base-4);background:var(--base-1);position:fixed;top:0;right:0;bottom:0;width:35rem;transform:translate(100%)}.old.open[_ngcontent-%COMP%]{transform:translate(0)}.old[_ngcontent-%COMP%] .toggle[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:.5rem;cursor:pointer;position:absolute;background-color:var(--base-1);border:1px solid var(--base-4);border-width:.0625rem 0 .0625rem .0625rem;width:2rem;height:2.5rem;border-radius:var(--shape-2) 0 0 var(--shape-2);top:3.75rem;left:-2rem;-webkit-user-select:none;user-select:none}.old[_ngcontent-%COMP%] .toggle[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:1rem}.nav-buttons[_ngcontent-%COMP%]{display:flex;gap:.5rem;flex-direction:row}"],changeDetection:0})};export{R as default};
@@ -1 +1 @@
1
- import{g as he}from"./chunk-4N3AWKEK.js";import{a as Ne,b as pe,c as Ie,d as me,e as De}from"./chunk-5YSRDRTE.js";import"./chunk-4VEFX5WQ.js";import"./chunk-AS6Z56AD.js";import{b as Oe,c as Ce}from"./chunk-IW4RDAIN.js";import{j as Re}from"./chunk-XADL5RYU.js";import"./chunk-O4OTZE5N.js";import"./chunk-WIVARGP6.js";import"./chunk-MHRECQ5Y.js";import"./chunk-6Q6SSTBK.js";import"./chunk-FK7JFD5B.js";import"./chunk-LFISHZZP.js";import"./chunk-ME77WZZI.js";import{a as I}from"./chunk-5DJAX2HH.js";import"./chunk-6ALGXRIS.js";import"./chunk-DW332N2S.js";import"./chunk-AABUGLWU.js";import"./chunk-TELPJYLN.js";import"./chunk-5QZIKR6A.js";import{B as de,H as ue,K as Fe,c as oe,e as ae,f as se,g as re,i as _e,j as le,s as ce,u as Te,w as Ee,y as Se,z as ge}from"./chunk-HPNLQHW6.js";import"./chunk-BGTK25UG.js";import{b as ne,d as ie}from"./chunk-A4LPGPDU.js";import"./chunk-PKPBSTZA.js";import"./chunk-QPTSKQZ2.js";import"./chunk-OTPG7USH.js";import"./chunk-TT3S63BX.js";import{$ as T,Ab as r,Bb as d,Fb as K,Gb as j,Ib as C,Mc as A,Pa as l,Pb as S,Qb as g,Rb as p,Sb as P,Sc as te,Tb as $,Ub as Q,Vb as u,W as R,Xb as _,aa as E,cb as H,cc as q,da as X,dc as Y,jc as L,la as N,oc as h,pc as f,qc as M,rc as y,sb as F,sc as x,tb as O,tc as w,wc as Z,xc as ee,yb as D,zb as s}from"./chunk-T2WO6CVD.js";import"./chunk-7CGTOI24.js";var fe=["formRef"],Me=()=>({maxWidth:"700px",width:"100%"});function Ae(o,n){if(o&1){let e=C();s(0,"button",31),u("click",function(){T(e);let t=_();return E(t.testDestination(0,!0))}),p(1,4),r()}if(o&2){let e=_();D("disabled",e.testSignal()=="testing")}}function Pe(o,n){if(o&1){let e=C();s(0,"button",32),u("click",function(){T(e);let t=_();return E(t.openTargetUrlDialog())}),S(1,5),d(2,"sh-icon"),g(),r()}}function $e(o,n){if(o&1){let e=C();s(0,"button",32),u("click",function(){T(e);let t=_(2);return E(t.copyTargetUrl())}),S(1,7),d(2,"sh-icon"),g(),r()}}function Le(o,n){if(o&1){let e=C();s(0,"sh-menu")(1,"button",20)(2,"sh-icon"),L(3,"dots-three-vertical"),r()(),K(4,33),s(5,"button",32),u("click",function(){T(e);let t=_();return E(t.openTargetUrlDialog())}),S(6,6),d(7,"sh-icon"),g(),r(),F(8,$e,3,0,"button",20),j(),r()}if(o&2){_();let e=w(0);l(8),O(e?8:-1)}}function ye(o,n){o&1&&(s(0,"sh-alert"),S(1,8),d(2,"sh-icon",34),g(),r())}function xe(o,n){o&1&&(s(0,"sh-alert",21),S(1,9),d(2,"sh-icon",34),g(),r())}function we(o,n){if(o&1&&(s(0,"sh-alert",22),S(1,10),d(2,"sh-icon",34),g(),r()),o&2){let e=_();l(2),P(e.testErrorMessage()),$(1)}}function Ge(o,n){if(o&1&&(s(0,"sh-alert",23),S(1,11),d(2,"sh-icon",34),g(),r()),o&2){let e=_();l(2),P(e.testErrorMessage()),$(1)}}function be(o,n){if(o&1){let e=C();s(0,"app-destination-list-item",24)(1,"button",27),u("click",function(){T(e);let t=_();return E(t.removeDestination())}),p(2,12),r()()}if(o&2){_();let e=w(15);D("destination",e)}}function Ue(o,n){if(o&1){let e=C();s(0,"app-destination-list",35),u("setDestination",function(t){T(e);let a=_();return E(a.setDestination(t))}),r()}}function ke(o,n){if(o&1){let e=C();s(0,"app-single-destination",36),M("targetUrlChange",function(t){T(e);let a=_();return f(a.targetUrlModel,t)||(a.targetUrlModel=t),E(t)}),r()}if(o&2){let e=_();h("targetUrl",e.targetUrlModel)}}function ve(o,n){o&1&&(S(0,3,1),d(1,"sh-icon",29),g())}function We(o,n){o&1&&(S(0,3,2),d(1,"sh-icon"),g())}function Ve(o,n){if(o&1){let e=C();s(0,"sh-dialog",37),M("isOpenChange",function(t){T(e);let a=_();return f(a.targetUrlDialogOpen,t)||(a.targetUrlDialogOpen=t),E(t)}),s(1,"header",38)(2,"div",39)(3,"h2"),p(4,13),r(),s(5,"sh-alert",22),p(6,14),r()()(),s(7,"div",40)(8,"sh-form-field")(9,"textarea",41),M("ngModelChange",function(t){T(e);let a=_();return f(a.targetUrlCtrl,t)||(a.targetUrlCtrl=t),E(t)}),r()()(),s(10,"footer",42)(11,"button",27),u("click",function(){T(e);let t=_();return E(t.closeTargetUrlDialog(!1))}),L(12,"Cancel"),r(),s(13,"button",43),u("click",function(){T(e);let t=_();return E(t.closeTargetUrlDialog(!0))}),S(14,15),d(15,"sh-icon"),g(),r()()()}if(o&2){let e=_();h("isOpen",e.targetUrlDialogOpen),D("options",ee(3,Me)),l(9),h("ngModel",e.targetUrlCtrl)}}var G=class o{#i=R(ie);#o=R(ne);#t=R(ge);#a=R(Ne);injector=R(X);#e=R(he);#s=R(Ie);formRef=te.required("formRef");targetUrlModel=this.#e.destinationTargetUrl;targetUrlCtrl=N(null);targetUrlInitial=N(null);targetUrlDialogOpen=N(!1);toggleNewDestination=N(!0);testSignal=this.#e.testSignal;testErrorMessage=this.#e.testErrorMessage;destinationTypeOptionsInFocus=N(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=this.#s.destinationTypeOptions;destinationTypeOptionsFocused=A(()=>{let n=this.destinationTypeOptionsInFocus(),e=this.destinationTypeOptions();return n.map(i=>e.find(t=>t.key===i))});selectedDestinationType=A(()=>{let n=this.#e.destinationTargetUrl();return n?Oe(n):null});selectedDestinationTypeOption=A(()=>{let n=this.selectedDestinationType();return n?{key:n.customKey??n.key,customKey:n.customKey??null,displayName:n.displayName,description:n.description,icon:n.icon}:null});copyTargetUrl(){navigator.clipboard.writeText(this.#e.destinationTargetUrl()??"")}openTargetUrlDialog(){let n=this.#e.destinationTargetUrl();this.targetUrlCtrl.set(n),this.targetUrlInitial.set(n),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(n=!1){this.targetUrlDialogOpen.set(!1);let e=this.targetUrlCtrl(),i=this.targetUrlInitial();!n||e===i||!e||this.#e.updateTargetUrl(e)}testDestination(n,e,i){let t=this.#e.destinationTargetUrl();t&&(this.#e.setTestState("testing"),this.#a.testDestination(t,this.#e.backupId(),n,!0,e).subscribe({next:a=>{if(a.action==="success"){this.#e.setTestState("success"),a.containsBackup===!1?(this.#e.setTestState("warning",$localize`The remote destination does not contain any backups. Please check if the destination details are correct.`),e||this.#t.open(I,{data:{title:$localize`Folder contains no backup`,message:$localize`The remote destination does not contain any backups. Please check if the destination details are correct.`,confirmText:$localize`OK`,cancelText:void 0}})):a.anyFilesFound===!1&&(this.#e.setTestState("warning",$localize`The remote destination is empty. Please check if the destination details are correct.`),e||this.#t.open(I,{data:{title:$localize`Folder is empty`,message:$localize`The remote destination is empty. Please check if the destination details are correct.`,confirmText:$localize`OK`,cancelText:void 0}})),i?.();return}if(this.#e.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){i?.();return}let m=t.includes("?");a.action==="trust-cert"&&this.#e.updateTargetUrl(t+`${m?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#e.updateTargetUrl(t+`${m?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,e):i?.()}}))}setDestination(n){let e=Ce(n??"");if(e){if(e.mapper.default){let i=e.mapper.default("");this.#e.updateTargetUrl(i);return}this.#e.updateTargetUrl(`${n}://`)}}removeDestination(){this.#e.updateTargetUrl(null)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let n=this.testSignal();if(n===""){this.#t.open(I,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:e=>{e?this.testDestination(0,!1,()=>{this.testSignal()==="success"?this.#n():this.#t.open(I,{data:{title:$localize`Test did not succeed`,message:this.testErrorMessage()??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#n()}});return}if(n!=="success"){this.#t.open(I,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Yes, continue`,cancelText:$localize`Cancel`},closed:e=>{e&&this.#n()}});return}this.#n()}#n(){this.#i.navigate(["encryption"],{relativeTo:this.#o.parent})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=H({type:o,selectors:[["app-restore-destination"]],viewQuery:function(e,i){e&1&&q(i.formRef,fe,5),e&2&&Y()},features:[Z([Re])],decls:28,vars:11,consts:()=>{let n;n=$localize`Backup destination`;let e;e=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let i;i=$localize`${"\uFFFD*25:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*25:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*26:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*26:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,i=Q(i);let t;t=$localize` Test destination `;let a;a=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Set target URL `;let m;m=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: Edit target URL `;let b;b=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:copy${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Copy URL to clipboard `;let U;U=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Testing connection... `;let k;k=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:check${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Connection tested successfully. `;let v;v=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let W;W=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let V;V=$localize`Change`;let B;B=$localize`Edit target URL`;let z;z=$localize`Be careful, this will overwrite everything you have in your destination.`;let J;return J=$localize` Override target URL ${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],n,e,i,t,a,m,b,U,k,v,W,V,B,z,J,[3,"submit"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small",3,"disabled"],["shButton","","type","button",1,"small"],[1,"success"],[1,"warn"],[1,"error"],[1,"current-destination",3,"destination"],[3,"targetUrl"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click","disabled"],["shButton","","type","button",1,"small",3,"click"],["menu",""],["icon",""],[3,"setDestination"],[3,"targetUrlChange","targetUrl"],[3,"isOpenChange","isOpen","options"],["header",""],[1,"target-dialog-header"],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(e,i){if(e&1){let t=C();y(0),s(1,"form",16,0),u("submit",function(){return T(t),E(i.next())}),s(3,"header")(4,"h3",17)(5,"span"),p(6,1),r(),s(7,"div",18),F(8,Ae,2,1,"button",19),F(9,Pe,3,0,"button",20)(10,Le,9,1,"sh-menu"),r()(),F(11,ye,3,0,"sh-alert")(12,xe,3,0,"sh-alert",21)(13,we,3,1,"sh-alert",22)(14,Ge,3,1,"sh-alert",23),y(15),F(16,be,3,1,"app-destination-list-item",24),r(),F(17,Ue,1,0,"app-destination-list"),F(18,ke,1,1,"app-single-destination",25),s(19,"div",26)(20,"button",27),u("click",function(){return T(t),E(i.goBack())}),S(21,2),d(22,"sh-icon"),g(),r(),s(23,"button",28),S(24,3),F(25,ve,2,0,"sh-icon",29)(26,We,2,0,"sh-icon"),g(),r()()(),F(27,Ve,16,4,"sh-dialog",30)}if(e&2){let t=x(!!i.targetUrlModel());l(8),O(t?8:-1),l(),O(t?10:9),l(2),O(i.testSignal()=="testing"?11:i.testSignal()=="success"?12:i.testSignal()=="warning"?13:i.testSignal()=="error"?14:-1),l(4);let a=x(i.selectedDestinationTypeOption());l(),O(a?16:-1),l(),O(t?-1:17),l(),O(t?18:-1),l(5),D("disabled",i.testSignal()=="testing"||!t),l(2),O(i.testSignal()=="testing"?25:26),l(2),O(i.targetUrlDialogOpen()?27:-1)}},dependencies:[De,me,pe,ce,le,oe,ae,se,_e,re,de,ue,Fe,Te,Se,Ee],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}pre[_ngcontent-%COMP%]{white-space:pre-wrap}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.field-row.single-field[_ngcontent-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-8)}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-8)}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}.target-dialog-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:.5rem}"],changeDetection:0})};export{G as default};
1
+ import{g as he}from"./chunk-QQ2F3BER.js";import{a as Ne,b as pe,c as Ie,d as me,e as De}from"./chunk-7E34ZROH.js";import"./chunk-4VEFX5WQ.js";import"./chunk-AS6Z56AD.js";import{b as Oe,c as Ce}from"./chunk-IW4RDAIN.js";import{j as Re}from"./chunk-FPDCZ73R.js";import"./chunk-O4OTZE5N.js";import"./chunk-WIVARGP6.js";import"./chunk-MHRECQ5Y.js";import"./chunk-6Q6SSTBK.js";import"./chunk-FK7JFD5B.js";import"./chunk-WDMQH4ZC.js";import"./chunk-ME77WZZI.js";import{a as I}from"./chunk-5DJAX2HH.js";import"./chunk-IMDBR2SZ.js";import"./chunk-DW332N2S.js";import"./chunk-SJWKQCBL.js";import"./chunk-TELPJYLN.js";import"./chunk-G4SK3PS7.js";import{B as de,H as ue,K as Fe,c as oe,e as ae,f as se,g as re,i as _e,j as le,s as ce,u as Te,w as Ee,y as Se,z as ge}from"./chunk-HPNLQHW6.js";import"./chunk-BGTK25UG.js";import{b as ne,d as ie}from"./chunk-A4LPGPDU.js";import"./chunk-PKPBSTZA.js";import"./chunk-QPTSKQZ2.js";import"./chunk-OTPG7USH.js";import"./chunk-TT3S63BX.js";import{$ as T,Ab as r,Bb as d,Fb as K,Gb as j,Ib as C,Mc as A,Pa as l,Pb as S,Qb as g,Rb as p,Sb as P,Sc as te,Tb as $,Ub as Q,Vb as u,W as R,Xb as _,aa as E,cb as H,cc as q,da as X,dc as Y,jc as L,la as N,oc as h,pc as f,qc as M,rc as y,sb as F,sc as x,tb as O,tc as w,wc as Z,xc as ee,yb as D,zb as s}from"./chunk-T2WO6CVD.js";import"./chunk-7CGTOI24.js";var fe=["formRef"],Me=()=>({maxWidth:"700px",width:"100%"});function Ae(o,n){if(o&1){let e=C();s(0,"button",31),u("click",function(){T(e);let t=_();return E(t.testDestination(0,!0))}),p(1,4),r()}if(o&2){let e=_();D("disabled",e.testSignal()=="testing")}}function Pe(o,n){if(o&1){let e=C();s(0,"button",32),u("click",function(){T(e);let t=_();return E(t.openTargetUrlDialog())}),S(1,5),d(2,"sh-icon"),g(),r()}}function $e(o,n){if(o&1){let e=C();s(0,"button",32),u("click",function(){T(e);let t=_(2);return E(t.copyTargetUrl())}),S(1,7),d(2,"sh-icon"),g(),r()}}function Le(o,n){if(o&1){let e=C();s(0,"sh-menu")(1,"button",20)(2,"sh-icon"),L(3,"dots-three-vertical"),r()(),K(4,33),s(5,"button",32),u("click",function(){T(e);let t=_();return E(t.openTargetUrlDialog())}),S(6,6),d(7,"sh-icon"),g(),r(),F(8,$e,3,0,"button",20),j(),r()}if(o&2){_();let e=w(0);l(8),O(e?8:-1)}}function ye(o,n){o&1&&(s(0,"sh-alert"),S(1,8),d(2,"sh-icon",34),g(),r())}function xe(o,n){o&1&&(s(0,"sh-alert",21),S(1,9),d(2,"sh-icon",34),g(),r())}function we(o,n){if(o&1&&(s(0,"sh-alert",22),S(1,10),d(2,"sh-icon",34),g(),r()),o&2){let e=_();l(2),P(e.testErrorMessage()),$(1)}}function Ge(o,n){if(o&1&&(s(0,"sh-alert",23),S(1,11),d(2,"sh-icon",34),g(),r()),o&2){let e=_();l(2),P(e.testErrorMessage()),$(1)}}function be(o,n){if(o&1){let e=C();s(0,"app-destination-list-item",24)(1,"button",27),u("click",function(){T(e);let t=_();return E(t.removeDestination())}),p(2,12),r()()}if(o&2){_();let e=w(15);D("destination",e)}}function Ue(o,n){if(o&1){let e=C();s(0,"app-destination-list",35),u("setDestination",function(t){T(e);let a=_();return E(a.setDestination(t))}),r()}}function ke(o,n){if(o&1){let e=C();s(0,"app-single-destination",36),M("targetUrlChange",function(t){T(e);let a=_();return f(a.targetUrlModel,t)||(a.targetUrlModel=t),E(t)}),r()}if(o&2){let e=_();h("targetUrl",e.targetUrlModel)}}function ve(o,n){o&1&&(S(0,3,1),d(1,"sh-icon",29),g())}function We(o,n){o&1&&(S(0,3,2),d(1,"sh-icon"),g())}function Ve(o,n){if(o&1){let e=C();s(0,"sh-dialog",37),M("isOpenChange",function(t){T(e);let a=_();return f(a.targetUrlDialogOpen,t)||(a.targetUrlDialogOpen=t),E(t)}),s(1,"header",38)(2,"div",39)(3,"h2"),p(4,13),r(),s(5,"sh-alert",22),p(6,14),r()()(),s(7,"div",40)(8,"sh-form-field")(9,"textarea",41),M("ngModelChange",function(t){T(e);let a=_();return f(a.targetUrlCtrl,t)||(a.targetUrlCtrl=t),E(t)}),r()()(),s(10,"footer",42)(11,"button",27),u("click",function(){T(e);let t=_();return E(t.closeTargetUrlDialog(!1))}),L(12,"Cancel"),r(),s(13,"button",43),u("click",function(){T(e);let t=_();return E(t.closeTargetUrlDialog(!0))}),S(14,15),d(15,"sh-icon"),g(),r()()()}if(o&2){let e=_();h("isOpen",e.targetUrlDialogOpen),D("options",ee(3,Me)),l(9),h("ngModel",e.targetUrlCtrl)}}var G=class o{#i=R(ie);#o=R(ne);#t=R(ge);#a=R(Ne);injector=R(X);#e=R(he);#s=R(Ie);formRef=te.required("formRef");targetUrlModel=this.#e.destinationTargetUrl;targetUrlCtrl=N(null);targetUrlInitial=N(null);targetUrlDialogOpen=N(!1);toggleNewDestination=N(!0);testSignal=this.#e.testSignal;testErrorMessage=this.#e.testErrorMessage;destinationTypeOptionsInFocus=N(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=this.#s.destinationTypeOptions;destinationTypeOptionsFocused=A(()=>{let n=this.destinationTypeOptionsInFocus(),e=this.destinationTypeOptions();return n.map(i=>e.find(t=>t.key===i))});selectedDestinationType=A(()=>{let n=this.#e.destinationTargetUrl();return n?Oe(n):null});selectedDestinationTypeOption=A(()=>{let n=this.selectedDestinationType();return n?{key:n.customKey??n.key,customKey:n.customKey??null,displayName:n.displayName,description:n.description,icon:n.icon}:null});copyTargetUrl(){navigator.clipboard.writeText(this.#e.destinationTargetUrl()??"")}openTargetUrlDialog(){let n=this.#e.destinationTargetUrl();this.targetUrlCtrl.set(n),this.targetUrlInitial.set(n),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(n=!1){this.targetUrlDialogOpen.set(!1);let e=this.targetUrlCtrl(),i=this.targetUrlInitial();!n||e===i||!e||this.#e.updateTargetUrl(e)}testDestination(n,e,i){let t=this.#e.destinationTargetUrl();t&&(this.#e.setTestState("testing"),this.#a.testDestination(t,this.#e.backupId(),n,!0,e).subscribe({next:a=>{if(a.action==="success"){this.#e.setTestState("success"),a.containsBackup===!1?(this.#e.setTestState("warning",$localize`The remote destination does not contain any backups. Please check if the destination details are correct.`),e||this.#t.open(I,{data:{title:$localize`Folder contains no backup`,message:$localize`The remote destination does not contain any backups. Please check if the destination details are correct.`,confirmText:$localize`OK`,cancelText:void 0}})):a.anyFilesFound===!1&&(this.#e.setTestState("warning",$localize`The remote destination is empty. Please check if the destination details are correct.`),e||this.#t.open(I,{data:{title:$localize`Folder is empty`,message:$localize`The remote destination is empty. Please check if the destination details are correct.`,confirmText:$localize`OK`,cancelText:void 0}})),i?.();return}if(this.#e.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){i?.();return}let m=t.includes("?");a.action==="trust-cert"&&this.#e.updateTargetUrl(t+`${m?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#e.updateTargetUrl(t+`${m?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,e):i?.()}}))}setDestination(n){let e=Ce(n??"");if(e){if(e.mapper.default){let i=e.mapper.default("");this.#e.updateTargetUrl(i);return}this.#e.updateTargetUrl(`${n}://`)}}removeDestination(){this.#e.updateTargetUrl(null)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let n=this.testSignal();if(n===""){this.#t.open(I,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:e=>{e?this.testDestination(0,!1,()=>{this.testSignal()==="success"?this.#n():this.#t.open(I,{data:{title:$localize`Test did not succeed`,message:this.testErrorMessage()??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#n()}});return}if(n!=="success"){this.#t.open(I,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Yes, continue`,cancelText:$localize`Cancel`},closed:e=>{e&&this.#n()}});return}this.#n()}#n(){this.#i.navigate(["encryption"],{relativeTo:this.#o.parent})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=H({type:o,selectors:[["app-restore-destination"]],viewQuery:function(e,i){e&1&&q(i.formRef,fe,5),e&2&&Y()},features:[Z([Re])],decls:28,vars:11,consts:()=>{let n;n=$localize`Backup destination`;let e;e=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let i;i=$localize`${"\uFFFD*25:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*25:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*26:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*26:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,i=Q(i);let t;t=$localize` Test destination `;let a;a=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Set target URL `;let m;m=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: Edit target URL `;let b;b=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:copy${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Copy URL to clipboard `;let U;U=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Testing connection... `;let k;k=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:check${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Connection tested successfully. `;let v;v=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let W;W=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let V;V=$localize`Change`;let B;B=$localize`Edit target URL`;let z;z=$localize`Be careful, this will overwrite everything you have in your destination.`;let J;return J=$localize` Override target URL ${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],n,e,i,t,a,m,b,U,k,v,W,V,B,z,J,[3,"submit"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small",3,"disabled"],["shButton","","type","button",1,"small"],[1,"success"],[1,"warn"],[1,"error"],[1,"current-destination",3,"destination"],[3,"targetUrl"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click","disabled"],["shButton","","type","button",1,"small",3,"click"],["menu",""],["icon",""],[3,"setDestination"],[3,"targetUrlChange","targetUrl"],[3,"isOpenChange","isOpen","options"],["header",""],[1,"target-dialog-header"],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(e,i){if(e&1){let t=C();y(0),s(1,"form",16,0),u("submit",function(){return T(t),E(i.next())}),s(3,"header")(4,"h3",17)(5,"span"),p(6,1),r(),s(7,"div",18),F(8,Ae,2,1,"button",19),F(9,Pe,3,0,"button",20)(10,Le,9,1,"sh-menu"),r()(),F(11,ye,3,0,"sh-alert")(12,xe,3,0,"sh-alert",21)(13,we,3,1,"sh-alert",22)(14,Ge,3,1,"sh-alert",23),y(15),F(16,be,3,1,"app-destination-list-item",24),r(),F(17,Ue,1,0,"app-destination-list"),F(18,ke,1,1,"app-single-destination",25),s(19,"div",26)(20,"button",27),u("click",function(){return T(t),E(i.goBack())}),S(21,2),d(22,"sh-icon"),g(),r(),s(23,"button",28),S(24,3),F(25,ve,2,0,"sh-icon",29)(26,We,2,0,"sh-icon"),g(),r()()(),F(27,Ve,16,4,"sh-dialog",30)}if(e&2){let t=x(!!i.targetUrlModel());l(8),O(t?8:-1),l(),O(t?10:9),l(2),O(i.testSignal()=="testing"?11:i.testSignal()=="success"?12:i.testSignal()=="warning"?13:i.testSignal()=="error"?14:-1),l(4);let a=x(i.selectedDestinationTypeOption());l(),O(a?16:-1),l(),O(t?-1:17),l(),O(t?18:-1),l(5),D("disabled",i.testSignal()=="testing"||!t),l(2),O(i.testSignal()=="testing"?25:26),l(2),O(i.targetUrlDialogOpen()?27:-1)}},dependencies:[De,me,pe,ce,le,oe,ae,se,_e,re,de,ue,Fe,Te,Se,Ee],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}pre[_ngcontent-%COMP%]{white-space:pre-wrap}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.field-row.single-field[_ngcontent-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-8)}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-8)}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}.target-dialog-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:.5rem}"],changeDetection:0})};export{G as default};
@@ -1 +1 @@
1
- import{a as B}from"./chunk-4NN5ZM73.js";import{a as R}from"./chunk-FK7JFD5B.js";import{a as $}from"./chunk-5DJAX2HH.js";import{b as z}from"./chunk-AABUGLWU.js";import{a as b}from"./chunk-TELPJYLN.js";import{z as S}from"./chunk-HPNLQHW6.js";import{c as P}from"./chunk-BGTK25UG.js";import{E as u,K as k,Mc as c,R as m,W as s,l as d,la as n,na as f,p as h}from"./chunk-T2WO6CVD.js";import{a,b as r}from"./chunk-7CGTOI24.js";var F={Starting_Operation:$localize`Starting operation …`,Backup_Begin:$localize`Starting backup …`,Backup_PreBackupVerify:$localize`Verifying backend data …`,Backup_PostBackupTest:$localize`Verifying remote data …`,Backup_PreviousBackupFinalize:$localize`Completing previous backup …`,Backup_ProcessingFiles:$localize`Processing files to backup …`,Backup_Finalize:$localize`Completing backup …`,Backup_WaitForUpload:$localize`Waiting for upload to finish …`,Backup_Delete:$localize`Deleting unwanted files …`,Backup_Compact:$localize`Compacting remote data …`,Backup_VerificationUpload:$localize`Uploading verification file …`,Backup_PostBackupVerify:$localize`Verifying backend data …`,Backup_Complete:$localize`Backup complete!`,Restore_Begin:$localize`Starting restore …`,Restore_RecreateDatabase:$localize`Rebuilding local database …`,Restore_PreRestoreVerify:$localize`Verifying remote data …`,Restore_CreateFileList:$localize`Building list of files to restore …`,Restore_CreateTargetFolders:$localize`Creating target folders …`,Restore_ScanForExistingFiles:$localize`Scanning existing files …`,Restore_ScanForLocalBlocks:$localize`Scanning for local blocks …`,Restore_PatchWithLocalBlocks:$localize`Patching files with local blocks …`,Restore_DownloadingRemoteFiles:$localize`Downloading files …`,Restore_PostRestoreVerify:$localize`Verifying restored files …`,Restore_Complete:$localize`Restore complete!`,Recreate_Running:$localize`Recreating database …`,Vacuum_Running:$localize`Vacuuming database …`,Repair_Running:$localize`Repairing database …`,Verify_Running:$localize`Verifying files …`,BugReport_Running:$localize`Creating bug report …`,Delete_Listing:$localize`Listing remote files …`,Delete_Deleting:$localize`Deleting remote files …`,PurgeFiles_Begin:$localize`Listing remote files for purge …`,PurgeFiles_Process:$localize`Purging files …`,PurgeFiles_Compact:$localize`Compacting remote data …`,PurgeFiles_Complete:$localize`Purging files complete!`,Error:$localize`Error!`},_=class g{#i=s(R);#t=s(P);#o=s(B);#e=s(z);#c=s(S);#g=s(b);#s=n(!1);#a=n(null);statusData=this.#a.asReadonly();lastState=null;serverState=c(()=>{let e=this.#e.serverState();return e?(e.ProposedSchedule=e.ProposedSchedule?.map(i=>r(a({},i),{backup:i.Item1?this.#o.getBackupById(i.Item1):null}))??null,this.lastState=e,e):this.lastState});hasProgressOnWebsocket=c(()=>this.#g.hasProgressSubscribeOption()&&this.#e.getConnectionMethod()==="websocket");clientIsRunning=c(()=>this.serverState()?.ProgramState==="Running");isResuming=n(!1);isFetching=this.#s.asReadonly();connectionStatus=this.#e.connectionStatus;pollingInterval;#f=f(()=>{let e=this.#e.serverState();e?.ActiveTask||this.#o.getBackups(!0),this.hasProgressOnWebsocket()&&(this.#e.subscribe("progress"),this.#e.subscribe("taskqueue")),e?.ActiveTask&&this.pollingInterval===void 0?this.startPollingProgress():e?.ActiveTask||this.stopPollingProgress()});#d=f(()=>{let e=this.#e.progressState(),i=this.#e.taskQueueState();if(e){let t=i?.find(o=>o.ID===e.TaskID)??null;this.#l(r(a({},e),{task:t}))}});setConnectionMethod(e){this.#e.setConnectionMethod(e)}startPollingProgress(){this.hasProgressOnWebsocket()?this.#e.subscribe("progress"):this.pollingInterval=setInterval(()=>{this.#r()},1e3)}stopPollingProgress(){clearInterval(this.pollingInterval)}fetchProgressState(){this.#r()}pauseResume(){return this.isResuming.set(!0),this.#t.postApiV1ServerstateResume().pipe(u(()=>this.isResuming.set(!1)))}resumeDialogCheck(e){if(!this.clientIsRunning()){this.#c.open($,{data:{title:$localize`Server paused`,message:$localize`Server is currently paused. Do you want to resume now?`,confirmText:$localize`Resume`,cancelText:$localize`No, I'll resume later`},closed:i=>{i&&this.pauseResume().subscribe({next:()=>{e()}})}});return}e()}#r(){this.#s.set(!0),this.#t.getApiV1Progressstate().pipe(k(e=>{let i=e.TaskID??null;return i===null?d(e):this.#t.getApiV1TaskByTaskid({taskid:i}).pipe(h(t=>r(a({},e),{task:t??null})))}),u(()=>this.#s.set(!1))).subscribe({next:e=>{this.#l(e),this.serverState()?.ActiveTask==null&&this.stopPollingProgress()},error:e=>{e.status===404&&this.stopPollingProgress()}})}#l(e){let i=e.TaskID??null,t=e.BackupID??null;i!==null&&t!==null&&(e.backup=this.#o.getBackupById(t)),this.#a.set(r(a({},e),{progress:this.#p(e),statusText:this.#u(e),actionText:e.backup?.Backup?.Name??$localize`Running task`}))}#p(e){let i=-1;if(e.task&&e)if(e.Phase==="Backup_ProcessingFiles"||e.Phase==="Restore_DownloadingRemoteFiles")if(e.StillCounting)i=0;else{let t=e.CurrentFilecomplete?0:e.CurrentFileoffset,o=e.TotalFileCount-e.ProcessedFileCount,l=e.TotalFileSize-e.ProcessedFileSize-t;i=(e.ProcessedFileSize+t)/e.TotalFileSize,e.ProcessedFileCount===0?i=0:i>=.9&&(i=.9)}else e.Phase==="Backup_Finalize"||e.Phase==="Backup_WaitForUpload"?i=.9:e.Phase==="Backup_Delete"||e.Phase==="Backup_Compact"?i=.95:e.Phase==="Backup_VerificationUpload"||e.Phase==="Backup_PostBackupVerify"?i=.98:e.Phase==="Backup_Complete"?i=1:e.OverallProgress>0&&(i=e.OverallProgress);return i}#n(e){let i=(e.ActiveTransfers??[]).map(o=>o.BackendSpeed).reduce((o,l)=>(o??0)+(l??0),0)??-1,t=i<=0?e.BackendSpeed:i;return(t??-1)<0?"":` at ${this.#i.transform(t)}/s`}#u(e){let i="Running \u2026";if(e.task&&e){if(i=e.Phase?F[e.Phase]:"Running \u2026",e.TotalFileCount===0)return i;if(e.Phase==="Backup_ProcessingFiles"||e.Phase==="Restore_DownloadingRemoteFiles")if(e.StillCounting)i=`Counting (${e.TotalFileCount} files found, ${this.#i.transform(e.TotalFileSize)})`;else{let t=e.CurrentFilecomplete?0:e.CurrentFileoffset,o=e.TotalFileCount-e.ProcessedFileCount,l=e.TotalFileSize-e.ProcessedFileSize-t,v=e.Phase==="Restore_DownloadingRemoteFiles"?"Restoring: ":"",p=this.#n(e);e.Phase==="Backup_ProcessingFiles"&&o===0?i=`Completing upload ${p}`:e.BackendIsBlocking??!1?i=`Waiting for transfers ${p}`:i=`${v}${o} files (${this.#i.transform(l)}) to go ${p}`}else if(e.Phase==="Backup_WaitForUpload"){let t=this.#n(e);t!==""&&(i=`Waiting for upload to finish ${t}`)}}return i}static \u0275fac=function(i){return new(i||g)};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};export{_ as a};
1
+ import{a as B}from"./chunk-SAKHOLXS.js";import{a as R}from"./chunk-FK7JFD5B.js";import{a as $}from"./chunk-5DJAX2HH.js";import{b as z}from"./chunk-SJWKQCBL.js";import{a as b}from"./chunk-TELPJYLN.js";import{z as S}from"./chunk-HPNLQHW6.js";import{c as P}from"./chunk-BGTK25UG.js";import{E as u,K as k,Mc as c,R as m,W as s,l as d,la as n,na as f,p as h}from"./chunk-T2WO6CVD.js";import{a,b as r}from"./chunk-7CGTOI24.js";var F={Starting_Operation:$localize`Starting operation …`,Backup_Begin:$localize`Starting backup …`,Backup_PreBackupVerify:$localize`Verifying backend data …`,Backup_PostBackupTest:$localize`Verifying remote data …`,Backup_PreviousBackupFinalize:$localize`Completing previous backup …`,Backup_ProcessingFiles:$localize`Processing files to backup …`,Backup_Finalize:$localize`Completing backup …`,Backup_WaitForUpload:$localize`Waiting for upload to finish …`,Backup_Delete:$localize`Deleting unwanted files …`,Backup_Compact:$localize`Compacting remote data …`,Backup_VerificationUpload:$localize`Uploading verification file …`,Backup_PostBackupVerify:$localize`Verifying backend data …`,Backup_Complete:$localize`Backup complete!`,Restore_Begin:$localize`Starting restore …`,Restore_RecreateDatabase:$localize`Rebuilding local database …`,Restore_PreRestoreVerify:$localize`Verifying remote data …`,Restore_CreateFileList:$localize`Building list of files to restore …`,Restore_CreateTargetFolders:$localize`Creating target folders …`,Restore_ScanForExistingFiles:$localize`Scanning existing files …`,Restore_ScanForLocalBlocks:$localize`Scanning for local blocks …`,Restore_PatchWithLocalBlocks:$localize`Patching files with local blocks …`,Restore_DownloadingRemoteFiles:$localize`Downloading files …`,Restore_PostRestoreVerify:$localize`Verifying restored files …`,Restore_Complete:$localize`Restore complete!`,Recreate_Running:$localize`Recreating database …`,Vacuum_Running:$localize`Vacuuming database …`,Repair_Running:$localize`Repairing database …`,Verify_Running:$localize`Verifying files …`,BugReport_Running:$localize`Creating bug report …`,Delete_Listing:$localize`Listing remote files …`,Delete_Deleting:$localize`Deleting remote files …`,PurgeFiles_Begin:$localize`Listing remote files for purge …`,PurgeFiles_Process:$localize`Purging files …`,PurgeFiles_Compact:$localize`Compacting remote data …`,PurgeFiles_Complete:$localize`Purging files complete!`,Error:$localize`Error!`},_=class g{#i=s(R);#t=s(P);#o=s(B);#e=s(z);#c=s(S);#g=s(b);#s=n(!1);#a=n(null);statusData=this.#a.asReadonly();lastState=null;serverState=c(()=>{let e=this.#e.serverState();return e?(e.ProposedSchedule=e.ProposedSchedule?.map(i=>r(a({},i),{backup:i.Item1?this.#o.getBackupById(i.Item1):null}))??null,this.lastState=e,e):this.lastState});hasProgressOnWebsocket=c(()=>this.#g.hasProgressSubscribeOption()&&this.#e.getConnectionMethod()==="websocket");clientIsRunning=c(()=>this.serverState()?.ProgramState==="Running");isResuming=n(!1);isFetching=this.#s.asReadonly();connectionStatus=this.#e.connectionStatus;pollingInterval;#f=f(()=>{let e=this.#e.serverState();e?.ActiveTask||this.#o.getBackups(!0),this.hasProgressOnWebsocket()&&(this.#e.subscribe("progress"),this.#e.subscribe("taskqueue")),e?.ActiveTask&&this.pollingInterval===void 0?this.startPollingProgress():e?.ActiveTask||this.stopPollingProgress()});#d=f(()=>{let e=this.#e.progressState(),i=this.#e.taskQueueState();if(e){let t=i?.find(o=>o.ID===e.TaskID)??null;this.#l(r(a({},e),{task:t}))}});setConnectionMethod(e){this.#e.setConnectionMethod(e)}startPollingProgress(){this.hasProgressOnWebsocket()?this.#e.subscribe("progress"):this.pollingInterval=setInterval(()=>{this.#r()},1e3)}stopPollingProgress(){clearInterval(this.pollingInterval)}fetchProgressState(){this.#r()}pauseResume(){return this.isResuming.set(!0),this.#t.postApiV1ServerstateResume().pipe(u(()=>this.isResuming.set(!1)))}resumeDialogCheck(e){if(!this.clientIsRunning()){this.#c.open($,{data:{title:$localize`Server paused`,message:$localize`Server is currently paused. Do you want to resume now?`,confirmText:$localize`Resume`,cancelText:$localize`No, I'll resume later`},closed:i=>{i&&this.pauseResume().subscribe({next:()=>{e()}})}});return}e()}#r(){this.#s.set(!0),this.#t.getApiV1Progressstate().pipe(k(e=>{let i=e.TaskID??null;return i===null?d(e):this.#t.getApiV1TaskByTaskid({taskid:i}).pipe(h(t=>r(a({},e),{task:t??null})))}),u(()=>this.#s.set(!1))).subscribe({next:e=>{this.#l(e),this.serverState()?.ActiveTask==null&&this.stopPollingProgress()},error:e=>{e.status===404&&this.stopPollingProgress()}})}#l(e){let i=e.TaskID??null,t=e.BackupID??null;i!==null&&t!==null&&(e.backup=this.#o.getBackupById(t)),this.#a.set(r(a({},e),{progress:this.#p(e),statusText:this.#u(e),actionText:e.backup?.Backup?.Name??$localize`Running task`}))}#p(e){let i=-1;if(e.task&&e)if(e.Phase==="Backup_ProcessingFiles"||e.Phase==="Restore_DownloadingRemoteFiles")if(e.StillCounting)i=0;else{let t=e.CurrentFilecomplete?0:e.CurrentFileoffset,o=e.TotalFileCount-e.ProcessedFileCount,l=e.TotalFileSize-e.ProcessedFileSize-t;i=(e.ProcessedFileSize+t)/e.TotalFileSize,e.ProcessedFileCount===0?i=0:i>=.9&&(i=.9)}else e.Phase==="Backup_Finalize"||e.Phase==="Backup_WaitForUpload"?i=.9:e.Phase==="Backup_Delete"||e.Phase==="Backup_Compact"?i=.95:e.Phase==="Backup_VerificationUpload"||e.Phase==="Backup_PostBackupVerify"?i=.98:e.Phase==="Backup_Complete"?i=1:e.OverallProgress>0&&(i=e.OverallProgress);return i}#n(e){let i=(e.ActiveTransfers??[]).map(o=>o.BackendSpeed).reduce((o,l)=>(o??0)+(l??0),0)??-1,t=i<=0?e.BackendSpeed:i;return(t??-1)<0?"":` at ${this.#i.transform(t)}/s`}#u(e){let i="Running \u2026";if(e.task&&e){if(i=e.Phase?F[e.Phase]:"Running \u2026",e.TotalFileCount===0)return i;if(e.Phase==="Backup_ProcessingFiles"||e.Phase==="Restore_DownloadingRemoteFiles")if(e.StillCounting)i=`Counting (${e.TotalFileCount} files found, ${this.#i.transform(e.TotalFileSize)})`;else{let t=e.CurrentFilecomplete?0:e.CurrentFileoffset,o=e.TotalFileCount-e.ProcessedFileCount,l=e.TotalFileSize-e.ProcessedFileSize-t,v=e.Phase==="Restore_DownloadingRemoteFiles"?"Restoring: ":"",p=this.#n(e);e.Phase==="Backup_ProcessingFiles"&&o===0?i=`Completing upload ${p}`:e.BackendIsBlocking??!1?i=`Waiting for transfers ${p}`:i=`${v}${o} files (${this.#i.transform(l)}) to go ${p}`}else if(e.Phase==="Backup_WaitForUpload"){let t=this.#n(e);t!==""&&(i=`Waiting for upload to finish ${t}`)}}return i}static \u0275fac=function(i){return new(i||g)};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};export{_ as a};
@@ -1 +1 @@
1
- import{a as W}from"./chunk-YV32N6PE.js";import"./chunk-PAMKTLG5.js";import"./chunk-FOQJA6X2.js";import"./chunk-VHOAXFIJ.js";import{a as j}from"./chunk-4NN5ZM73.js";import"./chunk-6Q6SSTBK.js";import"./chunk-FK7JFD5B.js";import"./chunk-LFISHZZP.js";import"./chunk-ME77WZZI.js";import"./chunk-5DJAX2HH.js";import"./chunk-QZRRXR3V.js";import"./chunk-6ALGXRIS.js";import"./chunk-DW332N2S.js";import"./chunk-AABUGLWU.js";import"./chunk-TELPJYLN.js";import"./chunk-5QZIKR6A.js";import{B as m,C as N,G as w,L as z,u as O}from"./chunk-HPNLQHW6.js";import{c as H}from"./chunk-BGTK25UG.js";import{e as g}from"./chunk-A4LPGPDU.js";import"./chunk-PKPBSTZA.js";import"./chunk-QPTSKQZ2.js";import"./chunk-OTPG7USH.js";import"./chunk-TT3S63BX.js";import{Ab as o,Bb as r,Pa as s,Pb as E,Qb as S,Rb as a,Sb as v,Tb as B,W as T,Xb as u,cb as A,ib as D,jc as p,mc as J,pb as G,qb as k,sb as R,tb as d,ub as y,wb as b,xb as x,xc as C,yb as l,yc as X,zb as n}from"./chunk-T2WO6CVD.js";import"./chunk-7CGTOI24.js";var q=()=>[N,m,O,g],V=()=>["/restore-from-files"],K=()=>["/restore/from-config"],Q=t=>["/restore",t];function U(t,i){if(t&1&&(n(0,"sh-card",10),r(1,"img",15),n(2,"div",12)(3,"h3"),a(4,7),o(),n(5,"p"),p(6),o()(),n(7,"button",13),E(8,8),r(9,"sh-icon"),S(),o()()),t&2){let e=i.$implicit;l("routerLink",X(4,Q,e.Backup.ID)),s(4),v(e.Backup.Name??"Backup name missing"),B(4),s(2),J(" ",(e.Backup.Metadata==null?null:e.Backup.Metadata.SourceSizeString)??"-"," / ",(e.Backup.Metadata==null?null:e.Backup.Metadata.BackupListCount)??"-"," ")}}function Y(t,i){if(t&1&&b(0,U,10,6,"sh-card",10,y),t&2){let e=u(2);x(e.backups())}}function Z(t,i){if(t&1&&R(0,Y,2,0),t&2){let e=u();d(e.backups().length?0:-1)}}function ee(t,i){t&1&&(n(0,"div",16),r(1,"sh-progress-bar",17),n(2,"div",12)(3,"h3"),a(4,9),o()()())}function te(t,i){t&1&&(n(0,"sh-divider"),p(1,"Or without a local configuration"),o())}var P=class t{#e=T(j);#t=T(H);backups=this.#e.backups;backupsLoading=this.#e.backupsLoading;ngOnInit(){this.#e.getBackups(!0)}restoreNow(i){this.#t.postApiV1BackupByIdRestore({id:i.Backup?.ID,requestBody:{}})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=A({type:t,selectors:[["app-restore"]],decls:29,vars:6,consts:()=>{let i;i=$localize`Where do you want to restore from?`;let e;e=$localize`Direct restore from backup files`;let c;c=$localize`Point to your backup files and restore from there.`;let f;f=$localize` Start ${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:play-circle${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON:`;let F;F=$localize`Restore from configuration`;let M;M=$localize`Load destination from an exported job`;let h;h=$localize` Start ${"\uFFFD#28\uFFFD"}:START_TAG_SH_ICON:play-circle${"\uFFFD/#28\uFFFD"}:CLOSE_TAG_SH_ICON:`;let I;I=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let $;$=$localize` Restore ${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON:`;let L;return L=$localize`Loading backups...`,[i,e,c,f,F,M,h,I,$,L,[1,"type-a","actionable",3,"routerLink"],["src","assets/images/backup.png","alt","","width","48px"],[1,"text"],["shButton",""],["src","assets/images/restore.png","alt","","width","48px"],["src","assets/images/folder.png","alt","","width","48px"],[1,"loading-list"],[1,"indeterminate","primary"]]},template:function(e,c){e&1&&(r(0,"app-status-bar"),n(1,"section")(2,"h2"),a(3,0),o(),D(4,Z,1,1)(5,ee,5,0),G(6,4,q,null,5),R(8,te,2,0,"sh-divider"),n(9,"sh-card",10),r(10,"img",11),n(11,"div",12)(12,"h3"),a(13,1),o(),n(14,"p"),a(15,2),o()(),n(16,"button",13),E(17,3),r(18,"sh-icon"),S(),o()(),n(19,"sh-card",10),r(20,"img",14),n(21,"div",12)(22,"h3"),a(23,4),o(),n(24,"p"),a(25,5),o()(),n(26,"button",13),E(27,6),r(28,"sh-icon"),S(),o()()()),e&2&&(s(6),k(!c.backupsLoading()),s(2),d(c.backups().length?8:-1),s(),l("routerLink",C(4,V)),s(10),l("routerLink",C(5,K)))},dependencies:[W,N,m,w,O,z,g],styles:["[_nghost-%COMP%]{display:block}h2[_ngcontent-%COMP%]{font:var(--title-30);text-align:center;padding:2rem}section[_ngcontent-%COMP%]{max-width:43.75rem;margin:0 auto;padding:2rem 1rem;display:flex;flex-direction:column;gap:1rem}sh-divider[_ngcontent-%COMP%]{color:var(--base-8)}sh-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;--card-padding: 2rem}sh-card[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:.25rem}.actionable[_ngcontent-%COMP%]{cursor:pointer}.actionable[_ngcontent-%COMP%]:after{transition:inset .1s linear}.actionable[_ngcontent-%COMP%]:hover{--card-shp: 0}"],changeDetection:0})};export{P as default};
1
+ import{a as W}from"./chunk-DUVQ5DQX.js";import"./chunk-4VCGLPSI.js";import"./chunk-FOQJA6X2.js";import"./chunk-VHOAXFIJ.js";import{a as j}from"./chunk-SAKHOLXS.js";import"./chunk-6Q6SSTBK.js";import"./chunk-FK7JFD5B.js";import"./chunk-WDMQH4ZC.js";import"./chunk-ME77WZZI.js";import"./chunk-5DJAX2HH.js";import"./chunk-OG6NP7IP.js";import"./chunk-IMDBR2SZ.js";import"./chunk-DW332N2S.js";import"./chunk-SJWKQCBL.js";import"./chunk-TELPJYLN.js";import"./chunk-G4SK3PS7.js";import{B as m,C as N,G as w,L as z,u as O}from"./chunk-HPNLQHW6.js";import{c as H}from"./chunk-BGTK25UG.js";import{e as g}from"./chunk-A4LPGPDU.js";import"./chunk-PKPBSTZA.js";import"./chunk-QPTSKQZ2.js";import"./chunk-OTPG7USH.js";import"./chunk-TT3S63BX.js";import{Ab as o,Bb as r,Pa as s,Pb as E,Qb as S,Rb as a,Sb as v,Tb as B,W as T,Xb as u,cb as A,ib as D,jc as p,mc as J,pb as G,qb as k,sb as R,tb as d,ub as y,wb as b,xb as x,xc as C,yb as l,yc as X,zb as n}from"./chunk-T2WO6CVD.js";import"./chunk-7CGTOI24.js";var q=()=>[N,m,O,g],V=()=>["/restore-from-files"],K=()=>["/restore/from-config"],Q=t=>["/restore",t];function U(t,i){if(t&1&&(n(0,"sh-card",10),r(1,"img",15),n(2,"div",12)(3,"h3"),a(4,7),o(),n(5,"p"),p(6),o()(),n(7,"button",13),E(8,8),r(9,"sh-icon"),S(),o()()),t&2){let e=i.$implicit;l("routerLink",X(4,Q,e.Backup.ID)),s(4),v(e.Backup.Name??"Backup name missing"),B(4),s(2),J(" ",(e.Backup.Metadata==null?null:e.Backup.Metadata.SourceSizeString)??"-"," / ",(e.Backup.Metadata==null?null:e.Backup.Metadata.BackupListCount)??"-"," ")}}function Y(t,i){if(t&1&&b(0,U,10,6,"sh-card",10,y),t&2){let e=u(2);x(e.backups())}}function Z(t,i){if(t&1&&R(0,Y,2,0),t&2){let e=u();d(e.backups().length?0:-1)}}function ee(t,i){t&1&&(n(0,"div",16),r(1,"sh-progress-bar",17),n(2,"div",12)(3,"h3"),a(4,9),o()()())}function te(t,i){t&1&&(n(0,"sh-divider"),p(1,"Or without a local configuration"),o())}var P=class t{#e=T(j);#t=T(H);backups=this.#e.backups;backupsLoading=this.#e.backupsLoading;ngOnInit(){this.#e.getBackups(!0)}restoreNow(i){this.#t.postApiV1BackupByIdRestore({id:i.Backup?.ID,requestBody:{}})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=A({type:t,selectors:[["app-restore"]],decls:29,vars:6,consts:()=>{let i;i=$localize`Where do you want to restore from?`;let e;e=$localize`Direct restore from backup files`;let c;c=$localize`Point to your backup files and restore from there.`;let f;f=$localize` Start ${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:play-circle${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON:`;let F;F=$localize`Restore from configuration`;let M;M=$localize`Load destination from an exported job`;let h;h=$localize` Start ${"\uFFFD#28\uFFFD"}:START_TAG_SH_ICON:play-circle${"\uFFFD/#28\uFFFD"}:CLOSE_TAG_SH_ICON:`;let I;I=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let $;$=$localize` Restore ${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON:`;let L;return L=$localize`Loading backups...`,[i,e,c,f,F,M,h,I,$,L,[1,"type-a","actionable",3,"routerLink"],["src","assets/images/backup.png","alt","","width","48px"],[1,"text"],["shButton",""],["src","assets/images/restore.png","alt","","width","48px"],["src","assets/images/folder.png","alt","","width","48px"],[1,"loading-list"],[1,"indeterminate","primary"]]},template:function(e,c){e&1&&(r(0,"app-status-bar"),n(1,"section")(2,"h2"),a(3,0),o(),D(4,Z,1,1)(5,ee,5,0),G(6,4,q,null,5),R(8,te,2,0,"sh-divider"),n(9,"sh-card",10),r(10,"img",11),n(11,"div",12)(12,"h3"),a(13,1),o(),n(14,"p"),a(15,2),o()(),n(16,"button",13),E(17,3),r(18,"sh-icon"),S(),o()(),n(19,"sh-card",10),r(20,"img",14),n(21,"div",12)(22,"h3"),a(23,4),o(),n(24,"p"),a(25,5),o()(),n(26,"button",13),E(27,6),r(28,"sh-icon"),S(),o()()()),e&2&&(s(6),k(!c.backupsLoading()),s(2),d(c.backups().length?8:-1),s(),l("routerLink",C(4,V)),s(10),l("routerLink",C(5,K)))},dependencies:[W,N,m,w,O,z,g],styles:["[_nghost-%COMP%]{display:block}h2[_ngcontent-%COMP%]{font:var(--title-30);text-align:center;padding:2rem}section[_ngcontent-%COMP%]{max-width:43.75rem;margin:0 auto;padding:2rem 1rem;display:flex;flex-direction:column;gap:1rem}sh-divider[_ngcontent-%COMP%]{color:var(--base-8)}sh-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;--card-padding: 2rem}sh-card[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:.25rem}.actionable[_ngcontent-%COMP%]{cursor:pointer}.actionable[_ngcontent-%COMP%]:after{transition:inset .1s linear}.actionable[_ngcontent-%COMP%]:hover{--card-shp: 0}"],changeDetection:0})};export{P as default};
@@ -1,4 +1,4 @@
1
- import{a as Gt}from"./chunk-AS6Z56AD.js";import{a as yt,b as Re,c as Ot,d as Ft,e as At,f as wt,h as Mt,i as Lt,j as Pt}from"./chunk-IW4RDAIN.js";import{j as $t}from"./chunk-XADL5RYU.js";import{c as vt,d as Vt}from"./chunk-WIVARGP6.js";import{a as Dt}from"./chunk-LFISHZZP.js";import{a as U}from"./chunk-5DJAX2HH.js";import{a as xt}from"./chunk-6ALGXRIS.js";import{a as Et,b as It}from"./chunk-DW332N2S.js";import{a as ue}from"./chunk-TELPJYLN.js";import{B as Ce,C as pt,E as mt,H as Pe,K as Ct,L as ut,O as gt,P as Tt,V as ft,W as St,Y as Nt,a as st,c as se,e as de,i as ce,k as dt,s as pe,t as ct,u as me,z as Le}from"./chunk-HPNLQHW6.js";import{c as ht}from"./chunk-BGTK25UG.js";import{e as _t}from"./chunk-A4LPGPDU.js";import{_ as rt}from"./chunk-OTPG7USH.js";import{$ as f,Ab as d,Ac as Me,Bb as R,D as He,E as $e,Fb as xe,Gb as fe,Gc as oe,Hb as P,Ib as E,K as je,M as qe,Ma as Qe,Mc as $,Pa as r,Pb as H,Qb as j,Qc as ot,R as Ie,Rb as _e,Rc as ae,Sc as at,Ub as Ye,Uc as lt,Vb as h,W as w,Xb as l,Yb as De,Zb as ye,aa as S,cb as Z,cc as Ze,da as We,dc as et,ec as y,f as Ee,fc as tt,gc as Oe,hb as x,jc as m,kc as nt,l as Je,la as k,lc as A,mc as Se,na as Te,oc as Fe,p as Xe,pc as Ae,qc as we,rc as X,sb as u,sc as M,tb as g,tc as p,ub as te,uc as Ge,wb as ne,wc as it,xb as ie,xc as be,yb as c,yc as v,zb as s,zc as B}from"./chunk-T2WO6CVD.js";import{a as z,b as he}from"./chunk-7CGTOI24.js";var bt=class n{#e=w(ht);#t=w(Le);#n=w(ue);testDestination(t,e,o,i,a){return this.#n.hasV2TestOperations()?this.testDestinationv2(t,e,o,i,a):this.testDestinationv1(t,e,o,i,a)}testDestinationv2(t,e,o,i,a){return new Ee(_=>{this.#e.postApiV2DestinationTest({requestBody:{DestinationUrl:t,BackupId:e=="new"?null:e,AutoCreate:!1,Options:null}}).subscribe({next:C=>{if(C.Success){this.emitSuccessV2(_,t,o,C);return}this.handleGenericError(_,t,o,C.Error??"Unknown error",a)},error:C=>{let N=C?.error?.body??C?.error?.requestBody;if(N?.Data?.FolderExists===!1||N?.StatusCode==="missing-folder"){i?this.handleMissingFolder(_,t,o):this.handleGenericError(_,t,o,$localize`The remote destination folder does not exist.`,a);return}if(N?.Data?.HostCertificate){this.handleMissingCertificate(_,t,o,N.Data?.HostCertificate);return}if(N?.Data?.ReportedHostKey){this.handleIncorrectKey(_,t,o,N.Data.ReportedHostKey,N.Data.AcceptedHostKey??null);return}this.handleGenericError(_,t,o,C?.message??"Unknown error",a)}})})}testDestinationv1(t,e,o,i,a){return new Ee(_=>{this.#e.postApiV1RemoteoperationTest({requestBody:{path:t,backupId:e=="new"?null:e}}).subscribe({next:C=>{_.next({action:"success",targetUrl:t,testAgain:!1,destinationIndex:o}),_.complete()},error:C=>{this.handleDestinationErrorv1(C.message,t,o,i,a).subscribe(N=>{_.next(N)})}})})}handleMissingFolder(t,e,o){this.#t.open(U,{data:{title:$localize`Create folder`,message:$localize`The remote destination folder does not exist, do you want to create it?`,confirmText:$localize`Create folder`,cancelText:$localize`Cancel`},closed:i=>{if(!i){this.reportNoAction(t,e,o,$localize`The remote folder does not exist.`);return}this.#n.hasV2TestOperations()?this.#e.postApiV2DestinationTest({requestBody:{DestinationUrl:e,AutoCreate:!0,Options:null}}).subscribe({next:a=>{if(a.Success){this.emitSuccessV2(t,e,o,a);return}else this.handleFolderCreateFailure(t,e,o,a.Error??$localize`Unknown error`)},error:a=>{this.handleFolderCreateFailure(t,e,o,a.message??$localize`Unknown error`)}}):this.#e.postApiV1RemoteoperationCreate({requestBody:{path:e}}).subscribe({next:()=>{this.handleFolderCreated(t,e,o)},error:a=>{this.handleFolderCreateFailure(t,e,o,a.message??$localize`Unknown error`)}})}})}handleFolderCreateFailure(t,e,o,i){this.#t.open(U,{data:{title:$localize`Error creating folder`,message:$localize`The remote destination folder could not be created. ${i}`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:o}),t.complete()}})}emitSuccessV2(t,e,o,i){t.next({action:"success",targetUrl:e,testAgain:!1,destinationIndex:o,anyFilesFound:!i.Data?.FolderIsEmpty,containsBackup:i.Data?.FolderContainsBackupFiles??void 0,containsEncryptedBackupFiles:i.Data?.FolderContainsEncryptedBackupFiles??void 0}),t.complete()}handleFolderCreated(t,e,o){this.#t.open(U,{data:{title:$localize`Folder created`,message:$localize`The remote destination folder was created successfully.`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"test-again",targetUrl:e,testAgain:!0,destinationIndex:o}),t.complete()}})}reportNoAction(t,e,o,i){t.next({action:"generic-error",targetUrl:e,errorMessage:i,testAgain:!1,destinationIndex:o}),t.complete()}handleMissingCertificate(t,e,o,i){this.#t.open(U,{maxWidth:"500px",data:{title:$localize`Trust the certificate`,message:$localize`The server is using a certificate that is not trusted.
1
+ import{a as Gt}from"./chunk-AS6Z56AD.js";import{a as yt,b as Re,c as Ot,d as Ft,e as At,f as wt,h as Mt,i as Lt,j as Pt}from"./chunk-IW4RDAIN.js";import{j as $t}from"./chunk-FPDCZ73R.js";import{c as vt,d as Vt}from"./chunk-WIVARGP6.js";import{a as Dt}from"./chunk-WDMQH4ZC.js";import{a as U}from"./chunk-5DJAX2HH.js";import{a as xt}from"./chunk-IMDBR2SZ.js";import{a as Et,b as It}from"./chunk-DW332N2S.js";import{a as ue}from"./chunk-TELPJYLN.js";import{B as Ce,C as pt,E as mt,H as Pe,K as Ct,L as ut,O as gt,P as Tt,V as ft,W as St,Y as Nt,a as st,c as se,e as de,i as ce,k as dt,s as pe,t as ct,u as me,z as Le}from"./chunk-HPNLQHW6.js";import{c as ht}from"./chunk-BGTK25UG.js";import{e as _t}from"./chunk-A4LPGPDU.js";import{_ as rt}from"./chunk-OTPG7USH.js";import{$ as f,Ab as d,Ac as Me,Bb as R,D as He,E as $e,Fb as xe,Gb as fe,Gc as oe,Hb as P,Ib as E,K as je,M as qe,Ma as Qe,Mc as $,Pa as r,Pb as H,Qb as j,Qc as ot,R as Ie,Rb as _e,Rc as ae,Sc as at,Ub as Ye,Uc as lt,Vb as h,W as w,Xb as l,Yb as De,Zb as ye,aa as S,cb as Z,cc as Ze,da as We,dc as et,ec as y,f as Ee,fc as tt,gc as Oe,hb as x,jc as m,kc as nt,l as Je,la as k,lc as A,mc as Se,na as Te,oc as Fe,p as Xe,pc as Ae,qc as we,rc as X,sb as u,sc as M,tb as g,tc as p,ub as te,uc as Ge,wb as ne,wc as it,xb as ie,xc as be,yb as c,yc as v,zb as s,zc as B}from"./chunk-T2WO6CVD.js";import{a as z,b as he}from"./chunk-7CGTOI24.js";var bt=class n{#e=w(ht);#t=w(Le);#n=w(ue);testDestination(t,e,o,i,a){return this.#n.hasV2TestOperations()?this.testDestinationv2(t,e,o,i,a):this.testDestinationv1(t,e,o,i,a)}testDestinationv2(t,e,o,i,a){return new Ee(_=>{this.#e.postApiV2DestinationTest({requestBody:{DestinationUrl:t,BackupId:e=="new"?null:e,AutoCreate:!1,Options:null}}).subscribe({next:C=>{if(C.Success){this.emitSuccessV2(_,t,o,C);return}this.handleGenericError(_,t,o,C.Error??"Unknown error",a)},error:C=>{let N=C?.error?.body??C?.error?.requestBody;if(N?.Data?.FolderExists===!1||N?.StatusCode==="missing-folder"){i?this.handleMissingFolder(_,t,o):this.handleGenericError(_,t,o,$localize`The remote destination folder does not exist.`,a);return}if(N?.Data?.HostCertificate){this.handleMissingCertificate(_,t,o,N.Data?.HostCertificate);return}if(N?.Data?.ReportedHostKey){this.handleIncorrectKey(_,t,o,N.Data.ReportedHostKey,N.Data.AcceptedHostKey??null);return}this.handleGenericError(_,t,o,C?.message??"Unknown error",a)}})})}testDestinationv1(t,e,o,i,a){return new Ee(_=>{this.#e.postApiV1RemoteoperationTest({requestBody:{path:t,backupId:e=="new"?null:e}}).subscribe({next:C=>{_.next({action:"success",targetUrl:t,testAgain:!1,destinationIndex:o}),_.complete()},error:C=>{this.handleDestinationErrorv1(C.message,t,o,i,a).subscribe(N=>{_.next(N)})}})})}handleMissingFolder(t,e,o){this.#t.open(U,{data:{title:$localize`Create folder`,message:$localize`The remote destination folder does not exist, do you want to create it?`,confirmText:$localize`Create folder`,cancelText:$localize`Cancel`},closed:i=>{if(!i){this.reportNoAction(t,e,o,$localize`The remote folder does not exist.`);return}this.#n.hasV2TestOperations()?this.#e.postApiV2DestinationTest({requestBody:{DestinationUrl:e,AutoCreate:!0,Options:null}}).subscribe({next:a=>{if(a.Success){this.emitSuccessV2(t,e,o,a);return}else this.handleFolderCreateFailure(t,e,o,a.Error??$localize`Unknown error`)},error:a=>{this.handleFolderCreateFailure(t,e,o,a.message??$localize`Unknown error`)}}):this.#e.postApiV1RemoteoperationCreate({requestBody:{path:e}}).subscribe({next:()=>{this.handleFolderCreated(t,e,o)},error:a=>{this.handleFolderCreateFailure(t,e,o,a.message??$localize`Unknown error`)}})}})}handleFolderCreateFailure(t,e,o,i){this.#t.open(U,{data:{title:$localize`Error creating folder`,message:$localize`The remote destination folder could not be created. ${i}`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:o}),t.complete()}})}emitSuccessV2(t,e,o,i){t.next({action:"success",targetUrl:e,testAgain:!1,destinationIndex:o,anyFilesFound:!i.Data?.FolderIsEmpty,containsBackup:i.Data?.FolderContainsBackupFiles??void 0,containsEncryptedBackupFiles:i.Data?.FolderContainsEncryptedBackupFiles??void 0}),t.complete()}handleFolderCreated(t,e,o){this.#t.open(U,{data:{title:$localize`Folder created`,message:$localize`The remote destination folder was created successfully.`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"test-again",targetUrl:e,testAgain:!0,destinationIndex:o}),t.complete()}})}reportNoAction(t,e,o,i){t.next({action:"generic-error",targetUrl:e,errorMessage:i,testAgain:!1,destinationIndex:o}),t.complete()}handleMissingCertificate(t,e,o,i){this.#t.open(U,{maxWidth:"500px",data:{title:$localize`Trust the certificate`,message:$localize`The server is using a certificate that is not trusted.
2
2
  If this is a self-signed certificate, you can choose to trust this certificate.
3
3
  The server reported the certificate hash: ${i}`,confirmText:$localize`Trust the certificate`,cancelText:$localize`Cancel`},closed:a=>{if(!a){this.reportNoAction(t,e,o,$localize`The server certificate is not trusted.`);return}t.next({action:"trust-cert",targetUrl:e,testAgain:!0,certData:i,destinationIndex:o}),t.complete()}})}handleIncorrectKey(t,e,o,i,a){a?this.#t.open(U,{maxWidth:"500px",data:{title:$localize`The host key has changed`,message:$localize`The host key has changed, please check with the server administrator if this is correct,
4
4
  otherwise you could be the victim of a MAN-IN-THE-MIDDLE attack.
@@ -1 +1 @@
1
- import{g as C}from"./chunk-4N3AWKEK.js";import"./chunk-4VEFX5WQ.js";import"./chunk-AS6Z56AD.js";import"./chunk-IW4RDAIN.js";import{a as k}from"./chunk-YV32N6PE.js";import{j as w}from"./chunk-XADL5RYU.js";import"./chunk-O4OTZE5N.js";import"./chunk-WIVARGP6.js";import"./chunk-MHRECQ5Y.js";import"./chunk-PAMKTLG5.js";import"./chunk-FOQJA6X2.js";import"./chunk-VHOAXFIJ.js";import"./chunk-4NN5ZM73.js";import"./chunk-6Q6SSTBK.js";import"./chunk-FK7JFD5B.js";import"./chunk-LFISHZZP.js";import"./chunk-ME77WZZI.js";import"./chunk-5DJAX2HH.js";import"./chunk-QZRRXR3V.js";import"./chunk-6ALGXRIS.js";import{b as u}from"./chunk-DW332N2S.js";import"./chunk-AABUGLWU.js";import"./chunk-TELPJYLN.js";import"./chunk-5QZIKR6A.js";import{M as W,R as y}from"./chunk-HPNLQHW6.js";import"./chunk-BGTK25UG.js";import{a as A,b as $,c as M,d as I,e as G,f as v}from"./chunk-A4LPGPDU.js";import"./chunk-PKPBSTZA.js";import"./chunk-QPTSKQZ2.js";import"./chunk-OTPG7USH.js";import"./chunk-TT3S63BX.js";import{Ab as n,Bb as s,Pa as r,Pb as F,Qb as l,W as c,Xb as O,cb as D,gc as L,la as f,na as P,sb as E,tb as g,wc as N,xc as R,yb as _,yc as p,zb as o}from"./chunk-T2WO6CVD.js";import"./chunk-7CGTOI24.js";var b=()=>["/restore-from-files/destination"],x=()=>["/restore-from-files/encryption"],H=()=>["/restore-from-files/select-files"],J=()=>["/restore-from-files/options"],X=t=>["/restore",t,"select-files"],z=t=>["/restore",t,"options"];function B(t,i){t&1&&(o(0,"div",7),F(1,0),s(2,"sh-radio"),l(),n(),o(3,"div",7),F(4,1),s(5,"sh-radio"),l(),n(),o(6,"div",8),F(7,2),s(8,"sh-radio"),l(),n(),o(9,"div",8),F(10,3),s(11,"sh-radio"),l(),n()),t&2&&(_("routerLink",R(4,b)),r(3),_("routerLink",R(5,x)),r(3),_("routerLink",R(6,H)),r(3),_("routerLink",R(7,J)))}function U(t,i){if(t&1&&(o(0,"div",7),F(1,4),s(2,"sh-radio"),l(),n(),o(3,"div",7),F(4,5),s(5,"sh-radio"),l(),n()),t&2){let e=O(2);_("routerLink",p(2,X,e.backupId())),r(3),_("routerLink",p(4,z,e.backupId()))}}function j(t,i){if(t&1&&(o(0,"sh-stepper",6),E(1,B,12,8)(2,U,6,6),n()),t&2){let e=O();r(),g(e.isFileRestore()?1:2)}}var h=class t{#e=c($);#i=c(I);#t=c(C);#o=u(this.#e.params);#n=u(this.#e.url);#s=u(this.#e.children[0].url);backupId=this.#t.backupId;isFileRestore=this.#t.isFileRestore;isProgressPage=f(!1);paramsChanged=P(()=>{let i=this.#s(),e=this.#o()?.id,a=!!this.#n()?.find(S=>S.path==="restore-from-files"),T=!!i?.find(S=>S.path==="progress");this.isProgressPage.set(T),this.#t.init(e,a)});ngOnInit(){this.#i.events.subscribe(i=>{if(i instanceof A){let e=i.urlAfterRedirects;this.isProgressPage.set(e.includes("progress"))}})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=D({type:t,selectors:[["app-restore-flow"]],hostVars:2,hostBindings:function(e,a){e&2&&L("full-width",a.isProgressPage())},features:[N([C,w])],decls:4,vars:1,consts:()=>{let i;i=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_RADIO: Destination `;let e;e=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_RADIO: Encryption `;let a;a=$localize`${"\uFFFD#8\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_SH_RADIO: Select files `;let T;T=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `;let S;S=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_RADIO: Select files `;let m;return m=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `,[i,e,a,T,S,m,[1,"primary"],["step","","routerLinkActive","active",3,"routerLink"],["step","","routerLinkActive","active",1,"inactive",3,"routerLink"]]},template:function(e,a){e&1&&(s(0,"app-status-bar"),E(1,j,3,1,"sh-stepper",6),o(2,"section"),s(3,"router-outlet"),n()),e&2&&(r(),g(a.isProgressPage()?-1:1))},dependencies:[y,W,k,M,G,v],styles:["[_nghost-%COMP%]{display:block}.full-width[_nghost-%COMP%] section[_ngcontent-%COMP%]{max-width:62.5rem}sh-stepper[_ngcontent-%COMP%]{max-width:31.25rem;margin:2.5rem auto}section[_ngcontent-%COMP%]{max-width:31.25rem;margin:0 auto 2.5rem}.inactive[_ngcontent-%COMP%]{pointer-events:none;opacity:.5}"],changeDetection:0})};export{h as default};
1
+ import{g as C}from"./chunk-QQ2F3BER.js";import"./chunk-4VEFX5WQ.js";import"./chunk-AS6Z56AD.js";import"./chunk-IW4RDAIN.js";import{a as k}from"./chunk-DUVQ5DQX.js";import{j as w}from"./chunk-FPDCZ73R.js";import"./chunk-O4OTZE5N.js";import"./chunk-WIVARGP6.js";import"./chunk-MHRECQ5Y.js";import"./chunk-4VCGLPSI.js";import"./chunk-FOQJA6X2.js";import"./chunk-VHOAXFIJ.js";import"./chunk-SAKHOLXS.js";import"./chunk-6Q6SSTBK.js";import"./chunk-FK7JFD5B.js";import"./chunk-WDMQH4ZC.js";import"./chunk-ME77WZZI.js";import"./chunk-5DJAX2HH.js";import"./chunk-OG6NP7IP.js";import"./chunk-IMDBR2SZ.js";import{b as u}from"./chunk-DW332N2S.js";import"./chunk-SJWKQCBL.js";import"./chunk-TELPJYLN.js";import"./chunk-G4SK3PS7.js";import{M as W,R as y}from"./chunk-HPNLQHW6.js";import"./chunk-BGTK25UG.js";import{a as A,b as $,c as M,d as I,e as G,f as v}from"./chunk-A4LPGPDU.js";import"./chunk-PKPBSTZA.js";import"./chunk-QPTSKQZ2.js";import"./chunk-OTPG7USH.js";import"./chunk-TT3S63BX.js";import{Ab as n,Bb as s,Pa as r,Pb as F,Qb as l,W as c,Xb as O,cb as D,gc as L,la as f,na as P,sb as E,tb as g,wc as N,xc as R,yb as _,yc as p,zb as o}from"./chunk-T2WO6CVD.js";import"./chunk-7CGTOI24.js";var b=()=>["/restore-from-files/destination"],x=()=>["/restore-from-files/encryption"],H=()=>["/restore-from-files/select-files"],J=()=>["/restore-from-files/options"],X=t=>["/restore",t,"select-files"],z=t=>["/restore",t,"options"];function B(t,i){t&1&&(o(0,"div",7),F(1,0),s(2,"sh-radio"),l(),n(),o(3,"div",7),F(4,1),s(5,"sh-radio"),l(),n(),o(6,"div",8),F(7,2),s(8,"sh-radio"),l(),n(),o(9,"div",8),F(10,3),s(11,"sh-radio"),l(),n()),t&2&&(_("routerLink",R(4,b)),r(3),_("routerLink",R(5,x)),r(3),_("routerLink",R(6,H)),r(3),_("routerLink",R(7,J)))}function U(t,i){if(t&1&&(o(0,"div",7),F(1,4),s(2,"sh-radio"),l(),n(),o(3,"div",7),F(4,5),s(5,"sh-radio"),l(),n()),t&2){let e=O(2);_("routerLink",p(2,X,e.backupId())),r(3),_("routerLink",p(4,z,e.backupId()))}}function j(t,i){if(t&1&&(o(0,"sh-stepper",6),E(1,B,12,8)(2,U,6,6),n()),t&2){let e=O();r(),g(e.isFileRestore()?1:2)}}var h=class t{#e=c($);#i=c(I);#t=c(C);#o=u(this.#e.params);#n=u(this.#e.url);#s=u(this.#e.children[0].url);backupId=this.#t.backupId;isFileRestore=this.#t.isFileRestore;isProgressPage=f(!1);paramsChanged=P(()=>{let i=this.#s(),e=this.#o()?.id,a=!!this.#n()?.find(S=>S.path==="restore-from-files"),T=!!i?.find(S=>S.path==="progress");this.isProgressPage.set(T),this.#t.init(e,a)});ngOnInit(){this.#i.events.subscribe(i=>{if(i instanceof A){let e=i.urlAfterRedirects;this.isProgressPage.set(e.includes("progress"))}})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=D({type:t,selectors:[["app-restore-flow"]],hostVars:2,hostBindings:function(e,a){e&2&&L("full-width",a.isProgressPage())},features:[N([C,w])],decls:4,vars:1,consts:()=>{let i;i=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_RADIO: Destination `;let e;e=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_RADIO: Encryption `;let a;a=$localize`${"\uFFFD#8\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_SH_RADIO: Select files `;let T;T=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `;let S;S=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_RADIO: Select files `;let m;return m=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `,[i,e,a,T,S,m,[1,"primary"],["step","","routerLinkActive","active",3,"routerLink"],["step","","routerLinkActive","active",1,"inactive",3,"routerLink"]]},template:function(e,a){e&1&&(s(0,"app-status-bar"),E(1,j,3,1,"sh-stepper",6),o(2,"section"),s(3,"router-outlet"),n()),e&2&&(r(),g(a.isProgressPage()?-1:1))},dependencies:[y,W,k,M,G,v],styles:["[_nghost-%COMP%]{display:block}.full-width[_nghost-%COMP%] section[_ngcontent-%COMP%]{max-width:62.5rem}sh-stepper[_ngcontent-%COMP%]{max-width:31.25rem;margin:2.5rem auto}section[_ngcontent-%COMP%]{max-width:31.25rem;margin:0 auto 2.5rem}.inactive[_ngcontent-%COMP%]{pointer-events:none;opacity:.5}"],changeDetection:0})};export{h as default};
@@ -1 +1 @@
1
- import{e as a,f as b}from"./chunk-4N3AWKEK.js";import"./chunk-4VEFX5WQ.js";import"./chunk-AS6Z56AD.js";import"./chunk-IW4RDAIN.js";import"./chunk-O4OTZE5N.js";import"./chunk-WIVARGP6.js";import"./chunk-FK7JFD5B.js";import"./chunk-5DJAX2HH.js";import"./chunk-DW332N2S.js";import"./chunk-AABUGLWU.js";import"./chunk-TELPJYLN.js";import"./chunk-5QZIKR6A.js";import"./chunk-HPNLQHW6.js";import"./chunk-BGTK25UG.js";import"./chunk-A4LPGPDU.js";import"./chunk-PKPBSTZA.js";import"./chunk-QPTSKQZ2.js";import"./chunk-OTPG7USH.js";import"./chunk-TT3S63BX.js";import"./chunk-T2WO6CVD.js";import"./chunk-7CGTOI24.js";export{a as createRestoreSelectFilesForm,b as default};
1
+ import{e as a,f as b}from"./chunk-QQ2F3BER.js";import"./chunk-4VEFX5WQ.js";import"./chunk-AS6Z56AD.js";import"./chunk-IW4RDAIN.js";import"./chunk-O4OTZE5N.js";import"./chunk-WIVARGP6.js";import"./chunk-FK7JFD5B.js";import"./chunk-5DJAX2HH.js";import"./chunk-DW332N2S.js";import"./chunk-SJWKQCBL.js";import"./chunk-TELPJYLN.js";import"./chunk-G4SK3PS7.js";import"./chunk-HPNLQHW6.js";import"./chunk-BGTK25UG.js";import"./chunk-A4LPGPDU.js";import"./chunk-PKPBSTZA.js";import"./chunk-QPTSKQZ2.js";import"./chunk-OTPG7USH.js";import"./chunk-TT3S63BX.js";import"./chunk-T2WO6CVD.js";import"./chunk-7CGTOI24.js";export{a as createRestoreSelectFilesForm,b as default};
@@ -1 +1 @@
1
- import{a as ve}from"./chunk-PAMKTLG5.js";import{a as be}from"./chunk-FOQJA6X2.js";import{a as he}from"./chunk-4NN5ZM73.js";import{a as ye}from"./chunk-LFISHZZP.js";import{a as Le}from"./chunk-6ALGXRIS.js";import{b as Me}from"./chunk-AABUGLWU.js";import{a as Ie}from"./chunk-TELPJYLN.js";import{b as de}from"./chunk-5QZIKR6A.js";import{B as I,D as Oe,H as Ne,L as Ae,M as De,O as Pe,P as fe,Y as Re,c as pe,e as Ce,i as ge,k as Ee,s as w,u as V,w as Fe,z as me}from"./chunk-HPNLQHW6.js";import{c as M}from"./chunk-BGTK25UG.js";import{e as Se}from"./chunk-A4LPGPDU.js";import{fa as ue}from"./chunk-OTPG7USH.js";import{$ as F,Ab as _,Bb as S,Cc as H,Dc as Te,E as U,Ec as ce,Ib as A,Mc as G,Pa as r,Pb as d,Qb as p,Qc as x,Rb as g,Sb as se,Tb as ae,Ub as v,Vb as c,W as C,Xb as E,aa as m,cb as D,fc as _e,gc as f,jc as L,la as u,lc as le,mc as re,na as te,oc as y,pc as b,qc as $,sb as O,tb as N,ub as ne,wb as ie,xb as oe,xc as X,yb as P,zb as a}from"./chunk-T2WO6CVD.js";function xe(o,t){if(o&1){let n=A();a(0,"sh-radio",10),c("click",function(){let i=F(n).$implicit,s=E();return m(s.pauseOption.set(i.value))}),L(1),_()}if(o&2){let n=t.$implicit,e=E();f("active",e.pauseOption()===n.value),r(),le(" ",n.label," ")}}var we=[{label:$localize`5 minutes`,value:"5m"},{label:$localize`10 minutes`,value:"10m"},{label:$localize`15 minutes`,value:"15m"},{label:$localize`30 minutes`,value:"30m"},{label:$localize`1 hour`,value:"1h"},{label:$localize`4 hours`,value:"4h"},{label:$localize`8 hours`,value:"8h"},{label:$localize`24 hours`,value:"24h"},{label:$localize`Until resumed`,value:void 0}],z=class o{#e=C(M);pauseOptions=u(we);closed=x();isSubmitting=u(!1);pauseTransfers=u(!1);pauseOption=u(void 0);submit(){this.isSubmitting.set(!0);let t=this.pauseTransfers()||null,n=this.pauseOption();this.#e.postApiV1ServerstatePause({duration:n,pauseTransfers:t}).pipe(U(()=>this.isSubmitting.set(!1))).subscribe({next:e=>{this.closed.emit()}})}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=D({type:o,selectors:[["app-pause-dialog"]],outputs:{closed:"closed"},decls:17,vars:4,consts:()=>{let t;t=$localize`Pause settings`;let n;n=$localize` Also pause transfers `;let e;e=$localize`If you pause transfers they could time out and cause retries or failures.`;let i;i=$localize`Cancel`;let s;return s=$localize` Update settings `,[t,n,e,i,s,["header",""],["content",""],[1,"radios"],[1,"primary","raised",3,"active"],[1,"check-wrap"],[1,"primary","raised",3,"click"],["type","warning"],["footer",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"click"]]},template:function(n,e){n&1&&(a(0,"header",5)(1,"h3"),g(2,0),_()(),a(3,"div",6)(4,"div",7),ie(5,xe,2,3,"sh-radio",8,ne),_(),a(7,"div",9)(8,"sh-checkbox",10),c("click",function(){return e.pauseTransfers.set(!e.pauseTransfers())}),g(9,1),_(),a(10,"sh-alert",11),g(11,2),_()()(),a(12,"footer",12)(13,"button",13),c("click",function(){return e.closed.emit()}),g(14,3),_(),a(15,"button",14),c("click",function(){return e.submit()}),g(16,4),_()()),n&2&&(r(5),oe(e.pauseOptions()),r(3),f("active",e.pauseTransfers()),r(7),f("loader",e.isSubmitting()))},dependencies:[w,De,Oe,Fe,I],styles:["[_nghost-%COMP%]{--dialog-p: 1.5rem;display:block}h3[_ngcontent-%COMP%]{font:var(--title-30)}.radios[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.check-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:2rem 0 0}"],changeDetection:0})};var $e=()=>["/connect/logon"];function Ve(o,t){o&1&&(d(0,0,1),S(1,"div",9),p())}function ze(o,t){o&1&&(d(0,0,2),S(1,"div",10),p())}function Je(o,t){if(o&1){let n=A();a(0,"div",8),c("click",function(){F(n);let i=E();return m(i.resetAndRetry())}),d(1,0),O(2,Ve,2,0)(3,ze,2,0),p(),_()}if(o&2){let n=E();r(2),N(n.resetting()?2:3)}}function Xe(o,t){o&1&&(a(0,"div",6),d(1,1),S(2,"div",11),p(),_()),o&2&&P("routerLink",X(1,$e))}function He(o,t){o&1&&(a(0,"div",6),d(1,2),S(2,"div",10),p(),_()),o&2&&P("routerLink",X(1,$e))}function Ye(o,t){if(o&1){let n=A();a(0,"div",7),d(1,3),a(2,"sh-icon",12),c("click",function(){F(n);let i=E();return m(i.cancel())}),_(),a(3,"div",13),c("click",function(){F(n);let i=E();return m(i.claim())}),_(),S(4,"div",14),p(),_()}}function Ke(o,t){if(o&1){let n=A();a(0,"div",8),c("click",function(){F(n);let i=E();return m(i.openConsole())}),d(1,4),S(2,"div",15),p(),_()}}var B=class o{#e=C(ye);state=this.#e.state;resetting=u(!1);stateEffect=te(()=>{let t=this.#e.state(),n=this.resetting();t==="registered"&&n&&(this.resetting.set(!1),this.#e.beginRemoteRegistration())});ngOnInit(){this.#e.refreshRemoteControlStatus()}claim(){let t=this.#e.claimUrl();t&&window.open(t,"_blank")}cancel(){this.#e.cancelRemoteRegistration()}resetAndRetry(){this.resetting.set(!0),this.#e.cancelRemoteRegistration()}openConsole(){this.#e.openConsole()}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=D({type:o,selectors:[["app-remote-connectivity-status"]],decls:5,vars:1,consts:()=>{let t;t=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF: Resetting ${"\uFFFD#1:1\uFFFD"}:START_TAG_DIV:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_DIV:${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE: Click to connect ${"\uFFFD#1:2\uFFFD"}:START_TAG_DIV_1:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_DIV:${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,t=v(t);let n;n=$localize` Connecting ${"\uFFFD#2\uFFFD"}:START_TAG_DIV:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_DIV:`;let e;e=$localize` Click to register ${"\uFFFD#2\uFFFD"}:START_TAG_DIV:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_DIV:`;let i;i=$localize`Cancel registration`;let s;s=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:x-circle${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD#3\uFFFD"}:START_TAG_DIV:Click to claim${"[\uFFFD/#3\uFFFD|\uFFFD/#4\uFFFD]"}:CLOSE_TAG_DIV:${"\uFFFD#4\uFFFD"}:START_TAG_DIV_1:${"[\uFFFD/#3\uFFFD|\uFFFD/#4\uFFFD]"}:CLOSE_TAG_DIV:`,s=v(s);let T;return T=$localize` Connected ${"\uFFFD#2\uFFFD"}:START_TAG_DIV:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_DIV:`,[t,n,e,s,T,[1,"connectivity-status"],[1,"connectivity-status",3,"routerLink"],[1,"connectivity-status","claim"],[1,"connectivity-status",3,"click"],[1,"status","blinking"],[1,"status"],[1,"status","warning","blinking"],["shTooltip",i,3,"click"],[1,"claim",3,"click"],[1,"status","success","blinking"],[1,"status","success"]]},template:function(n,e){if(n&1&&O(0,Je,4,1,"div",5)(1,Xe,3,2,"div",6)(2,He,3,2,"div",6)(3,Ye,5,0,"div",7)(4,Ke,3,0,"div",5),n&2){let i=e.state()==="unknown"||e.state()==="inactive"||e.state()==="registeringfaulted",s=e.state()==="registeringfaulted",T=e.state()==="registering",l=e.state()==="registered",R=e.state()==="connected"||e.state()==="disabled"||e.state()==="connecting";N(s?0:T?1:i?2:l?3:R?4:-1)}},dependencies:[Se,V,Re],styles:["[_nghost-%COMP%]{display:flex;align-items:center;padding:0 .75rem}.connectivity-status[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer}.connectivity-status[_ngcontent-%COMP%]:hover{color:var(--primary-8)}.connectivity-status.claim[_ngcontent-%COMP%]{display:flex;gap:.5rem;cursor:pointer}.connectivity-status.claim[_ngcontent-%COMP%]:hover{color:inherit}.connectivity-status.claim[_ngcontent-%COMP%] .claim[_ngcontent-%COMP%]:hover{color:var(--primary-8)}.connectivity-status.claim[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]:hover{color:var(--error-8)}.status[_ngcontent-%COMP%]{width:.625rem;height:.625rem;border-radius:50%;background-color:var(--base-4)}.status.success[_ngcontent-%COMP%]{background-color:var(--success-8)}.status.warning[_ngcontent-%COMP%]{background-color:var(--warn-8)}.status.blinking[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_blinking 1s infinite}@keyframes _ngcontent-%COMP%_blinking{0%{opacity:.2}50%{opacity:1}to{opacity:.2}}"],changeDetection:0})};var Ge={Byte:"B",KByte:"KB",MByte:"MB",GByte:"GB",TByte:"TB",PByte:"PB"},We=["mbps","gbps"],Be=8,Z=1024,J=Z*1024,q=J*1024,Q=q*1024,ke=Q*1024,je={B:1,KB:Z,MB:J,GB:q,TB:Q,PB:ke},Ze=1e3,j=Ze*1e3,W=j*1e3,qe=[{threshold:ke,unitPrefix:"PByte"},{threshold:Q,unitPrefix:"TByte"},{threshold:q,unitPrefix:"GByte"},{threshold:J,unitPrefix:"MByte"},{threshold:Z,unitPrefix:"KByte"},{threshold:1,unitPrefix:"Byte"}],k=class o{#e=C(M);closed=x();isSubmitting=u(!1);sizeOptions=u([...We]);maxUpload=u(0);maxDownload=u(0);maxUploadUnit=u("mbps");maxDownloadUnit=u("mbps");ngOnInit(){this.init()}convertToBitsPerSecondUnits(t,n){let i=t*(je[n.toUpperCase()]||J)*Be;return i===0?{value:0,unit:"mbps"}:i>=W?{value:parseFloat((i/W).toFixed(2)),unit:"gbps"}:{value:parseFloat((i/j).toFixed(2)),unit:"mbps"}}convertFromBitsPerSecondUnits(t,n){let e=0;switch(n){case"gbps":e=t*W;break;case"mbps":e=t*j;break}let i=e/Be;if(i===0)return{valueForApi:0,unitPrefixForApi:"Byte"};for(let{threshold:s,unitPrefix:T}of qe)if(i>=s)return{valueForApi:Math.round(i/s),unitPrefixForApi:T};return{valueForApi:Math.round(i),unitPrefixForApi:"Byte"}}init(){this.#e.getApiV1Serversettings().subscribe({next:t=>{let n=t?.["max-upload-speed"],e=t?.["max-download-speed"];if(n&&n!==""){let i=n.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(i){let s=parseFloat(i[1]),T=i[2],l=this.convertToBitsPerSecondUnits(s,T);this.maxUpload.set(l.value),this.maxUploadUnit.set(l.unit)}else console.warn("Unexpected max-upload-speed format from API:",n),this.resetUpload()}else this.resetUpload();if(e&&e!==""){let i=e.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(i){let s=parseFloat(i[1]),T=i[2],l=this.convertToBitsPerSecondUnits(s,T);this.maxDownload.set(l.value),this.maxDownloadUnit.set(l.unit)}else console.warn("Unexpected max-download-speed format from API:",e),this.resetDownload()}else this.resetDownload()},error:t=>{console.error("Failed to get server settings:",t),this.resetDownload(),this.resetUpload()}})}resetDownload(){this.maxDownload.set(0),this.maxDownloadUnit.set("mbps")}resetUpload(){this.maxUpload.set(0),this.maxUploadUnit.set("mbps")}blockDecimalKeys(t){if([".",","].includes(t.key))return t.preventDefault()}cleanupInputAfterPasting(t){t.preventDefault();let n=t.clipboardData?.getData("text/plain");if(!n)return;let e=n.replaceAll(/[\.,]/g,"");t.target.value=e}submit(){this.isSubmitting.set(!0);let t="",n="",e=this.maxUpload()??0,i=this.maxUploadUnit(),s=this.maxDownload()??0,T=this.maxDownloadUnit();if(e>0){let{valueForApi:l,unitPrefixForApi:R}=this.convertFromBitsPerSecondUnits(e,i),h=Ge[R];h?t=`${l}${h}`:console.error(`Invalid unit prefix for API submission (upload): ${R}. Defaulting to empty string.`)}if(s){let{valueForApi:l,unitPrefixForApi:R}=this.convertFromBitsPerSecondUnits(s,T),h=Ge[R];h?n=`${l}${h}`:console.error(`Invalid unit prefix for API submission (download): ${R}. Defaulting to empty string.`)}this.#e.patchApiV1Serversettings({requestBody:{"max-upload-speed":t,"max-download-speed":n}}).pipe(U(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{this.closed.emit(!0)},error:l=>{console.error("Failed to submit throttle settings:",l)}})}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=D({type:o,selectors:[["app-throttle-settings-dialog"]],outputs:{closed:"closed"},decls:26,vars:10,consts:()=>{let t;t=$localize`Throttle network speed`;let n;n=$localize`We will round bits to the nearest byte value.`;let e;e=$localize`Max upload speed`;let i;i=$localize`Max download speed`;let s;s=$localize`Cancel`;let T;return T=$localize` Update settings `,[t,n,e,i,s,T,["content",""],[1,"column"],[1,"field-row"],["type","number",3,"paste","keydown","ngModelChange","ngModel"],[3,"isClearable","options"],["type","text",3,"ngModelChange","ngModel"],["footer",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"click"]]},template:function(n,e){n&1&&(a(0,"header")(1,"h3"),g(2,0),_(),a(3,"p"),g(4,1),_()(),a(5,"div",6)(6,"div",7)(7,"div",8)(8,"label"),g(9,2),_(),a(10,"sh-form-field")(11,"input",9),c("paste",function(s){return e.cleanupInputAfterPasting(s)})("keydown",function(s){return e.blockDecimalKeys(s)}),$("ngModelChange",function(s){return b(e.maxUpload,s)||(e.maxUpload=s),s}),_()(),a(12,"sh-select",10)(13,"input",11),$("ngModelChange",function(s){return b(e.maxUploadUnit,s)||(e.maxUploadUnit=s),s}),_()()(),a(14,"div",8)(15,"label"),g(16,3),_(),a(17,"sh-form-field")(18,"input",9),c("paste",function(s){return e.cleanupInputAfterPasting(s)})("keydown",function(s){return e.blockDecimalKeys(s)}),$("ngModelChange",function(s){return b(e.maxDownload,s)||(e.maxDownload=s),s}),_()(),a(19,"sh-select",10)(20,"input",11),$("ngModelChange",function(s){return b(e.maxDownloadUnit,s)||(e.maxDownloadUnit=s),s}),_()()()()(),a(21,"footer",12)(22,"button",13),c("click",function(){return e.closed.emit(!1)}),g(23,4),_(),a(24,"button",14),c("click",function(){return e.submit()}),g(25,5),_()()),n&2&&(r(11),y("ngModel",e.maxUpload),r(),P("isClearable",!1)("options",e.sizeOptions()),r(),y("ngModel",e.maxUploadUnit),r(5),y("ngModel",e.maxDownload),r(),P("isClearable",!1)("options",e.sizeOptions()),r(),y("ngModel",e.maxDownloadUnit),r(4),f("loader",e.isSubmitting()))},dependencies:[w,pe,Ee,Ce,ge,Ne,fe,I],styles:['[_nghost-%COMP%]{display:block}h3[_ngcontent-%COMP%]{font:var(--title-30)}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;padding:1rem;gap:.5rem;margin-bottom:1rem}.column[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.field-row[_ngcontent-%COMP%]{display:grid;grid-template-areas:"label label" "input select";grid-template-columns:1fr auto;align-items:center;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%]{grid-area:input}.field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{grid-area:select}'],changeDetection:0})};function Qe(o,t){if(o&1&&(a(0,"div"),L(1),_(),S(2,"sh-progress-bar",12)),o&2){let n=E();r(),re("",n.statusData().actionText," - ",n.statusData().statusText),r(),P("value",n.statusData().progress*100)}}function et(o,t){if(o&1&&(a(0,"div",8),d(1,1),S(2,"sh-icon"),H(3,"relativeTime"),H(4,"date"),p(),_()),o&2){let n,e=E();r(4),se((n=e.nextBackup().backup)==null||n.Backup==null?null:n.Backup.Name)(Te(3,3,e.nextBackup().time))(ce(4,5,e.nextBackup().time,"shortTime")),ae(1)}}function tt(o,t){o&1&&(a(0,"div",8),g(1,2),_())}function nt(o,t){o&1&&(a(0,"div",9),d(1,3),S(2,"sh-spinner"),p(),_()),o&2&&(r(2),_e("--spinner-size","12px")("--spinner-thickness","2px"))}function it(o,t){o&1&&S(0,"app-remote-connectivity-status")}function ot(o,t){if(o&1){let n=A();a(0,"button",11),c("click",function(){F(n);let i=E(2);return m(i.abort())}),d(1,4),S(2,"sh-icon"),p(),_()}}function st(o,t){if(o&1){let n=A();a(0,"button",11),c("click",function(){F(n);let i=E(2);return m(i.stop())}),d(1,5),S(2,"sh-icon"),p(),_()}}function at(o,t){if(o&1&&O(0,ot,3,0,"button",13)(1,st,3,0,"button",13),o&2){let n=E();N(n.isStopping()?0:1)}}function _t(o,t){o&1&&(d(0,0,1),S(1,"sh-icon"),p())}function lt(o,t){o&1&&(d(0,0,2),S(1,"sh-icon"),p())}var Ue=new Date,ee=class o{#e=C(M);#t=C(ve);#n=C(me);#a=C(he);#i=C(de);#_=C(Ie);#o=C(Me);#l=C(Le);minsAgo=Ue.setMinutes(Ue.getMinutes()-1);statusData=this.#t.statusData;serverState=this.#t.serverState;clientIsRunning=this.#t.clientIsRunning;isResuming=this.#t.isResuming;runningTask=G(()=>this.#o.serverState()?.ActiveTask?.Item1);isStopping=G(()=>this.runningTask()==this.#s());#s=u(-1);pgState=G(()=>this.#o.serverState());isUsingRelay=this.#i.relayIsEnabled;hideConsoleConnectionStatus=this.#l.isConsoleConnectionStatusHidden;nextBackup=G(()=>{let t=this.#a.backups();return{backup:this.serverState()?.ProposedSchedule?.[0]?.backup,time:this.serverState()?.ProposedSchedule?.[0]?.Item2}});openThrottleSettingsDialog(){this.#n.open(k,{maxWidth:"550px",width:"100%"})}openPauseDialog(){this.#n.open(z,{maxWidth:"550px",width:"100%"})}pauseResume(){if(this.clientIsRunning()){this.openPauseDialog();return}this.#t.pauseResume().subscribe()}stop(){let t=this.runningTask();t&&(this.#s.set(t),this.#e.postApiV1TaskByTaskidStop({taskid:t}).subscribe())}abort(){let t=this.runningTask();t&&this.#e.postApiV1TaskByTaskidAbort({taskid:t}).subscribe()}ngAfterViewInit(){let t=this.#i.relayIsEnabled()||!this.#_.hasWebSocket()?"longpoll":"websocket";this.#t.setConnectionMethod(t)}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=D({type:o,selectors:[["app-status-bar"]],decls:16,vars:6,consts:()=>{let t;t=$localize`${"\uFFFD*11: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/*11:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*12: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/*12:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,t=v(t);let n;n=$localize` ${"\uFFFD0\uFFFD"}:INTERPOLATION: - ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:clock${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD1\uFFFD"}:INTERPOLATION_1: at ${"\uFFFD2\uFFFD"}:INTERPOLATION_2: `;let e;e=$localize`No scheduled tasks`;let i;i=$localize` Loading ${"\uFFFD#2\uFFFD"}:START_TAG_SH_SPINNER:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_SPINNER:`;let s;s=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:skull${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Abort `;let T;return T=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:stop${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Stop `,[t,n,e,i,s,T,[1,"current-backup"],[1,"current-backup-progress"],[1,"label"],[1,"label","label-loading"],[1,"current-backup-actions"],["shButton","",3,"click"],[1,"raised","primary",3,"value"],["shButton",""]]},template:function(n,e){if(n&1&&(a(0,"div",6)(1,"div",7),O(2,Qe,3,3)(3,et,5,8,"div",8)(4,tt,2,0,"div",8)(5,nt,3,4,"div",9),_(),a(6,"div",10),O(7,it,1,0,"app-remote-connectivity-status"),O(8,at,2,1),a(9,"button",11),c("click",function(){return e.pauseResume()}),d(10,0),O(11,_t,2,0)(12,lt,2,0),p(),_(),a(13,"button",11),c("click",function(){return e.openThrottleSettingsDialog()}),a(14,"sh-icon"),L(15,"speedometer"),_()()()()),n&2){let i;r(2),N((i=e.serverState())!=null&&i.ActiveTask&&(!((i=e.statusData())==null||i.task==null)&&i.task.Status)&&((i=e.statusData())==null||i.task==null?null:i.task.Status)!=="Completed"?2:e.nextBackup().backup||e.nextBackup().time?3:(i=e.serverState())!=null&&i.ActiveTask?5:4),r(5),N(!e.isUsingRelay()&&!e.hideConsoleConnectionStatus()?7:-1),r(),N(e.runningTask()?8:-1),r(),f("loader",e.isResuming()),r(2),N(e.clientIsRunning()?11:12)}},dependencies:[B,V,I,Pe,Ae,be,ue],styles:["[_nghost-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1rem;min-height:3.875rem;border-bottom:1px solid var(--base-4);position:sticky;top:0;z-index:2000;background:var(--base-1)}.current-backup[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;width:100%;gap:.5rem}.current-backup-progress[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;min-width:18.75rem;flex:1 0}.current-backup-progress[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{max-width:18.75rem;width:100%}.current-backup-progress[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.current-backup-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.label-loading[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.25rem}"],changeDetection:0})};export{ee as a};
1
+ import{a as ve}from"./chunk-4VCGLPSI.js";import{a as be}from"./chunk-FOQJA6X2.js";import{a as he}from"./chunk-SAKHOLXS.js";import{a as ye}from"./chunk-WDMQH4ZC.js";import{a as Le}from"./chunk-IMDBR2SZ.js";import{b as Me}from"./chunk-SJWKQCBL.js";import{a as Ie}from"./chunk-TELPJYLN.js";import{c as de}from"./chunk-G4SK3PS7.js";import{B as I,D as Oe,H as Ne,L as Ae,M as De,O as Pe,P as fe,Y as Re,c as pe,e as Ce,i as ge,k as Ee,s as w,u as V,w as Fe,z as me}from"./chunk-HPNLQHW6.js";import{c as M}from"./chunk-BGTK25UG.js";import{e as Se}from"./chunk-A4LPGPDU.js";import{fa as ue}from"./chunk-OTPG7USH.js";import{$ as F,Ab as _,Bb as S,Cc as H,Dc as Te,E as U,Ec as ce,Ib as A,Mc as G,Pa as r,Pb as d,Qb as p,Qc as x,Rb as g,Sb as se,Tb as ae,Ub as v,Vb as c,W as C,Xb as E,aa as m,cb as D,fc as _e,gc as f,jc as L,la as u,lc as le,mc as re,na as te,oc as y,pc as b,qc as $,sb as O,tb as N,ub as ne,wb as ie,xb as oe,xc as X,yb as P,zb as a}from"./chunk-T2WO6CVD.js";function xe(o,t){if(o&1){let n=A();a(0,"sh-radio",10),c("click",function(){let i=F(n).$implicit,s=E();return m(s.pauseOption.set(i.value))}),L(1),_()}if(o&2){let n=t.$implicit,e=E();f("active",e.pauseOption()===n.value),r(),le(" ",n.label," ")}}var we=[{label:$localize`5 minutes`,value:"5m"},{label:$localize`10 minutes`,value:"10m"},{label:$localize`15 minutes`,value:"15m"},{label:$localize`30 minutes`,value:"30m"},{label:$localize`1 hour`,value:"1h"},{label:$localize`4 hours`,value:"4h"},{label:$localize`8 hours`,value:"8h"},{label:$localize`24 hours`,value:"24h"},{label:$localize`Until resumed`,value:void 0}],z=class o{#e=C(M);pauseOptions=u(we);closed=x();isSubmitting=u(!1);pauseTransfers=u(!1);pauseOption=u(void 0);submit(){this.isSubmitting.set(!0);let t=this.pauseTransfers()||null,n=this.pauseOption();this.#e.postApiV1ServerstatePause({duration:n,pauseTransfers:t}).pipe(U(()=>this.isSubmitting.set(!1))).subscribe({next:e=>{this.closed.emit()}})}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=D({type:o,selectors:[["app-pause-dialog"]],outputs:{closed:"closed"},decls:17,vars:4,consts:()=>{let t;t=$localize`Pause settings`;let n;n=$localize` Also pause transfers `;let e;e=$localize`If you pause transfers they could time out and cause retries or failures.`;let i;i=$localize`Cancel`;let s;return s=$localize` Update settings `,[t,n,e,i,s,["header",""],["content",""],[1,"radios"],[1,"primary","raised",3,"active"],[1,"check-wrap"],[1,"primary","raised",3,"click"],["type","warning"],["footer",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"click"]]},template:function(n,e){n&1&&(a(0,"header",5)(1,"h3"),g(2,0),_()(),a(3,"div",6)(4,"div",7),ie(5,xe,2,3,"sh-radio",8,ne),_(),a(7,"div",9)(8,"sh-checkbox",10),c("click",function(){return e.pauseTransfers.set(!e.pauseTransfers())}),g(9,1),_(),a(10,"sh-alert",11),g(11,2),_()()(),a(12,"footer",12)(13,"button",13),c("click",function(){return e.closed.emit()}),g(14,3),_(),a(15,"button",14),c("click",function(){return e.submit()}),g(16,4),_()()),n&2&&(r(5),oe(e.pauseOptions()),r(3),f("active",e.pauseTransfers()),r(7),f("loader",e.isSubmitting()))},dependencies:[w,De,Oe,Fe,I],styles:["[_nghost-%COMP%]{--dialog-p: 1.5rem;display:block}h3[_ngcontent-%COMP%]{font:var(--title-30)}.radios[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.check-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:2rem 0 0}"],changeDetection:0})};var $e=()=>["/connect/logon"];function Ve(o,t){o&1&&(d(0,0,1),S(1,"div",9),p())}function ze(o,t){o&1&&(d(0,0,2),S(1,"div",10),p())}function Je(o,t){if(o&1){let n=A();a(0,"div",8),c("click",function(){F(n);let i=E();return m(i.resetAndRetry())}),d(1,0),O(2,Ve,2,0)(3,ze,2,0),p(),_()}if(o&2){let n=E();r(2),N(n.resetting()?2:3)}}function Xe(o,t){o&1&&(a(0,"div",6),d(1,1),S(2,"div",11),p(),_()),o&2&&P("routerLink",X(1,$e))}function He(o,t){o&1&&(a(0,"div",6),d(1,2),S(2,"div",10),p(),_()),o&2&&P("routerLink",X(1,$e))}function Ye(o,t){if(o&1){let n=A();a(0,"div",7),d(1,3),a(2,"sh-icon",12),c("click",function(){F(n);let i=E();return m(i.cancel())}),_(),a(3,"div",13),c("click",function(){F(n);let i=E();return m(i.claim())}),_(),S(4,"div",14),p(),_()}}function Ke(o,t){if(o&1){let n=A();a(0,"div",8),c("click",function(){F(n);let i=E();return m(i.openConsole())}),d(1,4),S(2,"div",15),p(),_()}}var B=class o{#e=C(ye);state=this.#e.state;resetting=u(!1);stateEffect=te(()=>{let t=this.#e.state(),n=this.resetting();t==="registered"&&n&&(this.resetting.set(!1),this.#e.beginRemoteRegistration())});ngOnInit(){this.#e.refreshRemoteControlStatus()}claim(){let t=this.#e.claimUrl();t&&window.open(t,"_blank")}cancel(){this.#e.cancelRemoteRegistration()}resetAndRetry(){this.resetting.set(!0),this.#e.cancelRemoteRegistration()}openConsole(){this.#e.openConsole()}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=D({type:o,selectors:[["app-remote-connectivity-status"]],decls:5,vars:1,consts:()=>{let t;t=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF: Resetting ${"\uFFFD#1:1\uFFFD"}:START_TAG_DIV:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_DIV:${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE: Click to connect ${"\uFFFD#1:2\uFFFD"}:START_TAG_DIV_1:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_DIV:${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,t=v(t);let n;n=$localize` Connecting ${"\uFFFD#2\uFFFD"}:START_TAG_DIV:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_DIV:`;let e;e=$localize` Click to register ${"\uFFFD#2\uFFFD"}:START_TAG_DIV:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_DIV:`;let i;i=$localize`Cancel registration`;let s;s=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:x-circle${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD#3\uFFFD"}:START_TAG_DIV:Click to claim${"[\uFFFD/#3\uFFFD|\uFFFD/#4\uFFFD]"}:CLOSE_TAG_DIV:${"\uFFFD#4\uFFFD"}:START_TAG_DIV_1:${"[\uFFFD/#3\uFFFD|\uFFFD/#4\uFFFD]"}:CLOSE_TAG_DIV:`,s=v(s);let T;return T=$localize` Connected ${"\uFFFD#2\uFFFD"}:START_TAG_DIV:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_DIV:`,[t,n,e,s,T,[1,"connectivity-status"],[1,"connectivity-status",3,"routerLink"],[1,"connectivity-status","claim"],[1,"connectivity-status",3,"click"],[1,"status","blinking"],[1,"status"],[1,"status","warning","blinking"],["shTooltip",i,3,"click"],[1,"claim",3,"click"],[1,"status","success","blinking"],[1,"status","success"]]},template:function(n,e){if(n&1&&O(0,Je,4,1,"div",5)(1,Xe,3,2,"div",6)(2,He,3,2,"div",6)(3,Ye,5,0,"div",7)(4,Ke,3,0,"div",5),n&2){let i=e.state()==="unknown"||e.state()==="inactive"||e.state()==="registeringfaulted",s=e.state()==="registeringfaulted",T=e.state()==="registering",l=e.state()==="registered",R=e.state()==="connected"||e.state()==="disabled"||e.state()==="connecting";N(s?0:T?1:i?2:l?3:R?4:-1)}},dependencies:[Se,V,Re],styles:["[_nghost-%COMP%]{display:flex;align-items:center;padding:0 .75rem}.connectivity-status[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer}.connectivity-status[_ngcontent-%COMP%]:hover{color:var(--primary-8)}.connectivity-status.claim[_ngcontent-%COMP%]{display:flex;gap:.5rem;cursor:pointer}.connectivity-status.claim[_ngcontent-%COMP%]:hover{color:inherit}.connectivity-status.claim[_ngcontent-%COMP%] .claim[_ngcontent-%COMP%]:hover{color:var(--primary-8)}.connectivity-status.claim[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]:hover{color:var(--error-8)}.status[_ngcontent-%COMP%]{width:.625rem;height:.625rem;border-radius:50%;background-color:var(--base-4)}.status.success[_ngcontent-%COMP%]{background-color:var(--success-8)}.status.warning[_ngcontent-%COMP%]{background-color:var(--warn-8)}.status.blinking[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_blinking 1s infinite}@keyframes _ngcontent-%COMP%_blinking{0%{opacity:.2}50%{opacity:1}to{opacity:.2}}"],changeDetection:0})};var Ge={Byte:"B",KByte:"KB",MByte:"MB",GByte:"GB",TByte:"TB",PByte:"PB"},We=["mbps","gbps"],Be=8,Z=1024,J=Z*1024,q=J*1024,Q=q*1024,ke=Q*1024,je={B:1,KB:Z,MB:J,GB:q,TB:Q,PB:ke},Ze=1e3,j=Ze*1e3,W=j*1e3,qe=[{threshold:ke,unitPrefix:"PByte"},{threshold:Q,unitPrefix:"TByte"},{threshold:q,unitPrefix:"GByte"},{threshold:J,unitPrefix:"MByte"},{threshold:Z,unitPrefix:"KByte"},{threshold:1,unitPrefix:"Byte"}],k=class o{#e=C(M);closed=x();isSubmitting=u(!1);sizeOptions=u([...We]);maxUpload=u(0);maxDownload=u(0);maxUploadUnit=u("mbps");maxDownloadUnit=u("mbps");ngOnInit(){this.init()}convertToBitsPerSecondUnits(t,n){let i=t*(je[n.toUpperCase()]||J)*Be;return i===0?{value:0,unit:"mbps"}:i>=W?{value:parseFloat((i/W).toFixed(2)),unit:"gbps"}:{value:parseFloat((i/j).toFixed(2)),unit:"mbps"}}convertFromBitsPerSecondUnits(t,n){let e=0;switch(n){case"gbps":e=t*W;break;case"mbps":e=t*j;break}let i=e/Be;if(i===0)return{valueForApi:0,unitPrefixForApi:"Byte"};for(let{threshold:s,unitPrefix:T}of qe)if(i>=s)return{valueForApi:Math.round(i/s),unitPrefixForApi:T};return{valueForApi:Math.round(i),unitPrefixForApi:"Byte"}}init(){this.#e.getApiV1Serversettings().subscribe({next:t=>{let n=t?.["max-upload-speed"],e=t?.["max-download-speed"];if(n&&n!==""){let i=n.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(i){let s=parseFloat(i[1]),T=i[2],l=this.convertToBitsPerSecondUnits(s,T);this.maxUpload.set(l.value),this.maxUploadUnit.set(l.unit)}else console.warn("Unexpected max-upload-speed format from API:",n),this.resetUpload()}else this.resetUpload();if(e&&e!==""){let i=e.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(i){let s=parseFloat(i[1]),T=i[2],l=this.convertToBitsPerSecondUnits(s,T);this.maxDownload.set(l.value),this.maxDownloadUnit.set(l.unit)}else console.warn("Unexpected max-download-speed format from API:",e),this.resetDownload()}else this.resetDownload()},error:t=>{console.error("Failed to get server settings:",t),this.resetDownload(),this.resetUpload()}})}resetDownload(){this.maxDownload.set(0),this.maxDownloadUnit.set("mbps")}resetUpload(){this.maxUpload.set(0),this.maxUploadUnit.set("mbps")}blockDecimalKeys(t){if([".",","].includes(t.key))return t.preventDefault()}cleanupInputAfterPasting(t){t.preventDefault();let n=t.clipboardData?.getData("text/plain");if(!n)return;let e=n.replaceAll(/[\.,]/g,"");t.target.value=e}submit(){this.isSubmitting.set(!0);let t="",n="",e=this.maxUpload()??0,i=this.maxUploadUnit(),s=this.maxDownload()??0,T=this.maxDownloadUnit();if(e>0){let{valueForApi:l,unitPrefixForApi:R}=this.convertFromBitsPerSecondUnits(e,i),h=Ge[R];h?t=`${l}${h}`:console.error(`Invalid unit prefix for API submission (upload): ${R}. Defaulting to empty string.`)}if(s){let{valueForApi:l,unitPrefixForApi:R}=this.convertFromBitsPerSecondUnits(s,T),h=Ge[R];h?n=`${l}${h}`:console.error(`Invalid unit prefix for API submission (download): ${R}. Defaulting to empty string.`)}this.#e.patchApiV1Serversettings({requestBody:{"max-upload-speed":t,"max-download-speed":n}}).pipe(U(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{this.closed.emit(!0)},error:l=>{console.error("Failed to submit throttle settings:",l)}})}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=D({type:o,selectors:[["app-throttle-settings-dialog"]],outputs:{closed:"closed"},decls:26,vars:10,consts:()=>{let t;t=$localize`Throttle network speed`;let n;n=$localize`We will round bits to the nearest byte value.`;let e;e=$localize`Max upload speed`;let i;i=$localize`Max download speed`;let s;s=$localize`Cancel`;let T;return T=$localize` Update settings `,[t,n,e,i,s,T,["content",""],[1,"column"],[1,"field-row"],["type","number",3,"paste","keydown","ngModelChange","ngModel"],[3,"isClearable","options"],["type","text",3,"ngModelChange","ngModel"],["footer",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"click"]]},template:function(n,e){n&1&&(a(0,"header")(1,"h3"),g(2,0),_(),a(3,"p"),g(4,1),_()(),a(5,"div",6)(6,"div",7)(7,"div",8)(8,"label"),g(9,2),_(),a(10,"sh-form-field")(11,"input",9),c("paste",function(s){return e.cleanupInputAfterPasting(s)})("keydown",function(s){return e.blockDecimalKeys(s)}),$("ngModelChange",function(s){return b(e.maxUpload,s)||(e.maxUpload=s),s}),_()(),a(12,"sh-select",10)(13,"input",11),$("ngModelChange",function(s){return b(e.maxUploadUnit,s)||(e.maxUploadUnit=s),s}),_()()(),a(14,"div",8)(15,"label"),g(16,3),_(),a(17,"sh-form-field")(18,"input",9),c("paste",function(s){return e.cleanupInputAfterPasting(s)})("keydown",function(s){return e.blockDecimalKeys(s)}),$("ngModelChange",function(s){return b(e.maxDownload,s)||(e.maxDownload=s),s}),_()(),a(19,"sh-select",10)(20,"input",11),$("ngModelChange",function(s){return b(e.maxDownloadUnit,s)||(e.maxDownloadUnit=s),s}),_()()()()(),a(21,"footer",12)(22,"button",13),c("click",function(){return e.closed.emit(!1)}),g(23,4),_(),a(24,"button",14),c("click",function(){return e.submit()}),g(25,5),_()()),n&2&&(r(11),y("ngModel",e.maxUpload),r(),P("isClearable",!1)("options",e.sizeOptions()),r(),y("ngModel",e.maxUploadUnit),r(5),y("ngModel",e.maxDownload),r(),P("isClearable",!1)("options",e.sizeOptions()),r(),y("ngModel",e.maxDownloadUnit),r(4),f("loader",e.isSubmitting()))},dependencies:[w,pe,Ee,Ce,ge,Ne,fe,I],styles:['[_nghost-%COMP%]{display:block}h3[_ngcontent-%COMP%]{font:var(--title-30)}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;padding:1rem;gap:.5rem;margin-bottom:1rem}.column[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.field-row[_ngcontent-%COMP%]{display:grid;grid-template-areas:"label label" "input select";grid-template-columns:1fr auto;align-items:center;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%]{grid-area:input}.field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{grid-area:select}'],changeDetection:0})};function Qe(o,t){if(o&1&&(a(0,"div"),L(1),_(),S(2,"sh-progress-bar",12)),o&2){let n=E();r(),re("",n.statusData().actionText," - ",n.statusData().statusText),r(),P("value",n.statusData().progress*100)}}function et(o,t){if(o&1&&(a(0,"div",8),d(1,1),S(2,"sh-icon"),H(3,"relativeTime"),H(4,"date"),p(),_()),o&2){let n,e=E();r(4),se((n=e.nextBackup().backup)==null||n.Backup==null?null:n.Backup.Name)(Te(3,3,e.nextBackup().time))(ce(4,5,e.nextBackup().time,"shortTime")),ae(1)}}function tt(o,t){o&1&&(a(0,"div",8),g(1,2),_())}function nt(o,t){o&1&&(a(0,"div",9),d(1,3),S(2,"sh-spinner"),p(),_()),o&2&&(r(2),_e("--spinner-size","12px")("--spinner-thickness","2px"))}function it(o,t){o&1&&S(0,"app-remote-connectivity-status")}function ot(o,t){if(o&1){let n=A();a(0,"button",11),c("click",function(){F(n);let i=E(2);return m(i.abort())}),d(1,4),S(2,"sh-icon"),p(),_()}}function st(o,t){if(o&1){let n=A();a(0,"button",11),c("click",function(){F(n);let i=E(2);return m(i.stop())}),d(1,5),S(2,"sh-icon"),p(),_()}}function at(o,t){if(o&1&&O(0,ot,3,0,"button",13)(1,st,3,0,"button",13),o&2){let n=E();N(n.isStopping()?0:1)}}function _t(o,t){o&1&&(d(0,0,1),S(1,"sh-icon"),p())}function lt(o,t){o&1&&(d(0,0,2),S(1,"sh-icon"),p())}var Ue=new Date,ee=class o{#e=C(M);#t=C(ve);#n=C(me);#a=C(he);#i=C(de);#_=C(Ie);#o=C(Me);#l=C(Le);minsAgo=Ue.setMinutes(Ue.getMinutes()-1);statusData=this.#t.statusData;serverState=this.#t.serverState;clientIsRunning=this.#t.clientIsRunning;isResuming=this.#t.isResuming;runningTask=G(()=>this.#o.serverState()?.ActiveTask?.Item1);isStopping=G(()=>this.runningTask()==this.#s());#s=u(-1);pgState=G(()=>this.#o.serverState());isUsingRelay=this.#i.relayIsEnabled;hideConsoleConnectionStatus=this.#l.isConsoleConnectionStatusHidden;nextBackup=G(()=>{let t=this.#a.backups();return{backup:this.serverState()?.ProposedSchedule?.[0]?.backup,time:this.serverState()?.ProposedSchedule?.[0]?.Item2}});openThrottleSettingsDialog(){this.#n.open(k,{maxWidth:"550px",width:"100%"})}openPauseDialog(){this.#n.open(z,{maxWidth:"550px",width:"100%"})}pauseResume(){if(this.clientIsRunning()){this.openPauseDialog();return}this.#t.pauseResume().subscribe()}stop(){let t=this.runningTask();t&&(this.#s.set(t),this.#e.postApiV1TaskByTaskidStop({taskid:t}).subscribe())}abort(){let t=this.runningTask();t&&this.#e.postApiV1TaskByTaskidAbort({taskid:t}).subscribe()}ngAfterViewInit(){let t=this.#i.relayIsEnabled()||!this.#_.hasWebSocket()?"longpoll":"websocket";this.#t.setConnectionMethod(t)}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=D({type:o,selectors:[["app-status-bar"]],decls:16,vars:6,consts:()=>{let t;t=$localize`${"\uFFFD*11: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/*11:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*12: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/*12:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,t=v(t);let n;n=$localize` ${"\uFFFD0\uFFFD"}:INTERPOLATION: - ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:clock${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD1\uFFFD"}:INTERPOLATION_1: at ${"\uFFFD2\uFFFD"}:INTERPOLATION_2: `;let e;e=$localize`No scheduled tasks`;let i;i=$localize` Loading ${"\uFFFD#2\uFFFD"}:START_TAG_SH_SPINNER:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_SPINNER:`;let s;s=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:skull${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Abort `;let T;return T=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:stop${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Stop `,[t,n,e,i,s,T,[1,"current-backup"],[1,"current-backup-progress"],[1,"label"],[1,"label","label-loading"],[1,"current-backup-actions"],["shButton","",3,"click"],[1,"raised","primary",3,"value"],["shButton",""]]},template:function(n,e){if(n&1&&(a(0,"div",6)(1,"div",7),O(2,Qe,3,3)(3,et,5,8,"div",8)(4,tt,2,0,"div",8)(5,nt,3,4,"div",9),_(),a(6,"div",10),O(7,it,1,0,"app-remote-connectivity-status"),O(8,at,2,1),a(9,"button",11),c("click",function(){return e.pauseResume()}),d(10,0),O(11,_t,2,0)(12,lt,2,0),p(),_(),a(13,"button",11),c("click",function(){return e.openThrottleSettingsDialog()}),a(14,"sh-icon"),L(15,"speedometer"),_()()()()),n&2){let i;r(2),N((i=e.serverState())!=null&&i.ActiveTask&&(!((i=e.statusData())==null||i.task==null)&&i.task.Status)&&((i=e.statusData())==null||i.task==null?null:i.task.Status)!=="Completed"?2:e.nextBackup().backup||e.nextBackup().time?3:(i=e.serverState())!=null&&i.ActiveTask?5:4),r(5),N(!e.isUsingRelay()&&!e.hideConsoleConnectionStatus()?7:-1),r(),N(e.runningTask()?8:-1),r(),f("loader",e.isResuming()),r(2),N(e.clientIsRunning()?11:12)}},dependencies:[B,V,I,Pe,Ae,be,ue],styles:["[_nghost-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1rem;min-height:3.875rem;border-bottom:1px solid var(--base-4);position:sticky;top:0;z-index:2000;background:var(--base-1)}.current-backup[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;width:100%;gap:.5rem}.current-backup-progress[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;min-width:18.75rem;flex:1 0}.current-backup-progress[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{max-width:18.75rem;width:100%}.current-backup-progress[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.current-backup-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.label-loading[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.25rem}"],changeDetection:0})};export{ee as a};
@@ -1 +1 @@
1
- import{a as De,b as he,d as Oe,e as fe}from"./chunk-5YSRDRTE.js";import"./chunk-AS6Z56AD.js";import{b as Ee,c as Ie}from"./chunk-IW4RDAIN.js";import{j as me}from"./chunk-XADL5RYU.js";import"./chunk-O4OTZE5N.js";import"./chunk-WIVARGP6.js";import"./chunk-MHRECQ5Y.js";import"./chunk-6Q6SSTBK.js";import"./chunk-LFISHZZP.js";import"./chunk-ME77WZZI.js";import{a as D}from"./chunk-5DJAX2HH.js";import"./chunk-6ALGXRIS.js";import"./chunk-DW332N2S.js";import"./chunk-AABUGLWU.js";import"./chunk-TELPJYLN.js";import"./chunk-5QZIKR6A.js";import{B as Se,H as Ne,K as pe,c as ae,e as se,f as re,g as le,i as _e,j as ce,r as Te,s as ue,u as ge,w as de,y as Fe,z as Ce}from"./chunk-HPNLQHW6.js";import"./chunk-BGTK25UG.js";import{b as ie,d as oe}from"./chunk-A4LPGPDU.js";import"./chunk-PKPBSTZA.js";import"./chunk-QPTSKQZ2.js";import"./chunk-OTPG7USH.js";import"./chunk-TT3S63BX.js";import{$ as T,Ab as r,Bb as F,Fb as Q,Gb as Y,Ib as p,Mc as U,Pa as _,Pb as g,Qb as d,Rb as E,Sb as R,Sc as ne,Tb as y,Ub as q,Vb as N,W as I,Xb as l,aa as u,cb as j,cc as Z,da as W,dc as ee,jc as L,la as O,oc as f,pc as A,qc as P,rc as x,sb as C,sc as G,tb as S,tc as M,xc as te,yb as m,zb as s}from"./chunk-T2WO6CVD.js";import"./chunk-7CGTOI24.js";var Ae=["formRef"],Pe=()=>({maxWidth:"700px",width:"100%"});function Me(t,n){t&1&&E(0,4,1)}function $e(t,n){t&1&&E(0,4,2)}function Re(t,n){if(t&1){let e=p();s(0,"button",35),N("click",function(){T(e);let o=l();return u(o.testDestination(0,!0))}),g(1,4),C(2,Me,1,0)(3,$e,1,0),d(),r()}if(t&2){let e=l();m("disabled",e.testSignal()=="testing"),_(2),S(e.testSignal()=="testing"?2:3)}}function ye(t,n){if(t&1){let e=p();s(0,"button",36),N("click",function(){T(e);let o=l();return u(o.openTargetUrlDialog())}),g(1,5),F(2,"sh-icon"),d(),r()}}function Le(t,n){if(t&1){let e=p();s(0,"button",36),N("click",function(){T(e);let o=l(2);return u(o.copyTargetUrl())}),g(1,7),F(2,"sh-icon"),d(),r()}}function xe(t,n){if(t&1){let e=p();s(0,"sh-menu")(1,"button",24)(2,"sh-icon"),L(3,"dots-three-vertical"),r()(),Q(4,37),s(5,"button",36),N("click",function(){T(e);let o=l();return u(o.openTargetUrlDialog())}),g(6,6),F(7,"sh-icon"),d(),r(),C(8,Le,3,0,"button",24),Y(),r()}if(t&2){l();let e=M(0);_(8),S(e?8:-1)}}function Ge(t,n){t&1&&(s(0,"sh-alert"),g(1,8),F(2,"sh-icon",38),d(),r())}function Ue(t,n){t&1&&(s(0,"sh-alert",25),g(1,9),F(2,"sh-icon",38),d(),r())}function we(t,n){if(t&1&&(s(0,"sh-alert",26),g(1,10),F(2,"sh-icon",38),d(),r()),t&2){let e=l();_(2),R(e.testErrorMessage()),y(1)}}function Be(t,n){if(t&1&&(s(0,"sh-alert",27),g(1,11),F(2,"sh-icon",38),d(),r()),t&2){let e=l();_(2),R(e.testErrorMessage()),y(1)}}function be(t,n){if(t&1){let e=p();s(0,"app-destination-list-item",28)(1,"button",31),N("click",function(){T(e);let o=l();return u(o.removeDestination())}),E(2,12),r()()}if(t&2){l();let e=M(18);m("destination",e)}}function ke(t,n){if(t&1){let e=p();s(0,"app-destination-list",39),N("setDestination",function(o){T(e);let a=l();return u(a.setDestination(o))}),r()}}function ve(t,n){if(t&1){let e=p();s(0,"app-single-destination",40),P("targetUrlChange",function(o){T(e);let a=l();return A(a.targetUrlModel,o)||(a.targetUrlModel=o),u(o)}),r()}if(t&2){let e=l();f("targetUrl",e.targetUrlModel),m("useBackupState",!0)}}function Ke(t,n){t&1&&(g(0,3,1),F(1,"sh-icon",33),d())}function Ve(t,n){t&1&&(g(0,3,2),F(1,"sh-icon"),d())}function ze(t,n){t&1&&(s(0,"h2"),E(1,15),r())}function Je(t,n){t&1&&(s(0,"h2"),E(1,16),r())}function Xe(t,n){if(t&1){let e=p();s(0,"sh-dialog",41),P("isOpenChange",function(o){T(e);let a=l();return A(a.targetUrlDialogOpen,o)||(a.targetUrlDialogOpen=o),u(o)}),s(1,"header",42)(2,"div",43),C(3,ze,2,0,"h2")(4,Je,2,0,"h2"),s(5,"sh-alert",26),E(6,13),r()()(),s(7,"div",44)(8,"sh-form-field")(9,"textarea",45),P("ngModelChange",function(o){T(e);let a=l();return A(a.targetUrlCtrl,o)||(a.targetUrlCtrl=o),u(o)}),r()()(),s(10,"footer",46)(11,"button",31),N("click",function(){T(e);let o=l();return u(o.closeTargetUrlDialog(!1))}),L(12,"Cancel"),r(),s(13,"button",47),N("click",function(){T(e);let o=l();return u(o.closeTargetUrlDialog(!0))}),g(14,14),F(15,"sh-icon"),d(),r()()()}if(t&2){let e=l(),i=M(0);f("isOpen",e.targetUrlDialogOpen),m("options",te(4,Pe)),_(3),S(i?4:3),_(6),f("ngModel",e.targetUrlCtrl)}}var $=new Te,Tt=(t={destinations:[]})=>$.group({destinations:$.array(t.destinations)}),ut=({key:t,customGroup:n,dynamicGroup:e,advancedGroup:i})=>$.group({destinationType:$.control(t),custom:n,dynamic:e,advanced:i}),w=class t{#i=I(oe);#o=I(ie);#e=I(me);#t=I(Ce);#a=I(De);injector=I(W);formRef=ne.required("formRef");targetUrlModel=this.#e.targetUrlModel;targetUrlCtrl=O(null);targetUrlInitial=O(null);targetUrlDialogOpen=O(!1);toggleNewDestination=O(!0);testSignal=this.#e.testSignal;testErrorMessage=this.#e.testErrorMessage;selectedDestinationType=U(()=>{let n=this.targetUrlModel();return n?Ee(n)??null:null});selectedDestinationTypeOption=U(()=>{let n=this.selectedDestinationType();return n?{key:n.customKey??n.key,customKey:n.customKey??null,displayName:n.displayName,description:n.description,icon:n.icon}:null});copyTargetUrl(){navigator.clipboard.writeText(this.targetUrlModel()??"")}openTargetUrlDialog(){let n=this.targetUrlModel();this.targetUrlCtrl.set(n),this.targetUrlInitial.set(n),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(n=!1){this.targetUrlDialogOpen.set(!1);let e=this.targetUrlCtrl(),i=this.targetUrlInitial();!n||e===i||!e||this.#e.setTargetUrl(e)}testDestination(n,e,i){let o=this.targetUrlModel();o&&(this.#e.setTestState("testing"),this.#a.testDestination(o,this.#e.backupId(),n,!0,!0).subscribe({next:a=>{if(a.action==="success"){this.#e.setTestState("success"),this.#e.isNew()&&(a.containsBackup===!0?(this.#e.setTestState("warning",$localize`The remote destination already contains a backup. Please use a different folder for each backup.`),e||this.#t.open(D,{data:{title:$localize`Folder contains backup`,message:$localize`The remote destination already contains a backup. You must use a different folder for each backup.`,confirmText:$localize`OK`,cancelText:void 0}})):a.anyFilesFound===!0&&(this.#e.setTestState("warning",$localize`The remote destination contains unknown files.`),e||this.#t.open(D,{data:{title:$localize`Folder is not empty`,message:$localize`The remote destination is not empty. It is recommended to use an empty folder for the backup.`,confirmText:$localize`OK`,cancelText:void 0}}))),i?.();return}if(this.#e.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){i?.();return}let h=o.includes("?");a.action==="trust-cert"&&this.#e.setTargetUrl(o+`${h?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#e.setTargetUrl(o+`${h?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,e):i?.()}}))}setDestination(n){let e=Ie(n??"");if(e){if(e.mapper.default){let i=e.mapper.default(this.#e.backupName()??"");this.#e.setTargetUrl(i,!0);return}this.#e.setTargetUrl(`${n}://`,!0)}}removeDestination(){this.#e.setTargetUrl(null,!0)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let n=this.#e.isNew(),e=this.testSignal();if(!n){this.#n();return}if(e===""){this.#t.open(D,{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:i=>{i?this.testDestination(0,!1,()=>{this.testSignal()==="success"?this.#n():this.#t.open(D,{data:{title:$localize`Test did not succeed`,message:this.testErrorMessage()??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#n()}});return}if(e!=="success"){this.#t.open(D,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Yes, continue`,cancelText:$localize`Cancel`},closed:i=>{i&&this.#n()}});return}this.#n()}#n(){this.#e.isNew()||this.#e.submit(!0),this.#i.navigate(["source-data"],{relativeTo:this.#o.parent})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=j({type:t,selectors:[["app-destination"]],viewQuery:function(e,i){e&1&&Z(i.formRef,Ae,5),e&2&&ee()},decls:31,vars:11,consts:()=>{let n;n=$localize`Backup destination`;let e;e=$localize`${"\uFFFD#25\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#25\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let i;i=$localize`${"\uFFFD*28: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/*28:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*29: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/*29:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,i=q(i);let o;o=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF: Testing... ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE: Test destination ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`;let a;a=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Set target URL `;let h;h=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: Edit target URL `;let B;B=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:copy${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Copy URL to clipboard `;let b;b=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Testing connection... `;let k;k=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:check${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Connection tested successfully. `;let v;v=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let K;K=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let V;V=$localize`Change`;let z;z=$localize`Be careful, this will overwrite everything you have in your destination.`;let J;J=$localize` Override target URL ${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON:`;let X;X=$localize`Set target URL`;let H;return H=$localize`Edit target URL`,[["formRef",""],n,e,i,o,a,h,B,b,k,v,K,V,z,J,X,H,["autocomplete","off",3,"submit"],[2,"position","absolute","left","-9999px","width","1px","height","1px","overflow","hidden"],["type","text","name","fake_email","tabindex","-1"],["type","password","name","fake_password","tabindex","-1"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small",3,"disabled"],["shButton","","type","button",1,"small"],[1,"success"],[1,"warn"],[1,"error"],[1,"current-destination",3,"destination"],[3,"targetUrl","useBackupState"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click","disabled"],["shButton","","type","button",1,"small",3,"click"],["menu",""],["icon",""],[3,"setDestination"],[3,"targetUrlChange","targetUrl","useBackupState"],[3,"isOpenChange","isOpen","options"],["header",""],[1,"target-dialog-header"],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(e,i){if(e&1){let o=p();x(0),s(1,"form",17,0),N("submit",function(){return T(o),u(i.next())}),s(3,"div",18),F(4,"input",19)(5,"input",20),r(),s(6,"header")(7,"h3",21)(8,"span"),E(9,1),r(),s(10,"div",22),C(11,Re,4,2,"button",23),C(12,ye,3,0,"button",24)(13,xe,9,1,"sh-menu"),r()(),C(14,Ge,3,0,"sh-alert")(15,Ue,3,0,"sh-alert",25)(16,we,3,1,"sh-alert",26)(17,Be,3,1,"sh-alert",27),x(18),C(19,be,3,1,"app-destination-list-item",28),r(),C(20,ke,1,0,"app-destination-list"),C(21,ve,1,2,"app-single-destination",29),s(22,"div",30)(23,"button",31),N("click",function(){return T(o),u(i.goBack())}),g(24,2),F(25,"sh-icon"),d(),r(),s(26,"button",32),g(27,3),C(28,Ke,2,0,"sh-icon",33)(29,Ve,2,0,"sh-icon"),d(),r()()(),C(30,Xe,16,5,"sh-dialog",34)}if(e&2){let o=G(!!i.targetUrlModel());_(11),S(o?11:-1),_(),S(o?13:12),_(2),S(i.testSignal()=="testing"?14:i.testSignal()=="success"?15:i.testSignal()=="warning"?16:i.testSignal()=="error"?17:-1),_(4);let a=G(i.selectedDestinationTypeOption());_(),S(a?19:-1),_(),S(o?-1:20),_(),S(o?21:-1),_(5),m("disabled",i.testSignal()=="testing"||!o),_(2),S(i.testSignal()=="testing"?28:29),_(2),S(i.targetUrlDialogOpen()?30:-1)}},dependencies:[fe,Oe,he,ue,ce,ae,se,re,_e,le,Se,Ne,pe,ge,Fe,de],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem;padding:2.5rem 2.5rem 0}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;height:100%;padding:0 0 2.5rem}.current-destination[_ngcontent-%COMP%]{margin:1rem 0 0}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}.target-dialog-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:.5rem}"],changeDetection:0})};export{Tt as createDestinationForm,ut as createDestinationFormGroup,w as default};
1
+ import{a as De,b as he,d as Oe,e as fe}from"./chunk-7E34ZROH.js";import"./chunk-AS6Z56AD.js";import{b as Ee,c as Ie}from"./chunk-IW4RDAIN.js";import{j as me}from"./chunk-FPDCZ73R.js";import"./chunk-O4OTZE5N.js";import"./chunk-WIVARGP6.js";import"./chunk-MHRECQ5Y.js";import"./chunk-6Q6SSTBK.js";import"./chunk-WDMQH4ZC.js";import"./chunk-ME77WZZI.js";import{a as D}from"./chunk-5DJAX2HH.js";import"./chunk-IMDBR2SZ.js";import"./chunk-DW332N2S.js";import"./chunk-SJWKQCBL.js";import"./chunk-TELPJYLN.js";import"./chunk-G4SK3PS7.js";import{B as Se,H as Ne,K as pe,c as ae,e as se,f as re,g as le,i as _e,j as ce,r as Te,s as ue,u as ge,w as de,y as Fe,z as Ce}from"./chunk-HPNLQHW6.js";import"./chunk-BGTK25UG.js";import{b as ie,d as oe}from"./chunk-A4LPGPDU.js";import"./chunk-PKPBSTZA.js";import"./chunk-QPTSKQZ2.js";import"./chunk-OTPG7USH.js";import"./chunk-TT3S63BX.js";import{$ as T,Ab as r,Bb as F,Fb as Q,Gb as Y,Ib as p,Mc as U,Pa as _,Pb as g,Qb as d,Rb as E,Sb as R,Sc as ne,Tb as y,Ub as q,Vb as N,W as I,Xb as l,aa as u,cb as j,cc as Z,da as W,dc as ee,jc as L,la as O,oc as f,pc as A,qc as P,rc as x,sb as C,sc as G,tb as S,tc as M,xc as te,yb as m,zb as s}from"./chunk-T2WO6CVD.js";import"./chunk-7CGTOI24.js";var Ae=["formRef"],Pe=()=>({maxWidth:"700px",width:"100%"});function Me(t,n){t&1&&E(0,4,1)}function $e(t,n){t&1&&E(0,4,2)}function Re(t,n){if(t&1){let e=p();s(0,"button",35),N("click",function(){T(e);let o=l();return u(o.testDestination(0,!0))}),g(1,4),C(2,Me,1,0)(3,$e,1,0),d(),r()}if(t&2){let e=l();m("disabled",e.testSignal()=="testing"),_(2),S(e.testSignal()=="testing"?2:3)}}function ye(t,n){if(t&1){let e=p();s(0,"button",36),N("click",function(){T(e);let o=l();return u(o.openTargetUrlDialog())}),g(1,5),F(2,"sh-icon"),d(),r()}}function Le(t,n){if(t&1){let e=p();s(0,"button",36),N("click",function(){T(e);let o=l(2);return u(o.copyTargetUrl())}),g(1,7),F(2,"sh-icon"),d(),r()}}function xe(t,n){if(t&1){let e=p();s(0,"sh-menu")(1,"button",24)(2,"sh-icon"),L(3,"dots-three-vertical"),r()(),Q(4,37),s(5,"button",36),N("click",function(){T(e);let o=l();return u(o.openTargetUrlDialog())}),g(6,6),F(7,"sh-icon"),d(),r(),C(8,Le,3,0,"button",24),Y(),r()}if(t&2){l();let e=M(0);_(8),S(e?8:-1)}}function Ge(t,n){t&1&&(s(0,"sh-alert"),g(1,8),F(2,"sh-icon",38),d(),r())}function Ue(t,n){t&1&&(s(0,"sh-alert",25),g(1,9),F(2,"sh-icon",38),d(),r())}function we(t,n){if(t&1&&(s(0,"sh-alert",26),g(1,10),F(2,"sh-icon",38),d(),r()),t&2){let e=l();_(2),R(e.testErrorMessage()),y(1)}}function Be(t,n){if(t&1&&(s(0,"sh-alert",27),g(1,11),F(2,"sh-icon",38),d(),r()),t&2){let e=l();_(2),R(e.testErrorMessage()),y(1)}}function be(t,n){if(t&1){let e=p();s(0,"app-destination-list-item",28)(1,"button",31),N("click",function(){T(e);let o=l();return u(o.removeDestination())}),E(2,12),r()()}if(t&2){l();let e=M(18);m("destination",e)}}function ke(t,n){if(t&1){let e=p();s(0,"app-destination-list",39),N("setDestination",function(o){T(e);let a=l();return u(a.setDestination(o))}),r()}}function ve(t,n){if(t&1){let e=p();s(0,"app-single-destination",40),P("targetUrlChange",function(o){T(e);let a=l();return A(a.targetUrlModel,o)||(a.targetUrlModel=o),u(o)}),r()}if(t&2){let e=l();f("targetUrl",e.targetUrlModel),m("useBackupState",!0)}}function Ke(t,n){t&1&&(g(0,3,1),F(1,"sh-icon",33),d())}function Ve(t,n){t&1&&(g(0,3,2),F(1,"sh-icon"),d())}function ze(t,n){t&1&&(s(0,"h2"),E(1,15),r())}function Je(t,n){t&1&&(s(0,"h2"),E(1,16),r())}function Xe(t,n){if(t&1){let e=p();s(0,"sh-dialog",41),P("isOpenChange",function(o){T(e);let a=l();return A(a.targetUrlDialogOpen,o)||(a.targetUrlDialogOpen=o),u(o)}),s(1,"header",42)(2,"div",43),C(3,ze,2,0,"h2")(4,Je,2,0,"h2"),s(5,"sh-alert",26),E(6,13),r()()(),s(7,"div",44)(8,"sh-form-field")(9,"textarea",45),P("ngModelChange",function(o){T(e);let a=l();return A(a.targetUrlCtrl,o)||(a.targetUrlCtrl=o),u(o)}),r()()(),s(10,"footer",46)(11,"button",31),N("click",function(){T(e);let o=l();return u(o.closeTargetUrlDialog(!1))}),L(12,"Cancel"),r(),s(13,"button",47),N("click",function(){T(e);let o=l();return u(o.closeTargetUrlDialog(!0))}),g(14,14),F(15,"sh-icon"),d(),r()()()}if(t&2){let e=l(),i=M(0);f("isOpen",e.targetUrlDialogOpen),m("options",te(4,Pe)),_(3),S(i?4:3),_(6),f("ngModel",e.targetUrlCtrl)}}var $=new Te,Tt=(t={destinations:[]})=>$.group({destinations:$.array(t.destinations)}),ut=({key:t,customGroup:n,dynamicGroup:e,advancedGroup:i})=>$.group({destinationType:$.control(t),custom:n,dynamic:e,advanced:i}),w=class t{#i=I(oe);#o=I(ie);#e=I(me);#t=I(Ce);#a=I(De);injector=I(W);formRef=ne.required("formRef");targetUrlModel=this.#e.targetUrlModel;targetUrlCtrl=O(null);targetUrlInitial=O(null);targetUrlDialogOpen=O(!1);toggleNewDestination=O(!0);testSignal=this.#e.testSignal;testErrorMessage=this.#e.testErrorMessage;selectedDestinationType=U(()=>{let n=this.targetUrlModel();return n?Ee(n)??null:null});selectedDestinationTypeOption=U(()=>{let n=this.selectedDestinationType();return n?{key:n.customKey??n.key,customKey:n.customKey??null,displayName:n.displayName,description:n.description,icon:n.icon}:null});copyTargetUrl(){navigator.clipboard.writeText(this.targetUrlModel()??"")}openTargetUrlDialog(){let n=this.targetUrlModel();this.targetUrlCtrl.set(n),this.targetUrlInitial.set(n),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(n=!1){this.targetUrlDialogOpen.set(!1);let e=this.targetUrlCtrl(),i=this.targetUrlInitial();!n||e===i||!e||this.#e.setTargetUrl(e)}testDestination(n,e,i){let o=this.targetUrlModel();o&&(this.#e.setTestState("testing"),this.#a.testDestination(o,this.#e.backupId(),n,!0,!0).subscribe({next:a=>{if(a.action==="success"){this.#e.setTestState("success"),this.#e.isNew()&&(a.containsBackup===!0?(this.#e.setTestState("warning",$localize`The remote destination already contains a backup. Please use a different folder for each backup.`),e||this.#t.open(D,{data:{title:$localize`Folder contains backup`,message:$localize`The remote destination already contains a backup. You must use a different folder for each backup.`,confirmText:$localize`OK`,cancelText:void 0}})):a.anyFilesFound===!0&&(this.#e.setTestState("warning",$localize`The remote destination contains unknown files.`),e||this.#t.open(D,{data:{title:$localize`Folder is not empty`,message:$localize`The remote destination is not empty. It is recommended to use an empty folder for the backup.`,confirmText:$localize`OK`,cancelText:void 0}}))),i?.();return}if(this.#e.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){i?.();return}let h=o.includes("?");a.action==="trust-cert"&&this.#e.setTargetUrl(o+`${h?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#e.setTargetUrl(o+`${h?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,e):i?.()}}))}setDestination(n){let e=Ie(n??"");if(e){if(e.mapper.default){let i=e.mapper.default(this.#e.backupName()??"");this.#e.setTargetUrl(i,!0);return}this.#e.setTargetUrl(`${n}://`,!0)}}removeDestination(){this.#e.setTargetUrl(null,!0)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let n=this.#e.isNew(),e=this.testSignal();if(!n){this.#n();return}if(e===""){this.#t.open(D,{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:i=>{i?this.testDestination(0,!1,()=>{this.testSignal()==="success"?this.#n():this.#t.open(D,{data:{title:$localize`Test did not succeed`,message:this.testErrorMessage()??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#n()}});return}if(e!=="success"){this.#t.open(D,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Yes, continue`,cancelText:$localize`Cancel`},closed:i=>{i&&this.#n()}});return}this.#n()}#n(){this.#e.isNew()||this.#e.submit(!0),this.#i.navigate(["source-data"],{relativeTo:this.#o.parent})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=j({type:t,selectors:[["app-destination"]],viewQuery:function(e,i){e&1&&Z(i.formRef,Ae,5),e&2&&ee()},decls:31,vars:11,consts:()=>{let n;n=$localize`Backup destination`;let e;e=$localize`${"\uFFFD#25\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#25\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let i;i=$localize`${"\uFFFD*28: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/*28:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*29: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/*29:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,i=q(i);let o;o=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF: Testing... ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE: Test destination ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`;let a;a=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Set target URL `;let h;h=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: Edit target URL `;let B;B=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:copy${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Copy URL to clipboard `;let b;b=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Testing connection... `;let k;k=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:check${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Connection tested successfully. `;let v;v=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let K;K=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let V;V=$localize`Change`;let z;z=$localize`Be careful, this will overwrite everything you have in your destination.`;let J;J=$localize` Override target URL ${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON:`;let X;X=$localize`Set target URL`;let H;return H=$localize`Edit target URL`,[["formRef",""],n,e,i,o,a,h,B,b,k,v,K,V,z,J,X,H,["autocomplete","off",3,"submit"],[2,"position","absolute","left","-9999px","width","1px","height","1px","overflow","hidden"],["type","text","name","fake_email","tabindex","-1"],["type","password","name","fake_password","tabindex","-1"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small",3,"disabled"],["shButton","","type","button",1,"small"],[1,"success"],[1,"warn"],[1,"error"],[1,"current-destination",3,"destination"],[3,"targetUrl","useBackupState"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click","disabled"],["shButton","","type","button",1,"small",3,"click"],["menu",""],["icon",""],[3,"setDestination"],[3,"targetUrlChange","targetUrl","useBackupState"],[3,"isOpenChange","isOpen","options"],["header",""],[1,"target-dialog-header"],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(e,i){if(e&1){let o=p();x(0),s(1,"form",17,0),N("submit",function(){return T(o),u(i.next())}),s(3,"div",18),F(4,"input",19)(5,"input",20),r(),s(6,"header")(7,"h3",21)(8,"span"),E(9,1),r(),s(10,"div",22),C(11,Re,4,2,"button",23),C(12,ye,3,0,"button",24)(13,xe,9,1,"sh-menu"),r()(),C(14,Ge,3,0,"sh-alert")(15,Ue,3,0,"sh-alert",25)(16,we,3,1,"sh-alert",26)(17,Be,3,1,"sh-alert",27),x(18),C(19,be,3,1,"app-destination-list-item",28),r(),C(20,ke,1,0,"app-destination-list"),C(21,ve,1,2,"app-single-destination",29),s(22,"div",30)(23,"button",31),N("click",function(){return T(o),u(i.goBack())}),g(24,2),F(25,"sh-icon"),d(),r(),s(26,"button",32),g(27,3),C(28,Ke,2,0,"sh-icon",33)(29,Ve,2,0,"sh-icon"),d(),r()()(),C(30,Xe,16,5,"sh-dialog",34)}if(e&2){let o=G(!!i.targetUrlModel());_(11),S(o?11:-1),_(),S(o?13:12),_(2),S(i.testSignal()=="testing"?14:i.testSignal()=="success"?15:i.testSignal()=="warning"?16:i.testSignal()=="error"?17:-1),_(4);let a=G(i.selectedDestinationTypeOption());_(),S(a?19:-1),_(),S(o?-1:20),_(),S(o?21:-1),_(5),m("disabled",i.testSignal()=="testing"||!o),_(2),S(i.testSignal()=="testing"?28:29),_(2),S(i.targetUrlDialogOpen()?30:-1)}},dependencies:[fe,Oe,he,ue,ce,ae,se,re,_e,le,Se,Ne,pe,ge,Fe,de],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem;padding:2.5rem 2.5rem 0}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;height:100%;padding:0 0 2.5rem}.current-destination[_ngcontent-%COMP%]{margin:1rem 0 0}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}.target-dialog-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:.5rem}"],changeDetection:0})};export{Tt as createDestinationForm,ut as createDestinationFormGroup,w as default};