@duplicati/ngclient 0.0.159 → 0.0.161

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 (87) hide show
  1. package/assets/sh.woff2 +0 -0
  2. package/{chunk-F6ME3VE6.js → chunk-2KU5X7TN.js} +1 -1
  3. package/{chunk-XX3WLO55.js → chunk-2MIEBBFN.js} +1 -1
  4. package/{chunk-2WGW24ZH.js → chunk-2PUCHKOK.js} +1 -1
  5. package/{chunk-4NBLWONL.js → chunk-2YGOHGD2.js} +1 -1
  6. package/{chunk-XUIDYG2O.js → chunk-3S7YCGEK.js} +1 -1
  7. package/chunk-3V4DGTSM.js +1 -0
  8. package/{chunk-RZKDEJUP.js → chunk-4FWCJIJ4.js} +1 -1
  9. package/{chunk-NM7WJRU7.js → chunk-4KEA3KF7.js} +1 -1
  10. package/chunk-4NOWNXOS.js +1 -0
  11. package/{chunk-QNM5CG4Z.js → chunk-5CTM5KYC.js} +1 -1
  12. package/{chunk-XLDVUBTQ.js → chunk-5LX6M65H.js} +1 -1
  13. package/{chunk-GCCJSS4C.js → chunk-6XI3IP27.js} +1 -1
  14. package/{chunk-4IXUXIXV.js → chunk-A366Q7F5.js} +1 -1
  15. package/{chunk-2S6ABLBU.js → chunk-AUR4SBGD.js} +1 -1
  16. package/chunk-AVTEJPQ4.js +1 -0
  17. package/{chunk-PHQBBCUL.js → chunk-B32YSHV5.js} +1 -1
  18. package/{chunk-PULERFBI.js → chunk-BF2IYOUB.js} +1 -1
  19. package/{chunk-CCKT2GLS.js → chunk-BK2MSH26.js} +1 -1
  20. package/{chunk-72QJ345F.js → chunk-BZ2XGEV5.js} +1 -1
  21. package/{chunk-BQJICFF5.js → chunk-C7EUC34O.js} +1 -1
  22. package/{chunk-GOVVHVP2.js → chunk-CSL7HCLZ.js} +1 -1
  23. package/{chunk-SWD3HS57.js → chunk-CTAP3SAA.js} +1 -1
  24. package/{chunk-ZDME3W57.js → chunk-DJQOPNQJ.js} +1 -1
  25. package/{chunk-LSKF2B33.js → chunk-DUCPSWRQ.js} +1 -1
  26. package/{chunk-KAAYNQ7L.js → chunk-E6H2XELA.js} +1 -1
  27. package/chunk-EYFTFGJS.js +1 -0
  28. package/{chunk-D6KZSKI7.js → chunk-F5Z5ZAIL.js} +1 -1
  29. package/{chunk-C6F6FP4R.js → chunk-FSG362SU.js} +1 -1
  30. package/{chunk-D4F7SID5.js → chunk-G6VJHFTW.js} +1 -1
  31. package/{chunk-UST7PIBI.js → chunk-GMUNZKVL.js} +1 -1
  32. package/{chunk-MGTRQOF6.js → chunk-H44BDPZE.js} +1 -1
  33. package/{chunk-GYDI67IZ.js → chunk-H7ZKBS2Q.js} +1 -1
  34. package/{chunk-ZBVBVQO7.js → chunk-HHU5JW5J.js} +1 -1
  35. package/{chunk-4IIDZXFC.js → chunk-HJBNADRP.js} +1 -1
  36. package/{chunk-A5LNLNWR.js → chunk-HYQ6MPYI.js} +1 -1
  37. package/chunk-IUK3B6GX.js +1 -0
  38. package/{chunk-5WDKKAXO.js → chunk-K2BANUEJ.js} +1 -1
  39. package/{chunk-FNJU5CD3.js → chunk-KIIJBHZE.js} +1 -1
  40. package/{chunk-VXRNST6C.js → chunk-KXJZEADJ.js} +1 -1
  41. package/chunk-MBYGBVHF.js +1 -0
  42. package/{chunk-6YGURBW6.js → chunk-MHPSC3FM.js} +1 -1
  43. package/chunk-MTNOIKEK.js +1 -0
  44. package/chunk-MWXDEOZO.js +3 -0
  45. package/{chunk-U2Y2D6MA.js → chunk-NCDXMDW5.js} +1 -1
  46. package/{chunk-QX3IRESN.js → chunk-NSAY2K7E.js} +1 -1
  47. package/{chunk-PUNIQ3JW.js → chunk-NSPJ3ZXL.js} +1 -1
  48. package/{chunk-2QJVTZ56.js → chunk-OJ3H3ZRA.js} +1 -1
  49. package/chunk-P6IZFXXC.js +1 -0
  50. package/{chunk-2ZGJS4OW.js → chunk-PFZASYQH.js} +1 -1
  51. package/chunk-QF5WMLMJ.js +1 -0
  52. package/chunk-QWNOIRT4.js +1 -0
  53. package/{chunk-CHYEYO6L.js → chunk-R2FAS2C3.js} +1 -1
  54. package/chunk-RPUPXDQE.js +1 -0
  55. package/{chunk-7LYN2XHO.js → chunk-S4OFJD2F.js} +1 -1
  56. package/{chunk-7JHF4R5J.js → chunk-SPMSFKWG.js} +1 -1
  57. package/{chunk-EBANXXYI.js → chunk-SWAQMTBY.js} +1 -1
  58. package/{chunk-EMRD3UKA.js → chunk-TI6AQ6OL.js} +1 -1
  59. package/chunk-U562AGPC.js +1 -0
  60. package/chunk-U7GOWS7E.js +1 -0
  61. package/chunk-XJ7KXQWK.js +1 -0
  62. package/{chunk-KT7U3QIP.js → chunk-XXVFRNSP.js} +1 -1
  63. package/{chunk-3NFAL4U4.js → chunk-YCORZV4Z.js} +1 -1
  64. package/{chunk-ZMTLDG46.js → chunk-YPJRYB54.js} +1 -1
  65. package/{chunk-DW7A6PHZ.js → chunk-YYJFEUNT.js} +1 -1
  66. package/{chunk-KXM6LF3X.js → chunk-Z7WHLTVV.js} +1 -1
  67. package/index.html +2 -2
  68. package/main-L6FT73U5.js +1 -0
  69. package/package.json +1 -1
  70. package/styles-FD7LUDV4.css +1 -0
  71. package/chunk-33J6ZQYE.js +0 -1
  72. package/chunk-3OCWLJKG.js +0 -3
  73. package/chunk-72HORZFV.js +0 -1
  74. package/chunk-A2LUC3NC.js +0 -1
  75. package/chunk-DTOILX4E.js +0 -1
  76. package/chunk-GDQZEB3A.js +0 -1
  77. package/chunk-H3UUJ5EW.js +0 -1
  78. package/chunk-K3ILN56U.js +0 -1
  79. package/chunk-OKDVOGSM.js +0 -1
  80. package/chunk-PQSZLHZR.js +0 -1
  81. package/chunk-Q65KFDJ5.js +0 -1
  82. package/chunk-QF4DQYEP.js +0 -1
  83. package/chunk-RUXUFB7C.js +0 -1
  84. package/chunk-RWPF5SQT.js +0 -1
  85. package/chunk-W2CMPDWL.js +0 -1
  86. package/main-AK26L46R.js +0 -1
  87. package/styles-DYNNLJCR.css +0 -1
@@ -1 +1 @@
1
- import{a as ut,c as ct,d as dt}from"./chunk-A5LNLNWR.js";import{a as ye}from"./chunk-3NFAL4U4.js";import{a as rt,b as Ve,c as _t}from"./chunk-4VY6SMSL.js";import{b as re}from"./chunk-Z27IQRKV.js";import{a as lt}from"./chunk-72HORZFV.js";import{a as Oe}from"./chunk-XLDVUBTQ.js";import{b as ie,d as H}from"./chunk-ABYM5HWA.js";import{B as se,G as Y,K as ot,O as le,V as Me,X as at,b as Te,c as z,d as he,e as j,f as Ne,h as Qe,i as oe,j as fe,k as Ze,n as et,o as Pe,p as tt,q as Ae,r as De,s as ae,t as Re,u as q,w as nt,z as it}from"./chunk-QF4DQYEP.js";import{h as st}from"./chunk-2QJVTZ56.js";import{$b as u,Ab as $e,Bb as xe,Bc as Se,Cb as T,Db as s,Eb as l,Fb as g,H as we,Jb as B,Kb as k,Mb as x,Qc as G,Rc as ne,Sa as _,Tb as E,Ub as m,V as Ce,Vb as N,Vc as Be,Wc as ke,Xc as Fe,Yb as Ue,Zb as F,_ as O,cb as J,ea as c,fa as d,gc as ge,hb as je,hc as Ee,ic as be,kc as me,nc as U,oc as ve,pa as C,pc as Ye,sc as y,tc as L,ub as qe,uc as I,xb as A,yb as D,zb as Ge}from"./chunk-QONLYWYC.js";import{a as b,b as X}from"./chunk-EUDKD2JW.js";var Le=class a{fromString(t){if(!t)return null;let e=t.match(/(\d+)([smhDWMY])/);return e&&{value:parseInt(e[1]),unit:e[2]}}toString(t,e){return`${t}${e}`}static \u0275fac=function(e){return new(e||a)};static \u0275prov=Ce({token:a,factory:a.\u0275fac,providedIn:"root"})};function Et(a,t){if(a&1){let e=x();s(0,"div",24)(1,"sh-form-field")(2,"label",25),N(3,7),l(),s(4,"input",26,0),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.nextTime().time,i)||(o.scheduleFields.nextTime().time=i),d(i)}),F("focus",function(){c(e);let i=be(5);return d(i.showPicker())}),l(),s(6,"sh-icon",27),U(7,"clock"),l()(),s(8,"sh-form-field"),g(9,"label",28),s(10,"input",29,1),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.nextTime().date,i)||(o.scheduleFields.nextTime().date=i),d(i)}),F("focus",function(){c(e);let i=be(11);return d(i.showPicker())}),l(),s(12,"sh-icon",27),U(13,"calendar"),l()()(),s(14,"div",24)(15,"sh-form-field")(16,"label",30),N(17,8),l(),s(18,"input",31),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().repeatValue,i)||(o.scheduleFields.runAgain().repeatValue=i),d(i)}),l()(),s(19,"sh-select",32)(20,"input",33),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().repeatUnit,i)||(o.scheduleFields.runAgain().repeatUnit=i),d(i)}),l()()(),s(21,"app-toggle-card",34),B(22,35),N(23,9),k(),s(24,"div",36)(25,"sh-toggle",19),E(26,10),s(27,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.mon,i)||(o.scheduleFields.runAgain().allowedDays.mon=i),d(i)}),l(),m(),l(),s(28,"sh-toggle",19),E(29,11),s(30,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.tue,i)||(o.scheduleFields.runAgain().allowedDays.tue=i),d(i)}),l(),m(),l(),s(31,"sh-toggle",19),E(32,12),s(33,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.wed,i)||(o.scheduleFields.runAgain().allowedDays.wed=i),d(i)}),l(),m(),l(),s(34,"sh-toggle",19),E(35,13),s(36,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.thu,i)||(o.scheduleFields.runAgain().allowedDays.thu=i),d(i)}),l(),m(),l(),s(37,"sh-toggle",19),E(38,14),s(39,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.fri,i)||(o.scheduleFields.runAgain().allowedDays.fri=i),d(i)}),l(),m(),l(),s(40,"sh-toggle",19),E(41,15),s(42,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.sat,i)||(o.scheduleFields.runAgain().allowedDays.sat=i),d(i)}),l(),m(),l(),s(43,"sh-toggle",19),E(44,16),s(45,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.sun,i)||(o.scheduleFields.runAgain().allowedDays.sun=i),d(i)}),l(),m(),l()()()}if(a&2){let e=u();_(4),y("ngModel",e.scheduleFields.nextTime().time),_(6),y("ngModel",e.scheduleFields.nextTime().date),_(8),y("ngModel",e.scheduleFields.runAgain().repeatValue),_(),T("options",e.unitOptions)("isClearable",!1),_(),y("ngModel",e.scheduleFields.runAgain().repeatUnit),_(),T("disallowToggle",!0),_(6),y("ngModel",e.scheduleFields.runAgain().allowedDays.mon),_(3),y("ngModel",e.scheduleFields.runAgain().allowedDays.tue),_(3),y("ngModel",e.scheduleFields.runAgain().allowedDays.wed),_(3),y("ngModel",e.scheduleFields.runAgain().allowedDays.thu),_(3),y("ngModel",e.scheduleFields.runAgain().allowedDays.fri),_(3),y("ngModel",e.scheduleFields.runAgain().allowedDays.sat),_(3),y("ngModel",e.scheduleFields.runAgain().allowedDays.sun)}}var mt=[{key:"s",label:$localize`Seconds`},{key:"m",label:$localize`Minutes`},{key:"h",label:$localize`Hours`},{key:"D",label:$localize`Days`},{key:"W",label:$localize`Weeks`},{key:"M",label:$localize`Months`},{key:"Y",label:$localize`Years`}],ee={autoRun:!0,nextTime:{time:"13:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!1,tue:!1,wed:!1,thu:!1,fri:!1,sat:!1,sun:!1}}},Ke=class a{#e=O(Q);#t=O(H);#i=O(ie);unitOptions=mt;scheduleFields=this.#e.scheduleFields;goBack(){this.#t.navigate(["source-data"],{relativeTo:this.#i.parent})}next(){this.#e.isNew()||this.#e.submit(!0),this.#t.navigate(["options"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=J({type:a,selectors:[["app-schedule"]],decls:16,vars:2,consts:()=>{let t;t=$localize`Schedule`;let e;e=$localize` Automatically run backups ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let n;n=$localize`If a date was missed, the job will run as soon as possible.`;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let r;r=$localize`Next time`;let p;p=$localize`Run again every`;let h;h=$localize`Allowed days`;let S;S=$localize` Monday ${"\uFFFD#27\uFFFD\uFFFD/#27\uFFFD"}:TAG_INPUT:`;let w;w=$localize` Tuesday ${"\uFFFD#30\uFFFD\uFFFD/#30\uFFFD"}:TAG_INPUT:`;let P;P=$localize` Wednesday ${"\uFFFD#33\uFFFD\uFFFD/#33\uFFFD"}:TAG_INPUT:`;let $;$=$localize` Thursday ${"\uFFFD#36\uFFFD\uFFFD/#36\uFFFD"}:TAG_INPUT:`;let K;K=$localize` Friday ${"\uFFFD#39\uFFFD\uFFFD/#39\uFFFD"}:TAG_INPUT:`;let v;v=$localize` Saturday ${"\uFFFD#42\uFFFD\uFFFD/#42\uFFFD"}:TAG_INPUT:`;let W;return W=$localize` Sunday ${"\uFFFD#45\uFFFD\uFFFD/#45\uFFFD"}:TAG_INPUT:`,[["timeRef",""],["dateRef",""],t,e,n,i,o,r,p,h,S,w,P,$,K,v,W,[1,"title-30"],[1,"toggle-wrap"],[1,"raised","primary"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click"],[1,"row-inputs"],["for","time"],["type","time","id","time",3,"ngModelChange","focus","ngModel"],["suffix",""],["for","date"],["type","date","id","date",3,"ngModelChange","focus","ngModel"],["for","repeatValue"],["type","number","id","repeatValue",3,"ngModelChange","ngModel"],["value","key","label","label",3,"options","isClearable"],["type","text","id","repeatUnit",3,"ngModelChange","ngModel"],[3,"disallowToggle"],["title",""],[1,"days-wrap"]]},template:function(e,n){e&1&&(s(0,"h3",17),N(1,2),l(),s(2,"div",18)(3,"sh-toggle",19),E(4,3),s(5,"input",20),I("ngModelChange",function(o){return L(n.scheduleFields.autoRun,o)||(n.scheduleFields.autoRun=o),o}),l(),m(),l(),s(6,"p"),N(7,4),l()(),A(8,Et,46,14),s(9,"div",21)(10,"button",22),F("click",function(){return n.goBack()}),E(11,5),g(12,"sh-icon"),m(),l(),s(13,"button",23),F("click",function(){return n.next()}),E(14,6),g(15,"sh-icon"),m(),l()()),e&2&&(_(5),y("ngModel",n.scheduleFields.autoRun),_(3),D(n.scheduleFields.autoRun()?8:-1))},dependencies:[ae,z,Ze,Te,j,oe,Y,Me,q,se,le,ye],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem 2.5rem 1.5rem;display:flex;flex-direction:column;gap:1.5rem}.toggle-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.days-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};function St(a,t){if(a&1){let e=x();s(0,"sh-select",2)(1,"input",6),I("ngModelChange",function(i){c(e);let o=u();return L(o.internalPath,i)||(o.internalPath=i),d(i)}),F("ngModelChange",function(){c(e);let i=u();return d(i.updateFilter())}),l()()}if(a&2){let e=u();T("options",e.fileGroupOptions())("isClearable",!1)("selectMultiple",!0),_(),y("ngModel",e.internalPath)}}function Ft(a,t){if(a&1&&(B(0,7),U(1),k()),a&2){let e,n=u(2);_(),ve((e=n.currentExpressionOption())==null?null:e.startsWith)}}function Tt(a,t){if(a&1&&(B(0,8),U(1),k()),a&2){let e,n=u(2);_(),ve((e=n.currentExpressionOption())==null?null:e.endsWith)}}function ht(a,t){if(a&1){let e=x();s(0,"sh-form-field",3)(1,"input",6),I("ngModelChange",function(i){c(e);let o=u();return L(o.internalPath,i)||(o.internalPath=i),d(i)}),F("ngModelChange",function(){c(e);let i=u();return d(i.updateFilter())}),l(),A(2,Ft,2,1,"ng-container",7),A(3,Tt,2,1,"ng-container",8),l()}if(a&2){let e,n,i=u();_(),y("ngModel",i.internalPath),_(),D(!((e=i.currentExpressionOption())==null||e.startsWith==null)&&e.startsWith.length?2:-1),_(),D(!((n=i.currentExpressionOption())==null||n.endsWith==null)&&n.endsWith.length?3:-1)}}var Nt=[{key:"Applications",value:"Applications"},{key:"CacheFiles",value:"Cache Files"},{key:"TemporaryFiles",value:"Temporary Files"},{key:"OperatingSystem",value:"Operating System"},{key:"SystemFiles",value:"System Files"},{key:"DefaultExcludes",value:"Standard Excludes"}],ft=[{key:"Excludes folders where name contains",value:"-FolderName"},{key:"Excludes folder",value:"-Folder"},{key:"Excludes files where name contains",value:"-FileName"},{key:"Excludes file extension",value:"-Extension"},{key:"Excludes files where name matches regex",value:"-Regex"},{key:"Includes files where name matches regex",value:"+Regex"},{key:"Exclude file groups",value:"-FileGroup"},{key:"Includes expression",value:"+Expression"},{key:"Excludes expression",value:"-Expression"},{key:"None",value:"-Unknown"}],Ie=class a{path=ke.required();osType=ke();pathChange=Be();remove=Be();internalPath=C("");pathType=C("-Expression");currentExpressionOption=G(()=>{let t=this.pathType();return this.expressionOptions().find(e=>e.value===t)});fileGroupOptions=C(Nt);expressionOptions=G(()=>{let e=this.osType()==="Windows"?"\\":"/";return ft.map(n=>n.value==="-Folder"||n.value==="+Folder"?X(b({},n),{startsWith:"",endsWith:""}):n.value==="-FolderName"||n.value==="+FolderName"?X(b({},n),{startsWith:"*",endsWith:`*${e}`}):n.value==="-FileName"||n.value==="+FileName"?X(b({},n),{startsWith:"[.*",endsWith:`[^\\${e}]*]`}):n.value==="-FileGroup"||n.value==="+FileGroup"?X(b({},n),{startsWith:"{",endsWith:"}"}):n.value==="-Regex"||n.value==="+Regex"?X(b({},n),{startsWith:"[",endsWith:"]"}):n.value==="-Extension"||n.value==="+Extension"?X(b({},n),{startsWith:"*.",endsWith:""}):X(b({},n),{startsWith:"",endsWith:""}))});pathEffect=ne(()=>{let t=this.path(),e=t.slice(1),n=t.startsWith("-")?"-":"+",i=this.osType()==="Windows",o=i?"\\":"/";e.startsWith("%")&&e.endsWith(o)||i&&e.slice(2).startsWith(o)&&e.endsWith(o)||e.startsWith(o)&&e.endsWith(o)?(this.pathType.set(`${n}Folder`),this.internalPath.set(e)):e.startsWith("*")&&e.endsWith(`*${o}`)?(this.pathType.set(`${n}FolderName`),this.internalPath.set(e.slice(1,-2))):e.startsWith("[.*")&&e.endsWith(`[^\\${o}]*]`)?(this.pathType.set(`${n}FileName`),this.internalPath.set(e.slice(3,-7))):e.startsWith("{")&&e.endsWith("}")?(this.pathType.set(`${n}FileGroup`),this.internalPath.set(e.slice(1,-1))):e.startsWith("[")&&e.endsWith("]")?(this.pathType.set(`${n}Regex`),this.internalPath.set(e.slice(1,-1))):e.startsWith("*.")?(this.pathType.set(`${n}Extension`),this.internalPath.set(e.slice(2))):(this.pathType.set(`${n}Expression`),this.internalPath.set(e))});updateFilter(){let t=this.internalPath(),e=this.currentExpressionOption();t!==""&&this.pathChange.emit(`${e?.value.slice(0,1)}${e?.startsWith??""}${t}${e?.endsWith??""}`)}removeFilter(){this.remove.emit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=J({type:a,selectors:[["app-new-filter"]],inputs:{path:[1,"path"],osType:[1,"osType"]},outputs:{pathChange:"pathChange",remove:"remove"},decls:7,vars:4,consts:()=>{let t;return t=$localize`Select an option...`,[["value","value","label","key",3,"options","isClearable"],["type","text","placeholder",t,3,"ngModelChange","ngModel"],["value","key","label","value",1,"expression-input",3,"options","isClearable","selectMultiple"],[1,"expression-input"],[1,"filter-removal",3,"click"],[1,"sh-primary"],["type","text",3,"ngModelChange","ngModel"],["prefix",""],["suffix",""]]},template:function(e,n){if(e&1&&(s(0,"sh-select",0)(1,"input",1),I("ngModelChange",function(o){return L(n.pathType,o)||(n.pathType=o),o}),F("ngModelChange",function(){return n.updateFilter()}),l()(),A(2,St,2,4,"sh-select",2)(3,ht,4,3,"sh-form-field",3),s(4,"div",4),F("click",function(){return n.removeFilter()}),s(5,"sh-icon",5),U(6,"x-circle"),l()()),e&2){let i;T("options",n.expressionOptions())("isClearable",!1),_(),y("ngModel",n.pathType),_(),D(((i=n.currentExpressionOption())==null?null:i.value)=="-FileGroup"||((i=n.currentExpressionOption())==null?null:i.value)=="+FileGroup"?2:3)}},dependencies:[ae,z,j,oe,le,Y,q],styles:["[_nghost-%COMP%]{display:grid;grid-template-columns:13.125rem 1fr 1.875rem;gap:.5rem;align-items:flex-end}.expression-input[_ngcontent-%COMP%]{--ff-suffix-bg: var(--base-2)}.filter-removal[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;justify-content:center;height:2.5rem;flex:0 0}"],changeDetection:0})};var Pt=["formRef"],He=()=>({standalone:!0});function At(a,t){if(a&1){let e=x();s(0,"sh-form-field",41)(1,"input",42),I("ngModelChange",function(i){c(e);let o=u(2);return L(o.editingPath,i)||(o.editingPath=i),d(i)}),l()(),s(2,"button",43),F("click",function(){c(e);let i=u(2);return d(i.updatePath())}),s(3,"sh-icon"),U(4,"floppy-disk"),l()(),s(5,"button",43),F("click",function(){c(e);let i=u(2);return d(i.cancelEditPath())}),s(6,"sh-icon"),U(7,"x-bold"),l()()}if(a&2){let e=u(2);_(),y("ngModel",e.editingPath),T("ngModelOptions",Se(2,He))}}function Dt(a,t){if(a&1){let e=x();s(0,"sh-form-field",41),g(1,"input",44),l(),s(2,"button",43),F("click",function(){c(e);let i=u().$implicit,o=u();return d(o.editPath(i))}),s(3,"sh-icon"),U(4,"pen"),l()(),s(5,"button",43),F("click",function(){c(e);let i=u().$implicit,o=u();return d(o.removePath(i))}),s(6,"sh-icon"),U(7,"trash-simple"),l()()}if(a&2){let e=u().$implicit;qe("readonly",!0),_(),T("ngModel",e)("ngModelOptions",Se(3,He))}}function Rt(a,t){if(a&1&&(s(0,"div",30),A(1,At,8,3)(2,Dt,8,4),l()),a&2){let e=t.$implicit,n=u();_(),D(n.oldPath()===e?1:2)}}function Mt(a,t){if(a&1){let e=x();s(0,"app-new-filter",46),F("pathChange",function(i){let o=c(e).$index,r=u(2);return d(r.patchPathAt(i,o))})("remove",function(){let i=c(e).$index,o=u(2);return d(o.removePathAt(i))}),l()}if(a&2){let e=t.$implicit,n=u(2);T("path",e)("osType",n.osType()??"")}}function Ot(a,t){if(a&1&&$e(0,Mt,1,2,"app-new-filter",45,Ge),a&2){let e=u();xe(e.pathArray())}}function yt(a,t){if(a&1){let e=x();s(0,"div",31)(1,"app-size",47),F("ngModelChange",function(i){c(e);let o=u();return d(o.updateFilesLargerThan(i))}),l()()}if(a&2){let e=u();_(),T("ngModel",e.filesLargerThan())("ngModelOptions",Se(2,He))}}var V=new De,pt=(a={path:"",filters:[],excludes:{hidden:!1,system:!1,temporary:!1,filesLargerThan:null}})=>V.group({path:V.control(a.path),excludes:V.group({hidden:V.control(a.excludes.hidden),system:V.control(a.excludes.system),temporary:V.control(a.excludes.temporary),filesLargerThan:V.group({size:V.control(null),unit:V.control(null)})})}),Je=class a{#e=O(Q);#t=O(H);#i=O(ie);formRef=Fe.required("formRef");sourceDataForm=this.#e.sourceDataForm;sourceDataFormSignal=this.#e.sourceDataFormSignal;newPathCtrl=new Qe("");filesLargerThan=G(()=>this.sourceDataFormSignal()?.excludes?.filesLargerThan?.size!==null);osType=this.#e.osType;pathSignal=re(this.sourceDataForm.controls.path.valueChanges);pathArray=G(()=>this.pathSignal()?.split("\0").filter(t=>t.startsWith("-")||t.startsWith("+")||t==="___none___")??[]);nonFilterPaths=G(()=>this.pathSignal()?.split("\0").filter(t=>!t.startsWith("-")&&!t.startsWith("+")&&t!==""));oldPath=C(null);editingPath=C(null);addingNewPath=C(!1);editPath(t){this.oldPath.set(t),this.editingPath.set(t)}updateFilesLargerThan(t){let{size:e,unit:n}=ct(t);this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:e,unit:n})}updatePath(){let t=this.oldPath(),e=this.editingPath();if(!t||!e||e===t){this.oldPath.set(null),this.editingPath.set(null);return}let n=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(n?.replace(t,e)??""),this.oldPath.set(null),this.editingPath.set(null)}cancelEditPath(){this.oldPath.set(null),this.editingPath.set(null)}removePath(t){let n=(this.sourceDataForm.controls.path.value??"").split("\0"),i=n.indexOf(t);if(i===-1)return;n.splice(i,1);let o=n.filter(r=>r&&r!=="").join("\0");this.sourceDataForm.controls.path.setValue(o)}addFilter(t="-*"){let n=[this.sourceDataForm.controls.path.value,t].filter(i=>i&&i!=="").join("\0");this.sourceDataForm.controls.path.setValue(n)}patchPathAt(t,e){let i=this.sourceDataForm.controls.path.value.split("\0").filter(p=>!p.startsWith("-")&&!p.startsWith("+")).join("\0"),o=this.pathArray().map((p,h)=>h===e?`${t}`:`${p}`).join("\0"),r=[i,o].filter(p=>p&&p!=="").join("\0");this.sourceDataForm.controls.path.setValue(r)}removePathAt(t){let n=this.sourceDataForm.controls.path.value.split("\0").filter(r=>!r.startsWith("-")&&!r.startsWith("+")).join("\0"),i=this.pathArray().filter((r,p)=>p!==t).join("\0"),o=[n,i].filter(r=>r&&r!=="").join("\0");this.sourceDataForm.controls.path.setValue(o)}getPath(){return this.sourceDataForm.value.path??null}toggleFilesLargerThan(){this.sourceDataForm.controls.excludes.value.filesLargerThan?.size===null?this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:50,unit:"MB"}):this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:null,unit:null})}addNewPath(){let t=this.sourceDataForm.controls.path.value,e=this.newPathCtrl.value,n=t?.split("\0")||[];e&&!n.includes(e)&&n.push(e);let i=n.filter(o=>o&&o!=="").join("\0");this.sourceDataForm.controls.path.setValue(i),this.newPathCtrl.setValue("")}goBack(){this.#t.navigate(["destination"],{relativeTo:this.#i.parent})}next(){this.#e.isNew()||this.#e.submit(!0),this.#t.navigate(["schedule"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=J({type:a,selectors:[["app-source-data"]],viewQuery:function(e,n){e&1&&ge(n.formRef,Pt,5),e&2&&Ee()},decls:56,vars:12,consts:()=>{let t;t=$localize`Path`;let e;e=$localize`Add a direct path`;let n;n=$localize`Hidden files`;let i;i=$localize`System files`;let o;o=$localize`Temporary files`;let r;r=$localize`Source Data`;let p;p=$localize`Folder path`;let h;h=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let S;S=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let w;w=$localize`Paths`;let P;P=$localize`Add a path directly from your machine.`;let $;$=$localize`Filters`;let K;K=$localize`Customize your filters.`;let v;v=$localize`Add filter`;let W;W=$localize`Exclude`;let R;R=$localize`Choose if there’s any files you want to exclude.`;let Z;Z=$localize` Files with the Hidden attribute ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`;let _e;_e=$localize` Files with the System attribute ${"\uFFFD#49\uFFFD\uFFFD/#49\uFFFD"}:TAG_INPUT:`;let ue;ue=$localize` Files with the Temporary attribute ${"\uFFFD#52\uFFFD\uFFFD/#52\uFFFD"}:TAG_INPUT:`;let ce;ce=$localize` Files larger than `;let f;return f=$localize`Edit path`,[["formRef",""],r,p,h,S,w,P,$,K,v,W,R,Z,_e,ue,ce,[3,"submit","formGroup"],[1,"left"],[1,"title-30"],[1,"fill",3,"multiSelect","startingPath","showFiles"],["for","path"],["type","text","id","path","tabindex","4","placeholder",t,"formControlName","path"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],[1,"right"],[3,"disallowToggle"],["title",""],["description",""],[1,"paths"],[1,"path"],[1,"row-inputs"],["type","text","placeholder",e,3,"formControl"],["shButton","","type","button",1,"raised","primary",3,"click"],["type","button","shButton","","action","",3,"click"],["formGroupName","excludes",3,"disallowToggle"],[1,"raised","primary"],["type","checkbox","placeholder",n,"formControlName","hidden"],["type","checkbox","placeholder",i,"formControlName","system"],["type","checkbox","placeholder",o,"formControlName","temporary"],[1,"raised","primary",3,"click"],[1,"small"],["type","text","placeholder",f,3,"ngModelChange","ngModel","ngModelOptions"],["shButton","","type","button",1,"small",3,"click"],["type","text",3,"ngModel","ngModelOptions"],[3,"path","osType"],[3,"pathChange","remove","path","osType"],[3,"ngModelChange","ngModel","ngModelOptions"]]},template:function(e,n){if(e&1){let i=x();s(0,"form",16,0),F("submit",function(){return c(i),d(n.next())}),s(2,"div",17)(3,"h3",18),N(4,1),l(),s(5,"app-file-tree",19)(6,"label",20),N(7,2),l(),g(8,"input",21),l(),s(9,"div",22)(10,"button",23),F("click",function(){return c(i),d(n.goBack())}),E(11,3),g(12,"sh-icon"),m(),l(),s(13,"button",24),E(14,4),g(15,"sh-icon"),m(),l()()(),s(16,"div",25)(17,"app-toggle-card",26),B(18,27),N(19,5),k(),s(20,"p",28),N(21,6),l(),s(22,"div",29),$e(23,Rt,3,1,"div",30,Ge),s(25,"div",31)(26,"sh-form-field"),g(27,"input",32),l(),s(28,"button",33),F("click",function(){return c(i),d(n.addNewPath())}),s(29,"sh-icon"),U(30,"plus"),l()()()()(),s(31,"app-toggle-card",26),B(32,27),N(33,7),k(),s(34,"p",28),N(35,8),l(),s(36,"button",34),F("click",function(){return c(i),d(n.addFilter())}),N(37,9),l(),A(38,Ot,2,0),l(),s(39,"app-toggle-card",35),B(40,27),N(41,10),k(),s(42,"p",28),N(43,11),l(),s(44,"sh-toggle",36),E(45,12),g(46,"input",37),m(),l(),s(47,"sh-toggle",36),E(48,13),g(49,"input",38),m(),l(),s(50,"sh-toggle",36),E(51,14),g(52,"input",39),m(),l(),s(53,"sh-toggle",40),F("click",function(){return c(i),d(n.toggleFilesLargerThan())}),N(54,15),l(),A(55,yt,2,3,"div",31),l()()()}if(e&2){let i;T("formGroup",n.sourceDataForm),_(5),T("multiSelect",!0)("startingPath",n.getPath())("showFiles",!0),_(12),T("disallowToggle",!0),_(6),xe(n.nonFilterPaths()),_(4),T("formControl",n.newPathCtrl),_(4),T("disallowToggle",!0),_(7),D((i=n.pathSignal())!=null&&i.length?38:-1),_(),T("disallowToggle",!0),_(14),me("active",n.filesLargerThan()),_(2),D(n.filesLargerThan()?55:-1)}},dependencies:[ae,fe,z,Te,j,Ne,oe,Re,et,Pe,Ae,tt,Y,q,se,Me,Ie,ut,ye,dt],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;width:100%;flex:1 0;overflow:hidden}form[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;flex:1 0;overflow:hidden}.right[_ngcontent-%COMP%], .left[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:1.5rem}.left[_ngcontent-%COMP%]{padding:2.5rem;overflow:hidden;border-right:1px solid var(--base-4)}.right[_ngcontent-%COMP%]{padding:2.5rem 1.5rem;overflow:auto}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}sh-divider[_ngcontent-%COMP%]{margin:.75rem 0}.row-inputs[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content;gap:.25rem}.paths[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.path[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:1fr min-content min-content;gap:.25rem}"],changeDetection:0})};var Ct="1W:1D,4W:1W,12M:1M",Q=class a{#e=O(H);#t=O(Oe);#i=O(it);#n=O(st);#a=O(Le);generalForm=gt();sourceDataForm=pt();scheduleFields={autoRun:C(ee.autoRun),nextTime:C(ee.nextTime),runAgain:C(ee.runAgain)};settings=C([]);optionsFields={remoteVolumeSize:C("50MB"),backupRetention:C("all"),backupRetentionTime:C(""),backupRetentionVersions:C(0),backupRetentionCustom:C("")};targetUrlModel=C(null);backupMetadata=C(null);isDraft=C(!1);backupId=C(null);backupName=G(()=>this.generalFormSignal()?.name??"");isSubmitting=C(!1);finishedLoading=C(!1);backupDefaults=C(null);applicationOptions=C(null);isNew=G(()=>this.backupId()==="new");osType=G(()=>this.#t.systemInfo()?.OSType);selectedOptions=C([]);sourceDataFormSignal=re(this.sourceDataForm.valueChanges);generalFormSignal=re(this.generalForm.valueChanges);encryptionFieldSignal=re(this.generalForm.controls.encryption.valueChanges);advancedOptions=G(()=>this.#t.systemInfo()?.Options?.map(this.#_)??[]);#o=C("");#s=C(null);#l=null;testSignal=this.#o.asReadonly();testErrorMessage=this.#s.asReadonly();#d=ne(()=>{let t=this.targetUrlModel(),e=this.#o(),n=this.#l;this.#l=t,!(e==="testing"||n===null||n===t)&&(this.#o.set(""),this.#s.set(null))});setTestState(t,e){this.#o.set(t),this.#s.set(e??null)}#_(t){return{name:t.Name,type:t.Type,shortDescription:t.ShortDescription??void 0,longDescription:t.LongDescription??void 0,options:t.ValidValues}}encryptionOptions=G(()=>{let t=this.#t.systemInfo()?.EncryptionModules??[];return[pe,...t]});nonSelectedOptions=G(()=>this.advancedOptions().sort((t,e)=>t?.name&&e?.name?t?.name.localeCompare(e?.name):0).filter(t=>this.selectedOptions()?.findIndex(e=>e.name===t.name)===-1));submit(t=!1){this.isSubmitting.set(!0);let e=this.#u(),n=this.backupId();this.isDraft()&&e.Backup&&(e.Backup.Metadata=this.backupMetadata()),n==="new"||!n||this.isDraft()?this.#n.postApiV1Backups({requestBody:e}).pipe(we(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{t||this.exit(!1)},error:()=>{}}):this.#n.putApiV1BackupById({id:n,requestBody:e}).pipe(we(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{t||this.exit(!1)},error:()=>{}})}exit(t){if(!t){this.#r(),this.#e.navigate(["/"]);return}this.#i.open(lt,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:e=>{e&&(this.#r(),this.#e.navigate(["/"]))}})}mapSourceDataToForm(t){let e=t.Sources??"",n=t.Filters?.map(p=>`${p.Include?"":"-"}${p.Expression}`)??[],i=t.Settings?.find(p=>p.Name==="--exclude-files-attributes")?.Value??"",o=t.Settings?.find(p=>p.Name==="--skip-files-larger-than")??null,r={path:[...e,...n].join("\0"),excludes:{hiddenFiles:i.includes("hidden"),systemFiles:i.includes("system"),tempFiles:i.includes("temporary"),filesLargerThan:o?.Value?.toUpperCase()??null}};this.sourceDataForm.patchValue(r)}mapDestinationToForm(t){this.targetUrlModel.set(t.TargetURL??"")}mapGeneralToForm(t){let e=t.Name??"",n=t.Description??"",i=t.Settings?.find(S=>S.Name==="encryption-module"),o=t.Settings?.find(S=>S.Name==="passphrase")?.Value??"",r=i?.Value&&i.Value.length?i.Value:"",p=t.Settings?.find(S=>S.Name==="compression-module")?.Value??"",h={name:t.Name??"",description:t.Description??""};e&&e!==""&&(h.name=e),n&&n!==""&&(h.description=n),r&&r!==""&&(h.encryption=r),o&&o!==""&&(h.password=o,h.repeatPassword=o),p&&p!==""&&(h.compression=p),this.generalForm.patchValue(h)}mapScheduleToForm(t){if(!t){this.scheduleFields.autoRun.set(!1);return}let e=this.#a.fromString(t.Repeat)??null,n=this.#c(t.Time);this.scheduleFields.autoRun.set(!0),this.scheduleFields.nextTime.update(i=>b(b({},i),n)),this.scheduleFields.runAgain.set({repeatValue:e?.value??1,repeatUnit:e?.unit??"D",allowedDays:{mon:t.AllowedDays?.includes("mon")??!1,tue:t.AllowedDays?.includes("tue")??!1,wed:t.AllowedDays?.includes("wed")??!1,thu:t.AllowedDays?.includes("thu")??!1,fri:t.AllowedDays?.includes("fri")??!1,sat:t.AllowedDays?.includes("sat")??!1,sun:t.AllowedDays?.includes("sun")??!1}})}mapOptionsToForms(t){let e=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","dblock-size","passphrase","keep-time","keep-versions","retention-policy"],n=t.Settings?.filter(r=>!e.includes(r.Name)),i=t.Settings?.filter(r=>e.includes(r.Name));this.settings.set(n??[]),n?.forEach(r=>{if(r.Name==="encryption-module"&&this.isNew())return this.generalForm.controls.encryption.setValue(r.Value??"")});var o="all";i?.forEach(r=>{if(r.Name==="dblock-size"&&this.optionsFields.remoteVolumeSize.set(r.Value??"50MB"),r.Name==="keep-time"&&(r.Value??"")!=="")return o="time",this.optionsFields.backupRetentionTime.set(r.Value??"");if(r.Name==="keep-versions"&&(r.Value??"")!=="")return o="versions",this.optionsFields.backupRetentionVersions.set(r.Value?parseInt(r.Value):null);if(r.Name==="retention-policy"&&(r.Value??"")!=="")if(r.Value===Ct)o="smart";else return o="custom",this.optionsFields.backupRetentionCustom.set(r.Value??"")}),this.optionsFields.backupRetention.set(o)}storeMetadata(t,e){this.backupMetadata.set(e?t.Metadata??null:null)}getScheduleFormValue(){return{autoRun:this.scheduleFields.autoRun(),nextTime:this.scheduleFields.nextTime(),runAgain:this.scheduleFields.runAgain()}}#u(){let t=this.generalForm.value,e=this.getScheduleFormValue(),n=this.sourceDataForm.value,i=this.targetUrlModel(),o=null;e.runAgain?.repeatUnit&&e.runAgain?.repeatValue&&(o=this.#a.toString(e.runAgain.repeatValue,e.runAgain.repeatUnit));let r=e.runAgain?.allowedDays?Object.entries(e.runAgain?.allowedDays).filter(([P,$])=>$).map(([P,$])=>P):[],p=n.path?.split("\0")??[],h=this.mapFormsToSettings(),S=Object.entries(n.excludes??{}).filter(([P,$])=>$&&P!=="filesLargerThan").map(([P])=>P),w=n.excludes?.filesLargerThan;return S.length&&h.push({Name:"--exclude-files-attributes",Value:S.join(",")}),w&&w.size!==null&&w.unit!==null&&h.push({Name:"--skip-files-larger-than",Value:`${w.size}${w.unit}`}),{Backup:{Name:t.name,Description:t.description,TargetURL:i??null,Sources:p.filter(P=>!P.startsWith("-")),Settings:h,Filters:p.filter(P=>P.startsWith("-")).map((P,$)=>({Order:$,Include:!1,Expression:P.slice(1)}))},Schedule:e.autoRun?{Repeat:o,Time:e.nextTime?.date?new Date(`${e.nextTime.date}T${e.nextTime?.time||"00:00:00"}`).toISOString():null,AllowedDays:r}:null}}mapFormsToSettings(t=[]){let e=this.generalForm.value,n=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","encryption-module","passphrase","keep-time","keep-versions","retention-policy","dblock-size","compression-module"],i=[{Name:"--no-encryption",Value:"True"}];e.encryption!==""&&e.encryption!==pe.Key&&(i=[{Name:"encryption-module",Value:e.encryption??null},{Name:"passphrase",Value:e.password??null}]);let o=[{Name:"compression-module",Value:e.compression}];e.compression===""&&(o=[]);let r=[{Name:"dblock-size",Value:this.optionsFields.remoteVolumeSize()}];switch(this.optionsFields.backupRetention()){case"time":r.push({Name:"keep-time",Value:this.optionsFields.backupRetentionTime()});break;case"versions":r.push({Name:"keep-versions",Value:this.optionsFields.backupRetentionVersions()?.toString()??""});break;case"custom":r.push({Name:"retention-policy",Value:this.optionsFields.backupRetentionCustom()});break;case"smart":r.push({Name:"retention-policy",Value:Ct});break}let p=[...t,...n],h=this.settings().filter(S=>!p.includes(S.Name)).map(S=>{let w=S.Value;return typeof S.Value=="number"&&(w=S.Value.toString()),typeof S.Value=="boolean"&&(w=S.Value?"True":"False"),{Name:S.Name?.startsWith("--")?S.Name:`--${S.Name}`,Value:w}});return[...i,...o,...r,...h]}#c(t){if(!t||t?.indexOf("T")===-1)return{time:t??"13:00"};let e=new Date(t);return{time:`${(""+e.getHours()).padStart(2,"0")}:${(""+e.getMinutes()).padStart(2,"0")}`,date:e.toISOString().split("T")[0]}}setTargetUrl(t,e=!1){e&&(this.#l=null),this.targetUrlModel.set(t)}#r(){this.generalForm.reset(),this.sourceDataForm.reset(),this.scheduleFields.autoRun.set(ee.autoRun),this.scheduleFields.nextTime.set(ee.nextTime),this.scheduleFields.runAgain.set(ee.runAgain),this.optionsFields.remoteVolumeSize.set("50MB"),this.optionsFields.backupRetention.set("all"),this.settings.set([]),this.targetUrlModel.set(null)}static \u0275fac=function(e){return new(e||a)};static \u0275prov=Ce({token:a,factory:a.\u0275fac,providedIn:"root"})};var Lt=["formRef"];function It(a,t){a&1&&(s(0,"sh-alert",17),E(1,5),g(2,"sh-icon",26),m(),l())}function wt(a,t){if(a&1&&U(0),a&2){let e=t.$implicit;Ye(" ",e.DisplayName," ")}}function Gt(a,t){if(a&1&&g(0,"sh-progress-bar",40),a&2){let e=u(3);me("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),T("value",e.calculatePasswordStrength()*(100/5))}}function $t(a,t){a&1&&(s(0,"span",35),N(1,10),l())}function xt(a,t){a&1&&(E(0,8,1),g(1,"sh-icon"),m())}function Ut(a,t){a&1&&(E(0,8,2),g(1,"sh-icon"),m())}function bt(a,t){a&1&&(E(0,11,1),g(1,"sh-icon",42),m())}function vt(a,t){a&1&&(E(0,11,2),g(1,"sh-icon"),m())}function Bt(a,t){if(a&1){let e=x();s(0,"button",41),F("click",function(){c(e);let i=u(3);return d(i.copyPassword())}),E(1,11),A(2,bt,2,0)(3,vt,2,0),m(),l()}if(a&2){let e=u(3);_(2),D(e.copiedPassword()?2:3)}}function kt(a,t){a&1&&(s(0,"sh-alert",39),N(1,12),l())}function Vt(a,t){if(a&1){let e=x();s(0,"div",30)(1,"sh-form-field")(2,"label",31),E(3,7),g(4,"sup"),m(),l(),g(5,"input",32),l(),A(6,Gt,1,9,"sh-progress-bar",33),s(7,"sh-form-field"),g(8,"input",34),A(9,$t,2,0,"span",35),l(),s(10,"div",36)(11,"button",37),F("click",function(){c(e);let i=u(2);return d(i.showPassword.set(!i.showPassword()))}),E(12,8),A(13,xt,2,0)(14,Ut,2,0),m(),l(),s(15,"button",37),F("click",function(){c(e);let i=u(2);return d(i.generatePassword())}),E(16,9),g(17,"sh-icon"),m(),l(),A(18,Bt,4,1,"button",38),l(),A(19,kt,2,0,"sh-alert",39),l()}if(a&2){let e=u(2);_(5),T("type",e.showPassword()?"text":"password"),_(),D(e.generalForm.value.password?6:-1),_(2),T("type",e.showPassword()?"text":"password"),_(),D(e.generalForm.value.repeatPassword&&e.generalForm.value.repeatPassword!==e.generalForm.value.password?9:-1),_(4),D(e.showPassword()?13:14),_(5),D(e.showCopyPassword()?18:-1),_(),D(e.generalForm.value.password&&e.generalForm.value.password===e.generalForm.value.repeatPassword?19:-1)}}function Kt(a,t){if(a&1&&(s(0,"sh-select",27)(1,"label",28),N(2,6),l(),g(3,"input",29),je(4,wt,1,1,"ng-template"),l(),A(5,Vt,20,7,"div",30)),a&2){let e=u();T("options",e.encryptionOptions())("isClearable",!1),_(5),D(e.encryptionFieldSignal()!==e.noneOptionKey?5:-1)}}function Wt(a,t){if(a&1&&(s(0,"button",24),E(1,13),g(2,"sh-icon"),m(),l()),a&2){let e=u();T("disabled",e.nameAndDescriptionValid()===!1)}}function Xt(a,t){if(a&1&&(s(0,"button",25),E(1,14),g(2,"sh-icon"),m(),l()),a&2){let e=u();T("disabled",e.generalForm.invalid||e.showCopyPassword()&&!e.copiedPassword())}}var te=new De,gt=(a={name:"",description:"",encryption:"",password:"",repeatPassword:"",compression:""})=>te.group({name:te.control(a.name,[he.required]),description:te.control(a.description),encryption:te.control(a.encryption,[_t()]),password:te.control(a.password,[Ve(t=>t?.value.encryption!=="",[he.required])]),repeatPassword:te.control(a.repeatPassword,[Ve(t=>t?.value.encryption!=="",[he.required])]),compression:te.control(a.compression)}),pe={Key:"-",DisplayName:"None"},ze=class a{#e=O(H);#t=O(ie);#i=O(rt);#n=O(Q);#a=O(Oe);formRef=Fe.required("formRef");generalForm=this.#n.generalForm;generalFormSignal=this.#n.generalFormSignal;encryptionFieldSignal=this.#n.encryptionFieldSignal;encryptionOptions=this.#n.encryptionOptions;isNew=this.#n.isNew;showPassword=C(!1);copiedPassword=C(!1);showCopyPassword=C(!1);noneOptionKey=pe.Key;encryptionEffect=ne(()=>{this.encryptionFieldSignal()===pe.Key&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});nameAndDescriptionValid=G(()=>{let t=this.generalFormSignal(),e=this.generalForm.controls;return e?.name&&e.name.valid&&e?.description&&e.description.valid});calculatePasswordStrength=G(()=>{let e=this.generalFormSignal()?.password??"";return this.#i.calculatePasswordStrength(e)});ngOnInit(){this.formRef().nativeElement.focus()}exit(){this.#n.exit(!0)}async copyPassword(){let t=this.generalForm.controls.password.value;await this.#o(t??""),this.copiedPassword.set(!0)}async#o(t){try{await navigator.clipboard.writeText(t)}catch{try{let n=document.createElement("textarea");n.value=t,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)}catch(n){console.error("Failed to copy text: ",n)}}}generatePassword(){this.copiedPassword.set(!1);let t=this.#i.generate(16);this.generalForm.controls.password.setValue(t),this.generalForm.controls.repeatPassword.setValue(t),this.showCopyPassword.set(!0)}next(){this.#n.isNew()||this.#n.submit(!0),this.#e.navigate(["destination"],{relativeTo:this.#t.parent})}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=J({type:a,selectors:[["app-general"]],viewQuery:function(e,n){e&1&&ge(n.formRef,Lt,5),e&2&&Ee()},decls:21,vars:4,consts:()=>{let t;t=$localize`Your backup name`;let e;e=$localize`Your backup description`;let n;n=$localize`Remember to copy the password`;let i;i=$localize`General backup settings`;let o;o=$localize` Backup name ${"\uFFFD#8\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#8\uFFFD"}:CLOSE_SUPERSCRIPT:`;let r;r=$localize`Backup description`;let p;p=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON: Exit `;let h;h=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:lock${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Encrypted backup `;let S;S=$localize`Encryption`;let w;w=$localize`Encryption`;let P;P=$localize`Password`;let $;$=$localize`Repeat password`;let K;K=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let v;v=$localize`${"\uFFFD*13:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:eye-slash${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: hide ${"\uFFFD/*13:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*14:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:eye${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: show ${"\uFFFD/*14:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,v=Ue(v);let W;W=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Generate password `;let R;R=$localize`Passwords do not match`;let Z;Z=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copied password ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy password ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,Z=Ue(Z);let _e;_e=$localize` Tip: Be sure to save your password. If you lose it, you will lose access to your backups. `;let ue;ue=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let ce;return ce=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],i,o,r,p,h,w,K,v,W,R,Z,_e,ue,ce,["autocomplete","off",3,"submit","formGroup"],[1,"title-30"],[1,"primary"],["for","backupName"],["type","text","tabindex","1","placeholder",t,"formControlName","name"],["for","backupDescription"],["id","backupDescription","tabindex","2","placeholder",e,"formControlName","description"],[1,"form-actions"],["type","button","shButton","",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],["shButton","","type","submit","shTooltip",n,1,"raised","primary",3,"disabled"],["icon",""],["value","Key","label","DisplayName",3,"options","isClearable"],["for","encryption"],["type","text","id","encryption","tabindex","3","placeholder",S,"formControlName","encryption"],[1,"passwords"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",P,"formControlName","password",3,"type"],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",$,"formControlName","repeatPassword",3,"type"],["error",""],[1,"password-actions"],["shButton","","type","button",1,"small",3,"click"],["shButton","","type","button",1,"small","copy"],["type","primary"],[1,"raised",3,"value"],["shButton","","type","button",1,"small","copy",3,"click"],[1,"sh-success"]]},template:function(e,n){if(e&1){let i=x();s(0,"form",15,0),F("submit",function(){return c(i),d(n.next())}),s(2,"h3",16),N(3,1),l(),A(4,It,3,0,"sh-alert",17),s(5,"sh-form-field")(6,"label",18),E(7,2),g(8,"sup"),m(),l(),g(9,"input",19),l(),s(10,"sh-form-field")(11,"label",20),N(12,3),l(),g(13,"textarea",21),l(),A(14,Kt,6,3),s(15,"div",22)(16,"button",23),F("click",function(){return c(i),d(n.exit())}),E(17,4),g(18,"sh-icon"),m(),l(),A(19,Wt,3,1,"button",24)(20,Xt,3,1,"button",25),l()()}if(e&2){let i;T("formGroup",n.generalForm),_(4),D(!n.isNew()&&((i=n.generalFormSignal())==null?null:i.encryption)!==""?4:-1),_(10),D(n.isNew()?14:-1),_(5),D(n.encryptionFieldSignal()===n.noneOptionKey||!n.isNew()?19:20)}},dependencies:[Re,fe,z,j,Ne,Pe,Ae,Y,le,se,q,ot,nt,at],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}sup[_ngcontent-%COMP%]{padding:0 .125rem;color:var(--error-8)}.passwords[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.password-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.copy[_ngcontent-%COMP%] sh-icon.sh-success[_ngcontent-%COMP%]{color:var(--success-8)}"],changeDetection:0})};export{gt as a,pe as b,ze as c,ee as d,Ke as e,pt as f,Je as g,Q as h};
1
+ import{a as ut,c as ct,d as dt}from"./chunk-HYQ6MPYI.js";import{a as ye}from"./chunk-YCORZV4Z.js";import{a as rt,b as Ve,c as _t}from"./chunk-4VY6SMSL.js";import{b as re}from"./chunk-Z27IQRKV.js";import{a as lt}from"./chunk-3V4DGTSM.js";import{a as Oe}from"./chunk-5LX6M65H.js";import{b as ie,d as H}from"./chunk-ABYM5HWA.js";import{B as se,G as Y,K as ot,O as le,V as Me,X as at,b as Te,c as z,d as he,e as j,f as Ne,h as Qe,i as oe,j as fe,k as Ze,n as et,o as Pe,p as tt,q as Ae,r as De,s as ae,t as Re,u as q,w as nt,z as it}from"./chunk-RPUPXDQE.js";import{i as st}from"./chunk-OJ3H3ZRA.js";import{$b as u,Ab as $e,Bb as xe,Bc as Se,Cb as T,Db as s,Eb as l,Fb as g,H as we,Jb as B,Kb as k,Mb as x,Qc as G,Rc as ne,Sa as _,Tb as E,Ub as m,V as Ce,Vb as N,Vc as Be,Wc as ke,Xc as Fe,Yb as Ue,Zb as F,_ as O,cb as J,ea as c,fa as d,gc as ge,hb as je,hc as Ee,ic as be,kc as me,nc as U,oc as ve,pa as C,pc as Ye,sc as y,tc as L,ub as qe,uc as I,xb as A,yb as D,zb as Ge}from"./chunk-QONLYWYC.js";import{a as b,b as X}from"./chunk-EUDKD2JW.js";var Le=class a{fromString(t){if(!t)return null;let e=t.match(/(\d+)([smhDWMY])/);return e&&{value:parseInt(e[1]),unit:e[2]}}toString(t,e){return`${t}${e}`}static \u0275fac=function(e){return new(e||a)};static \u0275prov=Ce({token:a,factory:a.\u0275fac,providedIn:"root"})};function Et(a,t){if(a&1){let e=x();s(0,"div",24)(1,"sh-form-field")(2,"label",25),N(3,7),l(),s(4,"input",26,0),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.nextTime().time,i)||(o.scheduleFields.nextTime().time=i),d(i)}),F("focus",function(){c(e);let i=be(5);return d(i.showPicker())}),l(),s(6,"sh-icon",27),U(7,"clock"),l()(),s(8,"sh-form-field"),g(9,"label",28),s(10,"input",29,1),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.nextTime().date,i)||(o.scheduleFields.nextTime().date=i),d(i)}),F("focus",function(){c(e);let i=be(11);return d(i.showPicker())}),l(),s(12,"sh-icon",27),U(13,"calendar"),l()()(),s(14,"div",24)(15,"sh-form-field")(16,"label",30),N(17,8),l(),s(18,"input",31),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().repeatValue,i)||(o.scheduleFields.runAgain().repeatValue=i),d(i)}),l()(),s(19,"sh-select",32)(20,"input",33),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().repeatUnit,i)||(o.scheduleFields.runAgain().repeatUnit=i),d(i)}),l()()(),s(21,"app-toggle-card",34),B(22,35),N(23,9),k(),s(24,"div",36)(25,"sh-toggle",19),E(26,10),s(27,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.mon,i)||(o.scheduleFields.runAgain().allowedDays.mon=i),d(i)}),l(),m(),l(),s(28,"sh-toggle",19),E(29,11),s(30,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.tue,i)||(o.scheduleFields.runAgain().allowedDays.tue=i),d(i)}),l(),m(),l(),s(31,"sh-toggle",19),E(32,12),s(33,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.wed,i)||(o.scheduleFields.runAgain().allowedDays.wed=i),d(i)}),l(),m(),l(),s(34,"sh-toggle",19),E(35,13),s(36,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.thu,i)||(o.scheduleFields.runAgain().allowedDays.thu=i),d(i)}),l(),m(),l(),s(37,"sh-toggle",19),E(38,14),s(39,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.fri,i)||(o.scheduleFields.runAgain().allowedDays.fri=i),d(i)}),l(),m(),l(),s(40,"sh-toggle",19),E(41,15),s(42,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.sat,i)||(o.scheduleFields.runAgain().allowedDays.sat=i),d(i)}),l(),m(),l(),s(43,"sh-toggle",19),E(44,16),s(45,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.sun,i)||(o.scheduleFields.runAgain().allowedDays.sun=i),d(i)}),l(),m(),l()()()}if(a&2){let e=u();_(4),y("ngModel",e.scheduleFields.nextTime().time),_(6),y("ngModel",e.scheduleFields.nextTime().date),_(8),y("ngModel",e.scheduleFields.runAgain().repeatValue),_(),T("options",e.unitOptions)("isClearable",!1),_(),y("ngModel",e.scheduleFields.runAgain().repeatUnit),_(),T("disallowToggle",!0),_(6),y("ngModel",e.scheduleFields.runAgain().allowedDays.mon),_(3),y("ngModel",e.scheduleFields.runAgain().allowedDays.tue),_(3),y("ngModel",e.scheduleFields.runAgain().allowedDays.wed),_(3),y("ngModel",e.scheduleFields.runAgain().allowedDays.thu),_(3),y("ngModel",e.scheduleFields.runAgain().allowedDays.fri),_(3),y("ngModel",e.scheduleFields.runAgain().allowedDays.sat),_(3),y("ngModel",e.scheduleFields.runAgain().allowedDays.sun)}}var mt=[{key:"s",label:$localize`Seconds`},{key:"m",label:$localize`Minutes`},{key:"h",label:$localize`Hours`},{key:"D",label:$localize`Days`},{key:"W",label:$localize`Weeks`},{key:"M",label:$localize`Months`},{key:"Y",label:$localize`Years`}],ee={autoRun:!0,nextTime:{time:"13:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!1,tue:!1,wed:!1,thu:!1,fri:!1,sat:!1,sun:!1}}},Ke=class a{#e=O(Q);#t=O(H);#i=O(ie);unitOptions=mt;scheduleFields=this.#e.scheduleFields;goBack(){this.#t.navigate(["source-data"],{relativeTo:this.#i.parent})}next(){this.#e.isNew()||this.#e.submit(!0),this.#t.navigate(["options"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=J({type:a,selectors:[["app-schedule"]],decls:16,vars:2,consts:()=>{let t;t=$localize`Schedule`;let e;e=$localize` Automatically run backups ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let n;n=$localize`If a date was missed, the job will run as soon as possible.`;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let r;r=$localize`Next time`;let p;p=$localize`Run again every`;let h;h=$localize`Allowed days`;let S;S=$localize` Monday ${"\uFFFD#27\uFFFD\uFFFD/#27\uFFFD"}:TAG_INPUT:`;let w;w=$localize` Tuesday ${"\uFFFD#30\uFFFD\uFFFD/#30\uFFFD"}:TAG_INPUT:`;let P;P=$localize` Wednesday ${"\uFFFD#33\uFFFD\uFFFD/#33\uFFFD"}:TAG_INPUT:`;let $;$=$localize` Thursday ${"\uFFFD#36\uFFFD\uFFFD/#36\uFFFD"}:TAG_INPUT:`;let K;K=$localize` Friday ${"\uFFFD#39\uFFFD\uFFFD/#39\uFFFD"}:TAG_INPUT:`;let v;v=$localize` Saturday ${"\uFFFD#42\uFFFD\uFFFD/#42\uFFFD"}:TAG_INPUT:`;let W;return W=$localize` Sunday ${"\uFFFD#45\uFFFD\uFFFD/#45\uFFFD"}:TAG_INPUT:`,[["timeRef",""],["dateRef",""],t,e,n,i,o,r,p,h,S,w,P,$,K,v,W,[1,"title-30"],[1,"toggle-wrap"],[1,"raised","primary"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click"],[1,"row-inputs"],["for","time"],["type","time","id","time",3,"ngModelChange","focus","ngModel"],["suffix",""],["for","date"],["type","date","id","date",3,"ngModelChange","focus","ngModel"],["for","repeatValue"],["type","number","id","repeatValue",3,"ngModelChange","ngModel"],["value","key","label","label",3,"options","isClearable"],["type","text","id","repeatUnit",3,"ngModelChange","ngModel"],[3,"disallowToggle"],["title",""],[1,"days-wrap"]]},template:function(e,n){e&1&&(s(0,"h3",17),N(1,2),l(),s(2,"div",18)(3,"sh-toggle",19),E(4,3),s(5,"input",20),I("ngModelChange",function(o){return L(n.scheduleFields.autoRun,o)||(n.scheduleFields.autoRun=o),o}),l(),m(),l(),s(6,"p"),N(7,4),l()(),A(8,Et,46,14),s(9,"div",21)(10,"button",22),F("click",function(){return n.goBack()}),E(11,5),g(12,"sh-icon"),m(),l(),s(13,"button",23),F("click",function(){return n.next()}),E(14,6),g(15,"sh-icon"),m(),l()()),e&2&&(_(5),y("ngModel",n.scheduleFields.autoRun),_(3),D(n.scheduleFields.autoRun()?8:-1))},dependencies:[ae,z,Ze,Te,j,oe,Y,Me,q,se,le,ye],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem 2.5rem 1.5rem;display:flex;flex-direction:column;gap:1.5rem}.toggle-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.days-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};function St(a,t){if(a&1){let e=x();s(0,"sh-select",2)(1,"input",6),I("ngModelChange",function(i){c(e);let o=u();return L(o.internalPath,i)||(o.internalPath=i),d(i)}),F("ngModelChange",function(){c(e);let i=u();return d(i.updateFilter())}),l()()}if(a&2){let e=u();T("options",e.fileGroupOptions())("isClearable",!1)("selectMultiple",!0),_(),y("ngModel",e.internalPath)}}function Ft(a,t){if(a&1&&(B(0,7),U(1),k()),a&2){let e,n=u(2);_(),ve((e=n.currentExpressionOption())==null?null:e.startsWith)}}function Tt(a,t){if(a&1&&(B(0,8),U(1),k()),a&2){let e,n=u(2);_(),ve((e=n.currentExpressionOption())==null?null:e.endsWith)}}function ht(a,t){if(a&1){let e=x();s(0,"sh-form-field",3)(1,"input",6),I("ngModelChange",function(i){c(e);let o=u();return L(o.internalPath,i)||(o.internalPath=i),d(i)}),F("ngModelChange",function(){c(e);let i=u();return d(i.updateFilter())}),l(),A(2,Ft,2,1,"ng-container",7),A(3,Tt,2,1,"ng-container",8),l()}if(a&2){let e,n,i=u();_(),y("ngModel",i.internalPath),_(),D(!((e=i.currentExpressionOption())==null||e.startsWith==null)&&e.startsWith.length?2:-1),_(),D(!((n=i.currentExpressionOption())==null||n.endsWith==null)&&n.endsWith.length?3:-1)}}var Nt=[{key:"Applications",value:"Applications"},{key:"CacheFiles",value:"Cache Files"},{key:"TemporaryFiles",value:"Temporary Files"},{key:"OperatingSystem",value:"Operating System"},{key:"SystemFiles",value:"System Files"},{key:"DefaultExcludes",value:"Standard Excludes"}],ft=[{key:"Excludes folders where name contains",value:"-FolderName"},{key:"Excludes folder",value:"-Folder"},{key:"Excludes files where name contains",value:"-FileName"},{key:"Excludes file extension",value:"-Extension"},{key:"Excludes files where name matches regex",value:"-Regex"},{key:"Includes files where name matches regex",value:"+Regex"},{key:"Exclude file groups",value:"-FileGroup"},{key:"Includes expression",value:"+Expression"},{key:"Excludes expression",value:"-Expression"},{key:"None",value:"-Unknown"}],Ie=class a{path=ke.required();osType=ke();pathChange=Be();remove=Be();internalPath=C("");pathType=C("-Expression");currentExpressionOption=G(()=>{let t=this.pathType();return this.expressionOptions().find(e=>e.value===t)});fileGroupOptions=C(Nt);expressionOptions=G(()=>{let e=this.osType()==="Windows"?"\\":"/";return ft.map(n=>n.value==="-Folder"||n.value==="+Folder"?X(b({},n),{startsWith:"",endsWith:""}):n.value==="-FolderName"||n.value==="+FolderName"?X(b({},n),{startsWith:"*",endsWith:`*${e}`}):n.value==="-FileName"||n.value==="+FileName"?X(b({},n),{startsWith:"[.*",endsWith:`[^\\${e}]*]`}):n.value==="-FileGroup"||n.value==="+FileGroup"?X(b({},n),{startsWith:"{",endsWith:"}"}):n.value==="-Regex"||n.value==="+Regex"?X(b({},n),{startsWith:"[",endsWith:"]"}):n.value==="-Extension"||n.value==="+Extension"?X(b({},n),{startsWith:"*.",endsWith:""}):X(b({},n),{startsWith:"",endsWith:""}))});pathEffect=ne(()=>{let t=this.path(),e=t.slice(1),n=t.startsWith("-")?"-":"+",i=this.osType()==="Windows",o=i?"\\":"/";e.startsWith("%")&&e.endsWith(o)||i&&e.slice(2).startsWith(o)&&e.endsWith(o)||e.startsWith(o)&&e.endsWith(o)?(this.pathType.set(`${n}Folder`),this.internalPath.set(e)):e.startsWith("*")&&e.endsWith(`*${o}`)?(this.pathType.set(`${n}FolderName`),this.internalPath.set(e.slice(1,-2))):e.startsWith("[.*")&&e.endsWith(`[^\\${o}]*]`)?(this.pathType.set(`${n}FileName`),this.internalPath.set(e.slice(3,-7))):e.startsWith("{")&&e.endsWith("}")?(this.pathType.set(`${n}FileGroup`),this.internalPath.set(e.slice(1,-1))):e.startsWith("[")&&e.endsWith("]")?(this.pathType.set(`${n}Regex`),this.internalPath.set(e.slice(1,-1))):e.startsWith("*.")?(this.pathType.set(`${n}Extension`),this.internalPath.set(e.slice(2))):(this.pathType.set(`${n}Expression`),this.internalPath.set(e))});updateFilter(){let t=this.internalPath(),e=this.currentExpressionOption();t!==""&&this.pathChange.emit(`${e?.value.slice(0,1)}${e?.startsWith??""}${t}${e?.endsWith??""}`)}removeFilter(){this.remove.emit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=J({type:a,selectors:[["app-new-filter"]],inputs:{path:[1,"path"],osType:[1,"osType"]},outputs:{pathChange:"pathChange",remove:"remove"},decls:7,vars:4,consts:()=>{let t;return t=$localize`Select an option...`,[["value","value","label","key",3,"options","isClearable"],["type","text","placeholder",t,3,"ngModelChange","ngModel"],["value","key","label","value",1,"expression-input",3,"options","isClearable","selectMultiple"],[1,"expression-input"],[1,"filter-removal",3,"click"],[1,"sh-primary"],["type","text",3,"ngModelChange","ngModel"],["prefix",""],["suffix",""]]},template:function(e,n){if(e&1&&(s(0,"sh-select",0)(1,"input",1),I("ngModelChange",function(o){return L(n.pathType,o)||(n.pathType=o),o}),F("ngModelChange",function(){return n.updateFilter()}),l()(),A(2,St,2,4,"sh-select",2)(3,ht,4,3,"sh-form-field",3),s(4,"div",4),F("click",function(){return n.removeFilter()}),s(5,"sh-icon",5),U(6,"x-circle"),l()()),e&2){let i;T("options",n.expressionOptions())("isClearable",!1),_(),y("ngModel",n.pathType),_(),D(((i=n.currentExpressionOption())==null?null:i.value)=="-FileGroup"||((i=n.currentExpressionOption())==null?null:i.value)=="+FileGroup"?2:3)}},dependencies:[ae,z,j,oe,le,Y,q],styles:["[_nghost-%COMP%]{display:grid;grid-template-columns:13.125rem 1fr 1.875rem;gap:.5rem;align-items:flex-end}.expression-input[_ngcontent-%COMP%]{--ff-suffix-bg: var(--base-2)}.filter-removal[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;justify-content:center;height:2.5rem;flex:0 0}"],changeDetection:0})};var Pt=["formRef"],He=()=>({standalone:!0});function At(a,t){if(a&1){let e=x();s(0,"sh-form-field",41)(1,"input",42),I("ngModelChange",function(i){c(e);let o=u(2);return L(o.editingPath,i)||(o.editingPath=i),d(i)}),l()(),s(2,"button",43),F("click",function(){c(e);let i=u(2);return d(i.updatePath())}),s(3,"sh-icon"),U(4,"floppy-disk"),l()(),s(5,"button",43),F("click",function(){c(e);let i=u(2);return d(i.cancelEditPath())}),s(6,"sh-icon"),U(7,"x-bold"),l()()}if(a&2){let e=u(2);_(),y("ngModel",e.editingPath),T("ngModelOptions",Se(2,He))}}function Dt(a,t){if(a&1){let e=x();s(0,"sh-form-field",41),g(1,"input",44),l(),s(2,"button",43),F("click",function(){c(e);let i=u().$implicit,o=u();return d(o.editPath(i))}),s(3,"sh-icon"),U(4,"pen"),l()(),s(5,"button",43),F("click",function(){c(e);let i=u().$implicit,o=u();return d(o.removePath(i))}),s(6,"sh-icon"),U(7,"trash-simple"),l()()}if(a&2){let e=u().$implicit;qe("readonly",!0),_(),T("ngModel",e)("ngModelOptions",Se(3,He))}}function Rt(a,t){if(a&1&&(s(0,"div",30),A(1,At,8,3)(2,Dt,8,4),l()),a&2){let e=t.$implicit,n=u();_(),D(n.oldPath()===e?1:2)}}function Mt(a,t){if(a&1){let e=x();s(0,"app-new-filter",46),F("pathChange",function(i){let o=c(e).$index,r=u(2);return d(r.patchPathAt(i,o))})("remove",function(){let i=c(e).$index,o=u(2);return d(o.removePathAt(i))}),l()}if(a&2){let e=t.$implicit,n=u(2);T("path",e)("osType",n.osType()??"")}}function Ot(a,t){if(a&1&&$e(0,Mt,1,2,"app-new-filter",45,Ge),a&2){let e=u();xe(e.pathArray())}}function yt(a,t){if(a&1){let e=x();s(0,"div",31)(1,"app-size",47),F("ngModelChange",function(i){c(e);let o=u();return d(o.updateFilesLargerThan(i))}),l()()}if(a&2){let e=u();_(),T("ngModel",e.filesLargerThan())("ngModelOptions",Se(2,He))}}var V=new De,pt=(a={path:"",filters:[],excludes:{hidden:!1,system:!1,temporary:!1,filesLargerThan:null}})=>V.group({path:V.control(a.path),excludes:V.group({hidden:V.control(a.excludes.hidden),system:V.control(a.excludes.system),temporary:V.control(a.excludes.temporary),filesLargerThan:V.group({size:V.control(null),unit:V.control(null)})})}),Je=class a{#e=O(Q);#t=O(H);#i=O(ie);formRef=Fe.required("formRef");sourceDataForm=this.#e.sourceDataForm;sourceDataFormSignal=this.#e.sourceDataFormSignal;newPathCtrl=new Qe("");filesLargerThan=G(()=>this.sourceDataFormSignal()?.excludes?.filesLargerThan?.size!==null);osType=this.#e.osType;pathSignal=re(this.sourceDataForm.controls.path.valueChanges);pathArray=G(()=>this.pathSignal()?.split("\0").filter(t=>t.startsWith("-")||t.startsWith("+")||t==="___none___")??[]);nonFilterPaths=G(()=>this.pathSignal()?.split("\0").filter(t=>!t.startsWith("-")&&!t.startsWith("+")&&t!==""));oldPath=C(null);editingPath=C(null);addingNewPath=C(!1);editPath(t){this.oldPath.set(t),this.editingPath.set(t)}updateFilesLargerThan(t){let{size:e,unit:n}=ct(t);this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:e,unit:n})}updatePath(){let t=this.oldPath(),e=this.editingPath();if(!t||!e||e===t){this.oldPath.set(null),this.editingPath.set(null);return}let n=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(n?.replace(t,e)??""),this.oldPath.set(null),this.editingPath.set(null)}cancelEditPath(){this.oldPath.set(null),this.editingPath.set(null)}removePath(t){let n=(this.sourceDataForm.controls.path.value??"").split("\0"),i=n.indexOf(t);if(i===-1)return;n.splice(i,1);let o=n.filter(r=>r&&r!=="").join("\0");this.sourceDataForm.controls.path.setValue(o)}addFilter(t="-*"){let n=[this.sourceDataForm.controls.path.value,t].filter(i=>i&&i!=="").join("\0");this.sourceDataForm.controls.path.setValue(n)}patchPathAt(t,e){let i=this.sourceDataForm.controls.path.value.split("\0").filter(p=>!p.startsWith("-")&&!p.startsWith("+")).join("\0"),o=this.pathArray().map((p,h)=>h===e?`${t}`:`${p}`).join("\0"),r=[i,o].filter(p=>p&&p!=="").join("\0");this.sourceDataForm.controls.path.setValue(r)}removePathAt(t){let n=this.sourceDataForm.controls.path.value.split("\0").filter(r=>!r.startsWith("-")&&!r.startsWith("+")).join("\0"),i=this.pathArray().filter((r,p)=>p!==t).join("\0"),o=[n,i].filter(r=>r&&r!=="").join("\0");this.sourceDataForm.controls.path.setValue(o)}getPath(){return this.sourceDataForm.value.path??null}toggleFilesLargerThan(){this.sourceDataForm.controls.excludes.value.filesLargerThan?.size===null?this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:50,unit:"MB"}):this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:null,unit:null})}addNewPath(){let t=this.sourceDataForm.controls.path.value,e=this.newPathCtrl.value,n=t?.split("\0")||[];e&&!n.includes(e)&&n.push(e);let i=n.filter(o=>o&&o!=="").join("\0");this.sourceDataForm.controls.path.setValue(i),this.newPathCtrl.setValue("")}goBack(){this.#t.navigate(["destination"],{relativeTo:this.#i.parent})}next(){this.#e.isNew()||this.#e.submit(!0),this.#t.navigate(["schedule"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=J({type:a,selectors:[["app-source-data"]],viewQuery:function(e,n){e&1&&ge(n.formRef,Pt,5),e&2&&Ee()},decls:56,vars:12,consts:()=>{let t;t=$localize`Path`;let e;e=$localize`Add a direct path`;let n;n=$localize`Hidden files`;let i;i=$localize`System files`;let o;o=$localize`Temporary files`;let r;r=$localize`Source Data`;let p;p=$localize`Folder path`;let h;h=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let S;S=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let w;w=$localize`Paths`;let P;P=$localize`Add a path directly from your machine.`;let $;$=$localize`Filters`;let K;K=$localize`Customize your filters.`;let v;v=$localize`Add filter`;let W;W=$localize`Exclude`;let R;R=$localize`Choose if there’s any files you want to exclude.`;let Z;Z=$localize` Files with the Hidden attribute ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`;let _e;_e=$localize` Files with the System attribute ${"\uFFFD#49\uFFFD\uFFFD/#49\uFFFD"}:TAG_INPUT:`;let ue;ue=$localize` Files with the Temporary attribute ${"\uFFFD#52\uFFFD\uFFFD/#52\uFFFD"}:TAG_INPUT:`;let ce;ce=$localize` Files larger than `;let f;return f=$localize`Edit path`,[["formRef",""],r,p,h,S,w,P,$,K,v,W,R,Z,_e,ue,ce,[3,"submit","formGroup"],[1,"left"],[1,"title-30"],[1,"fill",3,"multiSelect","startingPath","showFiles"],["for","path"],["type","text","id","path","tabindex","4","placeholder",t,"formControlName","path"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],[1,"right"],[3,"disallowToggle"],["title",""],["description",""],[1,"paths"],[1,"path"],[1,"row-inputs"],["type","text","placeholder",e,3,"formControl"],["shButton","","type","button",1,"raised","primary",3,"click"],["type","button","shButton","","action","",3,"click"],["formGroupName","excludes",3,"disallowToggle"],[1,"raised","primary"],["type","checkbox","placeholder",n,"formControlName","hidden"],["type","checkbox","placeholder",i,"formControlName","system"],["type","checkbox","placeholder",o,"formControlName","temporary"],[1,"raised","primary",3,"click"],[1,"small"],["type","text","placeholder",f,3,"ngModelChange","ngModel","ngModelOptions"],["shButton","","type","button",1,"small",3,"click"],["type","text",3,"ngModel","ngModelOptions"],[3,"path","osType"],[3,"pathChange","remove","path","osType"],[3,"ngModelChange","ngModel","ngModelOptions"]]},template:function(e,n){if(e&1){let i=x();s(0,"form",16,0),F("submit",function(){return c(i),d(n.next())}),s(2,"div",17)(3,"h3",18),N(4,1),l(),s(5,"app-file-tree",19)(6,"label",20),N(7,2),l(),g(8,"input",21),l(),s(9,"div",22)(10,"button",23),F("click",function(){return c(i),d(n.goBack())}),E(11,3),g(12,"sh-icon"),m(),l(),s(13,"button",24),E(14,4),g(15,"sh-icon"),m(),l()()(),s(16,"div",25)(17,"app-toggle-card",26),B(18,27),N(19,5),k(),s(20,"p",28),N(21,6),l(),s(22,"div",29),$e(23,Rt,3,1,"div",30,Ge),s(25,"div",31)(26,"sh-form-field"),g(27,"input",32),l(),s(28,"button",33),F("click",function(){return c(i),d(n.addNewPath())}),s(29,"sh-icon"),U(30,"plus"),l()()()()(),s(31,"app-toggle-card",26),B(32,27),N(33,7),k(),s(34,"p",28),N(35,8),l(),s(36,"button",34),F("click",function(){return c(i),d(n.addFilter())}),N(37,9),l(),A(38,Ot,2,0),l(),s(39,"app-toggle-card",35),B(40,27),N(41,10),k(),s(42,"p",28),N(43,11),l(),s(44,"sh-toggle",36),E(45,12),g(46,"input",37),m(),l(),s(47,"sh-toggle",36),E(48,13),g(49,"input",38),m(),l(),s(50,"sh-toggle",36),E(51,14),g(52,"input",39),m(),l(),s(53,"sh-toggle",40),F("click",function(){return c(i),d(n.toggleFilesLargerThan())}),N(54,15),l(),A(55,yt,2,3,"div",31),l()()()}if(e&2){let i;T("formGroup",n.sourceDataForm),_(5),T("multiSelect",!0)("startingPath",n.getPath())("showFiles",!0),_(12),T("disallowToggle",!0),_(6),xe(n.nonFilterPaths()),_(4),T("formControl",n.newPathCtrl),_(4),T("disallowToggle",!0),_(7),D((i=n.pathSignal())!=null&&i.length?38:-1),_(),T("disallowToggle",!0),_(14),me("active",n.filesLargerThan()),_(2),D(n.filesLargerThan()?55:-1)}},dependencies:[ae,fe,z,Te,j,Ne,oe,Re,et,Pe,Ae,tt,Y,q,se,Me,Ie,ut,ye,dt],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;width:100%;flex:1 0;overflow:hidden}form[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;flex:1 0;overflow:hidden}.right[_ngcontent-%COMP%], .left[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:1.5rem}.left[_ngcontent-%COMP%]{padding:2.5rem;overflow:hidden;border-right:1px solid var(--base-4)}.right[_ngcontent-%COMP%]{padding:2.5rem 1.5rem;overflow:auto}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}sh-divider[_ngcontent-%COMP%]{margin:.75rem 0}.row-inputs[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content;gap:.25rem}.paths[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.path[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:1fr min-content min-content;gap:.25rem}"],changeDetection:0})};var Ct="1W:1D,4W:1W,12M:1M",Q=class a{#e=O(H);#t=O(Oe);#i=O(it);#n=O(st);#a=O(Le);generalForm=gt();sourceDataForm=pt();scheduleFields={autoRun:C(ee.autoRun),nextTime:C(ee.nextTime),runAgain:C(ee.runAgain)};settings=C([]);optionsFields={remoteVolumeSize:C("50MB"),backupRetention:C("all"),backupRetentionTime:C(""),backupRetentionVersions:C(0),backupRetentionCustom:C("")};targetUrlModel=C(null);backupMetadata=C(null);isDraft=C(!1);backupId=C(null);backupName=G(()=>this.generalFormSignal()?.name??"");isSubmitting=C(!1);finishedLoading=C(!1);backupDefaults=C(null);applicationOptions=C(null);isNew=G(()=>this.backupId()==="new");osType=G(()=>this.#t.systemInfo()?.OSType);selectedOptions=C([]);sourceDataFormSignal=re(this.sourceDataForm.valueChanges);generalFormSignal=re(this.generalForm.valueChanges);encryptionFieldSignal=re(this.generalForm.controls.encryption.valueChanges);advancedOptions=G(()=>this.#t.systemInfo()?.Options?.map(this.#_)??[]);#o=C("");#s=C(null);#l=null;testSignal=this.#o.asReadonly();testErrorMessage=this.#s.asReadonly();#d=ne(()=>{let t=this.targetUrlModel(),e=this.#o(),n=this.#l;this.#l=t,!(e==="testing"||n===null||n===t)&&(this.#o.set(""),this.#s.set(null))});setTestState(t,e){this.#o.set(t),this.#s.set(e??null)}#_(t){return{name:t.Name,type:t.Type,shortDescription:t.ShortDescription??void 0,longDescription:t.LongDescription??void 0,options:t.ValidValues}}encryptionOptions=G(()=>{let t=this.#t.systemInfo()?.EncryptionModules??[];return[pe,...t]});nonSelectedOptions=G(()=>this.advancedOptions().sort((t,e)=>t?.name&&e?.name?t?.name.localeCompare(e?.name):0).filter(t=>this.selectedOptions()?.findIndex(e=>e.name===t.name)===-1));submit(t=!1){this.isSubmitting.set(!0);let e=this.#u(),n=this.backupId();this.isDraft()&&e.Backup&&(e.Backup.Metadata=this.backupMetadata()),n==="new"||!n||this.isDraft()?this.#n.postApiV1Backups({requestBody:e}).pipe(we(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{t||this.exit(!1)},error:()=>{}}):this.#n.putApiV1BackupById({id:n,requestBody:e}).pipe(we(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{t||this.exit(!1)},error:()=>{}})}exit(t){if(!t){this.#r(),this.#e.navigate(["/"]);return}this.#i.open(lt,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:e=>{e&&(this.#r(),this.#e.navigate(["/"]))}})}mapSourceDataToForm(t){let e=t.Sources??"",n=t.Filters?.map(p=>`${p.Include?"":"-"}${p.Expression}`)??[],i=t.Settings?.find(p=>p.Name==="--exclude-files-attributes")?.Value??"",o=t.Settings?.find(p=>p.Name==="--skip-files-larger-than")??null,r={path:[...e,...n].join("\0"),excludes:{hiddenFiles:i.includes("hidden"),systemFiles:i.includes("system"),tempFiles:i.includes("temporary"),filesLargerThan:o?.Value?.toUpperCase()??null}};this.sourceDataForm.patchValue(r)}mapDestinationToForm(t){this.targetUrlModel.set(t.TargetURL??"")}mapGeneralToForm(t){let e=t.Name??"",n=t.Description??"",i=t.Settings?.find(S=>S.Name==="encryption-module"),o=t.Settings?.find(S=>S.Name==="passphrase")?.Value??"",r=i?.Value&&i.Value.length?i.Value:"",p=t.Settings?.find(S=>S.Name==="compression-module")?.Value??"",h={name:t.Name??"",description:t.Description??""};e&&e!==""&&(h.name=e),n&&n!==""&&(h.description=n),r&&r!==""&&(h.encryption=r),o&&o!==""&&(h.password=o,h.repeatPassword=o),p&&p!==""&&(h.compression=p),this.generalForm.patchValue(h)}mapScheduleToForm(t){if(!t){this.scheduleFields.autoRun.set(!1);return}let e=this.#a.fromString(t.Repeat)??null,n=this.#c(t.Time);this.scheduleFields.autoRun.set(!0),this.scheduleFields.nextTime.update(i=>b(b({},i),n)),this.scheduleFields.runAgain.set({repeatValue:e?.value??1,repeatUnit:e?.unit??"D",allowedDays:{mon:t.AllowedDays?.includes("mon")??!1,tue:t.AllowedDays?.includes("tue")??!1,wed:t.AllowedDays?.includes("wed")??!1,thu:t.AllowedDays?.includes("thu")??!1,fri:t.AllowedDays?.includes("fri")??!1,sat:t.AllowedDays?.includes("sat")??!1,sun:t.AllowedDays?.includes("sun")??!1}})}mapOptionsToForms(t){let e=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","dblock-size","passphrase","keep-time","keep-versions","retention-policy"],n=t.Settings?.filter(r=>!e.includes(r.Name)),i=t.Settings?.filter(r=>e.includes(r.Name));this.settings.set(n??[]),n?.forEach(r=>{if(r.Name==="encryption-module"&&this.isNew())return this.generalForm.controls.encryption.setValue(r.Value??"")});var o="all";i?.forEach(r=>{if(r.Name==="dblock-size"&&this.optionsFields.remoteVolumeSize.set(r.Value??"50MB"),r.Name==="keep-time"&&(r.Value??"")!=="")return o="time",this.optionsFields.backupRetentionTime.set(r.Value??"");if(r.Name==="keep-versions"&&(r.Value??"")!=="")return o="versions",this.optionsFields.backupRetentionVersions.set(r.Value?parseInt(r.Value):null);if(r.Name==="retention-policy"&&(r.Value??"")!=="")if(r.Value===Ct)o="smart";else return o="custom",this.optionsFields.backupRetentionCustom.set(r.Value??"")}),this.optionsFields.backupRetention.set(o)}storeMetadata(t,e){this.backupMetadata.set(e?t.Metadata??null:null)}getScheduleFormValue(){return{autoRun:this.scheduleFields.autoRun(),nextTime:this.scheduleFields.nextTime(),runAgain:this.scheduleFields.runAgain()}}#u(){let t=this.generalForm.value,e=this.getScheduleFormValue(),n=this.sourceDataForm.value,i=this.targetUrlModel(),o=null;e.runAgain?.repeatUnit&&e.runAgain?.repeatValue&&(o=this.#a.toString(e.runAgain.repeatValue,e.runAgain.repeatUnit));let r=e.runAgain?.allowedDays?Object.entries(e.runAgain?.allowedDays).filter(([P,$])=>$).map(([P,$])=>P):[],p=n.path?.split("\0")??[],h=this.mapFormsToSettings(),S=Object.entries(n.excludes??{}).filter(([P,$])=>$&&P!=="filesLargerThan").map(([P])=>P),w=n.excludes?.filesLargerThan;return S.length&&h.push({Name:"--exclude-files-attributes",Value:S.join(",")}),w&&w.size!==null&&w.unit!==null&&h.push({Name:"--skip-files-larger-than",Value:`${w.size}${w.unit}`}),{Backup:{Name:t.name,Description:t.description,TargetURL:i??null,Sources:p.filter(P=>!P.startsWith("-")),Settings:h,Filters:p.filter(P=>P.startsWith("-")).map((P,$)=>({Order:$,Include:!1,Expression:P.slice(1)}))},Schedule:e.autoRun?{Repeat:o,Time:e.nextTime?.date?new Date(`${e.nextTime.date}T${e.nextTime?.time||"00:00:00"}`).toISOString():null,AllowedDays:r}:null}}mapFormsToSettings(t=[]){let e=this.generalForm.value,n=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","encryption-module","passphrase","keep-time","keep-versions","retention-policy","dblock-size","compression-module"],i=[{Name:"--no-encryption",Value:"True"}];e.encryption!==""&&e.encryption!==pe.Key&&(i=[{Name:"encryption-module",Value:e.encryption??null},{Name:"passphrase",Value:e.password??null}]);let o=[{Name:"compression-module",Value:e.compression}];e.compression===""&&(o=[]);let r=[{Name:"dblock-size",Value:this.optionsFields.remoteVolumeSize()}];switch(this.optionsFields.backupRetention()){case"time":r.push({Name:"keep-time",Value:this.optionsFields.backupRetentionTime()});break;case"versions":r.push({Name:"keep-versions",Value:this.optionsFields.backupRetentionVersions()?.toString()??""});break;case"custom":r.push({Name:"retention-policy",Value:this.optionsFields.backupRetentionCustom()});break;case"smart":r.push({Name:"retention-policy",Value:Ct});break}let p=[...t,...n],h=this.settings().filter(S=>!p.includes(S.Name)).map(S=>{let w=S.Value;return typeof S.Value=="number"&&(w=S.Value.toString()),typeof S.Value=="boolean"&&(w=S.Value?"True":"False"),{Name:S.Name?.startsWith("--")?S.Name:`--${S.Name}`,Value:w}});return[...i,...o,...r,...h]}#c(t){if(!t||t?.indexOf("T")===-1)return{time:t??"13:00"};let e=new Date(t);return{time:`${(""+e.getHours()).padStart(2,"0")}:${(""+e.getMinutes()).padStart(2,"0")}`,date:e.toISOString().split("T")[0]}}setTargetUrl(t,e=!1){e&&(this.#l=null),this.targetUrlModel.set(t)}#r(){this.generalForm.reset(),this.sourceDataForm.reset(),this.scheduleFields.autoRun.set(ee.autoRun),this.scheduleFields.nextTime.set(ee.nextTime),this.scheduleFields.runAgain.set(ee.runAgain),this.optionsFields.remoteVolumeSize.set("50MB"),this.optionsFields.backupRetention.set("all"),this.settings.set([]),this.targetUrlModel.set(null)}static \u0275fac=function(e){return new(e||a)};static \u0275prov=Ce({token:a,factory:a.\u0275fac,providedIn:"root"})};var Lt=["formRef"];function It(a,t){a&1&&(s(0,"sh-alert",17),E(1,5),g(2,"sh-icon",26),m(),l())}function wt(a,t){if(a&1&&U(0),a&2){let e=t.$implicit;Ye(" ",e.DisplayName," ")}}function Gt(a,t){if(a&1&&g(0,"sh-progress-bar",40),a&2){let e=u(3);me("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),T("value",e.calculatePasswordStrength()*(100/5))}}function $t(a,t){a&1&&(s(0,"span",35),N(1,10),l())}function xt(a,t){a&1&&(E(0,8,1),g(1,"sh-icon"),m())}function Ut(a,t){a&1&&(E(0,8,2),g(1,"sh-icon"),m())}function bt(a,t){a&1&&(E(0,11,1),g(1,"sh-icon",42),m())}function vt(a,t){a&1&&(E(0,11,2),g(1,"sh-icon"),m())}function Bt(a,t){if(a&1){let e=x();s(0,"button",41),F("click",function(){c(e);let i=u(3);return d(i.copyPassword())}),E(1,11),A(2,bt,2,0)(3,vt,2,0),m(),l()}if(a&2){let e=u(3);_(2),D(e.copiedPassword()?2:3)}}function kt(a,t){a&1&&(s(0,"sh-alert",39),N(1,12),l())}function Vt(a,t){if(a&1){let e=x();s(0,"div",30)(1,"sh-form-field")(2,"label",31),E(3,7),g(4,"sup"),m(),l(),g(5,"input",32),l(),A(6,Gt,1,9,"sh-progress-bar",33),s(7,"sh-form-field"),g(8,"input",34),A(9,$t,2,0,"span",35),l(),s(10,"div",36)(11,"button",37),F("click",function(){c(e);let i=u(2);return d(i.showPassword.set(!i.showPassword()))}),E(12,8),A(13,xt,2,0)(14,Ut,2,0),m(),l(),s(15,"button",37),F("click",function(){c(e);let i=u(2);return d(i.generatePassword())}),E(16,9),g(17,"sh-icon"),m(),l(),A(18,Bt,4,1,"button",38),l(),A(19,kt,2,0,"sh-alert",39),l()}if(a&2){let e=u(2);_(5),T("type",e.showPassword()?"text":"password"),_(),D(e.generalForm.value.password?6:-1),_(2),T("type",e.showPassword()?"text":"password"),_(),D(e.generalForm.value.repeatPassword&&e.generalForm.value.repeatPassword!==e.generalForm.value.password?9:-1),_(4),D(e.showPassword()?13:14),_(5),D(e.showCopyPassword()?18:-1),_(),D(e.generalForm.value.password&&e.generalForm.value.password===e.generalForm.value.repeatPassword?19:-1)}}function Kt(a,t){if(a&1&&(s(0,"sh-select",27)(1,"label",28),N(2,6),l(),g(3,"input",29),je(4,wt,1,1,"ng-template"),l(),A(5,Vt,20,7,"div",30)),a&2){let e=u();T("options",e.encryptionOptions())("isClearable",!1),_(5),D(e.encryptionFieldSignal()!==e.noneOptionKey?5:-1)}}function Wt(a,t){if(a&1&&(s(0,"button",24),E(1,13),g(2,"sh-icon"),m(),l()),a&2){let e=u();T("disabled",e.nameAndDescriptionValid()===!1)}}function Xt(a,t){if(a&1&&(s(0,"button",25),E(1,14),g(2,"sh-icon"),m(),l()),a&2){let e=u();T("disabled",e.generalForm.invalid||e.showCopyPassword()&&!e.copiedPassword())}}var te=new De,gt=(a={name:"",description:"",encryption:"",password:"",repeatPassword:"",compression:""})=>te.group({name:te.control(a.name,[he.required]),description:te.control(a.description),encryption:te.control(a.encryption,[_t()]),password:te.control(a.password,[Ve(t=>t?.value.encryption!=="",[he.required])]),repeatPassword:te.control(a.repeatPassword,[Ve(t=>t?.value.encryption!=="",[he.required])]),compression:te.control(a.compression)}),pe={Key:"-",DisplayName:"None"},ze=class a{#e=O(H);#t=O(ie);#i=O(rt);#n=O(Q);#a=O(Oe);formRef=Fe.required("formRef");generalForm=this.#n.generalForm;generalFormSignal=this.#n.generalFormSignal;encryptionFieldSignal=this.#n.encryptionFieldSignal;encryptionOptions=this.#n.encryptionOptions;isNew=this.#n.isNew;showPassword=C(!1);copiedPassword=C(!1);showCopyPassword=C(!1);noneOptionKey=pe.Key;encryptionEffect=ne(()=>{this.encryptionFieldSignal()===pe.Key&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});nameAndDescriptionValid=G(()=>{let t=this.generalFormSignal(),e=this.generalForm.controls;return e?.name&&e.name.valid&&e?.description&&e.description.valid});calculatePasswordStrength=G(()=>{let e=this.generalFormSignal()?.password??"";return this.#i.calculatePasswordStrength(e)});ngOnInit(){this.formRef().nativeElement.focus()}exit(){this.#n.exit(!0)}async copyPassword(){let t=this.generalForm.controls.password.value;await this.#o(t??""),this.copiedPassword.set(!0)}async#o(t){try{await navigator.clipboard.writeText(t)}catch{try{let n=document.createElement("textarea");n.value=t,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)}catch(n){console.error("Failed to copy text: ",n)}}}generatePassword(){this.copiedPassword.set(!1);let t=this.#i.generate(16);this.generalForm.controls.password.setValue(t),this.generalForm.controls.repeatPassword.setValue(t),this.showCopyPassword.set(!0)}next(){this.#n.isNew()||this.#n.submit(!0),this.#e.navigate(["destination"],{relativeTo:this.#t.parent})}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=J({type:a,selectors:[["app-general"]],viewQuery:function(e,n){e&1&&ge(n.formRef,Lt,5),e&2&&Ee()},decls:21,vars:4,consts:()=>{let t;t=$localize`Your backup name`;let e;e=$localize`Your backup description`;let n;n=$localize`Remember to copy the password`;let i;i=$localize`General backup settings`;let o;o=$localize` Backup name ${"\uFFFD#8\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#8\uFFFD"}:CLOSE_SUPERSCRIPT:`;let r;r=$localize`Backup description`;let p;p=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON: Exit `;let h;h=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:lock${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Encrypted backup `;let S;S=$localize`Encryption`;let w;w=$localize`Encryption`;let P;P=$localize`Password`;let $;$=$localize`Repeat password`;let K;K=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let v;v=$localize`${"\uFFFD*13:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:eye-slash${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: hide ${"\uFFFD/*13:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*14:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:eye${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: show ${"\uFFFD/*14:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,v=Ue(v);let W;W=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Generate password `;let R;R=$localize`Passwords do not match`;let Z;Z=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copied password ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy password ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,Z=Ue(Z);let _e;_e=$localize` Tip: Be sure to save your password. If you lose it, you will lose access to your backups. `;let ue;ue=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let ce;return ce=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],i,o,r,p,h,w,K,v,W,R,Z,_e,ue,ce,["autocomplete","off",3,"submit","formGroup"],[1,"title-30"],[1,"primary"],["for","backupName"],["type","text","tabindex","1","placeholder",t,"formControlName","name"],["for","backupDescription"],["id","backupDescription","tabindex","2","placeholder",e,"formControlName","description"],[1,"form-actions"],["type","button","shButton","",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],["shButton","","type","submit","shTooltip",n,1,"raised","primary",3,"disabled"],["icon",""],["value","Key","label","DisplayName",3,"options","isClearable"],["for","encryption"],["type","text","id","encryption","tabindex","3","placeholder",S,"formControlName","encryption"],[1,"passwords"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",P,"formControlName","password",3,"type"],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",$,"formControlName","repeatPassword",3,"type"],["error",""],[1,"password-actions"],["shButton","","type","button",1,"small",3,"click"],["shButton","","type","button",1,"small","copy"],["type","primary"],[1,"raised",3,"value"],["shButton","","type","button",1,"small","copy",3,"click"],[1,"sh-success"]]},template:function(e,n){if(e&1){let i=x();s(0,"form",15,0),F("submit",function(){return c(i),d(n.next())}),s(2,"h3",16),N(3,1),l(),A(4,It,3,0,"sh-alert",17),s(5,"sh-form-field")(6,"label",18),E(7,2),g(8,"sup"),m(),l(),g(9,"input",19),l(),s(10,"sh-form-field")(11,"label",20),N(12,3),l(),g(13,"textarea",21),l(),A(14,Kt,6,3),s(15,"div",22)(16,"button",23),F("click",function(){return c(i),d(n.exit())}),E(17,4),g(18,"sh-icon"),m(),l(),A(19,Wt,3,1,"button",24)(20,Xt,3,1,"button",25),l()()}if(e&2){let i;T("formGroup",n.generalForm),_(4),D(!n.isNew()&&((i=n.generalFormSignal())==null?null:i.encryption)!==""?4:-1),_(10),D(n.isNew()?14:-1),_(5),D(n.encryptionFieldSignal()===n.noneOptionKey||!n.isNew()?19:20)}},dependencies:[Re,fe,z,j,Ne,Pe,Ae,Y,le,se,q,ot,nt,at],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}sup[_ngcontent-%COMP%]{padding:0 .125rem;color:var(--error-8)}.passwords[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.password-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.copy[_ngcontent-%COMP%] sh-icon.sh-success[_ngcontent-%COMP%]{color:var(--success-8)}"],changeDetection:0})};export{gt as a,pe as b,ze as c,ee as d,Ke as e,pt as f,Je as g,Q as h};
@@ -1,2 +1,2 @@
1
- import{b as j}from"./chunk-Z27IQRKV.js";import{B as X,u as U,y as W}from"./chunk-QF4DQYEP.js";import{h as z}from"./chunk-2QJVTZ56.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import{$b as f,Ab as P,Bb as D,Bc as V,Cb as m,Db as o,Eb as r,Fb as u,Mb as C,Pa as F,Rc as J,Sa as a,Tb as x,Ub as A,Vb as y,Zb as S,_ as b,cb as R,ea as p,fa as _,nc as s,oc as I,pa as g,pc as h,qc as w,r as E,sc as B,tc as $,uc as k,xb as v,yb as M,yc as G,zb as N}from"./chunk-QONLYWYC.js";import{a as T,b as O}from"./chunk-EUDKD2JW.js";var q=()=>({maxWidth:"700px",width:"100%"});function H(l,t){if(l&1&&(o(0,"a",9)(1,"sh-icon"),s(2,"link"),r()()),l&2){let e=f().$implicit;m("href",G(e.Url),F)}}function K(l,t){if(l&1){let e=C();o(0,"div",2)(1,"h4"),s(2),v(3,H,3,2,"a",9),r(),o(4,"p"),s(5),u(6,"br"),o(7,"i"),s(8),r()(),o(9,"div",10)(10,"button",11),S("click",function(){let i=p(e).$implicit,c=f();return _(c.openLicense(i))}),x(11,1),u(12,"sh-icon"),A(),r()()()}if(l&2){let e=t.$implicit;a(2),w(" ",e.Title," - ",e.data==null?null:e.data.license," "),a(),M(e.Url?3:-1),a(2),h(" ",e.data==null?null:e.data.description," "),a(3),I(e.data==null?null:e.data.notes)}}var L=class l{#e=b(z);licenses=j(this.#e.getApiV1Licenses().pipe(E(t=>t.map(e=>O(T({},e),{data:e.Jsondata?JSON.parse(e.Jsondata):null})))));dialogIsOpen=g(!1);dialogLicense=g(null);#t=J(()=>{this.dialogLicense()&&this.dialogIsOpen.set(!0)});openLicense(t){this.dialogLicense.set(t)}closeLicense(){this.dialogIsOpen.set(!1),this.dialogLicense.set(null)}breakIntoLines(t){let e=t.split(`
1
+ import{b as j}from"./chunk-Z27IQRKV.js";import{B as X,u as U,y as W}from"./chunk-RPUPXDQE.js";import{i as z}from"./chunk-OJ3H3ZRA.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import{$b as f,Ab as P,Bb as D,Bc as V,Cb as m,Db as o,Eb as r,Fb as u,Mb as C,Pa as F,Rc as J,Sa as a,Tb as x,Ub as A,Vb as y,Zb as S,_ as b,cb as R,ea as p,fa as _,nc as s,oc as I,pa as g,pc as h,qc as w,r as E,sc as B,tc as $,uc as k,xb as v,yb as M,yc as G,zb as N}from"./chunk-QONLYWYC.js";import{a as T,b as O}from"./chunk-EUDKD2JW.js";var q=()=>({maxWidth:"700px",width:"100%"});function H(l,t){if(l&1&&(o(0,"a",9)(1,"sh-icon"),s(2,"link"),r()()),l&2){let e=f().$implicit;m("href",G(e.Url),F)}}function K(l,t){if(l&1){let e=C();o(0,"div",2)(1,"h4"),s(2),v(3,H,3,2,"a",9),r(),o(4,"p"),s(5),u(6,"br"),o(7,"i"),s(8),r()(),o(9,"div",10)(10,"button",11),S("click",function(){let i=p(e).$implicit,c=f();return _(c.openLicense(i))}),x(11,1),u(12,"sh-icon"),A(),r()()()}if(l&2){let e=t.$implicit;a(2),w(" ",e.Title," - ",e.data==null?null:e.data.license," "),a(),M(e.Url?3:-1),a(2),h(" ",e.data==null?null:e.data.description," "),a(3),I(e.data==null?null:e.data.notes)}}var L=class l{#e=b(z);licenses=j(this.#e.getApiV1Licenses().pipe(E(t=>t.map(e=>O(T({},e),{data:e.Jsondata?JSON.parse(e.Jsondata):null})))));dialogIsOpen=g(!1);dialogLicense=g(null);#t=J(()=>{this.dialogLicense()&&this.dialogIsOpen.set(!0)});openLicense(t){this.dialogLicense.set(t)}closeLicense(){this.dialogIsOpen.set(!1),this.dialogLicense.set(null)}breakIntoLines(t){let e=t.split(`
2
2
  `),n="";for(let i=0;i<e.length;i++)n+=`<li>${e[i]}</li>`;return n}static \u0275fac=function(e){return new(e||l)};static \u0275cmp=R({type:l,selectors:[["app-libraries"]],decls:14,vars:5,consts:()=>{let t;t=$localize`Libraries`;let e;return e=$localize` Details ${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-square-in${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON:`,[t,e,[1,"license"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],[1,"license-dialog"],["footer",""],["shButton","","type","button",3,"click"],[3,"href"],[1,"actions"],["shButton","",3,"click"]]},template:function(e,n){if(e&1){let i=C();o(0,"h3"),y(1,0),r(),P(2,K,13,5,"div",2,N),o(4,"sh-dialog",3),k("isOpenChange",function(d){return p(i),$(n.dialogIsOpen,d)||(n.dialogIsOpen=d),_(d)}),o(5,"header",4)(6,"h3"),s(7),r()(),o(8,"div",5)(9,"div",6),s(10),r()(),o(11,"footer",7)(12,"button",8),S("click",function(){return p(i),n.dialogLicense.set(null),_(n.dialogIsOpen.set(!1))}),s(13,"Close"),r()()()}if(e&2){let i,c;a(2),D(n.licenses()),a(2),B("isOpen",n.dialogIsOpen),m("options",V(4,q)),a(3),I((i=n.dialogLicense())==null?null:i.Title);let d=((c=n.dialogLicense())==null?null:c.License)??"";a(3),h(" ",d," ")}},dependencies:[U,X,W],styles:["[_nghost-%COMP%]{display:block;padding:0 2.5rem}h3[_ngcontent-%COMP%]{font:var(--title-30);margin:0 0 1.25rem}h4[_ngcontent-%COMP%]{font:var(--paragraph-10)}a[_ngcontent-%COMP%]{text-decoration:none}.license[_ngcontent-%COMP%]{padding:1rem;border-bottom:1px solid var(--base-4);display:flex;flex-direction:column;align-items:flex-start;gap:.5rem}.license[_ngcontent-%COMP%]:first-of-type{border-top:1px solid var(--base-4)}.license[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.25rem;align-items:center}.license-dialog[_ngcontent-%COMP%]{background-color:var(--base-1);color:var(--base-12);padding:2.5rem 2.5rem 2.5rem 1.5rem;border-radius:var(--shape-3);overflow:auto;max-height:31.25rem;white-space:pre;border:1px solid var(--base-4)}"],changeDetection:0})};export{L as default};
@@ -1 +1 @@
1
- import{a as _}from"./chunk-6YGURBW6.js";import"./chunk-Z27IQRKV.js";import"./chunk-2QJVTZ56.js";import{oa as l}from"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import{Fc as g,Gb as n,Gc as d,Hb as i,Sa as a,Vb as p,_ as s,cb as S,nc as c,oc as m}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var o=class r{#e=s(_);serverSettings=this.#e.serverSettings;static \u0275fac=function(e){return new(e||r)};static \u0275cmp=S({type:r,selectors:[["app-server-settings"]],decls:6,vars:3,consts:()=>{let t;return t=$localize`System settings`,[t]},template:function(e,E){e&1&&(n(0,"h3"),p(1,0),i(),n(2,"code")(3,"pre"),c(4),g(5,"json"),i()()),e&2&&(a(4),m(d(5,1,E.serverSettings())))},dependencies:[l],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding:0 2.5rem}h3[_ngcontent-%COMP%]{font:var(--title-30)}code[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--base-8),#000 70%);color:#fff;padding:1rem 1.5rem;border-radius:var(--shape-3);overflow:auto;white-space:pre}"],changeDetection:0})};export{o as default};
1
+ import{a as _}from"./chunk-MHPSC3FM.js";import"./chunk-Z27IQRKV.js";import"./chunk-OJ3H3ZRA.js";import{oa as l}from"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import{Fc as g,Gb as n,Gc as d,Hb as i,Sa as a,Vb as p,_ as s,cb as S,nc as c,oc as m}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var o=class r{#e=s(_);serverSettings=this.#e.serverSettings;static \u0275fac=function(e){return new(e||r)};static \u0275cmp=S({type:r,selectors:[["app-server-settings"]],decls:6,vars:3,consts:()=>{let t;return t=$localize`System settings`,[t]},template:function(e,E){e&1&&(n(0,"h3"),p(1,0),i(),n(2,"code")(3,"pre"),c(4),g(5,"json"),i()()),e&2&&(a(4),m(d(5,1,E.serverSettings())))},dependencies:[l],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding:0 2.5rem}h3[_ngcontent-%COMP%]{font:var(--title-30)}code[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--base-8),#000 70%);color:#fff;padding:1rem 1.5rem;border-radius:var(--shape-3);overflow:auto;white-space:pre}"],changeDetection:0})};export{o as default};
@@ -1 +1 @@
1
- import{a as M}from"./chunk-VXRNST6C.js";import"./chunk-GYDI67IZ.js";import"./chunk-4NBLWONL.js";import"./chunk-CCKT2GLS.js";import"./chunk-72HORZFV.js";import"./chunk-6Q6SSTBK.js";import"./chunk-XLDVUBTQ.js";import"./chunk-LN26XMBJ.js";import"./chunk-7LYN2XHO.js";import"./chunk-GCCJSS4C.js";import{e as m}from"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{B as D,C as N,u as E}from"./chunk-QF4DQYEP.js";import"./chunk-2QJVTZ56.js";import"./chunk-I2LW33GO.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-JYWOYPSQ.js";import{Bc as d,Cb as s,Db as e,Eb as n,Fb as o,Sa as c,Tb as r,Ub as l,Vb as i,cb as T}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var f=()=>["/backup/new"],O=()=>["/backup/import"],u=class p{static \u0275fac=function(t){return new(t||p)};static \u0275cmp=T({type:p,selectors:[["app-add-backup"]],decls:23,vars:4,consts:()=>{let a;a=$localize`Add a new backup`;let t;t=$localize`New backup`;let C;C=$localize`Configure a new backup. Choose your destination, source data and schedule.`;let A;A=$localize` Add a new backup ${"\uFFFD#13\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#13\uFFFD"}:CLOSE_TAG_SH_ICON:`;let g;g=$localize`Import from file`;let P;P=$localize`Import backup configuration from a file. During import, you can adjust the settings.`;let S;return S=$localize` Import from file ${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:upload-simple${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON:`,[a,t,C,A,g,P,S,[1,"backup-types"],[1,"type-a"],["src","assets/images/new-backup.png"],["shButton","",1,"raised","primary",3,"routerLink"]]},template:function(t,C){t&1&&(o(0,"app-status-bar"),e(1,"section")(2,"h2"),i(3,0),n(),e(4,"div",7)(5,"sh-card",8),o(6,"img",9),e(7,"h3"),i(8,1),n(),e(9,"p"),i(10,2),n(),e(11,"button",10),r(12,3),o(13,"sh-icon"),l(),n()(),e(14,"sh-card",8),o(15,"img",9),e(16,"h3"),i(17,4),n(),e(18,"p"),i(19,5),n(),e(20,"button",10),r(21,6),o(22,"sh-icon"),l(),n()()()()),t&2&&(c(11),s("routerLink",d(2,f)),c(9),s("routerLink",d(3,O)))},dependencies:[M,D,N,E,m],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;align-items:center;flex-direction:column;gap:2rem;padding:2rem 0}div.backup-types[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem;max-width:43.75rem}sh-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:1rem;padding-bottom:3rem}sh-card[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:18.75rem}sh-card[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;text-align:center;width:75%}"],changeDetection:0})};export{u as default};
1
+ import{a as M}from"./chunk-KXJZEADJ.js";import"./chunk-H7ZKBS2Q.js";import"./chunk-2YGOHGD2.js";import"./chunk-BK2MSH26.js";import"./chunk-3V4DGTSM.js";import"./chunk-6Q6SSTBK.js";import"./chunk-5LX6M65H.js";import"./chunk-LN26XMBJ.js";import"./chunk-S4OFJD2F.js";import"./chunk-6XI3IP27.js";import{e as m}from"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{B as D,C as N,u as E}from"./chunk-RPUPXDQE.js";import"./chunk-OJ3H3ZRA.js";import"./chunk-I2LW33GO.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-JYWOYPSQ.js";import{Bc as d,Cb as s,Db as e,Eb as n,Fb as o,Sa as c,Tb as r,Ub as l,Vb as i,cb as T}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var f=()=>["/backup/new"],O=()=>["/backup/import"],u=class p{static \u0275fac=function(t){return new(t||p)};static \u0275cmp=T({type:p,selectors:[["app-add-backup"]],decls:23,vars:4,consts:()=>{let a;a=$localize`Add a new backup`;let t;t=$localize`New backup`;let C;C=$localize`Configure a new backup. Choose your destination, source data and schedule.`;let A;A=$localize` Add a new backup ${"\uFFFD#13\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#13\uFFFD"}:CLOSE_TAG_SH_ICON:`;let g;g=$localize`Import from file`;let P;P=$localize`Import backup configuration from a file. During import, you can adjust the settings.`;let S;return S=$localize` Import from file ${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:upload-simple${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON:`,[a,t,C,A,g,P,S,[1,"backup-types"],[1,"type-a"],["src","assets/images/new-backup.png"],["shButton","",1,"raised","primary",3,"routerLink"]]},template:function(t,C){t&1&&(o(0,"app-status-bar"),e(1,"section")(2,"h2"),i(3,0),n(),e(4,"div",7)(5,"sh-card",8),o(6,"img",9),e(7,"h3"),i(8,1),n(),e(9,"p"),i(10,2),n(),e(11,"button",10),r(12,3),o(13,"sh-icon"),l(),n()(),e(14,"sh-card",8),o(15,"img",9),e(16,"h3"),i(17,4),n(),e(18,"p"),i(19,5),n(),e(20,"button",10),r(21,6),o(22,"sh-icon"),l(),n()()()()),t&2&&(c(11),s("routerLink",d(2,f)),c(9),s("routerLink",d(3,O)))},dependencies:[M,D,N,E,m],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;align-items:center;flex-direction:column;gap:2rem;padding:2rem 0}div.backup-types[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem;max-width:43.75rem}sh-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:1rem;padding-bottom:3rem}sh-card[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:18.75rem}sh-card[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;text-align:center;width:75%}"],changeDetection:0})};export{u as default};
@@ -1 +1 @@
1
- import{a as P}from"./chunk-KT7U3QIP.js";import{a as Z}from"./chunk-72HORZFV.js";import{b as U,d as j}from"./chunk-ABYM5HWA.js";import{B as q,K as Y,w as H,x as K,z as W}from"./chunk-QF4DQYEP.js";import{h as Q}from"./chunk-2QJVTZ56.js";import{$b as s,Ab as k,Bb as v,Cb as O,Db as a,Eb as l,Fb as m,Jb as y,Kb as D,Mb as f,Pa as M,Qc as F,Sa as r,Tb as G,Ub as V,Vb as _,Wc as S,Zb as u,_ as T,cb as E,ea as p,fa as I,mc as z,nc as A,oc as x,pa as b,pc as J,vc as X,wc as B,xb as d,xc as g,yb as N}from"./chunk-QONLYWYC.js";function ne(n,t){if(n&1&&A(0),n&2){s();let e=g(0);J(" ",e.Message," ")}}function oe(n,t){if(n&1&&(a(0,"div"),G(1,1),m(2,"a",15),V(),l()),n&2){let e=s();r(2),O("href",e.downloadLink(),M)}}function ae(n,t){if(n&1){let e=f();a(0,"button",14),u("click",function(){p(e);let i=s(),c=g(0);return I(i.doRepair(c.BackupID))}),_(1,2),l()}}function re(n,t){if(n&1){let e=f();a(0,"button",14),u("click",function(){p(e);let i=s(),c=g(0);return I(i.doDownloadBugreport(c))}),_(1,3),l()}}function le(n,t){if(n&1&&m(0,"sh-progress-bar",17),n&2){let e,o=s(2);O("value",(e=o.serverState())==null?null:e.UpdateDownloadProgress)}}function ce(n,t){if(n&1){let e=f();a(0,"div",13),y(1),_(2,4),D(),a(3,"a",16),A(4),l(),d(5,le,1,1,"sh-progress-bar",17),a(6,"button",14),u("click",function(){p(e);let i=s();return I(i.doShowUpdate())}),_(7,5),l()()}if(n&2){let e,o,i=s(),c=g(0);r(3),O("href",(e=i.serverState())==null?null:e.UpdateDownloadLink,M),r(),x(c.Message),r(),N(((o=i.serverState())==null?null:o.UpdaterState)==="Downloading"?5:-1)}}function _e(n,t){if(n&1){let e=f();a(0,"button",14),u("click",function(){p(e);let i=s(),c=g(0);return I(i.doShowLog(c.BackupID))}),_(1,6),l()}}function se(n,t){if(n&1){let e=f();a(0,"button",14),u("click",function(){p(e);let i=s();return I(i.doShowLink("https://docs.duplicati.com/detailed-descriptions/the-server-database"))}),_(1,7),l()}}function de(n,t){if(n&1){let e=f();a(0,"button",14),u("click",function(){p(e);let i=s();return I(i.doShowLink("https://docs.duplicati.com/detailed-descriptions/the-server-database"))}),_(1,8),l()}}var Ne={Error:"error",Warning:"warn",Information:"primary"},h=class n{#e=T(j);#a=T(U);#r=T(W);#t=T(K);#i=T(P);#n=T(Q);#o=b(null);serverState=this.#i.serverState;index=S.required();notification=S.required();downloadLink=F(()=>this.#o()||this.notification().DownloadLink||"");deleteNotificationByIndex(){this.#i.deleteNotification(this.index())}deleteAllNotifications(){this.#i.deleteAllNotifications()}getAlertType(t){return t&&Ne[t]||"primary"}doShowLog(t){this.#n.getApiV1BackupByIdIsactive({id:t}).subscribe({next:e=>{this.#e.navigate(["/backup/"+t+"/log"])},error:e=>{if(e.status===404){let o={title:$localize`Error`,message:$localize`The backup is missing, has it been deleted?`,confirmText:$localize`OK`,cancelText:null};parseInt(t)+""!=t&&(o={title:$localize`Error`,message:$localize`The backup was temporary and does not exist anymore, so the log data is lost`,confirmText:$localize`OK`,cancelText:null}),this.#r.open(Z,{maxWidth:"550px",width:"100%",data:o})}else this.#t.error($localize`Failed to find backup: `+e.message)}})}doRepair(t){this.#n.postApiV1BackupByIdRepair({id:t}).subscribe({next:()=>{this.#t.success($localize`Backup repaired`),this.#e.navigate(["./"],{onSameUrlNavigation:"reload",relativeTo:this.#a})},error:e=>{this.#t.error($localize`Failed to repair backup: `+e.message)}})}doShowUpdate(){this.#e.navigate(["/about/changelog"])}doShowLink(t){window.open(t,"_blank")}doDownloadBugreport(t){let e=t.Action.slice(19);this.#n.postApiV1AuthIssuetokenByOperation({operation:"bugreport"}).subscribe({next:o=>{if(!o.Token){this.#t.error("Failed to get bug report URL: No token generated");return}let i=`${location.origin}/api/v1/bugreport/${e}?token=${o.Token}`;t.DownloadLink=i,this.#o.set(i),this.triggerDownload(i)},error:o=>{this.#t.error(`Failed to get bug report URL: ${o.message}`)}})}triggerDownload(t){let e=document.createElement("a");e.href=t,e.download="",e.style.display="none",document.body.appendChild(e);try{e.click()}catch{}document.body.removeChild(e)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=E({type:n,selectors:[["app-notification"]],inputs:{index:[1,"index"],notification:[1,"notification"]},decls:16,vars:12,consts:()=>{let t;t=$localize`Dismiss`;let e;e=$localize` If the backup file was not downloaded automatically, ${"\uFFFD#2\uFFFD"}:START_LINK:right click and choose "Save as …"${"\uFFFD/#2\uFFFD"}:CLOSE_LINK:`;let o;o=$localize`Repair`;let i;i=$localize`Download`;let c;c=$localize`New update found:`;let L;L=$localize`Show Update`;let w;w=$localize`Show Log`;let R;R=$localize` Show Help `;let $;return $=$localize` Show Help `,[t,e,o,i,c,L,w,R,$,["ship-alert-title",""],["ship-alert-content","",1,"content"],[1,"actions"],["shButton","",1,"small","outlined"],[1,"message"],["shButton","",1,"small","outlined",3,"click"],["target","_blank",3,"href"],[3,"href"],[3,"value"]]},template:function(e,o){if(e&1){let i=f();X(0),a(1,"sh-alert")(2,"div",9),A(3),l(),a(4,"div",10),d(5,ne,1,1),d(6,oe,3,1,"div"),a(7,"div",11),d(8,ae,2,0,"button",12),d(9,re,2,0,"button",12),d(10,ce,8,3,"div",13),d(11,_e,2,0,"button",12),d(12,se,2,0,"button",12),d(13,de,2,0,"button",12),a(14,"button",14),u("click",function(){return p(i),I(o.deleteNotificationByIndex())}),_(15,0),l()()()()}if(e&2){let i=B(o.notification());r(),z(o.getAlertType(i.Type)),r(2),x(i.Title),r(2),N(i.Action!=="update:new"&&i.Action!=="update:manual"?5:-1),r(),N(o.downloadLink()?6:-1),r(2),N(i.Message!=null&&i.Message.includes("please run repair")?8:-1),r(),N(i.Action!=null&&i.Action.startsWith("bug-report:created:")&&!o.downloadLink()?9:-1),r(),N(i.Action==="update:new"?10:-1),r(),N(i.Action==="backup:show-log"?11:-1),r(),N(i.Action==="config:issue:unencrypted-database"?12:-1),r(),N(i.Action==="config:issue:windows-folder-used"?13:-1)}},dependencies:[Y,q,H],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};var Te=(n,t)=>t.ID;function Ce(n,t){if(n&1&&m(0,"app-notification",1),n&2){let e=t.$implicit,o=t.$index;O("index",o)("notification",e)}}function pe(n,t){n&1&&(a(0,"div",2)(1,"p"),_(2,0),l()())}var ee=class n{#e=T(P);notificationFilterPredicate=S();notifications=F(()=>{let t=this.notificationFilterPredicate()?.predicate,e=this.#e.notifications();return typeof t!="function"?e:e.filter(t)});static \u0275fac=function(e){return new(e||n)};static \u0275cmp=E({type:n,selectors:[["app-notifications"]],inputs:{notificationFilterPredicate:[1,"notificationFilterPredicate"]},decls:3,vars:1,consts:()=>{let t;return t=$localize`No more notifications`,[t,[3,"index","notification"],[1,"notification-list"]]},template:function(e,o){e&1&&k(0,Ce,1,2,"app-notification",1,Te,!1,pe,3,0,"div",2),e&2&&v(o.notifications())},dependencies:[h],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.actions[_ngcontent-%COMP%]{display:flex;gap:.25rem;justify-content:flex-end}.notification-list[_ngcontent-%COMP%]{padding:1rem;display:flex;flex-direction:column;gap:1rem;text-align:center}"],changeDetection:0})};export{h as a,ee as b};
1
+ import{a as P}from"./chunk-XXVFRNSP.js";import{a as Z}from"./chunk-3V4DGTSM.js";import{b as U,d as j}from"./chunk-ABYM5HWA.js";import{B as q,K as Y,w as H,x as K,z as W}from"./chunk-RPUPXDQE.js";import{i as Q}from"./chunk-OJ3H3ZRA.js";import{$b as s,Ab as k,Bb as v,Cb as O,Db as a,Eb as l,Fb as m,Jb as y,Kb as D,Mb as f,Pa as M,Qc as F,Sa as r,Tb as G,Ub as V,Vb as _,Wc as S,Zb as u,_ as T,cb as E,ea as p,fa as I,mc as z,nc as A,oc as x,pa as b,pc as J,vc as X,wc as B,xb as d,xc as g,yb as N}from"./chunk-QONLYWYC.js";function ne(n,t){if(n&1&&A(0),n&2){s();let e=g(0);J(" ",e.Message," ")}}function oe(n,t){if(n&1&&(a(0,"div"),G(1,1),m(2,"a",15),V(),l()),n&2){let e=s();r(2),O("href",e.downloadLink(),M)}}function ae(n,t){if(n&1){let e=f();a(0,"button",14),u("click",function(){p(e);let i=s(),c=g(0);return I(i.doRepair(c.BackupID))}),_(1,2),l()}}function re(n,t){if(n&1){let e=f();a(0,"button",14),u("click",function(){p(e);let i=s(),c=g(0);return I(i.doDownloadBugreport(c))}),_(1,3),l()}}function le(n,t){if(n&1&&m(0,"sh-progress-bar",17),n&2){let e,o=s(2);O("value",(e=o.serverState())==null?null:e.UpdateDownloadProgress)}}function ce(n,t){if(n&1){let e=f();a(0,"div",13),y(1),_(2,4),D(),a(3,"a",16),A(4),l(),d(5,le,1,1,"sh-progress-bar",17),a(6,"button",14),u("click",function(){p(e);let i=s();return I(i.doShowUpdate())}),_(7,5),l()()}if(n&2){let e,o,i=s(),c=g(0);r(3),O("href",(e=i.serverState())==null?null:e.UpdateDownloadLink,M),r(),x(c.Message),r(),N(((o=i.serverState())==null?null:o.UpdaterState)==="Downloading"?5:-1)}}function _e(n,t){if(n&1){let e=f();a(0,"button",14),u("click",function(){p(e);let i=s(),c=g(0);return I(i.doShowLog(c.BackupID))}),_(1,6),l()}}function se(n,t){if(n&1){let e=f();a(0,"button",14),u("click",function(){p(e);let i=s();return I(i.doShowLink("https://docs.duplicati.com/detailed-descriptions/the-server-database"))}),_(1,7),l()}}function de(n,t){if(n&1){let e=f();a(0,"button",14),u("click",function(){p(e);let i=s();return I(i.doShowLink("https://docs.duplicati.com/detailed-descriptions/the-server-database"))}),_(1,8),l()}}var Ne={Error:"error",Warning:"warn",Information:"primary"},h=class n{#e=T(j);#a=T(U);#r=T(W);#t=T(K);#i=T(P);#n=T(Q);#o=b(null);serverState=this.#i.serverState;index=S.required();notification=S.required();downloadLink=F(()=>this.#o()||this.notification().DownloadLink||"");deleteNotificationByIndex(){this.#i.deleteNotification(this.index())}deleteAllNotifications(){this.#i.deleteAllNotifications()}getAlertType(t){return t&&Ne[t]||"primary"}doShowLog(t){this.#n.getApiV1BackupByIdIsactive({id:t}).subscribe({next:e=>{this.#e.navigate(["/backup/"+t+"/log"])},error:e=>{if(e.status===404){let o={title:$localize`Error`,message:$localize`The backup is missing, has it been deleted?`,confirmText:$localize`OK`,cancelText:null};parseInt(t)+""!=t&&(o={title:$localize`Error`,message:$localize`The backup was temporary and does not exist anymore, so the log data is lost`,confirmText:$localize`OK`,cancelText:null}),this.#r.open(Z,{maxWidth:"550px",width:"100%",data:o})}else this.#t.error($localize`Failed to find backup: `+e.message)}})}doRepair(t){this.#n.postApiV1BackupByIdRepair({id:t}).subscribe({next:()=>{this.#t.success($localize`Backup repaired`),this.#e.navigate(["./"],{onSameUrlNavigation:"reload",relativeTo:this.#a})},error:e=>{this.#t.error($localize`Failed to repair backup: `+e.message)}})}doShowUpdate(){this.#e.navigate(["/about/changelog"])}doShowLink(t){window.open(t,"_blank")}doDownloadBugreport(t){let e=t.Action.slice(19);this.#n.postApiV1AuthIssuetokenByOperation({operation:"bugreport"}).subscribe({next:o=>{if(!o.Token){this.#t.error("Failed to get bug report URL: No token generated");return}let i=`${location.origin}/api/v1/bugreport/${e}?token=${o.Token}`;t.DownloadLink=i,this.#o.set(i),this.triggerDownload(i)},error:o=>{this.#t.error(`Failed to get bug report URL: ${o.message}`)}})}triggerDownload(t){let e=document.createElement("a");e.href=t,e.download="",e.style.display="none",document.body.appendChild(e);try{e.click()}catch{}document.body.removeChild(e)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=E({type:n,selectors:[["app-notification"]],inputs:{index:[1,"index"],notification:[1,"notification"]},decls:16,vars:12,consts:()=>{let t;t=$localize`Dismiss`;let e;e=$localize` If the backup file was not downloaded automatically, ${"\uFFFD#2\uFFFD"}:START_LINK:right click and choose "Save as …"${"\uFFFD/#2\uFFFD"}:CLOSE_LINK:`;let o;o=$localize`Repair`;let i;i=$localize`Download`;let c;c=$localize`New update found:`;let L;L=$localize`Show Update`;let w;w=$localize`Show Log`;let R;R=$localize` Show Help `;let $;return $=$localize` Show Help `,[t,e,o,i,c,L,w,R,$,["ship-alert-title",""],["ship-alert-content","",1,"content"],[1,"actions"],["shButton","",1,"small","outlined"],[1,"message"],["shButton","",1,"small","outlined",3,"click"],["target","_blank",3,"href"],[3,"href"],[3,"value"]]},template:function(e,o){if(e&1){let i=f();X(0),a(1,"sh-alert")(2,"div",9),A(3),l(),a(4,"div",10),d(5,ne,1,1),d(6,oe,3,1,"div"),a(7,"div",11),d(8,ae,2,0,"button",12),d(9,re,2,0,"button",12),d(10,ce,8,3,"div",13),d(11,_e,2,0,"button",12),d(12,se,2,0,"button",12),d(13,de,2,0,"button",12),a(14,"button",14),u("click",function(){return p(i),I(o.deleteNotificationByIndex())}),_(15,0),l()()()()}if(e&2){let i=B(o.notification());r(),z(o.getAlertType(i.Type)),r(2),x(i.Title),r(2),N(i.Action!=="update:new"&&i.Action!=="update:manual"?5:-1),r(),N(o.downloadLink()?6:-1),r(2),N(i.Message!=null&&i.Message.includes("please run repair")?8:-1),r(),N(i.Action!=null&&i.Action.startsWith("bug-report:created:")&&!o.downloadLink()?9:-1),r(),N(i.Action==="update:new"?10:-1),r(),N(i.Action==="backup:show-log"?11:-1),r(),N(i.Action==="config:issue:unencrypted-database"?12:-1),r(),N(i.Action==="config:issue:windows-folder-used"?13:-1)}},dependencies:[Y,q,H],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};var Te=(n,t)=>t.ID;function Ce(n,t){if(n&1&&m(0,"app-notification",1),n&2){let e=t.$implicit,o=t.$index;O("index",o)("notification",e)}}function pe(n,t){n&1&&(a(0,"div",2)(1,"p"),_(2,0),l()())}var ee=class n{#e=T(P);notificationFilterPredicate=S();notifications=F(()=>{let t=this.notificationFilterPredicate()?.predicate,e=this.#e.notifications();return typeof t!="function"?e:e.filter(t)});static \u0275fac=function(e){return new(e||n)};static \u0275cmp=E({type:n,selectors:[["app-notifications"]],inputs:{notificationFilterPredicate:[1,"notificationFilterPredicate"]},decls:3,vars:1,consts:()=>{let t;return t=$localize`No more notifications`,[t,[3,"index","notification"],[1,"notification-list"]]},template:function(e,o){e&1&&k(0,Ce,1,2,"app-notification",1,Te,!1,pe,3,0,"div",2),e&2&&v(o.notifications())},dependencies:[h],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.actions[_ngcontent-%COMP%]{display:flex;gap:.25rem;justify-content:flex-end}.notification-list[_ngcontent-%COMP%]{padding:1rem;display:flex;flex-direction:column;gap:1rem;text-align:center}"],changeDetection:0})};export{h as a,ee as b};
@@ -1,2 +1,2 @@
1
- import{a as Ce}from"./chunk-ZBVBVQO7.js";import{d as ce}from"./chunk-C6F6FP4R.js";import{a as de,d as me}from"./chunk-A5LNLNWR.js";import{a as pe}from"./chunk-XLDVUBTQ.js";import{B as ie,G as oe,J as re,O as ae,U as le,V as _e,X as se,b as Q,c as W,e as Y,i as Z,k as ee,s as te,u as ne}from"./chunk-QF4DQYEP.js";import{ea as q}from"./chunk-5ZSBXGHQ.js";import{$b as l,Ab as E,Bb as P,Bc as H,Cb as c,Db as a,Eb as _,Fb as w,Jb as v,Jc as D,Kb as I,Lb as S,Mb as g,Qc as R,Sa as s,Tb as b,Ub as $,Vb as U,Wc as k,Zb as u,Zc as j,_ as K,cb as J,ea as m,fa as C,hb as f,ic as T,kc as G,nc as d,oc as B,pa as N,pc as A,vc as X,wc as z,xb as h,xc as x,yb as O,zb as M}from"./chunk-QONLYWYC.js";import{a as y,b as V}from"./chunk-EUDKD2JW.js";var fe=()=>({updateOn:"blur"});function Te(t,i){if(t&1){let e=g();a(0,"button",13),u("click",function(){m(e);let n=l();return C(n.showTextArea.set(!1))}),b(1,5),w(2,"sh-icon"),$(),_()}}function xe(t,i){if(t&1){let e=g();a(0,"button",17,0),u("click",function(){let n=m(e).$implicit,r=l(3);return C(r.addSetting(n))}),d(2),_()}if(t&2){let e=i.$implicit;G("deprecated",e.deprecatedDescription),s(2),A(" ",e.name," ")}}function Se(t,i){if(t&1&&(a(0,"h3",9),d(1),_(),E(2,xe,3,3,"button",16,M)),t&2){let e=i.$implicit;s(),B(e.displayName),s(),P(e.options)}}function he(t,i){if(t&1){let e=g();a(0,"sh-menu")(1,"button",18)(2,"sh-icon"),d(3,"dots-three-vertical"),_()(),v(4,15),a(5,"button",13),u("click",function(){m(e);let n=l(2);return C(n.addFreeTextSetting())}),b(6,7),w(7,"sh-icon"),$(),_(),a(8,"button",19),u("click",function(){m(e);let n=l(2);return C(n.showTextArea.set(!0))}),a(9,"sh-icon"),d(10,"link"),_(),d(11," Edit contents as text "),_(),I(),_()}}function Oe(t,i){if(t&1&&(a(0,"sh-menu",14)(1,"button",11),b(2,6),w(3,"sh-icon"),$(),_(),v(4,15),E(5,Se,4,1,null,null,M),I(),_(),h(7,he,12,0,"sh-menu")),t&2){let e=l();c("searchable",!0),s(5),P(e.nonSelectedOptionsGrouped()),s(2),O(e.hasFreeTextSettings()?7:-1)}}function Fe(t,i){if(t&1){let e=g();a(0,"textarea",20),u("ngModelChange",function(n){m(e);let r=l();return C(r.updateSettingsFromText(n))}),_()}if(t&2){let e=l();c("ngModel",e.settingsAsText())("ngModelOptions",H(2,fe))}}function we(t,i){t&1&&(a(0,"div",21),d(1,"Add a setting above to get started."),_())}function Ie(t,i){t&1&&(a(0,"sh-icon",29),d(1," warning-octagon "),_())}function Le(t,i){if(t&1&&(a(0,"sh-icon",30),d(1,"archive"),_()),t&2){let e=l(2).$implicit;c("shTooltip",e.FormView.deprecatedDescription)}}function ye(t,i){if(t&1&&(a(0,"sh-icon",31),d(1,"question"),_()),t&2){let e=l(2).$implicit;c("shTooltip",e.FormView.longDescription)}}function Ve(t,i){if(t&1&&(h(0,Ie,2,0,"sh-icon",29),a(1,"span"),d(2),_(),h(3,Le,2,1,"sh-icon",30)(4,ye,2,1,"sh-icon",31)),t&2){let e=l().$implicit,o=x(1);O(o?0:-1),s(),G("deprecated",e.FormView.deprecatedDescription),s(),B(e.FormView.shortDescription),s(),O(e.FormView.deprecatedDescription?3:e.FormView.longDescription?4:-1)}}function Ne(t,i){t&1&&S(0)}function Me(t,i){if(t&1){let e=g();a(0,"div",23)(1,"label"),f(2,Ne,1,0,"ng-container",32),_(),a(3,"div")(4,"sh-form-field")(5,"input",33),u("ngModelChange",function(n){m(e);let r=l().$implicit,p=l(2);return C(p.updateFreeTextSettingName(r,n))}),_(),a(6,"sh-icon",34),d(7,"rectangle-dashed"),_()()(),a(8,"div")(9,"sh-form-field")(10,"input",33),u("ngModelChange",function(n){m(e);let r=l().$implicit,p=l(2);return C(p.updateSettingValue(r,n))}),_(),a(11,"sh-icon",34),d(12,"textbox"),_()()()()}if(t&2){let e=l().$implicit,o=T(3);s(2),c("ngTemplateOutlet",o),s(3),c("ngModel",e.Name),s(5),c("ngModel",e.Value())}}function Ee(t,i){t&1&&S(0)}function Pe(t,i){if(t&1){let e=g();a(0,"app-file-tree",24)(1,"label",35),f(2,Ee,1,0,"ng-container",32),_(),a(3,"input",36),u("ngModelChange",function(n){m(e);let r=l().$implicit,p=l(2);return C(p.updateSettingValue(r,n))}),_()()}if(t&2){let e=l().$implicit,o=T(3),n=x(0);c("startingPath",e.Value())("accepts",e.FormView.accepts)("showFiles",!0)("showHiddenNodes",!0)("selectFiles",!0),s(),c("for",n),s(),c("ngTemplateOutlet",o),s(),c("id",n)("ngModel",e.Value())}}function ve(t,i){if(t&1){let e=g();a(0,"app-file-tree",25),w(1,"label",35),a(2,"input",36),u("ngModelChange",function(n){m(e);let r=l().$implicit,p=l(2);return C(p.updateSettingValue(r,n))}),_()()}if(t&2){let e=l().$implicit,o=x(0);c("startingPath",e.Value()),s(),c("for",o),s(),c("id",o)("ngModel",e.Value())}}function be(t,i){t&1&&S(0)}function $e(t,i){t&1&&(a(0,"sh-icon",34),d(1,"link"),_())}function Ae(t,i){t&1&&(a(0,"sh-icon",34),d(1,"textbox"),_())}function De(t,i){if(t&1){let e=g();a(0,"sh-form-field")(1,"label",35),f(2,be,1,0,"ng-container",32),_(),a(3,"input",36),u("ngModelChange",function(n){m(e);let r=l().$implicit,p=l(2);return C(p.updateSettingValue(r,n))}),_(),h(4,$e,2,0,"sh-icon",34)(5,Ae,2,0,"sh-icon",34),_()}if(t&2){let e=l().$implicit,o=T(3),n=x(0);s(),c("for",n),s(),c("ngTemplateOutlet",o),s(),c("id",n)("ngModel",e.Value()),s(),O(e.FormView.type==="Path"?4:5)}}function Re(t,i){t&1&&S(0)}function ke(t,i){if(t&1){let e=g();a(0,"sh-icon",39),u("click",function(){m(e);let n=l(2).$implicit;return C(n.showPassword=!n.showPassword)}),d(1," eye "),_()}}function Ge(t,i){if(t&1){let e=g();a(0,"sh-icon",39),u("click",function(){m(e);let n=l(2).$implicit;return C(n.showPassword=!n.showPassword)}),d(1," eye-slash "),_()}}function Be(t,i){if(t&1){let e=g();a(0,"sh-form-field")(1,"label",35),f(2,Re,1,0,"ng-container",32),_(),a(3,"input",37),u("ngModelChange",function(n){m(e);let r=l().$implicit,p=l(2);return C(p.updateSettingValue(r,n))}),_(),a(4,"sh-icon",34),d(5,"password"),_(),h(6,ke,2,0,"sh-icon",38)(7,Ge,2,0,"sh-icon",38),_()}if(t&2){let e=l().$implicit,o=T(3),n=x(0);s(),c("for",n),s(),c("ngTemplateOutlet",o),s(),c("type",e.showPassword?"text":"password")("id",n)("ngModel",e.Value()),s(3),O(e.showPassword?6:7)}}function ze(t,i){t&1&&S(0)}function Ke(t,i){if(t&1&&d(0),t&2){let e=i.$implicit;A(" ",e," ")}}function Je(t,i){if(t&1){let e=g();a(0,"sh-select",40)(1,"label",35),f(2,ze,1,0,"ng-container",32),_(),a(3,"input",36),u("ngModelChange",function(n){m(e);let r=l().$implicit,p=l(2);return C(p.updateSettingValue(r,n))}),_()(),f(4,Ke,1,1,"ng-template",null,2,D)}if(t&2){let e=T(5),o=l().$implicit,n=T(3),r=x(0);c("options",o.FormView.options)("isClearable",!1)("optionTemplate",e),s(),c("for",r),s(),c("ngTemplateOutlet",n),s(),c("id",r)("ngModel",o.Value())}}function Ue(t,i){t&1&&S(0)}function Xe(t,i){if(t&1){let e=g();a(0,"app-size",41),u("ngModelChange",function(n){m(e);let r=l().$implicit,p=l(2);return C(p.updateSettingValue(r,n))}),a(1,"label",35),f(2,Ue,1,0,"ng-container",32),_()()}if(t&2){let e=l().$implicit,o=T(3),n=x(0);c("inputType",e.Name)("ngModel",e.Value())("customId",n),s(),c("for",n),s(),c("ngTemplateOutlet",o)}}function He(t,i){t&1&&S(0)}function je(t,i){if(t&1){let e=g();a(0,"sh-form-field")(1,"label",35),f(2,He,1,0,"ng-container",32),_(),a(3,"input",42),u("ngModelChange",function(n){m(e);let r=l().$implicit,p=l(2);return C(p.updateSettingValue(r,n))}),_(),a(4,"sh-icon",34),d(5,"numpad"),_()()}if(t&2){let e=l().$implicit,o=T(3),n=x(0);s(),c("for",n),s(),c("ngTemplateOutlet",o),s(),c("id",n)("ngModel",e.Value())}}function qe(t,i){t&1&&S(0)}function Qe(t,i){if(t&1){let e=g();a(0,"sh-toggle",27)(1,"label",35),f(2,qe,1,0,"ng-container",32),_(),a(3,"input",43),u("ngModelChange",function(n){m(e);let r=l().$implicit,p=l(2);return C(p.updateSettingValue(r,n))}),_()()}if(t&2){let e=l().$implicit,o=T(3),n=x(0);s(),c("for",n),s(),c("ngTemplateOutlet",o),s(),c("id",n)("ngModel",e.Value())}}function We(t,i){t&1&&S(0)}function Ye(t,i){if(t&1&&d(0),t&2){let e=i.$implicit;A(" ",e," ")}}function Ze(t,i){if(t&1){let e=g();a(0,"sh-select",44)(1,"label",35),f(2,We,1,0,"ng-container",32),_(),a(3,"input",45),u("ngModelChange",function(n){m(e);let r=l().$implicit,p=l(2);return C(p.updateSettingValue(r,n))}),_()(),f(4,Ye,1,1,"ng-template",null,3,D)}if(t&2){let e=T(5),o=l().$implicit,n=T(3),r=x(0);c("options",o.FormView.options)("selectMultiple",!0)("optionTemplate",e),s(),c("for",r),s(),c("ngTemplateOutlet",n),s(),c("ngModel",o.Value())}}function et(t,i){t&1&&S(0)}function tt(t,i){if(t&1){let e=g();a(0,"app-timespan",41),u("ngModelChange",function(n){m(e);let r=l().$implicit,p=l(2);return C(p.updateSettingValue(r,n))}),a(1,"label",35),f(2,et,1,0,"ng-container",32),_()()}if(t&2){let e=l().$implicit,o=T(3),n=x(0);c("inputType",e.Name)("ngModel",e.Value())("customId",n),s(),c("for",n),s(),c("ngTemplateOutlet",o)}}function nt(t,i){if(t&1){let e=g();X(0)(1),f(2,Ve,5,5,"ng-template",null,1,D),a(4,"div",22),h(5,Me,13,3,"div",23)(6,Pe,4,9,"app-file-tree",24)(7,ve,3,4,"app-file-tree",25)(8,De,6,5,"sh-form-field")(9,Be,8,6,"sh-form-field")(10,Je,6,7)(11,Xe,3,5,"app-size",26)(12,je,6,4,"sh-form-field")(13,Qe,4,4,"sh-toggle",27)(14,Ze,6,6)(15,tt,3,5,"app-timespan",26),a(16,"button",28),u("click",function(){let n=m(e).$implicit,r=l(2);return C(r.removeSetting(n))}),a(17,"sh-icon"),d(18,"x-bold"),_()()()}if(t&2){let e=i.$implicit,o=i.$index,n=l(2);z("destination-"+e.Name+o),s(),z(n.inAppOptions(e.Name)),s(4),O(e.FormView.type==="FreeText"?5:e.FormView.type==="FileTree"?6:e.FormView.type==="FolderTree"?7:e.FormView.type==="String"||e.FormView.type==="Path"||e.FormView.type==="Decimal"?8:e.FormView.type==="Password"?9:e.FormView.type==="Enumeration"?10:e.FormView.type==="Size"?11:e.FormView.type==="Integer"?12:e.FormView.type==="Boolean"?13:e.FormView.type==="Flags"?14:e.FormView.type==="Timespan"||e.FormView.type==="DateTime"?15:-1)}}function it(t,i){if(t&1&&(h(0,we,2,0,"div",21),E(1,nt,19,3,null,null,M)),t&2){let e=l();O(e.selectedSettings().length===0?0:-1),s(),P(e.selectedSettings())}}var ue=class t{#e=K(pe);options=j.required();hiddenOptions=k([]);hasFreeTextSettings=k(!1);applicationOptions=k();showTextArea=N(!1);allOptionsGrouped=this.#e.allOptionsGrouped;allOptions=this.#e.allOptions;selectedSettings=R(()=>{let i=this.hiddenOptions();return this.options().map(n=>{let r=this.allOptions().find(F=>F.name===n.Name?.replace("--","")),p=n.Value??"";if(r&&i.includes(r.name))return null;if(r){if(r.type==="Boolean"&&(p=this.isTrue(p)),r.type==="Integer"&&(p=parseInt(p)||0),r.type==="Enumeration"&&r.options){let F=p?.trim().toLowerCase(),L=r.options.find(ge=>(ge??"").trim().toLocaleLowerCase()===F);L&&(p=L)}return V(y({},n),{Value:N(p),FormView:r})}else if(this.hasFreeTextSettings())return V(y({},n),{Value:N(p),FormView:{name:n.Name,type:"FreeText",shortDescription:"Custom settings argument",longDescription:"Custom settings argument"}});return null}).filter(n=>n!==null)});nonSelectedOptionsGrouped=R(()=>{let i=this.options().map(o=>o.Name?.replace("--","")),e=this.hiddenOptions();return this.allOptionsGrouped().map(o=>V(y({},o),{options:o.options.filter(n=>!i.includes(n.name)&&!e.includes(n.name))})).filter(o=>o.options.length>0)});settingsAsText=R(()=>this.selectedSettings().map(i=>{let e=i.Value(),o="";return typeof e=="boolean"?o=this.isTrue(e)?"True":"False":(typeof e=="number"||e!=null)&&(o=e.toString()),`${i.Name??""}=${o}`}).join(`
1
+ import{a as Ce}from"./chunk-HHU5JW5J.js";import{d as ce}from"./chunk-FSG362SU.js";import{a as de,d as me}from"./chunk-HYQ6MPYI.js";import{a as pe}from"./chunk-5LX6M65H.js";import{B as ie,G as oe,J as re,O as ae,U as le,V as _e,X as se,b as Q,c as W,e as Y,i as Z,k as ee,s as te,u as ne}from"./chunk-RPUPXDQE.js";import{ea as q}from"./chunk-5ZSBXGHQ.js";import{$b as l,Ab as E,Bb as P,Bc as H,Cb as c,Db as a,Eb as _,Fb as w,Jb as v,Jc as D,Kb as I,Lb as S,Mb as g,Qc as R,Sa as s,Tb as b,Ub as $,Vb as U,Wc as k,Zb as u,Zc as j,_ as K,cb as J,ea as m,fa as C,hb as f,ic as T,kc as G,nc as d,oc as B,pa as N,pc as A,vc as X,wc as z,xb as h,xc as x,yb as O,zb as M}from"./chunk-QONLYWYC.js";import{a as y,b as V}from"./chunk-EUDKD2JW.js";var fe=()=>({updateOn:"blur"});function Te(t,i){if(t&1){let e=g();a(0,"button",13),u("click",function(){m(e);let n=l();return C(n.showTextArea.set(!1))}),b(1,5),w(2,"sh-icon"),$(),_()}}function xe(t,i){if(t&1){let e=g();a(0,"button",17,0),u("click",function(){let n=m(e).$implicit,r=l(3);return C(r.addSetting(n))}),d(2),_()}if(t&2){let e=i.$implicit;G("deprecated",e.deprecatedDescription),s(2),A(" ",e.name," ")}}function Se(t,i){if(t&1&&(a(0,"h3",9),d(1),_(),E(2,xe,3,3,"button",16,M)),t&2){let e=i.$implicit;s(),B(e.displayName),s(),P(e.options)}}function he(t,i){if(t&1){let e=g();a(0,"sh-menu")(1,"button",18)(2,"sh-icon"),d(3,"dots-three-vertical"),_()(),v(4,15),a(5,"button",13),u("click",function(){m(e);let n=l(2);return C(n.addFreeTextSetting())}),b(6,7),w(7,"sh-icon"),$(),_(),a(8,"button",19),u("click",function(){m(e);let n=l(2);return C(n.showTextArea.set(!0))}),a(9,"sh-icon"),d(10,"link"),_(),d(11," Edit contents as text "),_(),I(),_()}}function Oe(t,i){if(t&1&&(a(0,"sh-menu",14)(1,"button",11),b(2,6),w(3,"sh-icon"),$(),_(),v(4,15),E(5,Se,4,1,null,null,M),I(),_(),h(7,he,12,0,"sh-menu")),t&2){let e=l();c("searchable",!0),s(5),P(e.nonSelectedOptionsGrouped()),s(2),O(e.hasFreeTextSettings()?7:-1)}}function Fe(t,i){if(t&1){let e=g();a(0,"textarea",20),u("ngModelChange",function(n){m(e);let r=l();return C(r.updateSettingsFromText(n))}),_()}if(t&2){let e=l();c("ngModel",e.settingsAsText())("ngModelOptions",H(2,fe))}}function we(t,i){t&1&&(a(0,"div",21),d(1,"Add a setting above to get started."),_())}function Ie(t,i){t&1&&(a(0,"sh-icon",29),d(1," warning-octagon "),_())}function Le(t,i){if(t&1&&(a(0,"sh-icon",30),d(1,"archive"),_()),t&2){let e=l(2).$implicit;c("shTooltip",e.FormView.deprecatedDescription)}}function ye(t,i){if(t&1&&(a(0,"sh-icon",31),d(1,"question"),_()),t&2){let e=l(2).$implicit;c("shTooltip",e.FormView.longDescription)}}function Ve(t,i){if(t&1&&(h(0,Ie,2,0,"sh-icon",29),a(1,"span"),d(2),_(),h(3,Le,2,1,"sh-icon",30)(4,ye,2,1,"sh-icon",31)),t&2){let e=l().$implicit,o=x(1);O(o?0:-1),s(),G("deprecated",e.FormView.deprecatedDescription),s(),B(e.FormView.shortDescription),s(),O(e.FormView.deprecatedDescription?3:e.FormView.longDescription?4:-1)}}function Ne(t,i){t&1&&S(0)}function Me(t,i){if(t&1){let e=g();a(0,"div",23)(1,"label"),f(2,Ne,1,0,"ng-container",32),_(),a(3,"div")(4,"sh-form-field")(5,"input",33),u("ngModelChange",function(n){m(e);let r=l().$implicit,p=l(2);return C(p.updateFreeTextSettingName(r,n))}),_(),a(6,"sh-icon",34),d(7,"rectangle-dashed"),_()()(),a(8,"div")(9,"sh-form-field")(10,"input",33),u("ngModelChange",function(n){m(e);let r=l().$implicit,p=l(2);return C(p.updateSettingValue(r,n))}),_(),a(11,"sh-icon",34),d(12,"textbox"),_()()()()}if(t&2){let e=l().$implicit,o=T(3);s(2),c("ngTemplateOutlet",o),s(3),c("ngModel",e.Name),s(5),c("ngModel",e.Value())}}function Ee(t,i){t&1&&S(0)}function Pe(t,i){if(t&1){let e=g();a(0,"app-file-tree",24)(1,"label",35),f(2,Ee,1,0,"ng-container",32),_(),a(3,"input",36),u("ngModelChange",function(n){m(e);let r=l().$implicit,p=l(2);return C(p.updateSettingValue(r,n))}),_()()}if(t&2){let e=l().$implicit,o=T(3),n=x(0);c("startingPath",e.Value())("accepts",e.FormView.accepts)("showFiles",!0)("showHiddenNodes",!0)("selectFiles",!0),s(),c("for",n),s(),c("ngTemplateOutlet",o),s(),c("id",n)("ngModel",e.Value())}}function ve(t,i){if(t&1){let e=g();a(0,"app-file-tree",25),w(1,"label",35),a(2,"input",36),u("ngModelChange",function(n){m(e);let r=l().$implicit,p=l(2);return C(p.updateSettingValue(r,n))}),_()()}if(t&2){let e=l().$implicit,o=x(0);c("startingPath",e.Value()),s(),c("for",o),s(),c("id",o)("ngModel",e.Value())}}function be(t,i){t&1&&S(0)}function $e(t,i){t&1&&(a(0,"sh-icon",34),d(1,"link"),_())}function Ae(t,i){t&1&&(a(0,"sh-icon",34),d(1,"textbox"),_())}function De(t,i){if(t&1){let e=g();a(0,"sh-form-field")(1,"label",35),f(2,be,1,0,"ng-container",32),_(),a(3,"input",36),u("ngModelChange",function(n){m(e);let r=l().$implicit,p=l(2);return C(p.updateSettingValue(r,n))}),_(),h(4,$e,2,0,"sh-icon",34)(5,Ae,2,0,"sh-icon",34),_()}if(t&2){let e=l().$implicit,o=T(3),n=x(0);s(),c("for",n),s(),c("ngTemplateOutlet",o),s(),c("id",n)("ngModel",e.Value()),s(),O(e.FormView.type==="Path"?4:5)}}function Re(t,i){t&1&&S(0)}function ke(t,i){if(t&1){let e=g();a(0,"sh-icon",39),u("click",function(){m(e);let n=l(2).$implicit;return C(n.showPassword=!n.showPassword)}),d(1," eye "),_()}}function Ge(t,i){if(t&1){let e=g();a(0,"sh-icon",39),u("click",function(){m(e);let n=l(2).$implicit;return C(n.showPassword=!n.showPassword)}),d(1," eye-slash "),_()}}function Be(t,i){if(t&1){let e=g();a(0,"sh-form-field")(1,"label",35),f(2,Re,1,0,"ng-container",32),_(),a(3,"input",37),u("ngModelChange",function(n){m(e);let r=l().$implicit,p=l(2);return C(p.updateSettingValue(r,n))}),_(),a(4,"sh-icon",34),d(5,"password"),_(),h(6,ke,2,0,"sh-icon",38)(7,Ge,2,0,"sh-icon",38),_()}if(t&2){let e=l().$implicit,o=T(3),n=x(0);s(),c("for",n),s(),c("ngTemplateOutlet",o),s(),c("type",e.showPassword?"text":"password")("id",n)("ngModel",e.Value()),s(3),O(e.showPassword?6:7)}}function ze(t,i){t&1&&S(0)}function Ke(t,i){if(t&1&&d(0),t&2){let e=i.$implicit;A(" ",e," ")}}function Je(t,i){if(t&1){let e=g();a(0,"sh-select",40)(1,"label",35),f(2,ze,1,0,"ng-container",32),_(),a(3,"input",36),u("ngModelChange",function(n){m(e);let r=l().$implicit,p=l(2);return C(p.updateSettingValue(r,n))}),_()(),f(4,Ke,1,1,"ng-template",null,2,D)}if(t&2){let e=T(5),o=l().$implicit,n=T(3),r=x(0);c("options",o.FormView.options)("isClearable",!1)("optionTemplate",e),s(),c("for",r),s(),c("ngTemplateOutlet",n),s(),c("id",r)("ngModel",o.Value())}}function Ue(t,i){t&1&&S(0)}function Xe(t,i){if(t&1){let e=g();a(0,"app-size",41),u("ngModelChange",function(n){m(e);let r=l().$implicit,p=l(2);return C(p.updateSettingValue(r,n))}),a(1,"label",35),f(2,Ue,1,0,"ng-container",32),_()()}if(t&2){let e=l().$implicit,o=T(3),n=x(0);c("inputType",e.Name)("ngModel",e.Value())("customId",n),s(),c("for",n),s(),c("ngTemplateOutlet",o)}}function He(t,i){t&1&&S(0)}function je(t,i){if(t&1){let e=g();a(0,"sh-form-field")(1,"label",35),f(2,He,1,0,"ng-container",32),_(),a(3,"input",42),u("ngModelChange",function(n){m(e);let r=l().$implicit,p=l(2);return C(p.updateSettingValue(r,n))}),_(),a(4,"sh-icon",34),d(5,"numpad"),_()()}if(t&2){let e=l().$implicit,o=T(3),n=x(0);s(),c("for",n),s(),c("ngTemplateOutlet",o),s(),c("id",n)("ngModel",e.Value())}}function qe(t,i){t&1&&S(0)}function Qe(t,i){if(t&1){let e=g();a(0,"sh-toggle",27)(1,"label",35),f(2,qe,1,0,"ng-container",32),_(),a(3,"input",43),u("ngModelChange",function(n){m(e);let r=l().$implicit,p=l(2);return C(p.updateSettingValue(r,n))}),_()()}if(t&2){let e=l().$implicit,o=T(3),n=x(0);s(),c("for",n),s(),c("ngTemplateOutlet",o),s(),c("id",n)("ngModel",e.Value())}}function We(t,i){t&1&&S(0)}function Ye(t,i){if(t&1&&d(0),t&2){let e=i.$implicit;A(" ",e," ")}}function Ze(t,i){if(t&1){let e=g();a(0,"sh-select",44)(1,"label",35),f(2,We,1,0,"ng-container",32),_(),a(3,"input",45),u("ngModelChange",function(n){m(e);let r=l().$implicit,p=l(2);return C(p.updateSettingValue(r,n))}),_()(),f(4,Ye,1,1,"ng-template",null,3,D)}if(t&2){let e=T(5),o=l().$implicit,n=T(3),r=x(0);c("options",o.FormView.options)("selectMultiple",!0)("optionTemplate",e),s(),c("for",r),s(),c("ngTemplateOutlet",n),s(),c("ngModel",o.Value())}}function et(t,i){t&1&&S(0)}function tt(t,i){if(t&1){let e=g();a(0,"app-timespan",41),u("ngModelChange",function(n){m(e);let r=l().$implicit,p=l(2);return C(p.updateSettingValue(r,n))}),a(1,"label",35),f(2,et,1,0,"ng-container",32),_()()}if(t&2){let e=l().$implicit,o=T(3),n=x(0);c("inputType",e.Name)("ngModel",e.Value())("customId",n),s(),c("for",n),s(),c("ngTemplateOutlet",o)}}function nt(t,i){if(t&1){let e=g();X(0)(1),f(2,Ve,5,5,"ng-template",null,1,D),a(4,"div",22),h(5,Me,13,3,"div",23)(6,Pe,4,9,"app-file-tree",24)(7,ve,3,4,"app-file-tree",25)(8,De,6,5,"sh-form-field")(9,Be,8,6,"sh-form-field")(10,Je,6,7)(11,Xe,3,5,"app-size",26)(12,je,6,4,"sh-form-field")(13,Qe,4,4,"sh-toggle",27)(14,Ze,6,6)(15,tt,3,5,"app-timespan",26),a(16,"button",28),u("click",function(){let n=m(e).$implicit,r=l(2);return C(r.removeSetting(n))}),a(17,"sh-icon"),d(18,"x-bold"),_()()()}if(t&2){let e=i.$implicit,o=i.$index,n=l(2);z("destination-"+e.Name+o),s(),z(n.inAppOptions(e.Name)),s(4),O(e.FormView.type==="FreeText"?5:e.FormView.type==="FileTree"?6:e.FormView.type==="FolderTree"?7:e.FormView.type==="String"||e.FormView.type==="Path"||e.FormView.type==="Decimal"?8:e.FormView.type==="Password"?9:e.FormView.type==="Enumeration"?10:e.FormView.type==="Size"?11:e.FormView.type==="Integer"?12:e.FormView.type==="Boolean"?13:e.FormView.type==="Flags"?14:e.FormView.type==="Timespan"||e.FormView.type==="DateTime"?15:-1)}}function it(t,i){if(t&1&&(h(0,we,2,0,"div",21),E(1,nt,19,3,null,null,M)),t&2){let e=l();O(e.selectedSettings().length===0?0:-1),s(),P(e.selectedSettings())}}var ue=class t{#e=K(pe);options=j.required();hiddenOptions=k([]);hasFreeTextSettings=k(!1);applicationOptions=k();showTextArea=N(!1);allOptionsGrouped=this.#e.allOptionsGrouped;allOptions=this.#e.allOptions;selectedSettings=R(()=>{let i=this.hiddenOptions();return this.options().map(n=>{let r=this.allOptions().find(F=>F.name===n.Name?.replace("--","")),p=n.Value??"";if(r&&i.includes(r.name))return null;if(r){if(r.type==="Boolean"&&(p=this.isTrue(p)),r.type==="Integer"&&(p=parseInt(p)||0),r.type==="Enumeration"&&r.options){let F=p?.trim().toLowerCase(),L=r.options.find(ge=>(ge??"").trim().toLocaleLowerCase()===F);L&&(p=L)}return V(y({},n),{Value:N(p),FormView:r})}else if(this.hasFreeTextSettings())return V(y({},n),{Value:N(p),FormView:{name:n.Name,type:"FreeText",shortDescription:"Custom settings argument",longDescription:"Custom settings argument"}});return null}).filter(n=>n!==null)});nonSelectedOptionsGrouped=R(()=>{let i=this.options().map(o=>o.Name?.replace("--","")),e=this.hiddenOptions();return this.allOptionsGrouped().map(o=>V(y({},o),{options:o.options.filter(n=>!i.includes(n.name)&&!e.includes(n.name))})).filter(o=>o.options.length>0)});settingsAsText=R(()=>this.selectedSettings().map(i=>{let e=i.Value(),o="";return typeof e=="boolean"?o=this.isTrue(e)?"True":"False":(typeof e=="number"||e!=null)&&(o=e.toString()),`${i.Name??""}=${o}`}).join(`
2
2
  `));updateSettingsFromText(i){if(typeof i!="string")return;let e=ce(i);this.options.update(()=>e)}isTrue(i){if(typeof i=="boolean")return i;if(typeof i=="string"){let e=i.toLowerCase();return e==="true"||e==="1"||e==="yes"||e==="on"}return!1}inAppOptions(i){let e=this.applicationOptions()?.findIndex(o=>o.Name?.replace("--","")===i);return e===void 0?!1:e>-1}addFreeTextSetting(){this.hasFreeTextSettings()&&this.options.update(i=>[...i,{Filter:null,Name:"",Value:""}])}addSetting(i){this.options.update(e=>{let o=i.defaultValue??"";return i.type==="Boolean"&&(o=this.isTrue(o)),i.type==="Integer"&&(o=parseInt(o)||0),[...e,{Name:i.name,Value:o}]})}updateSettingValue(i,e){this.options.update(o=>{let n=[...o],r=n.findIndex(p=>p.Name===i.Name);if(i.FormView.type==="Boolean")return n[r].Value=this.isTrue(e)?"True":"False",n;if(i.FormView.type==="Integer")return n[r].Value=e.toString(),n;if(i.FormView.type==="Enumeration"&&i.FormView.options){let p=e?.trim().toLowerCase()??"",F=i.FormView.options.find(L=>(L??"").trim().toLocaleLowerCase()===p);if(F)return n[r].Value=F,n}return n[r].Value=e,n})}updateFreeTextSettingName(i,e){this.options.update(o=>{let n=[...o],r=n.findIndex(p=>p.Name===i.Name);return n[r].Name=e,n})}removeSetting(i){this.options.update(e=>e.filter(o=>o.Name!==i.Name))}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=J({type:t,selectors:[["app-options-list"]],inputs:{options:[1,"options"],hiddenOptions:[1,"hiddenOptions"],hasFreeTextSettings:[1,"hasFreeTextSettings"],applicationOptions:[1,"applicationOptions"]},outputs:{options:"optionsChange"},decls:9,vars:3,consts:()=>{let i;i=$localize`Advanced options`;let e;e=$localize` Show editor ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let o;o=$localize` Add advanced option ${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON:`;let n;n=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:pen${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: New custom option `;let r;return r=$localize`By adding this option it will override the matching global option`,[["option",""],["defaultLabel",""],["enumOptionTemplate",""],["optionTemplate",""],i,e,o,n,[3,"disallowToggle"],["title",""],[1,"actions"],["shButton","","type","button",1,"outlined","small"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModel","ngModelOptions"],["shButton","","type","button",1,"outlined","small",3,"click"],[3,"searchable"],["menu",""],["type","button",3,"deprecated"],["type","button",3,"click"],["shButton","","type","button",1,"small"],["shButton","","type","button",1,"small",3,"click"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModelChange","ngModel","ngModelOptions"],[1,"placeholder"],[1,"field-row"],[1,"form-column"],[3,"startingPath","accepts","showFiles","showHiddenNodes","selectFiles"],[3,"startingPath"],[3,"inputType","ngModel","customId"],[1,"primary","raised"],["shButton","","type","button",1,"outlined","remove-btn",3,"click"],["shTooltip",r,1,"error"],[1,"warn",3,"shTooltip"],[1,"primary",3,"shTooltip"],[4,"ngTemplateOutlet"],["type","text",3,"ngModelChange","ngModel"],["prefix",""],[3,"for"],["type","text",3,"ngModelChange","id","ngModel"],["autocomplete","off",3,"ngModelChange","type","id","ngModel"],["suffix","",1,"clickable"],["suffix","",1,"clickable",3,"click"],[3,"options","isClearable","optionTemplate"],[3,"ngModelChange","inputType","ngModel","customId"],["type","number",3,"ngModelChange","id","ngModel"],["type","checkbox",3,"ngModelChange","id","ngModel"],[1,"primary","raised",3,"options","selectMultiple","optionTemplate"],["type","text","id","text",3,"ngModelChange","ngModel"]]},template:function(e,o){e&1&&(a(0,"sh-toggle-card",8),v(1,9)(2),U(3,4),I(),a(4,"div",10),h(5,Te,3,0,"button",11)(6,Oe,8,2),_(),I(),h(7,Fe,1,3,"textarea",12)(8,it,3,1),_()),e&2&&(c("disallowToggle",!0),s(5),O(o.showTextArea()?5:6),s(2),O(o.showTextArea()?7:8))},dependencies:[te,W,ee,Q,Y,Z,de,me,Ce,q,le,oe,ie,re,se,ne,ae,_e],styles:["[_nghost-%COMP%]{display:block}sh-select[_ngcontent-%COMP%]{--miw: p2r(120)}sh-toggle[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:1rem}.placeholder[_ngcontent-%COMP%]{color:var(--base-9);text-align:center;padding:2rem 1rem}.field-row[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:1fr 2.5rem;gap:.5rem;position:relative;z-index:1}.field-row[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{align-self:flex-end}.form-column[_ngcontent-%COMP%]{display:flex;gap:.25rem;flex-direction:column}label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}sh-icon[_ngcontent-%COMP%]{font-size:1rem}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;justify-content:flex-end}.deprecated[_ngcontent-%COMP%]{text-decoration:line-through}.raw-text-area[_ngcontent-%COMP%]{min-height:12rem;white-space:pre}"],changeDetection:0})};export{ue as a};
@@ -0,0 +1 @@
1
+ import{a,b,c}from"./chunk-C7EUC34O.js";import"./chunk-HYQ6MPYI.js";import"./chunk-YCORZV4Z.js";import"./chunk-4VY6SMSL.js";import"./chunk-Z27IQRKV.js";import"./chunk-3V4DGTSM.js";import"./chunk-6Q6SSTBK.js";import"./chunk-5LX6M65H.js";import"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import"./chunk-RPUPXDQE.js";import"./chunk-OJ3H3ZRA.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";export{b as NONE_OPTION,a as createGeneralForm,c as default};
@@ -1 +1 @@
1
- import{a as Ye}from"./chunk-KAAYNQ7L.js";import{a as se}from"./chunk-A5LNLNWR.js";import{a as ne}from"./chunk-3NFAL4U4.js";import{b as _e}from"./chunk-Z27IQRKV.js";import{a as Xe}from"./chunk-CCKT2GLS.js";import{a as q}from"./chunk-72HORZFV.js";import{a as oe}from"./chunk-XLDVUBTQ.js";import{a as Je}from"./chunk-LN26XMBJ.js";import{b as R,d as h}from"./chunk-ABYM5HWA.js";import{B as J,G as Be,K as xe,L as Ve,O as We,V as ze,b as ve,c as A,e as G,f as k,i as Ae,j as w,l as Ge,o as B,q as x,r as V,s as ke,t as W,u as z,z as we}from"./chunk-QF4DQYEP.js";import{h as X}from"./chunk-2QJVTZ56.js";import{la as ie}from"./chunk-5ZSBXGHQ.js";import{$b as D,Ac as ye,B as Oe,Bc as be,Cb as g,Db as r,Eb as l,F as U,Fb as c,Fc as ae,Gc as $e,H as O,Hc as De,Jb as b,Kb as $,L as Ce,Mb as H,P as Ne,Q,Qc as le,Rc as v,Sa as d,Tb as S,Ub as T,V as fe,Vb as m,Wb as he,Xb as Pe,Zb as C,_,cb as L,ea as N,fa as f,hb as Re,i as me,kc as Ie,nc as j,o as Ee,pa as p,pc as Le,qc as Me,sc as Z,tc as ee,uc as te,x as re,xb as M,y as Fe,yb as y}from"./chunk-QONLYWYC.js";var Ue=new V,qe=()=>Ue.group({passphrase:Ue.control("")}),pe=class a{#t=_(X);#e=_(P);#o=_(h);#n=_(R);encryptionForm=this.#e.encryptionForm;creatingTemporaryBackup=p(!1);settings=p([]);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=L({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),C("submit",function(){return t.next()}),r(1,"sh-form-field")(2,"label",5),m(3,0),l(),c(4,"input",6),l(),r(5,"app-toggle-card"),b(6,7),m(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),C("click",function(){return t.back()}),S(11,2),c(12,"sh-icon"),T(),l(),r(13,"button",11),S(14,3),c(15,"sh-icon"),T(),l()()()),e&2&&(g("formGroup",t.encryptionForm),d(8),Z("options",t.settings),g("hasFreeTextSettings",!0))},dependencies:[W,w,A,G,k,B,x,Be,z,J,ne,Ye],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&&(j(0),ae(1,"bytes")),a&2){let e=D().$implicit;Le(" (",$e(1,1,e.FileSizes),") ")}}function it(a,i){a&1&&(r(0,"span",16),m(1,4),l())}function ot(a,i){if(a&1&&(r(0,"div",15),j(1),ae(2,"date"),M(3,tt,2,3),M(4,it,2,0,"span",16),l()),a&2){let e=i.$implicit;d(),Me(" ",e.Version,": ",De(2,4,e.Time,"medium")," "),d(2),y(e.FileSizes?3:-1),d(),y(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),m(2,5),l(),c(3,"input",18),l()),a&2){let e=D(2);g("rootPaths",e.rootPaths())("initialNodes",e.initialNodes())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)}}function rt(a,i){if(a&1){let e=H();r(0,"sh-select",12),C("cleared",function(){N(e);let o=D();return f(o.abortLoading())}),r(1,"input",13),te("ngModelChange",function(o){N(e);let n=D();return ee(n.selectOption,o)||(n.selectOption=o),f(o)}),l(),Re(2,ot,5,7,"ng-template"),l(),M(3,nt,1,0,"sh-progress-bar",8),M(4,st,4,5,"app-file-tree",14)}if(a&2){let e=D();g("options",e.versionOptions())("isClearable",!1),d(),Z("ngModel",e.selectOption),g("ngModelOptions",be(6,Ze)),d(2),y(e.isRepairing()||e.versionOptionsLoading()||e.loadingRootPath()?3:-1),d(),y(e.showFileTree()?4:-1)}}var ue=new V,Ke=()=>ue.group({filesToRestore:ue.control(""),passphrase:ue.control(null)}),de=class a{#t=_(X);#e=_(P);#o=_(Xe);#n=_(oe);#i=_(h);#s=_(R);#l=_(ie);#a=null;#_=null;#r=p([]);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=p(!1);backupSettings=p(null);rootPaths=p([]);initialNodes=p([]);loadingRootPath=p(!1);isRepairing=le(()=>this.#r().length>0);loadedVersions=p({});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(K=>K.Version===parseInt(e))?.Time??null;if(!s)return;let u=`${i}+${s}`,F=o[u];if(this.needsDatabaseRepair()&&(!F||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.#_===n||(this.#_=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.#_=null})).subscribe(s=>{let u=s.ID;this.#o.waitForTaskToComplete(u).pipe(U(1)).subscribe(()=>{this.#r.update(F=>F.filter(I=>I!==n)),this.loadedVersions.update(F=>(F[n]=!0,F))})})}});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 me;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=L({type:a,selectors:[["app-select-files"]],features:[ye([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=H();r(0,"form",6,0),C("submit",function(){return N(o),f(t.next())}),r(2,"h3",7),m(3,1),l(),M(4,et,1,0,"sh-progress-bar",8)(5,rt,5,7),r(6,"div",9)(7,"button",10),C("click",function(){return N(o),f(t.back())}),S(8,2),c(9,"sh-icon"),T(),l(),r(10,"button",11),S(11,3),c(12,"sh-icon"),T(),l()()()}e&2&&(g("formGroup",t.selectFilesForm),d(4),y(t.versionOptionsLoading()?4:5),d(5),he(t.isFileRestore()?"Back":"Exit"),Pe(8))},dependencies:[ke,w,A,G,k,Ae,W,B,x,se,J,z,We,xe,ie,Je],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.partial[_ngcontent-%COMP%]{color:var(--base-9);font-style:italic}"],changeDetection:0})};var P=class a{#t=_(h);#e=_(R);#o=_(oe);#n=_(we);#i=_(X);backupId=p(null);backup=p(null);destinationTargetUrl=p(null);selectFilesForm=Ke();optionsForm=Qe();encryptionForm=qe();optionsFormSignal=_e(this.optionsForm.valueChanges);selectFilesFormSignal=_e(this.selectFilesForm.valueChanges);selectOption=p(null);versionOptionsLoading=p(!1);versionOptions=p([]);isSubmitting=p(!1);isFileRestore=p(!1);isFullWidthPage=p(!1);#s=p("");#l=p(null);#a=null;testSignal=this.#s.asReadonly();testErrorMessage=this.#l.asReadonly();#_=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(q,{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(q,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:i=>{i&&(this.#p(),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?Ee(()=>t):Fe(1e3).pipe(Ne(()=>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(U(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(q,{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(q,{data:{title:$localize`Failed to load backup filesets`,message:u,confirmText:$localize`OK`,cancelText:void 0},closed:F=>{this.#t.navigate([o?"/restore-from-files/encryption":"/restore-from-files/destination"])}})}}):re([this.#i.getApiV1BackupById({id:e}),this.#i.getApiV1BackupByIdFilesets({id:e}).pipe(Ce(3))]).pipe(U(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)}})}#p(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||a)};static \u0275prov=fe({token:a,factory:a.\u0275fac,providedIn:"root"})};var Y=new V,Qe=()=>Y.group({restoreFrom:Y.control("orignal"),restoreFromPath:Y.control(""),handleExisting:Y.control("overwrite"),permissions:Y.control(!1),includeMetadata:Y.control(!0)}),Se=class a{#t=_(P);#e=_(h);#o=_(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=L({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 F;F=$localize`Metadata settings`;let I;I=$localize` Restore file metadata ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let K;K=$localize` Restore read/write permissions ${"\uFFFD#34\uFFFD\uFFFD/#34\uFFFD"}:TAG_INPUT:`;let Te;Te=$localize`${"\uFFFD#38\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let ge;return ge=$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,F,I,K,Te,ge,[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=H();r(0,"form",13,0),C("submit",function(){return N(o),f(t.submit())}),r(2,"h3",14),m(3,1),l(),r(4,"app-toggle-card",15),b(5,16),m(6,2),$(),r(7,"sh-radio",17),S(8,3),c(9,"input",18),T(),l(),r(10,"sh-radio",17),S(11,4),c(12,"input",19),T(),l(),r(13,"app-file-tree",20)(14,"label",21),j(15,"Path"),l(),c(16,"input",22),l()(),r(17,"app-toggle-card",15),b(18,16),m(19,5),$(),r(20,"sh-radio",17),S(21,6),c(22,"input",23),T(),l(),r(23,"sh-radio",17),S(24,7),c(25,"input",24),T(),l()(),r(26,"app-toggle-card"),b(27,16),m(28,8),$(),r(29,"sh-toggle",25),S(30,9),c(31,"input",26),T(),l(),r(32,"sh-toggle",25),S(33,10),c(34,"input",27),T(),l()(),r(35,"div",28)(36,"button",29),C("click",function(){return N(o),f(t.goBack())}),S(37,11),c(38,"sh-icon"),T(),l(),r(39,"button",30),S(40,12),c(41,"sh-icon"),T(),l()()()}if(e&2){let o;g("formGroup",t.optionsForm),d(4),g("disallowToggle",!0),d(9),g("disabled",((o=t.optionsFormSignal())==null?null:o.restoreFrom)!=="pickLocation")("enableCreateFolder",!0),d(4),g("disallowToggle",!0),d(22),Ie("loader",t.isSubmitting())}},dependencies:[W,w,A,ve,Ge,G,k,B,x,ne,se,ze,Ve,J,z],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,Se as b,qe as c,pe as d,Ke as e,de as f,P as g};
1
+ import{a as Ye}from"./chunk-E6H2XELA.js";import{a as se}from"./chunk-HYQ6MPYI.js";import{a as ne}from"./chunk-YCORZV4Z.js";import{b as _e}from"./chunk-Z27IQRKV.js";import{a as Xe}from"./chunk-BK2MSH26.js";import{a as q}from"./chunk-3V4DGTSM.js";import{a as oe}from"./chunk-5LX6M65H.js";import{a as Je}from"./chunk-LN26XMBJ.js";import{b as R,d as h}from"./chunk-ABYM5HWA.js";import{B as J,G as Be,K as xe,L as Ve,O as We,V as ze,b as ve,c as A,e as G,f as k,i as Ae,j as w,l as Ge,o as B,q as x,r as V,s as ke,t as W,u as z,z as we}from"./chunk-RPUPXDQE.js";import{i as X}from"./chunk-OJ3H3ZRA.js";import{la as ie}from"./chunk-5ZSBXGHQ.js";import{$b as D,Ac as ye,B as Oe,Bc as be,Cb as g,Db as r,Eb as l,F as U,Fb as c,Fc as ae,Gc as $e,H as O,Hc as De,Jb as b,Kb as $,L as Ce,Mb as H,P as Ne,Q,Qc as le,Rc as v,Sa as d,Tb as S,Ub as T,V as fe,Vb as m,Wb as he,Xb as Pe,Zb as C,_,cb as L,ea as N,fa as f,hb as Re,i as me,kc as Ie,nc as j,o as Ee,pa as p,pc as Le,qc as Me,sc as Z,tc as ee,uc as te,x as re,xb as M,y as Fe,yb as y}from"./chunk-QONLYWYC.js";var Ue=new V,qe=()=>Ue.group({passphrase:Ue.control("")}),pe=class a{#t=_(X);#e=_(P);#o=_(h);#n=_(R);encryptionForm=this.#e.encryptionForm;creatingTemporaryBackup=p(!1);settings=p([]);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=L({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),C("submit",function(){return t.next()}),r(1,"sh-form-field")(2,"label",5),m(3,0),l(),c(4,"input",6),l(),r(5,"app-toggle-card"),b(6,7),m(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),C("click",function(){return t.back()}),S(11,2),c(12,"sh-icon"),T(),l(),r(13,"button",11),S(14,3),c(15,"sh-icon"),T(),l()()()),e&2&&(g("formGroup",t.encryptionForm),d(8),Z("options",t.settings),g("hasFreeTextSettings",!0))},dependencies:[W,w,A,G,k,B,x,Be,z,J,ne,Ye],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&&(j(0),ae(1,"bytes")),a&2){let e=D().$implicit;Le(" (",$e(1,1,e.FileSizes),") ")}}function it(a,i){a&1&&(r(0,"span",16),m(1,4),l())}function ot(a,i){if(a&1&&(r(0,"div",15),j(1),ae(2,"date"),M(3,tt,2,3),M(4,it,2,0,"span",16),l()),a&2){let e=i.$implicit;d(),Me(" ",e.Version,": ",De(2,4,e.Time,"medium")," "),d(2),y(e.FileSizes?3:-1),d(),y(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),m(2,5),l(),c(3,"input",18),l()),a&2){let e=D(2);g("rootPaths",e.rootPaths())("initialNodes",e.initialNodes())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)}}function rt(a,i){if(a&1){let e=H();r(0,"sh-select",12),C("cleared",function(){N(e);let o=D();return f(o.abortLoading())}),r(1,"input",13),te("ngModelChange",function(o){N(e);let n=D();return ee(n.selectOption,o)||(n.selectOption=o),f(o)}),l(),Re(2,ot,5,7,"ng-template"),l(),M(3,nt,1,0,"sh-progress-bar",8),M(4,st,4,5,"app-file-tree",14)}if(a&2){let e=D();g("options",e.versionOptions())("isClearable",!1),d(),Z("ngModel",e.selectOption),g("ngModelOptions",be(6,Ze)),d(2),y(e.isRepairing()||e.versionOptionsLoading()||e.loadingRootPath()?3:-1),d(),y(e.showFileTree()?4:-1)}}var ue=new V,Ke=()=>ue.group({filesToRestore:ue.control(""),passphrase:ue.control(null)}),de=class a{#t=_(X);#e=_(P);#o=_(Xe);#n=_(oe);#i=_(h);#s=_(R);#l=_(ie);#a=null;#_=null;#r=p([]);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=p(!1);backupSettings=p(null);rootPaths=p([]);initialNodes=p([]);loadingRootPath=p(!1);isRepairing=le(()=>this.#r().length>0);loadedVersions=p({});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(K=>K.Version===parseInt(e))?.Time??null;if(!s)return;let u=`${i}+${s}`,F=o[u];if(this.needsDatabaseRepair()&&(!F||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.#_===n||(this.#_=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.#_=null})).subscribe(s=>{let u=s.ID;this.#o.waitForTaskToComplete(u).pipe(U(1)).subscribe(()=>{this.#r.update(F=>F.filter(I=>I!==n)),this.loadedVersions.update(F=>(F[n]=!0,F))})})}});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 me;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=L({type:a,selectors:[["app-select-files"]],features:[ye([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=H();r(0,"form",6,0),C("submit",function(){return N(o),f(t.next())}),r(2,"h3",7),m(3,1),l(),M(4,et,1,0,"sh-progress-bar",8)(5,rt,5,7),r(6,"div",9)(7,"button",10),C("click",function(){return N(o),f(t.back())}),S(8,2),c(9,"sh-icon"),T(),l(),r(10,"button",11),S(11,3),c(12,"sh-icon"),T(),l()()()}e&2&&(g("formGroup",t.selectFilesForm),d(4),y(t.versionOptionsLoading()?4:5),d(5),he(t.isFileRestore()?"Back":"Exit"),Pe(8))},dependencies:[ke,w,A,G,k,Ae,W,B,x,se,J,z,We,xe,ie,Je],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.partial[_ngcontent-%COMP%]{color:var(--base-9);font-style:italic}"],changeDetection:0})};var P=class a{#t=_(h);#e=_(R);#o=_(oe);#n=_(we);#i=_(X);backupId=p(null);backup=p(null);destinationTargetUrl=p(null);selectFilesForm=Ke();optionsForm=Qe();encryptionForm=qe();optionsFormSignal=_e(this.optionsForm.valueChanges);selectFilesFormSignal=_e(this.selectFilesForm.valueChanges);selectOption=p(null);versionOptionsLoading=p(!1);versionOptions=p([]);isSubmitting=p(!1);isFileRestore=p(!1);isFullWidthPage=p(!1);#s=p("");#l=p(null);#a=null;testSignal=this.#s.asReadonly();testErrorMessage=this.#l.asReadonly();#_=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(q,{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(q,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:i=>{i&&(this.#p(),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?Ee(()=>t):Fe(1e3).pipe(Ne(()=>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(U(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(q,{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(q,{data:{title:$localize`Failed to load backup filesets`,message:u,confirmText:$localize`OK`,cancelText:void 0},closed:F=>{this.#t.navigate([o?"/restore-from-files/encryption":"/restore-from-files/destination"])}})}}):re([this.#i.getApiV1BackupById({id:e}),this.#i.getApiV1BackupByIdFilesets({id:e}).pipe(Ce(3))]).pipe(U(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)}})}#p(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||a)};static \u0275prov=fe({token:a,factory:a.\u0275fac,providedIn:"root"})};var Y=new V,Qe=()=>Y.group({restoreFrom:Y.control("orignal"),restoreFromPath:Y.control(""),handleExisting:Y.control("overwrite"),permissions:Y.control(!1),includeMetadata:Y.control(!0)}),Se=class a{#t=_(P);#e=_(h);#o=_(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=L({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 F;F=$localize`Metadata settings`;let I;I=$localize` Restore file metadata ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let K;K=$localize` Restore read/write permissions ${"\uFFFD#34\uFFFD\uFFFD/#34\uFFFD"}:TAG_INPUT:`;let Te;Te=$localize`${"\uFFFD#38\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let ge;return ge=$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,F,I,K,Te,ge,[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=H();r(0,"form",13,0),C("submit",function(){return N(o),f(t.submit())}),r(2,"h3",14),m(3,1),l(),r(4,"app-toggle-card",15),b(5,16),m(6,2),$(),r(7,"sh-radio",17),S(8,3),c(9,"input",18),T(),l(),r(10,"sh-radio",17),S(11,4),c(12,"input",19),T(),l(),r(13,"app-file-tree",20)(14,"label",21),j(15,"Path"),l(),c(16,"input",22),l()(),r(17,"app-toggle-card",15),b(18,16),m(19,5),$(),r(20,"sh-radio",17),S(21,6),c(22,"input",23),T(),l(),r(23,"sh-radio",17),S(24,7),c(25,"input",24),T(),l()(),r(26,"app-toggle-card"),b(27,16),m(28,8),$(),r(29,"sh-toggle",25),S(30,9),c(31,"input",26),T(),l(),r(32,"sh-toggle",25),S(33,10),c(34,"input",27),T(),l()(),r(35,"div",28)(36,"button",29),C("click",function(){return N(o),f(t.goBack())}),S(37,11),c(38,"sh-icon"),T(),l(),r(39,"button",30),S(40,12),c(41,"sh-icon"),T(),l()()()}if(e&2){let o;g("formGroup",t.optionsForm),d(4),g("disallowToggle",!0),d(9),g("disabled",((o=t.optionsFormSignal())==null?null:o.restoreFrom)!=="pickLocation")("enableCreateFolder",!0),d(4),g("disallowToggle",!0),d(22),Ie("loader",t.isSubmitting())}},dependencies:[W,w,A,ve,Ge,G,k,B,x,ne,se,ze,Ve,J,z],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,Se as b,qe as c,pe as d,Ke as e,de as f,P as g};