@duplicati/ngclient 0.0.147 → 0.0.149

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 (34) hide show
  1. package/{chunk-AZ7AMASU.js → chunk-2RDLOXGA.js} +1 -1
  2. package/{chunk-NMJ4XJ6C.js → chunk-4EZ4GOK5.js} +1 -1
  3. package/{chunk-RUFE3SMI.js → chunk-5NRWNJ4J.js} +1 -1
  4. package/{chunk-QMTQBA5B.js → chunk-6EWMK5CH.js} +1 -1
  5. package/{chunk-DAYBMF7U.js → chunk-7ZTBW6LJ.js} +1 -1
  6. package/{chunk-WS76KLII.js → chunk-FUX6GJRD.js} +1 -1
  7. package/{chunk-23CWXAU4.js → chunk-FZTPUMUC.js} +1 -1
  8. package/chunk-GEI2CH2J.js +1 -0
  9. package/{chunk-2F6NVETW.js → chunk-GFMGDQOH.js} +1 -1
  10. package/chunk-GGPJKZ7T.js +1 -0
  11. package/{chunk-LBI35OS4.js → chunk-GWQAMFY2.js} +1 -1
  12. package/{chunk-7UZESCOY.js → chunk-HQO3ARLG.js} +1 -1
  13. package/{chunk-ZAIUME2O.js → chunk-HTBOWZJ4.js} +1 -1
  14. package/{chunk-4DNWEJIW.js → chunk-K56EDP42.js} +1 -1
  15. package/{chunk-Z6NPBMOP.js → chunk-LF7PTCJR.js} +1 -1
  16. package/{chunk-DEZMBIZH.js → chunk-NTZTXGGQ.js} +1 -1
  17. package/{chunk-QID36V67.js → chunk-OKM5JN2Q.js} +1 -1
  18. package/{chunk-HTMYJ6GV.js → chunk-PDM4HXOW.js} +1 -1
  19. package/{chunk-MNGZF3JM.js → chunk-QCISEYZT.js} +1 -1
  20. package/{chunk-PJLMDJTH.js → chunk-QEHNEYWY.js} +1 -1
  21. package/{chunk-B2D4QGDJ.js → chunk-QLYO56NW.js} +1 -1
  22. package/{chunk-XBWYEQIH.js → chunk-UIQIL2X6.js} +1 -1
  23. package/chunk-UM2R35PK.js +1 -0
  24. package/{chunk-G5FQY6XS.js → chunk-V5JXHJUD.js} +1 -1
  25. package/{chunk-MQI3XY6Q.js → chunk-VGUK4FJP.js} +1 -1
  26. package/{chunk-62QANGOE.js → chunk-X7ZE7U56.js} +2 -2
  27. package/{chunk-EVUH6UI7.js → chunk-YTYCTAUZ.js} +1 -1
  28. package/{chunk-CMON2THK.js → chunk-ZUBWG65U.js} +1 -1
  29. package/index.html +1 -1
  30. package/{main-USVDGYE2.js → main-JAKX2A32.js} +1 -1
  31. package/package.json +1 -1
  32. package/chunk-ESUPNSKH.js +0 -1
  33. package/chunk-WODA6N4N.js +0 -1
  34. package/chunk-X35RIHQ2.js +0 -1
@@ -1,3 +1,3 @@
1
- import{a as Ee}from"./chunk-4DNWEJIW.js";import"./chunk-TK5QY2QD.js";import{a as fe}from"./chunk-NJEX2N4Q.js";import{h as T}from"./chunk-MQI3XY6Q.js";import"./chunk-23CWXAU4.js";import{a as Se}from"./chunk-DDWLL7XA.js";import"./chunk-2QJC4PGQ.js";import{b as h}from"./chunk-O64ZZGQZ.js";import{a as le}from"./chunk-6LTGTS6B.js";import"./chunk-DVDTYV66.js";import"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import{c as se,e as me,f as de,j as _e,n as ce,o as ue,p as pe,q as Ce,r as ge,s as Ne,t as Me}from"./chunk-N5SC4SKW.js";import"./chunk-Z3EPZZGY.js";import"./chunk-UKQFDBNO.js";import{b as q,d as J,e as Q}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as Y,e as Z,g as ee,k as te,l as ne,p as ie,t as oe}from"./chunk-H7K35UUX.js";import{g as ae,h as re}from"./chunk-NOPMCS2Z.js";import"./chunk-TDKBGGNK.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-6OPAGPKF.js";import{Ab as a,Bb as n,Cb as r,Gb as F,Hb as A,Jb as v,Pc as j,Qb as N,Ra as m,Rb as M,Sb as u,Tb as G,Ub as U,Wb as x,Yb as f,_ as c,bb as $,ea as S,fa as E,ic as w,oa as L,qc as K,rc as X,sc as V,ub as b,vb as k,wb as B,xb as R,xc as z,yb as y,yc as H,zb as C,zc as W}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var Fe=()=>["backup"];function Ae(l,t){l&1&&r(0,"sh-progress-bar",12)}function he(l,t){if(l&1&&(a(0,"sh-form-field"),r(1,"input",32),n()),l&2){let e=t.$implicit,s=t.$index;m(),C("id",z("filter-",s))("formControl",e)}}function Te(l,t){if(l&1){let e=v();a(0,"form",13)(1,"sh-select",14)(2,"label",15),u(3,1),n(),r(4,"input",16),n(),a(5,"sh-form-field")(6,"label",17),u(7,2),n(),r(8,"textarea",18),n(),a(9,"sh-form-field")(10,"label",19),u(11,3),n(),r(12,"textarea",20),n()(),a(13,"sh-divider"),u(14,4),n(),a(15,"form",13)(16,"sh-form-field")(17,"label",21),u(18,5),n(),r(19,"input",22),n(),a(20,"sh-form-field")(21,"label",23),u(22,6),n(),r(23,"input",24),n(),a(24,"app-toggle-card",25),F(25,26),u(26,7),A(),F(27,27),R(28,he,2,3,"sh-form-field",null,B),A(),n()(),a(30,"p"),N(31,8),r(32,"a",28),M(),n(),a(33,"app-options-list",29),V("optionsChange",function(o){S(e);let p=f();return X(p.settings,o)||(p.settings=o),E(o)}),n(),a(34,"div",30)(35,"button",31),x("click",function(){S(e);let o=f();return E(o.submit())}),N(36,9),r(37,"sh-icon"),M(),n()()}if(l&2){let e=f();C("formGroup",e.baseCmdForm),m(),C("options",e.commandOptions()??W(10,Fe))("inlineSearch",!0),m(14),C("formGroup",e.standardFields),m(9),C("disallowToggle",!0),m(4),y(e.standardFields.controls.filters.controls),m(5),K("options",e.settings),C("hasFreeTextSettings",!0),m(2),w("loader",e.isSubmitting()),m(2),G(e.baseCmdForm.value.command),U(36)}}var d=new ge,O=class l{#e=c(T);#t=c(re);#n=c(J);#i=c(q);#o=c(ae);#a=c(le);#s=c(Z);#r=h(this.#i.params);commandOptions=h(this.#o.getApiV1Commandline());isSubmitting=L(!1);optionsFields=this.#e.optionsFields;standardFields=d.group({"backup-id":d.control(""),"backup-name":d.control(""),dbpath:d.control(""),filters:d.array([])});baseCmdForm=d.group({command:d.control("backup"),targetUrl:d.control(""),arguments:d.control("")});finishedLoading=this.#e.finishedLoading;backupId=this.#e.backupId;settings=this.#e.settings;#m=j(()=>{let t=this.#r()?.id;this.#e.backupId.set(t),this.getBackup(t)});getBackup(t){this.#t.getApiV1BackupById({id:t}).subscribe({next:e=>{this.#e.mapScheduleToForm(e.Schedule??null),e.Backup&&(this.#e.mapGeneralToForm(e.Backup),this.mapStandardFieldsToForm(e.Backup),this.mapBaseCmdToForm(e.Backup),this.#e.mapOptionsToForms(e.Backup)),this.#e.finishedLoading.set(!0)}})}mapStandardFieldsToForm(t){this.standardFields.patchValue({dbpath:t.DBPath,"backup-id":t.ID,"backup-name":t.Name}),t.Filters&&t.Filters.length&&t.Filters.map(e=>{this.standardFields.controls.filters.push(d.control(`${e.Include?"":"-"}${e.Expression}`))})}submit(){this.#a.resumeDialogCheck(()=>this.#l())}#l(){this.isSubmitting.set(!0);let t=this.baseCmdForm.value,e=t.targetUrl??"",s=t.arguments?.split(`
1
+ import{a as Ee}from"./chunk-K56EDP42.js";import"./chunk-TK5QY2QD.js";import{a as fe}from"./chunk-NJEX2N4Q.js";import{h as T}from"./chunk-VGUK4FJP.js";import"./chunk-FZTPUMUC.js";import{a as Se}from"./chunk-DDWLL7XA.js";import"./chunk-2QJC4PGQ.js";import{b as h}from"./chunk-O64ZZGQZ.js";import{a as le}from"./chunk-6LTGTS6B.js";import"./chunk-DVDTYV66.js";import"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import{c as se,e as me,f as de,j as _e,n as ce,o as ue,p as pe,q as Ce,r as ge,s as Ne,t as Me}from"./chunk-N5SC4SKW.js";import"./chunk-Z3EPZZGY.js";import"./chunk-UKQFDBNO.js";import{b as q,d as J,e as Q}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as Y,e as Z,g as ee,k as te,l as ne,p as ie,t as oe}from"./chunk-H7K35UUX.js";import{g as ae,h as re}from"./chunk-NOPMCS2Z.js";import"./chunk-TDKBGGNK.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-6OPAGPKF.js";import{Ab as a,Bb as n,Cb as r,Gb as F,Hb as A,Jb as v,Pc as j,Qb as N,Ra as m,Rb as M,Sb as u,Tb as G,Ub as U,Wb as x,Yb as f,_ as c,bb as $,ea as S,fa as E,ic as w,oa as L,qc as K,rc as X,sc as V,ub as b,vb as k,wb as B,xb as R,xc as z,yb as y,yc as H,zb as C,zc as W}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var Fe=()=>["backup"];function Ae(l,t){l&1&&r(0,"sh-progress-bar",12)}function he(l,t){if(l&1&&(a(0,"sh-form-field"),r(1,"input",32),n()),l&2){let e=t.$implicit,s=t.$index;m(),C("id",z("filter-",s))("formControl",e)}}function Te(l,t){if(l&1){let e=v();a(0,"form",13)(1,"sh-select",14)(2,"label",15),u(3,1),n(),r(4,"input",16),n(),a(5,"sh-form-field")(6,"label",17),u(7,2),n(),r(8,"textarea",18),n(),a(9,"sh-form-field")(10,"label",19),u(11,3),n(),r(12,"textarea",20),n()(),a(13,"sh-divider"),u(14,4),n(),a(15,"form",13)(16,"sh-form-field")(17,"label",21),u(18,5),n(),r(19,"input",22),n(),a(20,"sh-form-field")(21,"label",23),u(22,6),n(),r(23,"input",24),n(),a(24,"app-toggle-card",25),F(25,26),u(26,7),A(),F(27,27),R(28,he,2,3,"sh-form-field",null,B),A(),n()(),a(30,"p"),N(31,8),r(32,"a",28),M(),n(),a(33,"app-options-list",29),V("optionsChange",function(o){S(e);let p=f();return X(p.settings,o)||(p.settings=o),E(o)}),n(),a(34,"div",30)(35,"button",31),x("click",function(){S(e);let o=f();return E(o.submit())}),N(36,9),r(37,"sh-icon"),M(),n()()}if(l&2){let e=f();C("formGroup",e.baseCmdForm),m(),C("options",e.commandOptions()??W(10,Fe))("inlineSearch",!0),m(14),C("formGroup",e.standardFields),m(9),C("disallowToggle",!0),m(4),y(e.standardFields.controls.filters.controls),m(5),K("options",e.settings),C("hasFreeTextSettings",!0),m(2),w("loader",e.isSubmitting()),m(2),G(e.baseCmdForm.value.command),U(36)}}var d=new ge,O=class l{#e=c(T);#t=c(re);#n=c(J);#i=c(q);#o=c(ae);#a=c(le);#s=c(Z);#r=h(this.#i.params);commandOptions=h(this.#o.getApiV1Commandline());isSubmitting=L(!1);optionsFields=this.#e.optionsFields;standardFields=d.group({"backup-id":d.control(""),"backup-name":d.control(""),dbpath:d.control(""),filters:d.array([])});baseCmdForm=d.group({command:d.control("backup"),targetUrl:d.control(""),arguments:d.control("")});finishedLoading=this.#e.finishedLoading;backupId=this.#e.backupId;settings=this.#e.settings;#m=j(()=>{let t=this.#r()?.id;this.#e.backupId.set(t),this.getBackup(t)});getBackup(t){this.#t.getApiV1BackupById({id:t}).subscribe({next:e=>{this.#e.mapScheduleToForm(e.Schedule??null),e.Backup&&(this.#e.mapGeneralToForm(e.Backup),this.mapStandardFieldsToForm(e.Backup),this.mapBaseCmdToForm(e.Backup),this.#e.mapOptionsToForms(e.Backup)),this.#e.finishedLoading.set(!0)}})}mapStandardFieldsToForm(t){this.standardFields.patchValue({dbpath:t.DBPath,"backup-id":t.ID,"backup-name":t.Name}),t.Filters&&t.Filters.length&&t.Filters.map(e=>{this.standardFields.controls.filters.push(d.control(`${e.Include?"":"-"}${e.Expression}`))})}submit(){this.#a.resumeDialogCheck(()=>this.#l())}#l(){this.isSubmitting.set(!0);let t=this.baseCmdForm.value,e=t.targetUrl??"",s=t.arguments?.split(`
2
2
  `).filter(i=>i.length>0)??[],o=this.standardFields.value,p=o.filters??[],g=[t.command,e,...s,`--backup-name=${o["backup-name"]}`,`--dbpath=${o.dbpath}`,`--backup-id=${o["backup-id"]}`,...p.filter(i=>i).map(i=>i.startsWith("-")?`--exclude=${i?.slice(1)}`:`--include=${i}`),...this.#e.mapFormsToSettings(["backup-id","backup-name","dbpath"]).map(i=>`${i.Name.startsWith("--")?"":"--"}${i.Name}=${i.Value}`),"--disable-module=console-password-input"];this.#t.postApiV1Commandline({requestBody:g}).subscribe(i=>{i.Status==="OK"&&this.#n.navigate(["backup",this.backupId(),"commandline",i.ID])})}mapBaseCmdToForm(t){let e=t.TargetURL??null;e&&this.baseCmdForm.patchValue({targetUrl:e??"",arguments:t.Sources?.join(`
3
3
  `)??""})}static \u0275fac=function(e){return new(e||l)};static \u0275cmp=$({type:l,selectors:[["app-commandline"]],features:[H([T])],decls:8,vars:1,consts:()=>{let t;t=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let e;e=$localize`Command`;let s;s=$localize`TargetUrl`;let o;o=$localize`Commandline Arguments`;let p;p=$localize`Advanced options`;let g;g=$localize`Backup ID`;let i;i=$localize`Backup Name`;let P;P=$localize`Filters`;let I;I=$localize` The backups will be split up into multiple files called volumes. Here you can set the maximum size of the individual volume files. ${"\uFFFD#32\uFFFD"}:START_LINK:Read more${"\uFFFD/#32\uFFFD"}:CLOSE_LINK:`;let D;return D=$localize`${"\uFFFD#37\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#37\uFFFD"}:CLOSE_TAG_SH_ICON: Run "${"\uFFFD0\uFFFD"}:INTERPOLATION:" command now `,[t,e,s,o,p,g,i,P,I,D,[1,"back"],["type","button","shButton","","routerLink","/",1,"small"],[1,"indeterminate","primary"],[3,"formGroup"],["placeholder","Select a command...",3,"options","inlineSearch"],["for","command"],["type","text","id","command","formControlName","command"],["for","targetUrl"],["id","targetUrl","autocomplete","off","formControlName","targetUrl"],["for","arguments"],["id","arguments","autocomplete","off","formControlName","arguments"],["for","backup-id"],["id","backup-id","formControlName","backup-id"],["for","backup-name"],["id","backup-name","formControlName","backup-name"],[3,"disallowToggle"],["title",""],["content","","formGroupName","filters"],["href","#",1,"sh-primary"],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["shButton","",1,"raised","primary",3,"click"],[3,"id","formControl"]]},template:function(e,s){e&1&&(r(0,"app-status-bar"),a(1,"section")(2,"div",10)(3,"button",11),N(4,0),r(5,"sh-icon"),M(),n()(),b(6,Ae,1,0,"sh-progress-bar",12)(7,Te,38,11),n()),e&2&&(m(6),k(s.finishedLoading()?7:6))},dependencies:[Ne,_e,se,me,de,fe,Ee,Se,Me,ce,ue,Ce,pe,Q,ne,ee,te,oe,ie,Y],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;max-width:40rem;padding:2.5rem;gap:1.25rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}"],changeDetection:0})};export{O as default};
@@ -1 +1 @@
1
- import{a as le}from"./chunk-4DNWEJIW.js";import{a as ae}from"./chunk-TK5QY2QD.js";import{h as se}from"./chunk-MQI3XY6Q.js";import{c as ie}from"./chunk-23CWXAU4.js";import"./chunk-DDWLL7XA.js";import"./chunk-2QJC4PGQ.js";import"./chunk-O64ZZGQZ.js";import"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import{c as Z,e as J,i as ee,k as ne,s as te,t as oe}from"./chunk-N5SC4SKW.js";import{b as V,d as H}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as q,g as Y,l as Q,t as j}from"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import{Ab as t,Bb as i,Cb as g,Jb as F,Oc as I,Qb as S,Ra as c,Rb as O,Sb as r,Vc as W,Wb as M,Yb as p,_ as C,bb as x,ea as P,ec as G,fa as f,fc as K,ic as U,oa as v,qc as u,rc as d,sc as m,ub as h,vb as N,zb as T,zc as X}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var _e=["formRef"],re=()=>["--skip-files-larger-than","dblock-size","encryption-module","no-encryption","--no-encryption","compression-module","--exclude-files-attributes","keep-time","keep-versions","retention-policy"];function ce(s,l){s&1&&(S(0,1,1),g(1,"sh-icon",20),O())}function pe(s,l){s&1&&(t(0,"p",21),r(1,6),i())}function ue(s,l){s&1&&(t(0,"p"),r(1,7),i())}function de(s,l){if(s&1){let n=F();t(0,"p"),r(1,8),i(),t(2,"app-timespan",18),m("ngModelChange",function(a){P(n);let o=p();return d(o.optionsFields.backupRetentionTime,a)||(o.optionsFields.backupRetentionTime=a),f(a)}),t(3,"label",30),r(4,9),i()()}if(s&2){let n=p();c(2),T("customId","backupRetentionTime"),u("ngModel",n.optionsFields.backupRetentionTime)}}function me(s,l){if(s&1){let n=F();t(0,"p"),r(1,10),i(),t(2,"sh-form-field")(3,"label",31),r(4,11),i(),t(5,"input",32),m("ngModelChange",function(a){P(n);let o=p();return d(o.optionsFields.backupRetentionVersions,a)||(o.optionsFields.backupRetentionVersions=a),f(a)}),i()()}if(s&2){let n=p();c(5),u("ngModel",n.optionsFields.backupRetentionVersions)}}function Se(s,l){s&1&&(t(0,"p"),r(1,12),i())}function Oe(s,l){if(s&1){let n=F();t(0,"p"),r(1,13),i(),t(2,"sh-form-field")(3,"p"),r(4,14),i(),t(5,"label",33),r(6,15),i(),t(7,"input",34),m("ngModelChange",function(a){P(n);let o=p();return d(o.optionsFields.backupRetentionCustom,a)||(o.optionsFields.backupRetentionCustom=a),f(a)}),i()()}if(s&2){let n=p();c(7),u("ngModel",n.optionsFields.backupRetentionCustom)}}var Te=["Bytes","KB","MB","GB","TB","PB"],ge=[{value:"all",name:$localize`Keep all backups`},{value:"time",name:$localize`Delete backups that are older than`},{value:"versions",name:$localize`Keep a specific number of backups`},{value:"smart",name:$localize`Smart backup retention`},{value:"custom",name:$localize`Custom backup retention`}],Ce=1024*1024*1024*2,Pe=1024*1024*5,E=class s{#e=C(se);#n=C(H);#t=C(V);formRef=W.required("formRef");selectedOptions=this.#e.selectedOptions;nonSelectedOptions=this.#e.nonSelectedOptions;isSubmitting=this.#e.isSubmitting;settings=this.#e.settings;optionsFields=this.#e.optionsFields;applicationOptions=this.#e.applicationOptions;retentionOptions=v(ge);sizeSplit=I(()=>{let n=this.optionsFields.remoteVolumeSize().match(/^(\d+)(bytes|kb|mb|gb|tb|pb|b)$/i);return{value:n?parseInt(n[1],10):0,unit:n?n[2].toUpperCase():"MB"}});exceededVolumeSize=I(()=>{let l=this.sizeSplit().value,n=this.sizeSplit().unit;if(l==null||n===null||n===void 0)return!1;let e=l*Math.pow(1024,Te.indexOf(n));return e>Ce||e<Pe});goBack(){this.#n.navigate(["schedule"],{relativeTo:this.#t.parent})}submit(){this.#e.submit()}static \u0275fac=function(n){return new(n||s)};static \u0275cmp=x({type:s,selectors:[["app-advanced-options-settings"]],viewQuery:function(n,e){n&1&&G(e.formRef,_e,5),n&2&&K()},decls:30,vars:16,consts:()=>{let l;l=$localize`Options`;let n;n=$localize` Remote volume size ${"\uFFFD*7:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#1:1\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*7:1\uFFFD"}:CLOSE_BLOCK_IF:`;let e;e=$localize` The backups will be split up into multiple files called volumes. Here you can set the maximum size of the individual volume files. ${"\uFFFD#11\uFFFD"}:START_LINK: Read more ${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-square-out${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/#11\uFFFD"}:CLOSE_LINK:`;let a;a=$localize`Backup retention`;let o;o=$localize`${"\uFFFD#26\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#26\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let b;b=$localize`${"\uFFFD#29\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#29\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `;let A;A=$localize` The chosen size is outside the recommended range. This may cause performance issues, excessively large temporary files or other problems. `;let R;R=$localize`Nothing will be deleted. The backup size will grow with each change.`;let y;y=$localize`If at least one newer backup is found, all backups older than this date are deleted.`;let $;$=$localize`Time to keep versions`;let k;k=$localize`Once there are more backups than the specified number, the oldest backups are deleted.`;let w;w=$localize`Number of versions`;let D;D=$localize` Over time backups will be deleted automatically. There will remain one backup for each of the last 7 days, each of the last 4 weeks, each of the last 12 months. There will always be at least one remaining backup. `;let B;B=$localize` Enter a retention strategy manually. Placeholders are D/W/Y for days/weeks/years and U for unlimited. The syntax is: 7D:1D,4W:1W,36M:1M. This example keeps one backup for each of the next 7 days, one for each of the next 4 weeks, and one for each of the next 36 months. This can also be written as 1W:1D,1M:1W,3Y:1M. `;let L;L=$localize`Once there are more backups than the specified number, the oldest backups are deleted.`;let z;return z=$localize`Retention expression`,[l,n,e,a,o,b,A,R,y,$,k,w,D,B,L,z,[1,"title-30"],[1,"remote-volume-wrap"],[3,"ngModelChange","customId","ngModel"],["for","size"],[1,"warning"],[1,"warn"],["href","https://forum.duplicati.com/t/choosing-sizes-in-duplicati/17683","target","_blank",1,"sh-primary"],["suffix",""],["value","value","label","name",3,"options","inlineSearch","isClearable"],["type","text",3,"ngModelChange","ngModel"],[3,"optionsChange","options","applicationOptions","hasFreeTextSettings","hiddenOptions"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click"],["for","backupRetentionTime"],["for","backupRetentionVersions"],["type","number","id","backupRetentionVersions",3,"ngModelChange","ngModel"],["for","backupRetentionCustom"],["type","text","id","backupRetentionCustom",3,"ngModelChange","ngModel"]]},template:function(n,e){n&1&&(t(0,"section")(1,"h3",16),r(2,0),i(),t(3,"div",17)(4,"app-size",18),m("ngModelChange",function(o){return d(e.optionsFields.remoteVolumeSize,o)||(e.optionsFields.remoteVolumeSize=o),o}),t(5,"label",19),S(6,1),h(7,ce,2,0,"sh-icon",20),O(),i()(),h(8,pe,2,0,"p",21),t(9,"p"),S(10,2),t(11,"a",22),g(12,"sh-icon",23),i(),O(),i()(),t(13,"sh-select",24)(14,"label",19),r(15,3),i(),t(16,"input",25),m("ngModelChange",function(o){return d(e.optionsFields.backupRetention,o)||(e.optionsFields.backupRetention=o),o}),i()(),h(17,ue,2,0,"p")(18,de,5,2)(19,me,6,1)(20,Se,2,0,"p")(21,Oe,8,1),t(22,"app-options-list",26),m("optionsChange",function(o){return d(e.settings,o)||(e.settings=o),o}),i(),t(23,"div",27)(24,"button",28),M("click",function(){return e.goBack()}),S(25,4),g(26,"sh-icon"),O(),i(),t(27,"button",29),M("click",function(){return e.submit()}),S(28,5),g(29,"sh-icon"),O(),i()()()),n&2&&(c(4),T("customId","size"),u("ngModel",e.optionsFields.remoteVolumeSize),c(3),N(e.exceededVolumeSize()?7:-1),c(),N(e.exceededVolumeSize()?8:-1),c(5),T("options",e.retentionOptions())("inlineSearch",!0)("isClearable",!1),c(3),u("ngModel",e.optionsFields.backupRetention),c(),N(e.optionsFields.backupRetention()==="all"?17:e.optionsFields.backupRetention()==="time"?18:e.optionsFields.backupRetention()==="versions"?19:e.optionsFields.backupRetention()==="smart"?20:e.optionsFields.backupRetention()==="custom"?21:-1),c(5),u("options",e.settings),T("applicationOptions",e.applicationOptions())("hasFreeTextSettings",!0)("hiddenOptions",X(15,re)),c(5),U("loader",e.isSubmitting()))},dependencies:[te,Z,ne,J,ee,oe,le,Y,q,j,ie,ae,Q],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.form-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 2.5rem;gap:.5rem;align-items:flex-end}.remote-volume-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.remote-volume-wrap[_ngcontent-%COMP%] p.warning[_ngcontent-%COMP%]{color:#7d7d00}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.advanced-option[_ngcontent-%COMP%]{display:grid;gap:.5rem;grid-template-columns:1fr 1fr 2.5rem;align-items:flex-end}sh-select[_ngcontent-%COMP%]{--miw: p2r(120)}"],changeDetection:0})};export{E as default};
1
+ import{a as le}from"./chunk-K56EDP42.js";import{a as ae}from"./chunk-TK5QY2QD.js";import{h as se}from"./chunk-VGUK4FJP.js";import{c as ie}from"./chunk-FZTPUMUC.js";import"./chunk-DDWLL7XA.js";import"./chunk-2QJC4PGQ.js";import"./chunk-O64ZZGQZ.js";import"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import{c as Z,e as J,i as ee,k as ne,s as te,t as oe}from"./chunk-N5SC4SKW.js";import{b as V,d as H}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as q,g as Y,l as Q,t as j}from"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import{Ab as t,Bb as i,Cb as g,Jb as F,Oc as I,Qb as S,Ra as c,Rb as O,Sb as r,Vc as W,Wb as M,Yb as p,_ as C,bb as x,ea as P,ec as G,fa as f,fc as K,ic as U,oa as v,qc as u,rc as d,sc as m,ub as h,vb as N,zb as T,zc as X}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var _e=["formRef"],re=()=>["--skip-files-larger-than","dblock-size","encryption-module","no-encryption","--no-encryption","compression-module","--exclude-files-attributes","keep-time","keep-versions","retention-policy"];function ce(s,l){s&1&&(S(0,1,1),g(1,"sh-icon",20),O())}function pe(s,l){s&1&&(t(0,"p",21),r(1,6),i())}function ue(s,l){s&1&&(t(0,"p"),r(1,7),i())}function de(s,l){if(s&1){let n=F();t(0,"p"),r(1,8),i(),t(2,"app-timespan",18),m("ngModelChange",function(a){P(n);let o=p();return d(o.optionsFields.backupRetentionTime,a)||(o.optionsFields.backupRetentionTime=a),f(a)}),t(3,"label",30),r(4,9),i()()}if(s&2){let n=p();c(2),T("customId","backupRetentionTime"),u("ngModel",n.optionsFields.backupRetentionTime)}}function me(s,l){if(s&1){let n=F();t(0,"p"),r(1,10),i(),t(2,"sh-form-field")(3,"label",31),r(4,11),i(),t(5,"input",32),m("ngModelChange",function(a){P(n);let o=p();return d(o.optionsFields.backupRetentionVersions,a)||(o.optionsFields.backupRetentionVersions=a),f(a)}),i()()}if(s&2){let n=p();c(5),u("ngModel",n.optionsFields.backupRetentionVersions)}}function Se(s,l){s&1&&(t(0,"p"),r(1,12),i())}function Oe(s,l){if(s&1){let n=F();t(0,"p"),r(1,13),i(),t(2,"sh-form-field")(3,"p"),r(4,14),i(),t(5,"label",33),r(6,15),i(),t(7,"input",34),m("ngModelChange",function(a){P(n);let o=p();return d(o.optionsFields.backupRetentionCustom,a)||(o.optionsFields.backupRetentionCustom=a),f(a)}),i()()}if(s&2){let n=p();c(7),u("ngModel",n.optionsFields.backupRetentionCustom)}}var Te=["Bytes","KB","MB","GB","TB","PB"],ge=[{value:"all",name:$localize`Keep all backups`},{value:"time",name:$localize`Delete backups that are older than`},{value:"versions",name:$localize`Keep a specific number of backups`},{value:"smart",name:$localize`Smart backup retention`},{value:"custom",name:$localize`Custom backup retention`}],Ce=1024*1024*1024*2,Pe=1024*1024*5,E=class s{#e=C(se);#n=C(H);#t=C(V);formRef=W.required("formRef");selectedOptions=this.#e.selectedOptions;nonSelectedOptions=this.#e.nonSelectedOptions;isSubmitting=this.#e.isSubmitting;settings=this.#e.settings;optionsFields=this.#e.optionsFields;applicationOptions=this.#e.applicationOptions;retentionOptions=v(ge);sizeSplit=I(()=>{let n=this.optionsFields.remoteVolumeSize().match(/^(\d+)(bytes|kb|mb|gb|tb|pb|b)$/i);return{value:n?parseInt(n[1],10):0,unit:n?n[2].toUpperCase():"MB"}});exceededVolumeSize=I(()=>{let l=this.sizeSplit().value,n=this.sizeSplit().unit;if(l==null||n===null||n===void 0)return!1;let e=l*Math.pow(1024,Te.indexOf(n));return e>Ce||e<Pe});goBack(){this.#n.navigate(["schedule"],{relativeTo:this.#t.parent})}submit(){this.#e.submit()}static \u0275fac=function(n){return new(n||s)};static \u0275cmp=x({type:s,selectors:[["app-advanced-options-settings"]],viewQuery:function(n,e){n&1&&G(e.formRef,_e,5),n&2&&K()},decls:30,vars:16,consts:()=>{let l;l=$localize`Options`;let n;n=$localize` Remote volume size ${"\uFFFD*7:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#1:1\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*7:1\uFFFD"}:CLOSE_BLOCK_IF:`;let e;e=$localize` The backups will be split up into multiple files called volumes. Here you can set the maximum size of the individual volume files. ${"\uFFFD#11\uFFFD"}:START_LINK: Read more ${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-square-out${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/#11\uFFFD"}:CLOSE_LINK:`;let a;a=$localize`Backup retention`;let o;o=$localize`${"\uFFFD#26\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#26\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let b;b=$localize`${"\uFFFD#29\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#29\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `;let A;A=$localize` The chosen size is outside the recommended range. This may cause performance issues, excessively large temporary files or other problems. `;let R;R=$localize`Nothing will be deleted. The backup size will grow with each change.`;let y;y=$localize`If at least one newer backup is found, all backups older than this date are deleted.`;let $;$=$localize`Time to keep versions`;let k;k=$localize`Once there are more backups than the specified number, the oldest backups are deleted.`;let w;w=$localize`Number of versions`;let D;D=$localize` Over time backups will be deleted automatically. There will remain one backup for each of the last 7 days, each of the last 4 weeks, each of the last 12 months. There will always be at least one remaining backup. `;let B;B=$localize` Enter a retention strategy manually. Placeholders are D/W/Y for days/weeks/years and U for unlimited. The syntax is: 7D:1D,4W:1W,36M:1M. This example keeps one backup for each of the next 7 days, one for each of the next 4 weeks, and one for each of the next 36 months. This can also be written as 1W:1D,1M:1W,3Y:1M. `;let L;L=$localize`Once there are more backups than the specified number, the oldest backups are deleted.`;let z;return z=$localize`Retention expression`,[l,n,e,a,o,b,A,R,y,$,k,w,D,B,L,z,[1,"title-30"],[1,"remote-volume-wrap"],[3,"ngModelChange","customId","ngModel"],["for","size"],[1,"warning"],[1,"warn"],["href","https://forum.duplicati.com/t/choosing-sizes-in-duplicati/17683","target","_blank",1,"sh-primary"],["suffix",""],["value","value","label","name",3,"options","inlineSearch","isClearable"],["type","text",3,"ngModelChange","ngModel"],[3,"optionsChange","options","applicationOptions","hasFreeTextSettings","hiddenOptions"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click"],["for","backupRetentionTime"],["for","backupRetentionVersions"],["type","number","id","backupRetentionVersions",3,"ngModelChange","ngModel"],["for","backupRetentionCustom"],["type","text","id","backupRetentionCustom",3,"ngModelChange","ngModel"]]},template:function(n,e){n&1&&(t(0,"section")(1,"h3",16),r(2,0),i(),t(3,"div",17)(4,"app-size",18),m("ngModelChange",function(o){return d(e.optionsFields.remoteVolumeSize,o)||(e.optionsFields.remoteVolumeSize=o),o}),t(5,"label",19),S(6,1),h(7,ce,2,0,"sh-icon",20),O(),i()(),h(8,pe,2,0,"p",21),t(9,"p"),S(10,2),t(11,"a",22),g(12,"sh-icon",23),i(),O(),i()(),t(13,"sh-select",24)(14,"label",19),r(15,3),i(),t(16,"input",25),m("ngModelChange",function(o){return d(e.optionsFields.backupRetention,o)||(e.optionsFields.backupRetention=o),o}),i()(),h(17,ue,2,0,"p")(18,de,5,2)(19,me,6,1)(20,Se,2,0,"p")(21,Oe,8,1),t(22,"app-options-list",26),m("optionsChange",function(o){return d(e.settings,o)||(e.settings=o),o}),i(),t(23,"div",27)(24,"button",28),M("click",function(){return e.goBack()}),S(25,4),g(26,"sh-icon"),O(),i(),t(27,"button",29),M("click",function(){return e.submit()}),S(28,5),g(29,"sh-icon"),O(),i()()()),n&2&&(c(4),T("customId","size"),u("ngModel",e.optionsFields.remoteVolumeSize),c(3),N(e.exceededVolumeSize()?7:-1),c(),N(e.exceededVolumeSize()?8:-1),c(5),T("options",e.retentionOptions())("inlineSearch",!0)("isClearable",!1),c(3),u("ngModel",e.optionsFields.backupRetention),c(),N(e.optionsFields.backupRetention()==="all"?17:e.optionsFields.backupRetention()==="time"?18:e.optionsFields.backupRetention()==="versions"?19:e.optionsFields.backupRetention()==="smart"?20:e.optionsFields.backupRetention()==="custom"?21:-1),c(5),u("options",e.settings),T("applicationOptions",e.applicationOptions())("hasFreeTextSettings",!0)("hiddenOptions",X(15,re)),c(5),U("loader",e.isSubmitting()))},dependencies:[te,Z,ne,J,ee,oe,le,Y,q,j,ie,ae,Q],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.form-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 2.5rem;gap:.5rem;align-items:flex-end}.remote-volume-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.remote-volume-wrap[_ngcontent-%COMP%] p.warning[_ngcontent-%COMP%]{color:#7d7d00}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.advanced-option[_ngcontent-%COMP%]{display:grid;gap:.5rem;grid-template-columns:1fr 1fr 2.5rem;align-items:flex-end}sh-select[_ngcontent-%COMP%]{--miw: p2r(120)}"],changeDetection:0})};export{E as default};
@@ -1 +1 @@
1
- import{a}from"./chunk-62QANGOE.js";import"./chunk-ESUPNSKH.js";import"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";export{a as default};
1
+ import{a}from"./chunk-X7ZE7U56.js";import"./chunk-GEI2CH2J.js";import"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";export{a as default};
@@ -1 +1 @@
1
- import{c as a,d as b}from"./chunk-DAYBMF7U.js";import"./chunk-4DNWEJIW.js";import"./chunk-TK5QY2QD.js";import"./chunk-23CWXAU4.js";import"./chunk-DDWLL7XA.js";import"./chunk-O64ZZGQZ.js";import"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import"./chunk-N5SC4SKW.js";import"./chunk-UKQFDBNO.js";import"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";export{a as createEncryptionForm,b as default};
1
+ import{c as a,d as b}from"./chunk-7ZTBW6LJ.js";import"./chunk-K56EDP42.js";import"./chunk-TK5QY2QD.js";import"./chunk-FZTPUMUC.js";import"./chunk-DDWLL7XA.js";import"./chunk-O64ZZGQZ.js";import"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import"./chunk-N5SC4SKW.js";import"./chunk-UKQFDBNO.js";import"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";export{a as createEncryptionForm,b as default};
@@ -1 +1 @@
1
- import{a as Ue}from"./chunk-4DNWEJIW.js";import{a as se}from"./chunk-23CWXAU4.js";import{a as ne}from"./chunk-DDWLL7XA.js";import{b as pe}from"./chunk-O64ZZGQZ.js";import{a as Ve}from"./chunk-UIJYCGKA.js";import{a as K}from"./chunk-DELLEGXW.js";import{a as oe}from"./chunk-VTSUHAP5.js";import{a as xe}from"./chunk-UP5EOICU.js";import{b as We,c as G,e as B,f as x,i as ze,j as V,l as Xe,o as W,q as z,r as X,s as Ye,t as Y}from"./chunk-N5SC4SKW.js";import{b as R,d as N}from"./chunk-LVP2TPMO.js";import{A as Be,a as A,e as ve,g as k,l as Ae,p as ke,q as we,t as Ge}from"./chunk-H7K35UUX.js";import{h as w}from"./chunk-NOPMCS2Z.js";import{la as ie}from"./chunk-RUXCS4ZK.js";import{Ab as r,B as Oe,Bb as l,Cb as c,Dc as ae,Ec as $e,F as H,Fc as De,Gb as L,H as O,Hb as $,Jb as j,L as fe,Oc as le,P as he,Pc as v,Q,Qb as m,Ra as d,Rb as g,Sb as S,Tb as Ne,Ub as Pe,V as Ce,Wb as f,Yb as D,_ as p,bb as M,ea as h,fa as C,gb as Re,i as Se,ic as Ie,lc as q,nc as Me,o as Te,oa as _,oc as ye,qc as Z,rc as ee,sc as te,ub as y,vb as b,x as re,y as Ee,yc as be,zb as F,zc as Le}from"./chunk-HNWRQABR.js";var He=new X,Ke=()=>He.group({passphrase:He.control("")}),_e=class a{#t=p(w);#e=p(P);#o=p(N);#n=p(R);encryptionForm=this.#e.encryptionForm;creatingTemporaryBackup=_(!1);settings=_([]);next(){let i=this.#e.destinationTargetUrl();if(!i)throw new Error("No target URL");this.creatingTemporaryBackup.set(!0);let e=this.encryptionForm.value?.passphrase??null,t=[];e?t.push({Name:"--passphrase",Value:e}):t.push({Name:"--no-encryption",Value:"true"}),this.settings().forEach(o=>{let n=o.Name?.trim();n&&n!=="--"&&(n.startsWith("--")||(n=`--${n}`),t.push({Name:n,Value:o.Value??""}))}),this.#t.postApiV1Backups({requestBody:{Backup:{TargetURL:i,Settings:t}},temporary:!0}).pipe(O(()=>this.creatingTemporaryBackup.set(!1))).subscribe({next:o=>{let n=o.ID;this.#o.navigate([`/restore-draft/${n}`])},error:o=>{console.error(o)}})}back(){this.#e.isFileRestore()?this.#o.navigate(["destination"],{relativeTo:this.#n.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["app-restore-encryption"]],decls:16,vars:3,consts:()=>{let i;i=$localize`Enter backup passphrase if defined.`;let e;e=$localize`Password`;let t;t=$localize`Advanced options`;let o;o=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let n;return n=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `,[e,t,o,n,[3,"submit","formGroup"],["for","password"],["type","password","id","password","placeholder",i,"formControlName","passphrase"],["title",""],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"]]},template:function(e,t){e&1&&(r(0,"form",4),f("submit",function(){return t.next()}),r(1,"sh-form-field")(2,"label",5),S(3,0),l(),c(4,"input",6),l(),r(5,"app-toggle-card"),L(6,7),S(7,1),$(),r(8,"app-options-list",8),te("optionsChange",function(n){return ee(t.settings,n)||(t.settings=n),n}),l()(),r(9,"div",9)(10,"button",10),f("click",function(){return t.back()}),m(11,2),c(12,"sh-icon"),g(),l(),r(13,"button",11),m(14,3),c(15,"sh-icon"),g(),l()()()),e&2&&(F("formGroup",t.encryptionForm),d(8),Z("options",t.settings),F("hasFreeTextSettings",!0))},dependencies:[Y,V,G,B,x,W,z,Ae,A,k,ne,Ue],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var Ze=()=>({standalone:!0});function et(a,i){a&1&&c(0,"sh-progress-bar",8)}function tt(a,i){if(a&1&&(q(0),ae(1,"bytes")),a&2){let e=D().$implicit;Me(" (",$e(1,1,e.FileSizes),") ")}}function it(a,i){a&1&&(r(0,"span",16),S(1,4),l())}function ot(a,i){if(a&1&&(r(0,"div",15),q(1),ae(2,"date"),y(3,tt,2,3),y(4,it,2,0,"span",16),l()),a&2){let e=i.$implicit;d(),ye(" ",e.Version,": ",De(2,4,e.Time,"medium")," "),d(2),b(e.FileSizes?3:-1),d(),b(e.IsFullBackup===!1?4:-1)}}function nt(a,i){a&1&&c(0,"sh-progress-bar",8)}function st(a,i){if(a&1&&(r(0,"app-file-tree",14)(1,"label",17),S(2,5),l(),c(3,"input",18),l()),a&2){let e=D(2);F("rootPaths",e.rootPaths())("initialNodes",e.initialNodes())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)}}function rt(a,i){if(a&1){let e=j();r(0,"sh-select",12),f("cleared",function(){h(e);let o=D();return C(o.abortLoading())}),r(1,"input",13),te("ngModelChange",function(o){h(e);let n=D();return ee(n.selectOption,o)||(n.selectOption=o),C(o)}),l(),Re(2,ot,5,7,"ng-template"),l(),y(3,nt,1,0,"sh-progress-bar",8),y(4,st,4,5,"app-file-tree",14)}if(a&2){let e=D();F("options",e.versionOptions())("isClearable",!1),d(),Z("ngModel",e.selectOption),F("ngModelOptions",Le(6,Ze)),d(2),b(e.isRepairing()||e.versionOptionsLoading()||e.loadingRootPath()?3:-1),d(),b(e.showFileTree()?4:-1)}}var ue=new X,Je=()=>ue.group({filesToRestore:ue.control(""),passphrase:ue.control(null)}),de=class a{#t=p(w);#e=p(P);#o=p(Ve);#n=p(oe);#i=p(N);#s=p(R);#l=p(ie);#a=null;#p=null;#r=_([]);selectFilesForm=this.#e.selectFilesForm;selectFilesFormSignal=this.#e.selectFilesFormSignal;selectOption=this.#e.selectOption;backupId=this.#e.backupId;versionOptionsLoading=this.#e.versionOptionsLoading;versionOptions=this.#e.versionOptions;isFileRestore=this.#e.isFileRestore;needsDatabaseRepair=le(()=>this.#e.backup()?.Backup?.IsTemporary??!0);showFileTree=_(!1);backupSettings=_(null);rootPaths=_([]);initialNodes=_([]);loadingRootPath=_(!1);isRepairing=le(()=>this.#r().length>0);loadedVersions=_({});loadingEffect=v(()=>{if(this.versionOptionsLoading())return;let e=this.versionOptions();if(e&&e?.length>0){let t=e[0].Version;this.selectOption.set(t.toString())}});backupSettingsEffect=v(()=>{let i=this.backupId(),e=this.selectOption(),t=this.isRepairing(),o=this.loadedVersions();if(!e||!i)return;let s=this.versionOptions()?.find(J=>J.Version===parseInt(e))?.Time??null;if(!s)return;let u=`${i}+${s}`,E=o[u];if(this.needsDatabaseRepair()&&(!E||t))return;let I={id:i+"",time:s};this.backupSettings.set(I),this.getRootPath(I)});repairEffect=v(()=>{if(!this.needsDatabaseRepair())return;let i=this.selectOption(),e=this.versionOptions();if(i){let t=e.find(s=>s.Version===parseInt(i));if(t===void 0)return;let o=this.backupId(),n=`${o}+${t.Time}`;if(this.#p===n||(this.#p=n,this.#r().includes(n)))return;this.#r.update(s=>[...s,n]),this.#t.postApiV1BackupByIdRepairupdate({id:o,requestBody:{only_paths:!0,time:t.Time}}).pipe(Q(this.abortLoading$),O(()=>{this.#p=null})).subscribe(s=>{let u=s.ID;this.#o.waitForTaskToComplete(u).pipe(H(1)).subscribe(()=>{this.#r.update(E=>E.filter(I=>I!==n)),this.loadedVersions.update(E=>(E[n]=!0,E))})})}});getRootPath(i){let e={id:i.id+"",time:i.time,prefixOnly:!0,folderContents:!1},t=i.id+"";this.isRepairing()||this.#a===t||(this.#a=t,this.loadingRootPath.set(!0),this.showFileTree.set(!1),this.#n.hasV2ListOperations()?this.#t.postApiV2BackupListFolder({requestBody:{BackupId:i.id,Time:i.time,Paths:null,PageSize:0,Page:0}}).pipe(Q(this.abortLoading$),O(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1),this.#a=null})).subscribe({next:o=>{let n=(o.Data??[]).map(s=>s.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}):this.#t.getApiV1BackupByIdFiles(e).pipe(Q(this.abortLoading$),O(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1)})).subscribe({next:o=>{let n=o.Files.map(s=>s.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}))}abortLoading$=new Se;abortLoading(){this.showFileTree.set(!1),this.loadingRootPath.set(!1),this.abortLoading$.next(!0)}displayFn(){let i=this.versionOptions();return e=>{if(!e)return"";let t=i?.find(o=>typeof o.Version=="number"&&o.Version.toString()===e);return t?`${t.Version}: ${this.#l.transform(t.Time,"medium")}`:""}}next(){this.#i.navigate(["options"],{relativeTo:this.#s.parent})}back(){this.#e.isFileRestore()?this.#i.navigate(["encryption"],{relativeTo:this.#s.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["app-select-files"]],features:[be([ie])],decls:13,vars:3,consts:()=>{let i;i=$localize`Select files`;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let t;t=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let o;o=$localize`Select an option...`;let n;n=$localize`(partial)`;let s;return s=$localize`Path`,[["formRef",""],i,e,t,n,s,[3,"submit","formGroup"],[1,"title-30"],[1,"indeterminate","primary"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],["value","Version",3,"cleared","options","isClearable"],["type","text","placeholder",o,3,"ngModelChange","ngModel","ngModelOptions"],[3,"rootPaths","initialNodes","backupSettings","multiSelect","showFiles"],[1,"custom-option"],[1,"partial"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]]},template:function(e,t){if(e&1){let o=j();r(0,"form",6,0),f("submit",function(){return h(o),C(t.next())}),r(2,"h3",7),S(3,1),l(),y(4,et,1,0,"sh-progress-bar",8)(5,rt,5,7),r(6,"div",9)(7,"button",10),f("click",function(){return h(o),C(t.back())}),m(8,2),c(9,"sh-icon"),g(),l(),r(10,"button",11),m(11,3),c(12,"sh-icon"),g(),l()()()}e&2&&(F("formGroup",t.selectFilesForm),d(4),b(t.versionOptionsLoading()?4:5),d(5),Ne(t.isFileRestore()?"Back":"Exit"),Pe(8))},dependencies:[Ye,V,G,B,x,ze,Y,W,z,se,k,A,Ge,ke,ie,xe],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.partial[_ngcontent-%COMP%]{color:var(--base-9);font-style:italic}"],changeDetection:0})};var P=class a{#t=p(N);#e=p(R);#o=p(oe);#n=p(ve);#i=p(w);backupId=_(null);backup=_(null);destinationTargetUrl=_(null);selectFilesForm=Je();optionsForm=Qe();encryptionForm=Ke();optionsFormSignal=pe(this.optionsForm.valueChanges);selectFilesFormSignal=pe(this.selectFilesForm.valueChanges);selectOption=_(null);versionOptionsLoading=_(!1);versionOptions=_([]);isSubmitting=_(!1);isFileRestore=_(!1);isFullWidthPage=_(!1);#s=_("");#l=_(null);#a=null;testSignal=this.#s.asReadonly();testErrorMessage=this.#l.asReadonly();#p=v(()=>{let i=this.destinationTargetUrl(),e=this.#s(),t=this.#a;this.#a=i,!(e==="testing"||t===null||t===i)&&(this.#s.set(""),this.#l.set(null))});init(i,e=!1){this.backupId.set(i),this.isFileRestore.set(e),e&&this.#t.navigate(["/restore-from-files/destination"]),e||this.getBackup(!0)}setTestState(i,e){this.#s.set(i),this.#l.set(e??null)}updateTargetUrl(i){this.destinationTargetUrl.set(i)}submit(){this.isSubmitting.set(!0);let i=this.backupId();this.backup()?.Backup?.IsTemporary??!1?this.#i.postApiV1BackupByIdCopytotemp({id:this.backupId()??""}).subscribe({next:t=>{this.#r(t.ID??"")},error:t=>this.showErrorDialog($localize`An error occurred while copying the backup to a temporary location: ${t.message}`)}):this.#r(i??"")}showErrorDialog(i){this.#n.open(K,{data:{title:$localize`Error occured`,message:i,confirmText:$localize`OK`,cancelText:void 0},closed:e=>{}})}#r(i){let e=this.optionsForm.value,t=this.selectFilesForm.value,o=this.selectOption(),n=this.versionOptions()?.find(s=>s.Version===(o&&parseInt(o)));this.#i.postApiV1BackupByIdRestore({id:i??"",requestBody:{paths:t.filesToRestore?.split("\0").map(s=>s.endsWith("/")||s.endsWith("\\")?`${s}*`:s)??[],passphrase:t.passphrase??null,time:n?.Time,restore_path:e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!e.includeMetadata}}).pipe(O(()=>this.isSubmitting.set(!1))).subscribe({next:s=>{this.#t.navigate([`./${s.ID}`,"progress"],{relativeTo:this.#e})},error:s=>{console.error("restore error",s)}})}exit(){this.#n.open(K,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:i=>{i&&(this.#_(),this.#t.navigate(["/"]))}})}getVersionOptions(){this.versionOptions()}loadFilesetsWithRetryv2(i,e=2){return this.#i.postApiV2BackupListFilesets({requestBody:{BackupId:i}}).pipe(Oe(t=>{let o=t?.error?.body?.StatusCode==="EncryptedStorageNoPassphrase",n=t?.error?.body?.StatusCode==="FolderMissing",s=t?.error?.body?.StatusCode==="EmptyRemoteFolder";return o||n||s||e===0?Te(()=>t):Ee(1e3).pipe(he(()=>this.loadFilesetsWithRetryv2(i,e-1)))}))}getBackup(i=!1){let e=this.backupId();this.versionOptionsLoading.set(!0),this.#o.hasV2ListOperations()?re([this.#i.getApiV1BackupById({id:e}),this.loadFilesetsWithRetryv2(e)]).pipe(H(1),O(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([t,o])=>{if(o.Error)throw new Error(o.Error);if(!(t.Backup?.IsTemporary??!0)&&t?.Backup?.DBPathExists===!1){this.#n.open(K,{data:{title:$localize`Missing Local Database`,message:$localize`The local database for this backup is missing. Please repair or recreate the local database before restoring.`,confirmText:$localize`OK`,cancelText:void 0},closed:s=>{this.#t.navigate(["/backup",e,"database"])}});return}this.versionOptions.set((o.Data??[]).map(s=>({Version:s.Version??-1,IsFullBackup:s.IsFullBackup??void 0,Time:s.Time??"<missing>",FileCount:s.FileCount??void 0,FileSizes:s.FileSizes??void 0}))),this.backup.set(t)},error:t=>{let o=t?.error?.body?.StatusCode==="EncryptedStorageNoPassphrase",n=t?.error?.body?.StatusCode==="FolderMissing",s=t?.error?.body?.StatusCode==="EmptyRemoteFolder",u=$localize`An error occurred while loading the backup filesets: ${t.message}`;o&&(u=$localize`The remote storage is encrypted. Please enter the passphrase to access the backup.`),n&&(u=$localize`The backup storage folder was not found.`),s&&(u=$localize`The backup storage folder does not contain any filesets.`),this.#n.open(K,{data:{title:$localize`Failed to load backup filesets`,message:u,confirmText:$localize`OK`,cancelText:void 0},closed:E=>{this.#t.navigate([o?"/restore-from-files/encryption":"/restore-from-files/destination"])}})}}):re([this.#i.getApiV1BackupById({id:e}),this.#i.getApiV1BackupByIdFilesets({id:e}).pipe(fe(3))]).pipe(H(1),O(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([t,o])=>{this.versionOptions.set(o.map(n=>({Version:n.Version??-1,IsFullBackup:(n.IsFullBackup??1)==1,Time:n.Time??"<missing>",FileCount:n.FileCount??void 0,FileSizes:n.FileSizes??void 0}))),this.backup.set(t)}})}#_(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||a)};static \u0275prov=Ce({token:a,factory:a.\u0275fac,providedIn:"root"})};var U=new X,Qe=()=>U.group({restoreFrom:U.control("orignal"),restoreFromPath:U.control(""),handleExisting:U.control("overwrite"),permissions:U.control(!1),includeMetadata:U.control(!0)}),me=class a{#t=p(P);#e=p(N);#o=p(R);optionsForm=this.#t.optionsForm;optionsFormSignal=this.#t.optionsFormSignal;isSubmitting=this.#t.isSubmitting;goBack(){this.#e.navigate(["select-files"],{relativeTo:this.#o.parent})}submit(){this.#t.submit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["app-advanced-options-settings"]],decls:42,vars:7,consts:()=>{let i;i=$localize`Restore options`;let e;e=$localize`Where do you want to restore files to?`;let t;t=$localize` Original location ${"\uFFFD#9\uFFFD\uFFFD/#9\uFFFD"}:TAG_INPUT:`;let o;o=$localize` Pick location ${"\uFFFD#12\uFFFD\uFFFD/#12\uFFFD"}:TAG_INPUT:`;let n;n=$localize`How do you want to handle existing files?`;let s;s=$localize` Overwrite ${"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"}:TAG_INPUT:`;let u;u=$localize` Save different versions with timestamp in file name ${"\uFFFD#25\uFFFD\uFFFD/#25\uFFFD"}:TAG_INPUT:`;let E;E=$localize`Metadata settings`;let I;I=$localize` Restore file metadata ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let J;J=$localize` Restore read/write permissions ${"\uFFFD#34\uFFFD\uFFFD/#34\uFFFD"}:TAG_INPUT:`;let ge;ge=$localize`${"\uFFFD#38\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let Fe;return Fe=$localize`${"\uFFFD#41\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#41\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `,[["formRef",""],i,e,t,o,n,s,u,E,I,J,ge,Fe,[3,"submit","formGroup"],[1,"title-30"],[3,"disallowToggle"],["title",""],[1,"raised","primary"],["type","radio","name","restoreFrom","value","orignal","formControlName","restoreFrom"],["type","radio","name","restoreFrom","value","pickLocation","formControlName","restoreFrom"],[3,"disabled","enableCreateFolder"],["for","path"],["type","text","id","path","formControlName","restoreFromPath"],["type","radio","name","handleExisting","value","overwrite","formControlName","handleExisting"],["type","radio","name","handleExisting","value","saveTimestamp","formControlName","handleExisting"],[1,"primary","raised"],["type","checkbox","formControlName","includeMetadata"],["type","checkbox","formControlName","permissions"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"]]},template:function(e,t){if(e&1){let o=j();r(0,"form",13,0),f("submit",function(){return h(o),C(t.submit())}),r(2,"h3",14),S(3,1),l(),r(4,"app-toggle-card",15),L(5,16),S(6,2),$(),r(7,"sh-radio",17),m(8,3),c(9,"input",18),g(),l(),r(10,"sh-radio",17),m(11,4),c(12,"input",19),g(),l(),r(13,"app-file-tree",20)(14,"label",21),q(15,"Path"),l(),c(16,"input",22),l()(),r(17,"app-toggle-card",15),L(18,16),S(19,5),$(),r(20,"sh-radio",17),m(21,6),c(22,"input",23),g(),l(),r(23,"sh-radio",17),m(24,7),c(25,"input",24),g(),l()(),r(26,"app-toggle-card"),L(27,16),S(28,8),$(),r(29,"sh-toggle",25),m(30,9),c(31,"input",26),g(),l(),r(32,"sh-toggle",25),m(33,10),c(34,"input",27),g(),l()(),r(35,"div",28)(36,"button",29),f("click",function(){return h(o),C(t.goBack())}),m(37,11),c(38,"sh-icon"),g(),l(),r(39,"button",30),m(40,12),c(41,"sh-icon"),g(),l()()()}if(e&2){let o;F("formGroup",t.optionsForm),d(4),F("disallowToggle",!0),d(9),F("disabled",((o=t.optionsFormSignal())==null?null:o.restoreFrom)!=="pickLocation")("enableCreateFolder",!0),d(4),F("disallowToggle",!0),d(22),Ie("loader",t.isSubmitting())}},dependencies:[Y,V,G,We,Xe,B,x,W,z,ne,se,Be,we,k,A],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};export{Qe as a,me as b,Ke as c,_e as d,Je as e,de as f,P as g};
1
+ import{a as Ue}from"./chunk-K56EDP42.js";import{a as se}from"./chunk-FZTPUMUC.js";import{a as ne}from"./chunk-DDWLL7XA.js";import{b as pe}from"./chunk-O64ZZGQZ.js";import{a as Ve}from"./chunk-UIJYCGKA.js";import{a as K}from"./chunk-DELLEGXW.js";import{a as oe}from"./chunk-VTSUHAP5.js";import{a as xe}from"./chunk-UP5EOICU.js";import{b as We,c as G,e as B,f as x,i as ze,j as V,l as Xe,o as W,q as z,r as X,s as Ye,t as Y}from"./chunk-N5SC4SKW.js";import{b as R,d as N}from"./chunk-LVP2TPMO.js";import{A as Be,a as A,e as ve,g as k,l as Ae,p as ke,q as we,t as Ge}from"./chunk-H7K35UUX.js";import{h as w}from"./chunk-NOPMCS2Z.js";import{la as ie}from"./chunk-RUXCS4ZK.js";import{Ab as r,B as Oe,Bb as l,Cb as c,Dc as ae,Ec as $e,F as H,Fc as De,Gb as L,H as O,Hb as $,Jb as j,L as fe,Oc as le,P as he,Pc as v,Q,Qb as m,Ra as d,Rb as g,Sb as S,Tb as Ne,Ub as Pe,V as Ce,Wb as f,Yb as D,_ as p,bb as M,ea as h,fa as C,gb as Re,i as Se,ic as Ie,lc as q,nc as Me,o as Te,oa as _,oc as ye,qc as Z,rc as ee,sc as te,ub as y,vb as b,x as re,y as Ee,yc as be,zb as F,zc as Le}from"./chunk-HNWRQABR.js";var He=new X,Ke=()=>He.group({passphrase:He.control("")}),_e=class a{#t=p(w);#e=p(P);#o=p(N);#n=p(R);encryptionForm=this.#e.encryptionForm;creatingTemporaryBackup=_(!1);settings=_([]);next(){let i=this.#e.destinationTargetUrl();if(!i)throw new Error("No target URL");this.creatingTemporaryBackup.set(!0);let e=this.encryptionForm.value?.passphrase??null,t=[];e?t.push({Name:"--passphrase",Value:e}):t.push({Name:"--no-encryption",Value:"true"}),this.settings().forEach(o=>{let n=o.Name?.trim();n&&n!=="--"&&(n.startsWith("--")||(n=`--${n}`),t.push({Name:n,Value:o.Value??""}))}),this.#t.postApiV1Backups({requestBody:{Backup:{TargetURL:i,Settings:t}},temporary:!0}).pipe(O(()=>this.creatingTemporaryBackup.set(!1))).subscribe({next:o=>{let n=o.ID;this.#o.navigate([`/restore-draft/${n}`])},error:o=>{console.error(o)}})}back(){this.#e.isFileRestore()?this.#o.navigate(["destination"],{relativeTo:this.#n.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["app-restore-encryption"]],decls:16,vars:3,consts:()=>{let i;i=$localize`Enter backup passphrase if defined.`;let e;e=$localize`Password`;let t;t=$localize`Advanced options`;let o;o=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let n;return n=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `,[e,t,o,n,[3,"submit","formGroup"],["for","password"],["type","password","id","password","placeholder",i,"formControlName","passphrase"],["title",""],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"]]},template:function(e,t){e&1&&(r(0,"form",4),f("submit",function(){return t.next()}),r(1,"sh-form-field")(2,"label",5),S(3,0),l(),c(4,"input",6),l(),r(5,"app-toggle-card"),L(6,7),S(7,1),$(),r(8,"app-options-list",8),te("optionsChange",function(n){return ee(t.settings,n)||(t.settings=n),n}),l()(),r(9,"div",9)(10,"button",10),f("click",function(){return t.back()}),m(11,2),c(12,"sh-icon"),g(),l(),r(13,"button",11),m(14,3),c(15,"sh-icon"),g(),l()()()),e&2&&(F("formGroup",t.encryptionForm),d(8),Z("options",t.settings),F("hasFreeTextSettings",!0))},dependencies:[Y,V,G,B,x,W,z,Ae,A,k,ne,Ue],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var Ze=()=>({standalone:!0});function et(a,i){a&1&&c(0,"sh-progress-bar",8)}function tt(a,i){if(a&1&&(q(0),ae(1,"bytes")),a&2){let e=D().$implicit;Me(" (",$e(1,1,e.FileSizes),") ")}}function it(a,i){a&1&&(r(0,"span",16),S(1,4),l())}function ot(a,i){if(a&1&&(r(0,"div",15),q(1),ae(2,"date"),y(3,tt,2,3),y(4,it,2,0,"span",16),l()),a&2){let e=i.$implicit;d(),ye(" ",e.Version,": ",De(2,4,e.Time,"medium")," "),d(2),b(e.FileSizes?3:-1),d(),b(e.IsFullBackup===!1?4:-1)}}function nt(a,i){a&1&&c(0,"sh-progress-bar",8)}function st(a,i){if(a&1&&(r(0,"app-file-tree",14)(1,"label",17),S(2,5),l(),c(3,"input",18),l()),a&2){let e=D(2);F("rootPaths",e.rootPaths())("initialNodes",e.initialNodes())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)}}function rt(a,i){if(a&1){let e=j();r(0,"sh-select",12),f("cleared",function(){h(e);let o=D();return C(o.abortLoading())}),r(1,"input",13),te("ngModelChange",function(o){h(e);let n=D();return ee(n.selectOption,o)||(n.selectOption=o),C(o)}),l(),Re(2,ot,5,7,"ng-template"),l(),y(3,nt,1,0,"sh-progress-bar",8),y(4,st,4,5,"app-file-tree",14)}if(a&2){let e=D();F("options",e.versionOptions())("isClearable",!1),d(),Z("ngModel",e.selectOption),F("ngModelOptions",Le(6,Ze)),d(2),b(e.isRepairing()||e.versionOptionsLoading()||e.loadingRootPath()?3:-1),d(),b(e.showFileTree()?4:-1)}}var ue=new X,Je=()=>ue.group({filesToRestore:ue.control(""),passphrase:ue.control(null)}),de=class a{#t=p(w);#e=p(P);#o=p(Ve);#n=p(oe);#i=p(N);#s=p(R);#l=p(ie);#a=null;#p=null;#r=_([]);selectFilesForm=this.#e.selectFilesForm;selectFilesFormSignal=this.#e.selectFilesFormSignal;selectOption=this.#e.selectOption;backupId=this.#e.backupId;versionOptionsLoading=this.#e.versionOptionsLoading;versionOptions=this.#e.versionOptions;isFileRestore=this.#e.isFileRestore;needsDatabaseRepair=le(()=>this.#e.backup()?.Backup?.IsTemporary??!0);showFileTree=_(!1);backupSettings=_(null);rootPaths=_([]);initialNodes=_([]);loadingRootPath=_(!1);isRepairing=le(()=>this.#r().length>0);loadedVersions=_({});loadingEffect=v(()=>{if(this.versionOptionsLoading())return;let e=this.versionOptions();if(e&&e?.length>0){let t=e[0].Version;this.selectOption.set(t.toString())}});backupSettingsEffect=v(()=>{let i=this.backupId(),e=this.selectOption(),t=this.isRepairing(),o=this.loadedVersions();if(!e||!i)return;let s=this.versionOptions()?.find(J=>J.Version===parseInt(e))?.Time??null;if(!s)return;let u=`${i}+${s}`,E=o[u];if(this.needsDatabaseRepair()&&(!E||t))return;let I={id:i+"",time:s};this.backupSettings.set(I),this.getRootPath(I)});repairEffect=v(()=>{if(!this.needsDatabaseRepair())return;let i=this.selectOption(),e=this.versionOptions();if(i){let t=e.find(s=>s.Version===parseInt(i));if(t===void 0)return;let o=this.backupId(),n=`${o}+${t.Time}`;if(this.#p===n||(this.#p=n,this.#r().includes(n)))return;this.#r.update(s=>[...s,n]),this.#t.postApiV1BackupByIdRepairupdate({id:o,requestBody:{only_paths:!0,time:t.Time}}).pipe(Q(this.abortLoading$),O(()=>{this.#p=null})).subscribe(s=>{let u=s.ID;this.#o.waitForTaskToComplete(u).pipe(H(1)).subscribe(()=>{this.#r.update(E=>E.filter(I=>I!==n)),this.loadedVersions.update(E=>(E[n]=!0,E))})})}});getRootPath(i){let e={id:i.id+"",time:i.time,prefixOnly:!0,folderContents:!1},t=i.id+"";this.isRepairing()||this.#a===t||(this.#a=t,this.loadingRootPath.set(!0),this.showFileTree.set(!1),this.#n.hasV2ListOperations()?this.#t.postApiV2BackupListFolder({requestBody:{BackupId:i.id,Time:i.time,Paths:null,PageSize:0,Page:0}}).pipe(Q(this.abortLoading$),O(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1),this.#a=null})).subscribe({next:o=>{let n=(o.Data??[]).map(s=>s.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}):this.#t.getApiV1BackupByIdFiles(e).pipe(Q(this.abortLoading$),O(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1)})).subscribe({next:o=>{let n=o.Files.map(s=>s.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}))}abortLoading$=new Se;abortLoading(){this.showFileTree.set(!1),this.loadingRootPath.set(!1),this.abortLoading$.next(!0)}displayFn(){let i=this.versionOptions();return e=>{if(!e)return"";let t=i?.find(o=>typeof o.Version=="number"&&o.Version.toString()===e);return t?`${t.Version}: ${this.#l.transform(t.Time,"medium")}`:""}}next(){this.#i.navigate(["options"],{relativeTo:this.#s.parent})}back(){this.#e.isFileRestore()?this.#i.navigate(["encryption"],{relativeTo:this.#s.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["app-select-files"]],features:[be([ie])],decls:13,vars:3,consts:()=>{let i;i=$localize`Select files`;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let t;t=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let o;o=$localize`Select an option...`;let n;n=$localize`(partial)`;let s;return s=$localize`Path`,[["formRef",""],i,e,t,n,s,[3,"submit","formGroup"],[1,"title-30"],[1,"indeterminate","primary"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],["value","Version",3,"cleared","options","isClearable"],["type","text","placeholder",o,3,"ngModelChange","ngModel","ngModelOptions"],[3,"rootPaths","initialNodes","backupSettings","multiSelect","showFiles"],[1,"custom-option"],[1,"partial"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]]},template:function(e,t){if(e&1){let o=j();r(0,"form",6,0),f("submit",function(){return h(o),C(t.next())}),r(2,"h3",7),S(3,1),l(),y(4,et,1,0,"sh-progress-bar",8)(5,rt,5,7),r(6,"div",9)(7,"button",10),f("click",function(){return h(o),C(t.back())}),m(8,2),c(9,"sh-icon"),g(),l(),r(10,"button",11),m(11,3),c(12,"sh-icon"),g(),l()()()}e&2&&(F("formGroup",t.selectFilesForm),d(4),b(t.versionOptionsLoading()?4:5),d(5),Ne(t.isFileRestore()?"Back":"Exit"),Pe(8))},dependencies:[Ye,V,G,B,x,ze,Y,W,z,se,k,A,Ge,ke,ie,xe],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.partial[_ngcontent-%COMP%]{color:var(--base-9);font-style:italic}"],changeDetection:0})};var P=class a{#t=p(N);#e=p(R);#o=p(oe);#n=p(ve);#i=p(w);backupId=_(null);backup=_(null);destinationTargetUrl=_(null);selectFilesForm=Je();optionsForm=Qe();encryptionForm=Ke();optionsFormSignal=pe(this.optionsForm.valueChanges);selectFilesFormSignal=pe(this.selectFilesForm.valueChanges);selectOption=_(null);versionOptionsLoading=_(!1);versionOptions=_([]);isSubmitting=_(!1);isFileRestore=_(!1);isFullWidthPage=_(!1);#s=_("");#l=_(null);#a=null;testSignal=this.#s.asReadonly();testErrorMessage=this.#l.asReadonly();#p=v(()=>{let i=this.destinationTargetUrl(),e=this.#s(),t=this.#a;this.#a=i,!(e==="testing"||t===null||t===i)&&(this.#s.set(""),this.#l.set(null))});init(i,e=!1){this.backupId.set(i),this.isFileRestore.set(e),e&&this.#t.navigate(["/restore-from-files/destination"]),e||this.getBackup(!0)}setTestState(i,e){this.#s.set(i),this.#l.set(e??null)}updateTargetUrl(i){this.destinationTargetUrl.set(i)}submit(){this.isSubmitting.set(!0);let i=this.backupId();this.backup()?.Backup?.IsTemporary??!1?this.#i.postApiV1BackupByIdCopytotemp({id:this.backupId()??""}).subscribe({next:t=>{this.#r(t.ID??"")},error:t=>this.showErrorDialog($localize`An error occurred while copying the backup to a temporary location: ${t.message}`)}):this.#r(i??"")}showErrorDialog(i){this.#n.open(K,{data:{title:$localize`Error occured`,message:i,confirmText:$localize`OK`,cancelText:void 0},closed:e=>{}})}#r(i){let e=this.optionsForm.value,t=this.selectFilesForm.value,o=this.selectOption(),n=this.versionOptions()?.find(s=>s.Version===(o&&parseInt(o)));this.#i.postApiV1BackupByIdRestore({id:i??"",requestBody:{paths:t.filesToRestore?.split("\0").map(s=>s.endsWith("/")||s.endsWith("\\")?`${s}*`:s)??[],passphrase:t.passphrase??null,time:n?.Time,restore_path:e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!e.includeMetadata}}).pipe(O(()=>this.isSubmitting.set(!1))).subscribe({next:s=>{this.#t.navigate([`./${s.ID}`,"progress"],{relativeTo:this.#e})},error:s=>{console.error("restore error",s)}})}exit(){this.#n.open(K,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:i=>{i&&(this.#_(),this.#t.navigate(["/"]))}})}getVersionOptions(){this.versionOptions()}loadFilesetsWithRetryv2(i,e=2){return this.#i.postApiV2BackupListFilesets({requestBody:{BackupId:i}}).pipe(Oe(t=>{let o=t?.error?.body?.StatusCode==="EncryptedStorageNoPassphrase",n=t?.error?.body?.StatusCode==="FolderMissing",s=t?.error?.body?.StatusCode==="EmptyRemoteFolder";return o||n||s||e===0?Te(()=>t):Ee(1e3).pipe(he(()=>this.loadFilesetsWithRetryv2(i,e-1)))}))}getBackup(i=!1){let e=this.backupId();this.versionOptionsLoading.set(!0),this.#o.hasV2ListOperations()?re([this.#i.getApiV1BackupById({id:e}),this.loadFilesetsWithRetryv2(e)]).pipe(H(1),O(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([t,o])=>{if(o.Error)throw new Error(o.Error);if(!(t.Backup?.IsTemporary??!0)&&t?.Backup?.DBPathExists===!1){this.#n.open(K,{data:{title:$localize`Missing Local Database`,message:$localize`The local database for this backup is missing. Please repair or recreate the local database before restoring.`,confirmText:$localize`OK`,cancelText:void 0},closed:s=>{this.#t.navigate(["/backup",e,"database"])}});return}this.versionOptions.set((o.Data??[]).map(s=>({Version:s.Version??-1,IsFullBackup:s.IsFullBackup??void 0,Time:s.Time??"<missing>",FileCount:s.FileCount??void 0,FileSizes:s.FileSizes??void 0}))),this.backup.set(t)},error:t=>{let o=t?.error?.body?.StatusCode==="EncryptedStorageNoPassphrase",n=t?.error?.body?.StatusCode==="FolderMissing",s=t?.error?.body?.StatusCode==="EmptyRemoteFolder",u=$localize`An error occurred while loading the backup filesets: ${t.message}`;o&&(u=$localize`The remote storage is encrypted. Please enter the passphrase to access the backup.`),n&&(u=$localize`The backup storage folder was not found.`),s&&(u=$localize`The backup storage folder does not contain any filesets.`),this.#n.open(K,{data:{title:$localize`Failed to load backup filesets`,message:u,confirmText:$localize`OK`,cancelText:void 0},closed:E=>{this.#t.navigate([o?"/restore-from-files/encryption":"/restore-from-files/destination"])}})}}):re([this.#i.getApiV1BackupById({id:e}),this.#i.getApiV1BackupByIdFilesets({id:e}).pipe(fe(3))]).pipe(H(1),O(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([t,o])=>{this.versionOptions.set(o.map(n=>({Version:n.Version??-1,IsFullBackup:(n.IsFullBackup??1)==1,Time:n.Time??"<missing>",FileCount:n.FileCount??void 0,FileSizes:n.FileSizes??void 0}))),this.backup.set(t)}})}#_(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||a)};static \u0275prov=Ce({token:a,factory:a.\u0275fac,providedIn:"root"})};var U=new X,Qe=()=>U.group({restoreFrom:U.control("orignal"),restoreFromPath:U.control(""),handleExisting:U.control("overwrite"),permissions:U.control(!1),includeMetadata:U.control(!0)}),me=class a{#t=p(P);#e=p(N);#o=p(R);optionsForm=this.#t.optionsForm;optionsFormSignal=this.#t.optionsFormSignal;isSubmitting=this.#t.isSubmitting;goBack(){this.#e.navigate(["select-files"],{relativeTo:this.#o.parent})}submit(){this.#t.submit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["app-advanced-options-settings"]],decls:42,vars:7,consts:()=>{let i;i=$localize`Restore options`;let e;e=$localize`Where do you want to restore files to?`;let t;t=$localize` Original location ${"\uFFFD#9\uFFFD\uFFFD/#9\uFFFD"}:TAG_INPUT:`;let o;o=$localize` Pick location ${"\uFFFD#12\uFFFD\uFFFD/#12\uFFFD"}:TAG_INPUT:`;let n;n=$localize`How do you want to handle existing files?`;let s;s=$localize` Overwrite ${"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"}:TAG_INPUT:`;let u;u=$localize` Save different versions with timestamp in file name ${"\uFFFD#25\uFFFD\uFFFD/#25\uFFFD"}:TAG_INPUT:`;let E;E=$localize`Metadata settings`;let I;I=$localize` Restore file metadata ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let J;J=$localize` Restore read/write permissions ${"\uFFFD#34\uFFFD\uFFFD/#34\uFFFD"}:TAG_INPUT:`;let ge;ge=$localize`${"\uFFFD#38\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let Fe;return Fe=$localize`${"\uFFFD#41\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#41\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `,[["formRef",""],i,e,t,o,n,s,u,E,I,J,ge,Fe,[3,"submit","formGroup"],[1,"title-30"],[3,"disallowToggle"],["title",""],[1,"raised","primary"],["type","radio","name","restoreFrom","value","orignal","formControlName","restoreFrom"],["type","radio","name","restoreFrom","value","pickLocation","formControlName","restoreFrom"],[3,"disabled","enableCreateFolder"],["for","path"],["type","text","id","path","formControlName","restoreFromPath"],["type","radio","name","handleExisting","value","overwrite","formControlName","handleExisting"],["type","radio","name","handleExisting","value","saveTimestamp","formControlName","handleExisting"],[1,"primary","raised"],["type","checkbox","formControlName","includeMetadata"],["type","checkbox","formControlName","permissions"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"]]},template:function(e,t){if(e&1){let o=j();r(0,"form",13,0),f("submit",function(){return h(o),C(t.submit())}),r(2,"h3",14),S(3,1),l(),r(4,"app-toggle-card",15),L(5,16),S(6,2),$(),r(7,"sh-radio",17),m(8,3),c(9,"input",18),g(),l(),r(10,"sh-radio",17),m(11,4),c(12,"input",19),g(),l(),r(13,"app-file-tree",20)(14,"label",21),q(15,"Path"),l(),c(16,"input",22),l()(),r(17,"app-toggle-card",15),L(18,16),S(19,5),$(),r(20,"sh-radio",17),m(21,6),c(22,"input",23),g(),l(),r(23,"sh-radio",17),m(24,7),c(25,"input",24),g(),l()(),r(26,"app-toggle-card"),L(27,16),S(28,8),$(),r(29,"sh-toggle",25),m(30,9),c(31,"input",26),g(),l(),r(32,"sh-toggle",25),m(33,10),c(34,"input",27),g(),l()(),r(35,"div",28)(36,"button",29),f("click",function(){return h(o),C(t.goBack())}),m(37,11),c(38,"sh-icon"),g(),l(),r(39,"button",30),m(40,12),c(41,"sh-icon"),g(),l()()()}if(e&2){let o;F("formGroup",t.optionsForm),d(4),F("disallowToggle",!0),d(9),F("disabled",((o=t.optionsFormSignal())==null?null:o.restoreFrom)!=="pickLocation")("enableCreateFolder",!0),d(4),F("disallowToggle",!0),d(22),Ie("loader",t.isSubmitting())}},dependencies:[Y,V,G,We,Xe,B,x,W,z,ne,se,Be,we,k,A],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};export{Qe as a,me as b,Ke as c,_e as d,Je as e,de as f,P as g};
@@ -1 +1 @@
1
- import{a as S}from"./chunk-NJEX2N4Q.js";import"./chunk-6LTGTS6B.js";import"./chunk-DVDTYV66.js";import"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import"./chunk-N5SC4SKW.js";import"./chunk-Z3EPZZGY.js";import"./chunk-UKQFDBNO.js";import{c as O,e as C,f as d}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{y as M}from"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-TDKBGGNK.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-6OPAGPKF.js";import{Ab as e,Bb as t,Cb as l,Sb as n,bb as A}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var s=class a{static \u0275fac=function(o){return new(o||a)};static \u0275cmp=A({type:a,selectors:[["app-about"]],decls:19,vars:0,consts:()=>{let _;_=$localize`General`;let o;o=$localize`Changelog`;let r;r=$localize`Libraries`;let g;g=$localize`System info`;let u;u=$localize`Server settings`;let T;T=$localize`Logs`;let c;return c=$localize`Crash log`,[_,o,r,g,u,T,c,[1,"content"],[1,"primary"],["tab","","routerLink","/about/general","routerLinkActive","active"],["tab","","routerLink","/about/changelog","routerLinkActive","active"],["tab","","routerLink","/about/libraries","routerLinkActive","active"],["tab","","routerLink","/about/system-info","routerLinkActive","active"],["tab","","routerLink","/about/server-settings","routerLinkActive","active"],["tab","","routerLink","/about/logs","routerLinkActive","active"],["tab","","routerLink","/about/crashlogs","routerLinkActive","active"]]},template:function(o,r){o&1&&(l(0,"app-status-bar"),e(1,"div",7)(2,"sh-tabs",8)(3,"button",9),n(4,0),t(),e(5,"button",10),n(6,1),t(),e(7,"button",11),n(8,2),t(),e(9,"button",12),n(10,3),t(),e(11,"button",13),n(12,4),t(),e(13,"button",14),n(14,5),t(),e(15,"button",15),n(16,6),t()(),e(17,"section"),l(18,"router-outlet"),t()())},dependencies:[S,M,O,C,d],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:0}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:1rem 0}.content[_ngcontent-%COMP%] sh-tabs[_ngcontent-%COMP%]{margin:0 2rem}.content[_ngcontent-%COMP%] section[_ngcontent-%COMP%]{padding-left:2rem}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:2rem}"],changeDetection:0})};export{s as default};
1
+ import{a as S}from"./chunk-NJEX2N4Q.js";import"./chunk-6LTGTS6B.js";import"./chunk-DVDTYV66.js";import"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import"./chunk-N5SC4SKW.js";import"./chunk-Z3EPZZGY.js";import"./chunk-UKQFDBNO.js";import{c as O,e as C,f as d}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{y as M}from"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-TDKBGGNK.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-6OPAGPKF.js";import{Ab as e,Bb as t,Cb as l,Sb as n,bb as A}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var s=class a{static \u0275fac=function(o){return new(o||a)};static \u0275cmp=A({type:a,selectors:[["app-about"]],decls:19,vars:0,consts:()=>{let _;_=$localize`General`;let o;o=$localize`Changelog`;let r;r=$localize`Libraries`;let g;g=$localize`System info`;let u;u=$localize`Server settings`;let T;T=$localize`Logs`;let c;return c=$localize`Crash log`,[_,o,r,g,u,T,c,[1,"content"],[1,"primary"],["tab","","routerLink","/about/general","routerLinkActive","active"],["tab","","routerLink","/about/changelog","routerLinkActive","active"],["tab","","routerLink","/about/libraries","routerLinkActive","active"],["tab","","routerLink","/about/system-info","routerLinkActive","active"],["tab","","routerLink","/about/server-settings","routerLinkActive","active"],["tab","","routerLink","/about/logs","routerLinkActive","active"],["tab","","routerLink","/about/crashlogs","routerLinkActive","active"]]},template:function(o,r){o&1&&(l(0,"app-status-bar"),e(1,"div",7)(2,"sh-tabs",8)(3,"button",9),n(4,0),t(),e(5,"button",10),n(6,1),t(),e(7,"button",11),n(8,2),t(),e(9,"button",12),n(10,3),t(),e(11,"button",13),n(12,4),t(),e(13,"button",14),n(14,5),t(),e(15,"button",15),n(16,6),t()(),e(17,"section"),l(18,"router-outlet"),t()())},dependencies:[S,M,O,C,d],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:0}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:1rem 0}.content[_ngcontent-%COMP%] sh-tabs[_ngcontent-%COMP%]{margin:0 2rem 2rem}.content[_ngcontent-%COMP%] section[_ngcontent-%COMP%]{padding:0}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:2rem}"],changeDetection:0})};export{s as default};
@@ -1 +1 @@
1
- import{a as He}from"./chunk-DELLEGXW.js";import{a as Ve}from"./chunk-VTSUHAP5.js";import{a as ze,c as Y,e as ee,i as te,k as Ge,s as ie}from"./chunk-N5SC4SKW.js";import{A as We,a as De,d as Re,e as Ie,f as Ae,l as Z,n as Be,p as Le,t as ke}from"./chunk-H7K35UUX.js";import{h as $e}from"./chunk-NOPMCS2Z.js";import{ea as we}from"./chunk-RUXCS4ZK.js";import{Ab as c,Ac as J,B as _e,Bb as p,Bc as ye,Cb as K,H as se,Hc as xe,Ib as le,Jb as W,Oc as A,Pc as B,Qb as Pe,Ra as g,Rb as Te,Sb as $,Tb as be,Tc as de,Ub as Ee,Uc as P,Vc as pe,Wb as w,Yb as u,Zb as Q,_ as X,_b as I,bb as q,ea as v,ec as ae,fa as F,fc as Me,gb as G,gc as ce,hc as U,ic as x,lc as E,mc as ve,n as he,nc as Fe,oa as b,oc as Se,qc as V,r as j,rc as H,sc as z,tb as me,ub as S,vb as N,x as ge,xb as fe,yb as Ce,yc as Ne,zb as y,zc as Oe}from"./chunk-HNWRQABR.js";import{a as oe,b as re}from"./chunk-EUDKD2JW.js";var et=["treeContainer"],tt=["formRef"],it=[[["label"]],[["label"]],[["input"]]],nt=["label","label","input"],ot=o=>({children:o,level:0}),je=o=>({$implicit:o}),rt=(o,t)=>({children:o,level:t}),st=()=>({maxWidth:"700px",width:"100%"}),lt=(o,t)=>t.id;function at(o,t){if(o&1){let e=W();c(0,"sh-button-group")(1,"button",19),w("click",function(){v(e);let n=u();return F(n.pathDiscoveryMethod.set("browse"))}),$(2,4),p(),c(3,"button",19),w("click",function(){v(e);let n=u();return F(n.pathDiscoveryMethod.set("path"))}),$(4,5),p()()}if(o&2){let e=u();g(),x("active",e.pathDiscoveryMethod()==="browse"),g(2),x("active",e.pathDiscoveryMethod()==="path")}}function ct(o,t){o&1&&K(0,"sh-progress-bar",12)}function dt(o,t){o&1&&(c(0,"sh-icon",24),E(1,"caret-down"),p())}function pt(o,t){o&1&&K(0,"sh-icon",24)}function ut(o,t){o&1&&(c(0,"sh-icon",24),E(1,"caret-right"),p())}function ht(o,t){o&1&&(c(0,"sh-icon",22),E(1,"folder-open"),p())}function gt(o,t){o&1&&(c(0,"sh-icon",22),E(1,"folder-user"),p())}function _t(o,t){o&1&&(c(0,"sh-icon",22),E(1,"file"),p())}function mt(o,t){o&1&&(c(0,"sh-icon",22),E(1,"folder"),p())}function ft(o,t){if(o&1&&(S(0,dt,2,0,"sh-icon",24)(1,pt,1,0,"sh-icon",24)(2,ut,2,0,"sh-icon",24),S(3,ht,2,0,"sh-icon",22)(4,gt,2,0,"sh-icon",22)(5,_t,2,0,"sh-icon",22)(6,mt,2,0,"sh-icon",22)),o&2){let e=u(2).$implicit;N(e.children.length?0:e.cls==="file"?1:2),g(3),N(e.children.length?3:e.id==="%HOME%"?4:e.cls==="file"?5:6)}}function Ct(o,t){o&1&&(c(0,"sh-icon",22),E(1,"desktop-tower"),p())}function Pt(o,t){o&1&&le(0)}function Tt(o,t){if(o&1&&G(0,Pt,1,0,"ng-container",13),o&2){let e=u(2).$implicit,i=u().$implicit;u();let n=ce(7);y("ngTemplateOutlet",n)("ngTemplateOutletContext",J(5,je,ye(2,rt,e.children,i.level+1)))}}function bt(o,t){if(o&1){let e=W();c(0,"div",20,3),w("click",function(){v(e);let n=u().$implicit,r=u(2);return F(r.toggleNode(n.id,n))}),c(2,"div",21),S(3,ft,7,2)(4,Ct,2,0,"sh-icon",22),p(),c(5,"div",23),w("click",function(n){v(e);let r=u().$implicit,a=u(2);return F(a.toggleSelectedNode(n,r))}),E(6),p()(),S(7,Tt,1,7,"ng-container")}if(o&2){let e=u().$implicit,i=u().$implicit,n=u();x("accepted",e.accepted===!0)("active",e.evalState===n.TreeEvalEnum.Included)("indeterminate",e.isIndeterminate)("open",e.children.length)("usually-hidden",e.hidden)("root",i.level===0),g(2),x("file",e.cls==="file"),g(),N(e.id!=="/"?3:4),g(3),Fe(" ",e.text," "),g(),N(e.children.length>0?7:-1)}}function Et(o,t){if(o&1&&S(0,bt,8,17),o&2){let e=t.$implicit,i=u(2);N(e.hidden&&i._showHiddenNodes()||!e.hidden?0:-1)}}function Mt(o,t){if(o&1&&(c(0,"sh-list"),fe(1,Et,1,1,null,null,lt),p()),o&2){let e=t.$implicit;U("padding-left",e.level*.25,"rem"),g(),Ce(e.children)}}function vt(o,t){o&1&&le(0)}function Ft(o,t){if(o&1){let e=W();c(0,"sh-toggle",25),w("click",function(){v(e);let n=u();return F(n._showHiddenNodes.set(!n._showHiddenNodes()))}),$(1,6),p()}if(o&2){let e=u();x("active",e._showHiddenNodes()),g(),be(e.showFiles()?"files":"folders"),Ee(1)}}function St(o,t){if(o&1){let e=W();c(0,"button",26),w("click",function(){v(e);let n=u();return F(n.openCreateFolderDialog())}),$(1,7),p()}if(o&2){let e=u();y("disabled",!e.isCurrentPathFolder())}}function Nt(o,t){if(o&1){let e=W();c(0,"sh-dialog",27),z("isOpenChange",function(n){v(e);let r=u();return H(r.createFolderDialogOpen,n)||(r.createFolderDialogOpen=n),F(n)}),c(1,"header",28)(2,"h2"),$(3,8),p()(),c(4,"div",29)(5,"div"),E(6," Folder will be created under "),c(7,"pre"),E(8),p()(),c(9,"sh-form-field")(10,"textarea",30),z("ngModelChange",function(n){v(e);let r=u();return H(r.createFolderPath,n)||(r.createFolderPath=n),F(n)}),p()()(),c(11,"footer",31)(12,"button",32),w("click",function(){v(e);let n=u();return F(n.closeCreateFolderDialog(!1))}),E(13,"Cancel"),p(),c(14,"button",33),w("click",function(){v(e);let n=u();return F(n.closeCreateFolderDialog(!0))}),Pe(15,9),K(16,"sh-icon"),Te(),p()()()}if(o&2){let e,i=u();V("isOpen",i.createFolderDialogOpen),y("options",Oe(5,st)),g(8),ve(i.currentPath()),g(2),V("ngModel",i.createFolderPath),g(4),y("disabled",!((e=i.createFolderPath())!=null&&e.length))}}var Xe=(r=>(r[r.ExcludedByParent=-2]="ExcludedByParent",r[r.Excluded=-1]="Excluded",r[r.None=0]="None",r[r.Included=1]="Included",r[r.IncludedByParent=2]="IncludedByParent",r))(Xe||{}),M="/",ue=class o{#t=X($e);#n=X(Ve);#d=X(Ie);multiSelect=P(!1);disabled=P(!1);showFiles=P(!1);selectFiles=P(!1);accepts=P(null);startingPath=P(null);rootPaths=P([]);initialNodes=P([]);backupSettings=P(null);pathRefreshTrigger=P(!1);showHiddenNodes=P(!1);enableCreateFolder=P(!1);hideShortcuts=P(!1);includes=de();excludes=de();_showHiddenNodes=b(!1);createFolderDialogOpen=b(!1);createFolderPath=b(null);treeContainerRef=pe("treeContainer");formRef=pe("formRef");pathDiscoveryMethod=b("browse");isLoading=b(!1);currentPath=b("/");#o=b(null);treeSearchQuery=b("");treeNodes=b([]);isWindows=A(()=>this.#n.systemInfo()?.OSType==="Windows");pathDelimiter=A(()=>this.isWindows()?"\\":"/");filterGroups=this.#n.filterGroups();isByBackupSettings=A(()=>{let t=this.backupSettings();return!(t===void 0||t?.id===void 0||t?.time===void 0)});searchableTreeNodes=A(()=>{let t=this.treeSearchQuery();return t?this.treeNodes().filter(e=>e.text?.toLowerCase().includes(t.toLowerCase())):this.treeNodes()});TreeEvalEnum=Xe;treeStructure=A(()=>{let t=this.showHiddenNodes(),e=this.currentPath().split("\0").filter(l=>l!==""&&l!==M),i=structuredClone(e);for(let l=0;l<i.length;l++){let f=i[l].slice(1);if(f.startsWith("{")&&f.endsWith("}")){let m=f.slice(1,-1),d=this.filterGroups?.FilterGroups[m];if(d&&d.length){let O=d.map(C=>`-${C}`);i.splice(l,1,...O)}}}let n=this.searchableTreeNodes(),r=this.rootPaths(),a=this.accepts(),_=this.pathDelimiter(),s=[];return r.length>0?s=r.map(l=>{let h=this.#s(i,l,"folder",null);return{id:l,resolvedpath:l,text:l,parentPath:"",children:[],evalState:h,isIndeterminate:!1,cls:this.#e(l,_)?"folder":"file"}}):s=[{id:M,resolvedpath:M,text:$localize`Computer`,parentPath:"",children:[],evalState:0,isIndeterminate:!1,cls:"folder"}],s.map(l=>{let h=new Map,f=l?.id;a&&(l.accepted=!0),h.set(l.id,l);let m=r.length>0?n.filter(d=>d.parentPath.startsWith(l.id)):n;for(let d of m){let C=(r.length>0?d.id.replace(f??"",""):d.id).split(_).filter(Boolean),T="",D=l;for(let L of C){if(T+=L+_,!h.has(T)){let ne=d.hidden===!0&&t?0:this.#s(i,d.id,d.cls,D),R={id:d.id,isIndeterminate:this.isIndeterminate(i,d.id),evalState:ne,parentPath:T,resolvedpath:d.cls=="folder"?this.#r(d.resolvedpath):T,hidden:d.hidden,text:d.text,cls:d.cls,children:[]};a&&(R.accepted=this.matchAccepts(a,R)),h.set(T,R),D.children.push(R)}D=h.get(T)}}return l}),s});#r(t){let e=this.pathDelimiter();return t?t.endsWith(e)||t===M?t:t+e:M}#s(t,e,i,n){if(n&&n.evalState===-1)return-2;let r=0,a=this.pathDelimiter(),_=t.filter(h=>!h.startsWith("-")&&!h.startsWith("+")),s=t.filter(h=>h.startsWith("-")||h.startsWith("+")),l=this.multiSelect();if(_.length===0)return r;for(let h=0;h<_.length;h++){let f=_[h];if(e===f){r=1;break}if(!l||!this.#e(f,a))continue;if(e?.startsWith(f)){r=1;break}}if(s.length===0)return r;for(let h=0;h<s.length;h++){let f=s[h],m=f.slice(1),d=f.startsWith("-")?-1:1;if(this.#e(m,a)){if(i!=="folder")continue;if(e===m){r=d;break}}if(m.startsWith("*")&&m.endsWith(`*${a}`)){if(i!=="folder")continue;let C=m.slice(1,-2);if(C==="")break;if(e?.includes(C+a)){r=d;break}}if(m.startsWith("[.*")&&m.endsWith(`[^\\${a}]*]`)){if(i!=="file")continue;let C=m.slice(3,-7);if(new RegExp(C).test(e)){r=d;break}}if(m.startsWith("[")&&m.endsWith("]")){let C=m.slice(1,-1),T=this.translateCSharpRegex(C);if(new RegExp(`${T}`).test(e)){r=d;break}}if(m.startsWith("*.")){if(i!=="file"||m.replace("*.","").length===0)continue;if(this.#l(e,m,!0)){r=d;break}}if(m==="")continue;if(m===e){r=d;break}if(this.#l(e,m,!0)){r=d;break}}return r}translateCSharpRegex(t){let e=t;e=e.replace(/^@/,"");let i=/\(\?<(?<name>\w+)>(?<pattern>[^)]+)\)/g;return e=e.replace(i,(n,r,a)=>`(${a})`),e=e.replace(/\\/g,"\\\\"),e}isIndeterminate(t,e){return t.filter(i=>!i.startsWith("-")&&this.#e(i,this.pathDelimiter())).some(i=>i.startsWith(e))}isCurrentPathFolder(){let t=this.currentPath();return t?t.endsWith(this.pathDelimiter())||t.startsWith("%")&&t.endsWith("%")&&!t.includes(this.pathDelimiter()):!1}#l(t,e,i=!1){let n=e.replace(/\*/g,".*").replace(/\?/g,".").replace(/\[!([^\]]+)\]/g,"[^$1]");return new RegExp(`${n}${i?"$":""}`).test(t)}showHiddenNodesEffect=B(()=>this._showHiddenNodes.set(this.showHiddenNodes()));pathDiscoveryMethodEffect=B(()=>{let t=this.pathDiscoveryMethod(),e=this.#o();t==="browse"&&e&&this.currentPath.set(e.value)});matchAccepts(t,e){if(!t||e.cls==="folder"||e.id===M)return!0;let i=t.split(",");if(i.length===0)return!0;let n="."+e.id.slice(e.id.indexOf("."));return n?i.some(r=>n.endsWith(r)):!1}currentPathEffect=B(()=>{let t=this.#o();t&&(t.value=this.currentPath(),t.dispatchEvent(new Event("input")))});inputValueChangeAbortController=null;inputRefEffect=B(()=>{let t=this.formRef()?.nativeElement?.querySelector("input");t&&(this.#p(t),this.inputValueChangeAbortController&&this.inputValueChangeAbortController.abort(),this.inputValueChangeAbortController=new AbortController,t.addEventListener("inputValueChanged",e=>{this.currentPath.set(e.detail.value)},{signal:this.inputValueChangeAbortController.signal}),this.#o.set(t),t.autocomplete="off")});ngOnInit(){let t=this.startingPath();if(t)this.currentPath.set(t),this.#g(t);else{let e=this.rootPaths(),i=this.initialNodes();e&&e.length>0?(i&&i.length>0&&this.treeNodes.set(i.map(n=>({id:n.id,leaf:n.leaf,cls:n.cls,text:n.text,iconCls:n.iconCls,fileSize:n.fileSize,resolvedpath:n.resolvedpath,parentPath:this.getParentPath(n.id??"")}))),this.#i(null,e[0])):this.#i(null,M)}}getParentPath(t){let e=this.pathDelimiter(),i=t.split(e);return i.length<=1?M:(i.pop(),i.length!==0&&i.pop(),i.join(e)+e)}toggleSelectedNode(t,e){if(e.id===M||(t.stopPropagation(),e.evalState===-2))return;if(this.selectFiles()&&e.cls==="folder"){this.toggleNode(e.id,e);return}if(this.accepts()&&!e.accepted)return;let n=this.currentPath().split("\0").filter(s=>s!==""&&s!==M),a=this.isChildOfSelected(e)?`-${e.id}`:e.id,_=this.#e(e.id,this.pathDelimiter());if(this.multiSelect())if(n.includes(e.id))this.currentPath.set(n.filter(s=>s!==e.id&&!(_&&s.startsWith(a))).join("\0"));else if(n.some(s=>s==a))this.currentPath.set(n.filter(s=>s!==a).join("\0"));else{let s=_?n.filter(l=>!l.startsWith(e.id)):n;this.currentPath.set([...s,a].join("\0"))}else n.includes(e.id)?this.currentPath.set(n.filter(s=>s!==e.id).join("\0")):this.currentPath.set(e.id)}isChildOfSelected(t){return this.currentPath().split("\0").filter(i=>i!==""&&i!==M&&this.#e(i,this.pathDelimiter())).some(i=>t.id?.startsWith(i)||`-${t.id}`.startsWith(i))}toggleNode(t,e=null){e?.cls==="folder"&&(e?.children.length?this.treeNodes.update(i=>i.filter(n=>!n.id?.startsWith(e.id)||n.id===e.id)):this.#i(e,t))}openCreateFolderDialog(){return this.createFolderPath.set(null),this.createFolderDialogOpen.set(!0),!1}closeCreateFolderDialog(t){if(t&&this.createFolderPath()?.length&&this.isCurrentPathFolder()){let e=this.createFolderPath()?.trim();if(e){let i=this.currentPath(),n=this.#r(e),r=i+n;this.#t.postApiV1RemoteoperationCreate({requestBody:{path:"file://"+r}}).subscribe({next:()=>{this.currentPath.set(r),this.#i(null,i),setTimeout(()=>{this.#a()},500),this.createFolderDialogOpen.set(!1)},error:a=>{let _=a?.message?.match(/user-information\s*:\s*(.*?)(?:\s*,|$)/i),s=_?_[1]:a?.message||$localize`An error occurred while trying to create the folder.`;this.#d.open(He,{data:{title:$localize`Cannot create folder`,message:s,confirmText:$localize`OK`,cancelText:void 0}})}})}}else this.createFolderDialogOpen.set(!1);return!1}#a(){setTimeout(()=>{let e=this.treeContainerRef()?.nativeElement?.querySelector(".active");e&&e.scrollIntoView({behavior:"smooth",block:"center"})},100)}#p(t){return Object.defineProperty(t,"value",{configurable:!0,get(){return Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").get.call(this)},set(e){return Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").set.call(this,e),this.dispatchEvent(new CustomEvent("inputValueChanged",{bubbles:!0,cancelable:!0,detail:{value:e}})),e}}),t}#u(t){return this.#t.postApiV1Filesystem({showHidden:!0,requestBody:{path:t},onlyFolders:!this.showFiles()})}#h(t){let e=this.backupSettings();if(this.#n.hasV2ListOperations())return this.#t.postApiV2BackupListFolder({requestBody:{BackupId:e.id,Time:e.time,Paths:t?[t]:null,PageSize:0,Page:0}}).pipe(j(i=>i.Data??[]));{let i={id:e.id+"",prefixOnly:!1,folderContents:!0,time:e.time,filter:t?"@"+t:void 0};return this.#t.getApiV1BackupByIdFiles(i).pipe(j(n=>n.Files??[]))}}#c(t){return this.isByBackupSettings()?this.#h(t):this.#u(t)}#g(t){let e=this.pathDelimiter(),i=t.split("\0").filter(s=>s.startsWith("-")).map(s=>s.slice(1,-1)),n=t.split("\0").filter(s=>!s.startsWith("-")).filter(Boolean),r=n.map(s=>{let l=s.split(e);return l.at(-1)!==""&&l.pop(),l}),a=[M];r.forEach(s=>{s.forEach((l,h)=>{let f=s.slice(0,h+1).join(e);f!==""&&(a.includes(f)||a.push(f))})}),this.isLoading.set(!0);let _=a.map(s=>this.#c(s).pipe(j(l=>({status:"success",value:l,url:s})),_e(l=>he({status:"error",value:l,url:s}))));ge(_).pipe(se(()=>this.isLoading.set(!1))).subscribe({next:s=>{let l=s.filter(f=>f.status==="success"),h=s.filter(f=>f.status==="error");this.treeNodes.update(f=>{let m=l.flatMap(O=>O.value.map(C=>{let T=C.id,D=C.id.startsWith("%")&&C.id.endsWith("%")?C.resolvedpath+e:C.id,L=T&&T.split(e).filter(Boolean).slice(0,-1).join(e),ne=T&&T.split(e).filter(Boolean).join(e),R=e+ne,Ke=n.findIndex(k=>this.multiSelect()?R.startsWith(k):R===k)>-1,Qe=n.findIndex(k=>k===T)>-1,Ue=i.findIndex(k=>k===R)>-1;return re(oe({},C),{cls:this.#e(D,e)||D==M?"folder":"file",parentPath:L.startsWith("%")?L:e+L,isSelected:Ke&&!Ue||Qe})})),d=[...new Map([...f,...m].map(O=>[O.id,O])).values()];return this.#a(),this.hideShortcuts()?d.filter(O=>!O.id.startsWith("%")):d})}})}#e(t,e){return t.startsWith("%")&&t.endsWith("%")||t.endsWith(e)}#i(t=null,e=M){let i=this.pathDelimiter();this.isLoading.set(!0),this.#c(e).pipe(se(()=>this.isLoading.set(!1))).subscribe({next:n=>{let r=this.isByBackupSettings()?n.map(a=>({text:a.Path.split(i).filter(_=>_!=="").pop(),id:a.Path,cls:this.#e(a.Path,i)?"folder":"file",leaf:t!==null,resolvedpath:a.Path,hidden:!1})):n;this.treeNodes.update(a=>{let _=r.map(l=>{let h=this.#e(l.id,i)?"folder":"file";return re(oe({},l),{cls:h,parentPath:e})}),s=[...new Map([...a,..._].map(l=>[l.id,l])).values()];return this.hideShortcuts()?s.filter(l=>!l.id.startsWith("%")):s})}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=q({type:o,selectors:[["app-file-tree"]],viewQuery:function(e,i){e&1&&(ae(i.treeContainerRef,et,5),ae(i.formRef,tt,5)),e&2&&Me(2)},hostVars:2,hostBindings:function(e,i){e&2&&x("disabled",i.disabled())},inputs:{multiSelect:[1,"multiSelect"],disabled:[1,"disabled"],showFiles:[1,"showFiles"],selectFiles:[1,"selectFiles"],accepts:[1,"accepts"],startingPath:[1,"startingPath"],rootPaths:[1,"rootPaths"],initialNodes:[1,"initialNodes"],backupSettings:[1,"backupSettings"],pathRefreshTrigger:[1,"pathRefreshTrigger"],showHiddenNodes:[1,"showHiddenNodes"],enableCreateFolder:[1,"enableCreateFolder"],hideShortcuts:[1,"hideShortcuts"]},outputs:{includes:"includes",excludes:"excludes"},ngContentSelectors:nt,decls:18,vars:17,consts:()=>{let t;t=$localize` Browse path `;let e;e=$localize` Manually type path `;let i;i=$localize` Show hidden ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let n;n=$localize` Create folder `;let r;r=$localize`Enter new folder path`;let a;return a=$localize` Create folder ${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:folder-plus${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["treeContainer",""],["recursiveTree",""],["formRef",""],["treeNode",""],t,e,i,n,r,a,[1,"section"],[1,"browse-files"],[1,"indeterminate","primary"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"footer"],[1,"primary","raised","browse-files-toggle",3,"active"],["shButton","","type","button",1,"small","create-folder",3,"disabled"],[1,"form-field"],[3,"isOpen","options"],["type","button",3,"click"],["action","",3,"click"],[1,"icon"],[1,"primary"],[1,"text",3,"click"],[1,"small"],[1,"primary","raised","browse-files-toggle",3,"click"],["shButton","","type","button",1,"small","create-folder",3,"click","disabled"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click","disabled"]]},template:function(e,i){if(e&1&&(Q(it),S(0,at,5,4,"sh-button-group"),c(1,"div",10),I(2,0,["ngProjectAs","label",5,["label"]]),c(3,"div",11,0),S(5,ct,1,0,"sh-progress-bar",12),G(6,Mt,3,2,"ng-template",null,1,xe)(8,vt,1,0,"ng-container",13),p(),c(9,"div",14),S(10,Ft,2,3,"sh-toggle",15),S(11,St,2,1,"button",16),p()(),c(12,"div",17,2)(14,"sh-form-field"),I(15,1,["ngProjectAs","label",5,["label"]]),I(16,2,["ngProjectAs","input",5,["input"]]),p()(),S(17,Nt,17,6,"sh-dialog",18)),e&2){let n=ce(7);N(i.multiSelect()?-1:0),g(),x("hidden",i.pathDiscoveryMethod()!=="browse"),g(2),x("visualize-accepted",i.accepts()),g(2),N(i.isLoading()?5:-1),g(3),y("ngTemplateOutlet",n)("ngTemplateOutletContext",J(15,je,J(13,ot,i.treeStructure()))),g(2),N(!i.accepts()&&!i.isByBackupSettings()?10:-1),g(),N(i.enableCreateFolder()?11:-1),g(),x("hidden",i.pathDiscoveryMethod()!=="path"),g(5),N(i.createFolderDialogOpen()?17:-1)}},dependencies:[Ae,We,De,Z,Be,Le,Re,we,ie,Y,ee,te],styles:['[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem}.disabled[_nghost-%COMP%]{opacity:.5;-webkit-user-select:none;user-select:none;pointer-events:none;position:relative}.disabled[_nghost-%COMP%]:before{content:"";position:absolute;inset:0;background:transparent}.fill[_nghost-%COMP%]{height:auto;overflow:hidden;flex:1 0}.fill[_nghost-%COMP%] .section[_ngcontent-%COMP%]{height:auto;overflow:hidden;flex:1 0;display:grid;grid-template-columns:1fr auto;grid-template-rows:auto 1fr;grid-template-areas:"label toggle" "tree tree"}.fill[_nghost-%COMP%] .browse-files[_ngcontent-%COMP%]{resize:none;height:initial;grid-area:tree}.fill[_nghost-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.fill[_nghost-%COMP%] sh-toggle[_ngcontent-%COMP%]{grid-area:toggle;flex-direction:row-reverse}.section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.form-field.hidden[_ngcontent-%COMP%]{display:none}.browse-files[_ngcontent-%COMP%]{display:flex;gap:.5rem;padding:.5rem 1rem;height:12.5rem;border:1px solid var(--base-4);border-radius:var(--shape-3);overflow:auto;resize:vertical;background:var(--base-1);position:relative}.browse-files[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]:not(.accepted){opacity:.5}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action].accepted[_ngcontent-%COMP%]{opacity:1}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%]{--list-active-bg: var(--base-3);gap:.125rem;padding:0;height:min-content;min-width:min-content}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]{padding:0;gap:0;border:1px solid transparent}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].active[_ngcontent-%COMP%]{border-color:transparent;--list-active-bg: var(--primary-2)}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].indeterminate[_ngcontent-%COMP%]{border-color:var(--primary-4)}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].usually-hidden[_ngcontent-%COMP%]{opacity:.6}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%]{gap:.25rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]:has(sh-icon:nth-child(2)){width:3rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:1.5rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;height:100%;width:max-content;display:flex;align-items:center}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:3rem;gap:.25rem;height:1.5rem;display:flex;align-items:center;justify-content:center;cursor:pointer}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon.file[_ngcontent-%COMP%]{width:3rem;padding:0 .25rem}.browse-files-toggle[_ngcontent-%COMP%]{color:var(--base-9)}.hidden[_ngcontent-%COMP%]{display:none}.footer[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:space-between;align-items:center}'],changeDetection:0})};var Ot=[[["label"]],[["","prefix",""]],[["","suffix",""]]],yt=["label","[prefix]","[suffix]"];function xt(o,t){if(o&1&&E(0),o&2){let e=t.$implicit,i=u();Se("",e.label,"",i.hasPerSecond()?"/s":"")}}var wt=["throttle-upload","throttle-download"],Dt=[{value:"B",label:"Bytes"},{value:"KB",label:"KB"},{value:"MB",label:"MB"},{value:"GB",label:"GB"},{value:"TB",label:"TB"},{value:"PB",label:"PB"}],Rt=o=>{if(!o||typeof o!="string"||o.length===0)return{size:0,unit:"MB"};let t=o.match(/^(\d+)(bytes|kb|mb|gb|tb|pb|b)$/i);return{size:t?parseInt(t[1],10):0,unit:t?t[2].toUpperCase():"MB"}},qe=class o{customId=P();inputType=P();timespan=b(0);unit=b("MB");sizeOptions=b(Dt);readonly=b(!1);hasPerSecond=A(()=>{let t=this.inputType();return t&&wt.includes(t)});onChange=()=>{};onTouched=()=>{};onChangeEffect=B(()=>{this.onChange(this.getValue())});writeValue(t){if(t){let e=Rt(t);e?queueMicrotask(()=>{this.timespan.set(e.size),this.unit.set(e.unit)}):(this.timespan.set(0),this.unit.set("MB"))}else this.timespan.set(0),this.unit.set("MB")}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.readonly.set(t)}getValue(){return`${this.timespan()}${this.unit()}`}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=q({type:o,selectors:[["app-size"]],inputs:{customId:[1,"customId"],inputType:[1,"inputType"]},features:[Ne([{provide:ze,useExisting:o,multi:!0}])],ngContentSelectors:yt,decls:9,vars:10,consts:[[1,"label"],["type","number",3,"ngModelChange","id","ngModel","disabled"],["value","value","label","label",3,"options","readonly","isClearable"],["type","text",3,"ngModelChange","ngModel"]],template:function(e,i){e&1&&(Q(Ot),c(0,"div",0),I(1,0,["ngProjectAs","label",5,["label"]]),p(),c(2,"sh-form-field")(3,"input",1),z("ngModelChange",function(r){return H(i.timespan,r)||(i.timespan=r),r}),p(),I(4,1),I(5,2),p(),c(6,"sh-select",2)(7,"input",3),z("ngModelChange",function(r){return H(i.unit,r)||(i.unit=r),r}),p(),G(8,xt,1,2,"ng-template"),p()),e&2&&(g(2),me("readonly",i.readonly()||void 0),g(),y("id",i.customId()),V("ngModel",i.timespan),y("disabled",i.readonly()),g(3),U("--miw",0),y("options",i.sizeOptions())("readonly",i.readonly())("isClearable",!1),g(),V("ngModel",i.unit))},dependencies:[ke,Z,ie,Y,Ge,ee,te],styles:['[_nghost-%COMP%]{display:grid;grid-template-areas:"label label" "input unit";grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{grid-area:label;grid-column:1/-1}[_nghost-%COMP%] sh-form-field[_ngcontent-%COMP%]{grid-area:input}[_nghost-%COMP%] sh-select[_ngcontent-%COMP%]{grid-area:unit}'],changeDetection:0})};export{ue as a,Rt as b,qe as c};
1
+ import{a as ze}from"./chunk-DELLEGXW.js";import{a as Ve}from"./chunk-VTSUHAP5.js";import{a as He,c as Z,e as ee,i as te,k as Ge,s as ie}from"./chunk-N5SC4SKW.js";import{A as We,a as De,d as Re,e as Ie,f as Ae,l as Y,n as Be,p as Le,t as ke}from"./chunk-H7K35UUX.js";import{h as $e}from"./chunk-NOPMCS2Z.js";import{ea as we}from"./chunk-RUXCS4ZK.js";import{Ab as c,Ac as J,B as _e,Bb as p,Bc as ye,Cb as K,H as se,Hc as xe,Ib as le,Jb as W,Oc as A,Pc as B,Qb as Pe,Ra as g,Rb as Te,Sb as $,Tb as Ee,Tc as de,Ub as be,Uc as P,Vc as pe,Wb as w,Yb as u,Zb as Q,_ as X,_b as I,bb as q,ea as v,ec as ae,fa as F,fc as Me,gb as G,gc as ce,hc as U,ic as x,lc as b,mc as ve,n as he,nc as Fe,oa as E,oc as Se,qc as V,r as j,rc as z,sc as H,tb as me,ub as S,vb as N,x as ge,xb as fe,yb as Ce,yc as Ne,zb as y,zc as Oe}from"./chunk-HNWRQABR.js";import{a as oe,b as re}from"./chunk-EUDKD2JW.js";var et=["treeContainer"],tt=["formRef"],it=[[["label"]],[["label"]],[["input"]]],nt=["label","label","input"],ot=o=>({children:o,level:0}),je=o=>({$implicit:o}),rt=(o,t)=>({children:o,level:t}),st=()=>({maxWidth:"700px",width:"100%"}),lt=(o,t)=>t.id;function at(o,t){if(o&1){let e=W();c(0,"sh-button-group")(1,"button",19),w("click",function(){v(e);let n=u();return F(n.pathDiscoveryMethod.set("browse"))}),$(2,4),p(),c(3,"button",19),w("click",function(){v(e);let n=u();return F(n.pathDiscoveryMethod.set("path"))}),$(4,5),p()()}if(o&2){let e=u();g(),x("active",e.pathDiscoveryMethod()==="browse"),g(2),x("active",e.pathDiscoveryMethod()==="path")}}function ct(o,t){o&1&&K(0,"sh-progress-bar",12)}function dt(o,t){o&1&&(c(0,"sh-icon",24),b(1,"caret-down"),p())}function pt(o,t){o&1&&K(0,"sh-icon",24)}function ut(o,t){o&1&&(c(0,"sh-icon",24),b(1,"caret-right"),p())}function ht(o,t){o&1&&(c(0,"sh-icon",22),b(1,"folder-open"),p())}function gt(o,t){o&1&&(c(0,"sh-icon",22),b(1,"folder-user"),p())}function _t(o,t){o&1&&(c(0,"sh-icon",22),b(1,"file"),p())}function mt(o,t){o&1&&(c(0,"sh-icon",22),b(1,"folder"),p())}function ft(o,t){if(o&1&&(S(0,dt,2,0,"sh-icon",24)(1,pt,1,0,"sh-icon",24)(2,ut,2,0,"sh-icon",24),S(3,ht,2,0,"sh-icon",22)(4,gt,2,0,"sh-icon",22)(5,_t,2,0,"sh-icon",22)(6,mt,2,0,"sh-icon",22)),o&2){let e=u(2).$implicit;N(e.children.length?0:e.cls==="file"?1:2),g(3),N(e.children.length?3:e.id==="%HOME%"?4:e.cls==="file"?5:6)}}function Ct(o,t){o&1&&(c(0,"sh-icon",22),b(1,"desktop-tower"),p())}function Pt(o,t){o&1&&le(0)}function Tt(o,t){if(o&1&&G(0,Pt,1,0,"ng-container",13),o&2){let e=u(2).$implicit,i=u().$implicit;u();let n=ce(7);y("ngTemplateOutlet",n)("ngTemplateOutletContext",J(5,je,ye(2,rt,e.children,i.level+1)))}}function Et(o,t){if(o&1){let e=W();c(0,"div",20,3),w("click",function(){v(e);let n=u().$implicit,r=u(2);return F(r.toggleNode(n.id,n))}),c(2,"div",21),S(3,ft,7,2)(4,Ct,2,0,"sh-icon",22),p(),c(5,"div",23),w("click",function(n){v(e);let r=u().$implicit,a=u(2);return F(a.toggleSelectedNode(n,r))}),b(6),p()(),S(7,Tt,1,7,"ng-container")}if(o&2){let e=u().$implicit,i=u().$implicit,n=u();x("accepted",e.accepted===!0)("active",e.evalState===n.TreeEvalEnum.Included)("indeterminate",e.isIndeterminate)("open",e.children.length)("usually-hidden",e.hidden)("root",i.level===0),g(2),x("file",e.cls==="file"),g(),N(e.id!=="/"?3:4),g(3),Fe(" ",e.text," "),g(),N(e.children.length>0?7:-1)}}function bt(o,t){if(o&1&&S(0,Et,8,17),o&2){let e=t.$implicit,i=u(2);N(e.hidden&&i._showHiddenNodes()||!e.hidden?0:-1)}}function Mt(o,t){if(o&1&&(c(0,"sh-list"),fe(1,bt,1,1,null,null,lt),p()),o&2){let e=t.$implicit;U("padding-left",e.level*.25,"rem"),g(),Ce(e.children)}}function vt(o,t){o&1&&le(0)}function Ft(o,t){if(o&1){let e=W();c(0,"sh-toggle",25),w("click",function(){v(e);let n=u();return F(n._showHiddenNodes.set(!n._showHiddenNodes()))}),$(1,6),p()}if(o&2){let e=u();x("active",e._showHiddenNodes()),g(),Ee(e.showFiles()?"files":"folders"),be(1)}}function St(o,t){if(o&1){let e=W();c(0,"button",26),w("click",function(){v(e);let n=u();return F(n.openCreateFolderDialog())}),$(1,7),p()}if(o&2){let e=u();y("disabled",!e.isCurrentPathFolder())}}function Nt(o,t){if(o&1){let e=W();c(0,"sh-dialog",27),H("isOpenChange",function(n){v(e);let r=u();return z(r.createFolderDialogOpen,n)||(r.createFolderDialogOpen=n),F(n)}),c(1,"header",28)(2,"h2"),$(3,8),p()(),c(4,"div",29)(5,"div"),b(6," Folder will be created under "),c(7,"pre"),b(8),p()(),c(9,"sh-form-field")(10,"textarea",30),H("ngModelChange",function(n){v(e);let r=u();return z(r.createFolderPath,n)||(r.createFolderPath=n),F(n)}),p()()(),c(11,"footer",31)(12,"button",32),w("click",function(){v(e);let n=u();return F(n.closeCreateFolderDialog(!1))}),b(13,"Cancel"),p(),c(14,"button",33),w("click",function(){v(e);let n=u();return F(n.closeCreateFolderDialog(!0))}),Pe(15,9),K(16,"sh-icon"),Te(),p()()()}if(o&2){let e,i=u();V("isOpen",i.createFolderDialogOpen),y("options",Oe(5,st)),g(8),ve(i.currentPath()),g(2),V("ngModel",i.createFolderPath),g(4),y("disabled",!((e=i.createFolderPath())!=null&&e.length))}}var Xe=(r=>(r[r.ExcludedByParent=-2]="ExcludedByParent",r[r.Excluded=-1]="Excluded",r[r.None=0]="None",r[r.Included=1]="Included",r[r.IncludedByParent=2]="IncludedByParent",r))(Xe||{}),M="/",ue=class o{#t=X($e);#n=X(Ve);#d=X(Ie);multiSelect=P(!1);disabled=P(!1);showFiles=P(!1);selectFiles=P(!1);accepts=P(null);startingPath=P(null);rootPaths=P([]);initialNodes=P([]);backupSettings=P(null);pathRefreshTrigger=P(!1);showHiddenNodes=P(!1);enableCreateFolder=P(!1);hideShortcuts=P(!1);includes=de();excludes=de();_showHiddenNodes=E(!1);createFolderDialogOpen=E(!1);createFolderPath=E(null);treeContainerRef=pe("treeContainer");formRef=pe("formRef");pathDiscoveryMethod=E("browse");isLoading=E(!1);currentPath=E("/");#o=E(null);treeSearchQuery=E("");treeNodes=E([]);isWindows=A(()=>this.#n.systemInfo()?.OSType==="Windows");pathDelimiter=A(()=>this.isWindows()?"\\":"/");filterGroups=this.#n.filterGroups();isByBackupSettings=A(()=>{let t=this.backupSettings();return!(t===void 0||t?.id===void 0||t?.time===void 0)});searchableTreeNodes=A(()=>{let t=this.treeSearchQuery();return t?this.treeNodes().filter(e=>e.text?.toLowerCase().includes(t.toLowerCase())):this.treeNodes()});TreeEvalEnum=Xe;treeStructure=A(()=>{let t=this.showHiddenNodes(),e=this.currentPath().split("\0").filter(l=>l!==""&&l!==M),i=structuredClone(e);for(let l=0;l<i.length;l++){let f=i[l].slice(1);if(f.startsWith("{")&&f.endsWith("}")){let m=f.slice(1,-1),d=this.filterGroups?.FilterGroups[m];if(d&&d.length){let O=d.map(C=>`-${C}`);i.splice(l,1,...O)}}}let n=this.searchableTreeNodes(),r=this.rootPaths(),a=this.accepts(),_=this.pathDelimiter(),s=[];return r.length>0?s=r.map(l=>{let h=this.#s(i,l,"folder",null);return{id:l,resolvedpath:l,text:l,parentPath:"",children:[],evalState:h,isIndeterminate:!1,cls:this.#e(l,_)?"folder":"file"}}):s=[{id:M,resolvedpath:M,text:$localize`Computer`,parentPath:"",children:[],evalState:0,isIndeterminate:!1,cls:"folder"}],s.map(l=>{let h=new Map,f=l?.id;a&&(l.accepted=!0),h.set(l.id,l);let m=r.length>0?n.filter(d=>d.parentPath.startsWith(l.id)):n;for(let d of m){let C=(r.length>0?d.id.replace(f??"",""):d.id).split(_).filter(Boolean),T="",D=l;for(let L of C){if(T+=L+_,!h.has(T)){let ne=d.hidden===!0&&t?0:this.#s(i,d.id,d.cls,D),R={id:d.id,isIndeterminate:this.isIndeterminate(i,d.id),evalState:ne,parentPath:T,resolvedpath:d.cls=="folder"?this.#r(d.resolvedpath):T,hidden:d.hidden,text:d.text,cls:d.cls,children:[]};a&&(R.accepted=this.matchAccepts(a,R)),h.set(T,R),D.children.push(R)}D=h.get(T)}}return l}),s});#r(t){let e=this.pathDelimiter();return t?t.endsWith(e)||t===M?t:t+e:M}#s(t,e,i,n){if(n&&n.evalState===-1)return-2;let r=0,a=this.pathDelimiter(),_=t.filter(h=>!h.startsWith("-")&&!h.startsWith("+")),s=t.filter(h=>h.startsWith("-")||h.startsWith("+")),l=this.multiSelect();if(_.length===0)return r;for(let h=0;h<_.length;h++){let f=_[h];if(e===f){r=1;break}if(!l||!this.#e(f,a))continue;if(e?.startsWith(f)){r=1;break}}if(s.length===0)return r;for(let h=0;h<s.length;h++){let f=s[h],m=f.slice(1),d=f.startsWith("-")?-1:1;if(this.#e(m,a)){if(i!=="folder")continue;if(e===m){r=d;break}}if(m.startsWith("*")&&m.endsWith(`*${a}`)){if(i!=="folder")continue;let C=m.slice(1,-2);if(C==="")break;if(e?.includes(C+a)){r=d;break}}if(m.startsWith("[.*")&&m.endsWith(`[^\\${a}]*]`)){if(i!=="file")continue;let C=m.slice(3,-7);if(new RegExp(C).test(e)){r=d;break}}if(m.startsWith("[")&&m.endsWith("]")){let C=m.slice(1,-1),T=this.translateCSharpRegex(C);if(new RegExp(`${T}`).test(e)){r=d;break}}if(m.startsWith("*.")){if(i!=="file"||m.replace("*.","").length===0)continue;if(this.#l(e,m,!0)){r=d;break}}if(m==="")continue;if(m===e){r=d;break}if(this.#l(e,m,!0)){r=d;break}}return r}translateCSharpRegex(t){let e=t;e=e.replace(/^@/,"");let i=/\(\?<(?<name>\w+)>(?<pattern>[^)]+)\)/g;return e=e.replace(i,(n,r,a)=>`(${a})`),e=e.replace(/\\/g,"\\\\"),e}isIndeterminate(t,e){return t.filter(i=>!i.startsWith("-")&&this.#e(i,this.pathDelimiter())).some(i=>i.startsWith(e))}isCurrentPathFolder(){let t=this.currentPath();return t?t.endsWith(this.pathDelimiter())||t.startsWith("%")&&t.endsWith("%")&&!t.includes(this.pathDelimiter()):!1}#l(t,e,i=!1){let n=e.replace(/\*/g,".*").replace(/\?/g,".").replace(/\[!([^\]]+)\]/g,"[^$1]");return new RegExp(`${n}${i?"$":""}`).test(t)}showHiddenNodesEffect=B(()=>this._showHiddenNodes.set(this.showHiddenNodes()));pathDiscoveryMethodEffect=B(()=>{let t=this.pathDiscoveryMethod(),e=this.#o();t==="browse"&&e&&this.currentPath.set(e.value)});matchAccepts(t,e){if(!t||e.cls==="folder"||e.id===M)return!0;let i=t.split(",");if(i.length===0)return!0;let n="."+e.id.slice(e.id.indexOf("."));return n?i.some(r=>n.endsWith(r)):!1}currentPathEffect=B(()=>{let t=this.#o();t&&(t.value=this.currentPath(),t.dispatchEvent(new Event("input")))});inputValueChangeAbortController=null;inputRefEffect=B(()=>{let t=this.formRef()?.nativeElement?.querySelector("input");t&&(this.#p(t),this.inputValueChangeAbortController&&this.inputValueChangeAbortController.abort(),this.inputValueChangeAbortController=new AbortController,t.addEventListener("inputValueChanged",e=>{this.currentPath.set(e.detail.value)},{signal:this.inputValueChangeAbortController.signal}),this.#o.set(t),t.autocomplete="off")});ngOnInit(){let t=this.startingPath();if(t)this.currentPath.set(t),this.#g(t);else{let e=this.rootPaths(),i=this.initialNodes();e&&e.length>0?(i&&i.length>0&&this.treeNodes.set(i.map(n=>({id:n.id,leaf:n.leaf,cls:n.cls,text:n.text,iconCls:n.iconCls,fileSize:n.fileSize,resolvedpath:n.resolvedpath,parentPath:this.getParentPath(n.id??"")}))),this.#i(null,e[0])):this.#i(null,M)}}getParentPath(t){let e=this.pathDelimiter(),i=t.split(e);return i.length<=1?M:(i.pop(),i.length!==0&&i.pop(),i.join(e)+e)}toggleSelectedNode(t,e){if(e.id===M||(t.stopPropagation(),e.evalState===-2))return;if(this.selectFiles()&&e.cls==="folder"){this.toggleNode(e.id,e);return}if(this.accepts()&&!e.accepted)return;let n=this.currentPath().split("\0").filter(s=>s!==""&&s!==M),a=this.isChildOfSelected(e)?`-${e.id}`:e.id,_=this.#e(e.id,this.pathDelimiter());if(this.multiSelect())if(n.includes(e.id))this.currentPath.set(n.filter(s=>s!==e.id&&!(_&&s.startsWith(a))).join("\0"));else if(n.some(s=>s==a))this.currentPath.set(n.filter(s=>s!==a).join("\0"));else{let s=_?n.filter(l=>!l.startsWith(e.id)):n;this.currentPath.set([...s,a].join("\0"))}else n.includes(e.id)?this.currentPath.set(n.filter(s=>s!==e.id).join("\0")):this.currentPath.set(e.id)}isChildOfSelected(t){return this.currentPath().split("\0").filter(i=>i!==""&&i!==M&&this.#e(i,this.pathDelimiter())).some(i=>t.id?.startsWith(i)||`-${t.id}`.startsWith(i))}toggleNode(t,e=null){e?.cls==="folder"&&(e?.children.length?this.treeNodes.update(i=>i.filter(n=>!n.id?.startsWith(e.id)||n.id===e.id)):this.#i(e,t))}openCreateFolderDialog(){return this.createFolderPath.set(null),this.createFolderDialogOpen.set(!0),!1}closeCreateFolderDialog(t){if(t&&this.createFolderPath()?.length&&this.isCurrentPathFolder()){let e=this.createFolderPath()?.trim();if(e){let i=this.currentPath(),n=this.#r(e),r=i+n;this.#t.postApiV1RemoteoperationCreate({requestBody:{path:"file://"+r}}).subscribe({next:()=>{this.currentPath.set(r),this.#i(null,i),setTimeout(()=>{this.#a()},500),this.createFolderDialogOpen.set(!1)},error:a=>{let _=a?.message?.match(/user-information\s*:\s*(.*?)(?:\s*,|$)/i),s=_?_[1]:a?.message||$localize`An error occurred while trying to create the folder.`;this.#d.open(ze,{data:{title:$localize`Cannot create folder`,message:s,confirmText:$localize`OK`,cancelText:void 0}})}})}}else this.createFolderDialogOpen.set(!1);return!1}#a(){setTimeout(()=>{let e=this.treeContainerRef()?.nativeElement?.querySelector(".active");e&&e.scrollIntoView({behavior:"smooth",block:"center"})},100)}#p(t){return Object.defineProperty(t,"value",{configurable:!0,get(){return Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").get.call(this)},set(e){return Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").set.call(this,e),this.dispatchEvent(new CustomEvent("inputValueChanged",{bubbles:!0,cancelable:!0,detail:{value:e}})),e}}),t}#u(t){return this.#t.postApiV1Filesystem({showHidden:!0,requestBody:{path:t},onlyFolders:!this.showFiles()})}#h(t){let e=this.backupSettings();if(this.#n.hasV2ListOperations())return this.#t.postApiV2BackupListFolder({requestBody:{BackupId:e.id,Time:e.time,Paths:t?[t]:null,PageSize:0,Page:0}}).pipe(j(i=>i.Data??[]));{let i={id:e.id+"",prefixOnly:!1,folderContents:!0,time:e.time,filter:t?"@"+t:void 0};return this.#t.getApiV1BackupByIdFiles(i).pipe(j(n=>n.Files??[]))}}#c(t){return this.isByBackupSettings()?this.#h(t):this.#u(t)}#g(t){let e=this.pathDelimiter(),i=t.split("\0").filter(s=>s.startsWith("-")).map(s=>s.slice(1,-1)),n=t.split("\0").filter(s=>!s.startsWith("-")).filter(Boolean),r=n.map(s=>{let l=s.split(e);return l.at(-1)!==""&&l.pop(),l}),a=[M];r.forEach(s=>{s.forEach((l,h)=>{let f=s.slice(0,h+1).join(e);f!==""&&(a.includes(f)||a.push(f))})}),this.isLoading.set(!0);let _=a.map(s=>this.#c(s).pipe(j(l=>({status:"success",value:l,url:s})),_e(l=>he({status:"error",value:l,url:s}))));ge(_).pipe(se(()=>this.isLoading.set(!1))).subscribe({next:s=>{let l=s.filter(f=>f.status==="success"),h=s.filter(f=>f.status==="error");this.treeNodes.update(f=>{let m=l.flatMap(O=>O.value.map(C=>{let T=C.id,D=C.id.startsWith("%")&&C.id.endsWith("%")?C.resolvedpath+e:C.id,L=T&&T.split(e).filter(Boolean).slice(0,-1).join(e),ne=T&&T.split(e).filter(Boolean).join(e),R=e+ne,Ke=n.findIndex(k=>this.multiSelect()?R.startsWith(k):R===k)>-1,Qe=n.findIndex(k=>k===T)>-1,Ue=i.findIndex(k=>k===R)>-1;return re(oe({},C),{cls:this.#e(D,e)||D==M?"folder":"file",parentPath:L.startsWith("%")?L:e+L,isSelected:Ke&&!Ue||Qe})})),d=[...new Map([...f,...m].map(O=>[O.id,O])).values()];return this.#a(),this.hideShortcuts()?d.filter(O=>!O.id.startsWith("%")):d})}})}#e(t,e){return t.startsWith("%")&&t.endsWith("%")||t.endsWith(e)}#i(t=null,e=M){let i=this.pathDelimiter();this.isLoading.set(!0),this.#c(e).pipe(se(()=>this.isLoading.set(!1))).subscribe({next:n=>{let r=this.isByBackupSettings()?n.map(a=>({text:a.Path.split(i).filter(_=>_!=="").pop(),id:a.Path,cls:this.#e(a.Path,i)?"folder":"file",leaf:t!==null,resolvedpath:a.Path,hidden:!1})):n;this.treeNodes.update(a=>{let _=r.map(l=>{let h=this.#e(l.id,i)?"folder":"file";return re(oe({},l),{cls:h,parentPath:e})}),s=[...new Map([...a,..._].map(l=>[l.id,l])).values()];return this.hideShortcuts()?s.filter(l=>!l.id.startsWith("%")):s})}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=q({type:o,selectors:[["app-file-tree"]],viewQuery:function(e,i){e&1&&(ae(i.treeContainerRef,et,5),ae(i.formRef,tt,5)),e&2&&Me(2)},hostVars:2,hostBindings:function(e,i){e&2&&x("disabled",i.disabled())},inputs:{multiSelect:[1,"multiSelect"],disabled:[1,"disabled"],showFiles:[1,"showFiles"],selectFiles:[1,"selectFiles"],accepts:[1,"accepts"],startingPath:[1,"startingPath"],rootPaths:[1,"rootPaths"],initialNodes:[1,"initialNodes"],backupSettings:[1,"backupSettings"],pathRefreshTrigger:[1,"pathRefreshTrigger"],showHiddenNodes:[1,"showHiddenNodes"],enableCreateFolder:[1,"enableCreateFolder"],hideShortcuts:[1,"hideShortcuts"]},outputs:{includes:"includes",excludes:"excludes"},ngContentSelectors:nt,decls:18,vars:17,consts:()=>{let t;t=$localize` Browse path `;let e;e=$localize` Manually type path `;let i;i=$localize` Show hidden ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let n;n=$localize` Create folder `;let r;r=$localize`Enter new folder path`;let a;return a=$localize` Create folder ${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:folder-plus${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["treeContainer",""],["recursiveTree",""],["formRef",""],["treeNode",""],t,e,i,n,r,a,[1,"section"],[1,"browse-files"],[1,"indeterminate","primary"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"footer"],[1,"primary","raised","browse-files-toggle",3,"active"],["shButton","","type","button",1,"small","create-folder",3,"disabled"],[1,"form-field"],[3,"isOpen","options"],["type","button",3,"click"],["action","",3,"click"],[1,"icon"],[1,"primary"],[1,"text",3,"click"],[1,"small"],[1,"primary","raised","browse-files-toggle",3,"click"],["shButton","","type","button",1,"small","create-folder",3,"click","disabled"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click","disabled"]]},template:function(e,i){if(e&1&&(Q(it),S(0,at,5,4,"sh-button-group"),c(1,"div",10),I(2,0,["ngProjectAs","label",5,["label"]]),c(3,"div",11,0),S(5,ct,1,0,"sh-progress-bar",12),G(6,Mt,3,2,"ng-template",null,1,xe)(8,vt,1,0,"ng-container",13),p(),c(9,"div",14),S(10,Ft,2,3,"sh-toggle",15),S(11,St,2,1,"button",16),p()(),c(12,"div",17,2)(14,"sh-form-field"),I(15,1,["ngProjectAs","label",5,["label"]]),I(16,2,["ngProjectAs","input",5,["input"]]),p()(),S(17,Nt,17,6,"sh-dialog",18)),e&2){let n=ce(7);N(i.multiSelect()?-1:0),g(),x("hidden",i.pathDiscoveryMethod()!=="browse"),g(2),x("visualize-accepted",i.accepts()),g(2),N(i.isLoading()?5:-1),g(3),y("ngTemplateOutlet",n)("ngTemplateOutletContext",J(15,je,J(13,ot,i.treeStructure()))),g(2),N(!i.accepts()&&!i.isByBackupSettings()?10:-1),g(),N(i.enableCreateFolder()?11:-1),g(),x("hidden",i.pathDiscoveryMethod()!=="path"),g(5),N(i.createFolderDialogOpen()?17:-1)}},dependencies:[Ae,We,De,Y,Be,Le,Re,we,ie,Z,ee,te],styles:['[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem}.disabled[_nghost-%COMP%]{opacity:.5;-webkit-user-select:none;user-select:none;pointer-events:none;position:relative}.disabled[_nghost-%COMP%]:before{content:"";position:absolute;inset:0;background:transparent}.fill[_nghost-%COMP%]{height:auto;overflow:hidden;flex:1 0}.fill[_nghost-%COMP%] .section[_ngcontent-%COMP%]{height:auto;overflow:hidden;flex:1 0;display:grid;grid-template-columns:1fr auto;grid-template-rows:auto 1fr;grid-template-areas:"label toggle" "tree tree"}.fill[_nghost-%COMP%] .browse-files[_ngcontent-%COMP%]{resize:none;height:initial;grid-area:tree}.fill[_nghost-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.fill[_nghost-%COMP%] sh-toggle[_ngcontent-%COMP%]{grid-area:toggle;flex-direction:row-reverse}.section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.form-field.hidden[_ngcontent-%COMP%]{display:none}.browse-files[_ngcontent-%COMP%]{display:flex;gap:.5rem;padding:.5rem 1rem;height:12.5rem;border:1px solid var(--base-4);border-radius:var(--shape-3);overflow:auto;resize:vertical;background:var(--base-1);position:relative}.browse-files[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]:not(.accepted){opacity:.5}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action].accepted[_ngcontent-%COMP%]{opacity:1}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%]{--list-active-bg: var(--base-3);gap:.125rem;padding:0;height:min-content;min-width:min-content}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]{padding:0;gap:0;border:1px solid transparent}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].active[_ngcontent-%COMP%]{border-color:transparent;--list-active-bg: var(--primary-2)}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].indeterminate[_ngcontent-%COMP%]{border-color:var(--primary-4)}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].usually-hidden[_ngcontent-%COMP%]{opacity:.6}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%]{gap:.25rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]:has(sh-icon:nth-child(2)){width:3rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:1.5rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;height:100%;width:max-content;display:flex;align-items:center}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:3rem;gap:.25rem;height:1.5rem;display:flex;align-items:center;justify-content:center;cursor:pointer}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon.file[_ngcontent-%COMP%]{width:3rem;padding:0 .25rem}.browse-files-toggle[_ngcontent-%COMP%]{color:var(--base-9)}.hidden[_ngcontent-%COMP%]{display:none}.footer[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:space-between;align-items:center}'],changeDetection:0})};var Ot=[[["label"]],[["","prefix",""]],[["","suffix",""]]],yt=["label","[prefix]","[suffix]"];function xt(o,t){if(o&1&&b(0),o&2){let e=t.$implicit,i=u();Se("",e.label,"",i.hasPerSecond()?"/s":"")}}var wt=["throttle-upload","throttle-download"],Dt=[{value:"KB",label:"KB"},{value:"MB",label:"MB"},{value:"GB",label:"GB"},{value:"TB",label:"TB"},{value:"PB",label:"PB"}],Rt=o=>{if(!o||typeof o!="string"||o.length===0)return{size:0,unit:"MB"};let t=o.match(/^(\d+)(bytes|kb|mb|gb|tb|pb|b)$/i);return t&&(t[2].toUpperCase()==="B"||t[2].toUpperCase()==="BYTES")?{size:1,unit:"KB"}:{size:t?parseInt(t[1],10):0,unit:t?t[2].toUpperCase():"MB"}},qe=class o{customId=P();inputType=P();timespan=E(0);unit=E("MB");sizeOptions=E(Dt);readonly=E(!1);hasPerSecond=A(()=>{let t=this.inputType();return t&&wt.includes(t)});onChange=()=>{};onTouched=()=>{};onChangeEffect=B(()=>{this.onChange(this.getValue())});writeValue(t){if(t){let e=Rt(t);e?queueMicrotask(()=>{this.timespan.set(e.size),this.unit.set(e.unit)}):(this.timespan.set(0),this.unit.set("MB"))}else this.timespan.set(0),this.unit.set("MB")}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.readonly.set(t)}getValue(){return`${this.timespan()}${this.unit()}`}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=q({type:o,selectors:[["app-size"]],inputs:{customId:[1,"customId"],inputType:[1,"inputType"]},features:[Ne([{provide:He,useExisting:o,multi:!0}])],ngContentSelectors:yt,decls:9,vars:10,consts:[[1,"label"],["type","number",3,"ngModelChange","id","ngModel","disabled"],["value","value","label","label",3,"options","readonly","isClearable"],["type","text",3,"ngModelChange","ngModel"]],template:function(e,i){e&1&&(Q(Ot),c(0,"div",0),I(1,0,["ngProjectAs","label",5,["label"]]),p(),c(2,"sh-form-field")(3,"input",1),H("ngModelChange",function(r){return z(i.timespan,r)||(i.timespan=r),r}),p(),I(4,1),I(5,2),p(),c(6,"sh-select",2)(7,"input",3),H("ngModelChange",function(r){return z(i.unit,r)||(i.unit=r),r}),p(),G(8,xt,1,2,"ng-template"),p()),e&2&&(g(2),me("readonly",i.readonly()||void 0),g(),y("id",i.customId()),V("ngModel",i.timespan),y("disabled",i.readonly()),g(3),U("--miw",0),y("options",i.sizeOptions())("readonly",i.readonly())("isClearable",!1),g(),V("ngModel",i.unit))},dependencies:[ke,Y,ie,Z,Ge,ee,te],styles:['[_nghost-%COMP%]{display:grid;grid-template-areas:"label label" "input unit";grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{grid-area:label;grid-column:1/-1}[_nghost-%COMP%] sh-form-field[_ngcontent-%COMP%]{grid-area:input}[_nghost-%COMP%] sh-select[_ngcontent-%COMP%]{grid-area:unit}'],changeDetection:0})};export{ue as a,Rt as b,qe as c};
@@ -0,0 +1 @@
1
+ import{h as d}from"./chunk-NOPMCS2Z.js";import{H as o,Oc as s,Pc as g,V as r,_ as n,oa as l}from"./chunk-HNWRQABR.js";var u=[{value:"Disabled",label:$localize`Disabled`},{value:"Verbose",label:$localize`Verbose`},{value:"ExplicitOnly",label:$localize`Explicit only`},{value:"Profiling",label:$localize`Profiling`},{value:"Retry",label:$localize`Retry`},{value:"Information",label:$localize`Information`},{value:"DryRun",label:$localize`Dry run`},{value:"Warning",label:$localize`Warning`},{value:"Error",label:$localize`Error`}],v=class a{#l=n(d);#e=l([]);LOG_LEVELS=u;logLevel=l("Disabled");logLevelByLabel=s(()=>u.find(e=>e.value===this.logLevel())?.label);whenFilter=l(null);backupIdFilter=l(null);id=l(0);logs=s(()=>this.whenFilter()&&this.backupIdFilter()?this.#e().filter(e=>e.BackupID===this.backupIdFilter()&&new Date(e.When).getTime()>=this.whenFilter()&&e.BackupID===this.backupIdFilter()):this.#e());timerInterval;logsLoading=l(!1);isPolling=l(!1);pagination=l({offset:0,pagesize:100});logLevelEffect=g(()=>{this.isPolling()?(this.#e.set([]),this.id.set(0),queueMicrotask(()=>this.loadLogs()),this.timerInterval&&clearInterval(this.timerInterval),this.timerInterval=setInterval(()=>{this.loadLogs()},3e3)):this.clearPolling()});setWhenFilter(e){this.whenFilter.set(e)}setBackupIdFilter(e){this.backupIdFilter.set(e)}loadLogs(){this.logsLoading.set(!0),this.#l.getApiV1LogdataPoll({id:this.id(),level:this.logLevel(),pagesize:this.pagination().pagesize}).pipe(o(()=>this.logsLoading.set(!1))).subscribe({next:e=>{let i=e.reverse(),t=this.#i(i);t>0&&this.id.set(t),this.#e.set([...i,...this.#e()])}})}updateLogLevel(e){this.logLevel.set(e),e==="Disabled"&&this.clearPolling()}#i(e){return e.reduce((i,t)=>Math.max(i,t.ID),0)}destroy(){this.logLevel.set("Disabled"),this.clearPolling()}clearPolling(){this.timerInterval&&clearInterval(this.timerInterval),this.timerInterval=void 0}static \u0275fac=function(i){return new(i||a)};static \u0275prov=r({token:a,factory:a.\u0275fac,providedIn:"root"})};export{v as a};
@@ -1 +1 @@
1
- import{a as z}from"./chunk-ESUPNSKH.js";import{a as x,c as B,d as w,e as U,f as k}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as X,f as H,o as V}from"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import{Ab as i,Bb as t,Cb as _,Gb as f,Hb as P,Jb as R,Qb as l,Ra as O,Rb as s,Sb as b,Tb as v,Ub as y,Wb as u,Yb as c,_ as T,bb as D,ea as a,fa as S,oa as $,ub as N,vb as G,zb as M}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";function W(g,F){if(g&1){let n=R();i(0,"sh-menu",15)(1,"button",16),b(2,2),t(),f(3,17),i(4,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Disabled"))}),l(5,3),_(6,"sh-icon"),s(),t(),i(7,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Verbose"))}),l(8,4),_(9,"sh-icon"),s(),t(),i(10,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("ExplicitOnly"))}),l(11,5),_(12,"sh-icon"),s(),t(),i(13,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Profiling"))}),l(14,6),_(15,"sh-icon"),s(),t(),i(16,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Retry"))}),l(17,7),_(18,"sh-icon"),s(),t(),i(19,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Information"))}),l(20,8),_(21,"sh-icon"),s(),t(),i(22,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("DryRun"))}),l(23,9),_(24,"sh-icon"),s(),t(),i(25,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Warning"))}),l(26,10),_(27,"sh-icon"),s(),t(),i(28,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Error"))}),l(29,11),_(30,"sh-icon"),s(),t(),P(),t()}if(g&2){let n=c();M("openIndicator",!0),O(2),v(n.logLevelByLabel()),y(2)}}var C=class g{#n=T(w);#e=T(z);logLevel=this.#e.logLevel;logLevelByLabel=this.#e.logLevelByLabel;currentUrl=$(this.#n.url);constructor(){this.#n.events.subscribe(F=>{F instanceof x&&this.currentUrl.set(F.urlAfterRedirects)})}updateLogLevel(F){this.#e.isPolling.set(!0),this.#e.updateLogLevel(F)}static \u0275fac=function(n){return new(n||g)};static \u0275cmp=D({type:g,selectors:[["app-logs"]],decls:10,vars:1,consts:()=>{let F;F=$localize`${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:archive${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON: Stored `;let n;n=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:play${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: Live `;let o;o=$localize`Log level: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let e;e=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SH_ICON:bell-simple-slash${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SH_ICON: Disabled `;let L;L=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:megaphone-simple${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON: Verbose `;let d;d=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:flow-arrow${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Explicit only `;let h;h=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:speedometer${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Profiling `;let I;I=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:arrow-arc-left${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON: Retry `;let E;E=$localize`${"\uFFFD#21\uFFFD"}:START_TAG_SH_ICON:info${"\uFFFD/#21\uFFFD"}:CLOSE_TAG_SH_ICON: Information `;let A;A=$localize`${"\uFFFD#24\uFFFD"}:START_TAG_SH_ICON:person-simple-run${"\uFFFD/#24\uFFFD"}:CLOSE_TAG_SH_ICON: Dry run `;let m;m=$localize`${"\uFFFD#27\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#27\uFFFD"}:CLOSE_TAG_SH_ICON: Warning `;let p;return p=$localize`${"\uFFFD#30\uFFFD"}:START_TAG_SH_ICON:warning-octagon${"\uFFFD/#30\uFFFD"}:CLOSE_TAG_SH_ICON: Error `,[F,n,o,e,L,d,h,I,E,A,m,p,[1,"filters"],["type","button","routerLink","/about/logs/stored","routerLinkActive","active"],["type","button","routerLink","/about/logs/live","routerLinkActive","active"],[3,"openIndicator"],["shButton","","type","button"],["menu",""],["shButton","","type","button",1,"small",3,"click"]]},template:function(n,o){n&1&&(i(0,"div",12)(1,"sh-button-group")(2,"button",13),l(3,0),_(4,"sh-icon"),s(),t(),i(5,"button",14),l(6,1),_(7,"sh-icon"),s(),t()(),N(8,W,31,2,"sh-menu",15),t(),_(9,"router-outlet")),n&2&&(O(8),G(o.currentUrl().startsWith("/about/logs/live")?8:-1))},dependencies:[H,X,V,B,k,U],styles:["[_nghost-%COMP%]{display:block}.filters[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;padding:0 2rem;margin-bottom:1.25rem}"],changeDetection:0})};export{C as default};
1
+ import{a as z}from"./chunk-GEI2CH2J.js";import{a as x,c as B,d as w,e as U,f as k}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as X,f as H,o as V}from"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import{Ab as i,Bb as t,Cb as _,Gb as f,Hb as P,Jb as R,Qb as l,Ra as O,Rb as s,Sb as b,Tb as v,Ub as y,Wb as u,Yb as c,_ as T,bb as D,ea as a,fa as S,oa as $,ub as N,vb as G,zb as M}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";function W(g,F){if(g&1){let n=R();i(0,"sh-menu",15)(1,"button",16),b(2,2),t(),f(3,17),i(4,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Disabled"))}),l(5,3),_(6,"sh-icon"),s(),t(),i(7,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Verbose"))}),l(8,4),_(9,"sh-icon"),s(),t(),i(10,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("ExplicitOnly"))}),l(11,5),_(12,"sh-icon"),s(),t(),i(13,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Profiling"))}),l(14,6),_(15,"sh-icon"),s(),t(),i(16,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Retry"))}),l(17,7),_(18,"sh-icon"),s(),t(),i(19,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Information"))}),l(20,8),_(21,"sh-icon"),s(),t(),i(22,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("DryRun"))}),l(23,9),_(24,"sh-icon"),s(),t(),i(25,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Warning"))}),l(26,10),_(27,"sh-icon"),s(),t(),i(28,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Error"))}),l(29,11),_(30,"sh-icon"),s(),t(),P(),t()}if(g&2){let n=c();M("openIndicator",!0),O(2),v(n.logLevelByLabel()),y(2)}}var C=class g{#n=T(w);#e=T(z);logLevel=this.#e.logLevel;logLevelByLabel=this.#e.logLevelByLabel;currentUrl=$(this.#n.url);constructor(){this.#n.events.subscribe(F=>{F instanceof x&&this.currentUrl.set(F.urlAfterRedirects)})}updateLogLevel(F){this.#e.isPolling.set(!0),this.#e.updateLogLevel(F)}static \u0275fac=function(n){return new(n||g)};static \u0275cmp=D({type:g,selectors:[["app-logs"]],decls:10,vars:1,consts:()=>{let F;F=$localize`${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:archive${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON: Stored `;let n;n=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:play${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: Live `;let o;o=$localize`Log level: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let e;e=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SH_ICON:bell-simple-slash${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SH_ICON: Disabled `;let L;L=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:megaphone-simple${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON: Verbose `;let d;d=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:flow-arrow${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Explicit only `;let h;h=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:speedometer${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Profiling `;let I;I=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:arrow-arc-left${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON: Retry `;let E;E=$localize`${"\uFFFD#21\uFFFD"}:START_TAG_SH_ICON:info${"\uFFFD/#21\uFFFD"}:CLOSE_TAG_SH_ICON: Information `;let A;A=$localize`${"\uFFFD#24\uFFFD"}:START_TAG_SH_ICON:person-simple-run${"\uFFFD/#24\uFFFD"}:CLOSE_TAG_SH_ICON: Dry run `;let m;m=$localize`${"\uFFFD#27\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#27\uFFFD"}:CLOSE_TAG_SH_ICON: Warning `;let p;return p=$localize`${"\uFFFD#30\uFFFD"}:START_TAG_SH_ICON:warning-octagon${"\uFFFD/#30\uFFFD"}:CLOSE_TAG_SH_ICON: Error `,[F,n,o,e,L,d,h,I,E,A,m,p,[1,"filters"],["type","button","routerLink","/about/logs/stored","routerLinkActive","active"],["type","button","routerLink","/about/logs/live","routerLinkActive","active"],[3,"openIndicator"],["shButton","","type","button"],["menu",""],["shButton","","type","button",1,"small",3,"click"]]},template:function(n,o){n&1&&(i(0,"div",12)(1,"sh-button-group")(2,"button",13),l(3,0),_(4,"sh-icon"),s(),t(),i(5,"button",14),l(6,1),_(7,"sh-icon"),s(),t()(),N(8,W,31,2,"sh-menu",15),t(),_(9,"router-outlet")),n&2&&(O(8),G(o.currentUrl().startsWith("/about/logs/live")?8:-1))},dependencies:[H,X,V,B,k,U],styles:["[_nghost-%COMP%]{display:block}.filters[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;padding:0 2rem;margin-bottom:1.25rem}"],changeDetection:0})};export{C as default};
@@ -0,0 +1 @@
1
+ import"./chunk-EUDKD2JW.js";var o=[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"destination",loadComponent:()=>import("./chunk-PDM4HXOW.js")},{path:"encryption",loadComponent:()=>import("./chunk-6EWMK5CH.js")},{path:"select-files",loadComponent:()=>import("./chunk-YTYCTAUZ.js")},{path:"options",loadComponent:()=>import("./chunk-OKM5JN2Q.js")},{path:":taskid/progress",loadComponent:()=>import("./chunk-ZUBWG65U.js")}],t=o;export{t as default};
@@ -1 +1 @@
1
- import{a as G}from"./chunk-NJEX2N4Q.js";import{h as T}from"./chunk-MQI3XY6Q.js";import"./chunk-23CWXAU4.js";import"./chunk-DDWLL7XA.js";import"./chunk-2QJC4PGQ.js";import{b as m}from"./chunk-O64ZZGQZ.js";import"./chunk-6LTGTS6B.js";import{a as L}from"./chunk-DVDTYV66.js";import"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import"./chunk-N5SC4SKW.js";import"./chunk-Z3EPZZGY.js";import"./chunk-UKQFDBNO.js";import{b as E,c as B,e as b,f as M}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{p as $,q as N,v as I}from"./chunk-H7K35UUX.js";import{h as v}from"./chunk-NOPMCS2Z.js";import"./chunk-TDKBGGNK.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-6OPAGPKF.js";import{Ab as s,Bb as u,Bc as _,Cb as r,F as f,Pc as O,Qb as c,Ra as n,Rb as p,Yb as R,_ as l,bb as D,lc as A,nc as k,ub as h,vb as g,yc as P,zb as d}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var y=(a,e)=>[a,e,"general"],U=(a,e)=>[a,e,"destination"],K=(a,e)=>[a,e,"source-data"],w=(a,e)=>[a,e,"schedule"],H=(a,e)=>[a,e,"options"];function X(a,e){if(a&1&&(s(0,"p"),A(1),u()),a&2){let t=R();n(),k("Editing: ",t.backupName())}}function x(a,e){a&1&&r(0,"sh-progress-bar",7)}function z(a,e){a&1&&(s(0,"section"),r(1,"router-outlet"),u())}var C=class a{#t=l(E);#e=l(T);#a=l(L);#i=l(v);isDraft=this.#e.isDraft;isNew=this.#e.isNew;backupId=this.#e.backupId;backupName=this.#e.backupName;finishedLoading=this.#e.finishedLoading;#o=m(this.#t.params);#n=m(this.#t.url);paramsChanged=O(()=>{let e=this.#o()?.id,t=!!this.#n()?.find(i=>i.path==="backup-draft");this.#e.backupId.set(e),e!=="new"?this.getBackup(e,t):this.getDefaults()});getDefaults(){this.#i.getApiV1Backupdefaults().pipe(f(1)).subscribe({next:e=>{let t=e.Backup;t.Settings=[...t.Settings],this.#e.mapGeneralToForm(t),this.#e.mapDestinationToForm(t),this.#e.mapSourceDataToForm(t),this.#e.mapScheduleToForm(e.Schedule),this.#e.mapOptionsToForms(t),this.#e.applicationOptions.set(e.ApplicationOptions),this.#e.backupDefaults.set(e),this.#e.finishedLoading.set(!0)}})}getBackup(e,t=!1){let i=o=>{this.#e.mapScheduleToForm(o.Schedule??null),o.Backup&&(this.#e.mapGeneralToForm(o.Backup),this.#e.mapDestinationToForm(o.Backup),this.#e.mapSourceDataToForm(o.Backup),this.#e.mapOptionsToForms(o.Backup),this.#e.storeMetadata(o.Backup,t)),this.#e.finishedLoading.set(!0)};if(t){this.isDraft.set(t);let o=this.#a.draftBackups().find(F=>F.id===e);if(!o){alert("Backup not found");return}i(o.data)}else this.#i.getApiV1BackupById({id:e}).subscribe({next:i})}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=D({type:a,selectors:[["app-backup"]],features:[P([T])],decls:21,vars:22,consts:()=>{let e;e=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SH_RADIO: General `;let t;t=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_RADIO: Destination `;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_RADIO: Source Data `;let o;o=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_RADIO: Schedule `;let F;return F=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `,[e,t,i,o,F,[1,"primary"],["step","","routerLinkActive","active",3,"routerLink"],[1,"indeterminate","primary"]]},template:function(t,i){t&1&&(r(0,"app-status-bar"),s(1,"header"),h(2,X,2,1,"p"),s(3,"sh-stepper",5)(4,"div",6),c(5,0),r(6,"sh-radio"),p(),u(),s(7,"div",6),c(8,1),r(9,"sh-radio"),p(),u(),s(10,"div",6),c(11,2),r(12,"sh-radio"),p(),u(),s(13,"div",6),c(14,3),r(15,"sh-radio"),p(),u(),s(16,"div",6),c(17,4),r(18,"sh-radio"),p(),u()()(),h(19,x,1,0,"sh-progress-bar",7)(20,z,2,0,"section")),t&2&&(n(2),g(i.isNew()?-1:2),n(2),d("routerLink",_(7,y,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",_(10,U,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",_(13,K,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",_(16,w,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",_(19,H,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),g(i.finishedLoading()?20:19))},dependencies:[B,b,M,G,N,I,$],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%}header[_ngcontent-%COMP%]{padding:1rem 1.5rem;border-bottom:1px solid var(--base-4)}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:.5rem}header[_ngcontent-%COMP%] sh-stepper[_ngcontent-%COMP%]{width:100%}section[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:center;flex:1 0;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:auto}"],changeDetection:0})};export{C as default};
1
+ import{a as G}from"./chunk-NJEX2N4Q.js";import{h as T}from"./chunk-VGUK4FJP.js";import"./chunk-FZTPUMUC.js";import"./chunk-DDWLL7XA.js";import"./chunk-2QJC4PGQ.js";import{b as m}from"./chunk-O64ZZGQZ.js";import"./chunk-6LTGTS6B.js";import{a as L}from"./chunk-DVDTYV66.js";import"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import"./chunk-N5SC4SKW.js";import"./chunk-Z3EPZZGY.js";import"./chunk-UKQFDBNO.js";import{b as E,c as B,e as b,f as M}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{p as $,q as N,v as I}from"./chunk-H7K35UUX.js";import{h as v}from"./chunk-NOPMCS2Z.js";import"./chunk-TDKBGGNK.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-6OPAGPKF.js";import{Ab as s,Bb as u,Bc as _,Cb as r,F as f,Pc as O,Qb as c,Ra as n,Rb as p,Yb as R,_ as l,bb as D,lc as A,nc as k,ub as h,vb as g,yc as P,zb as d}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var y=(a,e)=>[a,e,"general"],U=(a,e)=>[a,e,"destination"],K=(a,e)=>[a,e,"source-data"],w=(a,e)=>[a,e,"schedule"],H=(a,e)=>[a,e,"options"];function X(a,e){if(a&1&&(s(0,"p"),A(1),u()),a&2){let t=R();n(),k("Editing: ",t.backupName())}}function x(a,e){a&1&&r(0,"sh-progress-bar",7)}function z(a,e){a&1&&(s(0,"section"),r(1,"router-outlet"),u())}var C=class a{#t=l(E);#e=l(T);#a=l(L);#i=l(v);isDraft=this.#e.isDraft;isNew=this.#e.isNew;backupId=this.#e.backupId;backupName=this.#e.backupName;finishedLoading=this.#e.finishedLoading;#o=m(this.#t.params);#n=m(this.#t.url);paramsChanged=O(()=>{let e=this.#o()?.id,t=!!this.#n()?.find(i=>i.path==="backup-draft");this.#e.backupId.set(e),e!=="new"?this.getBackup(e,t):this.getDefaults()});getDefaults(){this.#i.getApiV1Backupdefaults().pipe(f(1)).subscribe({next:e=>{let t=e.Backup;t.Settings=[...t.Settings],this.#e.mapGeneralToForm(t),this.#e.mapDestinationToForm(t),this.#e.mapSourceDataToForm(t),this.#e.mapScheduleToForm(e.Schedule),this.#e.mapOptionsToForms(t),this.#e.applicationOptions.set(e.ApplicationOptions),this.#e.backupDefaults.set(e),this.#e.finishedLoading.set(!0)}})}getBackup(e,t=!1){let i=o=>{this.#e.mapScheduleToForm(o.Schedule??null),o.Backup&&(this.#e.mapGeneralToForm(o.Backup),this.#e.mapDestinationToForm(o.Backup),this.#e.mapSourceDataToForm(o.Backup),this.#e.mapOptionsToForms(o.Backup),this.#e.storeMetadata(o.Backup,t)),this.#e.finishedLoading.set(!0)};if(t){this.isDraft.set(t);let o=this.#a.draftBackups().find(F=>F.id===e);if(!o){alert("Backup not found");return}i(o.data)}else this.#i.getApiV1BackupById({id:e}).subscribe({next:i})}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=D({type:a,selectors:[["app-backup"]],features:[P([T])],decls:21,vars:22,consts:()=>{let e;e=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SH_RADIO: General `;let t;t=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_RADIO: Destination `;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_RADIO: Source Data `;let o;o=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_RADIO: Schedule `;let F;return F=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `,[e,t,i,o,F,[1,"primary"],["step","","routerLinkActive","active",3,"routerLink"],[1,"indeterminate","primary"]]},template:function(t,i){t&1&&(r(0,"app-status-bar"),s(1,"header"),h(2,X,2,1,"p"),s(3,"sh-stepper",5)(4,"div",6),c(5,0),r(6,"sh-radio"),p(),u(),s(7,"div",6),c(8,1),r(9,"sh-radio"),p(),u(),s(10,"div",6),c(11,2),r(12,"sh-radio"),p(),u(),s(13,"div",6),c(14,3),r(15,"sh-radio"),p(),u(),s(16,"div",6),c(17,4),r(18,"sh-radio"),p(),u()()(),h(19,x,1,0,"sh-progress-bar",7)(20,z,2,0,"section")),t&2&&(n(2),g(i.isNew()?-1:2),n(2),d("routerLink",_(7,y,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",_(10,U,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",_(13,K,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",_(16,w,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",_(19,H,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),g(i.finishedLoading()?20:19))},dependencies:[B,b,M,G,N,I,$],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%}header[_ngcontent-%COMP%]{padding:1rem 1.5rem;border-bottom:1px solid var(--base-4)}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:.5rem}header[_ngcontent-%COMP%] sh-stepper[_ngcontent-%COMP%]{width:100%}section[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:center;flex:1 0;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:auto}"],changeDetection:0})};export{C as default};
@@ -1 +1 @@
1
- import{a as xt,b as Lt,c as Rt,d as Ut,e as wt}from"./chunk-PJLMDJTH.js";import"./chunk-7IQY6U5W.js";import"./chunk-TK5QY2QD.js";import{a as Pt}from"./chunk-KDYD6LMI.js";import{h as Bt}from"./chunk-MQI3XY6Q.js";import"./chunk-23CWXAU4.js";import"./chunk-DDWLL7XA.js";import"./chunk-2QJC4PGQ.js";import"./chunk-O64ZZGQZ.js";import{a as $}from"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import{c as b,e as v,f as At,g as $t,i as k,j as Mt,r as yt,s as G}from"./chunk-N5SC4SKW.js";import{b as St,d as Ct}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as U,b as ht,d as It,e as Nt,g as ft,h as Ot,l as w,o as Et}from"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import{Ab as s,Bb as F,Cb as c,Gb as Ft,Hb as rt,Jb as g,Oa as it,Oc as L,Qb as u,Ra as r,Rb as _,Sb as B,Tb as z,Tc as gt,Ub as H,Uc as pt,Vb as X,Vc as mt,Wb as D,Yb as l,Zb as lt,_ as C,_b as ct,bb as f,ea as d,ec as ut,fa as T,fc as _t,ia as nt,ic as dt,lc as x,mc as W,oa as I,qc as O,rc as E,sc as A,tc as j,ub as m,uc as q,vb as S,vc as R,wb as ot,wc as Q,xb as at,yb as st,yc as Tt,zb as h,zc as Dt}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var kt=["*"],M=class o{destination=pt.required();static \u0275fac=function(t){return new(t||o)};static \u0275cmp=f({type:o,selectors:[["app-destination-list-item"]],inputs:{destination:[1,"destination"]},ngContentSelectors:kt,decls:9,vars:6,consts:[[1,"type-b"],[1,"icon"],[3,"src","alt"],[1,"name"],[1,"description"],[1,"actions"]],template:function(t,n){if(t&1&&(lt(),s(0,"sh-card",0)(1,"div",1),c(2,"img",2),F(),s(3,"div",3),x(4),F(),s(5,"div",4),x(6),F(),s(7,"div",5),ct(8),F()()),t&2){let i=n.destination();r(2),h("src",Q(i.icon),it)("alt",Q(i.displayName)),r(2),W(i.displayName),r(2),W(i.description)}},dependencies:[Ot],styles:['[_nghost-%COMP%]{display:block}sh-card[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:3rem 1fr auto;grid-template-areas:"icon name actions" "icon description actions";gap:.25rem 1rem}sh-card[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{grid-area:icon;display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:var(--shape-2)}sh-card[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{object-fit:contain;width:100%;border-radius:var(--shape-2);overflow:hidden}sh-card[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{grid-area:name;font:var(--paragraph-10)}sh-card[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{grid-area:description;color:var(--base-8)}sh-card[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{grid-area:actions;display:flex;align-items:center;gap:.5rem}'],changeDetection:0})};function Kt(o,e){if(o&1){let t=g();s(0,"app-destination-list-item",3)(1,"button",4),D("click",function(){let i=d(t).$implicit,a=l();return T(a.setDestination.emit(i.key))}),u(2,0),c(3,"sh-icon"),_(),F()()}if(o&2){let t=e.$implicit;h("destination",t)}}var K=class o{#i=C(Lt);setDestination=gt();destinationSearchTerm=I("");destinationTypeOptionsInFocus=I(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=this.#i.destinationTypeOptions;destinationTypeOptionsFocused=L(()=>{let e=new Set(this.destinationTypeOptionsInFocus()),t=this.destinationTypeOptions(),n=this.destinationSearchTerm().toLowerCase(),i=[...t].sort((a,N)=>{let y=e.has(a.key),P=e.has(N.key);return y&&!P?-1:!y&&P?1:0});return n?i.filter(a=>a.displayName.toLowerCase().includes(n)):i});static \u0275fac=function(t){return new(t||o)};static \u0275cmp=f({type:o,selectors:[["app-destination-list"]],outputs:{setDestination:"setDestination"},decls:5,vars:1,consts:()=>{let e;e=$localize`Search for destination...`;let t;return t=$localize` Choose ${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON:`,[t,["type","text","placeholder",e,3,"ngModelChange","ngModel"],[1,"list"],[3,"destination"],["shButton","","type","button",3,"click"]]},template:function(t,n){t&1&&(s(0,"sh-form-field")(1,"input",1),A("ngModelChange",function(a){return E(n.destinationSearchTerm,a)||(n.destinationSearchTerm=a),a}),F()(),s(2,"div",2),at(3,Kt,4,1,"app-destination-list-item",3,ot),F()),t&2&&(r(),O("ngModel",n.destinationSearchTerm),r(2),st(n.destinationTypeOptionsFocused()))},dependencies:[M,G,b,v,k,w,ft,U],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:hidden}.list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:auto;padding-bottom:1rem;border-bottom:.0625rem solid var(--base-4)}"],changeDetection:0})};var Vt=["formRef"],zt=()=>({maxWidth:"700px",width:"100%"});function Ht(o,e){if(o&1){let t=g();u(0,1,1),s(1,"button",28),D("click",function(){d(t);let i=l();return T(i.testDestination(0,!0))}),F(),_()}if(o&2){let t=l();r(),dt("loader",t.testSignal()=="testing"),h("disabled",t.testSignal()=="testing")}}function Xt(o,e){if(o&1){let t=g();u(0,1,2),s(1,"button",29),D("click",function(){d(t);let i=l();return T(i.openTargetUrlDialog())}),c(2,"sh-icon"),F(),_()}}function Wt(o,e){if(o&1){let t=g();u(0,1,4),s(1,"button",29),D("click",function(){d(t);let i=l(2);return T(i.copyTargetUrl())}),c(2,"sh-icon"),F(),_()}}function jt(o,e){if(o&1){let t=g();u(0,1,3),s(1,"sh-menu")(2,"button",17),c(3,"sh-icon"),F(),Ft(4,30),s(5,"button",29),D("click",function(){d(t);let i=l();return T(i.openTargetUrlDialog())}),c(6,"sh-icon"),F(),m(7,Wt,3,0,"button",17),rt(),F(),_()}if(o&2){l();let t=R(0);r(7),S(t?7:-1)}}function qt(o,e){o&1&&(s(0,"sh-alert"),u(1,4),c(2,"sh-icon",31),_(),F())}function Qt(o,e){o&1&&(s(0,"sh-alert",18),u(1,5),c(2,"sh-icon",31),_(),F())}function Yt(o,e){if(o&1&&(s(0,"sh-alert",19),u(1,6),c(2,"sh-icon",31),_(),F()),o&2){let t=l();r(2),z(t.testErrorMessage()),H(1)}}function Jt(o,e){if(o&1&&(s(0,"sh-alert",20),u(1,7),c(2,"sh-icon",31),_(),F()),o&2){let t=l();r(2),z(t.testErrorMessage()),H(1)}}function Zt(o,e){if(o&1){let t=g();s(0,"app-destination-list-item",21)(1,"button",24),D("click",function(){d(t);let i=l();return T(i.removeDestination())}),B(2,8),F()()}if(o&2){l();let t=R(14);h("destination",t)}}function te(o,e){if(o&1){let t=g();s(0,"app-destination-list",32),D("setDestination",function(i){d(t);let a=l();return T(a.setDestination(i))}),F()}}function ee(o,e){if(o&1){let t=g();s(0,"app-single-destination",33),A("targetUrlChange",function(i){d(t);let a=l();return E(a.targetUrlModel,i)||(a.targetUrlModel=i),T(i)}),F()}if(o&2){let t=l();O("targetUrl",t.targetUrlModel)}}function ne(o,e){o&1&&(u(0,3,1),c(1,"sh-icon",26),_())}function ie(o,e){o&1&&(u(0,3,2),c(1,"sh-icon"),_())}function oe(o,e){o&1&&(s(0,"h2"),B(1,11),F())}function ae(o,e){o&1&&(s(0,"h2"),B(1,12),F())}function se(o,e){if(o&1){let t=g();s(0,"sh-dialog",34),A("isOpenChange",function(i){d(t);let a=l();return E(a.targetUrlDialogOpen,i)||(a.targetUrlDialogOpen=i),T(i)}),s(1,"header",35),m(2,oe,2,0,"h2")(3,ae,2,0,"h2"),s(4,"sh-alert",19),B(5,9),F()(),s(6,"div",36)(7,"sh-form-field")(8,"textarea",37),A("ngModelChange",function(i){d(t);let a=l();return E(a.targetUrlCtrl,i)||(a.targetUrlCtrl=i),T(i)}),F()()(),s(9,"footer",38)(10,"button",24),D("click",function(){d(t);let i=l();return T(i.closeTargetUrlDialog(!1))}),x(11,"Cancel"),F(),s(12,"button",39),D("click",function(){d(t);let i=l();return T(i.closeTargetUrlDialog(!0))}),u(13,10),c(14,"sh-icon"),_(),F()()()}if(o&2){let t=l(),n=R(0);O("isOpen",t.targetUrlDialogOpen),h("options",Dt(4,zt)),r(2),S(n?3:2),r(6),O("ngModel",t.targetUrlCtrl)}}var V=new yt,we=(o={destinations:[]})=>V.group({destinations:V.array(o.destinations)}),be=({key:o,customGroup:e,dynamicGroup:t,advancedGroup:n})=>V.group({destinationType:V.control(o),custom:e,dynamic:t,advanced:n}),Y=class o{#i=C(Ct);#o=C(St);#t=C(Bt);#e=C(Nt);#a=C(xt);injector=C(nt);formRef=mt.required("formRef");targetUrlModel=this.#t.targetUrlModel;targetUrlCtrl=I(null);targetUrlInitial=I(null);targetUrlDialogOpen=I(!1);toggleNewDestination=I(!0);testSignal=this.#t.testSignal;testErrorMessage=this.#t.testErrorMessage;selectedDestinationType=L(()=>{let e=this.targetUrlModel();if(!e)return null;let t=e.split("://")[0];return Pt(t)??null});selectedDestinationTypeOption=L(()=>{let e=this.selectedDestinationType();return e?{key:e.customKey??e.key,customKey:e.customKey??null,displayName:e.displayName,description:e.description,icon:e.icon}:null});copyTargetUrl(){navigator.clipboard.writeText(this.targetUrlModel()??"")}openTargetUrlDialog(){let e=this.targetUrlModel();this.targetUrlCtrl.set(e),this.targetUrlInitial.set(e),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(e=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl(),n=this.targetUrlInitial();!e||t===n||!t||this.#t.setTargetUrl(t)}testDestination(e,t,n){let i=this.targetUrlModel();i&&(this.#t.setTestState("testing"),this.#a.testDestination(i,e,!0,!0).subscribe({next:a=>{if(a.action==="success"){this.#t.setTestState("success"),this.#t.isNew()&&(a.containsBackup===!0?(this.#t.setTestState("warning",$localize`The remote destination already contains a backup. Please use a different folder for each backup.`),t||this.#e.open($,{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.#t.setTestState("warning",$localize`The remote destination contains unknown files.`),t||this.#e.open($,{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}}))),n?.();return}if(this.#t.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){n?.();return}let N=i.includes("?");a.action==="trust-cert"&&this.#t.setTargetUrl(i+`${N?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#t.setTargetUrl(i+`${N?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,t):n?.()}}))}setDestination(e){this.#t.setTargetUrl(`${e}://`,!0)}removeDestination(){this.#t.setTargetUrl(null,!0)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let e=this.#t.isNew(),t=this.testSignal();if(!e){this.#n();return}if(t===""){this.#e.open($,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:n=>{n?this.testDestination(0,!1,()=>{this.testSignal()==="success"?this.#n():this.#e.open($,{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(t!=="success"){this.#e.open($,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Yes, continue`,cancelText:$localize`Cancel`},closed:n=>{n&&this.#n()}});return}this.#n()}#n(){this.#t.isNew()||this.#t.submit(!0),this.#i.navigate(["source-data"],{relativeTo:this.#o.parent})}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=f({type:o,selectors:[["app-destination"]],viewQuery:function(t,n){t&1&&ut(n.formRef,Vt,5),t&2&&_t()},features:[Tt([{provide:Ut,useClass:Rt}])],decls:27,vars:11,consts:()=>{let e;e=$localize` Backup destination ${"\uFFFD#6\uFFFD"}:START_TAG_DIV:${"[\uFFFD*7:1\uFFFD|\uFFFD*7:4\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON: Test destination ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*7:1\uFFFD|\uFFFD/*8:2\uFFFD|\uFFFD/*7:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*8:2\uFFFD"}:START_BLOCK_IF_1:${"[\uFFFD#1:2\uFFFD|\uFFFD#5:3\uFFFD]"}:START_TAG_BUTTON_1:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:link${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON: Set target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*7:1\uFFFD|\uFFFD/*8:2\uFFFD|\uFFFD/*7:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*9:3\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:3\uFFFD"}:START_TAG_SH_MENU:${"\uFFFD#2:3\uFFFD"}:START_TAG_BUTTON_2:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:dots-three-vertical${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#4:3\uFFFD"}:START_TAG_NG_CONTAINER:${"[\uFFFD#1:2\uFFFD|\uFFFD#5:3\uFFFD]"}:START_TAG_BUTTON_1:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:link${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON: Edit target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD*7:1\uFFFD|\uFFFD*7:4\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:4\uFFFD"}:START_TAG_BUTTON_3:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:copy${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy url to clipboard ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*7:1\uFFFD|\uFFFD/*8:2\uFFFD|\uFFFD/*7:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD/#4:3\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#1:3\uFFFD"}:CLOSE_TAG_SH_MENU:${"\uFFFD/*9:3\uFFFD"}:CLOSE_BLOCK_ELSE:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_DIV:`,e=X(e);let t;t=$localize`${"\uFFFD#21\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#21\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let n;n=$localize`${"\uFFFD*24: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/*24:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*25: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/*25:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,n=X(n);let i;i=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Testing connection... `;let a;a=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:check${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Connection tested successfully. `;let N;N=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let y;y=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let P;P=$localize`Change`;let J;J=$localize`Be careful, this will overwrite everything you have in your destination.`;let Z;Z=$localize` Override target URL ${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON:`;let tt;tt=$localize`Set target URL`;let et;return et=$localize`Edit target URL`,[["formRef",""],e,t,n,i,a,N,y,P,J,Z,tt,et,[3,"submit"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small",3,"loader","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",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(t,n){if(t&1){let i=g();j(0),s(1,"form",13,0),D("submit",function(){return d(i),T(n.next())}),s(3,"header")(4,"h3",14),u(5,1),s(6,"div",15),m(7,Ht,2,3,"button",16),m(8,Xt,3,0,"button",17)(9,jt,8,1,"sh-menu"),F(),_(),F(),m(10,qt,3,0,"sh-alert")(11,Qt,3,0,"sh-alert",18)(12,Yt,3,1,"sh-alert",19)(13,Jt,3,1,"sh-alert",20),j(14),m(15,Zt,3,1,"app-destination-list-item",21),F(),m(16,te,1,0,"app-destination-list"),m(17,ee,1,1,"app-single-destination",22),s(18,"div",23)(19,"button",24),D("click",function(){return d(i),T(n.goBack())}),u(20,2),c(21,"sh-icon"),_(),F(),s(22,"button",25),u(23,3),m(24,ne,2,0,"sh-icon",26)(25,ie,2,0,"sh-icon"),_(),F()()(),m(26,se,15,5,"sh-dialog",27)}if(t&2){let i=q(!!n.targetUrlModel());r(7),S(i?7:-1),r(),S(i?9:8),r(2),S(n.testSignal()=="testing"?10:n.testSignal()=="success"?11:n.testSignal()=="warning"?12:n.testSignal()=="error"?13:-1),r(4);let a=q(n.selectedDestinationTypeOption());r(),S(a?15:-1),r(),S(i?-1:16),r(),S(i?17:-1),r(5),h("disabled",n.testSignal()=="testing"||!i),r(2),S(n.testSignal()=="testing"?24:25),r(2),S(n.targetUrlDialogOpen()?26:-1)}},dependencies:[wt,K,M,G,Mt,b,v,At,k,$t,w,Et,U,It,ht],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%;overflow:hidden;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}"],changeDetection:0})};export{we as createDestinationForm,be as createDestinationFormGroup,Y as default};
1
+ import{a as xt,b as Lt,c as Rt,d as Ut,e as wt}from"./chunk-QEHNEYWY.js";import"./chunk-7IQY6U5W.js";import"./chunk-TK5QY2QD.js";import{a as Pt}from"./chunk-KDYD6LMI.js";import{h as Bt}from"./chunk-VGUK4FJP.js";import"./chunk-FZTPUMUC.js";import"./chunk-DDWLL7XA.js";import"./chunk-2QJC4PGQ.js";import"./chunk-O64ZZGQZ.js";import{a as $}from"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import{c as b,e as v,f as At,g as $t,i as k,j as Mt,r as yt,s as G}from"./chunk-N5SC4SKW.js";import{b as St,d as Ct}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as U,b as ht,d as It,e as Nt,g as ft,h as Ot,l as w,o as Et}from"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import{Ab as s,Bb as F,Cb as c,Gb as Ft,Hb as rt,Jb as g,Oa as it,Oc as L,Qb as u,Ra as r,Rb as _,Sb as B,Tb as z,Tc as gt,Ub as H,Uc as pt,Vb as X,Vc as mt,Wb as D,Yb as l,Zb as lt,_ as C,_b as ct,bb as f,ea as d,ec as ut,fa as T,fc as _t,ia as nt,ic as dt,lc as x,mc as W,oa as I,qc as O,rc as E,sc as A,tc as j,ub as m,uc as q,vb as S,vc as R,wb as ot,wc as Q,xb as at,yb as st,yc as Tt,zb as h,zc as Dt}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var kt=["*"],M=class o{destination=pt.required();static \u0275fac=function(t){return new(t||o)};static \u0275cmp=f({type:o,selectors:[["app-destination-list-item"]],inputs:{destination:[1,"destination"]},ngContentSelectors:kt,decls:9,vars:6,consts:[[1,"type-b"],[1,"icon"],[3,"src","alt"],[1,"name"],[1,"description"],[1,"actions"]],template:function(t,n){if(t&1&&(lt(),s(0,"sh-card",0)(1,"div",1),c(2,"img",2),F(),s(3,"div",3),x(4),F(),s(5,"div",4),x(6),F(),s(7,"div",5),ct(8),F()()),t&2){let i=n.destination();r(2),h("src",Q(i.icon),it)("alt",Q(i.displayName)),r(2),W(i.displayName),r(2),W(i.description)}},dependencies:[Ot],styles:['[_nghost-%COMP%]{display:block}sh-card[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:3rem 1fr auto;grid-template-areas:"icon name actions" "icon description actions";gap:.25rem 1rem}sh-card[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{grid-area:icon;display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:var(--shape-2)}sh-card[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{object-fit:contain;width:100%;border-radius:var(--shape-2);overflow:hidden}sh-card[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{grid-area:name;font:var(--paragraph-10)}sh-card[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{grid-area:description;color:var(--base-8)}sh-card[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{grid-area:actions;display:flex;align-items:center;gap:.5rem}'],changeDetection:0})};function Kt(o,e){if(o&1){let t=g();s(0,"app-destination-list-item",3)(1,"button",4),D("click",function(){let i=d(t).$implicit,a=l();return T(a.setDestination.emit(i.key))}),u(2,0),c(3,"sh-icon"),_(),F()()}if(o&2){let t=e.$implicit;h("destination",t)}}var K=class o{#i=C(Lt);setDestination=gt();destinationSearchTerm=I("");destinationTypeOptionsInFocus=I(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=this.#i.destinationTypeOptions;destinationTypeOptionsFocused=L(()=>{let e=new Set(this.destinationTypeOptionsInFocus()),t=this.destinationTypeOptions(),n=this.destinationSearchTerm().toLowerCase(),i=[...t].sort((a,N)=>{let y=e.has(a.key),P=e.has(N.key);return y&&!P?-1:!y&&P?1:0});return n?i.filter(a=>a.displayName.toLowerCase().includes(n)):i});static \u0275fac=function(t){return new(t||o)};static \u0275cmp=f({type:o,selectors:[["app-destination-list"]],outputs:{setDestination:"setDestination"},decls:5,vars:1,consts:()=>{let e;e=$localize`Search for destination...`;let t;return t=$localize` Choose ${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON:`,[t,["type","text","placeholder",e,3,"ngModelChange","ngModel"],[1,"list"],[3,"destination"],["shButton","","type","button",3,"click"]]},template:function(t,n){t&1&&(s(0,"sh-form-field")(1,"input",1),A("ngModelChange",function(a){return E(n.destinationSearchTerm,a)||(n.destinationSearchTerm=a),a}),F()(),s(2,"div",2),at(3,Kt,4,1,"app-destination-list-item",3,ot),F()),t&2&&(r(),O("ngModel",n.destinationSearchTerm),r(2),st(n.destinationTypeOptionsFocused()))},dependencies:[M,G,b,v,k,w,ft,U],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:hidden}.list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:auto;padding-bottom:1rem;border-bottom:.0625rem solid var(--base-4)}"],changeDetection:0})};var Vt=["formRef"],zt=()=>({maxWidth:"700px",width:"100%"});function Ht(o,e){if(o&1){let t=g();u(0,1,1),s(1,"button",28),D("click",function(){d(t);let i=l();return T(i.testDestination(0,!0))}),F(),_()}if(o&2){let t=l();r(),dt("loader",t.testSignal()=="testing"),h("disabled",t.testSignal()=="testing")}}function Xt(o,e){if(o&1){let t=g();u(0,1,2),s(1,"button",29),D("click",function(){d(t);let i=l();return T(i.openTargetUrlDialog())}),c(2,"sh-icon"),F(),_()}}function Wt(o,e){if(o&1){let t=g();u(0,1,4),s(1,"button",29),D("click",function(){d(t);let i=l(2);return T(i.copyTargetUrl())}),c(2,"sh-icon"),F(),_()}}function jt(o,e){if(o&1){let t=g();u(0,1,3),s(1,"sh-menu")(2,"button",17),c(3,"sh-icon"),F(),Ft(4,30),s(5,"button",29),D("click",function(){d(t);let i=l();return T(i.openTargetUrlDialog())}),c(6,"sh-icon"),F(),m(7,Wt,3,0,"button",17),rt(),F(),_()}if(o&2){l();let t=R(0);r(7),S(t?7:-1)}}function qt(o,e){o&1&&(s(0,"sh-alert"),u(1,4),c(2,"sh-icon",31),_(),F())}function Qt(o,e){o&1&&(s(0,"sh-alert",18),u(1,5),c(2,"sh-icon",31),_(),F())}function Yt(o,e){if(o&1&&(s(0,"sh-alert",19),u(1,6),c(2,"sh-icon",31),_(),F()),o&2){let t=l();r(2),z(t.testErrorMessage()),H(1)}}function Jt(o,e){if(o&1&&(s(0,"sh-alert",20),u(1,7),c(2,"sh-icon",31),_(),F()),o&2){let t=l();r(2),z(t.testErrorMessage()),H(1)}}function Zt(o,e){if(o&1){let t=g();s(0,"app-destination-list-item",21)(1,"button",24),D("click",function(){d(t);let i=l();return T(i.removeDestination())}),B(2,8),F()()}if(o&2){l();let t=R(14);h("destination",t)}}function te(o,e){if(o&1){let t=g();s(0,"app-destination-list",32),D("setDestination",function(i){d(t);let a=l();return T(a.setDestination(i))}),F()}}function ee(o,e){if(o&1){let t=g();s(0,"app-single-destination",33),A("targetUrlChange",function(i){d(t);let a=l();return E(a.targetUrlModel,i)||(a.targetUrlModel=i),T(i)}),F()}if(o&2){let t=l();O("targetUrl",t.targetUrlModel)}}function ne(o,e){o&1&&(u(0,3,1),c(1,"sh-icon",26),_())}function ie(o,e){o&1&&(u(0,3,2),c(1,"sh-icon"),_())}function oe(o,e){o&1&&(s(0,"h2"),B(1,11),F())}function ae(o,e){o&1&&(s(0,"h2"),B(1,12),F())}function se(o,e){if(o&1){let t=g();s(0,"sh-dialog",34),A("isOpenChange",function(i){d(t);let a=l();return E(a.targetUrlDialogOpen,i)||(a.targetUrlDialogOpen=i),T(i)}),s(1,"header",35),m(2,oe,2,0,"h2")(3,ae,2,0,"h2"),s(4,"sh-alert",19),B(5,9),F()(),s(6,"div",36)(7,"sh-form-field")(8,"textarea",37),A("ngModelChange",function(i){d(t);let a=l();return E(a.targetUrlCtrl,i)||(a.targetUrlCtrl=i),T(i)}),F()()(),s(9,"footer",38)(10,"button",24),D("click",function(){d(t);let i=l();return T(i.closeTargetUrlDialog(!1))}),x(11,"Cancel"),F(),s(12,"button",39),D("click",function(){d(t);let i=l();return T(i.closeTargetUrlDialog(!0))}),u(13,10),c(14,"sh-icon"),_(),F()()()}if(o&2){let t=l(),n=R(0);O("isOpen",t.targetUrlDialogOpen),h("options",Dt(4,zt)),r(2),S(n?3:2),r(6),O("ngModel",t.targetUrlCtrl)}}var V=new yt,we=(o={destinations:[]})=>V.group({destinations:V.array(o.destinations)}),be=({key:o,customGroup:e,dynamicGroup:t,advancedGroup:n})=>V.group({destinationType:V.control(o),custom:e,dynamic:t,advanced:n}),Y=class o{#i=C(Ct);#o=C(St);#t=C(Bt);#e=C(Nt);#a=C(xt);injector=C(nt);formRef=mt.required("formRef");targetUrlModel=this.#t.targetUrlModel;targetUrlCtrl=I(null);targetUrlInitial=I(null);targetUrlDialogOpen=I(!1);toggleNewDestination=I(!0);testSignal=this.#t.testSignal;testErrorMessage=this.#t.testErrorMessage;selectedDestinationType=L(()=>{let e=this.targetUrlModel();if(!e)return null;let t=e.split("://")[0];return Pt(t)??null});selectedDestinationTypeOption=L(()=>{let e=this.selectedDestinationType();return e?{key:e.customKey??e.key,customKey:e.customKey??null,displayName:e.displayName,description:e.description,icon:e.icon}:null});copyTargetUrl(){navigator.clipboard.writeText(this.targetUrlModel()??"")}openTargetUrlDialog(){let e=this.targetUrlModel();this.targetUrlCtrl.set(e),this.targetUrlInitial.set(e),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(e=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl(),n=this.targetUrlInitial();!e||t===n||!t||this.#t.setTargetUrl(t)}testDestination(e,t,n){let i=this.targetUrlModel();i&&(this.#t.setTestState("testing"),this.#a.testDestination(i,e,!0,!0).subscribe({next:a=>{if(a.action==="success"){this.#t.setTestState("success"),this.#t.isNew()&&(a.containsBackup===!0?(this.#t.setTestState("warning",$localize`The remote destination already contains a backup. Please use a different folder for each backup.`),t||this.#e.open($,{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.#t.setTestState("warning",$localize`The remote destination contains unknown files.`),t||this.#e.open($,{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}}))),n?.();return}if(this.#t.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){n?.();return}let N=i.includes("?");a.action==="trust-cert"&&this.#t.setTargetUrl(i+`${N?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#t.setTargetUrl(i+`${N?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,t):n?.()}}))}setDestination(e){this.#t.setTargetUrl(`${e}://`,!0)}removeDestination(){this.#t.setTargetUrl(null,!0)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let e=this.#t.isNew(),t=this.testSignal();if(!e){this.#n();return}if(t===""){this.#e.open($,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:n=>{n?this.testDestination(0,!1,()=>{this.testSignal()==="success"?this.#n():this.#e.open($,{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(t!=="success"){this.#e.open($,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Yes, continue`,cancelText:$localize`Cancel`},closed:n=>{n&&this.#n()}});return}this.#n()}#n(){this.#t.isNew()||this.#t.submit(!0),this.#i.navigate(["source-data"],{relativeTo:this.#o.parent})}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=f({type:o,selectors:[["app-destination"]],viewQuery:function(t,n){t&1&&ut(n.formRef,Vt,5),t&2&&_t()},features:[Tt([{provide:Ut,useClass:Rt}])],decls:27,vars:11,consts:()=>{let e;e=$localize` Backup destination ${"\uFFFD#6\uFFFD"}:START_TAG_DIV:${"[\uFFFD*7:1\uFFFD|\uFFFD*7:4\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON: Test destination ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*7:1\uFFFD|\uFFFD/*8:2\uFFFD|\uFFFD/*7:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*8:2\uFFFD"}:START_BLOCK_IF_1:${"[\uFFFD#1:2\uFFFD|\uFFFD#5:3\uFFFD]"}:START_TAG_BUTTON_1:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:link${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON: Set target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*7:1\uFFFD|\uFFFD/*8:2\uFFFD|\uFFFD/*7:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*9:3\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:3\uFFFD"}:START_TAG_SH_MENU:${"\uFFFD#2:3\uFFFD"}:START_TAG_BUTTON_2:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:dots-three-vertical${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#4:3\uFFFD"}:START_TAG_NG_CONTAINER:${"[\uFFFD#1:2\uFFFD|\uFFFD#5:3\uFFFD]"}:START_TAG_BUTTON_1:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:link${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON: Edit target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD*7:1\uFFFD|\uFFFD*7:4\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:4\uFFFD"}:START_TAG_BUTTON_3:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:copy${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy url to clipboard ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*7:1\uFFFD|\uFFFD/*8:2\uFFFD|\uFFFD/*7:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD/#4:3\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#1:3\uFFFD"}:CLOSE_TAG_SH_MENU:${"\uFFFD/*9:3\uFFFD"}:CLOSE_BLOCK_ELSE:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_DIV:`,e=X(e);let t;t=$localize`${"\uFFFD#21\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#21\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let n;n=$localize`${"\uFFFD*24: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/*24:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*25: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/*25:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,n=X(n);let i;i=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Testing connection... `;let a;a=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:check${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Connection tested successfully. `;let N;N=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let y;y=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let P;P=$localize`Change`;let J;J=$localize`Be careful, this will overwrite everything you have in your destination.`;let Z;Z=$localize` Override target URL ${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON:`;let tt;tt=$localize`Set target URL`;let et;return et=$localize`Edit target URL`,[["formRef",""],e,t,n,i,a,N,y,P,J,Z,tt,et,[3,"submit"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small",3,"loader","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",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(t,n){if(t&1){let i=g();j(0),s(1,"form",13,0),D("submit",function(){return d(i),T(n.next())}),s(3,"header")(4,"h3",14),u(5,1),s(6,"div",15),m(7,Ht,2,3,"button",16),m(8,Xt,3,0,"button",17)(9,jt,8,1,"sh-menu"),F(),_(),F(),m(10,qt,3,0,"sh-alert")(11,Qt,3,0,"sh-alert",18)(12,Yt,3,1,"sh-alert",19)(13,Jt,3,1,"sh-alert",20),j(14),m(15,Zt,3,1,"app-destination-list-item",21),F(),m(16,te,1,0,"app-destination-list"),m(17,ee,1,1,"app-single-destination",22),s(18,"div",23)(19,"button",24),D("click",function(){return d(i),T(n.goBack())}),u(20,2),c(21,"sh-icon"),_(),F(),s(22,"button",25),u(23,3),m(24,ne,2,0,"sh-icon",26)(25,ie,2,0,"sh-icon"),_(),F()()(),m(26,se,15,5,"sh-dialog",27)}if(t&2){let i=q(!!n.targetUrlModel());r(7),S(i?7:-1),r(),S(i?9:8),r(2),S(n.testSignal()=="testing"?10:n.testSignal()=="success"?11:n.testSignal()=="warning"?12:n.testSignal()=="error"?13:-1),r(4);let a=q(n.selectedDestinationTypeOption());r(),S(a?15:-1),r(),S(i?-1:16),r(),S(i?17:-1),r(5),h("disabled",n.testSignal()=="testing"||!i),r(2),S(n.testSignal()=="testing"?24:25),r(2),S(n.targetUrlDialogOpen()?26:-1)}},dependencies:[wt,K,M,G,Mt,b,v,At,k,$t,w,Et,U,It,ht],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%;overflow:hidden;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}"],changeDetection:0})};export{we as createDestinationForm,be as createDestinationFormGroup,Y as default};
@@ -1 +1 @@
1
- import{g as h}from"./chunk-DAYBMF7U.js";import"./chunk-4DNWEJIW.js";import"./chunk-TK5QY2QD.js";import{a as w}from"./chunk-NJEX2N4Q.js";import{h as k}from"./chunk-MQI3XY6Q.js";import"./chunk-23CWXAU4.js";import"./chunk-DDWLL7XA.js";import"./chunk-2QJC4PGQ.js";import{b as T}from"./chunk-O64ZZGQZ.js";import"./chunk-6LTGTS6B.js";import"./chunk-DVDTYV66.js";import"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import"./chunk-N5SC4SKW.js";import"./chunk-Z3EPZZGY.js";import"./chunk-UKQFDBNO.js";import{a as L,b as M,c as N,d as I,e as G,f as W}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{q as v,v as y}from"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-TDKBGGNK.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-6OPAGPKF.js";import{Ab as i,Ac as p,Bb as n,Cb as s,Pc as $,Qb as F,Ra as r,Rb as l,Yb as O,_ as u,bb as D,ic as P,oa as C,ub as g,vb as E,yc as A,zb as _,zc as R}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var b=()=>["/restore-from-files/destination"],x=()=>["/restore-from-files/encryption"],H=()=>["/restore-from-files/select-files"],X=()=>["/restore-from-files/options"],z=t=>["/restore",t,"select-files"],B=t=>["/restore",t,"options"];function U(t,o){t&1&&(i(0,"div",6),F(1,0),s(2,"sh-radio"),l(),n(),i(3,"div",6),F(4,1),s(5,"sh-radio"),l(),n(),i(6,"div",6),F(7,2),s(8,"sh-radio"),l(),n(),i(9,"div",6),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,X)))}function j(t,o){if(t&1&&(i(0,"div",6),F(1,4),s(2,"sh-radio"),l(),n(),i(3,"div",6),F(4,5),s(5,"sh-radio"),l(),n()),t&2){let e=O(2);_("routerLink",p(2,z,e.backupId())),r(3),_("routerLink",p(4,B,e.backupId()))}}function V(t,o){if(t&1&&(i(0,"sh-stepper"),g(1,U,12,8)(2,j,6,6),n()),t&2){let e=O();r(),E(e.isFileRestore()?1:2)}}var m=class t{#e=u(M);#o=u(I);#t=u(h);#i=T(this.#e.params);#n=T(this.#e.url);#s=T(this.#e.children[0].url);backupId=this.#t.backupId;isFileRestore=this.#t.isFileRestore;isProgressPage=C(!1);paramsChanged=$(()=>{let o=this.#s(),e=this.#i()?.id,a=!!this.#n()?.find(d=>d.path==="restore-from-files"),c=!!o?.find(d=>d.path==="progress");this.isProgressPage.set(c),this.#t.init(e,a)});ngOnInit(){this.#o.events.subscribe(o=>{if(o instanceof L){let e=o.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&&P("full-width",a.isProgressPage())},features:[A([h,k])],decls:4,vars:1,consts:()=>{let o;o=$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 c;c=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `;let d;d=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_RADIO: Select files `;let f;return f=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `,[o,e,a,c,d,f,["step","","routerLinkActive","active",3,"routerLink"]]},template:function(e,a){e&1&&(s(0,"app-status-bar"),g(1,V,3,1,"sh-stepper"),i(2,"section"),s(3,"router-outlet"),n()),e&2&&(r(),E(a.isProgressPage()?-1:1))},dependencies:[y,v,w,N,G,W],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}"],changeDetection:0})};export{m as default};
1
+ import{g as h}from"./chunk-7ZTBW6LJ.js";import"./chunk-K56EDP42.js";import"./chunk-TK5QY2QD.js";import{a as w}from"./chunk-NJEX2N4Q.js";import{h as k}from"./chunk-VGUK4FJP.js";import"./chunk-FZTPUMUC.js";import"./chunk-DDWLL7XA.js";import"./chunk-2QJC4PGQ.js";import{b as T}from"./chunk-O64ZZGQZ.js";import"./chunk-6LTGTS6B.js";import"./chunk-DVDTYV66.js";import"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import"./chunk-N5SC4SKW.js";import"./chunk-Z3EPZZGY.js";import"./chunk-UKQFDBNO.js";import{a as L,b as M,c as N,d as I,e as G,f as W}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{q as v,v as y}from"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-TDKBGGNK.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-6OPAGPKF.js";import{Ab as i,Ac as p,Bb as n,Cb as s,Pc as $,Qb as F,Ra as r,Rb as l,Yb as O,_ as u,bb as D,ic as P,oa as C,ub as g,vb as E,yc as A,zb as _,zc as R}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var b=()=>["/restore-from-files/destination"],x=()=>["/restore-from-files/encryption"],H=()=>["/restore-from-files/select-files"],X=()=>["/restore-from-files/options"],z=t=>["/restore",t,"select-files"],B=t=>["/restore",t,"options"];function U(t,o){t&1&&(i(0,"div",6),F(1,0),s(2,"sh-radio"),l(),n(),i(3,"div",6),F(4,1),s(5,"sh-radio"),l(),n(),i(6,"div",6),F(7,2),s(8,"sh-radio"),l(),n(),i(9,"div",6),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,X)))}function j(t,o){if(t&1&&(i(0,"div",6),F(1,4),s(2,"sh-radio"),l(),n(),i(3,"div",6),F(4,5),s(5,"sh-radio"),l(),n()),t&2){let e=O(2);_("routerLink",p(2,z,e.backupId())),r(3),_("routerLink",p(4,B,e.backupId()))}}function V(t,o){if(t&1&&(i(0,"sh-stepper"),g(1,U,12,8)(2,j,6,6),n()),t&2){let e=O();r(),E(e.isFileRestore()?1:2)}}var m=class t{#e=u(M);#o=u(I);#t=u(h);#i=T(this.#e.params);#n=T(this.#e.url);#s=T(this.#e.children[0].url);backupId=this.#t.backupId;isFileRestore=this.#t.isFileRestore;isProgressPage=C(!1);paramsChanged=$(()=>{let o=this.#s(),e=this.#i()?.id,a=!!this.#n()?.find(d=>d.path==="restore-from-files"),c=!!o?.find(d=>d.path==="progress");this.isProgressPage.set(c),this.#t.init(e,a)});ngOnInit(){this.#o.events.subscribe(o=>{if(o instanceof L){let e=o.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&&P("full-width",a.isProgressPage())},features:[A([h,k])],decls:4,vars:1,consts:()=>{let o;o=$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 c;c=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `;let d;d=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_RADIO: Select files `;let f;return f=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `,[o,e,a,c,d,f,["step","","routerLinkActive","active",3,"routerLink"]]},template:function(e,a){e&1&&(s(0,"app-status-bar"),g(1,V,3,1,"sh-stepper"),i(2,"section"),s(3,"router-outlet"),n()),e&2&&(r(),E(a.isProgressPage()?-1:1))},dependencies:[y,v,w,N,G,W],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}"],changeDetection:0})};export{m as default};