@duplicati/ngclient 0.0.225 → 0.0.226

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 (100) hide show
  1. package/assets/images/backup-from-config.png +0 -0
  2. package/assets/images/backup-from-remote.png +0 -0
  3. package/{chunk-KZYRTI62.js → chunk-3GE3OWQF.js} +1 -1
  4. package/{chunk-6DX35WDO.js → chunk-47XLDVIW.js} +1 -1
  5. package/chunk-4V3AE4ZE.js +1 -0
  6. package/chunk-5IK3XXXK.js +1 -0
  7. package/chunk-66KSIF26.js +1 -0
  8. package/chunk-6A42WZTO.js +1 -0
  9. package/{chunk-VTOEFKZG.js → chunk-6GUEHKCO.js} +1 -1
  10. package/chunk-6JZ257HD.js +1 -0
  11. package/{chunk-EXAZ4QZR.js → chunk-6LQMQH6Z.js} +1 -1
  12. package/{chunk-PDZNQW6F.js → chunk-6RZVYDJF.js} +1 -1
  13. package/chunk-75ULGSKP.js +1 -0
  14. package/chunk-A2BMFFEA.js +1 -0
  15. package/{chunk-OYU6OBKA.js → chunk-A6LVKRWD.js} +1 -1
  16. package/chunk-AOPTGCDG.js +2 -0
  17. package/chunk-AU25JBCN.js +11 -0
  18. package/chunk-DCBSWJWZ.js +1 -0
  19. package/{chunk-OSGHJCUU.js → chunk-DHJS5K3Y.js} +1 -1
  20. package/{chunk-PNRFCYAE.js → chunk-DPQTEDTG.js} +1 -1
  21. package/{chunk-NE255HQN.js → chunk-EY7DOUFA.js} +1 -1
  22. package/{chunk-4ISFDBI3.js → chunk-FUF6MJKB.js} +1 -1
  23. package/{chunk-JNZJE3GC.js → chunk-FXUIGUFS.js} +1 -1
  24. package/chunk-G4QGXDP5.js +1 -0
  25. package/{chunk-AR5SEBWX.js → chunk-GDKT3FJR.js} +1 -1
  26. package/{chunk-N5XYG3QW.js → chunk-GO52XH3L.js} +1 -1
  27. package/{chunk-P2EIEVFT.js → chunk-GULHHZTR.js} +1 -1
  28. package/{chunk-T7RMSUHE.js → chunk-HX3OONES.js} +1 -1
  29. package/{chunk-TXCVGOPN.js → chunk-I5OT6RKO.js} +1 -1
  30. package/{chunk-VQLI7RDY.js → chunk-JSPDZRZU.js} +1 -1
  31. package/{chunk-5UJN5SN4.js → chunk-JUESTFR6.js} +1 -1
  32. package/chunk-K3VYMXQM.js +1 -0
  33. package/chunk-KKD7OSBL.js +1 -0
  34. package/{chunk-OP7MDR2B.js → chunk-KKUFO6NZ.js} +1 -1
  35. package/{chunk-EBKOJDCT.js → chunk-KMESPAAQ.js} +1 -1
  36. package/{chunk-ZSAEIKEB.js → chunk-KYWUJWBQ.js} +1 -1
  37. package/{chunk-UIVZWXBK.js → chunk-LNE7WQZG.js} +1 -1
  38. package/{chunk-ZGQ2WCM2.js → chunk-LP2FIVE3.js} +1 -1
  39. package/{chunk-O2HQIEE4.js → chunk-LP3KCTXP.js} +1 -1
  40. package/chunk-LZIQCSZ3.js +1 -0
  41. package/chunk-M3QHK4UT.js +1 -0
  42. package/{chunk-JBX7YYME.js → chunk-MIJNCB2V.js} +1 -1
  43. package/{chunk-5QGFYH2A.js → chunk-MOOFSJSE.js} +1 -1
  44. package/chunk-MWQHWJOA.js +1 -0
  45. package/{chunk-7VQ67PEZ.js → chunk-MWY7XFWW.js} +1 -1
  46. package/{chunk-MSIH2OJ5.js → chunk-N2ZEWG3V.js} +1 -1
  47. package/{chunk-3PARK7B7.js → chunk-NDEZRDHS.js} +1 -1
  48. package/chunk-NNSH2MIZ.js +1 -0
  49. package/{chunk-POVWDK74.js → chunk-ONQFM5B7.js} +1 -1
  50. package/chunk-OVNIENWW.js +2 -0
  51. package/{chunk-NQAD2FBX.js → chunk-PKSSAQHV.js} +1 -1
  52. package/chunk-PSEMHKPR.js +1 -0
  53. package/{chunk-3V25RAVK.js → chunk-QAEOCCMO.js} +1 -1
  54. package/chunk-QMZVKUXI.js +1 -0
  55. package/{chunk-JCXT6U5P.js → chunk-QODXELJ3.js} +1 -1
  56. package/{chunk-XUCXLLB4.js → chunk-R2U3UIJI.js} +1 -1
  57. package/{chunk-TSVSMVY4.js → chunk-S5IJ4C5T.js} +1 -1
  58. package/{chunk-QW23XWNE.js → chunk-SCDXVGMX.js} +1 -1
  59. package/{chunk-3DHD6GQL.js → chunk-SCFUXVU4.js} +1 -1
  60. package/chunk-SY6UK74R.js +1 -0
  61. package/{chunk-35FMFK4I.js → chunk-TGVKMKNV.js} +1 -1
  62. package/chunk-U2QRNQWA.js +1 -0
  63. package/{chunk-YS4B2B5N.js → chunk-UHSRAJTA.js} +1 -1
  64. package/{chunk-KX3UP3HV.js → chunk-UK6C6RS4.js} +1 -1
  65. package/{chunk-PMF4FTBF.js → chunk-ULC7YKKF.js} +1 -1
  66. package/{chunk-3HYQMG65.js → chunk-UZ2BD6RF.js} +1 -1
  67. package/{chunk-G7TNRWOU.js → chunk-VCDNIRPY.js} +1 -1
  68. package/{chunk-VOXTAZLZ.js → chunk-VJ3733O4.js} +1 -1
  69. package/chunk-W7PQYY25.js +1 -0
  70. package/{chunk-A23UTI46.js → chunk-XAYQR66G.js} +1 -1
  71. package/{chunk-ZXBKGNJU.js → chunk-XCS545S6.js} +1 -1
  72. package/{chunk-TWWAK5M6.js → chunk-XJUQUKBN.js} +1 -1
  73. package/chunk-XKDNDQVK.js +1 -0
  74. package/chunk-YQ5IJ3RD.js +1 -0
  75. package/{chunk-E4CYVUYG.js → chunk-ZFV3MK5Y.js} +1 -1
  76. package/chunk-ZUMHFNEV.js +1 -0
  77. package/index.html +1 -1
  78. package/main-RCWMFMBQ.js +1 -0
  79. package/package.json +1 -1
  80. package/chunk-2EX5HS5X.js +0 -1
  81. package/chunk-5FQ7HESA.js +0 -1
  82. package/chunk-6WX2UOAN.js +0 -1
  83. package/chunk-EVEI25GQ.js +0 -2
  84. package/chunk-GKAMSAN5.js +0 -1
  85. package/chunk-HS3UDQIJ.js +0 -1
  86. package/chunk-IDJ52K34.js +0 -1
  87. package/chunk-ITN4L52Q.js +0 -1
  88. package/chunk-J7GH3G72.js +0 -1
  89. package/chunk-KGK4RY3J.js +0 -1
  90. package/chunk-KNSQLQC6.js +0 -1
  91. package/chunk-KUNX5APQ.js +0 -1
  92. package/chunk-LXTSZI4K.js +0 -1
  93. package/chunk-MKI54WTC.js +0 -1
  94. package/chunk-NUV5LHQV.js +0 -1
  95. package/chunk-O2L2FRYE.js +0 -11
  96. package/chunk-TV7OB7Y4.js +0 -1
  97. package/chunk-UNQKMTFM.js +0 -1
  98. package/chunk-VZNLMGYP.js +0 -2
  99. package/chunk-Y47NRSCA.js +0 -1
  100. package/main-S64CL44W.js +0 -1
@@ -0,0 +1,11 @@
1
+ import{a as kn,b as jt,c as Vn}from"./chunk-PNQ5BDQN.js";import{a as ke,b as wt,c as Gt,d as Un}from"./chunk-DCBSWJWZ.js";import{a as Mn,b as xn,c as Rn,d as Ln,e as Xe,g as Lt,h as bn,i as wn,j as bt,l as Gn,m as $n,n as vn}from"./chunk-OVNIENWW.js";import{b as On}from"./chunk-3GE3OWQF.js";import{a as Rt}from"./chunk-S5IJ4C5T.js";import{a as Ht,b as Ue,c as Pn}from"./chunk-2KD757N6.js";import{a as ae}from"./chunk-PEOYNJJM.js";import{a as Ce}from"./chunk-MWQHWJOA.js";import{B as q,C as yn,E as At,F as An,H as ue,K as Ye,L as It,O as Pt,P as $e,V as Ot,W as ve,Y as Mt,a as En,b as hn,c as Y,d as St,e as Z,f as ft,h as Nn,i as ne,j as Et,k as ht,n as Fn,o as Dn,p as Nt,q as Ft,r as Dt,s as ie,t as Qe,v as ee,w as yt,z as Ge}from"./chunk-CJKZ27FM.js";import{c as In,d as xt}from"./chunk-4V3AE4ZE.js";import{b as qe,d as we,e as fn}from"./chunk-CQJRBQ6I.js";import{aa as Sn}from"./chunk-YF6JHIN5.js";import{$ as M,$c as Le,Ac as Tn,B as cn,Bb as fe,Bc as Ie,Cb as Ee,Cc as se,Db as u,Dc as me,Eb as l,Ec as Tt,F as un,Fb as r,G as Be,Gb as O,Kb as pe,Kc as Je,Lb as de,M as ct,Mb as re,Nb as I,O as pn,P as mn,Q as ut,Qa as pt,R as gn,Rc as P,Ta as _,Ub as x,Vb as R,W as De,Wb as D,Wc as Fe,Xc as w,Ya as mt,Yc as Pe,Zb as Ke,_b as T,a as sn,ac as s,bc as je,cc as he,ea as S,f as dt,fa as f,hb as K,hc as ye,ia as He,ic as Ae,jc as te,kc as Ct,l as Ve,lc as Ne,mb as H,oc as p,pb as Cn,pc as Wt,q as ot,qa as h,qc as V,rc as at,sa as j,tc as v,uc as $,vc as U,w as _n,wb as gt,wc as ce,xb as g,xc as Q,y as dn,yb as C,yc as E,zb as Se}from"./chunk-K5XGRFWJ.js";import{a as W,b as le}from"./chunk-7CGTOI24.js";var $t=class i{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||i)};static \u0275prov=De({token:i,factory:i.\u0275fac,providedIn:"root"})};function lt(i){if(Cn(i))return i();if(Array.isArray(i))return i.map(t=>lt(t));if(typeof i=="object"&&i!==null){let t={};for(let e in i)i.hasOwnProperty(e)&&(t[e]=lt(i[e]));return t}return i}var Wn=i=>i;function Bn(i,t){let e=mn(i,Wn,t?.equal),n=e[sn],o=e;return o.set=a=>{let d=e();return ut(n,a),()=>{ut(n,d)}},o.update=a=>{let d=e();return gn(n,a),()=>{ut(n,d)}},e}var Ze=class i{#e=M(In);isSaving=h(!1);resourceDestinations=Pn({stream:()=>this.#e.getApiV2ConnectionStrings()});destinations=Bn(()=>{let t=this.resourceDestinations.value()?.Data;return t||[]});save(t,e){return this.isSaving.set(!0),e.Description="",(t==="new"?this.#e.postApiV2ConnectionStrings({requestBody:e}):this.#e.putApiV2ConnectionStringById({id:t.ID,requestBody:e})).pipe(Be(()=>{this.isSaving.set(!1)}))}getById(t){return this.#e.getApiV2ConnectionStringById({id:t})}delete(t){return this.#e.deleteApiV2ConnectionStringById({id:t})}reload(){this.resourceDestinations.reload()}updateBackups(t,e){return this.#e.postApiV2ConnectionStringByIdUpdateBackups({id:t,requestBody:{BackupIDs:e}})}static \u0275fac=function(e){return new(e||i)};static \u0275prov=De({token:i,factory:i.\u0275fac,providedIn:"root"})};function Hn(i,t){if(i&1){let e=I();l(0,"div",26)(1,"sh-form-field")(2,"label",27),D(3,7),r(),l(4,"input",28,0),U("ngModelChange",function(o){S(e);let a=s(2);return $(a.scheduleFields.nextTime.time,o)||(a.scheduleFields.nextTime.time=o),f(o)}),r(),l(6,"sh-icon",29),p(7,"clock"),r()(),l(8,"sh-datepicker-input",30)(9,"label",31),p(10,"\xA0"),r(),l(11,"input",32,1),U("ngModelChange",function(o){S(e);let a=s(2);return $(a.scheduleFields.nextTime.date,o)||(a.scheduleFields.nextTime.date=o),f(o)}),r(),l(13,"sh-icon",29),p(14,"calendar"),r()()(),l(15,"div",26)(16,"sh-form-field")(17,"label",33),D(18,8),r(),l(19,"input",34),U("ngModelChange",function(o){S(e);let a=s(2);return $(a.scheduleFields.runAgain.repeatValue,o)||(a.scheduleFields.runAgain.repeatValue=o),f(o)}),r()(),l(20,"sh-select",35)(21,"input",36),U("ngModelChange",function(o){S(e);let a=s(2);return $(a.scheduleFields.runAgain.repeatUnit,o)||(a.scheduleFields.runAgain.repeatUnit=o),f(o)}),r()()(),l(22,"sh-toggle-card",37),pe(23,38),D(24,9),de(),l(25,"div",39)(26,"sh-toggle",24),x(27,10),l(28,"input",25),U("ngModelChange",function(o){S(e);let a=s(2);return $(a.scheduleFields.runAgain.allowedDays.mon,o)||(a.scheduleFields.runAgain.allowedDays.mon=o),f(o)}),r(),R(),r(),l(29,"sh-toggle",24),x(30,11),l(31,"input",25),U("ngModelChange",function(o){S(e);let a=s(2);return $(a.scheduleFields.runAgain.allowedDays.tue,o)||(a.scheduleFields.runAgain.allowedDays.tue=o),f(o)}),r(),R(),r(),l(32,"sh-toggle",24),x(33,12),l(34,"input",25),U("ngModelChange",function(o){S(e);let a=s(2);return $(a.scheduleFields.runAgain.allowedDays.wed,o)||(a.scheduleFields.runAgain.allowedDays.wed=o),f(o)}),r(),R(),r(),l(35,"sh-toggle",24),x(36,13),l(37,"input",25),U("ngModelChange",function(o){S(e);let a=s(2);return $(a.scheduleFields.runAgain.allowedDays.thu,o)||(a.scheduleFields.runAgain.allowedDays.thu=o),f(o)}),r(),R(),r(),l(38,"sh-toggle",24),x(39,14),l(40,"input",25),U("ngModelChange",function(o){S(e);let a=s(2);return $(a.scheduleFields.runAgain.allowedDays.fri,o)||(a.scheduleFields.runAgain.allowedDays.fri=o),f(o)}),r(),R(),r(),l(41,"sh-toggle",24),x(42,15),l(43,"input",25),U("ngModelChange",function(o){S(e);let a=s(2);return $(a.scheduleFields.runAgain.allowedDays.sat,o)||(a.scheduleFields.runAgain.allowedDays.sat=o),f(o)}),r(),R(),r(),l(44,"sh-toggle",24),x(45,16),l(46,"input",25),U("ngModelChange",function(o){S(e);let a=s(2);return $(a.scheduleFields.runAgain.allowedDays.sun,o)||(a.scheduleFields.runAgain.allowedDays.sun=o),f(o)}),r(),R(),r()()()}if(i&2){let e=s(2);_(4),v("ngModel",e.scheduleFields.nextTime.time),_(7),v("ngModel",e.scheduleFields.nextTime.date),_(8),v("ngModel",e.scheduleFields.runAgain.repeatValue),_(),u("options",e.unitOptions)("isClearable",!1),_(),v("ngModel",e.scheduleFields.runAgain.repeatUnit),_(),u("disableToggle",!0),_(6),v("ngModel",e.scheduleFields.runAgain.allowedDays.mon),_(3),v("ngModel",e.scheduleFields.runAgain.allowedDays.tue),_(3),v("ngModel",e.scheduleFields.runAgain.allowedDays.wed),_(3),v("ngModel",e.scheduleFields.runAgain.allowedDays.thu),_(3),v("ngModel",e.scheduleFields.runAgain.allowedDays.fri),_(3),v("ngModel",e.scheduleFields.runAgain.allowedDays.sat),_(3),v("ngModel",e.scheduleFields.runAgain.allowedDays.sun)}}function jn(i,t){if(i&1){let e=I();l(0,"div",23)(1,"sh-toggle",24),x(2,5),l(3,"input",25),U("ngModelChange",function(o){S(e);let a=s();return $(a.scheduleFields.autoRun,o)||(a.scheduleFields.autoRun=o),f(o)}),r(),R(),r(),l(4,"p"),D(5,6),r()(),g(6,Hn,47,14)}if(i&2){let e=s();_(3),v("ngModel",e.scheduleFields.autoRun),_(3),C(e.scheduleFields.autoRun()?6:-1)}}var qn=[{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`}],vt=[{key:$localize`Daily 13:00`,value:"daily",data:{autoRun:!0,nextTime:{time:"13:00:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!0,sun:!0}}}},{key:$localize`Weekdays 13:00`,value:"weekdays",data:{autoRun:!0,nextTime:{time:"13:00:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!1,sun:!1}}}},{key:$localize`Weekly monday 13:00`,value:"weekly",data:{autoRun:!0,nextTime:{time:"13:00:00",date:Qn().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"W",allowedDays:{mon:!0,tue:!1,wed:!1,thu:!1,fri:!1,sat:!1,sun:!1}}}},{key:$localize`Don't run automatically`,value:"disabled",data:{autoRun:!1,nextTime:{time:"13:00:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!0,sun:!0}}}},{key:$localize`Custom`,value:"custom",data:{autoRun:!0,nextTime:{time:"13:00:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!0,sun:!0}}}}];function Kn(i){if(!i.autoRun)return null;let t=[i.runAgain.allowedDays.mon?"Monday":null,i.runAgain.allowedDays.tue?"Tuesday":null,i.runAgain.allowedDays.wed?"Wednesday":null,i.runAgain.allowedDays.thu?"Thursday":null,i.runAgain.allowedDays.fri?"Friday":null,i.runAgain.allowedDays.sat?"Saturday":null,i.runAgain.allowedDays.sun?"Sunday":null].filter(d=>d!==null),e=i.nextTime.time.split(":"),n=new Date(i.nextTime.date);n.setHours(parseInt(e[0])),n.setMinutes(parseInt(e[1]));let o=i.runAgain.repeatValue,a=i.runAgain.repeatUnit;return{Time:n.toISOString(),Repeat:`${o}${a}`,AllowedDays:t}}function Qn(){let i=new Date,t=i.getDay(),e=t===1?7:(8-t)%7;return i.setDate(i.getDate()+e),i.setHours(12,0,0,0),i}var Qt=()=>({autoRun:h(!0),nextTime:{time:h("13:00"),date:h(new Date().toISOString().split("T")[0])},runAgain:{repeatValue:h(1),repeatUnit:h("D"),allowedDays:{mon:h(!0),tue:h(!0),wed:h(!0),thu:h(!0),fri:h(!0),sat:h(!0),sun:h(!0)}}}),qt=class i{#e=M(Oe);#t=M(we);#n=M(qe);unitOptions=qn;scheduleFields=this.#e.scheduleFields;scheduleType=this.#e.scheduleType;scheduleOptions=vt;updateScheduleType(t){let e=vt.find(n=>n.value===t);if(e&&e?.value!=="custom"){this.scheduleType.set(e.value);let n=e.data;this.scheduleFields.autoRun.set(n.autoRun??!1),this.scheduleFields.nextTime.time.set(n.nextTime?.time??"13:00"),this.scheduleFields.nextTime.date.set(n.nextTime?.date??new Date().toISOString().split("T")[0]),this.scheduleFields.runAgain.repeatValue.set(n.runAgain?.repeatValue??1),this.scheduleFields.runAgain.repeatUnit.set(n.runAgain?.repeatUnit??"D"),this.scheduleFields.runAgain.allowedDays.mon.set(n.runAgain?.allowedDays?.mon??!0),this.scheduleFields.runAgain.allowedDays.tue.set(n.runAgain?.allowedDays?.tue??!0),this.scheduleFields.runAgain.allowedDays.wed.set(n.runAgain?.allowedDays?.wed??!0),this.scheduleFields.runAgain.allowedDays.thu.set(n.runAgain?.allowedDays?.thu??!0),this.scheduleFields.runAgain.allowedDays.fri.set(n.runAgain?.allowedDays?.fri??!0),this.scheduleFields.runAgain.allowedDays.sat.set(n.runAgain?.allowedDays?.sat??!0),this.scheduleFields.runAgain.allowedDays.sun.set(n.runAgain?.allowedDays?.sun??!0)}else this.scheduleType.set("custom")}goBack(){this.#t.navigate(["source-data"],{relativeTo:this.#n.parent})}next(){this.#e.shouldAutoSave()&&this.#e.submit(!0),this.#t.navigate(["options"],{relativeTo:this.#n.parent})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=K({type:i,selectors:[["app-schedule"]],decls:12,vars:4,consts:()=>{let t;t=$localize`Select an option...`;let e;e=$localize`Schedule`;let n;n=$localize`${"\uFFFD#8\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let a;a=$localize` Automatically run backups ${"\uFFFD#3\uFFFD\uFFFD/#3\uFFFD"}:TAG_INPUT:`;let d;d=$localize`If a date was missed, the job will run as soon as possible.`;let c;c=$localize`Next time`;let m;m=$localize`Run again every`;let F;F=$localize`Allowed days`;let N;N=$localize` Monday ${"\uFFFD#28\uFFFD\uFFFD/#28\uFFFD"}:TAG_INPUT:`;let A;A=$localize` Tuesday ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let L;L=$localize` Wednesday ${"\uFFFD#34\uFFFD\uFFFD/#34\uFFFD"}:TAG_INPUT:`;let k;k=$localize` Thursday ${"\uFFFD#37\uFFFD\uFFFD/#37\uFFFD"}:TAG_INPUT:`;let y;y=$localize` Friday ${"\uFFFD#40\uFFFD\uFFFD/#40\uFFFD"}:TAG_INPUT:`;let J;J=$localize` Saturday ${"\uFFFD#43\uFFFD\uFFFD/#43\uFFFD"}:TAG_INPUT:`;let X;return X=$localize` Sunday ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`,[["timeRef",""],["dateRef",""],e,n,o,a,d,c,m,F,N,A,L,k,y,J,X,[1,"title-30"],["label","key","value","value",3,"isClearable","options"],["type","text","placeholder",t,3,"ngModelChange","ngModel"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click"],[1,"toggle-wrap"],[1,"raised","primary"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"row-inputs"],["for","time"],["type","time","id","time",3,"ngModelChange","ngModel"],["suffix",""],[1,"primary","sharp"],["for","date"],["type","text","id","date",3,"ngModelChange","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,"disableToggle"],["title",""],[1,"days-wrap"]]},template:function(e,n){e&1&&(l(0,"h3",17),D(1,2),r(),l(2,"sh-select",18)(3,"input",19),T("ngModelChange",function(a){return n.updateScheduleType(a)}),r()(),g(4,jn,7,2),l(5,"div",20)(6,"button",21),T("click",function(){return n.goBack()}),x(7,3),O(8,"sh-icon"),R(),r(),l(9,"button",22),T("click",function(){return n.next()}),x(10,4),O(11,"sh-icon"),R(),r()()),e&2&&(_(2),u("isClearable",!1)("options",n.scheduleOptions),_(),u("ngModel",n.scheduleType()),_(),C(n.scheduleType()==="custom"?4:-1))},dependencies:[ie,Y,ht,hn,Z,ne,ue,ve,ee,q,$e,Ot,An],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem;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})};var Yn=[[["","title",""]],[["","description",""]],[["","action",""]],"*"],Zn=["[title]","[description]","[action]","*"];function ei(i,t){i&1&&p(0,"Title")}function ti(i,t){i&1&&(l(0,"sh-icon"),p(1,"caret-down"),r())}var ze=class i{isActive=Le(!1);disableToggle=w(!1);ngOnInit(){this.disableToggle()&&this.isActive.set(!0)}toggle(){this.isActive.set(!this.isActive())}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=K({type:i,selectors:[["app-toggle-card"]],hostVars:2,hostBindings:function(e,n){e&2&&Ne("active",n.isActive())},inputs:{isActive:[1,"isActive"],disableToggle:[1,"disableToggle"]},outputs:{isActive:"isActiveChange"},ngContentSelectors:Zn,decls:11,vars:1,consts:[[1,"title"],[3,"click"],[1,"actions"],[1,"content"]],template:function(e,n){e&1&&(je(Yn),l(0,"header")(1,"div",0)(2,"h3",1),T("click",function(){return n.disableToggle()||n.toggle()}),he(3,0,null,ei,1,0),g(5,ti,2,0,"sh-icon"),r(),he(6,1),r(),l(7,"div",2),he(8,2),r()(),l(9,"div",3),he(10,3),r()),e&2&&(_(5),C(n.disableToggle()?-1:5))},dependencies:[ee],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;border-radius:var(--shape-3);background-color:var(--base-2)}.active[_nghost-%COMP%] .content[_ngcontent-%COMP%]{max-height:1000px;transition:max-height 1s linear;padding:0 1rem 1rem}.active[_nghost-%COMP%] sh-icon[_ngcontent-%COMP%]{transform:rotate(180deg)}[_nghost-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.25rem;font:var(--paragraph-10);cursor:pointer;-webkit-user-select:none;user-select:none}[_nghost-%COMP%] sh-icon[_ngcontent-%COMP%]{transform:rotate(0);transform-origin:center;transition:transform .2s ease}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem}header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;flex:1 0}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]:empty{display:none}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0 1rem;overflow:hidden;max-height:0;transition:max-height .25s linear,padding .25s linear}.content[_ngcontent-%COMP%]:empty{display:none}"],changeDetection:0})};var ni=["textInput"];function ii(i,t){if(i&1){let e=I();l(0,"sh-select",3)(1,"input",7),U("ngModelChange",function(o){S(e);let a=s();return $(a.internalPath,o)||(a.internalPath=o),f(o)}),T("ngModelChange",function(){S(e);let o=s();return f(o.updateFilter())}),r()()}if(i&2){let e=s();u("options",e.fileGroupOptions())("isClearable",!1)("selectMultiple",!0),_(),v("ngModel",e.internalPath)}}function oi(i,t){if(i&1&&(l(0,"div",8),p(1),r()),i&2){let e,n=s(2);_(),Wt((e=n.currentExpressionOption())==null?null:e.startsWith)}}function ai(i,t){if(i&1&&(l(0,"div",9),p(1),r()),i&2){let e,n=s(2);_(),Wt((e=n.currentExpressionOption())==null?null:e.endsWith)}}function li(i,t){if(i&1){let e=I();l(0,"sh-form-field",4)(1,"input",7,0),U("ngModelChange",function(o){S(e);let a=s();return $(a.internalPath,o)||(a.internalPath=o),f(o)}),T("ngModelChange",function(){S(e);let o=s();return f(o.updateFilter())}),r(),g(3,oi,2,1,"div",8),g(4,ai,2,1,"div",9),r()}if(i&2){let e,n,o=s();_(),v("ngModel",o.internalPath),_(2),C(!((e=o.currentExpressionOption())==null||e.startsWith==null)&&e.startsWith.length?3:-1),_(),C(!((n=o.currentExpressionOption())==null||n.endsWith==null)&&n.endsWith.length?4:-1)}}var ri=[{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"}],si=[{key:"Excludes folders where name contains",value:"-FolderName"},{key:"Includes folders where name contains",value:"+FolderName"},{key:"Excludes folder",value:"-Folder"},{key:"Includes folder",value:"+Folder"},{key:"Excludes files where name contains",value:"-FileName"},{key:"Includes files where name contains",value:"+FileName"},{key:"Excludes file extension",value:"-Extension"},{key:"Include 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:"Include file groups",value:"+FileGroup"},{key:"Includes expression",value:"+Expression"},{key:"Excludes expression",value:"-Expression"},{key:"None",value:"-Unknown"}],Ut=class i{#e=M(He);path=w.required();osType=w();isNew=w(!1);pathChange=Fe();remove=Fe();internalPath=h("");pathType=h("-Expression");textInput=Pe("textInput");currentExpressionOption=P(()=>{let t=this.pathType();return this.expressionOptions().find(e=>e.value===t)});fileGroupOptions=h(ri);expressionOptions=P(()=>{let e=this.osType()==="Windows"?"\\":"/";return si.map(n=>n.value==="-Folder"||n.value==="+Folder"?le(W({},n),{startsWith:"",endsWith:""}):n.value==="-FolderName"||n.value==="+FolderName"?le(W({},n),{startsWith:"*",endsWith:`*${e}`}):n.value==="-FileName"||n.value==="+FileName"?le(W({},n),{startsWith:"[.*",endsWith:`[^\\${e}]*]`}):n.value==="-FileGroup"||n.value==="+FileGroup"?le(W({},n),{startsWith:"{",endsWith:"}"}):n.value==="-Regex"||n.value==="+Regex"?le(W({},n),{startsWith:"[",endsWith:"]"}):n.value==="-Extension"||n.value==="+Extension"?le(W({},n),{startsWith:"*.",endsWith:""}):le(W({},n),{startsWith:"",endsWith:""}))});pathEffect=j(()=>{let t=this.path(),e=t.slice(1),n=t.startsWith("-")?"-":"+",o=this.osType()==="Windows",a=o?"\\":"/";e.startsWith("%")&&e.endsWith(a)||o&&e.slice(2).startsWith(a)&&e.endsWith(a)||e.startsWith(a)&&e.endsWith(a)?(this.pathType.set(`${n}Folder`),this.internalPath.set(e)):e.startsWith("*")&&e.endsWith(`*${a}`)?(this.pathType.set(`${n}FolderName`),this.internalPath.set(e.slice(1,-2))):e.startsWith("[.*")&&e.endsWith(`[^\\${a}]*]`)?(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)),this.isNew()&&mt(()=>{this.focusInput()},{injector:this.#e})});focusInput(){let t=this.textInput()?.nativeElement;t&&(t.focus(),t.select())}updateFilter(){let t=this.internalPath(),e=this.currentExpressionOption();t!==""&&(t==="*"&&(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||i)};static \u0275cmp=K({type:i,selectors:[["app-new-filter"]],viewQuery:function(e,n){e&1&&ye(n.textInput,ni,5),e&2&&Ae()},inputs:{path:[1,"path"],osType:[1,"osType"],isNew:[1,"isNew"]},outputs:{pathChange:"pathChange",remove:"remove"},decls:7,vars:4,consts:()=>{let t;return t=$localize`Select an option...`,[["textInput",""],["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"],["boxPrefix",""],["boxSuffix",""]]},template:function(e,n){if(e&1&&(l(0,"sh-select",1)(1,"input",2),U("ngModelChange",function(a){return $(n.pathType,a)||(n.pathType=a),a}),T("ngModelChange",function(){return n.updateFilter()}),r()(),g(2,ii,2,4,"sh-select",3)(3,li,5,3,"sh-form-field",4),l(4,"div",5),T("click",function(){return n.removeFilter()}),l(5,"sh-icon",6),p(6,"x-circle"),r()()),e&2){let o;u("options",n.expressionOptions())("isClearable",!1),_(),v("ngModel",n.pathType),_(),C(((o=n.currentExpressionOption())==null?null:o.value)=="-FileGroup"||((o=n.currentExpressionOption())==null?null:o.value)=="+FileGroup"?2:3)}},dependencies:[ie,Y,Z,ne,$e,ue,ee],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 _i=["filtersContainer"],di=()=>({updateOn:"blur",standalone:!0});function ci(i,t){if(i&1){let e=I();l(0,"button",15),T("click",function(){S(e);let o=s();return f(o.addFilter())}),x(1,3),O(2,"sh-icon"),R(),r()}}function ui(i,t){i&1&&D(0,2,1)}function pi(i,t){i&1&&D(0,2,2)}function mi(i,t){i&1&&(l(0,"p",13),D(1,4),r())}function gi(i,t){i&1&&(l(0,"p",13),D(1,5),r())}function Ci(i,t){if(i&1){let e=I();l(0,"sh-form-field")(1,"textarea",16),U("ngModelChange",function(o){S(e);let a=s();return $(a.bulkFilters,o)||(a.bulkFilters=o),f(o)}),T("ngModelChange",function(){S(e);let o=s();return f(o.saveBulkFilterEdit())}),r()()}if(i&2){let e=s();_(),v("ngModel",e.bulkFilters),u("ngModelOptions",Ie(2,di))}}function Ti(i,t){if(i&1){let e=I();l(0,"app-new-filter",18),T("pathChange",function(o){let a=S(e).$index,d=s(2);return f(d.updateFilterAt(o,a))})("remove",function(){let o=S(e).$index,a=s(2);return f(a.removeFilterAt(o))}),r()}if(i&2){let e=t.$implicit,n=t.$index,o=s(2);u("path",e)("osType",o.osType())("isNew",o.lastAddedIndex()===n)}}function Si(i,t){if(i&1&&(l(0,"div",14,0),fe(2,Ti,1,3,"app-new-filter",17,Se),r()),i&2){let e=s();_(2),Ee(e.filters())}}var kt=class i{#e=M(He);filters=Le.required();osType=w("");disableToggle=w(!0);bulkFilterEditMode=h(!1);bulkFilters=h("");lastAddedIndex=h(null);filtersContainer=Pe.required("filtersContainer");hasFilters=P(()=>this.filters().length>0);toggleBulkFilterEdit(){this.bulkFilterEditMode()?this.bulkFilterEditMode.set(!1):(this.bulkFilters.set(this.filters().join(`
2
+ `)),this.bulkFilterEditMode.set(!0))}saveBulkFilterEdit(){let t=this.bulkFilters().split(`
3
+ `).map(n=>n.trim()).filter(n=>n!==""&&(n.startsWith("-")||n.startsWith("+"))),e=[...new Set(t)];this.filters.set(e),this.bulkFilterEditMode.set(!1)}addFilter(){let t=this.filters(),e=t.length;this.filters.set([...t,"-*"]),this.lastAddedIndex.set(e),mt(()=>{this.scrollToFilter(e)},{injector:this.#e})}scrollToFilter(t){let e=this.filtersContainer()?.nativeElement;if(!e)return;let n=e.querySelectorAll("app-new-filter");n[t]&&n[t].scrollIntoView({behavior:"smooth",block:"nearest"})}updateFilterAt(t,e){let o=[...this.filters()];o[e]=t,this.filters.set(o),this.lastAddedIndex.set(null)}removeFilterAt(t){let n=this.filters().filter((o,a)=>a!==t);this.filters.set(n),this.lastAddedIndex.set(null)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=K({type:i,selectors:[["app-filters"]],viewQuery:function(e,n){e&1&&ye(n.filtersContainer,_i,5),e&2&&Ae()},inputs:{filters:[1,"filters"],osType:[1,"osType"],disableToggle:[1,"disableToggle"]},outputs:{filters:"filtersChange"},decls:20,vars:5,consts:()=>{let t;t=$localize`Filters`;let e;e=$localize`${"\uFFFD#13\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#13\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD*14:1\uFFFD"}:START_BLOCK_IF: Edit contents as list ${"\uFFFD/*14:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*15:2\uFFFD"}:START_BLOCK_ELSE: Edit contents as text ${"\uFFFD/*15:2\uFFFD"}:CLOSE_BLOCK_ELSE:`;let n;n=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Add filter `;let o;o=$localize`Customize your filters.`;let a;return a=$localize`Edit filters as text, one per line.`,[["filtersContainer",""],t,e,n,o,a,[3,"disableToggle"],["title",""],[1,"spacer"],["type","button","shButton","",1,"small"],["shButton","","type","button",1,"small"],["menu",""],["shButton","","type","button",1,"small",3,"click"],["description",""],[1,"filters"],["type","button","shButton","",1,"small",3,"click"],["wrap","off","rows","10",1,"bulk-textarea",3,"ngModelChange","ngModel","ngModelOptions"],[3,"path","osType","isNew"],[3,"pathChange","remove","path","osType","isNew"]]},template:function(e,n){e&1&&(l(0,"app-toggle-card",6),pe(1,7),l(2,"span"),D(3,1),r(),O(4,"div",8),g(5,ci,3,0,"button",9),l(6,"sh-menu")(7,"button",10)(8,"sh-icon"),p(9,"dots-three-vertical"),r()(),pe(10,11),l(11,"button",12),T("click",function(){return n.toggleBulkFilterEdit()}),x(12,2),O(13,"sh-icon"),g(14,ui,1,0)(15,pi,1,0),R(),r(),de(),r(),de(),g(16,mi,2,0,"p",13)(17,gi,2,0,"p",13),g(18,Ci,2,3,"sh-form-field")(19,Si,4,0,"div",14),r()),e&2&&(u("disableToggle",n.disableToggle()),_(5),C(n.bulkFilterEditMode()?-1:5),_(9),C(n.bulkFilterEditMode()?14:15),_(2),C(n.bulkFilterEditMode()?17:16),_(2),C(n.bulkFilterEditMode()?18:19))},dependencies:[ie,Y,Z,ne,q,ee,Ye,ue,ze,Ut],styles:["[_nghost-%COMP%]{display:block}.spacer[_ngcontent-%COMP%]{flex:1}.bulk-textarea[_ngcontent-%COMP%]{width:100%;font-family:monospace;min-height:12.5rem}.filters[_ngcontent-%COMP%]{max-height:200px;overflow-y:auto;display:flex;flex-direction:column;gap:.5rem}"],changeDetection:0})};var rt=class i{data=w();closed=Fe();path=h("");isValid=P(()=>this.path().length>0);dataEffect=j(()=>{let t=this.data();t?.initialPath&&this.path.set(t.initialPath)});submit(){this.closed.emit(this.path()||null)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=K({type:i,selectors:[["app-target-disk-dialog"]],inputs:{data:[1,"data"]},outputs:{closed:"closed"},decls:11,vars:4,consts:()=>{let t;t=$localize`Path`;let e;e=$localize`Full disk source`;let n;n=$localize`Cancel`;let o;return o=$localize` Use this disk `,[e,n,o,[1,"title-30"],["content",""],[3,"customRemoteMode","destinationUrl"],["type","text","id","path","tabindex","4","placeholder",t,3,"ngModelChange","ngModel"],["footer","",1,"sticky"],["shButton","","type","button",3,"click"],["shButton","","type","button",1,"raised","primary",3,"click","disabled"]]},template:function(e,n){e&1&&(l(0,"header")(1,"h3",3),D(2,0),r()(),l(3,"section",4)(4,"app-file-tree",5)(5,"input",6),U("ngModelChange",function(a){return $(n.path,a)||(n.path=a),a}),r()()(),l(6,"footer",7)(7,"button",8),T("click",function(){return n.closed.emit(null)}),D(8,1),r(),l(9,"button",9),T("click",function(){return n.submit()}),D(10,2),r()()),e&2&&(_(4),u("customRemoteMode","diskimage")("destinationUrl","diskimage://"),_(),v("ngModel",n.path),_(4),u("disabled",!n.isValid()))},dependencies:[q,ke,ie,Y,Z,ne],styles:["[_nghost-%COMP%]{--dialog-p: 1.5rem;display:flex;flex-direction:column;gap:1rem}header[_ngcontent-%COMP%]{display:flex;padding:1.5rem 1.5rem 0}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}footer[_ngcontent-%COMP%]{z-index:1}"],changeDetection:0})};var fi=[[["","displayName",""]],[["","description",""]],"*"],Ei=["[displayName]","[description]","*"];function hi(i,t){if(i&1&&p(0),i&2){s(2);let e=E(1);V(" ",e.Name," ")}}function Ni(i,t){if(i&1&&p(0),i&2){s(2);let e=E(0);V(" ",e.displayName," ")}}function Fi(i,t){i&1&&(l(0,"sh-chip",6),p(1,"Untested"),r())}function Di(i,t){i&1&&(l(0,"sh-chip",6),p(1,"Special"),r())}function yi(i,t){i&1&&(l(0,"sh-chip",7),p(1,"Deprecated"),r())}function Ai(i,t){if(i&1&&p(0),i&2){s();let e=E(16);V(" ",e," ")}}function Ii(i,t){if(i&1&&p(0),i&2){s(2);let e=E(0);V(" ",e.description," ")}}function Pi(i,t){if(i&1&&(l(0,"sh-card",0)(1,"div",1),O(2,"img",2),r(),l(3,"div",3)(4,"div",4),he(5),r(),l(6,"div",5),g(7,hi,1,1)(8,Ni,1,1),g(9,Fi,2,0,"sh-chip",6)(10,Di,2,0,"sh-chip",6)(11,yi,2,0,"sh-chip",7),r()(),l(12,"div",8)(13,"div",4),he(14,1),r(),l(15,"div",5),ce(16),g(17,Ai,1,1)(18,Ii,1,1),r()(),l(19,"div",9),he(20,2),r()()),i&2){let e=s(),n=E(0),o=E(1);u("variant",e.variant()),_(2),u("src",n.icon,pt),gt("alt",n.displayName),_(5),C(o&&o.Name?7:8),_(2),C((n.sortOrder??0)==-3?9:(n.sortOrder??0)==-2?10:(n.sortOrder??0)<0?11:-1),_(7);let a=Q(e.getSimplePath(o==null?null:o.BaseUrl));_(),C(a&&a.length>0?17:18)}}var et=class i{destination=w();targetUrl=w();variant=w("type-b");connectionStringId=w();#e=M(Ze);connectionString=P(()=>{let t=this.connectionStringId();return t==null?null:this.#e.destinations().find(e=>e.ID===t)});selectedDestinationType=P(()=>{let t=this.targetUrl();return t?Xe(t)??null:null});destinationFromTargetUrl=P(()=>{let t=this.selectedDestinationType();return t?{key:t.customKey??t.key,customKey:t.customKey??null,displayName:t.displayName,description:t.description,icon:t.icon}:null});destinationItem=P(()=>{let t=this.destination(),e=this.destinationFromTargetUrl();return t||e||null});getSimplePath(t){return t?xn(t):""}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=K({type:i,selectors:[["app-destination-list-item"]],inputs:{destination:[1,"destination"],targetUrl:[1,"targetUrl"],variant:[1,"variant"],connectionStringId:[1,"connectionStringId"]},ngContentSelectors:Ei,decls:3,vars:3,consts:[[3,"variant"],[1,"icon"],[3,"src"],[1,"name"],[1,"projected"],[1,"default"],[1,"small","simple","primary"],[1,"small","simple","warn"],[1,"description"],[1,"actions"]],template:function(e,n){if(e&1&&(je(fi),ce(0)(1),g(2,Pi,21,7,"sh-card",0)),e&2){let o=Q(n.destinationItem());_(),Q(n.connectionString()),_(),C(o?2:-1)}},dependencies:[yn,At],styles:['[_nghost-%COMP%]{display:block;border-radius:var(--shape-3)}[_nghost-%COMP%]:focus-visible{outline:2px solid var(--primary-8);outline-offset:2px}sh-card[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:3rem 1fr auto;grid-template-areas:"icon name actions" "icon description actions";gap:.25rem 1rem}sh-card[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{grid-area:icon;display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:var(--shape-2)}sh-card[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{object-fit:contain;width:100%;border-radius:var(--shape-2);overflow:hidden}sh-card[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{grid-area:name;font:var(--paragraph-10)}sh-card[_ngcontent-%COMP%] .name[_ngcontent-%COMP%] .projected[_ngcontent-%COMP%]:empty{display:none}sh-card[_ngcontent-%COMP%] .name[_ngcontent-%COMP%] .projected[_ngcontent-%COMP%]:not(:empty) + .default[_ngcontent-%COMP%]{display:none}sh-card[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{grid-area:description;color:var(--base-8)}sh-card[_ngcontent-%COMP%] .description[_ngcontent-%COMP%] .projected[_ngcontent-%COMP%]:empty{display:none}sh-card[_ngcontent-%COMP%] .description[_ngcontent-%COMP%] .projected[_ngcontent-%COMP%]:not(:empty) + .default[_ngcontent-%COMP%]{display:none}sh-card[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{grid-area:actions;display:flex;align-items:center;gap:.5rem}'],changeDetection:0})};var tt=class i{#e=M(Ce);#t(t){return t.flatMap(e=>{if(!e?.Key)return null;let n=bn(e.Key);if(n.length<=1){let o=Lt(e.Key);return o.isDefaultEntry===!0?[le(W({},o),{displayName:e.DisplayName||o.displayName||e.Key,description:e.Description||o.description||""})]:o}else return n}).filter(e=>e!==null)}#n(t){return t.map(e=>({key:e.customKey??e.key,customKey:e.customKey??null,displayName:e.displayName,description:e.description,icon:e.icon,searchTerms:[e.displayName,e.description,e.key,e.searchTerms??"",e.customKey??""].join(" "),sortOrder:e.sortOrder??0}))}backendDestinationOptions=P(()=>{let t=this.#e.backendModules(),e=this.#t(t);return this.#n(e)});sourceProviderOptions=P(()=>{let t=this.#e.sourceProviderModules(),e=this.#t(t.length?t:this.#e.backendModules());return this.#n(e)});restoreDestinationOptions=P(()=>{let t=this.#e.restoreDestinationProviderModules(),e=this.#t(t.length?t:this.#e.backendModules());return this.#n(e)});destinationTypeOptions=this.backendDestinationOptions;allModules=P(()=>[...this.#e.backendModules(),...this.#e.sourceProviderModules(),...this.#e.restoreDestinationProviderModules()].reduce((t,e)=>(t.find(n=>n.Key===e.Key)||t.push(e),t),[]));static \u0275fac=function(e){return new(e||i)};static \u0275prov=De({token:i,factory:i.\u0275fac,providedIn:"root"})};function Oi(i,t){if(i&1){let e=I();l(0,"app-destination-list-item",7),T("click",function(){let o=S(e).$implicit,a=s();return f(a.setDestination.emit(o.customKey??o.key))})("keydown.enter",function(o){return o.target.click()})("keydown.space",function(o){return o.target.click()}),l(1,"button",8),x(2,1),O(3,"sh-icon"),R(),r()()}if(i&2){let e=t.$implicit;u("destination",e)}}var Vt=class i{#e=M(tt);#t=M(Ce);showAsSources=w(!1);moduleType=w("Backend");setDestination=Fe();destinationSearchTerm=h("");showAllDestinations=h(!1);destinationTypeOptions=P(()=>{switch(this.moduleType()){case"SourceProvider":return this.#e.sourceProviderOptions();case"RestoreDestinationProvider":return this.#e.restoreDestinationOptions();default:return this.#e.backendDestinationOptions()}});destinationTypeOptionsFocused=P(()=>{let t=this.#t.backendModules(),e=this.destinationTypeOptions().map(d=>{let c=t.find(m=>m.Key==d.key);return c&&(d=le(W({},d),{sortOrder:c.IsDeprecated?-1:c.IsUntested?-3:d.sortOrder})),d}),n=this.destinationSearchTerm().toLowerCase(),o=this.showAllDestinations(),a=[...e].sort((d,c)=>{let m=d.sortOrder??0,F=c.sortOrder??0;return m!==F?F-m:d.displayName.localeCompare(c.displayName)}).filter(d=>{if(o)return!0;let c=d.sortOrder??0;return c<0&&n?.length&&(d.key.toLocaleLowerCase()===n.toLocaleLowerCase()||d.customKey?.toLocaleLowerCase()===n.toLocaleLowerCase())?!0:c>=0});return n?a.filter(d=>d.searchTerms.toLowerCase().includes(n)):a});static \u0275fac=function(e){return new(e||i)};static \u0275cmp=K({type:i,selectors:[["app-destination-list"]],inputs:{showAsSources:[1,"showAsSources"],moduleType:[1,"moduleType"]},outputs:{setDestination:"setDestination"},decls:8,vars:2,consts:()=>{let t;t=$localize`Search for destination...`;let e;e=$localize`Show all`;let n;return n=$localize` Choose ${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON:`,[e,n,[1,"search-area"],["type","text","placeholder",t,3,"ngModelChange","ngModel"],[1,"raised","primary",3,"checkedChange","checked"],[1,"list"],["tabindex","0",3,"destination"],["tabindex","0",3,"click","keydown.enter","keydown.space","destination"],["shButton","","tabindex","-1","type","button"]]},template:function(e,n){e&1&&(l(0,"div",2)(1,"sh-form-field")(2,"input",3),U("ngModelChange",function(a){return $(n.destinationSearchTerm,a)||(n.destinationSearchTerm=a),a}),r()(),l(3,"sh-toggle",4),U("checkedChange",function(a){return $(n.showAllDestinations,a)||(n.showAllDestinations=a),a}),D(4,0),r()(),l(5,"div",5),fe(6,Oi,4,1,"app-destination-list-item",6,Se),r()),e&2&&(_(2),v("ngModel",n.destinationSearchTerm),_(),v("checked",n.showAllDestinations),_(3),Ee(n.destinationTypeOptionsFocused()))},dependencies:[et,ie,Y,Z,ne,ue,q,ee,ve],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:hidden;padding:.25rem;min-height:250px}.list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:auto;padding:.25rem .375rem 1rem;width:calc(100% + .5rem);margin-left:-.375rem;border-bottom:.0625rem solid var(--base-4)}.search-area[_ngcontent-%COMP%]{display:flex;flex-direction:row;gap:1rem}"],changeDetection:0})};var Mi=["fileInput"],xi=[[["label"]]],Ri=["label"],Bt=class i{customId=w();content=h("");readonly=h(!1);placeholder=w($localize`Drop a file here or use the browse button`);fileInputRef=Pe("fileInput");onFileSelected(t){let e=t.target;e.files&&e.files.length>0&&this.readFile(e.files[0])}onFileDrop(t){t.preventDefault(),t.dataTransfer?.files&&t.dataTransfer.files.length>0&&this.readFile(t.dataTransfer.files[0])}onDragOver(t){t.preventDefault()}readFile(t){let e=new FileReader;e.onload=()=>{this.content.set(e.result)},e.readAsText(t)}triggerBrowse(){return this.fileInputRef()?.nativeElement.click(),!1}onChange=()=>{};onTouched=()=>{};onChangeEffect=j(()=>{this.onChange(this.content())});writeValue(t){this.content.set(t??"")}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.readonly.set(t)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=K({type:i,selectors:[["app-file-drop-textarea"]],viewQuery:function(e,n){e&1&&ye(n.fileInputRef,Mi,5),e&2&&Ae()},inputs:{customId:[1,"customId"],placeholder:[1,"placeholder"]},features:[Tn([{provide:En,useExisting:i,multi:!0}])],ngContentSelectors:Ri,decls:9,vars:3,consts:[["fileInput",""],[1,"browse-btn"],["shButton","","type","button",1,"small","outlined",3,"click"],[1,"textarea-container","textarea-wrap",3,"drop","dragover"],["rows","10",3,"ngModelChange","placeholder","ngModel","disabled"],["type","file",1,"hidden",3,"change"]],template:function(e,n){if(e&1){let o=I();je(xi),he(0,0,["ngProjectAs","label",5,["label"]]),l(1,"div",1)(2,"button",2),T("click",function(){return n.triggerBrowse()}),l(3,"sh-icon"),p(4,"upload"),r()()(),l(5,"div",3),T("drop",function(d){return n.onFileDrop(d)})("dragover",function(d){return n.onDragOver(d)}),l(6,"textarea",4),U("ngModelChange",function(d){return S(o),$(n.content,d)||(n.content=d),f(d)}),r()(),l(7,"input",5,0),T("change",function(d){return n.onFileSelected(d)}),r()}e&2&&(_(6),u("placeholder",n.placeholder()),v("ngModel",n.content),u("disabled",n.readonly()))},dependencies:[ie,Y,Z,ne,ee,q],styles:['[_nghost-%COMP%]{display:grid;grid-template-areas:"label browsebtn" "input input";grid-template-columns:8fr 1fr;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] .browse-btn[_ngcontent-%COMP%]{grid-area:browsebtn}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{grid-area:label;grid-column:1/-1}[_nghost-%COMP%] .textarea-wrap[_ngcontent-%COMP%]{grid-area:input;width:100%;border:none;font:var(--code-20)}[_nghost-%COMP%] .textarea-wrap[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{width:100%;color:var(--base-8);background-color:var(--base-1);border:1px solid var(--base-4);border-radius:var(--shape-3);padding:.5rem;resize:vertical;box-shadow:var(--box-shadow-10)}[_nghost-%COMP%] .textarea-wrap[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%] .dark[_ngcontent-%COMP%]{background-color:var(--base-2)}[_nghost-%COMP%] .hidden[_ngcontent-%COMP%]{display:none}'],changeDetection:0})};var Kt=class i{data=w();closed=Fe();path=h("");destinationUrl=h("");backupId=h("");connectionStringId=h(null);isValid=P(()=>this.path().length>0);dataEffect=j(()=>{let t=this.data();t?.destinationUrl&&this.destinationUrl.set(t.destinationUrl),t?.backupId&&this.backupId.set(t.backupId),t?.connectionStringId&&this.connectionStringId.set(t.connectionStringId)});submit(){this.closed.emit(this.path()||null)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=K({type:i,selectors:[["app-browse-path-dialog"]],inputs:{data:[1,"data"]},outputs:{closed:"closed"},decls:11,vars:8,consts:()=>{let t;t=$localize`Path`;let e;e=$localize`Select destination folder`;let n;n=$localize`Cancel`;let o;return o=$localize` Use this folder `,[e,n,o,[1,"title-30"],["content",""],[3,"customRemoteMode","backupId","destinationUrl","connectionStringId","onlySelectFolder","selectFiles"],["type","text","id","path","tabindex","4","placeholder",t,3,"ngModelChange","ngModel"],["footer","",1,"sticky"],["shButton","","type","button",3,"click"],["shButton","","type","button",1,"raised","primary",3,"click","disabled"]]},template:function(e,n){e&1&&(l(0,"header")(1,"h3",3),D(2,0),r()(),l(3,"section",4)(4,"app-file-tree",5)(5,"input",6),U("ngModelChange",function(a){return $(n.path,a)||(n.path=a),a}),r()()(),l(6,"footer",7)(7,"button",8),T("click",function(){return n.closed.emit(null)}),D(8,1),r(),l(9,"button",9),T("click",function(){return n.submit()}),D(10,2),r()()),e&2&&(_(4),u("customRemoteMode","backend")("backupId",n.backupId())("destinationUrl",n.destinationUrl())("connectionStringId",n.connectionStringId())("onlySelectFolder",!0)("selectFiles",!1),_(),v("ngModel",n.path),_(4),u("disabled",!n.isValid()))},dependencies:[q,ke,ie,Y,Z,ne],styles:["[_nghost-%COMP%]{--dialog-p: 1.5rem;display:flex;flex-direction:column;gap:1rem}header[_ngcontent-%COMP%]{display:flex;padding:1.5rem 1.5rem 0}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}footer[_ngcontent-%COMP%]{z-index:1}"],changeDetection:0})};var Li=(i,t,e,n)=>({index:i,fieldGroup:"custom",formView:t,destinationType:e,oauthField:n}),_e=i=>({$implicit:i}),bi=(i,t,e,n)=>({index:i,fieldGroup:"dynamic",formView:t,destinationType:e,oauthField:n}),wi=()=>({updateOn:"blur"}),Gi=(i,t,e,n)=>({index:i,formView:t,fieldGroup:"advanced",destinationType:e,oauthField:n}),Te=(i,t)=>({fieldGroup:i,formView:t}),$i=()=>["/connect/logon"];function vi(i,t){i&1&&re(0)}function Ui(i,t){if(i&1&&H(0,vi,1,0,"ng-container",25),i&2){let e=t.$implicit,n=t.$index;s();let o=te(15);s();let a=E(0),d=E(1);u("ngTemplateOutlet",o)("ngTemplateOutletContext",se(7,_e,Tt(2,Li,n,e,a,d.oauthField)))}}function ki(i,t){i&1&&re(0)}function Vi(i,t){if(i&1&&H(0,ki,1,0,"ng-container",25),i&2){let e=t.$implicit,n=t.$index;s();let o=te(15);s();let a=E(0),d=E(1);u("ngTemplateOutlet",o)("ngTemplateOutletContext",se(7,_e,Tt(2,bi,n,e,a,d.oauthField)))}}function Bi(i,t){if(i&1){let e=I();l(0,"button",26),T("click",function(){S(e);let o=s(2);return f(o.showTextArea.set(!1))}),x(1,8),O(2,"sh-icon"),R(),r()}}function Ki(i,t){if(i&1){let e=I();l(0,"button",33,2),T("click",function(){let o=S(e).$implicit,a=s(3);return f(a.addAdvancedOption(o))}),p(2),r()}if(i&2){let e=t.$implicit;_(2),V(" ",e.name," ")}}function Ji(i,t){if(i&1){let e=I();l(0,"div",23)(1,"sh-menu",27)(2,"button",28),x(3,9),O(4,"sh-icon"),R(),r(),pe(5,29),fe(6,Ki,3,1,"button",30,Se),de(),r(),l(8,"sh-menu")(9,"button",31)(10,"sh-icon"),p(11,"dots-three-vertical"),r()(),pe(12,29),l(13,"button",32),T("click",function(){S(e);let o=s(2);return f(o.showTextArea.set(!0))}),l(14,"sh-icon"),p(15,"link"),r(),p(16," Edit contents as text "),r(),de(),r()()}if(i&2){s();let e=E(9);_(),u("searchable",!0),_(),u("disabled",e.length===0),_(4),Ee(e)}}function Xi(i,t){if(i&1){let e=I();l(0,"textarea",34),T("ngModelChange",function(o){S(e);let a=s(2);return f(a.updateSettingsFromText(o))}),r()}if(i&2){let e=s(2);u("ngModel",e.settingsAsText())("ngModelOptions",Ie(2,wi))}}function zi(i,t){i&1&&re(0)}function Wi(i,t){if(i&1&&H(0,zi,1,0,"ng-container",25),i&2){let e=t.$implicit,n=t.$index;s(2);let o=te(15),a=s(),d=E(0),c=E(1),m=a.getFormView("advanced",e)??a.getDefaultFormView(e);u("ngTemplateOutlet",o)("ngTemplateOutletContext",se(7,_e,Tt(2,Gi,n,m,d,c.oauthField)))}}function Hi(i,t){if(i&1&&fe(0,Wi,1,9,"ng-container",null,Se),i&2){let e=s(2);Ee(e.advancedFormFieldNames())}}function ji(i,t){i&1&&(l(0,"sup",43),p(1,"*"),r())}function qi(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(2).$implicit;u("shTooltip",e.formView.longDescription)}}function Qi(i,t){if(i&1){let e=I();l(0,"app-file-tree",36)(1,"label",42),g(2,ji,2,0,"sup",43),p(3),g(4,qi,2,1,"sh-icon",44),r(),l(5,"input",45),T("ngModelChange",function(o){S(e);let a=s().$implicit,d=s(2);return f(d.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r()()}if(i&2){let e=s().$implicit,n=E(1),o=E(2),a=E(3),d=E(4),c=E(5);u("startingPath",a)("accepts",e.formView.accepts)("showFiles",!0)("hideShortcuts",!1)("showHiddenNodes",!0)("selectFiles",!0)("resolvePaths",!0),_(),u("for",c),_(),C(e.formView.isMandatory&&d?2:-1),_(),V(" ",n," "),_(),C(e.formView.longDescription?4:-1),_(),u("id",c)("ngModel",o)}}function Yi(i,t){i&1&&(l(0,"sup",46),p(1,"*"),r())}function Zi(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(2).$implicit;u("shTooltip",e.formView.longDescription)}}function eo(i,t){if(i&1){let e=I();l(0,"app-file-tree",37)(1,"label",42),g(2,Yi,2,0,"sup",46),p(3),g(4,Zi,2,1,"sh-icon",44),r(),l(5,"input",45),T("ngModelChange",function(o){S(e);let a=s().$implicit,d=s(2);return f(d.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r()()}if(i&2){let e=s().$implicit,n=E(1),o=E(2),a=E(3),d=E(4),c=E(5);u("hideShortcuts",!1)("enableCreateFolder",!0)("startingPath",a)("resolvePaths",!0),_(),u("for",c),_(),C(e.formView.isMandatory&&d?2:-1),_(),V(" ",n," "),_(),C(e.formView.longDescription?4:-1),_(),u("id",c)("ngModel",o)}}function to(i,t){i&1&&(l(0,"sup",47),p(1,"*"),r())}function no(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(2).$implicit;u("shTooltip",e.formView.longDescription)}}function io(i,t){i&1&&(l(0,"sh-icon",48),p(1," warning "),r())}function oo(i,t){i&1&&re(0)}function ao(i,t){if(i&1&&(l(0,"sh-icon",53),p(1," link "),r()),i&2){s();let e=E(8),n=E(9);Ne("error",e&&n==="error")("warn",e&&n==="warning"),u("shTooltip",e)}}function lo(i,t){i&1&&(l(0,"sh-icon",51),p(1,"envelope"),r())}function ro(i,t){i&1&&(l(0,"sh-icon",51),p(1,"hard-drives"),r())}function so(i,t){i&1&&(l(0,"sh-icon",51),p(1,"jar"),r())}function _o(i,t){i&1&&(l(0,"sh-icon",51),p(1,"textbox"),r())}function co(i,t){if(i&1){let e=I();l(0,"button",54),T("click",function(o){S(e);let a=s(2).$implicit,d=s(2);return f(d.browse(a.fieldGroup,a.formView.name,o))}),p(1," Browse ... "),r()}}function uo(i,t){if(i&1){let e=I();l(0,"sh-form-field")(1,"label",42),g(2,to,2,0,"sup",47),p(3),g(4,no,2,1,"sh-icon",44),g(5,io,2,0,"sh-icon",48),H(6,oo,1,0,"ng-container",25),r(),l(7,"input",49),T("keydown",function(o){S(e);let a=s().$implicit,d=s(2);return f(d.onKeyDown(a.fieldGroup,a.formView.name,a.formView.type,o))})("ngModelChange",function(o){S(e);let a=s().$implicit,d=s(2);return f(d.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r(),ce(8)(9),g(10,ao,2,5,"sh-icon",50)(11,lo,2,0,"sh-icon",51)(12,ro,2,0,"sh-icon",51)(13,so,2,0,"sh-icon",51)(14,_o,2,0,"sh-icon",51),g(15,co,2,0,"button",52),r()}if(i&2){let e=s().$implicit,n=E(1),o=E(2),a=E(3),d=E(4),c=E(5);s();let m=te(17),F=s();_(),u("for",c),_(),C(e.formView.isMandatory&&d?2:-1),_(),V(" ",n," "),_(),C(e.formView.longDescription?4:-1),_(),C(d&&e.formView.type==="Path"?5:-1),_(),u("ngTemplateOutlet",m)("ngTemplateOutletContext",se(17,_e,me(14,Te,e.fieldGroup,e.formView))),_(),u("type",e.formView.type==="Email"?"email":"text")("id",c)("ngModel",o);let N=a,A=F.hasLeadingSlash(N??"");_(),Q(A&&(e.formView.doubleSlash==null?null:e.formView.doubleSlash.message)),_(),Q(e.formView.doubleSlash==null?null:e.formView.doubleSlash.type),_(),C(e.formView.type==="Path"?10:e.formView.type==="Email"?11:e.formView.type==="Hostname"?12:e.formView.type==="Bucketname"||e.formView.type==="BucketnameB2"?13:14),_(5),C(e.formView.type==="Path"&&F.hasV2ListBackendOperations()?15:-1)}}function po(i,t){i&1&&(l(0,"sup",55),p(1,"*"),r())}function mo(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(2).$implicit;u("shTooltip",e.formView.longDescription)}}function go(i,t){i&1&&re(0)}function Co(i,t){if(i&1){let e=I();l(0,"span",59),T("click",function(){S(e);let o=s(2).$implicit,a=s(2);return f(a.oauthStartTokenCreation(o.destinationType,o.fieldGroup,o.formView.name,o.formView.oauthVersion))}),p(1," AuthID "),r()}}function To(i,t){i&1&&(l(0,"sh-icon",51),p(1,"password"),r())}function So(i,t){if(i&1){let e=I();l(0,"sh-icon",60),T("click",function(){S(e);let o=s(2).$implicit;return f(o.formView.showPassword=!o.formView.showPassword)}),p(1," eye "),r()}}function fo(i,t){if(i&1){let e=I();l(0,"sh-icon",60),T("click",function(){S(e);let o=s(2).$implicit;return f(o.formView.showPassword=!o.formView.showPassword)}),p(1," eye-slash "),r()}}function Eo(i,t){if(i&1){let e=I();l(0,"sh-form-field")(1,"label",42),g(2,po,2,0,"sup",55),p(3),g(4,mo,2,1,"sh-icon",44),H(5,go,1,0,"ng-container",25),r(),l(6,"input",56),T("ngModelChange",function(o){S(e);let a=s().$implicit,d=s(2);return f(d.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r(),g(7,Co,2,0,"span",57)(8,To,2,0,"sh-icon",51),g(9,So,2,0,"sh-icon",58)(10,fo,2,0,"sh-icon",58),r()}if(i&2){let e=s().$implicit,n=E(1),o=E(2),a=E(4),d=E(5);s();let c=te(17);_(),u("for",d),_(),C(e.formView.isMandatory&&a?2:-1),_(),V(" ",n," "),_(),C(e.formView.longDescription?4:-1),_(),u("ngTemplateOutlet",c)("ngTemplateOutletContext",se(14,_e,me(11,Te,e.fieldGroup,e.formView))),_(),u("type",e.formView.showPassword?"text":"password")("id",d)("ngModel",o),_(),C(e.oauthField===e.formView.name?7:8),_(2),C(e.formView.showPassword?9:10)}}function ho(i,t){i&1&&(l(0,"sup",62),p(1,"*"),r())}function No(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(3).$implicit;u("shTooltip",e.formView.longDescription)}}function Fo(i,t){i&1&&re(0)}function Do(i,t){if(i&1&&p(0),i&2){let e=t.$implicit;at(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ")}}function yo(i,t){if(i&1){let e=I();l(0,"sh-select",61)(1,"label",42),g(2,ho,2,0,"sup",62),p(3),g(4,No,2,1,"sh-icon",44),H(5,Fo,1,0,"ng-container",25),r(),l(6,"input",45),T("ngModelChange",function(o){S(e);let a=s(2).$implicit,d=s(2);return f(d.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r()(),H(7,Do,1,2,"ng-template",null,3,Je)}if(i&2){let e=te(8);s();let n=E(0),o=s().$implicit,a=E(1),d=E(2),c=E(4),m=E(5);s();let F=te(17);u("options",n)("isClearable",!1)("optionTemplate",e),_(),u("for",m),_(),C(o.formView.isMandatory&&c?2:-1),_(),V(" ",a," "),_(),C(o.formView.longDescription?4:-1),_(),u("ngTemplateOutlet",F)("ngTemplateOutletContext",se(14,_e,me(11,Te,o.fieldGroup,o.formView))),_(),u("id",m)("ngModel",d)}}function Ao(i,t){if(i&1&&(ce(0),g(1,yo,9,16)),i&2){let e=s().$implicit,n=Q(s(2).mapOptions(e.formView));_(),C(n?1:-1)}}function Io(i,t){i&1&&(l(0,"sup",65),p(1,"*"),r())}function Po(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(3).$implicit;u("shTooltip",e.formView.longDescription)}}function Oo(i,t){i&1&&re(0)}function Mo(i,t){if(i&1&&p(0),i&2){let e=t.$implicit;at(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ")}}function xo(i,t){if(i&1){let e=I();l(0,"sh-select",64)(1,"label",42),g(2,Io,2,0,"sup",65),p(3),g(4,Po,2,1,"sh-icon",44),H(5,Oo,1,0,"ng-container",25),r(),l(6,"input",45),T("ngModelChange",function(o){S(e);let a=s(2).$implicit,d=s(2);return f(d.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r()(),H(7,Mo,1,2,"ng-template",null,4,Je)}if(i&2){let e=te(8);s();let n=E(0),o=s().$implicit,a=E(1),d=E(2),c=E(4),m=E(5);s();let F=te(17);u("options",n)("asFreeText",!0)("inlineSearch",!0)("optionTemplate",e),_(),u("for",m),_(),C(o.formView.isMandatory&&c?2:-1),_(),V(" ",a," "),_(),C(o.formView.longDescription?4:-1),_(),u("ngTemplateOutlet",F)("ngTemplateOutletContext",se(15,_e,me(12,Te,o.fieldGroup,o.formView))),_(),u("id",m)("ngModel",d)}}function Ro(i,t){i&1&&O(0,"sh-progress-bar",63)}function Lo(i,t){if(i&1&&(ce(0),g(1,xo,9,17)(2,Ro,1,0,"sh-progress-bar",63)),i&2){let e=s().$implicit,n=E(2),o=Q(s(2).mapOptionsWithFreeText(e.formView,n));_(),C(o?1:2)}}function bo(i,t){i&1&&(l(0,"sup",67),p(1,"*"),r())}function wo(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(2).$implicit;u("shTooltip",e.formView.longDescription)}}function Go(i,t){i&1&&re(0)}function $o(i,t){if(i&1){let e=I();l(0,"app-size",66),T("ngModelChange",function(o){S(e);let a=s().$implicit,d=s(2);return f(d.updateFieldValue(a.fieldGroup,a.formView.name,o))}),l(1,"label",42),g(2,bo,2,0,"sup",67),p(3),g(4,wo,2,1,"sh-icon",44),H(5,Go,1,0,"ng-container",25),r()()}if(i&2){let e=s().$implicit,n=E(1),o=E(2),a=E(4),d=E(5);s();let c=te(17);u("inputType",e.Name)("ngModel",o)("customId",d),_(),u("for",d),_(),C(e.formView.isMandatory&&a?2:-1),_(),V(" ",n," "),_(),C(e.formView.longDescription?4:-1),_(),u("ngTemplateOutlet",c)("ngTemplateOutletContext",se(12,_e,me(9,Te,e.fieldGroup,e.formView)))}}function vo(i,t){i&1&&(l(0,"sup",68),p(1,"*"),r())}function Uo(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(2).$implicit;u("shTooltip",e.formView.longDescription)}}function ko(i,t){i&1&&re(0)}function Vo(i,t){if(i&1){let e=I();l(0,"sh-form-field")(1,"label",42),g(2,vo,2,0,"sup",68),p(3),g(4,Uo,2,1,"sh-icon",44),H(5,ko,1,0,"ng-container",25),r(),l(6,"input",69),T("ngModelChange",function(o){S(e);let a=s().$implicit,d=s(2);return f(d.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r(),l(7,"sh-icon",51),p(8,"numpad"),r()()}if(i&2){let e=s().$implicit,n=E(1),o=E(2),a=E(4),d=E(5);s();let c=te(17);_(),u("for",d),_(),C(e.formView.isMandatory&&a?2:-1),_(),V(" ",n," "),_(),C(e.formView.longDescription?4:-1),_(),u("ngTemplateOutlet",c)("ngTemplateOutletContext",se(11,_e,me(8,Te,e.fieldGroup,e.formView))),_(),u("id",d)("ngModel",o)}}function Bo(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(2).$implicit;u("shTooltip",e.formView.longDescription)}}function Ko(i,t){i&1&&re(0)}function Jo(i,t){if(i&1){let e=I();l(0,"sh-toggle",39)(1,"label",42),p(2),g(3,Bo,2,1,"sh-icon",44),H(4,Ko,1,0,"ng-container",25),r(),l(5,"input",70),T("change",function(o){S(e);let a=s().$implicit,d=s(2);return f(d.updateFieldValue(a.fieldGroup,a.formView.name,o.target.checked?"true":"false"))}),r()()}if(i&2){let e=s().$implicit,n=E(1),o=E(2),a=E(5);s();let d=te(17),c=s();_(),u("for",a),_(),V(" ",n," "),_(),C(e.formView.longDescription?3:-1),_(),u("ngTemplateOutlet",d)("ngTemplateOutletContext",se(9,_e,me(6,Te,e.fieldGroup,e.formView))),_(),u("checked",c.isTrue(o))}}function Xo(i,t){i&1&&(l(0,"sup",72),p(1,"*"),r())}function zo(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(3).$implicit;u("shTooltip",e.formView.longDescription)}}function Wo(i,t){i&1&&re(0)}function Ho(i,t){if(i&1&&p(0),i&2){let e=t.$implicit;at(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ")}}function jo(i,t){if(i&1){let e=I();l(0,"sh-select",71)(1,"label",42),g(2,Xo,2,0,"sup",72),p(3),g(4,zo,2,1,"sh-icon",44),H(5,Wo,1,0,"ng-container",25),r(),l(6,"input",73),T("ngModelChange",function(o){S(e);let a=s(2).$implicit,d=s(2);return f(d.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r()(),H(7,Ho,1,2,"ng-template",null,5,Je)}if(i&2){let e=te(8);s();let n=E(0),o=s().$implicit,a=E(1),d=E(2),c=E(4),m=E(5);s();let F=te(17);u("options",n)("selectMultiple",!0)("optionTemplate",e),_(),u("for",m),_(),C(o.formView.isMandatory&&c?2:-1),_(),V(" ",a," "),_(),C(o.formView.longDescription?4:-1),_(),u("ngTemplateOutlet",F)("ngTemplateOutletContext",se(13,_e,me(10,Te,o.fieldGroup,o.formView))),_(),u("ngModel",d)}}function qo(i,t){if(i&1&&(ce(0),g(1,jo,9,15)),i&2){let e=s().$implicit,n=Q(s(2).mapOptions(e.formView));_(),C(n?1:-1)}}function Qo(i,t){i&1&&(l(0,"sup",74),p(1,"*"),r())}function Yo(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(2).$implicit;u("shTooltip",e.formView.longDescription)}}function Zo(i,t){i&1&&re(0)}function ea(i,t){if(i&1){let e=I();l(0,"app-timespan",66),T("ngModelChange",function(o){S(e);let a=s().$implicit,d=s(2);return f(d.updateFieldValue(a.fieldGroup,a.formView.name,o))}),l(1,"label",42),g(2,Qo,2,0,"sup",74),p(3),g(4,Yo,2,1,"sh-icon",44),H(5,Zo,1,0,"ng-container",25),r()()}if(i&2){let e=s().$implicit,n=E(1),o=E(2),a=E(4),d=E(5);s();let c=te(17);u("inputType",e.formView.name)("ngModel",o)("customId",d),_(),u("for",d),_(),C(e.formView.isMandatory&&a?2:-1),_(),V(" ",n," "),_(),C(e.formView.longDescription?4:-1),_(),u("ngTemplateOutlet",c)("ngTemplateOutletContext",se(12,_e,me(9,Te,e.fieldGroup,e.formView)))}}function ta(i,t){i&1&&(l(0,"sup",76),p(1,"*"),r())}function na(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(2).$implicit;u("shTooltip",e.formView.longDescription)}}function ia(i,t){i&1&&re(0)}function oa(i,t){if(i&1){let e=I();l(0,"app-file-drop-textarea",75),T("ngModelChange",function(o){S(e);let a=s().$implicit,d=s(2);return f(d.updateFieldValue(a.fieldGroup,a.formView.name,o))}),l(1,"label"),g(2,ta,2,0,"sup",76),p(3),g(4,na,2,1,"sh-icon",44),H(5,ia,1,0,"ng-container",25),r()()}if(i&2){let e=s().$implicit,n=E(2),o=E(4),a=E(5);s();let d=te(17);u("ngModel",n)("customId",a)("placeholder",e.formView.longDescription),_(2),C(e.formView.isMandatory&&o?2:-1),_(),V(" ",e.formView.shortDescription??e.formView.name," "),_(),C(e.formView.longDescription?4:-1),_(),u("ngTemplateOutlet",d)("ngTemplateOutletContext",se(11,_e,me(8,Te,e.fieldGroup,e.formView)))}}function aa(i,t){i&1&&(O(0,"sh-spinner"),l(1,"span"),D(2,10),r()),i&2&&Ct("--spinner-size","16px")("--spinner-thickness","2px")}function la(i,t){if(i&1){let e=I();l(0,"div",79)(1,"span"),D(2,11),r(),l(3,"button",32),T("click",function(){S(e);let o=s(6);return f(o.reloadTrigger.set(!o.reloadTrigger()))}),D(4,12),r()()}}function ra(i,t){if(i&1&&p(0),i&2){let e=t.$implicit;at(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ")}}function sa(i,t){if(i&1){let e=I();l(0,"sh-select",80)(1,"label",42)(2,"sup",81),p(3,"*"),r(),l(4,"span"),D(5,13),r()(),l(6,"input",45),T("ngModelChange",function(o){S(e);let a=s(4).$implicit,d=s(2);return f(d.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r()(),H(7,ra,1,2,"ng-template",null,6,Je)}if(i&2){s(4);let e=E(2),n=E(5),o=s(2);u("options",o.restoreBackupIdOptions())("isClearable",!1),_(),u("for",n),_(5),u("id",n)("ngModel",e)}}function _a(i,t){if(i&1&&g(0,aa,3,4)(1,la,5,0,"div",79)(2,sa,9,5),i&2){let e=s(5);C(e.isLoadingRestoreBackupIdOptions()?0:e.restoreBackupIdOptions().length==0?1:2)}}function da(i,t){i&1&&(l(0,"sup",82),p(1,"*"),r())}function ca(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(4).$implicit;u("shTooltip",e.formView.longDescription)}}function ua(i,t){i&1&&re(0)}function pa(i,t){if(i&1){let e=I();l(0,"button",84),T("click",function(){S(e),s(4);let o=E(5),a=s(2);return f(a.toggleDisabled(o))}),x(1,14),O(2,"sh-icon"),R(),r()}}function ma(i,t){if(i&1){let e=I();l(0,"sh-form-field")(1,"label",42),g(2,da,2,0,"sup",82),p(3),g(4,ca,2,1,"sh-icon",44),H(5,ua,1,0,"ng-container",25),r(),l(6,"input",83),T("ngModelChange",function(o){S(e);let a=s(3).$implicit,d=s(2);return f(d.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r(),l(7,"sh-icon",51),p(8,"textbox"),r()(),g(9,pa,3,0,"button",41)}if(i&2){let e=s(3).$implicit,n=E(1),o=E(2),a=E(4),d=E(5);s();let c=te(17),m=s();_(),u("for",d),_(),C(e.formView.isMandatory&&a?2:-1),_(),V(" ",n," "),_(),C(e.formView.longDescription?4:-1),_(),u("ngTemplateOutlet",c)("ngTemplateOutletContext",se(15,_e,me(12,Te,e.fieldGroup,e.formView))),_(),u("type","text")("id",d)("ngModel",o)("placeholder",e.formView.longDescription)("disabled",!0),_(3),C(m.getIsDisabled(d)?9:-1)}}function ga(i,t){if(i&1&&(l(0,"div",77),g(1,_a,3,1)(2,ma,10,17),r()),i&2){let e=s(4);_(),C(e.isRestoreFlow()?1:2)}}function Ca(i,t){if(i&1){let e=I();l(0,"div",85),x(1,15),O(2,"div")(3,"div"),R(),r(),l(4,"button",84),T("click",function(){S(e);let o=s(5);return f(o.openConsole())}),x(5,16),O(6,"sh-icon"),R(),r()}}function Ta(i,t){i&1&&(l(0,"div",85),D(1,17),r(),l(2,"button",86),x(3,18),O(4,"sh-icon"),R(),r()),i&2&&(_(2),u("routerLink",Ie(1,$i)))}function Sa(i,t){if(i&1&&(l(0,"div",78),g(1,Ca,7,0)(2,Ta,5,2),r()),i&2){let e=s(4);_(),C(e.isConnectedToConsole()?1:2)}}function fa(i,t){if(i&1&&g(0,ga,3,1,"div",77)(1,Sa,3,1,"div",78),i&2){let e=s(3);C(e.isConnectedToConsole()&&e.hasStorageApiKey()?0:1)}}function Ea(i,t){i&1&&(l(0,"sup",87),p(1,"*"),r())}function ha(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(3).$implicit;u("shTooltip",e.formView.longDescription)}}function Na(i,t){i&1&&re(0)}function Fa(i,t){if(i&1){let e=I();l(0,"sh-form-field")(1,"label",42),g(2,Ea,2,0,"sup",87),p(3),g(4,ha,2,1,"sh-icon",44),H(5,Na,1,0,"ng-container",25),r(),l(6,"input",88),T("ngModelChange",function(o){S(e);let a=s(2).$implicit,d=s(2);return f(d.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r(),l(7,"sh-icon",51),p(8,"textbox"),r(),l(9,"button",89),T("click",function(){S(e);let o=s(4);return f(o.authenticateFilen())}),D(10,19),r()()}if(i&2){let e=s(2).$implicit,n=E(1),o=E(2),a=E(4),d=E(5);s();let c=te(17),m=s();_(),u("for",d),_(),C(e.formView.isMandatory&&a?2:-1),_(),V(" ",n," "),_(),C(e.formView.longDescription?4:-1),_(),u("ngTemplateOutlet",c)("ngTemplateOutletContext",se(12,_e,me(9,Te,e.fieldGroup,e.formView))),_(),u("id",d)("ngModel",o),_(3),u("disabled",m.isAuthenticatingFilen())}}function Da(i,t){if(i&1&&g(0,Fa,11,14,"sh-form-field"),i&2){let e=s(3);C(e.hasFilenApiKey()?-1:0)}}function ya(i,t){if(i&1){let e=I();l(0,"button",84),T("click",function(){S(e);let o=s().$implicit,a=s(2);return f(a.removeAdvancedOption(o.formView.name))}),l(1,"sh-icon"),p(2,"x-circle"),r()()}}function Aa(i,t){if(i&1&&(l(0,"div",35),ce(1)(2)(3)(4)(5),g(6,Qi,6,13,"app-file-tree",36)(7,eo,6,10,"app-file-tree",37)(8,uo,16,19,"sh-form-field")(9,Eo,11,16,"sh-form-field")(10,Ao,2,2)(11,Lo,3,2)(12,$o,6,14,"app-size",38)(13,Vo,9,13,"sh-form-field")(14,Jo,6,11,"sh-toggle",39)(15,qo,2,2)(16,ea,6,14,"app-timespan",38)(17,oa,6,13,"app-file-drop-textarea",40)(18,fa,2,1)(19,Da,1,1),g(20,ya,3,0,"button",41),r()),i&2){let e=t.$implicit;s();let n=E(0),o=s();Ne("single-field",e.fieldGroup!=="advanced"),_(),Q(e.formView.shortDescription??e.formView.name),_(),Q(o.getFieldGroup(n,e.fieldGroup)[e.formView.name]),_();let a=Q(o.getFieldValue(e.fieldGroup,e.formView.name));_(),Q((a??"").toString().trim()===""),_(),Q("destination-"+e.fieldGroup+"-"+e.index+"-"+(e.asHttpOptions?"http":"other")),_(),C(e.formView.type==="FileTree"?6:e.formView.type==="FolderTree"?7:e.formView.type==="String"||e.formView.type==="Path"||e.formView.type==="Email"||e.formView.type==="Hostname"||e.formView.type==="Bucketname"||e.formView.type==="BucketnameB2"?8:e.formView.type==="Password"?9:e.formView.type==="Enumeration"?10:e.formView.type==="NonValidatedSelectableString"?11:e.formView.type==="Size"?12:e.formView.type==="Integer"?13:e.formView.type==="Boolean"?14:e.formView.type==="Flags"?15:e.formView.type==="Timespan"||e.formView.type==="DateTime"?16:e.formView.type==="FreeText"?17:e.formView.type==="DuplicatiBackupId"?18:e.formView.type==="Filen2FACode"?19:-1),_(14),C(e.fieldGroup==="advanced"?20:-1)}}function Ia(i,t){if(i&1&&(l(0,"sh-icon",90),p(1,"x-circle"),r()),i&2){s();let e=E(0);u("shTooltip",(e==null?null:e.message)??"Invalid value")}}function Pa(i,t){if(i&1&&(l(0,"sh-icon",91),p(1,"warning"),r()),i&2){s();let e=E(0);u("shTooltip",(e==null?null:e.message)??"Invalid value")}}function Oa(i,t){if(i&1&&(ce(0),g(1,Ia,2,1,"sh-icon",90)(2,Pa,2,1,"sh-icon",91)),i&2){let e=s().$implicit,n=E(0),o=Q(e.formView.validate(n));_(),C((o==null?null:o.type)==="error"?1:(o==null?null:o.type)==="warning"?2:-1)}}function Ma(i,t){if(i&1&&(ce(0),g(1,Oa,3,2)),i&2){let e=t.$implicit,o=(Q(s(2).getFieldValue(e.fieldGroup,e.formView.name))??"").toString().trim()==="";_(),C(!o&&e.formView.validate?1:-1)}}function xa(i,t){if(i&1&&(ce(0),fe(1,Ui,1,9,"ng-container",null,Se),fe(3,Vi,1,9,"ng-container",null,Se),l(5,"sh-toggle-card",20),pe(6,21)(7),D(8,7),de(),ce(9),g(10,Bi,3,0,"button",22)(11,Ji,17,2,"div",23),de(),g(12,Xi,1,3,"textarea",24)(13,Hi,2,0),r(),H(14,Aa,21,9,"ng-template",null,0,Je)(16,Ma,2,2,"ng-template",null,1,Je)),i&2){let e=s(),n=E(1);Q(e.destinationForm()),_(),Ee(n.custom),_(2),Ee(n.dynamic),_(2),u("disableToggle",!0),_(4),Q(e.nonSelectedAdvancedFormViews()),_(),C(e.showTextArea()?10:11),_(2),C(e.showTextArea()?12:13)}}var Jt=class i{#e=M(Oe);#t=M(Ce);#n=M(Rt);#i=M(tt);#o=M(On);#s=M(Mn);#a=M(Ge);injector=M(He);targetUrl=Le.required();useBackupState=w(!1);#l=null;destinationType=P(()=>{let t=this.targetUrl();if(!t)return null;let e=Xe(t);return this.#l=e?.customKey??e?.key,this.#l});refreshView=h(!1);destinationForm=h({custom:{},dynamic:{},advanced:{}});advancedFormFieldNames=P(()=>Object.keys(this.destinationForm().advanced??{}));destinationFormConfig=h(null);showTextArea=h(!1);hasV2ListBackendOperations=this.#t.hasV2ListBackendOperations;isLoadingRestoreBackupIdOptions=h(!1);isRestoreFlow=P(()=>!this.useBackupState());reloadTrigger=h(!1);hasLoadedBackupIdOptions=h(!1);restoreBackupIdOptions=Ue(dn(Ht(this.targetUrl).pipe(un(),ot(t=>({url:t,isReload:!1}))),Ht(this.reloadTrigger).pipe(ot(()=>({url:this.targetUrl(),isReload:!0})))).pipe(ct(({url:t,isReload:e})=>t&&t.startsWith("duplicati://")&&this.hasStorageApiKey()&&this.isRestoreFlow()&&(e||!this.hasLoadedBackupIdOptions())?(this.hasLoadedBackupIdOptions.set(!0),this.isLoadingRestoreBackupIdOptions.set(!0),this.#s.getDuplicatiStorageBackups(t).pipe(cn(a=>(console.error("Error loading Duplicati storage backups",a),Ve([]))),Be(()=>this.isLoadingRestoreBackupIdOptions.set(!1)))):Ve([]))),{initialValue:[]});isConnectedToConsole=P(()=>this.#o.state()==="connected");hasStorageApiKey=P(()=>{let t=this.destinationForm();return(this.#n.serverSettings()?.["remote-control-storage-api-id"]??"").length>0||t.advanced["duplicati-auth-apiid"]});isAuthenticatingFilen=h(!1);hasFilenApiKey=P(()=>{let e=this.destinationForm().advanced["api-key"];return e&&e.length>0});nonSelectedAdvancedFormViews=P(()=>{let t=this.destinationFormConfig();if(!t)return[];let e=this.advancedFormFieldNames();return t.advanced.filter(n=>e.findIndex(o=>o===n.name)===-1)});destinationTypeEffect=j(()=>{let t=this.targetUrl(),e=Xe(t??""),n=e.key,o=e.customKey??n,a=this.#i.allModules().find(k=>k.Key===n)??{Key:n,DisplayName:e.displayName,Description:e.description,Options:[]};if(!a||!a.Options||!n)return;let d=e&&e.oauthField?e.oauthField:null,c=e&&e.customFields?e.customFields:{},m=e&&e.dynamicFields?e.dynamicFields:[],F=e&&e.advancedFields?e.advancedFields:[],N=e&&e.ignoredAdvancedFields?e.ignoredAdvancedFields:[],A={destinationType:o,oauthField:d,custom:[],dynamic:[],advanced:[]};c&&Object.entries(c).forEach(([k,y],J)=>{let X=y.order??J,b=y.validate;!b&&y.type==="Bucketname"&&(b=G=>$n(G)?null:{type:"error",message:$localize`Invalid bucket name.`}),b&&y.type==="Hostname"&&(b=G=>vn(G)?null:{type:"error",message:$localize`Invalid hostname.`}),A.custom.push(W({order:900+X,validate:b},y))});for(let k=0;k<a.Options.length;k++){let y=a.Options[k];if(y.Deprecated)continue;let J=m.find(X=>X===y.Name||y.Aliases?.includes(X.name)||X.name===y.Name);if(J){let X=y.Aliases?.indexOf(J.name)??-1,b=y.Aliases&&X>-1?y.Aliases[X]:y.Name,G=J&&typeof J!="string",Me=G?J?.defaultValue??y.DefaultValue:y.DefaultValue,xe=G&&J?.order!==void 0?J.order:k,B={name:b,type:y.Type,shortDescription:y.ShortDescription??void 0,longDescription:y.LongDescription??void 0,options:y.ValidValues,order:900+xe},We=G?W(W({},B),J):B;A.dynamic.push(We)}else{let X=y.Name;if(N.find(Re=>Re===X))continue;let G=F.find(Re=>Re===X||Re.name===X),Me=G&&typeof G!="string",xe=Me&&G?.order!==void 0?G.order:k,B={name:X,type:y.Type,shortDescription:y.ShortDescription??void 0,longDescription:y.LongDescription??void 0,options:y.ValidValues,defaultValue:y.DefaultValue,order:900+xe},We=Me?W(W({},B),G):B;A.advanced.push(We)}}if(A.custom.sort((k,y)=>k.order-y.order),A.dynamic.sort((k,y)=>k.order-y.order),A.advanced.sort((k,y)=>k.order-y.order),this.destinationFormConfig.set(A),!t)return;let L=bt(t);L&&this.destinationForm.set({custom:L.custom,dynamic:L.dynamic,advanced:L.advanced})});destinationFormEffect=j(()=>{let t=this.#l,e=this.destinationForm(),n=this.refreshView();if(!e||!t)return;let o=wn({destinationType:t,custom:e.custom,dynamic:e.dynamic,advanced:e.advanced});o&&this.targetUrl.set(o)});getFieldValue(t,e){let o=this.destinationForm()[t][e];return o||null}getFormView(t,e){let o=this.destinationFormConfig()?.[t].find(a=>a.name===e);return o||null}getDefaultFormView(t){return{name:t,type:"String",shortDescription:t,longDescription:$localize`This is an undocumented option.`}}getFieldGroup(t,e){return t[e]}hasLeadingSlash(t){return t?.startsWith("/")??!1}addAdvancedOption(t){let e=this.destinationForm();e.advanced[t.name]=t.defaultValue,this.destinationForm.set(W({},e))}isTrue(t){if(typeof t=="boolean")return t;if(typeof t=="string"){let e=t.toLowerCase();return e==="true"||e==="1"||e==="yes"||e==="on"}return!1}onKeyDown(t,e,n,o){if(n==="Hostname"||n==="Bucketname"){if(["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Home","End"].includes(o.key))return;if(o.key=="/"||o.key=="\\"||o.key==":"){o.preventDefault();return}}}updateFieldValue(t,e,n){let o=this.destinationForm();o[t][e]=n,this.destinationForm.set(W({},o))}removeAdvancedOption(t){let e=this.destinationForm();delete e.advanced[t],this.destinationForm.set(W({},e))}mapOptions(t){let e=t.loadOptions;if(e)return e(this.injector)();let n=t.options;return n?n.map(o=>({key:o,value:o})):null}mapOptionsWithFreeText(t,e){let n=this.mapOptions(t);return n?(e&&e.length>0&&(n.find(a=>a.value===e)||n.push({key:e,value:e})),n):null}#r=h(!1);browse(t,e,n){let o=this.useBackupState()?this.#e.backupId():null,a=this.useBackupState()?this.#e.connectionStringId():null;this.#a.open(Kt,{maxWidth:"700px",maxHeight:"80vh",width:"100%",closeOnOutsideClick:!1,data:{backupId:o,destinationUrl:this.targetUrl(),connectionStringId:a}}).closed.subscribe(c=>{c&&(c=c.replace(/^\/+/,""),this.destinationForm.update(m=>(m[t][e]=c,W({},m))))})}oauthStartTokenCreation(t,e,n,o){this.#r.set(!0);let a=(o??1)==2?this.#t.defaultOAuthUrlV2():this.#t.defaultOAuthUrl(),d=this.#n.serverSettings()?.["--oauth-url"];if(d&&d.length>0&&(a=d),this.useBackupState()){let y=this.#e.mapFormsToSettings().find(J=>J.Name==="--oauth-url")?.Value;y&&y.length>0&&(a=y)}let c=this.destinationForm().advanced["oauth-url"];c&&c.length>0&&(a=c);let m=`${a}?type=${t}`,F=450,N=600,A=screen.width/2-F/2,L=screen.height/2-N/2,k=window.open(m,"_blank","height="+N+",width="+F+",menubar=0,status=0,titlebar=0,toolbar=0,left="+A+",top="+L);return window.addEventListener("message",y=>{let J=y.data.startsWith("authid:"),X=J?y.data.replace("authid:",""):null;J&&(this.destinationForm.update(b=>(b[e][n]=X,W({},b))),this.#r.set(!1),this.refreshView.set(!this.refreshView()),k?.close())}),!1}settingsAsText=P(()=>{let t=this.destinationForm().advanced;return Object.entries(t).map(([e,n])=>{let o=e??"",a="";return typeof n=="boolean"?a=this.isTrue(n)?"True":"False":(typeof n=="number"||n!=null)&&(a=n.toString()),`${o}=${a}`}).join(`
4
+ `)});updateSettingsFromText(t){if(typeof t!="string")return;let e=Gn(t);this.destinationForm.update(n=>le(W({},n),{advanced:e}))}getIsDisabled(t){return document.getElementById(t)?.disabled??!0}toggleDisabled(t){let e=document.getElementById(t);e&&(e.disabled=!e.disabled)}openConsole(){this.#o.openConsole()}#_(t){var e=this.useBackupState()?this.#e.backupId():null;this.isAuthenticatingFilen.set(!0),this.#s.getFilenApiKey(t,e).pipe(Be(()=>this.isAuthenticatingFilen.set(!1))).subscribe({next:n=>{if(n.length===0){this.#a.open(ae,{data:{title:$localize`Authentication failed`,message:$localize`No API key was returned from the Filen server.`,confirmText:$localize`OK`}});return}this.destinationForm.update(o=>(o.advanced["api-key"]=n,o.dynamic["two-factor-code"]=null,W({},o))),this.refreshView.set(!this.refreshView())},error:n=>{console.error("Error authenticating Filen",n),this.#a.open(ae,{data:{title:$localize`Authentication failed`,message:$localize`An error occurred while requesting the Filen API key: ${n.message}`,confirmText:$localize`OK`}})}})}authenticateFilen(){let t=this.targetUrl();if(!t)return;let n=this.destinationForm().advanced["api-key"];if(n&&n.length>0){this.#a.open(ae,{data:{title:$localize`Confirm re-authenticate?`,message:$localize`You already have an API key. Are you sure you want to re-authenticate?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:o=>{if(o){var a=new URL(t);a.searchParams.delete("api-key"),this.#_(a.toString())}}});return}this.#_(t)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=K({type:i,selectors:[["app-single-destination"]],inputs:{targetUrl:[1,"targetUrl"],useBackupState:[1,"useBackupState"]},outputs:{targetUrl:"targetUrlChange"},decls:3,vars:3,consts:()=>{let t;t=$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 n;n=$localize` Add advanced option ${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON:`;let o;o=$localize`This field is mandatory`;let a;a=$localize`This field is mandatory`;let d;d=$localize`This field is mandatory`;let c;c=$localize`An empty path means storing data in the initial or root folder, which is not recommended`;let m;m=$localize`This field is mandatory`;let F;F=$localize`This field is mandatory`;let N;N=$localize`This field is mandatory`;let A;A=$localize`This field is mandatory`;let L;L=$localize`This field is mandatory`;let k;k=$localize`This field is mandatory`;let y;y=$localize`This field is mandatory`;let J;J=$localize`This field is mandatory`;let X;X=$localize`Loading available backups...`;let b;b=$localize`No backups found from this machine, contact support`;let G;G=$localize` Try again `;let Me;Me=$localize`This field is mandatory`;let xe;xe=$localize`Pick the backup to restore from`;let B;B=$localize`This field is mandatory`;let We;We=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:pencil${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let Re;Re=$localize`${"[\uFFFD#2\uFFFD|\uFFFD#3\uFFFD]"}:START_TAG_DIV:An API key with storage access is required to use Duplicati storage.${"[\uFFFD/#2\uFFFD|\uFFFD/#3\uFFFD]"}:CLOSE_TAG_DIV:${"[\uFFFD#2\uFFFD|\uFFFD#3\uFFFD]"}:START_TAG_DIV:Visit the console and assign an API key to this machine.${"[\uFFFD/#2\uFFFD|\uFFFD/#3\uFFFD]"}:CLOSE_TAG_DIV:`,Re=Ke(Re);let nn;nn=$localize` Visit console ${"\uFFFD#6\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SH_ICON:`;let on;on=$localize`Connect to the console to use Duplicati storage.`;let an;an=$localize` Connect now ${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON:`;let ln;ln=$localize`This field is mandatory`;let rn;return rn=$localize` Authenticate now `,[["fieldTemplate",""],["validateTemplate",""],["option",""],["enumOptionTemplate",""],["nonValidatedOptionTemplate",""],["optionTemplate",""],["backupIdOptionTemplate",""],t,e,n,X,b,G,xe,We,Re,nn,on,an,rn,[1,"advanced-options",3,"disableToggle"],["title",""],["shButton","","type","button",1,"outlined","small"],[1,"actions"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModel","ngModelOptions"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["shButton","","type","button",1,"outlined","small",3,"click"],[3,"searchable"],["shButton","","type","button",1,"outlined","small",3,"disabled"],["menu",""],["type","button"],["shButton","","type","button",1,"small"],["shButton","","type","button",1,"small",3,"click"],["type","button",3,"click"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModelChange","ngModel","ngModelOptions"],[1,"field-row"],[3,"startingPath","accepts","showFiles","hideShortcuts","showHiddenNodes","selectFiles","resolvePaths"],[3,"hideShortcuts","enableCreateFolder","startingPath","resolvePaths"],[3,"inputType","ngModel","customId"],[1,"primary","raised"],[3,"ngModel","customId","placeholder"],["shButton","","type","button",1,"outlined"],[3,"for"],["shTooltip",o],[1,"primary",3,"shTooltip"],["type","text",3,"ngModelChange","id","ngModel"],["shTooltip",a],["shTooltip",d],["shTooltip",c,1,"warn"],["autocomplete","off",3,"keydown","ngModelChange","type","id","ngModel"],["prefix","",3,"error","warn","shTooltip"],["prefix",""],["suffix","","shButton","","type","button",1,"outlined","small"],["prefix","",3,"shTooltip"],["suffix","","shButton","","type","button",1,"outlined","small",3,"click"],["shTooltip",m],["autocomplete","new-password",3,"ngModelChange","type","id","ngModel"],["prefix","",1,"link"],["suffix","",1,"clickable"],["prefix","",1,"link",3,"click"],["suffix","",1,"clickable",3,"click"],["label","key","value","value",3,"options","isClearable","optionTemplate"],["shTooltip",F],[1,"indeterminate","primary"],["label","key","value","value",3,"options","asFreeText","inlineSearch","optionTemplate"],["shTooltip",N],[3,"ngModelChange","inputType","ngModel","customId"],["shTooltip",A],["shTooltip",L],["type","number",3,"ngModelChange","id","ngModel"],["type","checkbox",3,"change","checked"],["key","key","value","value",1,"primary","raised",3,"options","selectMultiple","optionTemplate"],["shTooltip",k],["type","text","id","text",3,"ngModelChange","ngModel"],["shTooltip",y],[3,"ngModelChange","ngModel","customId","placeholder"],["shTooltip",J],[1,"duplicati-backup-id"],[1,"duplicati-backup-id-console"],[1,"no-backups-found"],[3,"options","isClearable"],["shTooltip",Me],["shTooltip",B],["autocomplete","off",3,"ngModelChange","type","id","ngModel","placeholder","disabled"],["shButton","","type","button",1,"outlined",3,"click"],[1,"info"],["shButton","","type","button",1,"outlined",3,"routerLink"],["shTooltip",ln],["type","text","autocomplete","off",3,"ngModelChange","id","ngModel"],["suffix","","shButton","","type","button",1,"outlined","small",3,"click","disabled"],[1,"error",3,"shTooltip"],[1,"warn",3,"shTooltip"]]},template:function(e,n){if(e&1&&(ce(0)(1),g(2,xa,18,5)),e&2){let o=Q(n.destinationType());_();let a=Q(n.destinationFormConfig());_(),C(o&&a?2:-1)}},dependencies:[Qe,Y,ht,Z,ie,ne,Sn,fn,ke,Gt,Un,Bt,ue,q,ee,Ot,Ye,$e,Mt,ve,It,Pt],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.advanced-options[_ngcontent-%COMP%]{position:relative;z-index:1}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}sh-select[_ngcontent-%COMP%]{--miw: p2r(120)}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-8)}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-8)}label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}label[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:1rem}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.field-row.single-field[_ngcontent-%COMP%]{display:block}.actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.raw-text-area[_ngcontent-%COMP%]{min-height:12rem;white-space:pre}.duplicati-backup-id[_ngcontent-%COMP%]{display:flex;flex-direction:row;gap:8px;align-items:flex-end}.duplicati-backup-id[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{width:100%}.duplicati-backup-id-console[_ngcontent-%COMP%]{display:flex;flex-direction:row;gap:8px;align-items:center}.duplicati-backup-id-console[_ngcontent-%COMP%] .info[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column;gap:4px}.no-backups-found[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin-left:4px;margin-right:4px}"],changeDetection:0})};var Xt=class i{#e=M(xt);#t=M(Ge);#n=M(Ce);testDestination(t,e,n,o,a,d,c,m,F){return this.#n.hasV2TestOperations()?this.testDestinationv2(t,e,n,o,a,d,c,m,F):this.testDestinationv1(t,e,n,o,a,d,c,m,F)}testDestinationv2(t,e,n,o,a,d,c,m,F){return new dt(N=>{this.#e.postApiV2DestinationTest({requestBody:{DestinationUrl:t,ConnectionStringId:n??null,BackupId:e=="new"?null:e,AutoCreate:m==="create",ReadOnlyTest:F,Options:null,DestinationType:d,SourcePrefix:e=="new"?null:o}}).subscribe({next:A=>{if(A.Success){this.emitSuccessV2(N,t,a,A);return}this.handleGenericError(N,t,a,A.Error??"Unknown error",c)},error:A=>{let L=A?.error?.body??A?.error?.requestBody;if(L?.Data?.FolderExists===!1||L?.StatusCode==="missing-folder"){this.handleMissingFolder(N,t,e,n,a,c,m,F);return}if(L?.Data?.HostCertificate){this.handleMissingCertificate(N,t,a,L.Data?.HostCertificate,c);return}if(L?.Data?.ReportedHostKey){this.handleIncorrectKey(N,t,a,L.Data.ReportedHostKey,L.Data.AcceptedHostKey??null,c);return}this.handleGenericError(N,t,a,A?.message??"Unknown error",c)}})})}testDestinationv1(t,e,n,o,a,d,c,m,F){return new dt(N=>{this.#e.postApiV1RemoteoperationTest({readOnlyTest:F,requestBody:{path:t,backupId:e=="new"?null:e,connectionStringId:n??null,sourcePrefix:e=="new"?null:o},type:d}).subscribe({next:A=>{N.next({action:"success",targetUrl:t,testAgain:!1,destinationIndex:a}),N.complete()},error:A=>{this.handleDestinationErrorv1(A.message,t,e,n,a,c,m,F).subscribe(L=>{N.next(L)})}})})}handleMissingFolder(t,e,n,o,a,d,c,m){function F(){t.next({action:"missing-folder",targetUrl:e,testAgain:!1,destinationIndex:a,errorMessage:$localize`The remote destination folder does not exist.`}),t.complete()}if(d||c==="error"){F();return}this.#t.open(ae,{data:{title:$localize`Create folder`,message:$localize`The remote destination folder does not exist, do you want to create it?`,confirmText:$localize`Create folder`,cancelText:$localize`Cancel`},closed:N=>{if(!N){this.reportNoAction(t,e,a,$localize`The remote folder does not exist.`);return}this.#n.hasV2TestOperations()?this.#e.postApiV2DestinationTest({requestBody:{DestinationUrl:e,ConnectionStringId:o,AutoCreate:!0,ReadOnlyTest:m,Options:null,BackupId:n=="new"?null:n}}).subscribe({next:A=>{if(A.Success){this.emitSuccessV2(t,e,a,A);return}else this.handleFolderCreateFailure(t,e,a,A.Error??$localize`Unknown error`)},error:A=>{this.handleFolderCreateFailure(t,e,a,A.message??$localize`Unknown error`)}}):this.#e.postApiV1RemoteoperationCreate({requestBody:{path:e,backupId:n=="new"?null:n}}).subscribe({next:()=>{this.handleFolderCreated(t,e,a)},error:A=>{this.handleFolderCreateFailure(t,e,a,A.message??$localize`Unknown error`)}})}})}handleFolderCreateFailure(t,e,n,o){this.#t.open(ae,{data:{title:$localize`Error creating folder`,message:$localize`The remote destination folder could not be created. ${o}`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:n}),t.complete()}})}emitSuccessV2(t,e,n,o){t.next({action:"success",targetUrl:e,testAgain:!1,destinationIndex:n,anyFilesFound:!o.Data?.FolderIsEmpty,containsBackup:o.Data?.FolderContainsBackupFiles??void 0,containsEncryptedBackupFiles:o.Data?.FolderContainsEncryptedBackupFiles??void 0}),t.complete()}handleFolderCreated(t,e,n){this.#t.open(ae,{data:{title:$localize`Folder created`,message:$localize`The remote destination folder was created successfully.`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"test-again",targetUrl:e,testAgain:!0,destinationIndex:n}),t.complete()}})}reportNoAction(t,e,n,o){t.next({action:"generic-error",targetUrl:e,errorMessage:o,testAgain:!1,destinationIndex:n}),t.complete()}handleMissingCertificate(t,e,n,o,a){let d=$localize`The server is using a certificate that is not trusted.
5
+ If this is a self-signed certificate, you can choose to trust this certificate.
6
+ The server reported the certificate hash: ${o}`,c=e.includes("?");function m(){t.next({action:"trust-cert",targetUrl:e,suggestedUrl:e+`${c?"&":"?"}accept-specified-ssl-hash=${o}`,testAgain:!0,certData:o,errorMessage:d,destinationIndex:n}),t.complete()}if(a){m();return}this.#t.open(ae,{maxWidth:"500px",data:{title:$localize`Trust the certificate`,message:d,confirmText:$localize`Trust the certificate`,cancelText:$localize`Cancel`},closed:F=>{if(!F){this.reportNoAction(t,e,n,$localize`The server certificate is not trusted.`);return}m()}})}handleIncorrectKey(t,e,n,o,a,d){if(a){let N=function(){t.next({action:"approve-host-key",targetUrl:e,suggestedUrl:F,testAgain:!0,reportedHostKey:o,errorMessage:m,destinationIndex:n}),t.complete()};var c=N;let m=$localize`The host key has changed, please check with the server administrator if this is correct,
7
+ otherwise you could be the victim of a MAN-IN-THE-MIDDLE attack.
8
+ Do you want to REPLACE your CURRENT host key ${a}
9
+ with the REPORTED host key: ${o}?`,F=e;try{let L=new URL(e);L.searchParams.set("ssh-fingerprint",o),F=L.toString()}catch{let L=e.replace(/([?&])ssh-fingerprint=[^&]*/,""),k=L.includes("?");F=L+`${k?"&":"?"}ssh-fingerprint=${o}`}if(d){N();return}this.#t.open(ae,{maxWidth:"500px",data:{title:$localize`The host key has changed`,message:m,confirmText:$localize`Approve`,cancelText:$localize`Cancel`},closed:L=>{if(!L){this.reportNoAction(t,e,n,$localize`The host key was not approved.`);return}N()}})}else{let N=function(){t.next({action:"approve-host-key",targetUrl:e,suggestedUrl:e+`${F?"&":"?"}ssh-fingerprint=${o}`,testAgain:!0,reportedHostKey:o,errorMessage:m,destinationIndex:n}),t.complete()};var c=N;let m=$localize`No certificate was specified, please verify that the reported host key is correct: ${o}`,F=e.includes("?");if(d){N();return}this.#t.open(ae,{maxWidth:"500px",data:{title:$localize`Approve host key?`,message:m,confirmText:$localize`Approve`,cancelText:$localize`Cancel`},closed:A=>{if(!A){this.reportNoAction(t,e,n,$localize`The host key was not approved.`);return}N()}})}}handleGenericError(t,e,n,o,a){function d(){t.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:n,errorMessage:o}),t.complete()}if(a){d();return}this.#t.open(ae,{maxWidth:"500px",data:{title:$localize`Test connection failed`,message:o,cancelText:$localize`OK`},closed:c=>d()})}handleDestinationErrorv1(t,e,n,o,a,d,c,m){return new dt(F=>{if(t==="missing-folder"){this.handleMissingFolder(F,e,n,o,a,d,c,m);return}if(t.startsWith("incorrect-cert:")){let N=t.split("incorrect-cert:")[1];this.handleMissingCertificate(F,e,a,N,d);return}if(t.startsWith("incorrect-host-key:")){let N=t.split('incorrect-host-key:"')[1].split('",')[0],A=t.split('accepted-host-key:"')[1].split('",')[0];this.handleIncorrectKey(F,e,a,N,A,d);return}this.handleGenericError(F,e,a,t,d)})}static \u0275fac=function(e){return new(e||i)};static \u0275prov=De({token:i,factory:i.\u0275fac,providedIn:"root"})};function Ra(i,t){if(i&1){let e=I();l(0,"sh-alert",13),x(1,0),l(2,"button",14),T("click",function(){S(e);let o=s(2);return f(o.testDestinationClick())}),r(),R(),r()}}function La(i,t){i&1&&(l(0,"sh-alert",13),x(1,1),O(2,"sh-icon"),l(3,"div",15),O(4,"sh-spinner"),r(),R(),r()),i&2&&(_(4),Ct("--spinner-size","16px")("--spinner-thickness","2px"))}function ba(i,t){i&1&&(l(0,"sh-alert",17),D(1,2),r())}function wa(i,t){i&1&&(l(0,"sh-alert",16),D(1,3),r())}function Ga(i,t){if(i&1&&g(0,ba,2,0,"sh-alert",17)(1,wa,2,0,"sh-alert",16),i&2){let e,n=s(4);C((e=n.testResponse())!=null&&e.containsBackup?0:1)}}function $a(i,t){i&1&&(l(0,"sh-alert",18),D(1,4),r())}function va(i,t){i&1&&(l(0,"sh-alert",16),D(1,5),r())}function Ua(i,t){i&1&&(l(0,"sh-alert",17),D(1,6),r())}function ka(i,t){if(i&1&&g(0,$a,2,0,"sh-alert",18)(1,va,2,0,"sh-alert",16)(2,Ua,2,0,"sh-alert",17),i&2){let e,n=s(4);C((e=n.testResponse())!=null&&e.containsBackup?0:(e=n.testResponse())!=null&&e.anyFilesFound?1:2)}}function Va(i,t){i&1&&(l(0,"sh-alert",17),D(1,7),r())}function Ba(i,t){i&1&&(l(0,"sh-alert",16),D(1,8),r())}function Ka(i,t){if(i&1&&g(0,Va,2,0,"sh-alert",17)(1,Ba,2,0,"sh-alert",16),i&2){let e,n=s(4);C((e=n.testResponse())!=null&&e.anyFilesFound?0:1)}}function Ja(i,t){i&1&&(l(0,"sh-alert",17),D(1,9),r())}function Xa(i,t){i&1&&(l(0,"sh-alert",17),D(1,10),r())}function za(i,t){i&1&&(l(0,"sh-alert",17),D(1,11),r())}function Wa(i,t){if(i&1&&g(0,Ja,2,0,"sh-alert",17)(1,Xa,2,0,"sh-alert",17)(2,za,2,0,"sh-alert",17),i&2){let e,n=s(4);C((e=n.testResponse())!=null&&e.containsBackup?0:(e=n.testResponse())!=null&&e.anyFilesFound?1:2)}}function Ha(i,t){if(i&1&&g(0,Ga,2,1)(1,ka,3,1)(2,Ka,2,1)(3,Wa,3,1),i&2){let e=s(3);C(e.testExpectation()==="containsBackup"?0:e.testExpectation()==="destinationEmpty"?1:e.testExpectation()==="destinationNotEmpty"?2:3)}}function ja(i,t){if(i&1){let e=I();x(0,12,1),l(1,"button",14),T("click",function(){S(e);let o=s(4);return f(o.createFolder())}),r(),R()}}function qa(i,t){if(i&1&&(l(0,"sh-alert",16),x(1,12),g(2,ja,2,0,"button",19),R(),r()),i&2){let e=s(3);_(2),C(e.askToCreate()?2:-1)}}function Qa(i,t){if(i&1){let e=I();l(0,"sh-alert",16),p(1),l(2,"button",14),T("click",function(){S(e);let o=s(3);return f(o.useSuggestedUrl())}),p(3,"Approve"),r()()}if(i&2){let e,n=s(3);_(),V(" ",(e=n.testResponse())==null?null:e.errorMessage," ")}}function Ya(i,t){if(i&1){let e=I();l(0,"sh-alert",16),p(1),l(2,"button",14),T("click",function(){S(e);let o=s(3);return f(o.useSuggestedUrl())}),p(3,"Approve"),r()()}if(i&2){let e,n=s(3);_(),V(" ",(e=n.testResponse())==null?null:e.errorMessage," ")}}function Za(i,t){if(i&1){let e=I();l(0,"sh-alert",16),p(1),l(2,"button",14),T("click",function(){S(e);let o=s(3);return f(o.testDestinationClick())}),p(3,"Test again"),r()()}if(i&2){let e,n=s(3);_(),V(" ",(e=n.testResponse())==null?null:e.errorMessage," ")}}function el(i,t){if(i&1&&g(0,Ha,4,1)(1,qa,3,1,"sh-alert",16)(2,Qa,4,1,"sh-alert",16)(3,Ya,4,1,"sh-alert",16)(4,Za,4,1,"sh-alert",16),i&2){let e,n=s(2);C(((e=n.testResponse())==null?null:e.action)==="success"?0:((e=n.testResponse())==null?null:e.action)==="missing-folder"?1:((e=n.testResponse())==null?null:e.action)==="trust-cert"?2:((e=n.testResponse())==null?null:e.action)==="approve-host-key"?3:((e=n.testResponse())==null?null:e.action)==="generic-error"?4:-1)}}function tl(i,t){if(i&1&&g(0,Ra,3,0,"sh-alert",13)(1,La,5,4,"sh-alert",13)(2,el,5,1),i&2){let e=s();C(e.testSignal()===null?0:e.testSignal()==="testing"?1:2)}}var zt=class i{#e=M(Xt);targetUrl=Le.required();testSignal=Le.required();connectionStringId=w(null);backupId=w.required();sourcePrefix=w.required();suppressErrorDialogs=w.required();askToCreate=w.required();readOnlyTest=w.required();testExpectation=w.required();moduleType=w.required();testResponse=P(()=>{let t=this.testSignal();return t&&typeof t!="string"?t:null});isExpectedValidTargetUrl=P(()=>{let t=this.targetUrl();return!(!t||!bt(t))});prevTargetUrl=null;targetUrlEffect=j(()=>{let t=this.targetUrl(),e=this.prevTargetUrl;t!==e&&(this.prevTargetUrl=t,this.testSignal()!=="testing"&&e!==null&&this.testSignal.set(null))});useSuggestedUrl(){let t=this.targetUrl(),e=this.testSignal(),n=e&&typeof e!="string"?e?.targetUrl:null,o=e&&typeof e!="string"?e?.suggestedUrl:null;return!t||!o||n!==t||(this.targetUrl.set(o),this.testDestinationClick()),!1}createFolder(){return this.testDestination(!0),!1}testDestinationClick(){return this.testDestination(!1),!1}testDestination(t){let e=this.targetUrl();if(!e)return;this.testSignal.set("testing");let n=t?"create":this.askToCreate()?"prompt":"error";return new Promise(o=>{this.#e.testDestination(e,this.backupId(),this.connectionStringId(),this.sourcePrefix(),0,this.moduleType(),this.suppressErrorDialogs(),n,this.readOnlyTest())?.subscribe({next:a=>{if(!this.suppressErrorDialogs()&&a.testAgain){let d=a.suggestedUrl;d&&this.targetUrl.set(d),this.testSignal.set("testing"),this.#e.testDestination(d??e,this.backupId(),this.connectionStringId(),this.sourcePrefix(),0,this.moduleType(),this.suppressErrorDialogs(),n,this.readOnlyTest())?.subscribe({next:c=>{this.testSignal.set(c),o(c)}})}else this.testSignal.set(a),o(a)}})})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=K({type:i,selectors:[["app-test-url"]],inputs:{targetUrl:[1,"targetUrl"],testSignal:[1,"testSignal"],connectionStringId:[1,"connectionStringId"],backupId:[1,"backupId"],sourcePrefix:[1,"sourcePrefix"],suppressErrorDialogs:[1,"suppressErrorDialogs"],askToCreate:[1,"askToCreate"],readOnlyTest:[1,"readOnlyTest"],testExpectation:[1,"testExpectation"],moduleType:[1,"moduleType"]},outputs:{targetUrl:"targetUrlChange",testSignal:"testSignalChange"},decls:1,vars:1,consts:()=>{let t;t=$localize` Make sure to test the configuration ${"\uFFFD#2\uFFFD"}:START_TAG_BUTTON:Test now${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_BUTTON:`;let e;e=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD#3\uFFFD"}:START_TAG_DIV: Testing connection... ${"\uFFFD#4\uFFFD"}:START_TAG_SH_SPINNER:${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_SPINNER:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_DIV:`;let n;n=$localize`Success! Test completed, backup found.`;let o;o=$localize`No backup found at the specified destination.`;let a;a=$localize` The remote destination already contains a backup. Please use a different folder for each backup. `;let d;d=$localize` The remote destination is not empty. It is recommended to use an empty folder for the backup. `;let c;c=$localize`Success! Test completed, destination is empty.`;let m;m=$localize`Success! Test completed, destination contains files.`;let F;F=$localize`The remote destination is empty.`;let N;N=$localize`Success! Test completed, backup found.`;let A;A=$localize`Success! Test completed, destination contains files.`;let L;L=$localize`Success! Test completed, destination is empty.`;let k;return k=$localize` The specified folder does not exist. ${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON:Create now${"\uFFFD/#1:1\uFFFD"}:CLOSE_TAG_BUTTON:${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:`,[t,e,n,o,a,d,c,m,F,N,A,L,k,[1,"simple","primary"],["shButton","",1,"primary","small",3,"click"],[1,"testing"],[1,"simple","warn"],[1,"simple","success"],[1,"simple","error"],["shButton","",1,"primary","small"]]},template:function(e,n){e&1&&g(0,tl,3,1),e&2&&C(n.isExpectedValidTargetUrl()?0:-1)},dependencies:[yt,q,ee,Pt],styles:["[_nghost-%COMP%]{display:block}.testing[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;gap:8px;justify-content:space-between}"],changeDetection:0})};function nl(i,t){if(i&1){let e=I();l(0,"app-destination-list",10),T("setDestination",function(o){S(e);let a=s();return f(a.setDestination(o))}),r()}if(i&2){let e=s();u("showAsSources",!0)("moduleType",e.moduleType())}}function il(i,t){if(i&1){let e=I();l(0,"app-destination-list-item",11)(1,"button",8),T("click",function(){S(e);let o=s();return f(o.removeDestination())}),D(2,3),r()(),l(3,"app-test-url",12),U("targetUrlChange",function(o){S(e);let a=s();return $(a.targetUrlModel,o)||(a.targetUrlModel=o),f(o)})("testSignalChange",function(o){S(e);let a=s();return $(a.testSignal,o)||(a.testSignal=o),f(o)}),r(),l(4,"app-single-destination",13),U("targetUrlChange",function(o){S(e);let a=s();return $(a.targetUrlModel,o)||(a.targetUrlModel=o),f(o)}),r()}if(i&2){let e=s();u("targetUrl",e.targetUrlModel()),_(3),v("targetUrl",e.targetUrlModel)("testSignal",e.testSignal),u("backupId",e.backupId())("sourcePrefix",e.sourcePrefix())("suppressErrorDialogs",e.suppressErrorDialogs())("askToCreate",e.askToCreate())("testExpectation",e.expectedResult())("readOnlyTest",!0)("moduleType",e.moduleType()),_(),v("targetUrl",e.targetUrlModel)}}function ol(i,t){i&1&&D(0,2,1)}function al(i,t){i&1&&D(0,2,2)}function ll(i,t){i&1&&D(0,2,3)}function rl(i,t){i&1&&D(0,2,4)}var st=class i{data=w();closed=Fe();targetUrlModel=h(null);moduleType=h("Backend");askToCreate=h(!1);expectedResult=h("any");suppressErrorDialogs=h(!1);backupId=h(null);sourcePrefix=h(null);dataEffect=j(()=>{let t=this.data();t?.targetUrlModel&&this.targetUrlModel.set(t.targetUrlModel),t?.moduleType&&this.moduleType.set(t.moduleType),t?.askToCreate!==null&&t?.askToCreate!==void 0&&this.askToCreate.set(t.askToCreate),t?.expectedResult&&this.expectedResult.set(t.expectedResult),t?.suppressErrorDialogs!==null&&t?.suppressErrorDialogs!==void 0&&this.suppressErrorDialogs.set(t.suppressErrorDialogs),t?.backupId&&this.backupId.set(t.backupId),t?.sourcePrefix&&this.sourcePrefix.set(t.sourcePrefix)});testSignal=h(null);setTargetUrl(t,e=!1){this.targetUrlModel.set(t)}setDestination(t){let e=Lt(t??"");if(e){if(e.mapper.default){let n=e.mapper.default("");this.setTargetUrl(n,!0);return}this.setTargetUrl(`${t}://`,!0)}}submit(){this.closed.emit(this.targetUrlModel())}removeDestination(){this.setTargetUrl(null,!0)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=K({type:i,selectors:[["app-target-url-dialog"]],inputs:{data:[1,"data"]},outputs:{closed:"closed"},decls:15,vars:6,consts:()=>{let t;t=$localize`Remote source`;let e;e=$localize`Cancel`;let n;n=$localize`${"\uFFFD*11:1\uFFFD"}:START_BLOCK_IF: Use storage destination ${"\uFFFD/*11:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*12:2\uFFFD"}:START_BLOCK_ELSE_IF: Use remote source ${"[\uFFFD/*12:2\uFFFD|\uFFFD/*13:3\uFFFD]"}:CLOSE_BLOCK_ELSE_IF:${"\uFFFD*13:3\uFFFD"}:START_BLOCK_ELSE_IF_1: Use remote destination ${"[\uFFFD/*12:2\uFFFD|\uFFFD/*13:3\uFFFD]"}:CLOSE_BLOCK_ELSE_IF:${"\uFFFD*14:4\uFFFD"}:START_BLOCK_ELSE: Use remote URL ${"\uFFFD/*14:4\uFFFD"}:CLOSE_BLOCK_ELSE:`,n=Ke(n);let o;return o=$localize`Change`,[t,e,n,o,[1,"title-30"],["content",""],[3,"showAsSources","moduleType"],["footer","",1,"sticky"],["shButton","","type","button",3,"click"],["shButton","","type","button",1,"raised","primary",3,"click","disabled"],[3,"setDestination","showAsSources","moduleType"],[1,"current-destination",3,"targetUrl"],[3,"targetUrlChange","testSignalChange","targetUrl","testSignal","backupId","sourcePrefix","suppressErrorDialogs","askToCreate","testExpectation","readOnlyTest","moduleType"],[3,"targetUrlChange","targetUrl"]]},template:function(e,n){if(e&1&&(l(0,"header")(1,"h3",4),D(2,0),r()(),l(3,"section",5),g(4,nl,1,2,"app-destination-list",6),g(5,il,5,11),r(),l(6,"footer",7)(7,"button",8),T("click",function(){return n.closed.emit(null)}),D(8,1),r(),l(9,"button",9),T("click",function(){return n.submit()}),x(10,2),g(11,ol,1,0)(12,al,1,0)(13,ll,1,0)(14,rl,1,0),R(),r()()),e&2){let o=!!n.targetUrlModel();_(4),C(o?-1:4),_(),C(o?5:-1),_(4),Ne("loading",n.testSignal()==="testing"),u("disabled",!o||n.testSignal()===null||n.testSignal()==="testing"),_(2),C(n.moduleType()==="Backend"?11:n.moduleType()==="SourceProvider"?12:n.moduleType()==="RestoreDestinationProvider"?13:14)}},dependencies:[Jt,Vt,et,q,zt],styles:["[_nghost-%COMP%]{--dialog-p: 1.5rem;display:flex;flex-direction:column;gap:1rem}header[_ngcontent-%COMP%]{display:flex;padding:1.5rem 1.5rem 0}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}footer[_ngcontent-%COMP%]{z-index:1}"],changeDetection:0})};var sl=["formRef"],_l=()=>({updateOn:"blur",standalone:!0}),Zt=()=>({standalone:!0});function dl(i,t){if(i&1){let e=I();l(0,"button",41),T("click",function(){S(e);let o=s(2);return f(o.openLocalDiskDialog())}),x(1,12),O(2,"sh-icon"),R(),r()}}function cl(i,t){if(i&1){let e=I();g(0,dl,3,0,"button",40),l(1,"button",41),T("click",function(){S(e);let o=s();return f(o.openRemoteDestinationDialog())}),x(2,11),O(3,"sh-icon"),R(),r()}if(i&2){let e=s();C(e.isLocalDiskSupported()?0:-1)}}function ul(i,t){i&1&&D(0,7,1)}function pl(i,t){i&1&&D(0,7,2)}function ml(i,t){i&1&&(l(0,"p",34),D(1,13),r())}function gl(i,t){i&1&&(l(0,"p",34),D(1,14),r())}function Cl(i,t){if(i&1){let e=I();l(0,"sh-form-field")(1,"textarea",42),U("ngModelChange",function(o){S(e);let a=s();return $(a.bulkPaths,o)||(a.bulkPaths=o),f(o)}),T("ngModelChange",function(){S(e);let o=s();return f(o.savePathBulkEdit())}),r()()}if(i&2){let e=s();_(),v("ngModel",e.bulkPaths),u("ngModelOptions",Ie(2,_l))}}function Tl(i,t){if(i&1){let e=I();l(0,"sh-form-field",46)(1,"input",47),U("ngModelChange",function(o){S(e);let a=s(3);return $(a.editingPath,o)||(a.editingPath=o),f(o)}),r()(),l(2,"button",24),T("click",function(){S(e);let o=s(3);return f(o.updatePath())}),l(3,"sh-icon"),p(4,"floppy-disk"),r()(),l(5,"button",24),T("click",function(){S(e);let o=s(3);return f(o.cancelEditPath())}),l(6,"sh-icon"),p(7,"x-bold"),r()()}if(i&2){let e=s(3);_(),v("ngModel",e.editingPath),u("ngModelOptions",Ie(2,Zt))}}function Sl(i,t){if(i&1&&(l(0,"sh-chip"),O(1,"img",48),p(2),r()),i&2){let e=s(2).$implicit,n=s(2);_(),u("src",n.getBackendIcon(e),pt),_(),V(" ",n.getRemotePathDisplayName(e)," ")}}function fl(i,t){if(i&1&&(l(0,"sh-form-field",46),O(1,"input",49),r()),i&2){let e=s(2).$implicit;gt("readonly",!0),_(),u("ngModel",e)("ngModelOptions",Ie(3,Zt))}}function El(i,t){if(i&1){let e=I();g(0,Sl,3,2,"sh-chip")(1,fl,2,4,"sh-form-field",46),l(2,"button",24),T("click",function(){S(e);let o=s().$implicit,a=s(2);return f(a.editPath(o))}),l(3,"sh-icon"),p(4,"pen"),r()(),l(5,"button",24),T("click",function(){S(e);let o=s().$implicit,a=s(2);return f(a.removePath(o))}),l(6,"sh-icon"),p(7,"trash-simple"),r()()}if(i&2){let e=s().$implicit;C(e.startsWith("@")?0:1)}}function hl(i,t){if(i&1&&(l(0,"div",43),g(1,Tl,8,3)(2,El,8,1),r()),i&2){let e=t.$implicit,n=s(2);_(),C(n.oldPath()===e?1:2)}}function Nl(i,t){if(i&1){let e=I();fe(0,hl,3,1,"div",43,Se),l(2,"div",39)(3,"sh-form-field"),O(4,"input",44),r(),l(5,"button",45),T("click",function(){S(e);let o=s();return f(o.addNewPath())}),l(6,"sh-icon"),p(7,"plus"),r()()()}if(i&2){let e=s();Ee(e.nonFilterPaths()),_(4),u("formControl",e.newPathCtrl)}}function Fl(i,t){if(i&1){let e=I();l(0,"div",39)(1,"app-size",50),T("ngModelChange",function(o){S(e);let a=s();return f(a.updateFilesLargerThan(o))}),r()()}if(i&2){let e=s();_(),u("ngModel",e.filesLargerThan())("ngModelOptions",Ie(2,Zt))}}var nt=new Dt,Jn=(i={path:"",filters:[],excludes:{filesLargerThan:null}})=>nt.group({path:nt.control(i.path),excludes:nt.group({filesLargerThan:nt.group({size:nt.control(null),unit:nt.control(null)})})}),Yt=class i{#e=M(Oe);#t=M(Ge);#n=M(we);#i=M(qe);#o=M(Ce);formRef=Pe.required("formRef");sourceDataForm=this.#e.sourceDataForm;sourceDataFormSignal=this.#e.sourceDataFormSignal;newPathCtrl=new Nn("");filesLargerThan=P(()=>{let t=this.sourceDataFormSignal()?.excludes?.filesLargerThan??{};return t.size!==null&&t.unit!==null?`${t.size}${t.unit}`:null});osType=this.#e.osType;pathSignal=Ue(this.sourceDataForm.controls.path.valueChanges);pathArray=P(()=>this.pathSignal()?.split("\0").filter(t=>t.startsWith("-")||t.startsWith("+")||t==="___none___")??[]);nonFilterPaths=P(()=>this.pathSignal()?.split("\0").filter(t=>!t.startsWith("-")&&!t.startsWith("+")&&t!==""));oldPath=h(null);editingPath=h(null);addingNewPath=h(!1);bulkPathEditMode=h(!1);bulkPaths=h("");mobileMenuOpen=h(!1);backupId=this.#e.backupId();isLocalDiskSupported=P(()=>this.#o.systemInfo()?.SourceProviderModules?.find(t=>t.Key=="diskimage"));filters=h([]);#s=j(()=>{let e=this.pathSignal()?.split("\0").filter(n=>n!=="___none___"&&(n.startsWith("-")||n.startsWith("+")))??[];this.filters.set(e)});openRemoteDestinationDialog(){this.#t.open(st,{maxWidth:"700px",maxHeight:"80vh",width:"100%",closeOnOutsideClick:!1,data:{targetUrlModel:null,moduleType:"SourceProvider",askToCreate:!1,expectedResult:"destinationNotEmpty",suppressErrorDialogs:!0,backupId:null,sourcePrefix:null}}).component.closed.subscribe(e=>{if(!e)return;let n=Math.random().toString(36).substring(2,10),o=e.split("://")[0],d=`@${this.#o.systemInfo()?.DirectorySeparator==="\\"?"X:\\":"/"}dupl-${o}-${n}|${e}`;this.addPath(d)})}openLocalDiskDialog(){this.#t.open(rt,{maxWidth:"700px",maxHeight:"80vh",width:"100%",closeOnOutsideClick:!1,data:{initialPath:null}}).closed.subscribe(e=>{if(!e)return;let n=Math.random().toString(36).substring(2,10),a=`@${this.#o.systemInfo()?.DirectorySeparator==="\\"?"X:\\":"/"}dupl-disk-${n}|diskimage://${e}`;this.addPath(a)})}togglePathBulkEdit(){if(this.bulkPathEditMode())this.bulkPathEditMode.set(!1);else{let t=this.nonFilterPaths()?.join(`
10
+ `)??"";this.bulkPaths.set(t),this.bulkPathEditMode.set(!0)}}savePathBulkEdit(){let t=this.bulkPaths().split(`
11
+ `).filter(a=>a.trim()!=="")??[],e=this.pathArray(),n=[...t,...e],o=[...new Set(n)].join("\0");this.sourceDataForm.controls.path.setValue(o)}editPath(t){if(t&&t.startsWith("@")){let e=t.split("|");if(e.length!==2)return;e[1].startsWith("diskimage://")?this.editLocalDiskSource(t,e[0],e[1].substring(12)):this.editTargetUrlPath(t,e[0],e[1]);return}this.oldPath.set(t),this.editingPath.set(t)}editLocalDiskSource(t,e,n){this.#t.open(rt,{maxWidth:"700px",maxHeight:"80vh",width:"100%",closeOnOutsideClick:!1,data:{initialPath:n}}).closed.subscribe(a=>{if(!a)return;let d=`${e}|diskimage://${a}`,c=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(c?.replace(t,d)??"")})}editTargetUrlPath(t,e,n){this.#t.open(st,{maxWidth:"700px",maxHeight:"80vh",width:"100%",closeOnOutsideClick:!1,data:{targetUrlModel:n,moduleType:"SourceProvider",askToCreate:!1,expectedResult:"destinationNotEmpty",suppressErrorDialogs:!0,backupId:this.#e.backupId(),sourcePrefix:e}}).closed.subscribe(a=>{if(!a)return;let d=`${e}|${a}`,c=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(c?.replace(t,d)??"")})}updateFilesLargerThan(t){let{size:e,unit:n}=wt(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"),o=n.indexOf(t);if(o===-1)return;n.splice(o,1);let a=n.filter(d=>d&&d!=="").join("\0");this.sourceDataForm.controls.path.setValue(a)}addPath(t){let n=[this.sourceDataForm.controls.path.value,t].filter(o=>o&&o!=="").join("\0");this.sourceDataForm.controls.path.setValue(n)}updateFilters(t){let n=[...this.nonFilterPaths()??[],...t].filter(o=>o&&o!=="").join("\0");this.sourceDataForm.controls.path.setValue(n)}getPath(){return this.sourceDataForm.value.path??null}getBackendIcon(t){if(!t)return"";let e=t.split("|")[1];return Rn(e)}getRemotePathDisplayName(t){if(!t)return"";let e=t.split("|")[1];return Ln(e)}toggleFilesLargerThan(t){t?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 o=n.filter(a=>a&&a!=="").join("\0");this.sourceDataForm.controls.path.setValue(o),this.newPathCtrl.setValue("")}goBack(){this.#n.navigate(["destination"],{relativeTo:this.#i.parent})}next(){this.#e.shouldAutoSave()&&this.#e.submit(!0),this.#n.navigate(["schedule"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=K({type:i,selectors:[["app-source-data"]],viewQuery:function(e,n){e&1&&ye(n.formRef,sl,5),e&2&&Ae()},decls:57,vars:18,consts:()=>{let t;t=$localize`Path`;let e;e=$localize`Source Data`;let n;n=$localize`Folder path`;let o;o=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let a;a=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let d;d=$localize`Options`;let c;c=$localize`Paths`;let m;m=$localize`${"\uFFFD#40\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#40\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD*41:1\uFFFD"}:START_BLOCK_IF: Edit contents as list ${"\uFFFD/*41:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*42:2\uFFFD"}:START_BLOCK_ELSE: Edit contents as text ${"\uFFFD/*42:2\uFFFD"}:CLOSE_BLOCK_ELSE:`;let F;F=$localize`Exclude`;let N;N=$localize`Choose if there’s any files you want to exclude.`;let A;A=$localize` Files larger than `;let L;L=$localize`${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:cloud-arrow-down${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON: Add remote path `;let k;k=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:hard-drive${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Add local disk `;let y;y=$localize`Manually add a path.`;let J;J=$localize`Edit paths as text, one per line.`;let X;X=$localize`Add a direct path`;let b;return b=$localize`Edit path`,[["formRef",""],e,n,o,a,d,c,m,F,N,A,L,k,y,J,[3,"submit","formGroup"],[1,"left"],[1,"header-row"],[1,"title-30"],["shButton","","type","button",1,"small","ghost","mobile-menu-toggle",3,"click"],[1,"fill",3,"multiSelect","startingPath","showFiles","showUnrootedSources","backupId"],["for","path"],["type","text","id","path","tabindex","4","placeholder",t,"formControlName","path"],[1,"form-actions"],["shButton","","type","button",1,"small",3,"click"],["shButton","","type","submit",1,"raised","primary","small"],[1,"right"],[1,"mobile-header"],["shButton","","type","button",1,"small","ghost",3,"click"],[3,"disableToggle"],["title",""],[1,"spacer"],["shButton","","type","button",1,"small"],["menu",""],["description",""],[1,"paths"],[3,"filtersChange","filters","osType"],["formGroupName","excludes",3,"disableToggle"],[1,"raised","primary",3,"checkedChange","checked"],[1,"row-inputs"],["shButton","","type","button",1,"small","rowbutton"],["shButton","","type","button",1,"small","rowbutton",3,"click"],["wrap","off","rows","10",1,"bulk-textarea",3,"ngModelChange","ngModel","ngModelOptions"],[1,"path"],["type","text","placeholder",X,3,"formControl"],["shButton","","type","button",1,"raised","primary",3,"click"],[1,"small"],["type","text","placeholder",b,3,"ngModelChange","ngModel","ngModelOptions"],["alt","Provider icon",1,"provider-icon",3,"src"],["type","text",3,"ngModel","ngModelOptions"],[3,"ngModelChange","ngModel","ngModelOptions"]]},template:function(e,n){if(e&1){let o=I();l(0,"form",15,0),T("submit",function(){return n.next()}),l(2,"div",16)(3,"div",17)(4,"h3",18),D(5,1),r(),l(6,"button",19),T("click",function(){return n.mobileMenuOpen.set(!0)}),l(7,"sh-icon"),p(8,"sliders"),r()()(),l(9,"app-file-tree",20)(10,"label",21),D(11,2),r(),O(12,"input",22),r(),l(13,"div",23)(14,"button",24),T("click",function(){return n.goBack()}),x(15,3),O(16,"sh-icon"),R(),r(),l(17,"button",25),x(18,4),O(19,"sh-icon"),R(),r()()(),l(20,"div",26)(21,"div",27)(22,"span",18),D(23,5),r(),l(24,"button",28),T("click",function(){return n.mobileMenuOpen.set(!1)}),l(25,"sh-icon"),p(26,"x-bold"),r()()(),l(27,"app-toggle-card",29),pe(28,30),l(29,"span"),D(30,6),r(),O(31,"div",31),g(32,cl,4,1),l(33,"sh-menu")(34,"button",32)(35,"sh-icon"),p(36,"dots-three-vertical"),r()(),pe(37,33),l(38,"button",24),T("click",function(){return n.togglePathBulkEdit()}),x(39,7),O(40,"sh-icon"),g(41,ul,1,0)(42,pl,1,0),R(),r(),de(),r(),de(),g(43,ml,2,0,"p",34)(44,gl,2,0,"p",34),l(45,"div",35),g(46,Cl,2,3,"sh-form-field")(47,Nl,8,1),r()(),l(48,"app-filters",36),U("filtersChange",function(d){return S(o),$(n.filters,d)||(n.filters=d),f(d)}),T("filtersChange",function(d){return n.updateFilters(d)}),r(),l(49,"app-toggle-card",37),pe(50,30),D(51,8),de(),l(52,"p",34),D(53,9),r(),l(54,"sh-toggle",38),T("checkedChange",function(d){return n.toggleFilesLargerThan(d)}),D(55,10),r(),g(56,Fl,2,3,"div",39),r()()()}e&2&&(u("formGroup",n.sourceDataForm),_(9),u("multiSelect",!0)("startingPath",n.getPath())("showFiles",!0)("showUnrootedSources",!0)("backupId",n.backupId),_(11),Ne("open",n.mobileMenuOpen()),_(7),u("disableToggle",!0),_(5),C(n.bulkPathEditMode()?-1:32),_(9),C(n.bulkPathEditMode()?41:42),_(2),C(n.bulkPathEditMode()?44:43),_(3),C(n.bulkPathEditMode()?46:47),_(2),v("filters",n.filters),u("osType",n.osType()??""),_(),u("disableToggle",!0),_(5),u("checked",n.filesLargerThan()!==null),_(2),C(n.filesLargerThan()?56:-1))},dependencies:[ie,Et,Y,Z,ft,ne,Qe,Fn,Ft,Nt,Dn,ue,ee,q,ve,Ye,kt,ke,ze,Gt,At],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}@media only screen and (max-width:768px){form[_ngcontent-%COMP%]{display:block;position:relative}}.right[_ngcontent-%COMP%], .left[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:1.5rem}.header-row[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}.mobile-header[_ngcontent-%COMP%]{display:none}@media only screen and (max-width:768px){.mobile-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:1.5rem}}.mobile-menu-toggle[_ngcontent-%COMP%]{display:none}@media only screen and (max-width:768px){.mobile-menu-toggle[_ngcontent-%COMP%]{display:inline-flex}}.left[_ngcontent-%COMP%]{padding:2.5rem;overflow:hidden;border-right:1px solid var(--base-4)}@media only screen and (max-width:768px){.left[_ngcontent-%COMP%]{border-right:none;padding:1.5rem 1.5rem 4.5rem;height:100%;width:100%}}.right[_ngcontent-%COMP%]{padding:2.5rem 1.5rem;overflow:auto}@media only screen and (max-width:768px){.right[_ngcontent-%COMP%]{position:absolute;inset:0;z-index:10;background:var(--base-1);padding:1.5rem;transform:translate(100%);transition:transform .3s cubic-bezier(.4,0,.2,1)}.right.open[_ngcontent-%COMP%]{transform:translate(0)}}.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}.path[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content min-content;gap:.25rem;align-items:center}.path[_ngcontent-%COMP%] sh-chip[_ngcontent-%COMP%]{width:100%}.path[_ngcontent-%COMP%] .provider-icon[_ngcontent-%COMP%]{width:1rem;height:1rem;margin-right:.5rem}.bulk-textarea[_ngcontent-%COMP%]{width:100%;font-family:monospace;min-height:12.5rem}.paths[_ngcontent-%COMP%]{max-height:200px;overflow-y:auto;display:flex;flex-direction:column;gap:.5rem}"],changeDetection:0})};var Xn="1W:1D,4W:1W,12M:1M",en=!1,Oe=class i{#e=M(we);#t=M(Ce);#n=M(Ge);#i=M(xt);#o=M(Rt);#s=M($t);#a=M(Ze);generalForm=zn();sourceDataForm=Jn();scheduleFields=Qt();scheduleType=h("daily");settings=h([]);optionsFields={backupRetention:h("all"),backupRetentionTime:h(""),backupRetentionVersions:h(0),backupRetentionCustom:h("")};targetUrls=h([]);targetUrlModel=P(()=>this.targetUrls()[0]?.url??null);connectionStringId=P(()=>this.targetUrls()[0]?.connectionStringId??null);targetUrlTestSignal=h(null);backupMetadata=h(null);isDraft=h(!1);backupId=h(null);backupName=P(()=>this.generalFormSignal()?.name??"");isSubmitting=h(!1);finishedLoading=h(!1);backupDefaults=h(null);applicationOptions=h(null);isNew=P(()=>this.backupId()==="new");shouldAutoSave=P(()=>!this.isDraft()&&!this.isNew());osType=P(()=>this.#t.systemInfo()?.OSType);isConnectionStringSaved=P(()=>{let t=this.targetUrlModel();return t?this.#a.destinations().some(e=>e.BaseUrl===t):!1});selectedOptions=h([]);sourceDataFormSignal=Ue(this.sourceDataForm.valueChanges);generalFormSignal=Ue(this.generalForm.valueChanges);encryptionFieldSignal=Ue(this.generalForm.controls.encryption.valueChanges);advancedOptions=P(()=>this.#t.systemInfo()?.Options?.map(this.#u)??[]);#l=h(null);#r=null;testSignal=this.#l.asReadonly();#_=j(()=>{let t=this.targetUrlModel(),e=this.#l(),n=this.#r;this.#r=t,!(e==="testing"||n===null||n===t)&&this.#l.set(null)});#g=j(()=>{let t=this.targetUrlModel(),e=this.connectionStringId();if(e){let n=this.#a.destinations();if(n.length===0)return;let o=n.find(a=>a.ID===e);!o||o.BaseUrl}});setTestState(t){this.#l.set(t)}#u(t){return{name:t.Name,type:t.Type,shortDescription:t.ShortDescription??void 0,longDescription:t.LongDescription??void 0,options:t.ValidValues}}encryptionOptions=P(()=>{let t=this.#t.systemInfo()?.EncryptionModules??[];return[_t,...t]});nonSelectedOptions=P(()=>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),this.#p().pipe(ct(e=>{let n=this.#d(),o=this.backupId(),a=n;if(a.Backup){e.length>0&&e[0]!==null?n.Backup.ConnectionStringID=e[0]:e.length>0&&e[0]===null&&(n.Backup.ConnectionStringID=void 0);let c=this.targetUrls().slice(1).map((m,F)=>{let N=e[F+1];return{TargetUrl:m.url,ConnectionStringID:N??void 0,UrlKey:m.urlKey}});c.length>0&&(a.Backup.AdditionalTargetURLs=c)}return this.isDraft()&&n.Backup&&(n.Backup.Metadata=this.backupMetadata()),o==="new"||!o||this.isDraft()?this.#i.postApiV1Backups({requestBody:n}):this.#i.putApiV1BackupById({id:o,requestBody:n})}),Be(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{t||this.exit(!1)},error:()=>{}})}validateBeforeSubmit(){this.generalForm.markAllAsTouched(),this.sourceDataForm.markAllAsTouched();let t=this.#d(),e=(t.Backup.Name??"").trim()!=="",o=(this.generalForm.controls.encryption.value!==""&&this.generalForm.controls.encryption.value!=="-")===!1||this.generalForm.controls.password.value===this.generalForm.controls.repeatPassword.value&&this.generalForm.controls.password.value!=="";if(!e||!o)return this.#n.open(ae,{data:{title:$localize`Validation Error`,message:this.isNew()?$localize`Please fix the errors indicated before creating the backup.`:$localize`Please fix the errors indicated before saving.`,confirmText:$localize`OK`}}),"general";let a=this.targetUrls();if(!(a.length>0&&a.some(m=>m.url.trim()!=="")))return this.#n.open(ae,{data:{title:$localize`Destination required`,message:this.isNew()?$localize`You must setup a destination before creating the backup.`:$localize`Please setup a destination before saving.`,confirmText:$localize`OK`}}),"destination";var c=(t.Backup.Sources??[]).filter(m=>m.trim()!=="").length>0;return!c||!this.sourceDataForm.valid?(this.#n.open(ae,{data:{title:$localize`Source data required`,message:this.isNew()?$localize`You must setup source data before creating the backup.`:$localize`Please add at least one source path before saving.`,confirmText:$localize`OK`}}),"source"):""}exit(t){if(!t){this.#c(),this.#e.navigate(["/"]);return}this.#n.open(ae,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:e=>{e&&(this.#c(),this.#e.navigate(["/"]))}})}mapSourceDataToForm(t){let e=t.Sources??"",n=t.Filters?.map(d=>`${d.Include?"+":"-"}${d.Expression}`)??[],o=t.Settings?.find(d=>d.Name==="--skip-files-larger-than")?.Value?.toUpperCase()??null,a={path:[...e,...n].join("\0"),excludes:{filesLargerThan:o===null?void 0:wt(o)}};this.sourceDataForm.patchValue(a)}mapDestinationToForm(t){let e=t,n=t.TargetURL??"",o=(t.ConnectionStringID===-1?null:t.ConnectionStringID)??null,a=n?[{url:n,connectionStringId:o,urlKey:null,save:!!o}]:[],d=e.AdditionalTargetURLs?.map(c=>({url:c.TargetUrl,urlKey:c.UrlKey,connectionStringId:c.ConnectionStringID??null,save:!!c.ConnectionStringID}))??[];this.targetUrls.set([...a,...d])}mapGeneralToForm(t){let e=t.Name??"",n=t.Description??"",o=t.Settings?.find(m=>m.Name==="encryption-module"),a=t.Settings?.find(m=>m.Name==="passphrase")?.Value??"",d=o?.Value&&o.Value.length?o.Value:"",c={name:t.Name??"",description:t.Description??""};e&&e!==""&&(c.name=e),n&&n!==""&&(c.description=n),d&&d!==""&&(c.encryption=d),a&&a!==""&&(c.password=a,c.repeatPassword=a),this.generalForm.patchValue(c)}mapScheduleToForm(t){if(!t){this.scheduleType.set("disabled"),this.scheduleFields.autoRun.set(!1);return}let e=this.#s.fromString(t.Repeat)??null,n=this.#m(t.Time);this.scheduleFields.autoRun.set(!0),n.date&&this.scheduleFields.nextTime.date.set(n.date),this.scheduleFields.nextTime.time.set(n.time),this.scheduleFields.runAgain.repeatUnit.set(e?.unit??"D"),this.scheduleFields.runAgain.repeatValue.set(e?.value??1),this.scheduleFields.runAgain.allowedDays.mon.set(t.AllowedDays?.includes("mon")??!1),this.scheduleFields.runAgain.allowedDays.tue.set(t.AllowedDays?.includes("tue")??!1),this.scheduleFields.runAgain.allowedDays.wed.set(t.AllowedDays?.includes("wed")??!1),this.scheduleFields.runAgain.allowedDays.thu.set(t.AllowedDays?.includes("thu")??!1),this.scheduleFields.runAgain.allowedDays.fri.set(t.AllowedDays?.includes("fri")??!1),this.scheduleFields.runAgain.allowedDays.sat.set(t.AllowedDays?.includes("sat")??!1),this.scheduleFields.runAgain.allowedDays.sun.set(t.AllowedDays?.includes("sun")??!1);let o=lt(this.scheduleFields),a=vt.find(d=>JSON.stringify(d.data)===JSON.stringify(o));a?this.scheduleType.set(a.value):this.scheduleType.set("custom")}mapOptionsToForms(t,e=!1){let n=["--no-encryption","--skip-files-larger-than","passphrase","keep-time","keep-versions","retention-policy"],o=(t.Settings??[]).map(m=>m);if(e){let m=this.#o.serverSettings()??{};Object.keys(m).filter(F=>F.startsWith("--")).forEach(F=>{o.find(A=>A.Name===F)||o.push({Name:F,Value:m[F],Filter:null})})}let a=o.filter(m=>!n.includes(m.Name)),d=o.filter(m=>n.includes(m.Name));this.settings.set(a??[]),a?.forEach(m=>{if(m.Name==="encryption-module"&&this.isNew())return this.generalForm.controls.encryption.setValue(m.Value??"")});var c="all";d?.forEach(m=>{if(m.Name==="keep-time"&&(m.Value??"")!=="")return c="time",this.optionsFields.backupRetentionTime.set(m.Value??"");if(m.Name==="keep-versions"&&(m.Value??"")!=="")return c="versions",this.optionsFields.backupRetentionVersions.set(m.Value?parseInt(m.Value):null);if(m.Name==="retention-policy"&&(m.Value??"")!=="")if(m.Value===Xn)c="smart";else return c="custom",this.optionsFields.backupRetentionCustom.set(m.Value??"")}),this.optionsFields.backupRetention.set(c)}storeMetadata(t,e){this.backupMetadata.set(e?t.Metadata??null:null)}getScheduleFormValue(){let t=lt(this.scheduleFields);return Kn(t)}#d(){let t=this.generalForm.value,e=this.getScheduleFormValue(),n=this.sourceDataForm.value,a=this.targetUrls()[0],d=a?.url??null,c=n.path?.split("\0")??[],m=this.mapFormsToSettings(),F=n.excludes?.filesLargerThan;return F&&F.size!==null&&F.unit!==null&&m.push({Name:"--skip-files-larger-than",Value:`${F.size}${F.unit}`}),{Backup:{Name:t.name,Description:t.description,TargetURL:d??null,ConnectionStringID:a?.connectionStringId??null,Sources:c.filter(N=>!(N.startsWith("-")||N.startsWith("+"))),Settings:m,Filters:c.filter(N=>N.startsWith("-")||N.startsWith("+")).map((N,A)=>({Order:A,Include:N.startsWith("+"),Expression:N.slice(1)}))},Schedule:e}}mapFormsToSettings(t=[]){let e=this.generalForm.value,n=["dblock-size","compression-module"],o=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","encryption-module","passphrase","keep-time","keep-versions","retention-policy",...n,...n.map(N=>`--${N}`)],a=[{Name:"--no-encryption",Value:"True"}];e.encryption!==""&&e.encryption!==_t.Key&&(a=[{Name:"encryption-module",Value:e.encryption??null},{Name:"passphrase",Value:e.password??null}]);let d=n.map(N=>{let A=this.settings().find(L=>L.Name===N||L.Name==="--"+N);return A?{Name:N,Value:A.Value}:null}).filter(N=>N!==null),c=[];switch(this.optionsFields.backupRetention()){case"time":c.push({Name:"keep-time",Value:this.optionsFields.backupRetentionTime()});break;case"versions":c.push({Name:"keep-versions",Value:this.optionsFields.backupRetentionVersions()?.toString()??""});break;case"custom":c.push({Name:"retention-policy",Value:this.optionsFields.backupRetentionCustom()});break;case"smart":c.push({Name:"retention-policy",Value:Xn});break}let m=[...t,...o],F=this.settings().filter(N=>!m.includes(N.Name)).map(N=>{let A=N.Value;return typeof N.Value=="number"&&(A=N.Value.toString()),typeof N.Value=="boolean"&&(A=N.Value?"True":"False"),{Name:N.Name?.startsWith("--")?N.Name:`--${N.Name}`,Value:A}});return[...a,...d,...c,...F]}#p(){let t=this.targetUrls();if(t.length===0)return Ve([]);let e=t.map(n=>{if(n.connectionStringId)return Ve(n.connectionStringId);if(!n.save)return Ve(null);let o=n.url,d=Xe(o)?.displayName??"Destination",m=this.#a.destinations().filter(A=>A.Name?.startsWith(d)).length,N={Name:`${d} ${new Date().toISOString()}`,Description:null,BaseUrl:o};return this.#a.save("new",N).pipe(ot(A=>A.Data?.ID??null))});return _n(e).pipe(pn(n=>{let o=this.targetUrls();n.forEach((a,d)=>{if(a&&d<o.length&&(this.#a.reload(),o[d].connectionStringId!==a)){let c=o[d].urlKey;this.updateTargetUrl(d,o[d].url,a,c)}})}))}#m(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.getFullYear()).padStart(4,"0")}-${(""+(e.getMonth()+1)).padStart(2,"0")}-${(""+e.getDate()).padStart(2,"0")}`}}setTargetUrl(t,e=!1,n=null,o=null){if(e&&(this.#r=null),t===null){this.targetUrls.set([]);return}this.targetUrls.update(a=>{let d=[...a];return d.length===0?d.push({url:t,urlKey:o,connectionStringId:n,save:n?!0:en}):d[0]={url:t,urlKey:o,connectionStringId:n,save:n?!0:en},d})}addTargetUrl(t,e,n){this.targetUrls.update(o=>[...o,{url:t,connectionStringId:e,urlKey:n,save:e?!0:en}])}updateTargetUrl(t,e,n,o){this.targetUrls.update(a=>{if(t<0||t>=a.length)return a;let d=[...a],c=d[t].save;return d[t]={url:e,connectionStringId:n,urlKey:o,save:n?!0:c},d})}toggleSaveConnectionString(t){this.targetUrls.update(e=>{if(t<0||t>=e.length)return e;let n=[...e];return n[t]=le(W({},n[t]),{save:!n[t].save}),n})}removeTargetUrl(t){this.targetUrls.update(e=>e.filter((n,o)=>o!==t))}#c(){this.generalForm.reset(),this.sourceDataForm.reset(),this.scheduleFields=Qt(),this.optionsFields.backupRetention.set("all"),this.settings.set([]),this.targetUrls.set([])}static \u0275fac=function(e){return new(e||i)};static \u0275prov=De({token:i,factory:i.\u0275fac,providedIn:"root"})};var Dl=["formRef"];function yl(i,t){i&1&&(l(0,"sh-alert",17),x(1,5),O(2,"sh-icon",26),R(),r())}function Al(i,t){if(i&1&&p(0),i&2){let e=t.$implicit;V(" ",e.DisplayName," ")}}function Il(i,t){if(i&1&&O(0,"sh-progress-bar",40),i&2){let e=s(3);Ne("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),u("value",e.calculatePasswordStrength()*(100/5))}}function Pl(i,t){i&1&&(l(0,"span",35),D(1,10),r())}function Ol(i,t){i&1&&(x(0,8,1),O(1,"sh-icon"),R())}function Ml(i,t){i&1&&(x(0,8,2),O(1,"sh-icon"),R())}function xl(i,t){i&1&&(x(0,11,1),O(1,"sh-icon",42),R())}function Rl(i,t){i&1&&(x(0,11,2),O(1,"sh-icon"),R())}function Ll(i,t){if(i&1){let e=I();l(0,"button",41),T("click",function(){S(e);let o=s(3);return f(o.copyPassword())}),x(1,11),g(2,xl,2,0)(3,Rl,2,0),R(),r()}if(i&2){let e=s(3);_(2),C(e.copiedPassword()?2:3)}}function bl(i,t){i&1&&(l(0,"sh-alert",39),D(1,12),r())}function wl(i,t){if(i&1){let e=I();l(0,"div",30)(1,"sh-form-field")(2,"label",31),x(3,7),O(4,"sup"),R(),r(),O(5,"input",32),r(),g(6,Il,1,9,"sh-progress-bar",33),l(7,"sh-form-field"),O(8,"input",34),g(9,Pl,2,0,"span",35),r(),l(10,"div",36)(11,"button",37),T("click",function(){S(e);let o=s(2);return f(o.showPassword.set(!o.showPassword()))}),x(12,8),g(13,Ol,2,0)(14,Ml,2,0),R(),r(),l(15,"button",37),T("click",function(){S(e);let o=s(2);return f(o.generatePassword())}),x(16,9),O(17,"sh-icon"),R(),r(),g(18,Ll,4,1,"button",38),r(),g(19,bl,2,0,"sh-alert",39),r()}if(i&2){let e=s(2);_(5),u("type",e.showPassword()?"text":"password"),_(),C(e.generalForm.value.password?6:-1),_(2),u("type",e.showPassword()?"text":"password"),_(),C(e.generalForm.value.repeatPassword&&e.generalForm.value.repeatPassword!==e.generalForm.value.password?9:-1),_(4),C(e.showPassword()?13:14),_(5),C(e.showCopyPassword()?18:-1),_(),C(e.generalForm.value.password&&e.generalForm.value.password===e.generalForm.value.repeatPassword?19:-1)}}function Gl(i,t){if(i&1&&(l(0,"sh-select",27)(1,"label",28),D(2,6),r(),O(3,"input",29),H(4,Al,1,1,"ng-template"),r(),g(5,wl,20,7,"div",30)),i&2){let e=s();u("options",e.encryptionOptions())("isClearable",!1),_(5),C(e.encryptionFieldSignal()!==e.noneOptionKey?5:-1)}}function $l(i,t){if(i&1&&(l(0,"button",24),x(1,13),O(2,"sh-icon"),R(),r()),i&2){let e=s();u("disabled",e.nameAndDescriptionValid()===!1)}}function vl(i,t){if(i&1&&(l(0,"button",25),x(1,14),O(2,"sh-icon"),R(),r()),i&2){let e=s();u("disabled",e.generalForm.invalid||e.showCopyPassword()&&!e.copiedPassword())}}var it=new Dt,zn=(i={name:"",description:"",encryption:"",password:"",repeatPassword:"",compression:""})=>it.group({name:it.control(i.name,[St.required]),description:it.control(i.description),encryption:it.control(i.encryption,[Vn()]),password:it.control(i.password,[jt(t=>t?.value.encryption!=="-",[St.required])]),repeatPassword:it.control(i.repeatPassword,[jt(t=>t?.value.encryption!=="-",[St.required])])}),_t={Key:"-",DisplayName:"None"},tn=class i{#e=M(we);#t=M(qe);#n=M(kn);#i=M(Oe);formRef=Pe.required("formRef");generalForm=this.#i.generalForm;generalFormSignal=this.#i.generalFormSignal;encryptionFieldSignal=this.#i.encryptionFieldSignal;encryptionOptions=this.#i.encryptionOptions;isNew=this.#i.isNew;showPassword=h(!1);copiedPassword=h(!1);showCopyPassword=h(!1);noneOptionKey=_t.Key;encryptionEffect=j(()=>{this.encryptionFieldSignal()===_t.Key&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});nameAndDescriptionValid=P(()=>{let t=this.generalFormSignal(),e=this.generalForm.controls;return e?.name&&e.name.valid&&e?.description&&e.description.valid});calculatePasswordStrength=P(()=>{let e=this.generalFormSignal()?.password??"";return this.#n.calculatePasswordStrength(e)});ngOnInit(){this.formRef().nativeElement.focus()}exit(){this.#i.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.#n.generate(41);this.generalForm.controls.password.setValue(t),this.generalForm.controls.repeatPassword.setValue(t),this.showCopyPassword.set(!0)}next(){this.#i.shouldAutoSave()&&this.#i.submit(!0),this.#e.navigate(["destination"],{relativeTo:this.#t.parent})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=K({type:i,selectors:[["app-general"]],viewQuery:function(e,n){e&1&&ye(n.formRef,Dl,5),e&2&&Ae()},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 o;o=$localize`General backup settings`;let a;a=$localize` Backup name ${"\uFFFD#8\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#8\uFFFD"}:CLOSE_SUPERSCRIPT:`;let d;d=$localize`Backup description`;let c;c=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON: Exit `;let m;m=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:lock${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Encrypted backup `;let F;F=$localize`Encryption`;let N;N=$localize`Encryption`;let A;A=$localize`Password`;let L;L=$localize`Repeat password`;let k;k=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let y;y=$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:`,y=Ke(y);let J;J=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Generate password `;let X;X=$localize`Passwords do not match`;let b;b=$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:`,b=Ke(b);let G;G=$localize` Tip: Be sure to save your password. If you lose it, you will lose access to your backups. `;let Me;Me=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let xe;return xe=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],o,a,d,c,m,N,k,y,J,X,b,G,Me,xe,["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",F,"formControlName","encryption"],[1,"passwords"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",A,"formControlName","password",3,"type"],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",L,"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&&(l(0,"form",15,0),T("submit",function(){return n.next()}),l(2,"h3",16),D(3,1),r(),g(4,yl,3,0,"sh-alert",17),l(5,"sh-form-field")(6,"label",18),x(7,2),O(8,"sup"),R(),r(),O(9,"input",19),r(),l(10,"sh-form-field")(11,"label",20),D(12,3),r(),O(13,"textarea",21),r(),g(14,Gl,6,3),l(15,"div",22)(16,"button",23),T("click",function(){return n.exit()}),x(17,4),O(18,"sh-icon"),R(),r(),g(19,$l,3,1,"button",24)(20,vl,3,1,"button",25),r()()),e&2){let o;u("formGroup",n.generalForm),_(4),C(!n.isNew()&&((o=n.generalFormSignal())==null?null:o.encryption)!==""?4:-1),_(10),C(n.isNew()?14:-1),_(5),C(n.encryptionFieldSignal()===n.noneOptionKey||!n.isNew()?19:20)}},dependencies:[Qe,Et,Y,Z,ft,Ft,Nt,ue,$e,q,ee,It,yt,Mt],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{Ze as a,et as b,Vt as c,zn as d,_t as e,tn as f,vt as g,Kn as h,Qt as i,qt as j,ze as k,kt as l,zt as m,st as n,Jn as o,Yt as p,Oe as q,Jt as r};
@@ -0,0 +1 @@
1
+ import{c as rt,d as st}from"./chunk-OVNIENWW.js";import{a as tt}from"./chunk-COEGVUM3.js";import{c as ot}from"./chunk-2KD757N6.js";import{a as it}from"./chunk-PEOYNJJM.js";import{a as nt}from"./chunk-MWQHWJOA.js";import{A as Xe,B as _e,H as Z,J as qe,K as Ke,L as Qe,P as Ye,W as Ze,a as ge,c as q,e as K,i as Q,k as me,s as Y,v as je,w as He,y as Ue,z as Je}from"./chunk-CJKZ27FM.js";import{d as et}from"./chunk-4V3AE4ZE.js";import{aa as ze}from"./chunk-YF6JHIN5.js";import{$ as se,Ac as he,B as fe,Bb as le,Bc as ke,Cb as ce,Cc as pe,Db as N,Dc as Be,Eb as p,Fb as h,G as Ce,Gb as ne,Gc as $e,Jc as We,Kb as Re,Kc as Ve,Lb as xe,M as ve,Mb as Pe,Nb as V,Qa as Oe,Rc as y,Ta as m,Ub as De,Vb as we,Wb as A,Wc as Ge,Xb as ie,Xc as f,Yb as oe,Yc as Te,_b as G,ac as _,bc as X,cc as D,ea as R,fa as x,hb as J,hc as Ie,ic as Le,jc as Me,kc as de,l as re,lc as z,mb as te,oc as v,pc as Ee,q as W,qa as b,qc as Ae,rc as ue,sa as L,tc as k,uc as B,vc as $,w as ye,wb as ae,x as Ne,xb as O,yb as F,zb as Fe}from"./chunk-K5XGRFWJ.js";import{a as H,b as U}from"./chunk-7CGTOI24.js";var _t=["treeContainer"],ft=["formRef"],Ct=[[["label"]],[["label"]],[["input"]]],Pt=["label","label","input"],Mt=r=>({children:r,level:0}),dt=r=>({$implicit:r}),Et=(r,t)=>({children:r,level:t}),Tt=()=>({maxWidth:"700px",width:"100%"}),bt=(r,t)=>t.id;function St(r,t){if(r&1){let e=V();p(0,"sh-button-group",22),$("valueChange",function(i){R(e);let o=_();return B(o.pathDiscoveryMethod,i)||(o.pathDiscoveryMethod=i),x(i)}),p(1,"button",23),A(2,4),h(),p(3,"button",24),A(4,5),h()()}if(r&2){let e=_();k("value",e.pathDiscoveryMethod)}}function yt(r,t){r&1&&ne(0,"sh-progress-bar",14)}function Nt(r,t){r&1&&(p(0,"sh-icon",30),v(1,"caret-down"),h())}function vt(r,t){r&1&&ne(0,"sh-icon",30)}function Ot(r,t){r&1&&(p(0,"sh-icon",30),v(1,"spinner"),h())}function Ft(r,t){r&1&&(p(0,"sh-icon",30),v(1,"caret-right"),h())}function Rt(r,t){if(r&1&&ne(0,"img",31),r&2){let e=_(3).$implicit;N("src",e.customIcon,Oe)}}function xt(r,t){r&1&&(p(0,"sh-icon",27),v(1,"folder-open"),h())}function Dt(r,t){r&1&&(p(0,"sh-icon",27),v(1,"folder-user"),h())}function wt(r,t){r&1&&(p(0,"sh-icon",27),v(1,"file"),h())}function It(r,t){r&1&&(p(0,"sh-icon",27),v(1,"folder"),h())}function Lt(r,t){if(r&1&&(O(0,Nt,2,0,"sh-icon",30)(1,vt,1,0,"sh-icon",30)(2,Ot,2,0,"sh-icon",30)(3,Ft,2,0,"sh-icon",30),O(4,Rt,1,1,"img",31)(5,xt,2,0,"sh-icon",27)(6,Dt,2,0,"sh-icon",27)(7,wt,2,0,"sh-icon",27)(8,It,2,0,"sh-icon",27)),r&2){let e=_(2).$implicit,n=_(2);F(e.children.length?0:e.cls==="file"?1:e.id===n.isLoading()?2:3),m(4),F(e.customIcon?4:e.children.length?5:e.id==="%HOME%"?6:e.cls==="file"?7:8)}}function At(r,t){r&1&&(p(0,"sh-icon",27),v(1,"desktop-tower"),h())}function kt(r,t){if(r&1&&(p(0,"span",29),v(1),$e(2,"bytes"),h()),r&2){let e=_(2).$implicit;m(),Ae("\xA0(",We(2,1,e.fileSize,!0,!0),")")}}function Bt(r,t){r&1&&Pe(0)}function $t(r,t){if(r&1&&te(0,Bt,1,0,"ng-container",15),r&2){let e=_(2).$implicit,n=_().$implicit;_();let i=Me(7);N("ngTemplateOutlet",i)("ngTemplateOutletContext",pe(5,dt,Be(2,Et,e.children,n.level+1)))}}function Wt(r,t){if(r&1){let e=V();p(0,"div",25,3),G("click",function(i){R(e);let o=_().$implicit,s=_(2);return x(s.toggleSelectedNode(i,o))}),p(2,"div",26),G("click",function(i){R(e);let o=_().$implicit,s=_(2);return x(s.toggleNode(i,o.id,o))}),O(3,Lt,9,2)(4,At,2,0,"sh-icon",27),h(),p(5,"div",28)(6,"span"),v(7),h(),O(8,kt,3,5,"span",29),h()(),O(9,$t,1,7,"ng-container")}if(r&2){let e=_().$implicit,n=_().$implicit,i=_();z("accepted",e.accepted===!0)("active",e.evalState===i.TreeEvalEnum.Included)("indeterminate",e.isIndeterminate)("open",e.children.length)("usually-hidden",e.hidden)("root",n.level===0)("loading",i.isLoading()===e.id)("generated",e.isGenerated)("search-match",e.isSearchMatch),m(2),z("file",e.cls==="file"),m(),F(e.id!=="/"?3:4),m(4),Ee(e.text),m(),F(e.cls=="file"&&e.fileSize!=null&&e.fileSize>=0?8:-1),m(),F(e.children.length>0?9:-1)}}function Vt(r,t){if(r&1&&O(0,Wt,10,24),r&2){let e=t.$implicit,n=_(2);F(e.hidden&&n._showHiddenNodes()||!e.hidden?0:-1)}}function Gt(r,t){if(r&1&&(p(0,"sh-list"),le(1,Vt,1,1,null,null,bt),h()),r&2){let e=t.$implicit;de("padding-left",e.level*.25,"rem"),m(),ce(e.children)}}function zt(r,t){r&1&&Pe(0)}function jt(r,t){if(r&1){let e=V();p(0,"sh-toggle",32),$("checkedChange",function(i){R(e);let o=_();return B(o._showHiddenNodes,i)||(o._showHiddenNodes=i),x(i)}),A(1,6),h()}if(r&2){let e=_();k("checked",e._showHiddenNodes),m(),ie(e.showFiles()?"files":"folders"),oe(1)}}function Ht(r,t){if(r&1){let e=V();p(0,"button",33),G("click",function(){R(e);let i=_();return x(i.openCreateFolderDialog())}),A(1,7),h()}if(r&2){let e=_();N("disabled",!e.isCurrentPathFolder())}}function Ut(r,t){if(r&1&&(p(0,"sh-alert",20),v(1),h()),r&2){let e=_();N("color","error"),m(),Ee(e.errorMessage())}}function Jt(r,t){if(r&1){let e=V();p(0,"sh-dialog",34),$("isOpenChange",function(i){R(e);let o=_();return B(o.createFolderDialogOpen,i)||(o.createFolderDialogOpen=i),x(i)}),p(1,"header",35)(2,"h2"),A(3,8),h()(),p(4,"div",36)(5,"div",37)(6,"p"),A(7,9),h(),p(8,"div",38)(9,"pre"),v(10),h()()(),p(11,"sh-form-field")(12,"textarea",39),$("ngModelChange",function(i){R(e);let o=_();return B(o.createFolderPath,i)||(o.createFolderPath=i),x(i)}),h()()(),p(13,"footer",40)(14,"button",41),G("click",function(){R(e);let i=_();return x(i.closeCreateFolderDialog(!1))}),v(15,"Cancel"),h(),p(16,"button",42),G("click",function(){R(e);let i=_();return x(i.closeCreateFolderDialog(!0))}),De(17,10),ne(18,"sh-icon"),we(),h()()()}if(r&2){let e,n=_();k("isOpen",n.createFolderDialogOpen),N("options",ke(6,Tt)),m(10),ue("",n.currentPathResolved(),"",n.createFolderPath()?"/"+n.createFolderPath():""),m(2),k("ngModel",n.createFolderPath),m(4),N("disabled",!((e=n.createFolderPath())!=null&&e.length))}}var ut=(o=>(o[o.ExcludedByParent=-2]="ExcludedByParent",o[o.Excluded=-1]="Excluded",o[o.None=0]="None",o[o.Included=1]="Included",o[o.IncludedByParent=2]="IncludedByParent",o))(ut||{}),S="/",ee=!0,be=class r{#e=se(et);#t=se(nt);#S=se(Je);multiSelect=f(!1);disabled=f(!1);showFiles=f(!1);selectFiles=f(!1);onlySelectFolder=f(!1);accepts=f(null);startingPath=f(null);rootPaths=f([]);initialNodes=f([]);backupSettings=f(null);pathRefreshTrigger=f(!1);showHiddenNodes=f(!1);enableCreateFolder=f(!1);hideShortcuts=f(!1);resolvePaths=f(!1);customRemoteMode=f(null);showUnrootedSources=f(!1);backupId=f("");connectionStringId=f(null);sourcePrefix=f("");destinationUrl=f("");loadExtendedData=f(!0);hasExtendedData=Ge();searchMode=f(!1);searchResults=f([]);_showHiddenNodes=b(!1);createFolderDialogOpen=b(!1);createFolderPath=b(null);errorMessage=b(null);anyRemoteSourcesLoaded=b(!1);treeContainerRef=Te("treeContainer");formRef=Te("formRef");pathDiscoveryMethod=b("browse");isLoading=b(null);currentPath=b("");#h=b(null);treeSearchQuery=b("");treeNodes=b([]);pathDelimiter=y(()=>this.#t.systemInfo()?.DirectorySeparator??"");#r=y(()=>this.currentPathArray().filter(e=>this.#i(e)).find(e=>e.includes("*")||e.includes("[")||e.includes("{")||e.includes("?"))&&this.#t.hasV2FilterOperations());filterGroups=this.#t.filterGroups();isByBackupSettings=y(()=>{let t=this.backupSettings();return!(t===void 0||t?.id===void 0||t?.time===void 0)});searchableTreeNodes=y(()=>{let t=this.treeSearchQuery();return t?this.treeNodes().filter(e=>e.text?.toLowerCase().includes(t.toLowerCase())):this.treeNodes()});currentPathArray=y(()=>this.currentPath().split("\0").filter(t=>t!==""&&t!==S));currentPathResolved=y(()=>this.currentPathArray().map(e=>{let n=this.treeNodes().find(i=>i.id===e)?.resolvedpath??e;return this.#t.resolveShorthandPath(n)}).join("\0"));#l(t){if(!t)return null;if(t.startsWith("@")&&t.includes("|")){let e=t.split("|"),n=e[0],i=e[1],o=i.split("://")[0],s=e[2]??"";return o==="diskimage"&&!s&&(s=this.#s(e[1].split("://")[1])),{mount:n.substring(1),prefix:n,url:i,type:o,path:s}}return null}#m=y(()=>{if(!this.showUnrootedSources())return[];let t=this.rootPaths();return(t===void 0||t.length===0)&&(t=[S]),this.currentPathArray().filter(n=>!this.#i(n)).filter(n=>!n.startsWith("%")).filter(n=>!t.find(i=>n.startsWith(i))).map(n=>{let i=this.#l(n);return i?{id:n,path:i.mount,displayName:st(i.url),icon:rt(i.url)}:{id:n,path:n,displayName:n,icon:null}})});#c(t){return t.map(e=>{if(this.#i(e))return e;let n=this.#l(e);return n?this.#s(n.mount):e})}TreeEvalEnum=ut;#y=y(()=>{if(!this.#r())return null;let t=this.#c(this.currentPathArray()),e=t.filter(o=>!this.#i(o)),n=t.filter(o=>this.#i(o));return{paths:this.searchableTreeNodes().map(o=>o.id).filter(Boolean),sources:e,filters:n}});#_=ot({params:()=>({data:this.#y()}),stream:({params:t})=>!this.#r()||!t.data||t.data.sources.length===0?re(null):Ne(300).pipe(ve(()=>this.#e.postApiV2FilesystemTestFilter({requestBody:{Paths:t.data?.paths,Sources:t.data?.sources,Filters:t.data?.filters}}).pipe(W(e=>{if(!e.Success||!e.Data)return console.log("Error evaluating filters",e),null;let n=new Map;for(let i of e.Data)if(i.Path){let o=0;i.Included?o=1:i.MatchedFilter&&(o=-1),n.set(i.Path,o)}return n}),fe(()=>re(null)))))});searchResultTreeStructure=y(()=>{let t=this.searchResults();if(t.length===0)return[];let e=this.currentPathArray(),n=this.showHiddenNodes(),i=new Map;for(let a of t){let l=a.Path??"",C=this.#a(l),T=l.split(C).filter(M=>M!==""),P="";for(let M=0;M<T.length;M++){let w=T[M],I=M===T.length-1,j=!I||this.#n(l),gt=P||S,Se=P?P.endsWith(C)?P.slice(0,-C.length):P:"";if(P=Se?`${Se}${C}${w}`:`${C}${w}`,j&&!P.endsWith(C)&&(P+=C),!i.has(P))i.set(P,{part:w,parentPath:gt,isFolder:j,match:I?a:null});else if(I){let mt=i.get(P);mt.match=a}}}let o=new Map;for(let[a,l]of i)o.has(l.parentPath)||o.set(l.parentPath,[]),o.get(l.parentPath).push(a);let s=new Set,u=new Map;for(let[a,l]of i){if(!l.isFolder){s.add(a);continue}let C=o.get(l.parentPath)||[];if(C.length===1&&C[0]===a&&l.parentPath!==S)continue;s.add(a);let P=l.part,M=a;for(;;){let w=o.get(M)||[];if(w.length!==1)break;let I=w[0],j=i.get(I);if(!j||!j.isFolder)break;P+="/"+j.part,M=I}M!==a&&u.set(a,P)}s.add(S);let g=[],c=new Map,d=Array.from(s).filter(a=>a!==S).sort((a,l)=>a.split("/").length-l.split("/").length||a.localeCompare(l));for(let a of d){let l=i.get(a);if(!l)continue;let C=l.parentPath;for(;C!==S&&!s.has(C);)C=i.get(C)?.parentPath||S;if(c.has(a))continue;let T=this.#g(u.get(a),l.match?.Metadata)??l.part,P=l.match===null,M=l.match!==null&&!l.isFolder&&n?0:this.#r()?this.#p(a,null,e,l.isFolder?"folder":"file"):this.#d(e,a,l.isFolder?"folder":"file",null),w={id:a,resolvedpath:a,text:T,parentPath:C,children:[],evalState:M,isIndeterminate:this.isIndeterminate(e,a),cls:l.isFolder?"folder":"file",isSearchMatch:l.match!==null,isGenerated:P,hasChildrenInSearch:(o.get(a)?.length||0)>0,iconCls:null,check:!1,leaf:!l.isFolder,hidden:!1,systemFile:!1,temporary:!1,symlink:!1,fileSize:l.match?.Size??0};if(c.set(a,w),C===S)g.push(w);else{let I=c.get(C);I&&I.children.push(w)}}let E=a=>{a.sort((l,C)=>l.cls==="folder"&&C.cls!=="folder"?-1:l.cls!=="folder"&&C.cls==="folder"?1:(l.text??"").localeCompare(C.text??"")),a.forEach(l=>E(l.children))};return E(g),g});treeStructure=y(()=>{if(this.searchMode())return this.searchResultTreeStructure();let t=this.#_.value(),e=this.showHiddenNodes(),n=this.#N(this.currentPathArray()),i=this.searchableTreeNodes(),o=this.rootPaths(),s=this.accepts(),u=[];o.length>0?u=o.map(c=>{let d=this.#r()?this.#p(c,null,n,"folder"):this.#d(n,c,"folder",null);return{id:c,resolvedpath:c,text:c,parentPath:"",children:[],evalState:d,isIndeterminate:!1,cls:this.#n(c)?"folder":"file"}}):u=[{id:S,resolvedpath:S,text:$localize`Computer`,parentPath:"",children:[],evalState:0,isIndeterminate:!1,cls:"folder"}];let g=this.#m().map(c=>({id:c.path,resolvedpath:c.path,remoteSource:this.#l(c.id),text:c.displayName,parentPath:"",children:[],evalState:1,isIndeterminate:!1,cls:"folder",customIcon:c.icon}));return u=[...u,...g],u.map(c=>{let d=new Map;if(!c.id)return;let E=c.id;s&&(c.accepted=!0),d.set(E,c);let a=o.length>0?i.filter(l=>l.parentPath.startsWith(E)):i;for(let l of a){if(!l.id)continue;let C=l.id;if(!l.cls||d.has(C))continue;let T=d.get(l.parentPath),P=l.hidden===!0&&!e?0:this.#r()?this.#p(C,T,n,l.cls):this.#d(n,C,l.cls,T),M=U(H({},l),{isIndeterminate:this.isIndeterminate(n,C),evalState:P,children:[]});s&&(M.accepted=this.matchAccepts(s,M)),d.set(C,M),M.id?.startsWith("%")&&M.id?.endsWith("%")&&d.set(this.#s(C),M),T&&T.children.push(M)}return c}),u});#N(t){let e=structuredClone(t);for(let n=0;n<e.length;n++){let o=e[n].slice(1);if(o.startsWith("{")&&o.endsWith("}")){let s=o.slice(1,-1),u=this.filterGroups?.FilterGroups?.[s];if(u&&u.length){let g=u.map(c=>`-${c}`);e.splice(n,1,...g)}}}return e}#s(t){if(!t)return S;let e=this.#a(t);return t.endsWith("/")||t.endsWith("\\")||t===S?t:t+e}#f(t){return t?.id?!this.resolvePaths()||!t.resolvedpath?t.id:t.id.startsWith("%")&&t.id.endsWith("%")?this.#s(t.resolvedpath):t.resolvedpath:null}#p(t,e,n,i){if(e&&e.evalState===-1)return-2;let o=this.#_.value();return o&&o.has(t)?o.get(t):this.#d(n,t,i,e)}#d(t,e,n,i){if(i&&i.evalState===-1)return-2;let o=0,s=this.#c(t.filter(d=>!this.#i(d))),u=t.filter(d=>this.#i(d)),g=this.multiSelect(),c=this.#f(this.treeNodes().find(d=>d.id===e))??e;if(s.length===0)return o;for(let d=0;d<s.length;d++){let E=s[d];if(e===E||c==E){o=1;break}if(!g||!this.#n(E))continue;if(e?.startsWith(E)||c?.startsWith(E)){o=1;break}}if(u.length===0)return o;for(let d=0;d<u.length;d++){let E=u[d],a=E.slice(1),l=E.startsWith("-")?-1:1;if(this.#n(a)){if(n!=="folder")continue;if(e===a||c==a){o=l;break}}if(a.startsWith("*")&&(a.endsWith("*\\")||a.endsWith("*/"))){if(n!=="folder")continue;let T=a.slice(1,-2);if(T==="")break;if(e?.includes(T+"\\")||e?.includes(T+"/")){o=l;break}}if(a.startsWith("[.*")&&(a.endsWith("[^\\/]*]")||a.endsWith("[^\\\\]*]"))){if(n!=="file")continue;let T=a.slice(3,-7);if(new RegExp(T).test(e)){o=l;break}}if(a.startsWith("[")&&a.endsWith("]")){let T=a.slice(1,-1),P=this.translateCSharpRegex(T);if(new RegExp(`${P}`).test(e)){o=l;break}}if(a.startsWith("*.")){if(n!=="file"||a.replace("*.","").length===0)continue;if(this.#C(e,a,!0)){o=l;break}}if(a==="")continue;if(a===e){o=l;break}if(this.#C(e,a,!0)){o=l;break}}return o}translateCSharpRegex(t){let e=t;e=e.replace(/^@/,"");let n=/\(\?<(?<name>\w+)>(?<pattern>[^)]+)\)/g;return e=e.replace(n,(i,o,s)=>`(${s})`),e=e.replace(/\\/g,"\\\\"),e}isIndeterminate(t,e){return t.filter(n=>!n.startsWith("-")&&this.#n(n)).some(n=>n.startsWith(e))}isCurrentPathFolder(){let t=this.currentPath();return t?t.endsWith("/")||t.endsWith("\\")||t.startsWith("%")&&t.endsWith("%")&&!t.includes("/")&&!t.includes("\\"):!1}#C(t,e,n=!1){let i=e.replace(/[\\.+^${}()|[\]*?]/g,s=>s==="*"?".*":s==="?"?".":"\\"+s);return new RegExp(`${i}${n?"$":""}`).test(t)}#a(t){return t?t.includes("/")?"/":t.includes("\\")?"\\":this.pathDelimiter():this.pathDelimiter()}showHiddenNodesEffect=L(()=>this._showHiddenNodes.set(this.showHiddenNodes()));pathDiscoveryMethodEffect=L(()=>{let t=this.pathDiscoveryMethod(),e=this.#h();if(t==="browse"&&e){let n=e.value;if(n==null||n==="")return;this.currentPath.set(n)}});matchAccepts(t,e){if(!t||e.cls==="folder"||e.id===S)return!0;let n=t.split(",");if(n.length===0)return!0;let i="."+e.id.slice(e.id.indexOf("."));return i?n.some(o=>i.endsWith(o)):!1}currentPathEffect=L(()=>{let t=this.#h();t&&(t.value=this.currentPath(),t.dispatchEvent(new Event("input")))});inputValueChangeAbortController=null;inputRefEffect=L(()=>{let t=this.formRef()?.nativeElement?.querySelector("input");t&&(this.#v(t),this.inputValueChangeAbortController&&this.inputValueChangeAbortController.abort(),this.inputValueChangeAbortController=new AbortController,t.addEventListener("inputValueChanged",e=>{this.currentPath.set(e.detail.value)},{signal:this.inputValueChangeAbortController.signal}),this.#h.set(t),t.autocomplete="off")});ngOnInit(){let t=this.startingPath();if(t)this.currentPath.set(t),this.#R(t);else{let e=this.rootPaths(),n=this.initialNodes();e&&e.length>0?(n&&n.length>0&&this.treeNodes.set(n.map(i=>({id:i.id,leaf:i.leaf,cls:i.cls,text:this.#g(i.text,i?.Metadata),iconCls:i.iconCls,fileSize:i.fileSize,resolvedpath:i.resolvedpath,parentPath:this.getParentPath(i.id??"")}))),this.#u(null,e[0])):this.#u(null,S)}}getParentPath(t){let e=this.#a(t),n=t.split(e);return n.length<=1?S:(n.pop(),n.length!==0&&n.pop(),n.join(e)+e)}toggleSelectedNode(t,e){if(e.id===S||this.#m().map(d=>this.#l(d.id)?.mount).filter(d=>d).includes(e.id??"")||(t.stopPropagation(),this.searchMode()&&!e.isSearchMatch)||e.evalState===-2)return;if(this.selectFiles()&&e.cls==="folder"){this.toggleNode(t,e.id,e);return}if(this.onlySelectFolder()&&e.cls!=="folder"||this.accepts()&&!e.accepted)return;let i=this.currentPathArray(),o=this.#c(i),s=this.isChildOfSelected(e),u=this.#f(e),g=s?`-${u}`:u,c=this.#n(u);if(this.multiSelect())if(o.includes(u))this.currentPath.set(i.filter(d=>d!==u&&!(c&&d.startsWith(g))).join("\0"));else if(o.some(d=>d==g))this.currentPath.set(i.filter(d=>d!==g).join("\0"));else{let d=c?i.filter(E=>!E.startsWith(u)):i;this.currentPath.set([...d,g].join("\0"))}else i.includes(u)?this.currentPath.set(i.filter(d=>d!==u).join("\0")):this.currentPath.set(u)}isChildOfSelected(t){return this.#c(this.currentPathArray()).filter(n=>this.#n(n)).some(n=>t.id?.startsWith(n)||`-${t.id}`.startsWith(n))}toggleNode(t,e,n=null){t.stopPropagation(),n?.cls==="folder"&&(n?.children.length?this.treeNodes.update(i=>i.filter(o=>!o.id?.startsWith(n.id)||o.id===n.id)):this.#u(n,e))}openCreateFolderDialog(){return this.createFolderPath.set(null),this.createFolderDialogOpen.set(!0),!1}closeCreateFolderDialog(t){if(t&&this.createFolderPath()?.length&&this.isCurrentPathFolder()){let e=this.createFolderPath()?.trim();if(e){let n=this.currentPath(),i=this.currentPathResolved(),o=this.#s(e),s=`${i}/${o}`;this.#e.postApiV1RemoteoperationCreate({requestBody:{path:"file://"+s}}).subscribe({next:()=>{this.currentPath.set(s),this.#u(null,n),setTimeout(()=>{this.#P()},500),this.createFolderDialogOpen.set(!1)},error:u=>{let g=u?.message?.match(/user-information\s*:\s*(.*?)(?:\s*,|$)/i),c=g?g[1]:u?.message||$localize`An error occurred while trying to create the folder.`;this.#S.open(it,{data:{title:$localize`Cannot create folder`,message:c,confirmText:$localize`OK`,cancelText:void 0}})}})}}else this.createFolderDialogOpen.set(!1);return!1}#P(){setTimeout(()=>{let e=this.treeContainerRef()?.nativeElement?.querySelector(".active");e&&e.scrollIntoView({behavior:"smooth",block:"center"})},100)}#v(t){return Object.defineProperty(t,"value",{configurable:!0,get(){return Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").get.call(this)},set(e){return Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").set.call(this,e),this.dispatchEvent(new CustomEvent("inputValueChanged",{bubbles:!0,cancelable:!0,detail:{value:e}})),e}}),t}#O(t){return this.#e.postApiV1Filesystem({showHidden:!0,requestBody:{path:t},onlyFolders:!this.showFiles()})}#o(t,e,n){return this.#e.postApiV2DestinationList({requestBody:{BackupId:this.backupId()??null,DestinationUrl:e?.url??this.destinationUrl()??null,ConnectionStringId:this.connectionStringId()??null,DestinationType:n,SourcePrefix:e?.prefix??this.sourcePrefix()??null,Path:t,Offset:null,Limit:null}}).pipe(W(i=>(i.Data?.Items??[]).map(o=>U(H({},o),{Path:(e?.prefix??"")+o.Path})).filter(o=>o.Metadata==null||!o.Metadata.ExtType)))}#M(t,e){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"office365",requestBody:{"backup-id":this.backupId()??"","source-prefix":e?.prefix??this.sourcePrefix()??"",operation:"ListDestinationRestoreTargets",url:e?.url??this.destinationUrl()??"",path:t??"/"}}).pipe(W(n=>{let i=n.Result;if(!i)throw new Error("No result returned");if(n.Status!=="OK")throw new Error(i.error??"An error occured");return Object.keys(i).map(o=>({Path:(e?.prefix??"")+o,Metadata:JSON.parse(i[o])}))}))}#E(t,e){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"googleworkspace",requestBody:{"backup-id":this.backupId()??"","source-prefix":e?.prefix??this.sourcePrefix()??"",operation:"ListDestinationRestoreTargets",url:e?.url??this.destinationUrl()??"",path:t??"/"}}).pipe(W(n=>{let i=n.Result;if(!i)throw new Error("No result returned");if(n.Status!=="OK")throw new Error(i.error??"An error occured");return Object.keys(i).map(o=>({Path:(e?.prefix??"")+o,Metadata:JSON.parse(i[o])}))}))}#T(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"diskimage",requestBody:{operation:"ListDestinationRestoreTargets",path:t??"/"}}).pipe(W(e=>{let n=e.Result;return Object.keys(n).map(i=>({Path:i,Metadata:JSON.parse(n[i])}))}))}#F(t){let e=this.backupSettings();if(this.#t.hasV2ListOperations())return this.#e.postApiV2BackupListFolder({requestBody:{BackupId:e.id,Time:e.time,Paths:t?[t]:null,PageSize:0,Page:0,ReturnExtended:this.customRemoteMode()!==null||this.loadExtendedData()}}).pipe(W(n=>n.Data??[]));{let n={id:e.id+"",prefixOnly:!1,folderContents:!0,time:e.time,filter:t?"@"+t:void 0};return this.#e.getApiV1BackupByIdFiles(n).pipe(W(i=>i.Files??[]))}}#b(t,e){return e?.type==="office365"?this.#t.hasV2ListBackendOperations()&&ee?this.#o(e.path,e,"SourceProvider"):this.#M(e.path,e):this.customRemoteMode()==="o365"?this.#t.hasV2ListBackendOperations()&&ee?this.#o(t,null,"SourceProvider"):this.#M(t,null):e?.type==="googleworkspace"?this.#t.hasV2ListBackendOperations()&&ee?this.#o(e.path,e,"SourceProvider"):this.#E(e.path,e):this.customRemoteMode()==="gsuite"?this.#t.hasV2ListBackendOperations()&&ee?this.#o(t,null,"SourceProvider"):this.#E(t,null):e?.type==="diskimage"?this.#t.hasV2ListBackendOperations()&&ee?this.#o(e.path,e,"SourceProvider"):this.#T(e.path):this.customRemoteMode()==="diskimage"?this.#t.hasV2ListBackendOperations()&&ee?this.#o(t,null,"SourceProvider"):this.#T(t):this.isByBackupSettings()?this.#F(t):this.customRemoteMode()==="backend"?this.#o(t,null,"Backend"):this.#O(t)}#R(t){let n=t.split("\0").filter(s=>!this.#i(s)&&!s.startsWith("@")).filter(Boolean).map(s=>{let u=this.#a(s),g=s.split(u);return g.at(-1)===""&&g.pop(),this.#n(s)||g.pop(),{split:g,sep:u}}),i=[S];n.forEach(({split:s,sep:u})=>{s.forEach((g,c)=>{let d=s.slice(0,c+1).join(u)+u;d===""||d===u||i.includes(d)||i.push(d)})});let o=i.map(s=>(this.isLoading.set(s),this.#b(s,null).pipe(W(u=>({status:"success",value:u,url:s})),fe(u=>re({status:"error",value:u,url:s})))));ye(o).pipe(Ce(()=>this.isLoading.set(null))).subscribe({next:s=>{let u=s.filter(c=>c.status==="success"),g=s.filter(c=>c.status==="error");this.treeNodes.update(c=>{let d=u.flatMap(a=>Array.isArray(a.value)?a.value.map(l=>U(H({},l),{parentPath:a.url})):[]);d.length>0&&this.anyRemoteSourcesLoaded.set(!0);let E=[...new Map([...c,...d].map(a=>[a.id,a])).values()];return this.#P(),this.hideShortcuts()?E.filter(a=>!a.id.startsWith("%")):E})}})}#g(t,e){if(e){let n=e["o365:Name"]||e["o365:DisplayName"]||e["gsuite:Name"]||e["gsuite:DisplayName"]||e["diskimage:Name"];if(n)return n}return t}#x(t){t&&t.ExtType&&t.ExtType.length>0&&this.hasExtendedData.emit(t.ExtType)}#n(t){return t.startsWith("%")&&t.endsWith("%")&&!t.includes("/")&&!t.includes("\\")||t.endsWith("/")||t.endsWith("\\")}#i(t){return t.startsWith("+")||t.startsWith("-")}#u(t=null,e=S){let n=t?.remoteSource;this.isLoading.set(e),this.#b(e,n).pipe(Ce(()=>this.isLoading.set(null))).subscribe({next:i=>{let o=this.isByBackupSettings()||this.customRemoteMode()!==null||n?i.map(s=>{this.#x(s.Metadata);let u=this.#a(s.Path),g=this.#g(s.Path.split(u).filter(E=>E!=="").pop(),s.Metadata);if(s.Metadata&&s.Metadata["diskimage:Type"]==="filesystem")return null;let c=s.Path,d=null;return n&&(c=s.Path.substring(1),d=U(H({},n),{path:s.Path.substring(n.prefix.length)})),{text:g,id:c,cls:this.#n(s.Path)?"folder":"file",leaf:t!==null,resolvedpath:s.Path,hidden:!1,remoteSource:d,fileSize:s.Size}}):i;o.length>0&&this.anyRemoteSourcesLoaded.set(!0),this.treeNodes.update(s=>{let u=o.filter(c=>c!==null).map(c=>{let d=this.#n(c.id)?"folder":"file";return U(H({},c),{cls:d,parentPath:e})}),g=[...new Map([...s,...u].map(c=>[c.id,c])).values()];return this.hideShortcuts()?g.filter(c=>!c.id.startsWith("%")):g})},error:i=>{this.errorMessage.set(i.message),this.anyRemoteSourcesLoaded()&&setTimeout(()=>{this.errorMessage.set(null)},5e3)}})}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=J({type:r,selectors:[["app-file-tree"]],viewQuery:function(e,n){e&1&&Ie(n.treeContainerRef,_t,5)(n.formRef,ft,5),e&2&&Le(2)},hostVars:2,hostBindings:function(e,n){e&2&&z("disabled",n.disabled())},inputs:{multiSelect:[1,"multiSelect"],disabled:[1,"disabled"],showFiles:[1,"showFiles"],selectFiles:[1,"selectFiles"],onlySelectFolder:[1,"onlySelectFolder"],accepts:[1,"accepts"],startingPath:[1,"startingPath"],rootPaths:[1,"rootPaths"],initialNodes:[1,"initialNodes"],backupSettings:[1,"backupSettings"],pathRefreshTrigger:[1,"pathRefreshTrigger"],showHiddenNodes:[1,"showHiddenNodes"],enableCreateFolder:[1,"enableCreateFolder"],hideShortcuts:[1,"hideShortcuts"],resolvePaths:[1,"resolvePaths"],customRemoteMode:[1,"customRemoteMode"],showUnrootedSources:[1,"showUnrootedSources"],backupId:[1,"backupId"],connectionStringId:[1,"connectionStringId"],sourcePrefix:[1,"sourcePrefix"],destinationUrl:[1,"destinationUrl"],loadExtendedData:[1,"loadExtendedData"],searchMode:[1,"searchMode"],searchResults:[1,"searchResults"]},outputs:{hasExtendedData:"hasExtendedData"},ngContentSelectors:Pt,decls:19,vars:18,consts:()=>{let t;t=$localize`Browse path`;let e;e=$localize`Manually type path`;let n;n=$localize` Show hidden ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let i;i=$localize` Create folder `;let o;o=$localize`Enter new folder path`;let s;s=$localize`Will be created as:`;let u;return u=$localize` Create folder ${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:folder-plus${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["treeContainer",""],["recursiveTree",""],["formRef",""],["treeNode",""],t,e,n,i,o,s,u,[1,"type-b","small",3,"value"],[1,"section"],[1,"browse-files"],[1,"indeterminate","primary"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"footer"],[1,"primary","raised","browse-files-toggle",3,"checked"],["shButton","","type","button",1,"small","create-folder",3,"disabled"],[1,"form-field"],[3,"color"],[3,"isOpen","options"],[1,"type-b","small",3,"valueChange","value"],["type","button","value","browse"],["type","button","value","path"],["action","",3,"click"],[1,"icon",3,"click"],[1,"primary"],[1,"text"],[1,"size"],[1,"small"],["alt","Provider icon",1,"provider-icon",3,"src"],[1,"primary","raised","browse-files-toggle",3,"checkedChange","checked"],["shButton","","type","button",1,"small","create-folder",3,"click","disabled"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],[1,"wrap-box"],[1,"box"],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click","disabled"]]},template:function(e,n){if(e&1&&(X(Ct),O(0,St,5,1,"sh-button-group",11),p(1,"div",12),D(2,0,["ngProjectAs","label",5,["label"]]),p(3,"div",13,0),O(5,yt,1,0,"sh-progress-bar",14),te(6,Gt,3,2,"ng-template",null,1,Ve)(8,zt,1,0,"ng-container",15),h(),p(9,"div",16),O(10,jt,2,2,"sh-toggle",17),O(11,Ht,2,1,"button",18),h()(),p(12,"div",19,2)(14,"sh-form-field"),D(15,1,["ngProjectAs","label",5,["label"]]),D(16,2,["ngProjectAs","input",5,["input"]]),h()(),O(17,Ut,2,2,"sh-alert",20),O(18,Jt,19,7,"sh-dialog",21)),e&2){let i=Me(7);F(!n.multiSelect()&&n.customRemoteMode()===null&&!n.searchMode()?0:-1),m(),z("hidden",!n.searchMode()&&n.pathDiscoveryMethod()!=="browse"),m(2),z("visualize-accepted",n.accepts()),m(2),F(n.isLoading()!=null?5:-1),m(3),N("ngTemplateOutlet",i)("ngTemplateOutletContext",pe(16,dt,pe(14,Mt,n.treeStructure()))),m(2),F(!n.accepts()&&!n.isByBackupSettings()&&n.customRemoteMode()===null&&!n.searchMode()?10:-1),m(),F(n.enableCreateFolder()&&n.customRemoteMode()===null&&!n.searchMode()?11:-1),m(),z("hidden",n.searchMode()||n.pathDiscoveryMethod()!=="path"),m(5),F(n.errorMessage()?17:-1),m(),F(n.createFolderDialogOpen()?18:-1)}},dependencies:[_e,Xe,Ze,je,Z,qe,Qe,Ue,ze,Y,q,K,Q,He,tt],styles:['[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem}.disabled[_nghost-%COMP%]{opacity:.5;-webkit-user-select:none;user-select:none;pointer-events:none;position:relative}.disabled[_nghost-%COMP%]:before{content:"";position:absolute;inset:0;background:transparent}.fill[_nghost-%COMP%]{height:auto;overflow:hidden;flex:1 0}.fill[_nghost-%COMP%] .section[_ngcontent-%COMP%]{height:auto;overflow:hidden;flex:1 0;display:grid;grid-template-columns:1fr auto;grid-template-rows:auto 1fr;grid-template-areas:"label toggle" "tree tree"}.fill[_nghost-%COMP%] .browse-files[_ngcontent-%COMP%]{resize:none;height:initial;grid-area:tree}.fill[_nghost-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.fill[_nghost-%COMP%] sh-toggle[_ngcontent-%COMP%]{grid-area:toggle;flex-direction:row-reverse}.section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.form-field.hidden[_ngcontent-%COMP%]{display:none}.browse-files[_ngcontent-%COMP%]{display:flex;gap:.5rem;padding:.5rem 1rem;height:12.5rem;min-height:6.25rem;border:1px solid var(--base-4);border-radius:var(--shape-3);overflow:auto;resize:vertical;background:var(--base-1);position:relative}.browse-files[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]:not(.accepted){opacity:.5}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action].accepted[_ngcontent-%COMP%]{opacity:1}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%]{--list-active-bg: var(--base-3);gap:.125rem;padding:0;height:min-content;min-width:min-content}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]{padding:0;gap:0;border:1px solid transparent}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].active[_ngcontent-%COMP%]{border-color:transparent;--list-active-bg: var(--primary-2)}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].indeterminate[_ngcontent-%COMP%]{border-color:var(--primary-4)}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].usually-hidden[_ngcontent-%COMP%]{opacity:.6}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .size[_ngcontent-%COMP%]{opacity:.6}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].generated[_ngcontent-%COMP%]{opacity:.6}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].generated[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{color:var(--base-7)}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%]{gap:.25rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]:has(sh-icon:nth-child(2)){width:3rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]:has(img:nth-child(2)){width:2.5rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:1.5rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].loading[_ngcontent-%COMP%]{opacity:.7}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;height:100%;width:max-content;display:flex;align-items:center}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:3rem;gap:.25rem;height:1.5rem;display:flex;align-items:center;justify-content:center;cursor:pointer}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon[_ngcontent-%COMP%] .provider-icon[_ngcontent-%COMP%]{width:1rem;height:1rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon.file[_ngcontent-%COMP%]{width:3rem;padding:0 .25rem}.browse-files-toggle[_ngcontent-%COMP%]{color:var(--base-9)}.hidden[_ngcontent-%COMP%]{display:none}.footer[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:space-between;align-items:center}.box[_ngcontent-%COMP%]{border:1px solid var(--base-4);border-radius:var(--shape-3);padding:.5rem;background:var(--base-2)}.box[_ngcontent-%COMP%] pre[_ngcontent-%COMP%]{margin:0}.wrap-box[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;margin-bottom:1rem}'],changeDetection:0})};var Xt=[[["label"]],[["","prefix",""]],[["","suffix",""]]],qt=["label","[prefix]","[suffix]"];function Kt(r,t){if(r&1&&v(0),r&2){let e=t.$implicit,n=_();ue("",e.label,"",n.hasPerSecond()?"/s":"")}}var Qt=["throttle-upload","throttle-download"],Yt=[{value:"B",label:"Bytes"},{value:"KB",label:"KB"},{value:"MB",label:"MB"},{value:"GB",label:"GB"},{value:"TB",label:"TB"},{value:"PB",label:"PB"}],Zt=r=>{if(!r||typeof r!="string"||r.length===0)return{size:0,unit:"MB"};let t=r.match(/^(\d+)(bytes|kb|mb|gb|tb|pb|b|kib|mib|gib|tib|pib)$/i);return t&&(t[2].toUpperCase()==="B"||t[2].toUpperCase()==="BYTES")?{size:1,unit:"KB"}:{size:t?parseInt(t[1],10):0,unit:t?t[2].toUpperCase():"MB"}},ht=class r{customId=f();inputType=f();timespan=b(0);unit=b("MB");sizeOptions=b(Yt);readonly=b(!1);hasPerSecond=y(()=>{let t=this.inputType();return t&&Qt.includes(t)});onChange=()=>{};onTouched=()=>{};onChangeEffect=L(()=>{this.onChange(this.getValue())});writeValue(t){if(t){let e=Zt(t);e?queueMicrotask(()=>{this.timespan.set(e.size),this.unit.set(e.unit)}):(this.timespan.set(0),this.unit.set("MB"))}else this.timespan.set(0),this.unit.set("MB")}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.readonly.set(t)}getValue(){return`${this.timespan()}${this.unit()}`}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=J({type:r,selectors:[["app-size"]],inputs:{customId:[1,"customId"],inputType:[1,"inputType"]},features:[he([{provide:ge,useExisting:r,multi:!0}])],ngContentSelectors:qt,decls:9,vars:10,consts:[[1,"label"],["type","number",3,"ngModelChange","id","ngModel","disabled"],["value","value","label","label",3,"options","readonly","isClearable"],["type","text",3,"ngModelChange","ngModel"]],template:function(e,n){e&1&&(X(Xt),p(0,"div",0),D(1,0,["ngProjectAs","label",5,["label"]]),h(),p(2,"sh-form-field")(3,"input",1),$("ngModelChange",function(o){return B(n.timespan,o)||(n.timespan=o),o}),h(),D(4,1),D(5,2),h(),p(6,"sh-select",2)(7,"input",3),$("ngModelChange",function(o){return B(n.unit,o)||(n.unit=o),o}),h(),te(8,Kt,1,2,"ng-template"),h()),e&2&&(m(2),ae("readonly",n.readonly()||void 0),m(),N("id",n.customId()),k("ngModel",n.timespan),N("disabled",n.readonly()),m(3),de("--miw",0),N("options",n.sizeOptions())("readonly",n.readonly())("isClearable",!1),m(),k("ngModel",n.unit))},dependencies:[Ye,Z,Y,q,me,K,Q],styles:['[_nghost-%COMP%]{display:grid;grid-template-areas:"label label" "input unit";grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{grid-area:label;grid-column:1/-1}[_nghost-%COMP%] sh-form-field[_ngcontent-%COMP%]{grid-area:input}[_nghost-%COMP%] sh-select[_ngcontent-%COMP%]{grid-area:unit}'],changeDetection:0})};var en=[[["label"]],[["","prefix",""]],[["","suffix",""]]],tn=["label","[prefix]","[suffix]"];function nn(r,t){if(r&1){let e=V();p(0,"button",7),G("click",function(){let i=R(e).$implicit,o=_();return x(o.updateUnit(i.value))}),A(1,1),h()}if(r&2){let e=t.$implicit;m(),ie(e.label),oe(1)}}var on=[{value:"s",label:$localize`Seconds`},{value:"m",label:$localize`Minutes`},{value:"h",label:$localize`Hours`}],rn=[{value:"Y",label:$localize`Years`},{value:"M",label:$localize`Months`},{value:"W",label:$localize`Weeks`},{value:"D",label:$localize`Days`}],sn=["retry-delay","web-timeout","read-write-timeout","run-script-timeout","list-timeout","short-timeout"],pt=class r{customId=f();inputType=f();timespan=b(0);#e="D";unit=b(this.#e);unitLabel=y(()=>{let t=this.timeOptions(),e=t.findIndex(n=>n.value===this.unit());return t[e]?.label??this.unit()});isShortTime=y(()=>{let t=this.inputType();return t&&sn.includes(t.replace("--",""))});timeOptions=y(()=>this.isShortTime()?on:rn);readonly=b(!1);onChange=()=>{};onTouched=()=>{};onChangeEffect=L(()=>{this.onChange(this.getValue())});inputTypeEffect=L(()=>{let t=this.timeOptions(),e=this.isShortTime()?"s":"D";this.#e=e,this.unit.set(e)});updateUnit(t){this.unit.set(t)}writeValue(t){let e=this.isShortTime();if(t){let n=e?/(\d+)([smh])/i:/^(\d+)([YMWD])$/i,i=t.match(n);i?(this.timespan.set(parseInt(i[1],10)),this.unit.set(i[2])):(this.timespan.set(0),this.unit.set(this.#e))}else this.timespan.set(0),this.unit.set(this.#e)}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.readonly.set(t)}getValue(){return`${this.timespan()}${this.unit()}`}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=J({type:r,selectors:[["app-timespan"]],inputs:{customId:[1,"customId"],inputType:[1,"inputType"]},features:[he([{provide:ge,useExisting:r,multi:!0}])],ngContentSelectors:tn,decls:11,vars:6,consts:()=>{let t;t=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let e;return e=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION:`,[t,e,["type","number",3,"ngModelChange","id","ngModel","disabled"],[3,"openIndicator"],["shButton","","type","button",1,"trigger"],["menu",""],["shButton","","type","button",1,"small"],["shButton","","type","button",1,"small",3,"click"]]},template:function(e,n){e&1&&(X(en),D(0,0,["ngProjectAs","label",5,["label"]]),p(1,"sh-form-field")(2,"input",2),$("ngModelChange",function(o){return B(n.timespan,o)||(n.timespan=o),o}),h(),D(3,1),D(4,2),h(),p(5,"sh-menu",3)(6,"button",4),A(7,0),h(),Re(8,5),le(9,nn,2,1,"button",6,Fe),xe(),h()),e&2&&(m(),ae("readonly",n.readonly()||void 0),m(),N("id",n.customId()),k("ngModel",n.timespan),N("disabled",n.readonly()),m(3),N("openIndicator",!0),m(2),ie(n.unitLabel()),oe(7),m(2),ce(n.timeOptions()))},dependencies:[Ke,Z,Y,q,me,K,Q,_e],styles:['[_nghost-%COMP%]{display:grid;grid-template-areas:"label label" "input unit";grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{grid-area:label;grid-column:1/-1}[_nghost-%COMP%] sh-form-field[_ngcontent-%COMP%]{grid-area:input}[_nghost-%COMP%] sh-menu[_ngcontent-%COMP%]{grid-area:unit}[_nghost-%COMP%] sh-menu[_ngcontent-%COMP%] button.trigger[_ngcontent-%COMP%]{width:100%}'],changeDetection:0})};export{be as a,Zt as b,ht as c,pt as d};
@@ -1 +1 @@
1
- import{a as ne}from"./chunk-VZNLMGYP.js";import{q as ee}from"./chunk-O2L2FRYE.js";import"./chunk-PNQ5BDQN.js";import{d as Z}from"./chunk-2EX5HS5X.js";import"./chunk-EVEI25GQ.js";import"./chunk-6Q6SSTBK.js";import"./chunk-COEGVUM3.js";import"./chunk-KZYRTI62.js";import"./chunk-TSVSMVY4.js";import"./chunk-2KD757N6.js";import"./chunk-OP7MDR2B.js";import"./chunk-PEOYNJJM.js";import"./chunk-NUV5LHQV.js";import"./chunk-PDZNQW6F.js";import{B as j,H as Q,P as q,c as X,e as W,i as z,k as V,s as H,v as Y}from"./chunk-CJKZ27FM.js";import"./chunk-KNSQLQC6.js";import{b as U,d as J}from"./chunk-CQJRBQ6I.js";import"./chunk-V2UO7ES2.js";import"./chunk-HDDAGHHE.js";import"./chunk-YF6JHIN5.js";import"./chunk-2YUSBRXY.js";import{$ as C,Bc as D,Db as m,Eb as i,Fb as a,Gb as P,Nb as g,Ta as p,Ub as N,Vb as E,Wb as l,Yc as K,_b as f,ac as c,ea as O,fa as S,hb as $,hc as v,ic as B,lc as x,qa as w,tc as d,uc as T,vc as u,xb as L,yb as G}from"./chunk-K5XGRFWJ.js";import"./chunk-7CGTOI24.js";var te=["formRef"],ie=()=>["--skip-files-larger-than","encryption-module","no-encryption","--no-encryption","--dbpath","keep-time","keep-versions","retention-policy"];function oe(s,r){s&1&&(i(0,"p"),l(1,4),a())}function ae(s,r){if(s&1){let n=g();i(0,"p"),l(1,5),a(),i(2,"app-timespan",21),u("ngModelChange",function(o){O(n);let t=c();return T(t.optionsFields.backupRetentionTime,o)||(t.optionsFields.backupRetentionTime=o),S(o)}),i(3,"label",22),l(4,6),a()()}if(s&2){let n=c();p(2),m("customId","backupRetentionTime"),d("ngModel",n.optionsFields.backupRetentionTime)}}function se(s,r){if(s&1){let n=g();i(0,"p"),l(1,7),a(),i(2,"sh-form-field")(3,"label",23),l(4,8),a(),i(5,"input",24),u("ngModelChange",function(o){O(n);let t=c();return T(t.optionsFields.backupRetentionVersions,o)||(t.optionsFields.backupRetentionVersions=o),S(o)}),a()()}if(s&2){let n=c();p(5),d("ngModel",n.optionsFields.backupRetentionVersions)}}function _e(s,r){s&1&&(i(0,"p"),l(1,9),a())}function le(s,r){if(s&1){let n=g();i(0,"p"),l(1,10),a(),i(2,"sh-form-field")(3,"p"),l(4,11),a(),i(5,"label",25),l(6,12),a(),i(7,"input",26),u("ngModelChange",function(o){O(n);let t=c();return T(t.optionsFields.backupRetentionCustom,o)||(t.optionsFields.backupRetentionCustom=o),S(o)}),a()()}if(s&2){let n=c();p(7),d("ngModel",n.optionsFields.backupRetentionCustom)}}var re=[{value:"all",name:$localize`Keep all backups`},{value:"time",name:$localize`Delete backups that are older than`},{value:"versions",name:$localize`Keep a specific number of backups`},{value:"smart",name:$localize`Smart backup retention`},{value:"custom",name:$localize`Custom backup retention`}],h=class s{#e=C(ee);#n=C(J);#t=C(U);formRef=K.required("formRef");isSubmitting=this.#e.isSubmitting;settings=this.#e.settings;optionsFields=this.#e.optionsFields;applicationOptions=this.#e.applicationOptions;retentionOptions=w(re);goBack(){this.#n.navigate(["schedule"],{relativeTo:this.#t.parent})}submit(){switch(this.#e.validateBeforeSubmit()){case"general":this.#n.navigate(["general"],{relativeTo:this.#t.parent});return;case"destination":this.#n.navigate(["destination"],{relativeTo:this.#t.parent});return;case"source":this.#n.navigate(["source-data"],{relativeTo:this.#t.parent});return}this.#e.submit()}static \u0275fac=function(n){return new(n||s)};static \u0275cmp=$({type:s,selectors:[["app-advanced-options-settings"]],viewQuery:function(n,e){n&1&&v(e.formRef,te,5),n&2&&B()},decls:20,vars:12,consts:()=>{let r;r=$localize`Options`;let n;n=$localize`Backup retention`;let e;e=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `;let t;t=$localize`Nothing will be deleted. The backup size will grow with each change.`;let M;M=$localize`If at least one newer backup is found, all backups older than this date are deleted.`;let I;I=$localize`Time to keep versions`;let R;R=$localize`Once there are more backups than the specified number, the oldest backups are deleted.`;let b;b=$localize`Number of versions`;let y;y=$localize` Over time backups will be deleted automatically. There will remain one backup for each of the last 7 days, each of the last 4 weeks, each of the last 12 months. There will always be at least one remaining backup. `;let A;A=$localize` Enter a retention strategy manually. Placeholders are D/W/Y for days/weeks/years and U for unlimited. The syntax is: 7D:1D,4W:1W,36M:1M. This example keeps one backup for each of the next 7 days, one for each of the next 4 weeks, and one for each of the next 36 months. This can also be written as 1W:1D,1M:1W,3Y:1M. `;let k;k=$localize`Once there are more backups than the specified number, the oldest backups are deleted.`;let F;return F=$localize`Retention expression`,[r,n,e,o,t,M,I,R,b,y,A,k,F,[1,"title-30"],["value","value","label","name",3,"options","inlineSearch","isClearable"],["for","size"],["type","text",3,"ngModelChange","ngModel"],[3,"optionsChange","options","applicationOptions","hasFreeTextSettings","hiddenOptions"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click"],[3,"ngModelChange","customId","ngModel"],["for","backupRetentionTime"],["for","backupRetentionVersions"],["type","number","id","backupRetentionVersions",3,"ngModelChange","ngModel"],["for","backupRetentionCustom"],["type","text","id","backupRetentionCustom",3,"ngModelChange","ngModel"]]},template:function(n,e){n&1&&(i(0,"section")(1,"h3",13),l(2,0),a(),i(3,"sh-select",14)(4,"label",15),l(5,1),a(),i(6,"input",16),u("ngModelChange",function(t){return T(e.optionsFields.backupRetention,t)||(e.optionsFields.backupRetention=t),t}),a()(),L(7,oe,2,0,"p")(8,ae,5,2)(9,se,6,1)(10,_e,2,0,"p")(11,le,8,1),i(12,"app-options-list",17),u("optionsChange",function(t){return T(e.settings,t)||(e.settings=t),t}),a(),i(13,"div",18)(14,"button",19),f("click",function(){return e.goBack()}),N(15,2),P(16,"sh-icon"),E(),a(),i(17,"button",20),f("click",function(){return e.submit()}),N(18,3),P(19,"sh-icon"),E(),a()()()),n&2&&(p(3),m("options",e.retentionOptions())("inlineSearch",!0)("isClearable",!1),p(3),d("ngModel",e.optionsFields.backupRetention),p(),G(e.optionsFields.backupRetention()==="all"?7:e.optionsFields.backupRetention()==="time"?8:e.optionsFields.backupRetention()==="versions"?9:e.optionsFields.backupRetention()==="smart"?10:e.optionsFields.backupRetention()==="custom"?11:-1),p(5),d("options",e.settings),m("applicationOptions",e.applicationOptions())("hasFreeTextSettings",!0)("hiddenOptions",D(11,ie)),p(5),x("loading",e.isSubmitting()))},dependencies:[H,X,V,W,z,ne,Z,j,Y,q,Q],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:37.5rem;padding:2.5rem}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.form-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 2.5rem;gap:.5rem;align-items:flex-end}.remote-volume-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.remote-volume-wrap[_ngcontent-%COMP%] p.warning[_ngcontent-%COMP%]{color:#7d7d00}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.advanced-option[_ngcontent-%COMP%]{display:grid;gap:.5rem;grid-template-columns:1fr 1fr 2.5rem;align-items:flex-end}sh-select[_ngcontent-%COMP%]{--miw: p2r(120)}"],changeDetection:0})};export{h as default};
1
+ import{a as ne}from"./chunk-AOPTGCDG.js";import{q as ee}from"./chunk-AU25JBCN.js";import"./chunk-PNQ5BDQN.js";import{d as Z}from"./chunk-DCBSWJWZ.js";import"./chunk-OVNIENWW.js";import"./chunk-6Q6SSTBK.js";import"./chunk-COEGVUM3.js";import"./chunk-3GE3OWQF.js";import"./chunk-S5IJ4C5T.js";import"./chunk-2KD757N6.js";import"./chunk-KKUFO6NZ.js";import"./chunk-PEOYNJJM.js";import"./chunk-MWQHWJOA.js";import"./chunk-6RZVYDJF.js";import{B as j,H as Q,P as q,c as X,e as W,i as z,k as V,s as H,v as Y}from"./chunk-CJKZ27FM.js";import"./chunk-4V3AE4ZE.js";import{b as U,d as J}from"./chunk-CQJRBQ6I.js";import"./chunk-V2UO7ES2.js";import"./chunk-HDDAGHHE.js";import"./chunk-YF6JHIN5.js";import"./chunk-2YUSBRXY.js";import{$ as C,Bc as D,Db as m,Eb as i,Fb as a,Gb as P,Nb as g,Ta as p,Ub as N,Vb as E,Wb as l,Yc as K,_b as f,ac as c,ea as O,fa as S,hb as $,hc as v,ic as B,lc as x,qa as w,tc as d,uc as T,vc as u,xb as L,yb as G}from"./chunk-K5XGRFWJ.js";import"./chunk-7CGTOI24.js";var te=["formRef"],ie=()=>["--skip-files-larger-than","encryption-module","no-encryption","--no-encryption","--dbpath","keep-time","keep-versions","retention-policy"];function oe(s,r){s&1&&(i(0,"p"),l(1,4),a())}function ae(s,r){if(s&1){let n=g();i(0,"p"),l(1,5),a(),i(2,"app-timespan",21),u("ngModelChange",function(o){O(n);let t=c();return T(t.optionsFields.backupRetentionTime,o)||(t.optionsFields.backupRetentionTime=o),S(o)}),i(3,"label",22),l(4,6),a()()}if(s&2){let n=c();p(2),m("customId","backupRetentionTime"),d("ngModel",n.optionsFields.backupRetentionTime)}}function se(s,r){if(s&1){let n=g();i(0,"p"),l(1,7),a(),i(2,"sh-form-field")(3,"label",23),l(4,8),a(),i(5,"input",24),u("ngModelChange",function(o){O(n);let t=c();return T(t.optionsFields.backupRetentionVersions,o)||(t.optionsFields.backupRetentionVersions=o),S(o)}),a()()}if(s&2){let n=c();p(5),d("ngModel",n.optionsFields.backupRetentionVersions)}}function _e(s,r){s&1&&(i(0,"p"),l(1,9),a())}function le(s,r){if(s&1){let n=g();i(0,"p"),l(1,10),a(),i(2,"sh-form-field")(3,"p"),l(4,11),a(),i(5,"label",25),l(6,12),a(),i(7,"input",26),u("ngModelChange",function(o){O(n);let t=c();return T(t.optionsFields.backupRetentionCustom,o)||(t.optionsFields.backupRetentionCustom=o),S(o)}),a()()}if(s&2){let n=c();p(7),d("ngModel",n.optionsFields.backupRetentionCustom)}}var re=[{value:"all",name:$localize`Keep all backups`},{value:"time",name:$localize`Delete backups that are older than`},{value:"versions",name:$localize`Keep a specific number of backups`},{value:"smart",name:$localize`Smart backup retention`},{value:"custom",name:$localize`Custom backup retention`}],h=class s{#e=C(ee);#n=C(J);#t=C(U);formRef=K.required("formRef");isSubmitting=this.#e.isSubmitting;settings=this.#e.settings;optionsFields=this.#e.optionsFields;applicationOptions=this.#e.applicationOptions;retentionOptions=w(re);goBack(){this.#n.navigate(["schedule"],{relativeTo:this.#t.parent})}submit(){switch(this.#e.validateBeforeSubmit()){case"general":this.#n.navigate(["general"],{relativeTo:this.#t.parent});return;case"destination":this.#n.navigate(["destination"],{relativeTo:this.#t.parent});return;case"source":this.#n.navigate(["source-data"],{relativeTo:this.#t.parent});return}this.#e.submit()}static \u0275fac=function(n){return new(n||s)};static \u0275cmp=$({type:s,selectors:[["app-advanced-options-settings"]],viewQuery:function(n,e){n&1&&v(e.formRef,te,5),n&2&&B()},decls:20,vars:12,consts:()=>{let r;r=$localize`Options`;let n;n=$localize`Backup retention`;let e;e=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `;let t;t=$localize`Nothing will be deleted. The backup size will grow with each change.`;let M;M=$localize`If at least one newer backup is found, all backups older than this date are deleted.`;let I;I=$localize`Time to keep versions`;let R;R=$localize`Once there are more backups than the specified number, the oldest backups are deleted.`;let b;b=$localize`Number of versions`;let y;y=$localize` Over time backups will be deleted automatically. There will remain one backup for each of the last 7 days, each of the last 4 weeks, each of the last 12 months. There will always be at least one remaining backup. `;let A;A=$localize` Enter a retention strategy manually. Placeholders are D/W/Y for days/weeks/years and U for unlimited. The syntax is: 7D:1D,4W:1W,36M:1M. This example keeps one backup for each of the next 7 days, one for each of the next 4 weeks, and one for each of the next 36 months. This can also be written as 1W:1D,1M:1W,3Y:1M. `;let k;k=$localize`Once there are more backups than the specified number, the oldest backups are deleted.`;let F;return F=$localize`Retention expression`,[r,n,e,o,t,M,I,R,b,y,A,k,F,[1,"title-30"],["value","value","label","name",3,"options","inlineSearch","isClearable"],["for","size"],["type","text",3,"ngModelChange","ngModel"],[3,"optionsChange","options","applicationOptions","hasFreeTextSettings","hiddenOptions"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click"],[3,"ngModelChange","customId","ngModel"],["for","backupRetentionTime"],["for","backupRetentionVersions"],["type","number","id","backupRetentionVersions",3,"ngModelChange","ngModel"],["for","backupRetentionCustom"],["type","text","id","backupRetentionCustom",3,"ngModelChange","ngModel"]]},template:function(n,e){n&1&&(i(0,"section")(1,"h3",13),l(2,0),a(),i(3,"sh-select",14)(4,"label",15),l(5,1),a(),i(6,"input",16),u("ngModelChange",function(t){return T(e.optionsFields.backupRetention,t)||(e.optionsFields.backupRetention=t),t}),a()(),L(7,oe,2,0,"p")(8,ae,5,2)(9,se,6,1)(10,_e,2,0,"p")(11,le,8,1),i(12,"app-options-list",17),u("optionsChange",function(t){return T(e.settings,t)||(e.settings=t),t}),a(),i(13,"div",18)(14,"button",19),f("click",function(){return e.goBack()}),N(15,2),P(16,"sh-icon"),E(),a(),i(17,"button",20),f("click",function(){return e.submit()}),N(18,3),P(19,"sh-icon"),E(),a()()()),n&2&&(p(3),m("options",e.retentionOptions())("inlineSearch",!0)("isClearable",!1),p(3),d("ngModel",e.optionsFields.backupRetention),p(),G(e.optionsFields.backupRetention()==="all"?7:e.optionsFields.backupRetention()==="time"?8:e.optionsFields.backupRetention()==="versions"?9:e.optionsFields.backupRetention()==="smart"?10:e.optionsFields.backupRetention()==="custom"?11:-1),p(5),d("options",e.settings),m("applicationOptions",e.applicationOptions())("hasFreeTextSettings",!0)("hiddenOptions",D(11,ie)),p(5),x("loading",e.isSubmitting()))},dependencies:[H,X,V,W,z,ne,Z,j,Y,q,Q],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:37.5rem;padding:2.5rem}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.form-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 2.5rem;gap:.5rem;align-items:flex-end}.remote-volume-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.remote-volume-wrap[_ngcontent-%COMP%] p.warning[_ngcontent-%COMP%]{color:#7d7d00}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.advanced-option[_ngcontent-%COMP%]{display:grid;gap:.5rem;grid-template-columns:1fr 1fr 2.5rem;align-items:flex-end}sh-select[_ngcontent-%COMP%]{--miw: p2r(120)}"],changeDetection:0})};export{h as default};
@@ -1,2 +1,2 @@
1
- import{b as j}from"./chunk-2KD757N6.js";import{B as X,v as U,y as W}from"./chunk-CJKZ27FM.js";import{d as z}from"./chunk-KNSQLQC6.js";import"./chunk-HDDAGHHE.js";import"./chunk-YF6JHIN5.js";import"./chunk-2YUSBRXY.js";import{$ as E,Bb as D,Bc as J,Cb as x,Db as m,Eb as o,Fb as r,Gb as u,Nb as C,Qa as R,Ta as a,Ub as A,Vb as y,Wb as w,_b as S,ac as f,ea as p,fa as _,hb as v,oc as s,pc as I,q as O,qa as g,qc as h,rc as B,sa as F,tc as $,uc as k,vc as G,xb as M,yb as N,zb as P,zc as V}from"./chunk-K5XGRFWJ.js";import{a as T,b}from"./chunk-7CGTOI24.js";var q=()=>({maxWidth:"700px",width:"100%"});function H(l,n){if(l&1&&(o(0,"a",9)(1,"sh-icon"),s(2,"link"),r()()),l&2){let e=f().$implicit;m("href",V(e.Url),R)}}function K(l,n){if(l&1){let e=C();o(0,"div",2)(1,"h4"),s(2),M(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))}),A(11,1),u(12,"sh-icon"),y(),r()()()}if(l&2){let e=n.$implicit;a(2),B(" ",e.Title," - ",e.data==null?null:e.data.license," "),a(),N(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=E(z);licenses=j(this.#e.getApiV1Licenses().pipe(O(n=>n.map(e=>b(T({},e),{data:e.Jsondata?JSON.parse(e.Jsondata):null})))));dialogIsOpen=g(!1);dialogLicense=g(null);#n=F(()=>{this.dialogLicense()&&this.dialogIsOpen.set(!0)});openLicense(n){this.dialogLicense.set(n)}closeLicense(){this.dialogIsOpen.set(!1),this.dialogLicense.set(null)}breakIntoLines(n){let e=n.split(`
1
+ import{b as j}from"./chunk-2KD757N6.js";import{B as X,v as U,y as W}from"./chunk-CJKZ27FM.js";import{d as z}from"./chunk-4V3AE4ZE.js";import"./chunk-HDDAGHHE.js";import"./chunk-YF6JHIN5.js";import"./chunk-2YUSBRXY.js";import{$ as E,Bb as D,Bc as J,Cb as x,Db as m,Eb as o,Fb as r,Gb as u,Nb as C,Qa as R,Ta as a,Ub as A,Vb as y,Wb as w,_b as S,ac as f,ea as p,fa as _,hb as v,oc as s,pc as I,q as O,qa as g,qc as h,rc as B,sa as F,tc as $,uc as k,vc as G,xb as M,yb as N,zb as P,zc as V}from"./chunk-K5XGRFWJ.js";import{a as T,b}from"./chunk-7CGTOI24.js";var q=()=>({maxWidth:"700px",width:"100%"});function H(l,n){if(l&1&&(o(0,"a",9)(1,"sh-icon"),s(2,"link"),r()()),l&2){let e=f().$implicit;m("href",V(e.Url),R)}}function K(l,n){if(l&1){let e=C();o(0,"div",2)(1,"h4"),s(2),M(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))}),A(11,1),u(12,"sh-icon"),y(),r()()()}if(l&2){let e=n.$implicit;a(2),B(" ",e.Title," - ",e.data==null?null:e.data.license," "),a(),N(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=E(z);licenses=j(this.#e.getApiV1Licenses().pipe(O(n=>n.map(e=>b(T({},e),{data:e.Jsondata?JSON.parse(e.Jsondata):null})))));dialogIsOpen=g(!1);dialogLicense=g(null);#n=F(()=>{this.dialogLicense()&&this.dialogIsOpen.set(!0)});openLicense(n){this.dialogLicense.set(n)}closeLicense(){this.dialogIsOpen.set(!1),this.dialogLicense.set(null)}breakIntoLines(n){let e=n.split(`
2
2
  `),t="";for(let i=0;i<e.length;i++)t+=`<li>${e[i]}</li>`;return t}static \u0275fac=function(e){return new(e||l)};static \u0275cmp=v({type:l,selectors:[["app-libraries"]],decls:14,vars:5,consts:()=>{let n;n=$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:`,[n,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,t){if(e&1){let i=C();o(0,"h3"),w(1,0),r(),D(2,K,13,5,"div",2,P),o(4,"sh-dialog",3),G("isOpenChange",function(d){return p(i),k(t.dialogIsOpen,d)||(t.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),t.dialogLicense.set(null),_(t.dialogIsOpen.set(!1))}),s(13,"Close"),r()()()}if(e&2){let i,c;a(2),x(t.licenses()),a(2),$("isOpen",t.dialogIsOpen),m("options",J(4,q)),a(3),I((i=t.dialogLicense())==null?null:i.Title);let d=((c=t.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{b as v}from"./chunk-UIVZWXBK.js";import{a as N,b}from"./chunk-OP7MDR2B.js";import{a as S}from"./chunk-NUV5LHQV.js";import{d as g}from"./chunk-KNSQLQC6.js";import{$ as s,B as d,E as o,O as p,Rc as m,W as u,l as f,qa as c,sa as n,w as h}from"./chunk-K5XGRFWJ.js";var l=class r{#e=s(g);#o=s(v);#s=s(b);#a=s(S);#n=s(N);serverState=this.#o.serverState;serverStateEffect=n(()=>{let t=this.#o.serverState();t?.LastNotificationUpdateID&&this.updateLastNotificationEventId(t?.LastNotificationUpdateID)});#r=-1;#t=c([]);#i=c([]);notifications=this.#t.asReadonly();pendingRefresh=!1;constructor(){this.#n.subscribe("notifications")}init(){this.notifications().length===0&&this.getNotifications()}notificationsEffect=n(()=>{let t=this.#n.notificationState();t&&this.#t.set(t)});pendingRefreshEffect=n(()=>{this.#s.isConnectionMethodSet()&&this.pendingRefresh&&(this.pendingRefresh=!1,this.getNotifications())});#c=m(()=>{let t=this.#s.getConnectionMethod()==="websocket",i=this.#a.hasWsRemoteControl();return t&&i});updateLastNotificationEventId(t){this.#r!==t&&(this.#r=t,this.getNotifications())}getNotifications(){if(!this.#c()){if(!this.#s.isConnectionMethodSet()){this.pendingRefresh=!0;return}this.#e.getApiV1Notifications().pipe(o(1),p(t=>this.#t.set(t))).subscribe()}}getNofication(t){this.#e.getApiV1NotificationById({id:t}).pipe(o(1)).subscribe()}deleteNotification(t){let i=this.#t(),e=i[t];this.#i.set(i),i.splice(t,1),this.#t.set(i),this.#e.deleteApiV1NotificationById({id:e.ID}).pipe(o(1)).subscribe({error:()=>{this.#t.set(this.#i()),this.#i.set([])}})}deleteAllNotifications(){let t=this.#t();this.#i.set(t),this.#t.set([]);let i=t.map(e=>this.#e.deleteApiV1NotificationById({id:e.ID}).pipe(d(()=>f(e))));h(i).pipe(o(1)).subscribe({next:e=>{let D=e.filter(a=>a!=null&&"ID"in a);this.#t.set(D),this.#i.set([])},error:()=>{this.#t.set(this.#i()),this.#i.set([])}})}static \u0275fac=function(i){return new(i||r)};static \u0275prov=u({token:r,factory:r.\u0275fac,providedIn:"root"})};export{l as a};
1
+ import{b as v}from"./chunk-LNE7WQZG.js";import{a as N,b}from"./chunk-KKUFO6NZ.js";import{a as S}from"./chunk-MWQHWJOA.js";import{d as g}from"./chunk-4V3AE4ZE.js";import{$ as s,B as d,E as o,O as p,Rc as m,W as u,l as f,qa as c,sa as n,w as h}from"./chunk-K5XGRFWJ.js";var l=class r{#e=s(g);#o=s(v);#s=s(b);#a=s(S);#n=s(N);serverState=this.#o.serverState;serverStateEffect=n(()=>{let t=this.#o.serverState();t?.LastNotificationUpdateID&&this.updateLastNotificationEventId(t?.LastNotificationUpdateID)});#r=-1;#t=c([]);#i=c([]);notifications=this.#t.asReadonly();pendingRefresh=!1;constructor(){this.#n.subscribe("notifications")}init(){this.notifications().length===0&&this.getNotifications()}notificationsEffect=n(()=>{let t=this.#n.notificationState();t&&this.#t.set(t)});pendingRefreshEffect=n(()=>{this.#s.isConnectionMethodSet()&&this.pendingRefresh&&(this.pendingRefresh=!1,this.getNotifications())});#c=m(()=>{let t=this.#s.getConnectionMethod()==="websocket",i=this.#a.hasWsRemoteControl();return t&&i});updateLastNotificationEventId(t){this.#r!==t&&(this.#r=t,this.getNotifications())}getNotifications(){if(!this.#c()){if(!this.#s.isConnectionMethodSet()){this.pendingRefresh=!0;return}this.#e.getApiV1Notifications().pipe(o(1),p(t=>this.#t.set(t))).subscribe()}}getNofication(t){this.#e.getApiV1NotificationById({id:t}).pipe(o(1)).subscribe()}deleteNotification(t){let i=this.#t(),e=i[t];this.#i.set(i),i.splice(t,1),this.#t.set(i),this.#e.deleteApiV1NotificationById({id:e.ID}).pipe(o(1)).subscribe({error:()=>{this.#t.set(this.#i()),this.#i.set([])}})}deleteAllNotifications(){let t=this.#t();this.#i.set(t),this.#t.set([]);let i=t.map(e=>this.#e.deleteApiV1NotificationById({id:e.ID}).pipe(d(()=>f(e))));h(i).pipe(o(1)).subscribe({next:e=>{let D=e.filter(a=>a!=null&&"ID"in a);this.#t.set(D),this.#i.set([])},error:()=>{this.#t.set(this.#i()),this.#i.set([])}})}static \u0275fac=function(i){return new(i||r)};static \u0275prov=u({token:r,factory:r.\u0275fac,providedIn:"root"})};export{l as a};