@duplicati/ngclient 0.0.220 → 0.0.221

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 (67) hide show
  1. package/assets/dest-icons/drime.png +0 -0
  2. package/{chunk-7C2YZVSQ.js → chunk-3L3SRTPU.js} +1 -1
  3. package/{chunk-DJXLNIMV.js → chunk-43WATFQS.js} +6 -6
  4. package/chunk-5JGSXUKD.js +1 -0
  5. package/chunk-5YE4H57F.js +1 -0
  6. package/{chunk-PG4G4RLP.js → chunk-5ZRRLJA4.js} +1 -1
  7. package/{chunk-XDBSTUYC.js → chunk-6NVCDJR6.js} +1 -1
  8. package/{chunk-WOKYULBU.js → chunk-736PM4LG.js} +1 -1
  9. package/{chunk-XXVDL5TR.js → chunk-77IXQ4GU.js} +1 -1
  10. package/chunk-APSPCDGV.js +1 -0
  11. package/chunk-AXQQEOTT.js +1 -0
  12. package/{chunk-EADZVBRA.js → chunk-BMACDVWX.js} +1 -1
  13. package/{chunk-3RCF6UT4.js → chunk-COI6UMB5.js} +1 -1
  14. package/{chunk-RLWICOKH.js → chunk-CZVTBPNE.js} +1 -1
  15. package/{chunk-GN7AO4B6.js → chunk-DE4JIJWO.js} +1 -1
  16. package/{chunk-ZHQI6LYB.js → chunk-DHFLXFWF.js} +1 -1
  17. package/chunk-E4NQOMJX.js +1 -0
  18. package/chunk-ESLC5LVP.js +1 -0
  19. package/{chunk-I6MIXWIT.js → chunk-F2ZC26DC.js} +1 -1
  20. package/{chunk-BACKG7KA.js → chunk-F3ETZKLK.js} +1 -1
  21. package/{chunk-RJ2JM7C7.js → chunk-F3JYPWPK.js} +1 -1
  22. package/{chunk-4OJPTRZJ.js → chunk-FDYBIC4O.js} +1 -1
  23. package/{chunk-PXI3UZ4R.js → chunk-FR5RTIOE.js} +1 -1
  24. package/{chunk-NKUA7I47.js → chunk-G2BDKU26.js} +1 -1
  25. package/{chunk-2J2554EV.js → chunk-GW34KK5A.js} +1 -1
  26. package/{chunk-22AR7ES3.js → chunk-I5DD3Q6J.js} +1 -1
  27. package/{chunk-NHS6CQO2.js → chunk-JP2Z2HMH.js} +1 -1
  28. package/{chunk-EDLHTWBA.js → chunk-JPMKWWZP.js} +1 -1
  29. package/{chunk-ZP3QZ43W.js → chunk-JSZIISFS.js} +1 -1
  30. package/chunk-LE24LKH7.js +1 -0
  31. package/{chunk-X276XFCH.js → chunk-MTL3FBSM.js} +1 -1
  32. package/{chunk-37ODVJFS.js → chunk-N2GI5QYJ.js} +1 -1
  33. package/chunk-O56QUSSI.js +2 -0
  34. package/{chunk-RRDLQLTM.js → chunk-OCUE5GMT.js} +1 -1
  35. package/{chunk-BZXBH4CN.js → chunk-OJVUCHRP.js} +1 -1
  36. package/chunk-OL7ADIFI.js +1 -0
  37. package/{chunk-P4R3ERID.js → chunk-OLWLWDXZ.js} +1 -1
  38. package/{chunk-UCHK3SHH.js → chunk-PPSQGUOL.js} +1 -1
  39. package/{chunk-XEG3CP74.js → chunk-QQWV3FEH.js} +1 -1
  40. package/{chunk-ZYRB2TUK.js → chunk-RDLRXAJU.js} +1 -1
  41. package/{chunk-ZNYRWXQR.js → chunk-SACQFUJE.js} +1 -1
  42. package/{chunk-M3PW6DLD.js → chunk-TISQKN7N.js} +1 -1
  43. package/{chunk-IFSZJSGH.js → chunk-TVFRVP7K.js} +1 -1
  44. package/chunk-TWAHUXIN.js +1 -0
  45. package/{chunk-GRE6GKVP.js → chunk-TZ7MW3NZ.js} +1 -1
  46. package/{chunk-VC55KFAX.js → chunk-UZ4POLDC.js} +1 -1
  47. package/{chunk-KDV2OE64.js → chunk-WJBMMY2Y.js} +1 -1
  48. package/{chunk-NX35OQ3V.js → chunk-XBAZKJ47.js} +1 -1
  49. package/chunk-XPVATEBM.js +1 -0
  50. package/{chunk-5RNU5BNO.js → chunk-YMFI2Q2X.js} +1 -1
  51. package/chunk-YPNN5FBK.js +1 -0
  52. package/{chunk-C6PICAXB.js → chunk-YYD2JU6T.js} +1 -1
  53. package/index.html +1 -1
  54. package/{main-7J2QXC6H.js → main-IUT3IXX4.js} +1 -1
  55. package/package.json +1 -1
  56. package/chunk-4OA2FFS5.js +0 -1
  57. package/chunk-AIAUP7OE.js +0 -1
  58. package/chunk-C3PQFWVO.js +0 -1
  59. package/chunk-DSZ644JT.js +0 -1
  60. package/chunk-EPIYGHPM.js +0 -1
  61. package/chunk-EXMYBMGI.js +0 -1
  62. package/chunk-N3NJW75G.js +0 -1
  63. package/chunk-OHYENIPP.js +0 -1
  64. package/chunk-QOWXL7ZL.js +0 -1
  65. package/chunk-QZQS7M3D.js +0 -1
  66. package/chunk-YWUUX3S6.js +0 -1
  67. package/chunk-ZEFSBETQ.js +0 -2
@@ -1 +1 @@
1
- import{a as Ke}from"./chunk-YCJYEQF7.js";import{a as Ye}from"./chunk-IMQUTGIK.js";import{a as Qe}from"./chunk-C6PICAXB.js";import{A as ze,B as ge,H as Q,J as je,K as He,L as Je,P as Ue,W as Xe,a as pe,c as U,e as X,i as q,k as he,s as K,v as We,y as Ve,z as Ge}from"./chunk-VKQQDCUN.js";import{d as qe}from"./chunk-DSYNIXJF.js";import{aa as Be}from"./chunk-ZC23RK4J.js";import{$b as f,A as be,Ab as re,Ac as we,Bb as se,Bc as ue,Cb as N,Cc as Ie,Db as u,Eb as p,F as _e,Fb as ae,Fc as Le,Gc as Ae,Jb as Se,Jc as ke,Kb as ye,Lb as me,Mb as W,Qc as y,Sa as _,Tb as Oe,Ub as ve,Vb as A,Vc as $e,Wb as Z,Wc as C,Xb as ee,Xc as Ce,Zb as V,_ as ie,ac as J,bc as D,da as v,ea as F,gb as H,gc as Fe,hc as xe,ic as fe,jc as le,kc as z,l as Ee,lb as Y,nc as b,oc as Re,pa as P,pc as De,q as G,qc as ce,ra as L,sc as k,tc as $,uc as B,vb as oe,w as Pe,wb as x,xb as R,yb as Ne,zc as de}from"./chunk-TQTOIWBK.js";import{a as te,b as ne}from"./chunk-7CGTOI24.js";var lt=["treeContainer"],ct=["formRef"],dt=[[["label"]],[["label"]],[["input"]]],ut=["label","label","input"],pt=r=>({children:r,level:0}),nt=r=>({$implicit:r}),ht=(r,t)=>({children:r,level:t}),gt=()=>({maxWidth:"700px",width:"100%"}),_t=(r,t)=>t.id;function mt(r,t){if(r&1){let e=W();u(0,"sh-button-group",21),B("valueChange",function(i){v(e);let o=f();return $(o.pathDiscoveryMethod,i)||(o.pathDiscoveryMethod=i),F(i)}),u(1,"button",22),A(2,4),p(),u(3,"button",23),A(4,5),p()()}if(r&2){let e=f();k("value",e.pathDiscoveryMethod)}}function ft(r,t){r&1&&ae(0,"sh-progress-bar",14)}function Ct(r,t){r&1&&(u(0,"sh-icon",29),b(1,"caret-down"),p())}function Tt(r,t){r&1&&ae(0,"sh-icon",29)}function Mt(r,t){r&1&&(u(0,"sh-icon",29),b(1,"spinner"),p())}function Et(r,t){r&1&&(u(0,"sh-icon",29),b(1,"caret-right"),p())}function Pt(r,t){r&1&&(u(0,"sh-icon",26),b(1,"folder-open"),p())}function bt(r,t){r&1&&(u(0,"sh-icon",26),b(1,"folder-user"),p())}function Nt(r,t){r&1&&(u(0,"sh-icon",26),b(1,"file"),p())}function St(r,t){r&1&&(u(0,"sh-icon",26),b(1,"folder"),p())}function yt(r,t){if(r&1&&(x(0,Ct,2,0,"sh-icon",29)(1,Tt,1,0,"sh-icon",29)(2,Mt,2,0,"sh-icon",29)(3,Et,2,0,"sh-icon",29),x(4,Pt,2,0,"sh-icon",26)(5,bt,2,0,"sh-icon",26)(6,Nt,2,0,"sh-icon",26)(7,St,2,0,"sh-icon",26)),r&2){let e=f(2).$implicit,n=f(2);R(e.children.length?0:e.cls==="file"?1:e.id===n.isLoading()?2:3),_(4),R(e.children.length?4:e.id==="%HOME%"?5:e.cls==="file"?6:7)}}function Ot(r,t){r&1&&(u(0,"sh-icon",26),b(1,"desktop-tower"),p())}function vt(r,t){if(r&1&&(u(0,"span",28),b(1),Le(2,"bytes"),p()),r&2){let e=f(2).$implicit;_(),De("\xA0(",Ae(2,1,e.fileSize),")")}}function Ft(r,t){r&1&&me(0)}function xt(r,t){if(r&1&&Y(0,Ft,1,0,"ng-container",15),r&2){let e=f(2).$implicit,n=f().$implicit;f();let i=fe(7);N("ngTemplateOutlet",i)("ngTemplateOutletContext",ue(5,nt,Ie(2,ht,e.children,n.level+1)))}}function Rt(r,t){if(r&1){let e=W();u(0,"div",24,3),V("click",function(){v(e);let i=f().$implicit,o=f(2);return F(o.toggleNode(i.id,i))}),u(2,"div",25),x(3,yt,8,2)(4,Ot,2,0,"sh-icon",26),p(),u(5,"div",27),V("click",function(i){v(e);let o=f().$implicit,l=f(2);return F(l.toggleSelectedNode(i,o))}),u(6,"span"),b(7),p(),x(8,vt,3,3,"span",28),p()(),x(9,xt,1,7,"ng-container")}if(r&2){let e=f().$implicit,n=f().$implicit,i=f();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),_(2),z("file",e.cls==="file"),_(),R(e.id!=="/"?3:4),_(4),Re(e.text),_(),R(e.cls=="file"&&e.fileSize!=null?8:-1),_(),R(e.children.length>0?9:-1)}}function Dt(r,t){if(r&1&&x(0,Rt,10,24),r&2){let e=t.$implicit,n=f(2);R(e.hidden&&n._showHiddenNodes()||!e.hidden?0:-1)}}function wt(r,t){if(r&1&&(u(0,"sh-list"),re(1,Dt,1,1,null,null,_t),p()),r&2){let e=t.$implicit;le("padding-left",e.level*.25,"rem"),_(),se(e.children)}}function It(r,t){r&1&&me(0)}function Lt(r,t){if(r&1){let e=W();u(0,"sh-toggle",30),B("checkedChange",function(i){v(e);let o=f();return $(o._showHiddenNodes,i)||(o._showHiddenNodes=i),F(i)}),A(1,6),p()}if(r&2){let e=f();k("checked",e._showHiddenNodes),_(),Z(e.showFiles()?"files":"folders"),ee(1)}}function At(r,t){if(r&1){let e=W();u(0,"button",31),V("click",function(){v(e);let i=f();return F(i.openCreateFolderDialog())}),A(1,7),p()}if(r&2){let e=f();N("disabled",!e.isCurrentPathFolder())}}function kt(r,t){if(r&1){let e=W();u(0,"sh-dialog",32),B("isOpenChange",function(i){v(e);let o=f();return $(o.createFolderDialogOpen,i)||(o.createFolderDialogOpen=i),F(i)}),u(1,"header",33)(2,"h2"),A(3,8),p()(),u(4,"div",34)(5,"div",35)(6,"p"),A(7,9),p(),u(8,"div",36)(9,"pre"),b(10),p()()(),u(11,"sh-form-field")(12,"textarea",37),B("ngModelChange",function(i){v(e);let o=f();return $(o.createFolderPath,i)||(o.createFolderPath=i),F(i)}),p()()(),u(13,"footer",38)(14,"button",39),V("click",function(){v(e);let i=f();return F(i.closeCreateFolderDialog(!1))}),b(15,"Cancel"),p(),u(16,"button",40),V("click",function(){v(e);let i=f();return F(i.closeCreateFolderDialog(!0))}),Oe(17,10),ae(18,"sh-icon"),ve(),p()()()}if(r&2){let e,n=f();k("isOpen",n.createFolderDialogOpen),N("options",we(6,gt)),_(10),ce("",n.currentPathResolvedShorthands(),"",n.createFolderPath()?"/"+n.createFolderPath():""),_(2),k("ngModel",n.createFolderPath),_(4),N("disabled",!((e=n.createFolderPath())!=null&&e.length))}}var it=(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))(it||{}),E="/",Te=class r{#e=ie(qe);#i=ie(Qe);#p=ie(Ge);multiSelect=C(!1);disabled=C(!1);showFiles=C(!1);selectFiles=C(!1);accepts=C(null);startingPath=C(null);rootPaths=C([]);initialNodes=C([]);backupSettings=C(null);pathRefreshTrigger=C(!1);showHiddenNodes=C(!1);enableCreateFolder=C(!1);hideShortcuts=C(!1);customRemoteMode=C(null);backupId=C("");sourcePrefix=C("");destinationUrl=C("");loadExtendedData=C(!0);hasExtendedData=$e();searchMode=C(!1);searchResults=C([]);_showHiddenNodes=P(!1);createFolderDialogOpen=P(!1);createFolderPath=P(null);treeContainerRef=Ce("treeContainer");formRef=Ce("formRef");pathDiscoveryMethod=P("browse");isLoading=P(null);currentPath=P("");currentPathResolvedShorthands=y(()=>this.#i.resolveShorthandPath(this.currentPath()));#r=P(null);treeSearchQuery=P("");treeNodes=P([]);pathDelimiter=y(()=>this.#i.systemInfo()?.DirectorySeparator??"");filterGroups=this.#i.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()});TreeEvalEnum=it;searchResultTreeStructure=y(()=>{let t=this.searchResults();if(t.length===0)return[];let e=this.currentPath().split("\0").filter(a=>a!==""&&a!==E),n=this.showHiddenNodes(),i=new Map;for(let a of t){let c=a.Path??"",h=this.#n(c),O=c.split(h).filter(S=>S!==""),T="";for(let S=0;S<O.length;S++){let w=O[S],I=S===O.length-1,j=!I||this.#t(c),st=T||E,Me=T?T.endsWith(h)?T.slice(0,-h.length):T:"";if(T=Me?`${Me}${h}${w}`:`${h}${w}`,j&&!T.endsWith(h)&&(T+=h),!i.has(T))i.set(T,{part:w,parentPath:st,isFolder:j,match:I?a:null});else if(I){let at=i.get(T);at.match=a}}}let o=new Map;for(let[a,c]of i)o.has(c.parentPath)||o.set(c.parentPath,[]),o.get(c.parentPath).push(a);let l=new Set,g=new Map;for(let[a,c]of i){if(!c.isFolder){l.add(a);continue}let h=o.get(c.parentPath)||[];if(h.length===1&&h[0]===a&&c.parentPath!==E)continue;l.add(a);let T=c.part,S=a;for(;;){let w=o.get(S)||[];if(w.length!==1)break;let I=w[0],j=i.get(I);if(!j||!j.isFolder)break;T+="/"+j.part,S=I}S!==a&&g.set(a,T)}l.add(E);let s=[],d=new Map,M=Array.from(l).filter(a=>a!==E).sort((a,c)=>a.split("/").length-c.split("/").length||a.localeCompare(c));for(let a of M){let c=i.get(a);if(!c)continue;let h=c.parentPath;for(;h!==E&&!l.has(h);)h=i.get(h)?.parentPath||E;if(d.has(a))continue;let O=this.#a(g.get(a),c.match?.Metadata)??c.part,T=c.match===null,S=c.match!==null&&!c.isFolder&&n?0:this.#s(e,a,c.isFolder?"folder":"file",null),w={id:a,resolvedpath:a,text:O,parentPath:h,children:[],evalState:S,isIndeterminate:this.isIndeterminate(e,a),cls:c.isFolder?"folder":"file",isSearchMatch:c.match!==null,isGenerated:T,hasChildrenInSearch:(o.get(a)?.length||0)>0,iconCls:null,check:!1,leaf:!c.isFolder,hidden:!1,systemFile:!1,temporary:!1,symlink:!1,fileSize:c.match?.Size??0};if(d.set(a,w),h===E)s.push(w);else{let I=d.get(h);I&&I.children.push(w)}}let m=a=>{a.sort((c,h)=>c.cls==="folder"&&h.cls!=="folder"?-1:c.cls!=="folder"&&h.cls==="folder"?1:(c.text??"").localeCompare(h.text??"")),a.forEach(c=>m(c.children))};return m(s),s});treeStructure=y(()=>{if(this.searchMode())return this.searchResultTreeStructure();let t=this.showHiddenNodes(),e=this.currentPath().split("\0").filter(s=>s!==""&&s!==E),n=structuredClone(e);for(let s=0;s<n.length;s++){let M=n[s].slice(1);if(M.startsWith("{")&&M.endsWith("}")){let m=M.slice(1,-1),a=this.filterGroups?.FilterGroups[m];if(a&&a.length){let c=a.map(h=>`-${h}`);n.splice(s,1,...c)}}}let i=this.searchableTreeNodes(),o=this.rootPaths(),l=this.accepts(),g=[];return o.length>0?g=o.map(s=>{let d=this.#s(n,s,"folder",null);return{id:s,resolvedpath:s,text:s,parentPath:"",children:[],evalState:d,isIndeterminate:!1,cls:this.#t(s)?"folder":"file"}}):g=[{id:E,resolvedpath:E,text:$localize`Computer`,parentPath:"",children:[],evalState:0,isIndeterminate:!1,cls:"folder"}],g.map(s=>{let d=new Map;if(!s.id)return;let M=s.id;l&&(s.accepted=!0),d.set(M,s);let m=o.length>0?i.filter(a=>a.parentPath.startsWith(M)):i;for(let a of m){if(!a.id)continue;let c=a.id;if(!a.cls||d.has(c))continue;let h=d.get(a.parentPath),O=a.hidden===!0&&t?0:this.#s(n,c,a.cls,h),T=ne(te({},a),{isIndeterminate:this.isIndeterminate(n,c),evalState:O,children:[]});l&&(T.accepted=this.matchAccepts(l,T)),d.set(c,T),T.id?.startsWith("%")&&T.id?.endsWith("%")&&d.set(this.#l(c),T),h&&h.children.push(T)}return s}),g});#l(t){if(!t)return E;let e=this.#n(t);return t.endsWith("/")||t.endsWith("\\")||t===E?t:t+e}#s(t,e,n,i){if(i&&i.evalState===-1)return-2;let o=0,l=t.filter(d=>!d.startsWith("-")&&!d.startsWith("+")),g=t.filter(d=>d.startsWith("-")||d.startsWith("+")),s=this.multiSelect();if(l.length===0)return o;for(let d=0;d<l.length;d++){let M=l[d];if(e===M){o=1;break}if(!s||!this.#t(M))continue;if(e?.startsWith(M)){o=1;break}}if(g.length===0)return o;for(let d=0;d<g.length;d++){let M=g[d],m=M.slice(1),a=M.startsWith("-")?-1:1;if(this.#t(m)){if(n!=="folder")continue;if(e===m){o=a;break}}if(m.startsWith("*")&&(m.endsWith("*\\")||m.endsWith("*/"))){if(n!=="folder")continue;let h=m.slice(1,-2);if(h==="")break;if(e?.includes(h+"\\")||e?.includes(h+"/")){o=a;break}}if(m.startsWith("[.*")&&(m.endsWith("[^\\/]*]")||m.endsWith("[^\\\\]*]"))){if(n!=="file")continue;let h=m.slice(3,-7);if(new RegExp(h).test(e)){o=a;break}}if(m.startsWith("[")&&m.endsWith("]")){let h=m.slice(1,-1),O=this.translateCSharpRegex(h);if(new RegExp(`${O}`).test(e)){o=a;break}}if(m.startsWith("*.")){if(n!=="file"||m.replace("*.","").length===0)continue;if(this.#c(e,m,!0)){o=a;break}}if(m==="")continue;if(m===e){o=a;break}if(this.#c(e,m,!0)){o=a;break}}return o}translateCSharpRegex(t){let e=t;e=e.replace(/^@/,"");let n=/\(\?<(?<name>\w+)>(?<pattern>[^)]+)\)/g;return e=e.replace(n,(i,o,l)=>`(${l})`),e=e.replace(/\\/g,"\\\\"),e}isIndeterminate(t,e){return t.filter(n=>!n.startsWith("-")&&this.#t(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,".*").replace(/\?/g,".").replace(/\[!([^\]]+)\]/g,"[^$1]");return new RegExp(`${i}${n?"$":""}`).test(t)}#n(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.#r();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===E)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.#r();t&&(t.value=this.currentPath(),t.dispatchEvent(new Event("input")))});inputValueChangeAbortController=null;inputRefEffect=L(()=>{let t=this.formRef()?.nativeElement?.querySelector("input");t&&(this.#h(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.#r.set(t),t.autocomplete="off")});ngOnInit(){let t=this.startingPath();if(t)this.currentPath.set(t),this.#T(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.#a(i.text,i?.Metadata),iconCls:i.iconCls,fileSize:i.fileSize,resolvedpath:i.resolvedpath,parentPath:this.getParentPath(i.id??"")}))),this.#o(null,e[0])):this.#o(null,E)}}getParentPath(t){let e=this.#n(t),n=t.split(e);return n.length<=1?E:(n.pop(),n.length!==0&&n.pop(),n.join(e)+e)}toggleSelectedNode(t,e){if(e.id===E||(t.stopPropagation(),this.searchMode()&&!e.isSearchMatch)||e.evalState===-2)return;if(this.selectFiles()&&e.cls==="folder"){this.toggleNode(e.id,e);return}if(this.accepts()&&!e.accepted)return;let i=this.currentPath().split("\0").filter(s=>s!==""&&s!==E),l=this.isChildOfSelected(e)?`-${e.id}`:e.id,g=this.#t(e.id);if(this.multiSelect())if(i.includes(e.id))this.currentPath.set(i.filter(s=>s!==e.id&&!(g&&s.startsWith(l))).join("\0"));else if(i.some(s=>s==l))this.currentPath.set(i.filter(s=>s!==l).join("\0"));else{let s=g?i.filter(d=>!d.startsWith(e.id)):i;this.currentPath.set([...s,l].join("\0"))}else i.includes(e.id)?this.currentPath.set(i.filter(s=>s!==e.id).join("\0")):this.currentPath.set(e.id)}isChildOfSelected(t){return this.currentPath().split("\0").filter(n=>n!==""&&n!==E&&this.#t(n)).some(n=>t.id?.startsWith(n)||`-${t.id}`.startsWith(n))}toggleNode(t,e=null){e?.cls==="folder"&&(e?.children.length?this.treeNodes.update(n=>n.filter(i=>!i.id?.startsWith(e.id)||i.id===e.id)):this.#o(e,t))}openCreateFolderDialog(){return this.createFolderPath.set(null),this.createFolderDialogOpen.set(!0),!1}closeCreateFolderDialog(t){if(t&&this.createFolderPath()?.length&&this.isCurrentPathFolder()){let e=this.createFolderPath()?.trim();if(e){let n=this.currentPath(),i=this.currentPathResolvedShorthands(),o=this.#l(e),l=`${i}/${o}`;this.#e.postApiV1RemoteoperationCreate({requestBody:{path:"file://"+l}}).subscribe({next:()=>{this.currentPath.set(l),this.#o(null,n),setTimeout(()=>{this.#d()},500),this.createFolderDialogOpen.set(!1)},error:g=>{let s=g?.message?.match(/user-information\s*:\s*(.*?)(?:\s*,|$)/i),d=s?s[1]:g?.message||$localize`An error occurred while trying to create the folder.`;this.#p.open(Ye,{data:{title:$localize`Cannot create folder`,message:d,confirmText:$localize`OK`,cancelText:void 0}})}})}}else this.createFolderDialogOpen.set(!1);return!1}#d(){setTimeout(()=>{let e=this.treeContainerRef()?.nativeElement?.querySelector(".active");e&&e.scrollIntoView({behavior:"smooth",block:"center"})},100)}#h(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}#g(t){return this.#e.postApiV1Filesystem({showHidden:!0,requestBody:{path:t},onlyFolders:!this.showFiles()})}#_(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"office365",requestBody:{"backup-id":this.backupId()??"","source-prefix":this.sourcePrefix()??"",operation:"ListDestinationRestoreTargets",url:this.destinationUrl()??"",path:t??"/"}}).pipe(G(e=>{let n=e.Result;return Object.keys(n).map(i=>({Path:i,Metadata:JSON.parse(n[i])}))}))}#m(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"googleworkspace",requestBody:{"backup-id":this.backupId()??"","source-prefix":this.sourcePrefix()??"",operation:"ListDestinationRestoreTargets",url:this.destinationUrl()??"",path:t??"/"}}).pipe(G(e=>{let n=e.Result;return Object.keys(n).map(i=>({Path:i,Metadata:JSON.parse(n[i])}))}))}#f(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"diskimage",requestBody:{operation:"ListDestinationRestoreTargets",path:t??"/"}}).pipe(G(e=>{let n=e.Result;return Object.keys(n).map(i=>({Path:i,Metadata:JSON.parse(n[i])}))}))}#C(t){let e=this.backupSettings();if(this.#i.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(G(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(G(i=>i.Files??[]))}}#u(t){return this.customRemoteMode()==="o365"?this.#_(t):this.customRemoteMode()==="gsuite"?this.#m(t):this.customRemoteMode()==="diskimage"?this.#f(t):this.isByBackupSettings()?this.#C(t):this.#g(t)}#T(t){let n=t.split("\0").filter(l=>!l.startsWith("-")&&!l.startsWith("+")&&!l.startsWith("@")).filter(Boolean).map(l=>{let g=this.#n(l),s=l.split(g);return s.at(-1)===""&&s.pop(),{split:s,sep:g}}),i=[E];n.forEach(({split:l,sep:g})=>{l.forEach((s,d)=>{let M=l.slice(0,d+1).join(g)+g;M===""||M===g||i.includes(M)||i.push(M)})});let o=i.map(l=>(this.isLoading.set(l),this.#u(l).pipe(G(g=>({status:"success",value:g,url:l})),be(g=>Ee({status:"error",value:g,url:l})))));Pe(o).pipe(_e(()=>this.isLoading.set(null))).subscribe({next:l=>{let g=l.filter(d=>d.status==="success"),s=l.filter(d=>d.status==="error");this.treeNodes.update(d=>{let M=g.flatMap(a=>Array.isArray(a.value)?a.value.map(c=>ne(te({},c),{parentPath:a.url})):[]),m=[...new Map([...d,...M].map(a=>[a.id,a])).values()];return this.#d(),this.hideShortcuts()?m.filter(a=>!a.id.startsWith("%")):m})}})}#a(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}#M(t){t&&t.ExtType&&t.ExtType.length>0&&this.hasExtendedData.emit(t.ExtType)}#t(t){return t.startsWith("%")&&t.endsWith("%")&&!t.includes("/")&&!t.includes("\\")||t.endsWith("/")||t.endsWith("\\")}#o(t=null,e=E){this.isLoading.set(e),this.#u(e).pipe(_e(()=>this.isLoading.set(null))).subscribe({next:n=>{let i=this.isByBackupSettings()||this.customRemoteMode()!==null?n.map(o=>{this.#M(o.Metadata);let l=this.#n(o.Path);return{text:this.#a(o.Path.split(l).filter(s=>s!=="").pop(),o.Metadata),id:o.Path,cls:this.#t(o.Path)?"folder":"file",leaf:t!==null,resolvedpath:o.Path,hidden:!1,fileSize:o.Size}}):n;this.treeNodes.update(o=>{let l=i.map(s=>{let d=this.#t(s.id)?"folder":"file";return ne(te({},s),{cls:d,parentPath:e})}),g=[...new Map([...o,...l].map(s=>[s.id,s])).values()];return this.hideShortcuts()?g.filter(s=>!s.id.startsWith("%")):g})}})}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=H({type:r,selectors:[["app-file-tree"]],viewQuery:function(e,n){e&1&&Fe(n.treeContainerRef,lt,5)(n.formRef,ct,5),e&2&&xe(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"],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"],customRemoteMode:[1,"customRemoteMode"],backupId:[1,"backupId"],sourcePrefix:[1,"sourcePrefix"],destinationUrl:[1,"destinationUrl"],loadExtendedData:[1,"loadExtendedData"],searchMode:[1,"searchMode"],searchResults:[1,"searchResults"]},outputs:{hasExtendedData:"hasExtendedData"},ngContentSelectors:ut,decls:18,vars:17,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 l;l=$localize`Will be created as:`;let g;return g=$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,l,g,[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,"isOpen","options"],[1,"type-b","small",3,"valueChange","value"],["type","button","value","browse"],["type","button","value","path"],["action","",3,"click"],[1,"icon"],[1,"primary"],[1,"text",3,"click"],[1,"size"],[1,"small"],[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&&(J(dt),x(0,mt,5,1,"sh-button-group",11),u(1,"div",12),D(2,0,["ngProjectAs","label",5,["label"]]),u(3,"div",13,0),x(5,ft,1,0,"sh-progress-bar",14),Y(6,wt,3,2,"ng-template",null,1,ke)(8,It,1,0,"ng-container",15),p(),u(9,"div",16),x(10,Lt,2,2,"sh-toggle",17),x(11,At,2,1,"button",18),p()(),u(12,"div",19,2)(14,"sh-form-field"),D(15,1,["ngProjectAs","label",5,["label"]]),D(16,2,["ngProjectAs","input",5,["input"]]),p()(),x(17,kt,19,7,"sh-dialog",20)),e&2){let i=fe(7);R(!n.multiSelect()&&n.customRemoteMode()===null&&!n.searchMode()?0:-1),_(),z("hidden",!n.searchMode()&&n.pathDiscoveryMethod()!=="browse"),_(2),z("visualize-accepted",n.accepts()),_(2),R(n.isLoading()!=null?5:-1),_(3),N("ngTemplateOutlet",i)("ngTemplateOutletContext",ue(15,nt,ue(13,pt,n.treeStructure()))),_(2),R(!n.accepts()&&!n.isByBackupSettings()&&n.customRemoteMode()===null&&!n.searchMode()?10:-1),_(),R(n.enableCreateFolder()&&n.customRemoteMode()===null&&!n.searchMode()?11:-1),_(),z("hidden",n.searchMode()||n.pathDiscoveryMethod()!=="path"),_(5),R(n.createFolderDialogOpen()?17:-1)}},dependencies:[ge,ze,Xe,We,Q,je,Je,Ve,Be,K,U,X,q,Ke],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%]{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.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 $t=[[["label"]],[["","prefix",""]],[["","suffix",""]]],Bt=["label","[prefix]","[suffix]"];function Wt(r,t){if(r&1&&b(0),r&2){let e=t.$implicit,n=f();ce("",e.label,"",n.hasPerSecond()?"/s":"")}}var Vt=["throttle-upload","throttle-download"],Gt=[{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"}},ot=class r{customId=C();inputType=C();timespan=P(0);unit=P("MB");sizeOptions=P(Gt);readonly=P(!1);hasPerSecond=y(()=>{let t=this.inputType();return t&&Vt.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=H({type:r,selectors:[["app-size"]],inputs:{customId:[1,"customId"],inputType:[1,"inputType"]},features:[de([{provide:pe,useExisting:r,multi:!0}])],ngContentSelectors:Bt,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&&(J($t),u(0,"div",0),D(1,0,["ngProjectAs","label",5,["label"]]),p(),u(2,"sh-form-field")(3,"input",1),B("ngModelChange",function(o){return $(n.timespan,o)||(n.timespan=o),o}),p(),D(4,1),D(5,2),p(),u(6,"sh-select",2)(7,"input",3),B("ngModelChange",function(o){return $(n.unit,o)||(n.unit=o),o}),p(),Y(8,Wt,1,2,"ng-template"),p()),e&2&&(_(2),oe("readonly",n.readonly()||void 0),_(),N("id",n.customId()),k("ngModel",n.timespan),N("disabled",n.readonly()),_(3),le("--miw",0),N("options",n.sizeOptions())("readonly",n.readonly())("isClearable",!1),_(),k("ngModel",n.unit))},dependencies:[Ue,Q,K,U,he,X,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 jt=[[["label"]],[["","prefix",""]],[["","suffix",""]]],Ht=["label","[prefix]","[suffix]"];function Jt(r,t){if(r&1){let e=W();u(0,"button",7),V("click",function(){let i=v(e).$implicit,o=f();return F(o.updateUnit(i.value))}),A(1,1),p()}if(r&2){let e=t.$implicit;_(),Z(e.label),ee(1)}}var Ut=[{value:"s",label:$localize`Seconds`},{value:"m",label:$localize`Minutes`},{value:"h",label:$localize`Hours`}],Xt=[{value:"Y",label:$localize`Years`},{value:"M",label:$localize`Months`},{value:"W",label:$localize`Weeks`},{value:"D",label:$localize`Days`}],qt=["retry-delay","web-timeout","read-write-timeout","run-script-timeout","list-timeout","short-timeout"],rt=class r{customId=C();inputType=C();timespan=P(0);#e="D";unit=P(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&&qt.includes(t.replace("--",""))});timeOptions=y(()=>this.isShortTime()?Ut:Xt);readonly=P(!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=H({type:r,selectors:[["app-timespan"]],inputs:{customId:[1,"customId"],inputType:[1,"inputType"]},features:[de([{provide:pe,useExisting:r,multi:!0}])],ngContentSelectors:Ht,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&&(J(jt),D(0,0,["ngProjectAs","label",5,["label"]]),u(1,"sh-form-field")(2,"input",2),B("ngModelChange",function(o){return $(n.timespan,o)||(n.timespan=o),o}),p(),D(3,1),D(4,2),p(),u(5,"sh-menu",3)(6,"button",4),A(7,0),p(),Se(8,5),re(9,Jt,2,1,"button",6,Ne),ye(),p()),e&2&&(_(),oe("readonly",n.readonly()||void 0),_(),N("id",n.customId()),k("ngModel",n.timespan),N("disabled",n.readonly()),_(3),N("openIndicator",!0),_(2),Z(n.unitLabel()),ee(7),_(2),se(n.timeOptions()))},dependencies:[He,Q,K,U,he,X,q,ge],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{Te as a,zt as b,ot as c,rt as d};
1
+ import{a as Ke}from"./chunk-YCJYEQF7.js";import{a as Ye}from"./chunk-IMQUTGIK.js";import{a as Qe}from"./chunk-YYD2JU6T.js";import{A as ze,B as ge,H as Q,J as je,K as He,L as Je,P as Ue,W as Xe,a as pe,c as U,e as X,i as q,k as he,s as K,v as We,y as Ve,z as Ge}from"./chunk-VKQQDCUN.js";import{d as qe}from"./chunk-DSYNIXJF.js";import{aa as Be}from"./chunk-ZC23RK4J.js";import{$b as f,A as be,Ab as re,Ac as we,Bb as se,Bc as ue,Cb as N,Cc as Ie,Db as u,Eb as p,F as _e,Fb as ae,Fc as Le,Gc as Ae,Jb as Se,Jc as ke,Kb as ye,Lb as me,Mb as W,Qc as y,Sa as _,Tb as Oe,Ub as ve,Vb as A,Vc as $e,Wb as Z,Wc as C,Xb as ee,Xc as Ce,Zb as V,_ as ie,ac as J,bc as D,da as v,ea as F,gb as H,gc as Fe,hc as xe,ic as fe,jc as le,kc as z,l as Ee,lb as Y,nc as b,oc as Re,pa as P,pc as De,q as G,qc as ce,ra as L,sc as k,tc as $,uc as B,vb as oe,w as Pe,wb as x,xb as R,yb as Ne,zc as de}from"./chunk-TQTOIWBK.js";import{a as te,b as ne}from"./chunk-7CGTOI24.js";var lt=["treeContainer"],ct=["formRef"],dt=[[["label"]],[["label"]],[["input"]]],ut=["label","label","input"],pt=r=>({children:r,level:0}),nt=r=>({$implicit:r}),ht=(r,t)=>({children:r,level:t}),gt=()=>({maxWidth:"700px",width:"100%"}),_t=(r,t)=>t.id;function mt(r,t){if(r&1){let e=W();u(0,"sh-button-group",21),B("valueChange",function(i){v(e);let o=f();return $(o.pathDiscoveryMethod,i)||(o.pathDiscoveryMethod=i),F(i)}),u(1,"button",22),A(2,4),p(),u(3,"button",23),A(4,5),p()()}if(r&2){let e=f();k("value",e.pathDiscoveryMethod)}}function ft(r,t){r&1&&ae(0,"sh-progress-bar",14)}function Ct(r,t){r&1&&(u(0,"sh-icon",29),b(1,"caret-down"),p())}function Tt(r,t){r&1&&ae(0,"sh-icon",29)}function Mt(r,t){r&1&&(u(0,"sh-icon",29),b(1,"spinner"),p())}function Et(r,t){r&1&&(u(0,"sh-icon",29),b(1,"caret-right"),p())}function Pt(r,t){r&1&&(u(0,"sh-icon",26),b(1,"folder-open"),p())}function bt(r,t){r&1&&(u(0,"sh-icon",26),b(1,"folder-user"),p())}function Nt(r,t){r&1&&(u(0,"sh-icon",26),b(1,"file"),p())}function St(r,t){r&1&&(u(0,"sh-icon",26),b(1,"folder"),p())}function yt(r,t){if(r&1&&(x(0,Ct,2,0,"sh-icon",29)(1,Tt,1,0,"sh-icon",29)(2,Mt,2,0,"sh-icon",29)(3,Et,2,0,"sh-icon",29),x(4,Pt,2,0,"sh-icon",26)(5,bt,2,0,"sh-icon",26)(6,Nt,2,0,"sh-icon",26)(7,St,2,0,"sh-icon",26)),r&2){let e=f(2).$implicit,n=f(2);R(e.children.length?0:e.cls==="file"?1:e.id===n.isLoading()?2:3),_(4),R(e.children.length?4:e.id==="%HOME%"?5:e.cls==="file"?6:7)}}function Ot(r,t){r&1&&(u(0,"sh-icon",26),b(1,"desktop-tower"),p())}function vt(r,t){if(r&1&&(u(0,"span",28),b(1),Le(2,"bytes"),p()),r&2){let e=f(2).$implicit;_(),De("\xA0(",Ae(2,1,e.fileSize),")")}}function Ft(r,t){r&1&&me(0)}function xt(r,t){if(r&1&&Y(0,Ft,1,0,"ng-container",15),r&2){let e=f(2).$implicit,n=f().$implicit;f();let i=fe(7);N("ngTemplateOutlet",i)("ngTemplateOutletContext",ue(5,nt,Ie(2,ht,e.children,n.level+1)))}}function Rt(r,t){if(r&1){let e=W();u(0,"div",24,3),V("click",function(){v(e);let i=f().$implicit,o=f(2);return F(o.toggleNode(i.id,i))}),u(2,"div",25),x(3,yt,8,2)(4,Ot,2,0,"sh-icon",26),p(),u(5,"div",27),V("click",function(i){v(e);let o=f().$implicit,l=f(2);return F(l.toggleSelectedNode(i,o))}),u(6,"span"),b(7),p(),x(8,vt,3,3,"span",28),p()(),x(9,xt,1,7,"ng-container")}if(r&2){let e=f().$implicit,n=f().$implicit,i=f();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),_(2),z("file",e.cls==="file"),_(),R(e.id!=="/"?3:4),_(4),Re(e.text),_(),R(e.cls=="file"&&e.fileSize!=null?8:-1),_(),R(e.children.length>0?9:-1)}}function Dt(r,t){if(r&1&&x(0,Rt,10,24),r&2){let e=t.$implicit,n=f(2);R(e.hidden&&n._showHiddenNodes()||!e.hidden?0:-1)}}function wt(r,t){if(r&1&&(u(0,"sh-list"),re(1,Dt,1,1,null,null,_t),p()),r&2){let e=t.$implicit;le("padding-left",e.level*.25,"rem"),_(),se(e.children)}}function It(r,t){r&1&&me(0)}function Lt(r,t){if(r&1){let e=W();u(0,"sh-toggle",30),B("checkedChange",function(i){v(e);let o=f();return $(o._showHiddenNodes,i)||(o._showHiddenNodes=i),F(i)}),A(1,6),p()}if(r&2){let e=f();k("checked",e._showHiddenNodes),_(),Z(e.showFiles()?"files":"folders"),ee(1)}}function At(r,t){if(r&1){let e=W();u(0,"button",31),V("click",function(){v(e);let i=f();return F(i.openCreateFolderDialog())}),A(1,7),p()}if(r&2){let e=f();N("disabled",!e.isCurrentPathFolder())}}function kt(r,t){if(r&1){let e=W();u(0,"sh-dialog",32),B("isOpenChange",function(i){v(e);let o=f();return $(o.createFolderDialogOpen,i)||(o.createFolderDialogOpen=i),F(i)}),u(1,"header",33)(2,"h2"),A(3,8),p()(),u(4,"div",34)(5,"div",35)(6,"p"),A(7,9),p(),u(8,"div",36)(9,"pre"),b(10),p()()(),u(11,"sh-form-field")(12,"textarea",37),B("ngModelChange",function(i){v(e);let o=f();return $(o.createFolderPath,i)||(o.createFolderPath=i),F(i)}),p()()(),u(13,"footer",38)(14,"button",39),V("click",function(){v(e);let i=f();return F(i.closeCreateFolderDialog(!1))}),b(15,"Cancel"),p(),u(16,"button",40),V("click",function(){v(e);let i=f();return F(i.closeCreateFolderDialog(!0))}),Oe(17,10),ae(18,"sh-icon"),ve(),p()()()}if(r&2){let e,n=f();k("isOpen",n.createFolderDialogOpen),N("options",we(6,gt)),_(10),ce("",n.currentPathResolvedShorthands(),"",n.createFolderPath()?"/"+n.createFolderPath():""),_(2),k("ngModel",n.createFolderPath),_(4),N("disabled",!((e=n.createFolderPath())!=null&&e.length))}}var it=(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))(it||{}),E="/",Te=class r{#e=ie(qe);#i=ie(Qe);#p=ie(Ge);multiSelect=C(!1);disabled=C(!1);showFiles=C(!1);selectFiles=C(!1);accepts=C(null);startingPath=C(null);rootPaths=C([]);initialNodes=C([]);backupSettings=C(null);pathRefreshTrigger=C(!1);showHiddenNodes=C(!1);enableCreateFolder=C(!1);hideShortcuts=C(!1);customRemoteMode=C(null);backupId=C("");sourcePrefix=C("");destinationUrl=C("");loadExtendedData=C(!0);hasExtendedData=$e();searchMode=C(!1);searchResults=C([]);_showHiddenNodes=P(!1);createFolderDialogOpen=P(!1);createFolderPath=P(null);treeContainerRef=Ce("treeContainer");formRef=Ce("formRef");pathDiscoveryMethod=P("browse");isLoading=P(null);currentPath=P("");currentPathResolvedShorthands=y(()=>this.#i.resolveShorthandPath(this.currentPath()));#r=P(null);treeSearchQuery=P("");treeNodes=P([]);pathDelimiter=y(()=>this.#i.systemInfo()?.DirectorySeparator??"");filterGroups=this.#i.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()});TreeEvalEnum=it;searchResultTreeStructure=y(()=>{let t=this.searchResults();if(t.length===0)return[];let e=this.currentPath().split("\0").filter(a=>a!==""&&a!==E),n=this.showHiddenNodes(),i=new Map;for(let a of t){let c=a.Path??"",h=this.#n(c),O=c.split(h).filter(S=>S!==""),T="";for(let S=0;S<O.length;S++){let w=O[S],I=S===O.length-1,j=!I||this.#t(c),st=T||E,Me=T?T.endsWith(h)?T.slice(0,-h.length):T:"";if(T=Me?`${Me}${h}${w}`:`${h}${w}`,j&&!T.endsWith(h)&&(T+=h),!i.has(T))i.set(T,{part:w,parentPath:st,isFolder:j,match:I?a:null});else if(I){let at=i.get(T);at.match=a}}}let o=new Map;for(let[a,c]of i)o.has(c.parentPath)||o.set(c.parentPath,[]),o.get(c.parentPath).push(a);let l=new Set,g=new Map;for(let[a,c]of i){if(!c.isFolder){l.add(a);continue}let h=o.get(c.parentPath)||[];if(h.length===1&&h[0]===a&&c.parentPath!==E)continue;l.add(a);let T=c.part,S=a;for(;;){let w=o.get(S)||[];if(w.length!==1)break;let I=w[0],j=i.get(I);if(!j||!j.isFolder)break;T+="/"+j.part,S=I}S!==a&&g.set(a,T)}l.add(E);let s=[],d=new Map,M=Array.from(l).filter(a=>a!==E).sort((a,c)=>a.split("/").length-c.split("/").length||a.localeCompare(c));for(let a of M){let c=i.get(a);if(!c)continue;let h=c.parentPath;for(;h!==E&&!l.has(h);)h=i.get(h)?.parentPath||E;if(d.has(a))continue;let O=this.#a(g.get(a),c.match?.Metadata)??c.part,T=c.match===null,S=c.match!==null&&!c.isFolder&&n?0:this.#s(e,a,c.isFolder?"folder":"file",null),w={id:a,resolvedpath:a,text:O,parentPath:h,children:[],evalState:S,isIndeterminate:this.isIndeterminate(e,a),cls:c.isFolder?"folder":"file",isSearchMatch:c.match!==null,isGenerated:T,hasChildrenInSearch:(o.get(a)?.length||0)>0,iconCls:null,check:!1,leaf:!c.isFolder,hidden:!1,systemFile:!1,temporary:!1,symlink:!1,fileSize:c.match?.Size??0};if(d.set(a,w),h===E)s.push(w);else{let I=d.get(h);I&&I.children.push(w)}}let m=a=>{a.sort((c,h)=>c.cls==="folder"&&h.cls!=="folder"?-1:c.cls!=="folder"&&h.cls==="folder"?1:(c.text??"").localeCompare(h.text??"")),a.forEach(c=>m(c.children))};return m(s),s});treeStructure=y(()=>{if(this.searchMode())return this.searchResultTreeStructure();let t=this.showHiddenNodes(),e=this.currentPath().split("\0").filter(s=>s!==""&&s!==E),n=structuredClone(e);for(let s=0;s<n.length;s++){let M=n[s].slice(1);if(M.startsWith("{")&&M.endsWith("}")){let m=M.slice(1,-1),a=this.filterGroups?.FilterGroups[m];if(a&&a.length){let c=a.map(h=>`-${h}`);n.splice(s,1,...c)}}}let i=this.searchableTreeNodes(),o=this.rootPaths(),l=this.accepts(),g=[];return o.length>0?g=o.map(s=>{let d=this.#s(n,s,"folder",null);return{id:s,resolvedpath:s,text:s,parentPath:"",children:[],evalState:d,isIndeterminate:!1,cls:this.#t(s)?"folder":"file"}}):g=[{id:E,resolvedpath:E,text:$localize`Computer`,parentPath:"",children:[],evalState:0,isIndeterminate:!1,cls:"folder"}],g.map(s=>{let d=new Map;if(!s.id)return;let M=s.id;l&&(s.accepted=!0),d.set(M,s);let m=o.length>0?i.filter(a=>a.parentPath.startsWith(M)):i;for(let a of m){if(!a.id)continue;let c=a.id;if(!a.cls||d.has(c))continue;let h=d.get(a.parentPath),O=a.hidden===!0&&t?0:this.#s(n,c,a.cls,h),T=ne(te({},a),{isIndeterminate:this.isIndeterminate(n,c),evalState:O,children:[]});l&&(T.accepted=this.matchAccepts(l,T)),d.set(c,T),T.id?.startsWith("%")&&T.id?.endsWith("%")&&d.set(this.#l(c),T),h&&h.children.push(T)}return s}),g});#l(t){if(!t)return E;let e=this.#n(t);return t.endsWith("/")||t.endsWith("\\")||t===E?t:t+e}#s(t,e,n,i){if(i&&i.evalState===-1)return-2;let o=0,l=t.filter(d=>!d.startsWith("-")&&!d.startsWith("+")),g=t.filter(d=>d.startsWith("-")||d.startsWith("+")),s=this.multiSelect();if(l.length===0)return o;for(let d=0;d<l.length;d++){let M=l[d];if(e===M){o=1;break}if(!s||!this.#t(M))continue;if(e?.startsWith(M)){o=1;break}}if(g.length===0)return o;for(let d=0;d<g.length;d++){let M=g[d],m=M.slice(1),a=M.startsWith("-")?-1:1;if(this.#t(m)){if(n!=="folder")continue;if(e===m){o=a;break}}if(m.startsWith("*")&&(m.endsWith("*\\")||m.endsWith("*/"))){if(n!=="folder")continue;let h=m.slice(1,-2);if(h==="")break;if(e?.includes(h+"\\")||e?.includes(h+"/")){o=a;break}}if(m.startsWith("[.*")&&(m.endsWith("[^\\/]*]")||m.endsWith("[^\\\\]*]"))){if(n!=="file")continue;let h=m.slice(3,-7);if(new RegExp(h).test(e)){o=a;break}}if(m.startsWith("[")&&m.endsWith("]")){let h=m.slice(1,-1),O=this.translateCSharpRegex(h);if(new RegExp(`${O}`).test(e)){o=a;break}}if(m.startsWith("*.")){if(n!=="file"||m.replace("*.","").length===0)continue;if(this.#c(e,m,!0)){o=a;break}}if(m==="")continue;if(m===e){o=a;break}if(this.#c(e,m,!0)){o=a;break}}return o}translateCSharpRegex(t){let e=t;e=e.replace(/^@/,"");let n=/\(\?<(?<name>\w+)>(?<pattern>[^)]+)\)/g;return e=e.replace(n,(i,o,l)=>`(${l})`),e=e.replace(/\\/g,"\\\\"),e}isIndeterminate(t,e){return t.filter(n=>!n.startsWith("-")&&this.#t(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,".*").replace(/\?/g,".").replace(/\[!([^\]]+)\]/g,"[^$1]");return new RegExp(`${i}${n?"$":""}`).test(t)}#n(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.#r();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===E)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.#r();t&&(t.value=this.currentPath(),t.dispatchEvent(new Event("input")))});inputValueChangeAbortController=null;inputRefEffect=L(()=>{let t=this.formRef()?.nativeElement?.querySelector("input");t&&(this.#h(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.#r.set(t),t.autocomplete="off")});ngOnInit(){let t=this.startingPath();if(t)this.currentPath.set(t),this.#T(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.#a(i.text,i?.Metadata),iconCls:i.iconCls,fileSize:i.fileSize,resolvedpath:i.resolvedpath,parentPath:this.getParentPath(i.id??"")}))),this.#o(null,e[0])):this.#o(null,E)}}getParentPath(t){let e=this.#n(t),n=t.split(e);return n.length<=1?E:(n.pop(),n.length!==0&&n.pop(),n.join(e)+e)}toggleSelectedNode(t,e){if(e.id===E||(t.stopPropagation(),this.searchMode()&&!e.isSearchMatch)||e.evalState===-2)return;if(this.selectFiles()&&e.cls==="folder"){this.toggleNode(e.id,e);return}if(this.accepts()&&!e.accepted)return;let i=this.currentPath().split("\0").filter(s=>s!==""&&s!==E),l=this.isChildOfSelected(e)?`-${e.id}`:e.id,g=this.#t(e.id);if(this.multiSelect())if(i.includes(e.id))this.currentPath.set(i.filter(s=>s!==e.id&&!(g&&s.startsWith(l))).join("\0"));else if(i.some(s=>s==l))this.currentPath.set(i.filter(s=>s!==l).join("\0"));else{let s=g?i.filter(d=>!d.startsWith(e.id)):i;this.currentPath.set([...s,l].join("\0"))}else i.includes(e.id)?this.currentPath.set(i.filter(s=>s!==e.id).join("\0")):this.currentPath.set(e.id)}isChildOfSelected(t){return this.currentPath().split("\0").filter(n=>n!==""&&n!==E&&this.#t(n)).some(n=>t.id?.startsWith(n)||`-${t.id}`.startsWith(n))}toggleNode(t,e=null){e?.cls==="folder"&&(e?.children.length?this.treeNodes.update(n=>n.filter(i=>!i.id?.startsWith(e.id)||i.id===e.id)):this.#o(e,t))}openCreateFolderDialog(){return this.createFolderPath.set(null),this.createFolderDialogOpen.set(!0),!1}closeCreateFolderDialog(t){if(t&&this.createFolderPath()?.length&&this.isCurrentPathFolder()){let e=this.createFolderPath()?.trim();if(e){let n=this.currentPath(),i=this.currentPathResolvedShorthands(),o=this.#l(e),l=`${i}/${o}`;this.#e.postApiV1RemoteoperationCreate({requestBody:{path:"file://"+l}}).subscribe({next:()=>{this.currentPath.set(l),this.#o(null,n),setTimeout(()=>{this.#d()},500),this.createFolderDialogOpen.set(!1)},error:g=>{let s=g?.message?.match(/user-information\s*:\s*(.*?)(?:\s*,|$)/i),d=s?s[1]:g?.message||$localize`An error occurred while trying to create the folder.`;this.#p.open(Ye,{data:{title:$localize`Cannot create folder`,message:d,confirmText:$localize`OK`,cancelText:void 0}})}})}}else this.createFolderDialogOpen.set(!1);return!1}#d(){setTimeout(()=>{let e=this.treeContainerRef()?.nativeElement?.querySelector(".active");e&&e.scrollIntoView({behavior:"smooth",block:"center"})},100)}#h(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}#g(t){return this.#e.postApiV1Filesystem({showHidden:!0,requestBody:{path:t},onlyFolders:!this.showFiles()})}#_(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"office365",requestBody:{"backup-id":this.backupId()??"","source-prefix":this.sourcePrefix()??"",operation:"ListDestinationRestoreTargets",url:this.destinationUrl()??"",path:t??"/"}}).pipe(G(e=>{let n=e.Result;return Object.keys(n).map(i=>({Path:i,Metadata:JSON.parse(n[i])}))}))}#m(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"googleworkspace",requestBody:{"backup-id":this.backupId()??"","source-prefix":this.sourcePrefix()??"",operation:"ListDestinationRestoreTargets",url:this.destinationUrl()??"",path:t??"/"}}).pipe(G(e=>{let n=e.Result;return Object.keys(n).map(i=>({Path:i,Metadata:JSON.parse(n[i])}))}))}#f(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"diskimage",requestBody:{operation:"ListDestinationRestoreTargets",path:t??"/"}}).pipe(G(e=>{let n=e.Result;return Object.keys(n).map(i=>({Path:i,Metadata:JSON.parse(n[i])}))}))}#C(t){let e=this.backupSettings();if(this.#i.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(G(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(G(i=>i.Files??[]))}}#u(t){return this.customRemoteMode()==="o365"?this.#_(t):this.customRemoteMode()==="gsuite"?this.#m(t):this.customRemoteMode()==="diskimage"?this.#f(t):this.isByBackupSettings()?this.#C(t):this.#g(t)}#T(t){let n=t.split("\0").filter(l=>!l.startsWith("-")&&!l.startsWith("+")&&!l.startsWith("@")).filter(Boolean).map(l=>{let g=this.#n(l),s=l.split(g);return s.at(-1)===""&&s.pop(),{split:s,sep:g}}),i=[E];n.forEach(({split:l,sep:g})=>{l.forEach((s,d)=>{let M=l.slice(0,d+1).join(g)+g;M===""||M===g||i.includes(M)||i.push(M)})});let o=i.map(l=>(this.isLoading.set(l),this.#u(l).pipe(G(g=>({status:"success",value:g,url:l})),be(g=>Ee({status:"error",value:g,url:l})))));Pe(o).pipe(_e(()=>this.isLoading.set(null))).subscribe({next:l=>{let g=l.filter(d=>d.status==="success"),s=l.filter(d=>d.status==="error");this.treeNodes.update(d=>{let M=g.flatMap(a=>Array.isArray(a.value)?a.value.map(c=>ne(te({},c),{parentPath:a.url})):[]),m=[...new Map([...d,...M].map(a=>[a.id,a])).values()];return this.#d(),this.hideShortcuts()?m.filter(a=>!a.id.startsWith("%")):m})}})}#a(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}#M(t){t&&t.ExtType&&t.ExtType.length>0&&this.hasExtendedData.emit(t.ExtType)}#t(t){return t.startsWith("%")&&t.endsWith("%")&&!t.includes("/")&&!t.includes("\\")||t.endsWith("/")||t.endsWith("\\")}#o(t=null,e=E){this.isLoading.set(e),this.#u(e).pipe(_e(()=>this.isLoading.set(null))).subscribe({next:n=>{let i=this.isByBackupSettings()||this.customRemoteMode()!==null?n.map(o=>{this.#M(o.Metadata);let l=this.#n(o.Path);return{text:this.#a(o.Path.split(l).filter(s=>s!=="").pop(),o.Metadata),id:o.Path,cls:this.#t(o.Path)?"folder":"file",leaf:t!==null,resolvedpath:o.Path,hidden:!1,fileSize:o.Size}}):n;this.treeNodes.update(o=>{let l=i.map(s=>{let d=this.#t(s.id)?"folder":"file";return ne(te({},s),{cls:d,parentPath:e})}),g=[...new Map([...o,...l].map(s=>[s.id,s])).values()];return this.hideShortcuts()?g.filter(s=>!s.id.startsWith("%")):g})}})}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=H({type:r,selectors:[["app-file-tree"]],viewQuery:function(e,n){e&1&&Fe(n.treeContainerRef,lt,5)(n.formRef,ct,5),e&2&&xe(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"],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"],customRemoteMode:[1,"customRemoteMode"],backupId:[1,"backupId"],sourcePrefix:[1,"sourcePrefix"],destinationUrl:[1,"destinationUrl"],loadExtendedData:[1,"loadExtendedData"],searchMode:[1,"searchMode"],searchResults:[1,"searchResults"]},outputs:{hasExtendedData:"hasExtendedData"},ngContentSelectors:ut,decls:18,vars:17,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 l;l=$localize`Will be created as:`;let g;return g=$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,l,g,[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,"isOpen","options"],[1,"type-b","small",3,"valueChange","value"],["type","button","value","browse"],["type","button","value","path"],["action","",3,"click"],[1,"icon"],[1,"primary"],[1,"text",3,"click"],[1,"size"],[1,"small"],[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&&(J(dt),x(0,mt,5,1,"sh-button-group",11),u(1,"div",12),D(2,0,["ngProjectAs","label",5,["label"]]),u(3,"div",13,0),x(5,ft,1,0,"sh-progress-bar",14),Y(6,wt,3,2,"ng-template",null,1,ke)(8,It,1,0,"ng-container",15),p(),u(9,"div",16),x(10,Lt,2,2,"sh-toggle",17),x(11,At,2,1,"button",18),p()(),u(12,"div",19,2)(14,"sh-form-field"),D(15,1,["ngProjectAs","label",5,["label"]]),D(16,2,["ngProjectAs","input",5,["input"]]),p()(),x(17,kt,19,7,"sh-dialog",20)),e&2){let i=fe(7);R(!n.multiSelect()&&n.customRemoteMode()===null&&!n.searchMode()?0:-1),_(),z("hidden",!n.searchMode()&&n.pathDiscoveryMethod()!=="browse"),_(2),z("visualize-accepted",n.accepts()),_(2),R(n.isLoading()!=null?5:-1),_(3),N("ngTemplateOutlet",i)("ngTemplateOutletContext",ue(15,nt,ue(13,pt,n.treeStructure()))),_(2),R(!n.accepts()&&!n.isByBackupSettings()&&n.customRemoteMode()===null&&!n.searchMode()?10:-1),_(),R(n.enableCreateFolder()&&n.customRemoteMode()===null&&!n.searchMode()?11:-1),_(),z("hidden",n.searchMode()||n.pathDiscoveryMethod()!=="path"),_(5),R(n.createFolderDialogOpen()?17:-1)}},dependencies:[ge,ze,Xe,We,Q,je,Je,Ve,Be,K,U,X,q,Ke],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%]{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.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 $t=[[["label"]],[["","prefix",""]],[["","suffix",""]]],Bt=["label","[prefix]","[suffix]"];function Wt(r,t){if(r&1&&b(0),r&2){let e=t.$implicit,n=f();ce("",e.label,"",n.hasPerSecond()?"/s":"")}}var Vt=["throttle-upload","throttle-download"],Gt=[{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"}},ot=class r{customId=C();inputType=C();timespan=P(0);unit=P("MB");sizeOptions=P(Gt);readonly=P(!1);hasPerSecond=y(()=>{let t=this.inputType();return t&&Vt.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=H({type:r,selectors:[["app-size"]],inputs:{customId:[1,"customId"],inputType:[1,"inputType"]},features:[de([{provide:pe,useExisting:r,multi:!0}])],ngContentSelectors:Bt,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&&(J($t),u(0,"div",0),D(1,0,["ngProjectAs","label",5,["label"]]),p(),u(2,"sh-form-field")(3,"input",1),B("ngModelChange",function(o){return $(n.timespan,o)||(n.timespan=o),o}),p(),D(4,1),D(5,2),p(),u(6,"sh-select",2)(7,"input",3),B("ngModelChange",function(o){return $(n.unit,o)||(n.unit=o),o}),p(),Y(8,Wt,1,2,"ng-template"),p()),e&2&&(_(2),oe("readonly",n.readonly()||void 0),_(),N("id",n.customId()),k("ngModel",n.timespan),N("disabled",n.readonly()),_(3),le("--miw",0),N("options",n.sizeOptions())("readonly",n.readonly())("isClearable",!1),_(),k("ngModel",n.unit))},dependencies:[Ue,Q,K,U,he,X,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 jt=[[["label"]],[["","prefix",""]],[["","suffix",""]]],Ht=["label","[prefix]","[suffix]"];function Jt(r,t){if(r&1){let e=W();u(0,"button",7),V("click",function(){let i=v(e).$implicit,o=f();return F(o.updateUnit(i.value))}),A(1,1),p()}if(r&2){let e=t.$implicit;_(),Z(e.label),ee(1)}}var Ut=[{value:"s",label:$localize`Seconds`},{value:"m",label:$localize`Minutes`},{value:"h",label:$localize`Hours`}],Xt=[{value:"Y",label:$localize`Years`},{value:"M",label:$localize`Months`},{value:"W",label:$localize`Weeks`},{value:"D",label:$localize`Days`}],qt=["retry-delay","web-timeout","read-write-timeout","run-script-timeout","list-timeout","short-timeout"],rt=class r{customId=C();inputType=C();timespan=P(0);#e="D";unit=P(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&&qt.includes(t.replace("--",""))});timeOptions=y(()=>this.isShortTime()?Ut:Xt);readonly=P(!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=H({type:r,selectors:[["app-timespan"]],inputs:{customId:[1,"customId"],inputType:[1,"inputType"]},features:[de([{provide:pe,useExisting:r,multi:!0}])],ngContentSelectors:Ht,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&&(J(jt),D(0,0,["ngProjectAs","label",5,["label"]]),u(1,"sh-form-field")(2,"input",2),B("ngModelChange",function(o){return $(n.timespan,o)||(n.timespan=o),o}),p(),D(3,1),D(4,2),p(),u(5,"sh-menu",3)(6,"button",4),A(7,0),p(),Se(8,5),re(9,Jt,2,1,"button",6,Ne),ye(),p()),e&2&&(_(),oe("readonly",n.readonly()||void 0),_(),N("id",n.customId()),k("ngModel",n.timespan),N("disabled",n.readonly()),_(3),N("openIndicator",!0),_(2),Z(n.unitLabel()),ee(7),_(2),se(n.timeOptions()))},dependencies:[He,Q,K,U,he,X,q,ge],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{Te as a,zt as b,ot as c,rt as d};
@@ -1 +1 @@
1
- import{a as xe,c as Ae,d as v}from"./chunk-CAQ3XMFP.js";import{a as we}from"./chunk-WOKYULBU.js";import"./chunk-6Q6SSTBK.js";import"./chunk-ANSV4G2K.js";import{b as De}from"./chunk-IQL3REGJ.js";import"./chunk-AIAUP7OE.js";import"./chunk-C6PICAXB.js";import"./chunk-6JS7B4FW.js";import{A as ge,B as Oe,H as Ne,L as he,W as fe,Y as Re,b as ce,c as pe,d as g,e as Fe,f as de,j as ue,p as Te,q as Ce,r as Ee,t as Pe,v as Se,w as me}from"./chunk-VKQQDCUN.js";import{a as b,d as Ie}from"./chunk-DSYNIXJF.js";import{b as ae,d as le,e as _e}from"./chunk-NPFPMA4P.js";import"./chunk-O2SMJYPC.js";import{a as re,d as se}from"./chunk-N2AU7VKX.js";import"./chunk-ZC23RK4J.js";import"./chunk-OPHQNXYO.js";import{$b as u,Ac as ie,Cb as S,Db as s,Eb as r,F as $,Fb as _,L as Q,Mb as y,Qc as A,Sa as a,Tb as c,Ub as p,Vb as m,Wb as L,Xb as X,Yb as G,Zb as h,_ as E,da as w,ea as D,gb as Y,kc as B,nc as x,oc as Z,pa as P,qc as ee,ra as M,sc as oe,tc as te,uc as ne,wb as F,xb as d}from"./chunk-TQTOIWBK.js";import{a as W}from"./chunk-7CGTOI24.js";var $e=()=>["/"];function Me(t,o){t&1&&(s(0,"sh-toggle",25),c(1,5),_(2,"input",28),p(),r())}function ye(t,o){t&1&&(s(0,"span",31),m(1,9),r())}function Le(t,o){if(t&1&&(s(0,"span",31),m(1,10),r()),t&2){let e=u(2);a(),L(e.exportForm.controls.password.errors==null?null:e.exportForm.controls.password.errors.minlength.requiredLength),X(1)}}function Xe(t,o){if(t&1&&_(0,"sh-progress-bar",38),t&2){let e=u(2);B("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),S("value",e.calculatePasswordStrength()*(100/5))}}function Ge(t,o){t&1&&(s(0,"span",31),m(1,11),r())}function Be(t,o){t&1&&(s(0,"span",31),m(1,12),r())}function be(t,o){if(t&1&&(s(0,"span",31),m(1,13),r()),t&2){let e=u(2);a(),L(e.exportForm.controls.repeatPassword.errors==null?null:e.exportForm.controls.repeatPassword.errors.minlength.requiredLength),X(1)}}function ve(t,o){t&1&&(c(0,7,1),_(1,"sh-icon"),p())}function ke(t,o){t&1&&(c(0,7,2),_(1,"sh-icon"),p())}function Ue(t,o){t&1&&(c(0,14,1),_(1,"sh-icon",40),p())}function Ke(t,o){t&1&&(c(0,14,2),_(1,"sh-icon"),p())}function Je(t,o){if(t&1){let e=y();s(0,"button",39),h("click",function(){w(e);let i=u(2);return D(i.copyPassword())}),c(1,14),F(2,Ue,2,0)(3,Ke,2,0),p(),r()}if(t&2){let e=u(2);a(2),d(e.copiedPassword()?2:3)}}function He(t,o){t&1&&(s(0,"sh-alert",37),m(1,15),r())}function ze(t,o){if(t&1){let e=y();s(0,"div",26)(1,"sh-form-field")(2,"label",29),c(3,6),_(4,"sup"),p(),r(),_(5,"input",30),F(6,ye,2,0,"span",31)(7,Le,2,1,"span",31),r(),F(8,Xe,1,9,"sh-progress-bar",32),s(9,"sh-form-field"),_(10,"input",33),F(11,Ge,2,0,"span",31)(12,Be,2,0,"span",31)(13,be,2,1,"span",31),r(),s(14,"div",34)(15,"button",35),h("click",function(){w(e);let i=u();return D(i.showPassword.set(!i.showPassword()))}),c(16,7),F(17,ve,2,0)(18,ke,2,0),p(),r(),s(19,"button",35),h("click",function(){w(e);let i=u();return D(i.generatePassword())}),c(20,8),_(21,"sh-icon"),p(),r(),F(22,Je,4,1,"button",36),r(),F(23,He,2,0,"sh-alert",37),r()}if(t&2){let e=u();a(5),S("type",e.showPassword()?"text":"password"),a(),d(e.exportForm.controls.password.errors!=null&&e.exportForm.controls.password.errors.required?6:e.exportForm.controls.password.errors!=null&&e.exportForm.controls.password.errors.minlength?7:-1),a(2),d(e.exportForm.value.password?8:-1),a(2),S("type",e.showPassword()?"text":"password"),a(),d(e.exportForm.value.repeatPassword&&e.exportForm.value.repeatPassword!==e.exportForm.value.password?11:e.exportForm.controls.repeatPassword.errors!=null&&e.exportForm.controls.repeatPassword.errors.required?12:e.exportForm.controls.repeatPassword.errors!=null&&e.exportForm.controls.repeatPassword.errors.minlength?13:-1),a(6),d(e.showPassword()?17:18),a(5),d(e.showCopyPassword()?22:-1),a(),d(e.exportForm.value.password&&e.exportForm.value.password===e.exportForm.value.repeatPassword?23:-1)}}function Ve(t,o){if(t&1&&(s(0,"div",27)(1,"code"),x(2),r()()),t&2){let e=u();a(2),Z(e.exportedCmd())}}var f=new Ee,k=class t{#o=E(xe);#t=E(Ie);#e=E(ae);#n=E(le);#i=E(se);#r=E(we);isExporting=P(!1);exportType=P("file");exportedCmd=P(null);exportForm=f.group({exportPasswords:f.control(!0),encryption:f.control(!1,[g.required,Ae()]),password:f.control("",[v("encryption",!0,[g.required,g.minLength(3)])]),repeatPassword:f.control("",[v("encryption",!0,[g.required,g.minLength(3)])])});exportFormSignal=De(this.exportForm.valueChanges);encryptionFieldSignal=A(()=>(this.exportFormSignal()?.encryption??!1)&&this.exportType()==="file");activeBackup=A(()=>this.#r.backups().find(o=>o.Backup?.ID===this.#e.snapshot.params.id));showPassword=P(!1);copiedPassword=P(!1);showCopyPassword=P(!1);calculatePasswordStrength=A(()=>{let e=this.exportFormSignal()?.password??"";return this.#o.calculatePasswordStrength(e)});showPasswordEffect=M(()=>{this.showPassword()&&this.exportForm.updateValueAndValidity()});disablePasswordForCommandLine=M(()=>{this.exportType()==="cmd"&&this.exportForm.controls.encryption.setValue(!1)});submit(){this.isExporting.set(!0),this.exportType()==="file"?this.#t.postApiV1AuthIssuetokenByOperation({operation:"export"}).pipe(Q(o=>{let e=T=>{let O=Object.entries(T);return O?"?"+O.filter(([N,C])=>C!=null).map(([N,C])=>`${encodeURIComponent(N)}=${encodeURIComponent(C)}`).join("&"):""},n=this.exportFormSignal()?.password?.length?this.exportFormSignal()?.password:void 0,i=b.BASE||"";return this.#i.get(`${i}/api/v1/backup/${this.#e.snapshot.params.id}/export${e({"export-passwords":this.exportFormSignal()?.exportPasswords??void 0,passphrase:n,token:o.Token})}`,{responseType:"blob",headers:new re(W({},b.HEADERS??{}))})}),$(()=>this.isExporting.set(!1))).subscribe({next:o=>{let n=this.activeBackup()?.Backup?.Name??"Backup",i=this.exportFormSignal()?.encryption?"aes":"json";this.downloadFile(o,`${n}-duplicati-config.${i}`),this.#n.navigate(["/"])},error:o=>{}}):this.#t.getApiV1BackupByIdExportCmdline({id:this.#e.snapshot.params.id,exportPasswords:this.exportFormSignal()?.exportPasswords??void 0,passphrase:this.exportFormSignal()?.password??void 0}).pipe($(()=>this.isExporting.set(!1))).subscribe({next:o=>{this.exportedCmd.set(o.Command??null)},error:o=>{}})}downloadFile(o,e){let n=window.URL.createObjectURL(o),i=document.createElement("a");i.href=n,i.download=e,i.click(),window.URL.revokeObjectURL(n)}async copyPassword(){let o=this.exportForm.controls.password.value;await this.#s(o??""),this.copiedPassword.set(!0)}async#s(o){try{await navigator.clipboard.writeText(o)}catch{try{let n=document.createElement("textarea");n.value=o,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 o=this.#o.generate(16);this.exportForm.controls.password.setValue(o),this.exportForm.controls.repeatPassword.setValue(o),this.showCopyPassword.set(!0)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=Y({type:t,selectors:[["app-export"]],decls:26,vars:13,consts:()=>{let o;o=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:export${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON: Export `;let n;n=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:terminal-window${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON: As command line `;let i;i=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:file${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: To file `;let T;T=$localize` Export passwords ${"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"}:TAG_INPUT:`;let O;O=$localize` Encrypt file ${"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"}:TAG_INPUT:`;let N;N=$localize`Password`;let C;C=$localize`Repeat password`;let U;U=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let R;R=$localize`${"\uFFFD*17: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/*17:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*18: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/*18:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,R=G(R);let K;K=$localize`${"\uFFFD#21\uFFFD"}:START_TAG_SH_ICON:password${"\uFFFD/#21\uFFFD"}:CLOSE_TAG_SH_ICON: Generate password `;let J;J=$localize`Passwords are required`;let H;H=$localize` Passwords must be at least ${"\uFFFD0\uFFFD"}:INTERPOLATION: characters long `;let z;z=$localize`Passwords do not match`;let V;V=$localize`Passwords are required`;let q;q=$localize` Passwords must be at least ${"\uFFFD0\uFFFD"}:INTERPOLATION: characters long `;let I;I=$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:`,I=G(I);let j;return j=$localize` Tip: Be sure to save your password. If you lose it, you will not be able to import the configuration. `,[o,e,n,i,T,O,U,R,K,J,H,z,V,q,I,j,[1,"actions"],["shButton","",1,"outlined",3,"routerLink"],["shButton","",1,"raised","primary",3,"click","shTooltip","disabled"],["autocomplete","off",3,"formGroup"],[1,"type-b",3,"valueChange","value"],["value","cmd"],["value","file"],[1,"raised","primary"],["type","checkbox","formControlName","exportPasswords"],[1,"primary","raised"],[1,"passwords"],[1,"cmd-output"],["type","checkbox","formControlName","encryption"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",N,"formControlName","password",3,"type"],["error",""],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",C,"formControlName","repeatPassword",3,"type"],[1,"password-actions"],["shButton","","type","button",1,"small",3,"click"],["shButton","","type","button",1,"small","copy"],[1,"primary"],[1,"raised",3,"value"],["shButton","","type","button",1,"small","copy",3,"click"],[1,"sh-success"]]},template:function(e,n){if(e&1&&(s(0,"header")(1,"h3"),x(2," Export backup configuration "),s(3,"div",16)(4,"button",17),c(5,0),_(6,"sh-icon"),p(),r(),s(7,"button",18),h("click",function(){return n.submit()}),c(8,1),_(9,"sh-icon"),p(),r()()(),s(10,"p"),x(11),r()(),s(12,"form",19)(13,"sh-button-group",20),ne("valueChange",function(T){return te(n.exportType,T)||(n.exportType=T),T}),s(14,"button",21),c(15,2),_(16,"sh-icon"),p(),r(),s(17,"button",22),c(18,3),_(19,"sh-icon"),p(),r()(),s(20,"sh-toggle",23),c(21,4),_(22,"input",24),p(),r(),F(23,Me,3,0,"sh-toggle",25),F(24,ze,24,8,"div",26),F(25,Ve,3,1,"div",27),r()),e&2){let i;a(4),S("routerLink",ie(12,$e)),a(3),B("loading",n.isExporting()),S("shTooltip",n.encryptionFieldSignal()?"Remember to copy the password":"")("disabled",n.exportForm.invalid||n.showCopyPassword()&&!n.copiedPassword()||n.encryptionFieldSignal()&&n.exportForm.value.repeatPassword!==n.exportForm.value.password),a(4),ee("#",(i=n.activeBackup())==null||i.Backup==null?null:i.Backup.ID,": ",(i=n.activeBackup())==null||i.Backup==null?null:i.Backup.Name),a(),S("formGroup",n.exportForm),a(),oe("value",n.exportType),a(10),d(n.exportType()==="file"?23:-1),a(),d(n.encryptionFieldSignal()?24:-1),a(),d(n.exportedCmd()?25:-1)}},dependencies:[Pe,ue,pe,ce,Fe,de,Ce,Te,_e,ge,fe,Se,Ne,Oe,me,he,Re],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:3rem}h3[_ngcontent-%COMP%]{font:var(--title-30);display:flex;align-items:center;justify-content:space-between}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;max-width:31.25rem}.passwords[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.password-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.copy[_ngcontent-%COMP%] sh-icon.sh-success[_ngcontent-%COMP%]{color:var(--success-8)}.hide[_ngcontent-%COMP%]{display:none}"],changeDetection:0})};export{k as default};
1
+ import{a as xe,c as Ae,d as v}from"./chunk-CAQ3XMFP.js";import{a as we}from"./chunk-736PM4LG.js";import"./chunk-6Q6SSTBK.js";import"./chunk-ANSV4G2K.js";import{b as De}from"./chunk-IQL3REGJ.js";import"./chunk-E4NQOMJX.js";import"./chunk-YYD2JU6T.js";import"./chunk-6JS7B4FW.js";import{A as ge,B as Oe,H as Ne,L as he,W as fe,Y as Re,b as ce,c as pe,d as g,e as Fe,f as de,j as ue,p as Te,q as Ce,r as Ee,t as Pe,v as Se,w as me}from"./chunk-VKQQDCUN.js";import{a as b,d as Ie}from"./chunk-DSYNIXJF.js";import{b as ae,d as le,e as _e}from"./chunk-NPFPMA4P.js";import"./chunk-O2SMJYPC.js";import{a as re,d as se}from"./chunk-N2AU7VKX.js";import"./chunk-ZC23RK4J.js";import"./chunk-OPHQNXYO.js";import{$b as u,Ac as ie,Cb as S,Db as s,Eb as r,F as $,Fb as _,L as Q,Mb as y,Qc as A,Sa as a,Tb as c,Ub as p,Vb as m,Wb as L,Xb as X,Yb as G,Zb as h,_ as E,da as w,ea as D,gb as Y,kc as B,nc as x,oc as Z,pa as P,qc as ee,ra as M,sc as oe,tc as te,uc as ne,wb as F,xb as d}from"./chunk-TQTOIWBK.js";import{a as W}from"./chunk-7CGTOI24.js";var $e=()=>["/"];function Me(t,o){t&1&&(s(0,"sh-toggle",25),c(1,5),_(2,"input",28),p(),r())}function ye(t,o){t&1&&(s(0,"span",31),m(1,9),r())}function Le(t,o){if(t&1&&(s(0,"span",31),m(1,10),r()),t&2){let e=u(2);a(),L(e.exportForm.controls.password.errors==null?null:e.exportForm.controls.password.errors.minlength.requiredLength),X(1)}}function Xe(t,o){if(t&1&&_(0,"sh-progress-bar",38),t&2){let e=u(2);B("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),S("value",e.calculatePasswordStrength()*(100/5))}}function Ge(t,o){t&1&&(s(0,"span",31),m(1,11),r())}function Be(t,o){t&1&&(s(0,"span",31),m(1,12),r())}function be(t,o){if(t&1&&(s(0,"span",31),m(1,13),r()),t&2){let e=u(2);a(),L(e.exportForm.controls.repeatPassword.errors==null?null:e.exportForm.controls.repeatPassword.errors.minlength.requiredLength),X(1)}}function ve(t,o){t&1&&(c(0,7,1),_(1,"sh-icon"),p())}function ke(t,o){t&1&&(c(0,7,2),_(1,"sh-icon"),p())}function Ue(t,o){t&1&&(c(0,14,1),_(1,"sh-icon",40),p())}function Ke(t,o){t&1&&(c(0,14,2),_(1,"sh-icon"),p())}function Je(t,o){if(t&1){let e=y();s(0,"button",39),h("click",function(){w(e);let i=u(2);return D(i.copyPassword())}),c(1,14),F(2,Ue,2,0)(3,Ke,2,0),p(),r()}if(t&2){let e=u(2);a(2),d(e.copiedPassword()?2:3)}}function He(t,o){t&1&&(s(0,"sh-alert",37),m(1,15),r())}function ze(t,o){if(t&1){let e=y();s(0,"div",26)(1,"sh-form-field")(2,"label",29),c(3,6),_(4,"sup"),p(),r(),_(5,"input",30),F(6,ye,2,0,"span",31)(7,Le,2,1,"span",31),r(),F(8,Xe,1,9,"sh-progress-bar",32),s(9,"sh-form-field"),_(10,"input",33),F(11,Ge,2,0,"span",31)(12,Be,2,0,"span",31)(13,be,2,1,"span",31),r(),s(14,"div",34)(15,"button",35),h("click",function(){w(e);let i=u();return D(i.showPassword.set(!i.showPassword()))}),c(16,7),F(17,ve,2,0)(18,ke,2,0),p(),r(),s(19,"button",35),h("click",function(){w(e);let i=u();return D(i.generatePassword())}),c(20,8),_(21,"sh-icon"),p(),r(),F(22,Je,4,1,"button",36),r(),F(23,He,2,0,"sh-alert",37),r()}if(t&2){let e=u();a(5),S("type",e.showPassword()?"text":"password"),a(),d(e.exportForm.controls.password.errors!=null&&e.exportForm.controls.password.errors.required?6:e.exportForm.controls.password.errors!=null&&e.exportForm.controls.password.errors.minlength?7:-1),a(2),d(e.exportForm.value.password?8:-1),a(2),S("type",e.showPassword()?"text":"password"),a(),d(e.exportForm.value.repeatPassword&&e.exportForm.value.repeatPassword!==e.exportForm.value.password?11:e.exportForm.controls.repeatPassword.errors!=null&&e.exportForm.controls.repeatPassword.errors.required?12:e.exportForm.controls.repeatPassword.errors!=null&&e.exportForm.controls.repeatPassword.errors.minlength?13:-1),a(6),d(e.showPassword()?17:18),a(5),d(e.showCopyPassword()?22:-1),a(),d(e.exportForm.value.password&&e.exportForm.value.password===e.exportForm.value.repeatPassword?23:-1)}}function Ve(t,o){if(t&1&&(s(0,"div",27)(1,"code"),x(2),r()()),t&2){let e=u();a(2),Z(e.exportedCmd())}}var f=new Ee,k=class t{#o=E(xe);#t=E(Ie);#e=E(ae);#n=E(le);#i=E(se);#r=E(we);isExporting=P(!1);exportType=P("file");exportedCmd=P(null);exportForm=f.group({exportPasswords:f.control(!0),encryption:f.control(!1,[g.required,Ae()]),password:f.control("",[v("encryption",!0,[g.required,g.minLength(3)])]),repeatPassword:f.control("",[v("encryption",!0,[g.required,g.minLength(3)])])});exportFormSignal=De(this.exportForm.valueChanges);encryptionFieldSignal=A(()=>(this.exportFormSignal()?.encryption??!1)&&this.exportType()==="file");activeBackup=A(()=>this.#r.backups().find(o=>o.Backup?.ID===this.#e.snapshot.params.id));showPassword=P(!1);copiedPassword=P(!1);showCopyPassword=P(!1);calculatePasswordStrength=A(()=>{let e=this.exportFormSignal()?.password??"";return this.#o.calculatePasswordStrength(e)});showPasswordEffect=M(()=>{this.showPassword()&&this.exportForm.updateValueAndValidity()});disablePasswordForCommandLine=M(()=>{this.exportType()==="cmd"&&this.exportForm.controls.encryption.setValue(!1)});submit(){this.isExporting.set(!0),this.exportType()==="file"?this.#t.postApiV1AuthIssuetokenByOperation({operation:"export"}).pipe(Q(o=>{let e=T=>{let O=Object.entries(T);return O?"?"+O.filter(([N,C])=>C!=null).map(([N,C])=>`${encodeURIComponent(N)}=${encodeURIComponent(C)}`).join("&"):""},n=this.exportFormSignal()?.password?.length?this.exportFormSignal()?.password:void 0,i=b.BASE||"";return this.#i.get(`${i}/api/v1/backup/${this.#e.snapshot.params.id}/export${e({"export-passwords":this.exportFormSignal()?.exportPasswords??void 0,passphrase:n,token:o.Token})}`,{responseType:"blob",headers:new re(W({},b.HEADERS??{}))})}),$(()=>this.isExporting.set(!1))).subscribe({next:o=>{let n=this.activeBackup()?.Backup?.Name??"Backup",i=this.exportFormSignal()?.encryption?"aes":"json";this.downloadFile(o,`${n}-duplicati-config.${i}`),this.#n.navigate(["/"])},error:o=>{}}):this.#t.getApiV1BackupByIdExportCmdline({id:this.#e.snapshot.params.id,exportPasswords:this.exportFormSignal()?.exportPasswords??void 0,passphrase:this.exportFormSignal()?.password??void 0}).pipe($(()=>this.isExporting.set(!1))).subscribe({next:o=>{this.exportedCmd.set(o.Command??null)},error:o=>{}})}downloadFile(o,e){let n=window.URL.createObjectURL(o),i=document.createElement("a");i.href=n,i.download=e,i.click(),window.URL.revokeObjectURL(n)}async copyPassword(){let o=this.exportForm.controls.password.value;await this.#s(o??""),this.copiedPassword.set(!0)}async#s(o){try{await navigator.clipboard.writeText(o)}catch{try{let n=document.createElement("textarea");n.value=o,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 o=this.#o.generate(16);this.exportForm.controls.password.setValue(o),this.exportForm.controls.repeatPassword.setValue(o),this.showCopyPassword.set(!0)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=Y({type:t,selectors:[["app-export"]],decls:26,vars:13,consts:()=>{let o;o=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:export${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON: Export `;let n;n=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:terminal-window${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON: As command line `;let i;i=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:file${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: To file `;let T;T=$localize` Export passwords ${"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"}:TAG_INPUT:`;let O;O=$localize` Encrypt file ${"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"}:TAG_INPUT:`;let N;N=$localize`Password`;let C;C=$localize`Repeat password`;let U;U=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let R;R=$localize`${"\uFFFD*17: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/*17:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*18: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/*18:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,R=G(R);let K;K=$localize`${"\uFFFD#21\uFFFD"}:START_TAG_SH_ICON:password${"\uFFFD/#21\uFFFD"}:CLOSE_TAG_SH_ICON: Generate password `;let J;J=$localize`Passwords are required`;let H;H=$localize` Passwords must be at least ${"\uFFFD0\uFFFD"}:INTERPOLATION: characters long `;let z;z=$localize`Passwords do not match`;let V;V=$localize`Passwords are required`;let q;q=$localize` Passwords must be at least ${"\uFFFD0\uFFFD"}:INTERPOLATION: characters long `;let I;I=$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:`,I=G(I);let j;return j=$localize` Tip: Be sure to save your password. If you lose it, you will not be able to import the configuration. `,[o,e,n,i,T,O,U,R,K,J,H,z,V,q,I,j,[1,"actions"],["shButton","",1,"outlined",3,"routerLink"],["shButton","",1,"raised","primary",3,"click","shTooltip","disabled"],["autocomplete","off",3,"formGroup"],[1,"type-b",3,"valueChange","value"],["value","cmd"],["value","file"],[1,"raised","primary"],["type","checkbox","formControlName","exportPasswords"],[1,"primary","raised"],[1,"passwords"],[1,"cmd-output"],["type","checkbox","formControlName","encryption"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",N,"formControlName","password",3,"type"],["error",""],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",C,"formControlName","repeatPassword",3,"type"],[1,"password-actions"],["shButton","","type","button",1,"small",3,"click"],["shButton","","type","button",1,"small","copy"],[1,"primary"],[1,"raised",3,"value"],["shButton","","type","button",1,"small","copy",3,"click"],[1,"sh-success"]]},template:function(e,n){if(e&1&&(s(0,"header")(1,"h3"),x(2," Export backup configuration "),s(3,"div",16)(4,"button",17),c(5,0),_(6,"sh-icon"),p(),r(),s(7,"button",18),h("click",function(){return n.submit()}),c(8,1),_(9,"sh-icon"),p(),r()()(),s(10,"p"),x(11),r()(),s(12,"form",19)(13,"sh-button-group",20),ne("valueChange",function(T){return te(n.exportType,T)||(n.exportType=T),T}),s(14,"button",21),c(15,2),_(16,"sh-icon"),p(),r(),s(17,"button",22),c(18,3),_(19,"sh-icon"),p(),r()(),s(20,"sh-toggle",23),c(21,4),_(22,"input",24),p(),r(),F(23,Me,3,0,"sh-toggle",25),F(24,ze,24,8,"div",26),F(25,Ve,3,1,"div",27),r()),e&2){let i;a(4),S("routerLink",ie(12,$e)),a(3),B("loading",n.isExporting()),S("shTooltip",n.encryptionFieldSignal()?"Remember to copy the password":"")("disabled",n.exportForm.invalid||n.showCopyPassword()&&!n.copiedPassword()||n.encryptionFieldSignal()&&n.exportForm.value.repeatPassword!==n.exportForm.value.password),a(4),ee("#",(i=n.activeBackup())==null||i.Backup==null?null:i.Backup.ID,": ",(i=n.activeBackup())==null||i.Backup==null?null:i.Backup.Name),a(),S("formGroup",n.exportForm),a(),oe("value",n.exportType),a(10),d(n.exportType()==="file"?23:-1),a(),d(n.encryptionFieldSignal()?24:-1),a(),d(n.exportedCmd()?25:-1)}},dependencies:[Pe,ue,pe,ce,Fe,de,Ce,Te,_e,ge,fe,Se,Ne,Oe,me,he,Re],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:3rem}h3[_ngcontent-%COMP%]{font:var(--title-30);display:flex;align-items:center;justify-content:space-between}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;max-width:31.25rem}.passwords[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.password-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.copy[_ngcontent-%COMP%] sh-icon.sh-success[_ngcontent-%COMP%]{color:var(--success-8)}.hide[_ngcontent-%COMP%]{display:none}"],changeDetection:0})};export{k as default};
@@ -1 +1 @@
1
- import{a as K}from"./chunk-WOKYULBU.js";import"./chunk-6Q6SSTBK.js";import{a as z}from"./chunk-IMQUTGIK.js";import"./chunk-ANSV4G2K.js";import"./chunk-AIAUP7OE.js";import"./chunk-C6PICAXB.js";import"./chunk-6JS7B4FW.js";import{B as U,H as x,I as V,W as j,b as E,c as A,e as y,f as R,j as b,p as B,q as $,r as v,t as G,v as k,x as L,z as w}from"./chunk-VKQQDCUN.js";import{d as J}from"./chunk-DSYNIXJF.js";import{d as O,e as M}from"./chunk-NPFPMA4P.js";import"./chunk-O2SMJYPC.js";import"./chunk-N2AU7VKX.js";import"./chunk-ZC23RK4J.js";import"./chunk-OPHQNXYO.js";import{Ac as N,Cb as p,Db as a,Eb as i,F as T,Fb as u,Sa as l,Tb as D,Ub as h,Vb as _,Yb as I,Zb as d,_ as s,gb as f,kc as P,pa as c,wb as C,xb as S}from"./chunk-TQTOIWBK.js";import"./chunk-7CGTOI24.js";var X=()=>["/"];function H(m,o){m&1&&(a(0,"sh-form-field")(1,"label",14),_(2,3),i(),u(3,"input",15),i())}var F=new v,g=class m{#t=s(L);#o=s(w);#i=s(J);#n=s(K);#e=s(O);isImporting=c(!1);isSecureFile=c(!1);isValid=c(!1);importForm=F.group({config:F.control(""),cmdline:F.control(!1),import_metadata:F.control(!1),direct:F.control(!1),passphrase:F.control("")});selectedFile=c([]);onFileDropped(o){let e=o[0];if(e){let t=new FileReader;this.isSecureFile.set(e.type!=="application/json"),t.onload=this.#r.bind(this),t.readAsArrayBuffer(e)}}#r(o){let e=o.target?.result;this.isSecureFile.set(this.#a(e)!=="json"),this.importForm.patchValue({config:this.#s(e)}),this.isValid.set(this.importForm.value.config!=="")}#a(o){let e=new Uint8Array(o);if(e.length>=5&&e[0]===65&&e[1]===69&&e[2]===83&&e[4]===0)return"aes";try{let t=new TextDecoder().decode(o),n=JSON.parse(t);if(typeof n=="object"&&n!==null)return"json"}catch{}return"unknown"}#s(o){let e=new Uint8Array(o),t=e.byteLength,n="";for(let r=0;r<t;r++)n+=String.fromCharCode(e[r]);return btoa(n)}submit(){this.isImporting.set(!0);let o=this.importForm.value.direct??!1;this.#i.postApiV1BackupsImport({requestBody:this.importForm.value}).pipe(T(()=>this.isImporting.set(!1))).subscribe({next:e=>{if(o){this.#t.success("Backup imported successfully."),this.#e.navigate(["/"]);return}let t=this.#n.addDraftBackup(e.data);this.#e.navigate(["/backup-draft",t])},error:e=>{let t=e.message||$localize`Unknown error`;this.#o.open(z,{data:{title:$localize`Failed to import backup`,message:t,confirmText:$localize`OK`,cancelText:void 0}})}})}static \u0275fac=function(e){return new(e||m)};static \u0275cmp=f({type:m,selectors:[["app-import"]],decls:19,vars:8,consts:()=>{let o;o=$localize` Import backup configuration ${"\uFFFD#3\uFFFD"}:START_TAG_DIV:${"\uFFFD#4\uFFFD"}:START_TAG_BUTTON:${"[\uFFFD#5\uFFFD|\uFFFD#7\uFFFD]"}:START_TAG_SH_ICON:arrow-left${"[\uFFFD/#5\uFFFD|\uFFFD/#7\uFFFD]"}:CLOSE_TAG_SH_ICON: Back ${"[\uFFFD/#4\uFFFD|\uFFFD/#6\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#6\uFFFD"}:START_TAG_BUTTON_1:${"[\uFFFD#5\uFFFD|\uFFFD#7\uFFFD]"}:START_TAG_SH_ICON:download-simple${"[\uFFFD/#5\uFFFD|\uFFFD/#7\uFFFD]"}:CLOSE_TAG_SH_ICON: Import ${"[\uFFFD/#4\uFFFD|\uFFFD/#6\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_DIV:`,o=I(o);let e;e=$localize`Import Metadata`;let t;t=$localize`Save now`;let n;return n=$localize`Passphrase`,[o,e,t,n,[1,"actions"],["shButton","","type","button",1,"outlined",3,"routerLink"],["shButton","","type","submit",1,"raised","primary",3,"click","disabled"],["autocomplete","off",3,"formGroup"],["accept",".json,.aes",3,"filesChange","files"],[1,"primary","raised"],["for","importMetadata"],["type","checkbox","formControlName","import_metadata"],["for","direct"],["type","checkbox","formControlName","direct"],["for","passphrase"],["type","password","autocomplete","disabled","formControlName","passphrase"]]},template:function(e,t){e&1&&(a(0,"header")(1,"h3"),D(2,0),a(3,"div",4)(4,"button",5),u(5,"sh-icon"),i(),a(6,"button",6),d("click",function(){return t.submit()}),u(7,"sh-icon"),i()(),h(),i()(),a(8,"form",7)(9,"sh-file-upload",8),d("filesChange",function(r){return t.onFileDropped(r)}),i(),C(10,H,4,0,"sh-form-field"),a(11,"sh-toggle",9)(12,"label",10),_(13,1),i(),u(14,"input",11),i(),a(15,"sh-toggle",9)(16,"label",12),_(17,2),i(),u(18,"input",13),i()()),e&2&&(l(4),p("routerLink",N(7,X)),l(2),P("loading",t.isImporting()),p("disabled",t.isImporting()||!t.isValid()),l(2),p("formGroup",t.importForm),l(),p("files",t.selectedFile()),l(),S(t.isSecureFile()?10:-1))},dependencies:[G,b,A,E,y,R,$,B,M,x,k,U,j,V],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:3rem}h3[_ngcontent-%COMP%]{font:var(--title-30);display:flex;align-items:center;justify-content:space-between}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;max-width:31.25rem}sh-file-upload[_ngcontent-%COMP%]{width:100%}"],changeDetection:0})};export{g as default};
1
+ import{a as K}from"./chunk-736PM4LG.js";import"./chunk-6Q6SSTBK.js";import{a as z}from"./chunk-IMQUTGIK.js";import"./chunk-ANSV4G2K.js";import"./chunk-E4NQOMJX.js";import"./chunk-YYD2JU6T.js";import"./chunk-6JS7B4FW.js";import{B as U,H as x,I as V,W as j,b as E,c as A,e as y,f as R,j as b,p as B,q as $,r as v,t as G,v as k,x as L,z as w}from"./chunk-VKQQDCUN.js";import{d as J}from"./chunk-DSYNIXJF.js";import{d as O,e as M}from"./chunk-NPFPMA4P.js";import"./chunk-O2SMJYPC.js";import"./chunk-N2AU7VKX.js";import"./chunk-ZC23RK4J.js";import"./chunk-OPHQNXYO.js";import{Ac as N,Cb as p,Db as a,Eb as i,F as T,Fb as u,Sa as l,Tb as D,Ub as h,Vb as _,Yb as I,Zb as d,_ as s,gb as f,kc as P,pa as c,wb as C,xb as S}from"./chunk-TQTOIWBK.js";import"./chunk-7CGTOI24.js";var X=()=>["/"];function H(m,o){m&1&&(a(0,"sh-form-field")(1,"label",14),_(2,3),i(),u(3,"input",15),i())}var F=new v,g=class m{#t=s(L);#o=s(w);#i=s(J);#n=s(K);#e=s(O);isImporting=c(!1);isSecureFile=c(!1);isValid=c(!1);importForm=F.group({config:F.control(""),cmdline:F.control(!1),import_metadata:F.control(!1),direct:F.control(!1),passphrase:F.control("")});selectedFile=c([]);onFileDropped(o){let e=o[0];if(e){let t=new FileReader;this.isSecureFile.set(e.type!=="application/json"),t.onload=this.#r.bind(this),t.readAsArrayBuffer(e)}}#r(o){let e=o.target?.result;this.isSecureFile.set(this.#a(e)!=="json"),this.importForm.patchValue({config:this.#s(e)}),this.isValid.set(this.importForm.value.config!=="")}#a(o){let e=new Uint8Array(o);if(e.length>=5&&e[0]===65&&e[1]===69&&e[2]===83&&e[4]===0)return"aes";try{let t=new TextDecoder().decode(o),n=JSON.parse(t);if(typeof n=="object"&&n!==null)return"json"}catch{}return"unknown"}#s(o){let e=new Uint8Array(o),t=e.byteLength,n="";for(let r=0;r<t;r++)n+=String.fromCharCode(e[r]);return btoa(n)}submit(){this.isImporting.set(!0);let o=this.importForm.value.direct??!1;this.#i.postApiV1BackupsImport({requestBody:this.importForm.value}).pipe(T(()=>this.isImporting.set(!1))).subscribe({next:e=>{if(o){this.#t.success("Backup imported successfully."),this.#e.navigate(["/"]);return}let t=this.#n.addDraftBackup(e.data);this.#e.navigate(["/backup-draft",t])},error:e=>{let t=e.message||$localize`Unknown error`;this.#o.open(z,{data:{title:$localize`Failed to import backup`,message:t,confirmText:$localize`OK`,cancelText:void 0}})}})}static \u0275fac=function(e){return new(e||m)};static \u0275cmp=f({type:m,selectors:[["app-import"]],decls:19,vars:8,consts:()=>{let o;o=$localize` Import backup configuration ${"\uFFFD#3\uFFFD"}:START_TAG_DIV:${"\uFFFD#4\uFFFD"}:START_TAG_BUTTON:${"[\uFFFD#5\uFFFD|\uFFFD#7\uFFFD]"}:START_TAG_SH_ICON:arrow-left${"[\uFFFD/#5\uFFFD|\uFFFD/#7\uFFFD]"}:CLOSE_TAG_SH_ICON: Back ${"[\uFFFD/#4\uFFFD|\uFFFD/#6\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#6\uFFFD"}:START_TAG_BUTTON_1:${"[\uFFFD#5\uFFFD|\uFFFD#7\uFFFD]"}:START_TAG_SH_ICON:download-simple${"[\uFFFD/#5\uFFFD|\uFFFD/#7\uFFFD]"}:CLOSE_TAG_SH_ICON: Import ${"[\uFFFD/#4\uFFFD|\uFFFD/#6\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_DIV:`,o=I(o);let e;e=$localize`Import Metadata`;let t;t=$localize`Save now`;let n;return n=$localize`Passphrase`,[o,e,t,n,[1,"actions"],["shButton","","type","button",1,"outlined",3,"routerLink"],["shButton","","type","submit",1,"raised","primary",3,"click","disabled"],["autocomplete","off",3,"formGroup"],["accept",".json,.aes",3,"filesChange","files"],[1,"primary","raised"],["for","importMetadata"],["type","checkbox","formControlName","import_metadata"],["for","direct"],["type","checkbox","formControlName","direct"],["for","passphrase"],["type","password","autocomplete","disabled","formControlName","passphrase"]]},template:function(e,t){e&1&&(a(0,"header")(1,"h3"),D(2,0),a(3,"div",4)(4,"button",5),u(5,"sh-icon"),i(),a(6,"button",6),d("click",function(){return t.submit()}),u(7,"sh-icon"),i()(),h(),i()(),a(8,"form",7)(9,"sh-file-upload",8),d("filesChange",function(r){return t.onFileDropped(r)}),i(),C(10,H,4,0,"sh-form-field"),a(11,"sh-toggle",9)(12,"label",10),_(13,1),i(),u(14,"input",11),i(),a(15,"sh-toggle",9)(16,"label",12),_(17,2),i(),u(18,"input",13),i()()),e&2&&(l(4),p("routerLink",N(7,X)),l(2),P("loading",t.isImporting()),p("disabled",t.isImporting()||!t.isValid()),l(2),p("formGroup",t.importForm),l(),p("files",t.selectedFile()),l(),S(t.isSecureFile()?10:-1))},dependencies:[G,b,A,E,y,R,$,B,M,x,k,U,j,V],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:3rem}h3[_ngcontent-%COMP%]{font:var(--title-30);display:flex;align-items:center;justify-content:space-between}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;max-width:31.25rem}sh-file-upload[_ngcontent-%COMP%]{width:100%}"],changeDetection:0})};export{g as default};
@@ -0,0 +1 @@
1
+ import{a as v}from"./chunk-TVFRVP7K.js";import"./chunk-QDDVZ4CR.js";import"./chunk-BLSV7CNZ.js";import"./chunk-F2ZC26DC.js";import{q as S}from"./chunk-43WATFQS.js";import"./chunk-CAQ3XMFP.js";import"./chunk-UZ4POLDC.js";import"./chunk-O56QUSSI.js";import"./chunk-F3JYPWPK.js";import{a as D}from"./chunk-736PM4LG.js";import"./chunk-TCXCC5BM.js";import"./chunk-GKGMP6VF.js";import"./chunk-6Q6SSTBK.js";import"./chunk-YCJYEQF7.js";import"./chunk-AXQQEOTT.js";import"./chunk-UTXZPAY6.js";import"./chunk-IMQUTGIK.js";import"./chunk-ANSV4G2K.js";import"./chunk-F3ETZKLK.js";import{b as g}from"./chunk-IQL3REGJ.js";import"./chunk-E4NQOMJX.js";import"./chunk-YYD2JU6T.js";import"./chunk-6JS7B4FW.js";import{L as R,R as L}from"./chunk-VKQQDCUN.js";import{d as I}from"./chunk-DSYNIXJF.js";import{b as A,c as M,e as O,f as y}from"./chunk-NPFPMA4P.js";import"./chunk-O2SMJYPC.js";import"./chunk-N2AU7VKX.js";import"./chunk-ZC23RK4J.js";import"./chunk-OPHQNXYO.js";import{$b as N,Cb as p,Cc as u,D as k,Db as r,Eb as s,Fb as m,Sa as o,Vb as c,_,gb as T,nc as E,pc as b,ra as h,wb as C,xb as f,zc as B}from"./chunk-TQTOIWBK.js";import"./chunk-7CGTOI24.js";var G=(i,e)=>[i,e,"general"],$=(i,e)=>[i,e,"destination"],U=(i,e)=>[i,e,"source-data"],K=(i,e)=>[i,e,"schedule"],F=(i,e)=>[i,e,"options"];function w(i,e){if(i&1&&(r(0,"p"),E(1),s()),i&2){let t=N();o(),b("Editing: ",t.backupName())}}function J(i,e){i&1&&m(0,"sh-progress-bar",7)}function X(i,e){i&1&&(r(0,"section"),m(1,"router-outlet"),s())}var P=class i{#t=_(A);#e=_(S);#i=_(D);#n=_(I);isDraft=this.#e.isDraft;isNew=this.#e.isNew;backupId=this.#e.backupId;backupName=this.#e.backupName;finishedLoading=this.#e.finishedLoading;#a=g(this.#t.params);#o=g(this.#t.url);paramsChanged=h(()=>{let e=this.#a()?.id,t=!!this.#o()?.find(n=>n.path==="backup-draft");e!=this.#e.backupId()&&(this.#e.backupId.set(e),e!=="new"?this.getBackup(e,t):this.getDefaults())});getDefaults(){this.#n.getApiV1Backupdefaults().pipe(k(1)).subscribe({next:e=>{let t=e.Backup;t.Settings=[...t.Settings],this.#e.mapGeneralToForm(t),this.#e.mapDestinationToForm(t),this.#e.mapSourceDataToForm(t),this.#e.mapScheduleToForm(e.Schedule),this.#e.mapOptionsToForms(t),this.#e.applicationOptions.set(e.ApplicationOptions),this.#e.backupDefaults.set(e),this.#e.finishedLoading.set(!0)}})}getBackup(e,t=!1){let n=a=>{this.#e.mapScheduleToForm(a.Schedule??null),a.Backup&&(this.#e.mapGeneralToForm(a.Backup),this.#e.mapDestinationToForm(a.Backup),this.#e.mapSourceDataToForm(a.Backup),this.#e.mapOptionsToForms(a.Backup),this.#e.storeMetadata(a.Backup,t)),this.#e.finishedLoading.set(!0)};if(t){this.isDraft.set(t);let a=this.#i.draftBackups().find(d=>d.id===e);if(!a){alert("Backup not found");return}n(a.data)}else this.#n.getApiV1BackupById({id:e}).subscribe({next:n})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=T({type:i,selectors:[["app-backup"]],features:[B([S])],decls:16,vars:22,consts:()=>{let e;e=$localize` General `;let t;t=$localize` Destination `;let n;n=$localize` Source Data `;let a;a=$localize` Schedule `;let d;return d=$localize` Options `,[e,t,n,a,d,[1,"primary"],["tabindex","-1","routerLinkActive","active",3,"routerLink"],[1,"indeterminate","primary"]]},template:function(t,n){t&1&&(m(0,"app-status-bar"),r(1,"header"),C(2,w,2,1,"p"),r(3,"sh-stepper",5)(4,"div",6),c(5,0),s(),r(6,"div",6),c(7,1),s(),r(8,"div",6),c(9,2),s(),r(10,"div",6),c(11,3),s(),r(12,"div",6),c(13,4),s()()(),C(14,J,1,0,"sh-progress-bar",7)(15,X,2,0,"section")),t&2&&(o(2),f(n.isNew()?-1:2),o(2),p("routerLink",u(7,G,n.isDraft()?"/backup-draft":"/backup",n.backupId())),o(2),p("routerLink",u(10,$,n.isDraft()?"/backup-draft":"/backup",n.backupId())),o(2),p("routerLink",u(13,U,n.isDraft()?"/backup-draft":"/backup",n.backupId())),o(2),p("routerLink",u(16,K,n.isDraft()?"/backup-draft":"/backup",n.backupId())),o(2),p("routerLink",u(19,F,n.isDraft()?"/backup-draft":"/backup",n.backupId())),o(2),f(n.finishedLoading()?15:14))},dependencies:[M,O,y,v,L,R],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%}header[_ngcontent-%COMP%]{padding:1rem 1.5rem;border-bottom:1px solid var(--base-4)}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:.5rem}header[_ngcontent-%COMP%] sh-stepper[_ngcontent-%COMP%]{width:100%}section[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:center;flex:1 0;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:auto}"],changeDetection:0})};export{P as default};
@@ -1 +1 @@
1
- import{a as be,b as ve}from"./chunk-7C2YZVSQ.js";import{a as $e}from"./chunk-BLSV7CNZ.js";import{a as X}from"./chunk-EXMYBMGI.js";import"./chunk-RJ2JM7C7.js";import{a as Re}from"./chunk-WOKYULBU.js";import"./chunk-6Q6SSTBK.js";import"./chunk-YCJYEQF7.js";import"./chunk-UTXZPAY6.js";import"./chunk-IMQUTGIK.js";import{a as Ge}from"./chunk-PIGMTUUT.js";import"./chunk-ANSV4G2K.js";import{a as ye}from"./chunk-BACKG7KA.js";import"./chunk-IQL3REGJ.js";import"./chunk-AIAUP7OE.js";import{a as De}from"./chunk-C6PICAXB.js";import{c as Se,e as Me}from"./chunk-6JS7B4FW.js";import{B as R,G as Ne,H as fe,J as Pe,Q as Ie,Y as Le,c as ge,d as Ce,e as Te,i as me,r as he,s as Fe,t as Ee,v as M,w as Y,x as Ae,z as Oe}from"./chunk-VKQQDCUN.js";import{d as J}from"./chunk-DSYNIXJF.js";import{c as ue,e as de,f as pe}from"./chunk-NPFPMA4P.js";import"./chunk-O2SMJYPC.js";import"./chunk-N2AU7VKX.js";import"./chunk-ZC23RK4J.js";import"./chunk-OPHQNXYO.js";import{$b as c,Ab as te,Ac as le,Bb as ne,Cb as F,Db as a,Eb as o,F as j,Fb as _,Mb as N,Qc as B,Sa as r,Tb as p,Ub as S,Vb as f,Vc as _e,Xc as ce,Yb as b,Zb as T,_ as d,_c as K,da as A,ea as O,gb as D,gc as ie,hc as oe,kc as U,mc as L,nc as u,oc as Q,pa as h,pc as v,ra as q,sc as $,tc as H,uc as w,vc as ae,wb as g,wc as se,xb as C,xc as x,yb as ee,yc as re}from"./chunk-TQTOIWBK.js";import{a as z,b as W}from"./chunk-7CGTOI24.js";var ke=["scroller"];function Ue(i,n){i&1&&(a(0,"sh-icon"),u(1,"bell-ringing"),o())}function Be(i,n){i&1&&(a(0,"sh-icon"),u(1,"bell"),o())}function Ye(i,n){if(i&1&&_(0,"app-notification",8),i&2){c(2);let e=x(6);F("index",0)("notification",e.content)}}function Je(i,n){if(i&1&&(a(0,"div",11),u(1),o()),i&2){c(3);let e=x(6);r(),v(" ",e.content.content," ")}}function Xe(i,n){if(i&1&&(a(0,"sh-alert")(1,"div",10),u(2),o(),g(3,Je,2,1,"div",11),o()),i&2){c(2);let e=x(6);L(e.content.type||"error"),r(2),Q(e.content.title),r(),C(e.content.content?3:-1)}}function Ve(i,n){if(i&1&&(a(0,"div",6),g(1,Ye,1,2,"app-notification",8)(2,Xe,4,4,"sh-alert",9),o()),i&2){c();let e=x(6);r(),C(e.type==="notification"?1:2)}}function ze(i,n){if(i&1){let e=N();a(0,"div",7)(1,"div",12)(2,"h6",13),p(3,2),a(4,"button",5),T("click",function(){A(e);let s=c();return O(s.toggleNotifications())}),_(5,"sh-icon"),o(),S(),o(),a(6,"div",14,0)(8,"div",15),_(9,"app-notifications"),o()()()()}}function We(i,n){if(i&1&&(a(0,"div",20),u(1),o()),i&2){let e=c().$implicit;r(),v(" ",e.content," ")}}function je(i,n){if(i&1){let e=N();a(0,"sh-alert",18,1),T("click",function(){let s=A(e).$implicit,l=c(2);return O(l.deleteAlertByIndex(s.id))}),a(2,"div",19),u(3),o(),g(4,We,2,1,"div",20),o()}if(i&2){let e=n.$implicit;L(e.type),F("id",e.id),r(3),Q(e.title),r(),C(e.content?4:-1)}}function qe(i,n){i&1&&(a(0,"p",17),f(1,4),o())}function Qe(i,n){if(i&1){let e=N();a(0,"div",7)(1,"div",12)(2,"h6",13),p(3,3),a(4,"button",5),T("click",function(){A(e);let s=c();return O(s.toggleAlerts())}),_(5,"sh-icon"),o(),S(),o(),a(6,"div",14,0)(8,"div",15),te(9,je,5,5,"sh-alert",16,ee,!1,qe,2,0,"p",17),o()()()()}if(i&2){let e=c();r(9),ne(e.alertHistory())}}var He=new he,k=class i{#e=d(Ae);#t=d(X);isSubmitting=h(!1);messageSent=h(!1);form=He.group({message:He.control("",[Ce.required])});notifications=this.#t.notifications;shownMessage=h(null);shownMessageInterval=null;alertHistory=this.#e.alertHistory;alertHistoryIsOpen=this.#e.alertHistoryIsOpen;alertHistoryIsHidden=this.#e.alertHistoryIsHidden;numberOfOpenAlerts=B(()=>this.alertHistory().filter(n=>n.isOpen).length);scroller=ce("scroller");isAlertsOpen=K(!1);isNotificationsOpen=K(!1);previousHistoryCount=h(null);previousNotificationsCount=h(null);constructor(){q(()=>{let n=this.alertHistory(),e=this.notifications();if(e.length===0){this.shownMessage.set(null);return}e.length&&this.previousHistoryCount()!==n.length&&!this.isNotificationsOpen()?(this.shownMessage.set({content:e[0],countDown:3,type:"notification"}),this.previousHistoryCount.set(n.length),this.shownMessageInterval=setInterval(()=>{let t=this.shownMessage();if(t?.countDown===0){this.shownMessage.set(null),this.shownMessageInterval=null;return}t!==null&&this.shownMessage.update(s=>W(z({},s),{countDown:s.countDown-1}))},1e3)):n.length&&this.previousHistoryCount()!==n.length&&!this.isAlertsOpen()&&(this.shownMessage.set({content:n[0],countDown:3,type:"alert"}),this.previousHistoryCount.set(n.length),this.shownMessageInterval=setInterval(()=>{let t=this.shownMessage();if(t?.countDown===0){this.shownMessage.set(null),this.shownMessageInterval=null;return}t!==null&&this.shownMessage.update(s=>W(z({},s),{countDown:s.countDown-1}))},1e3))}),q(()=>{this.alertHistoryIsOpen(),this.scrollToBottom()})}resetPreviewMessage(){this.shownMessage.set(null),this.shownMessageInterval=null}toggleAlerts(){this.isAlertsOpen()?this.isAlertsOpen.set(!1):(this.isAlertsOpen.set(!0),this.isNotificationsOpen.set(!1),this.resetPreviewMessage())}toggleNotifications(){this.isNotificationsOpen.set(!this.isNotificationsOpen()),this.isAlertsOpen()&&this.isAlertsOpen.set(!1)}deleteAlertByIndex(n){this.#e.removeAlert(n)}scrollToBottom(){this.scroller()&&this.scroller()?.nativeElement&&this.scroller().nativeElement.scrollTo(0,this.scroller().nativeElement.scrollHeight)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=D({type:i,selectors:[["app-service-hub"]],viewQuery:function(e,t){e&1&&ie(t.scroller,ke,5),e&2&&oe()},inputs:{isAlertsOpen:[1,"isAlertsOpen"],isNotificationsOpen:[1,"isNotificationsOpen"]},outputs:{isAlertsOpen:"isAlertsOpenChange",isNotificationsOpen:"isNotificationsOpenChange"},decls:10,vars:9,consts:()=>{let n;n=$localize` Notifications ${"\uFFFD#4\uFFFD"}:START_TAG_BUTTON:${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:x-circle${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_BUTTON:`;let e;e=$localize` Alerts ${"\uFFFD#4\uFFFD"}:START_TAG_BUTTON:${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:x-circle${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_BUTTON:`;let t;return t=$localize`No alerts yet`,[["scroller",""],["alerts",""],n,e,t,["shButton","",3,"click"],[1,"preview-alert-wrap"],[1,"alert-stream-modal"],[3,"index","notification"],[3,"class"],["ship-alert-title",""],["ship-alert-content",""],[1,"alert-stream-modal-content"],[1,"paragraph-20"],[1,"alert-stream-modal-list-scroller"],[1,"alert-stream-modal-list"],[3,"class","id"],[1,"no-alerts"],[3,"click","id"],["title",""],["content",""]]},template:function(e,t){if(e&1&&(a(0,"button",5),T("click",function(){return t.toggleAlerts()}),a(1,"sh-icon"),u(2,"info"),o()(),a(3,"button",5),T("click",function(){return t.toggleNotifications()}),g(4,Ue,2,0,"sh-icon")(5,Be,2,0,"sh-icon"),o(),ae(6),g(7,Ve,3,1,"div",6),g(8,ze,10,0,"div",7),g(9,Qe,12,1,"div",7)),e&2){L(t.alertHistory().length?"error":""),r(3),L(t.notifications().length?"error":""),r(),C(t.notifications().length?4:5),r(2);let s=se(t.shownMessage());r(),C(s?7:-1),r(),C(t.isNotificationsOpen()?8:-1),r(),C(t.isAlertsOpen()?9:-1)}},dependencies:[Ee,Y,M,R,ve,be],styles:["[_nghost-%COMP%]{display:flex;position:fixed;gap:.5rem;bottom:1.5rem;right:1.5rem;z-index:5000}@media only screen and (max-width:768px){[_nghost-%COMP%]{bottom:1rem;right:1rem}}[_nghost-%COMP%] h6[_ngcontent-%COMP%]{margin:0}.preview-alert-wrap[_ngcontent-%COMP%]{position:absolute;bottom:2.6875rem;right:0;display:flex;flex-direction:column;min-width:15.625rem}.helpdesk-modal[_ngcontent-%COMP%]{position:absolute;bottom:2.6875rem;right:0;display:flex;flex-direction:column}@media only screen and (max-width:768px){.helpdesk-modal[_ngcontent-%COMP%]{bottom:2.6875rem}}.helpdesk-modal-content[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;gap:1rem;min-width:20rem;border:1px solid var(--base-4);background-color:var(--base-1);border-radius:var(--shape-2)}.helpdesk-modal-content[_ngcontent-%COMP%] .message-sent[_ngcontent-%COMP%]{padding:0 1rem 1rem;text-wrap:pretty}.helpdesk-modal-content[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{padding:1rem;border-bottom:1px solid var(--base-4);display:flex;align-items:center;justify-content:space-between}.helpdesk-modal-content[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{padding:0 1rem 1rem;display:flex;flex-direction:column;align-items:flex-end;gap:1rem}.helpdesk-modal-content[_ngcontent-%COMP%] form[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{width:100%;text-wrap:pretty}.helpdesk-modal-content[_ngcontent-%COMP%] form[_ngcontent-%COMP%] mat-form-field[_ngcontent-%COMP%]{width:100%}.alert-stream-modal[_ngcontent-%COMP%]{position:absolute;bottom:2.6875rem;right:0;display:flex;flex-direction:column}@media only screen and (max-width:768px){.alert-stream-modal[_ngcontent-%COMP%]{bottom:2.6875rem}}.alert-stream-modal-list-scroller[_ngcontent-%COMP%]{overflow-y:auto;max-height:18.75rem}.alert-stream-modal-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:1rem;border-radius:var(--shape-2)}.alert-stream-modal-content[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;min-width:20rem;border:1px solid var(--base-4);background-color:var(--base-1);border-radius:var(--shape-2)}.alert-stream-modal-content[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{padding:1rem;border-bottom:1px solid var(--base-4);display:flex;align-items:center;justify-content:space-between}.no-alerts[_ngcontent-%COMP%]{padding:1rem;display:flex;flex-direction:column;gap:1rem;text-align:center}"],changeDetection:0})};function Ke(i,n){i&1&&(a(0,"sh-icon",14),u(1,"check"),o())}function Ze(i,n){i&1&&(a(0,"sh-icon",15),u(1,"prohibit"),o())}function et(i,n){if(i&1){let e=N();a(0,"button",20),T("click",function(){A(e);let s=c();return O(s.updatePassphrase())}),f(1,5),o()}if(i&2){let e=c();U("loading",e.isUpdating())}}function tt(i,n){if(i&1){let e=N();a(0,"button",21),T("click",function(){A(e);let s=c();return O(s.updatePassphrase())}),f(1,6),o()}if(i&2){let e=c();U("loading",e.isUpdating()),F("disabled",!0)}}var V=class i{#e=d(J);closed=_e();isUpdating=h(!1);passphrase=h("");repeatPassphrase=h("");updatePassphrase(){this.passphrase()===this.repeatPassphrase()&&(this.isUpdating.set(!0),this.#e.patchApiV1Serversettings({requestBody:{"server-passphrase":this.passphrase()}}).pipe(j(()=>this.isUpdating.set(!1))).subscribe({next:()=>this.closed.emit()}))}cancel(){this.isUpdating.set(!0),this.#e.patchApiV1Serversettings({requestBody:{"has-asked-for-password-change":"True"}}).pipe(j(()=>this.isUpdating.set(!1))).subscribe({next:()=>this.closed.emit()})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=D({type:i,selectors:[["app-change-passphrase-alert-dialog"]],outputs:{closed:"closed"},decls:23,vars:7,consts:()=>{let n;n=$localize`Enter new password`;let e;e=$localize`Repeat password`;let t;t=$localize`Password have to be filled and have to match`;let s;s=$localize`Change passphrase`;let l;l=$localize` Duplicati needs to be secured with a passphrase and a random passphrase has been generated for you. ${"[\uFFFD#6\uFFFD\uFFFD/#6\uFFFD|\uFFFD#7\uFFFD\uFFFD/#7\uFFFD]"}:LINE_BREAK:${"[\uFFFD#6\uFFFD\uFFFD/#6\uFFFD|\uFFFD#7\uFFFD\uFFFD/#7\uFFFD]"}:LINE_BREAK: If you open Duplicati from the tray icon, you do not need a passphrase, but if you plan to open it from another location you need to set a passphrase you know. Do you want to set a passphrase now? `,l=b(l);let y;y=$localize`Passphrase`;let P;P=$localize`Repeat passphrase`;let I;I=$localize`Not now thanks`;let G;G=$localize` Yes, update passphrase now `;let m;return m=$localize` Yes, update passphrase now `,[s,l,y,P,I,G,m,["header",""],["content",""],["type","warning"],["for","password"],["type","password","name","password","autocomplete","disabled","placeholder",n,"tabindex","1",3,"ngModelChange","ngModel"],["for","repeatPassword"],["type","password","name","repeatPassword","autocomplete","disabled","placeholder",e,"tabindex","2",3,"ngModelChange","disabled","ngModel"],["suffix","",1,"sh-success"],["suffix",""],["footer",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"loading"],["shButton","","shTooltip",t,1,"raised","primary",3,"loading","disabled"],["shButton","",1,"raised","primary",3,"click"],["shButton","","shTooltip",t,1,"raised","primary",3,"click","disabled"]]},template:function(e,t){e&1&&(a(0,"header",7)(1,"h3"),f(2,0),o()(),a(3,"div",8)(4,"sh-alert",9),p(5,1),_(6,"br")(7,"br"),S(),o(),a(8,"sh-form-field")(9,"label",10),f(10,2),o(),a(11,"input",11),w("ngModelChange",function(l){return H(t.passphrase,l)||(t.passphrase=l),l}),o()(),a(12,"sh-form-field")(13,"label",12),f(14,3),o(),a(15,"input",13),w("ngModelChange",function(l){return H(t.repeatPassphrase,l)||(t.repeatPassphrase=l),l}),o(),g(16,Ke,2,0,"sh-icon",14)(17,Ze,2,0,"sh-icon",15),o()(),a(18,"footer",16)(19,"button",17),T("click",function(){return t.cancel()}),f(20,4),o(),g(21,et,2,2,"button",18)(22,tt,2,3,"button",19),o()),e&2&&(r(11),$("ngModel",t.passphrase),r(4),F("disabled",t.passphrase().length===0),$("ngModel",t.repeatPassphrase),r(),C(t.passphrase().length!==0&&t.passphrase()===t.repeatPassphrase()?16:17),r(3),U("loading",t.isUpdating()),r(2),C(t.passphrase().length!==0&&t.passphrase()===t.repeatPassphrase()?21:22))},dependencies:[Fe,ge,Te,me,Y,fe,M,Le,R],styles:["[_nghost-%COMP%]{display:block;--dialog-p: 1.5rem}[content][_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}"],changeDetection:0})};var nt=()=>({exact:!0});function it(i,n){i&1&&(a(0,"sh-icon"),u(1,"sun"),o())}function ot(i,n){i&1&&(a(0,"sh-icon"),u(1,"moon"),o())}function at(i,n){if(i&1){let e=N();a(0,"button",26),T("click",function(){A(e);let s=c();return O(s.logout())}),p(1,8),_(2,"sh-icon"),S(),o()}}var Z=class i{#e=d($e);#t=d(J);#i=d(Re);#o=d(Se);#a=d(Oe);#s=d(X);#r=d(Me);#l=d(ye);#n=d(De);relayIsEnabled=this.#o.relayIsEnabled;isDarkMode=this.#e.isDarkMode;isNavOpen=this.#e.isNavOpen;sidenavType=this.#e.sidenavType;machineName=B(()=>{let n=this.#l.serverSettings();if(n&&n["--machine-name"])return n["--machine-name"];if(n&&n["machine-name"])return n["machine-name"];let e=this.#n.allOptions().find(t=>t.name==="machine-name");return e&&e.defaultValue?e.defaultValue:this.#n.systemInfo()?.MachineName??"Unknown"});ngOnInit(){return this.#s.init(),this.#i.getBackups(!0),this.#t.getApiV1Serversettings().subscribe({next:n=>{let e=n["autogenerated-passphrase"]==="True",t=n["has-asked-for-password-change"]==="True";e&&!t&&this.#a.open(V,{maxWidth:"500px"})}})}toggleBodyClass(){this.#e.toggleBodyClass()}changeDefaultClientTo(n){this.#_(n),window.location.replace(`/${n}`)}logout(){this.#r.logout()}#_(n){var e=new Date;e.setTime(e.getTime()+2160*60*60*1e3),document.cookie="default-client="+n+"; expires="+e.toUTCString()+"; path=/"}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=D({type:i,selectors:[["app-layout"]],decls:44,vars:11,consts:()=>{let n;n=$localize`${"\uFFFD#10\uFFFD"}:START_TAG_SH_ICON:house${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_SH_ICON: Home `;let e;e=$localize`${"\uFFFD#13\uFFFD"}:START_TAG_SH_ICON:database${"\uFFFD/#13\uFFFD"}:CLOSE_TAG_SH_ICON: Add backup `;let t;t=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:clock-counter-clockwise${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON: Restore `;let s;s=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:link-simple${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Destinations `;let l;l=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:gear${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON: Settings `;let y;y=$localize`${"\uFFFD#32\uFFFD"}:START_TAG_SH_ICON:info${"\uFFFD/#32\uFFFD"}:CLOSE_TAG_SH_ICON: About Duplicati `;let P;P=$localize`${"\uFFFD#35\uFFFD"}:START_TAG_SH_ICON:files${"[\uFFFD/#35\uFFFD|\uFFFD/#36\uFFFD]"}:CLOSE_TAG_SH_ICON: Documentation ${"\uFFFD#36\uFFFD"}:START_TAG_SH_ICON_1:arrow-square-out${"[\uFFFD/#35\uFFFD|\uFFFD/#36\uFFFD]"}:CLOSE_TAG_SH_ICON:`,P=b(P);let I;I=$localize`${"\uFFFD#39\uFFFD"}:START_TAG_SH_ICON:chats-circle${"[\uFFFD/#39\uFFFD|\uFFFD/#40\uFFFD]"}:CLOSE_TAG_SH_ICON: Visit forum ${"\uFFFD#40\uFFFD"}:START_TAG_SH_ICON_1:arrow-square-out${"[\uFFFD/#39\uFFFD|\uFFFD/#40\uFFFD]"}:CLOSE_TAG_SH_ICON:`,I=b(I);let G;return G=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:sign-out${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Log out `,[n,e,t,s,l,y,P,I,G,[3,"isOpenChange","isOpen","disableDrag"],["sidenav",""],["shButton","",1,"icon","small",3,"click"],[1,"base-1","primary"],["action","","routerLink","/","routerLinkActive","active",3,"routerLinkActiveOptions"],["action","","routerLink","/add-backup","routerLinkActive","active"],["action","","routerLink","/restore","routerLinkActive","active"],["action","","routerLink","/destinations","routerLinkActive","active"],["action","","routerLink","/settings","routerLinkActive","active"],[1,"spacer"],[1,"base-1l","primary"],["action","",1,"machine-name",3,"title"],["action","","routerLink","/about","routerLinkActive","active"],["href","https://docs.duplicati.com","target","_blank","action",""],["suffix",""],["href","https://forum.duplicati.com","target","_blank","action",""],["action",""],["action","",3,"click"]]},template:function(e,t){e&1&&(a(0,"sh-sidenav",9),w("isOpenChange",function(l){return H(t.isNavOpen,l)||(t.isNavOpen=l),l}),a(1,"div",10)(2,"header"),_(3,"app-logo"),a(4,"button",11),T("click",function(){return t.toggleBodyClass()}),g(5,it,2,0,"sh-icon")(6,ot,2,0,"sh-icon"),o()(),a(7,"sh-list",12)(8,"button",13),p(9,0),_(10,"sh-icon"),S(),o(),a(11,"button",14),p(12,1),_(13,"sh-icon"),S(),o(),a(14,"button",15),p(15,2),_(16,"sh-icon"),S(),o(),a(17,"button",16),p(18,3),_(19,"sh-icon"),S(),o(),a(20,"button",17),p(21,4),_(22,"sh-icon"),S(),o()(),_(23,"div",18),a(24,"sh-list",19)(25,"div",20)(26,"sh-icon"),u(27,"desktop"),o(),u(28),o(),_(29,"sh-divider"),a(30,"button",21),p(31,5),_(32,"sh-icon"),S(),o(),a(33,"a",22),p(34,6),_(35,"sh-icon")(36,"sh-icon",23),S(),o(),a(37,"a",24),p(38,7),_(39,"sh-icon")(40,"sh-icon",23),S(),o(),g(41,at,3,0,"button",25),o()(),_(42,"router-outlet")(43,"app-service-hub"),o()),e&2&&(L(t.sidenavType()),$("isOpen",t.isNavOpen),F("disableDrag",!0),r(5),C(t.isDarkMode()?5:6),r(3),F("routerLinkActiveOptions",le(10,nt)),r(17),F("title",re(t.machineName())),r(3),v(" ",t.machineName()," "),r(13),C(t.relayIsEnabled()?-1:41))},dependencies:[ue,de,pe,Ie,M,Pe,R,Ne,k,Ge],styles:["[_nghost-%COMP%]{height:100vh;width:100%;overflow:hidden}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1.25rem;gap:.75rem}h3[title][_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}div[sidenav][_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100vh}.machine-name[_ngcontent-%COMP%]{margin:0;cursor:default}"],changeDetection:0})};export{Z as default};
1
+ import{a as be,b as ve}from"./chunk-3L3SRTPU.js";import{a as $e}from"./chunk-BLSV7CNZ.js";import{a as V}from"./chunk-LE24LKH7.js";import"./chunk-F3JYPWPK.js";import{a as Re}from"./chunk-736PM4LG.js";import"./chunk-6Q6SSTBK.js";import"./chunk-YCJYEQF7.js";import"./chunk-UTXZPAY6.js";import"./chunk-IMQUTGIK.js";import{a as Ge}from"./chunk-PIGMTUUT.js";import"./chunk-ANSV4G2K.js";import{a as ye}from"./chunk-F3ETZKLK.js";import"./chunk-IQL3REGJ.js";import"./chunk-E4NQOMJX.js";import{a as Le}from"./chunk-YYD2JU6T.js";import{c as Se,e as Me}from"./chunk-6JS7B4FW.js";import{B as R,G as Ne,H as fe,J as Pe,Q as Ie,Y as De,c as ge,d as Ce,e as Te,i as me,r as he,s as Fe,t as Ee,v as M,w as J,x as Ae,z as Oe}from"./chunk-VKQQDCUN.js";import{d as X}from"./chunk-DSYNIXJF.js";import{c as ue,e as de,f as pe}from"./chunk-NPFPMA4P.js";import"./chunk-O2SMJYPC.js";import"./chunk-N2AU7VKX.js";import"./chunk-ZC23RK4J.js";import"./chunk-OPHQNXYO.js";import{$b as c,Ab as te,Ac as le,Bb as ne,Cb as F,Db as a,Eb as o,F as q,Fb as _,Mb as N,Qc as Y,Sa as r,Tb as p,Ub as S,Vb as f,Vc as _e,Xc as ce,Yb as v,Zb as T,_ as d,_c as K,da as A,ea as O,gb as L,gc as ie,hc as oe,kc as B,mc as D,nc as u,oc as Q,pa as h,pc as $,ra as b,sc as H,tc as w,uc as x,vc as ae,wb as g,wc as se,xb as C,xc as k,yb as ee,yc as re}from"./chunk-TQTOIWBK.js";import{a as W,b as j}from"./chunk-7CGTOI24.js";var ke=["scroller"];function Ue(i,n){i&1&&(a(0,"sh-icon"),u(1,"bell-ringing"),o())}function Be(i,n){i&1&&(a(0,"sh-icon"),u(1,"bell"),o())}function Ye(i,n){if(i&1&&_(0,"app-notification",8),i&2){c(2);let e=k(6);F("index",0)("notification",e.content)}}function Je(i,n){if(i&1&&(a(0,"div",11),u(1),o()),i&2){c(3);let e=k(6);r(),$(" ",e.content.content," ")}}function Xe(i,n){if(i&1&&(a(0,"sh-alert")(1,"div",10),u(2),o(),g(3,Je,2,1,"div",11),o()),i&2){c(2);let e=k(6);D(e.content.type||"error"),r(2),Q(e.content.title),r(),C(e.content.content?3:-1)}}function Ve(i,n){if(i&1&&(a(0,"div",6),g(1,Ye,1,2,"app-notification",8)(2,Xe,4,4,"sh-alert",9),o()),i&2){c();let e=k(6);r(),C(e.type==="notification"?1:2)}}function ze(i,n){if(i&1){let e=N();a(0,"div",7)(1,"div",12)(2,"h6",13),p(3,2),a(4,"button",5),T("click",function(){A(e);let s=c();return O(s.toggleNotifications())}),_(5,"sh-icon"),o(),S(),o(),a(6,"div",14,0)(8,"div",15),_(9,"app-notifications"),o()()()()}}function We(i,n){if(i&1&&(a(0,"div",20),u(1),o()),i&2){let e=c().$implicit;r(),$(" ",e.content," ")}}function je(i,n){if(i&1){let e=N();a(0,"sh-alert",18,1),T("click",function(){let s=A(e).$implicit,l=c(2);return O(l.deleteAlertByIndex(s.id))}),a(2,"div",19),u(3),o(),g(4,We,2,1,"div",20),o()}if(i&2){let e=n.$implicit;D(e.type),F("id",e.id),r(3),Q(e.title),r(),C(e.content?4:-1)}}function qe(i,n){i&1&&(a(0,"p",17),f(1,4),o())}function Qe(i,n){if(i&1){let e=N();a(0,"div",7)(1,"div",12)(2,"h6",13),p(3,3),a(4,"button",5),T("click",function(){A(e);let s=c();return O(s.toggleAlerts())}),_(5,"sh-icon"),o(),S(),o(),a(6,"div",14,0)(8,"div",15),te(9,je,5,5,"sh-alert",16,ee,!1,qe,2,0,"p",17),o()()()()}if(i&2){let e=c();r(9),ne(e.alertHistory())}}var He=new he,U=class i{#e=d(Ae);#t=d(V);isSubmitting=h(!1);messageSent=h(!1);form=He.group({message:He.control("",[Ce.required])});notifications=this.#t.notifications;shownMessage=h(null);shownMessageInterval=null;alertHistory=this.#e.alertHistory;alertHistoryIsOpen=this.#e.alertHistoryIsOpen;alertHistoryIsHidden=this.#e.alertHistoryIsHidden;numberOfOpenAlerts=Y(()=>this.alertHistory().filter(n=>n.isOpen).length);scroller=ce("scroller");isAlertsOpen=K(!1);isNotificationsOpen=K(!1);previousHistoryCount=h(null);previousNotificationsCount=h(null);constructor(){b(()=>{let n=this.alertHistory(),e=this.notifications();if(e.length===0){this.shownMessage.set(null);return}e.length&&this.previousHistoryCount()!==n.length&&!this.isNotificationsOpen()?(this.shownMessage.set({content:e[0],countDown:3,type:"notification"}),this.previousHistoryCount.set(n.length),this.shownMessageInterval=setInterval(()=>{let t=this.shownMessage();if(t?.countDown===0){this.shownMessage.set(null),this.shownMessageInterval=null;return}t!==null&&this.shownMessage.update(s=>j(W({},s),{countDown:s.countDown-1}))},1e3)):n.length&&this.previousHistoryCount()!==n.length&&!this.isAlertsOpen()&&(this.shownMessage.set({content:n[0],countDown:3,type:"alert"}),this.previousHistoryCount.set(n.length),this.shownMessageInterval=setInterval(()=>{let t=this.shownMessage();if(t?.countDown===0){this.shownMessage.set(null),this.shownMessageInterval=null;return}t!==null&&this.shownMessage.update(s=>j(W({},s),{countDown:s.countDown-1}))},1e3))}),b(()=>{this.alertHistoryIsOpen(),this.scrollToBottom()})}resetPreviewMessage(){this.shownMessage.set(null),this.shownMessageInterval=null}toggleAlerts(){this.isAlertsOpen()?this.isAlertsOpen.set(!1):(this.isAlertsOpen.set(!0),this.isNotificationsOpen.set(!1),this.resetPreviewMessage())}toggleNotifications(){this.isNotificationsOpen.set(!this.isNotificationsOpen()),this.isAlertsOpen()&&this.isAlertsOpen.set(!1)}deleteAlertByIndex(n){this.#e.removeAlert(n)}scrollToBottom(){this.scroller()&&this.scroller()?.nativeElement&&this.scroller().nativeElement.scrollTo(0,this.scroller().nativeElement.scrollHeight)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=L({type:i,selectors:[["app-service-hub"]],viewQuery:function(e,t){e&1&&ie(t.scroller,ke,5),e&2&&oe()},inputs:{isAlertsOpen:[1,"isAlertsOpen"],isNotificationsOpen:[1,"isNotificationsOpen"]},outputs:{isAlertsOpen:"isAlertsOpenChange",isNotificationsOpen:"isNotificationsOpenChange"},decls:10,vars:9,consts:()=>{let n;n=$localize` Notifications ${"\uFFFD#4\uFFFD"}:START_TAG_BUTTON:${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:x-circle${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_BUTTON:`;let e;e=$localize` Alerts ${"\uFFFD#4\uFFFD"}:START_TAG_BUTTON:${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:x-circle${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_BUTTON:`;let t;return t=$localize`No alerts yet`,[["scroller",""],["alerts",""],n,e,t,["shButton","",3,"click"],[1,"preview-alert-wrap"],[1,"alert-stream-modal"],[3,"index","notification"],[3,"class"],["ship-alert-title",""],["ship-alert-content",""],[1,"alert-stream-modal-content"],[1,"paragraph-20"],[1,"alert-stream-modal-list-scroller"],[1,"alert-stream-modal-list"],[3,"class","id"],[1,"no-alerts"],[3,"click","id"],["title",""],["content",""]]},template:function(e,t){if(e&1&&(a(0,"button",5),T("click",function(){return t.toggleAlerts()}),a(1,"sh-icon"),u(2,"info"),o()(),a(3,"button",5),T("click",function(){return t.toggleNotifications()}),g(4,Ue,2,0,"sh-icon")(5,Be,2,0,"sh-icon"),o(),ae(6),g(7,Ve,3,1,"div",6),g(8,ze,10,0,"div",7),g(9,Qe,12,1,"div",7)),e&2){D(t.alertHistory().length?"error":""),r(3),D(t.notifications().length?"error":""),r(),C(t.notifications().length?4:5),r(2);let s=se(t.shownMessage());r(),C(s?7:-1),r(),C(t.isNotificationsOpen()?8:-1),r(),C(t.isAlertsOpen()?9:-1)}},dependencies:[Ee,J,M,R,ve,be],styles:["[_nghost-%COMP%]{display:flex;position:fixed;gap:.5rem;bottom:1.5rem;right:1.5rem;z-index:5000}@media only screen and (max-width:768px){[_nghost-%COMP%]{bottom:1rem;right:1rem}}[_nghost-%COMP%] h6[_ngcontent-%COMP%]{margin:0}.preview-alert-wrap[_ngcontent-%COMP%]{position:absolute;bottom:2.6875rem;right:0;display:flex;flex-direction:column;min-width:15.625rem}.helpdesk-modal[_ngcontent-%COMP%]{position:absolute;bottom:2.6875rem;right:0;display:flex;flex-direction:column}@media only screen and (max-width:768px){.helpdesk-modal[_ngcontent-%COMP%]{bottom:2.6875rem}}.helpdesk-modal-content[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;gap:1rem;min-width:20rem;border:1px solid var(--base-4);background-color:var(--base-1);border-radius:var(--shape-2)}.helpdesk-modal-content[_ngcontent-%COMP%] .message-sent[_ngcontent-%COMP%]{padding:0 1rem 1rem;text-wrap:pretty}.helpdesk-modal-content[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{padding:1rem;border-bottom:1px solid var(--base-4);display:flex;align-items:center;justify-content:space-between}.helpdesk-modal-content[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{padding:0 1rem 1rem;display:flex;flex-direction:column;align-items:flex-end;gap:1rem}.helpdesk-modal-content[_ngcontent-%COMP%] form[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{width:100%;text-wrap:pretty}.helpdesk-modal-content[_ngcontent-%COMP%] form[_ngcontent-%COMP%] mat-form-field[_ngcontent-%COMP%]{width:100%}.alert-stream-modal[_ngcontent-%COMP%]{position:absolute;bottom:2.6875rem;right:0;display:flex;flex-direction:column}@media only screen and (max-width:768px){.alert-stream-modal[_ngcontent-%COMP%]{bottom:2.6875rem}}.alert-stream-modal-list-scroller[_ngcontent-%COMP%]{overflow-y:auto;max-height:18.75rem}.alert-stream-modal-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:1rem;border-radius:var(--shape-2)}.alert-stream-modal-content[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;min-width:20rem;border:1px solid var(--base-4);background-color:var(--base-1);border-radius:var(--shape-2)}.alert-stream-modal-content[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{padding:1rem;border-bottom:1px solid var(--base-4);display:flex;align-items:center;justify-content:space-between}.no-alerts[_ngcontent-%COMP%]{padding:1rem;display:flex;flex-direction:column;gap:1rem;text-align:center}"],changeDetection:0})};function Ke(i,n){i&1&&(a(0,"sh-icon",14),u(1,"check"),o())}function Ze(i,n){i&1&&(a(0,"sh-icon",15),u(1,"prohibit"),o())}function et(i,n){if(i&1){let e=N();a(0,"button",20),T("click",function(){A(e);let s=c();return O(s.updatePassphrase())}),f(1,5),o()}if(i&2){let e=c();B("loading",e.isUpdating())}}function tt(i,n){if(i&1){let e=N();a(0,"button",21),T("click",function(){A(e);let s=c();return O(s.updatePassphrase())}),f(1,6),o()}if(i&2){let e=c();B("loading",e.isUpdating()),F("disabled",!0)}}var z=class i{#e=d(X);closed=_e();isUpdating=h(!1);passphrase=h("");repeatPassphrase=h("");updatePassphrase(){this.passphrase()===this.repeatPassphrase()&&(this.isUpdating.set(!0),this.#e.patchApiV1Serversettings({requestBody:{"server-passphrase":this.passphrase()}}).pipe(q(()=>this.isUpdating.set(!1))).subscribe({next:()=>this.closed.emit()}))}cancel(){this.isUpdating.set(!0),this.#e.patchApiV1Serversettings({requestBody:{"has-asked-for-password-change":"True"}}).pipe(q(()=>this.isUpdating.set(!1))).subscribe({next:()=>this.closed.emit()})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=L({type:i,selectors:[["app-change-passphrase-alert-dialog"]],outputs:{closed:"closed"},decls:23,vars:7,consts:()=>{let n;n=$localize`Enter new password`;let e;e=$localize`Repeat password`;let t;t=$localize`Password have to be filled and have to match`;let s;s=$localize`Change passphrase`;let l;l=$localize` Duplicati needs to be secured with a passphrase and a random passphrase has been generated for you. ${"[\uFFFD#6\uFFFD\uFFFD/#6\uFFFD|\uFFFD#7\uFFFD\uFFFD/#7\uFFFD]"}:LINE_BREAK:${"[\uFFFD#6\uFFFD\uFFFD/#6\uFFFD|\uFFFD#7\uFFFD\uFFFD/#7\uFFFD]"}:LINE_BREAK: If you open Duplicati from the tray icon, you do not need a passphrase, but if you plan to open it from another location you need to set a passphrase you know. Do you want to set a passphrase now? `,l=v(l);let y;y=$localize`Passphrase`;let P;P=$localize`Repeat passphrase`;let I;I=$localize`Not now thanks`;let G;G=$localize` Yes, update passphrase now `;let m;return m=$localize` Yes, update passphrase now `,[s,l,y,P,I,G,m,["header",""],["content",""],["type","warning"],["for","password"],["type","password","name","password","autocomplete","disabled","placeholder",n,"tabindex","1",3,"ngModelChange","ngModel"],["for","repeatPassword"],["type","password","name","repeatPassword","autocomplete","disabled","placeholder",e,"tabindex","2",3,"ngModelChange","disabled","ngModel"],["suffix","",1,"sh-success"],["suffix",""],["footer",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"loading"],["shButton","","shTooltip",t,1,"raised","primary",3,"loading","disabled"],["shButton","",1,"raised","primary",3,"click"],["shButton","","shTooltip",t,1,"raised","primary",3,"click","disabled"]]},template:function(e,t){e&1&&(a(0,"header",7)(1,"h3"),f(2,0),o()(),a(3,"div",8)(4,"sh-alert",9),p(5,1),_(6,"br")(7,"br"),S(),o(),a(8,"sh-form-field")(9,"label",10),f(10,2),o(),a(11,"input",11),x("ngModelChange",function(l){return w(t.passphrase,l)||(t.passphrase=l),l}),o()(),a(12,"sh-form-field")(13,"label",12),f(14,3),o(),a(15,"input",13),x("ngModelChange",function(l){return w(t.repeatPassphrase,l)||(t.repeatPassphrase=l),l}),o(),g(16,Ke,2,0,"sh-icon",14)(17,Ze,2,0,"sh-icon",15),o()(),a(18,"footer",16)(19,"button",17),T("click",function(){return t.cancel()}),f(20,4),o(),g(21,et,2,2,"button",18)(22,tt,2,3,"button",19),o()),e&2&&(r(11),H("ngModel",t.passphrase),r(4),F("disabled",t.passphrase().length===0),H("ngModel",t.repeatPassphrase),r(),C(t.passphrase().length!==0&&t.passphrase()===t.repeatPassphrase()?16:17),r(3),B("loading",t.isUpdating()),r(2),C(t.passphrase().length!==0&&t.passphrase()===t.repeatPassphrase()?21:22))},dependencies:[Fe,ge,Te,me,J,fe,M,De,R],styles:["[_nghost-%COMP%]{display:block;--dialog-p: 1.5rem}[content][_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}"],changeDetection:0})};var nt=()=>({exact:!0});function it(i,n){i&1&&(a(0,"sh-icon"),u(1,"sun"),o())}function ot(i,n){i&1&&(a(0,"sh-icon"),u(1,"moon"),o())}function at(i,n){if(i&1){let e=N();a(0,"button",26),T("click",function(){A(e);let s=c();return O(s.logout())}),p(1,8),_(2,"sh-icon"),S(),o()}}var Z=class i{#e=d($e);#t=d(X);#o=d(Re);#a=d(Se);#s=d(Oe);#r=d(V);#l=d(Me);#n=d(ye);#i=d(Le);relayIsEnabled=this.#a.relayIsEnabled;isDarkMode=this.#e.isDarkMode;isNavOpen=this.#e.isNavOpen;sidenavType=this.#e.sidenavType;hasShownPasswordDialog=!1;machineName=Y(()=>{let n=this.#n.serverSettings();if(n&&n["--machine-name"])return n["--machine-name"];if(n&&n["machine-name"])return n["machine-name"];let e=this.#i.allOptions().find(t=>t.name==="machine-name");return e&&e.defaultValue?e.defaultValue:this.#i.systemInfo()?.MachineName??"Unknown"});ngOnInit(){this.#r.init(),this.#o.getBackups(!0)}serverSettingsEffect=b(()=>{if(this.hasShownPasswordDialog)return;let n=this.#n.serverSettings();if(!n)return;let e=n["autogenerated-passphrase"]==="True",t=n["has-asked-for-password-change"]==="True";e&&!t&&(this.hasShownPasswordDialog=!0,this.#s.open(z,{maxWidth:"500px"}))});toggleBodyClass(){this.#e.toggleBodyClass()}changeDefaultClientTo(n){this.#_(n),window.location.replace(`/${n}`)}logout(){this.#l.logout()}#_(n){var e=new Date;e.setTime(e.getTime()+2160*60*60*1e3),document.cookie="default-client="+n+"; expires="+e.toUTCString()+"; path=/"}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=L({type:i,selectors:[["app-layout"]],decls:44,vars:11,consts:()=>{let n;n=$localize`${"\uFFFD#10\uFFFD"}:START_TAG_SH_ICON:house${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_SH_ICON: Home `;let e;e=$localize`${"\uFFFD#13\uFFFD"}:START_TAG_SH_ICON:database${"\uFFFD/#13\uFFFD"}:CLOSE_TAG_SH_ICON: Add backup `;let t;t=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:clock-counter-clockwise${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON: Restore `;let s;s=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:link-simple${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Destinations `;let l;l=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:gear${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON: Settings `;let y;y=$localize`${"\uFFFD#32\uFFFD"}:START_TAG_SH_ICON:info${"\uFFFD/#32\uFFFD"}:CLOSE_TAG_SH_ICON: About Duplicati `;let P;P=$localize`${"\uFFFD#35\uFFFD"}:START_TAG_SH_ICON:files${"[\uFFFD/#35\uFFFD|\uFFFD/#36\uFFFD]"}:CLOSE_TAG_SH_ICON: Documentation ${"\uFFFD#36\uFFFD"}:START_TAG_SH_ICON_1:arrow-square-out${"[\uFFFD/#35\uFFFD|\uFFFD/#36\uFFFD]"}:CLOSE_TAG_SH_ICON:`,P=v(P);let I;I=$localize`${"\uFFFD#39\uFFFD"}:START_TAG_SH_ICON:chats-circle${"[\uFFFD/#39\uFFFD|\uFFFD/#40\uFFFD]"}:CLOSE_TAG_SH_ICON: Visit forum ${"\uFFFD#40\uFFFD"}:START_TAG_SH_ICON_1:arrow-square-out${"[\uFFFD/#39\uFFFD|\uFFFD/#40\uFFFD]"}:CLOSE_TAG_SH_ICON:`,I=v(I);let G;return G=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:sign-out${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Log out `,[n,e,t,s,l,y,P,I,G,[3,"isOpenChange","isOpen","disableDrag"],["sidenav",""],["shButton","",1,"icon","small",3,"click"],[1,"base-1","primary"],["action","","routerLink","/","routerLinkActive","active",3,"routerLinkActiveOptions"],["action","","routerLink","/add-backup","routerLinkActive","active"],["action","","routerLink","/restore","routerLinkActive","active"],["action","","routerLink","/destinations","routerLinkActive","active"],["action","","routerLink","/settings","routerLinkActive","active"],[1,"spacer"],[1,"base-1l","primary"],["action","",1,"machine-name",3,"title"],["action","","routerLink","/about","routerLinkActive","active"],["href","https://docs.duplicati.com","target","_blank","action",""],["suffix",""],["href","https://forum.duplicati.com","target","_blank","action",""],["action",""],["action","",3,"click"]]},template:function(e,t){e&1&&(a(0,"sh-sidenav",9),x("isOpenChange",function(l){return w(t.isNavOpen,l)||(t.isNavOpen=l),l}),a(1,"div",10)(2,"header"),_(3,"app-logo"),a(4,"button",11),T("click",function(){return t.toggleBodyClass()}),g(5,it,2,0,"sh-icon")(6,ot,2,0,"sh-icon"),o()(),a(7,"sh-list",12)(8,"button",13),p(9,0),_(10,"sh-icon"),S(),o(),a(11,"button",14),p(12,1),_(13,"sh-icon"),S(),o(),a(14,"button",15),p(15,2),_(16,"sh-icon"),S(),o(),a(17,"button",16),p(18,3),_(19,"sh-icon"),S(),o(),a(20,"button",17),p(21,4),_(22,"sh-icon"),S(),o()(),_(23,"div",18),a(24,"sh-list",19)(25,"div",20)(26,"sh-icon"),u(27,"desktop"),o(),u(28),o(),_(29,"sh-divider"),a(30,"button",21),p(31,5),_(32,"sh-icon"),S(),o(),a(33,"a",22),p(34,6),_(35,"sh-icon")(36,"sh-icon",23),S(),o(),a(37,"a",24),p(38,7),_(39,"sh-icon")(40,"sh-icon",23),S(),o(),g(41,at,3,0,"button",25),o()(),_(42,"router-outlet")(43,"app-service-hub"),o()),e&2&&(D(t.sidenavType()),H("isOpen",t.isNavOpen),F("disableDrag",!0),r(5),C(t.isDarkMode()?5:6),r(3),F("routerLinkActiveOptions",le(10,nt)),r(17),F("title",re(t.machineName())),r(3),$(" ",t.machineName()," "),r(13),C(t.relayIsEnabled()?-1:41))},dependencies:[ue,de,pe,Ie,M,Pe,R,Ne,U,Ge],styles:["[_nghost-%COMP%]{height:100vh;width:100%;overflow:hidden}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1.25rem;gap:.75rem}h3[title][_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}div[sidenav][_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100vh}.machine-name[_ngcontent-%COMP%]{margin:0;cursor:default}"],changeDetection:0})};export{Z as default};
@@ -0,0 +1 @@
1
+ import{c as a,d as b}from"./chunk-77IXQ4GU.js";import"./chunk-TZ7MW3NZ.js";import"./chunk-43WATFQS.js";import"./chunk-CAQ3XMFP.js";import"./chunk-UZ4POLDC.js";import"./chunk-O56QUSSI.js";import"./chunk-6Q6SSTBK.js";import"./chunk-YCJYEQF7.js";import"./chunk-AXQQEOTT.js";import"./chunk-UTXZPAY6.js";import"./chunk-IMQUTGIK.js";import"./chunk-F3ETZKLK.js";import"./chunk-IQL3REGJ.js";import"./chunk-E4NQOMJX.js";import"./chunk-YYD2JU6T.js";import"./chunk-6JS7B4FW.js";import"./chunk-VKQQDCUN.js";import"./chunk-DSYNIXJF.js";import"./chunk-NPFPMA4P.js";import"./chunk-O2SMJYPC.js";import"./chunk-N2AU7VKX.js";import"./chunk-ZC23RK4J.js";import"./chunk-OPHQNXYO.js";import"./chunk-TQTOIWBK.js";import"./chunk-7CGTOI24.js";export{a as createEncryptionForm,b as default};
@@ -1 +1 @@
1
- import{d as m}from"./chunk-DSYNIXJF.js";import{F as u,N as d,Qc as s,V as p,_ as l,pa as i}from"./chunk-TQTOIWBK.js";var c=class r{#s=l(m);isLoaded=i(!1);systemInfo=i(null);filterGroups=i(null);backendModules=s(()=>this.systemInfo()?.BackendModules??[]);sourceProviderModules=s(()=>this.systemInfo()?.SourceProviderModules??[]);restoreDestinationProviderModules=s(()=>this.systemInfo()?.RestoreDestinationProviderModules??[]);allOptionsGrouped=s(()=>{let e={displayName:"Default",options:this.systemInfo()?.Options?.map(this.#e)??[]},t=this.systemInfo()?.GenericModules?.map(n=>({displayName:n.DisplayName??n.Key,options:n.Options?.map(this.#e)??[]}))??[],o=this.systemInfo()?.CompressionModules?.map(n=>({displayName:n.DisplayName??n.Key,options:n.Options?.map(this.#e)??[]}))??[],a=this.systemInfo()?.EncryptionModules?.map(n=>({displayName:n.DisplayName??n.Key,options:n.Options?.map(this.#e)??[]}))??[];return[e,...t,...o,...a]});allOptions=s(()=>this.allOptionsGrouped().reduce((e,t)=>[...e,...t.options],[]));hasWebSocket=s(()=>(this.systemInfo()?.APIExtensions??[]).includes("v1:websocket"));hasV2ListOperations=s(()=>{let e=this.systemInfo()?.APIExtensions??[];return e.includes("v2:backup:list-filesets")&&e.includes("v2:backup:list-folder")});hasV2TestOperations=s(()=>(this.systemInfo()?.APIExtensions??[]).includes("v2:destination:test"));hasProgressSubscribeOption=s(()=>(this.systemInfo()?.APIExtensions??[]).includes("v1:subscribe:progress"));hasTaskSubscribeOption=s(()=>(this.systemInfo()?.APIExtensions??[]).includes("v1:subscribe:taskqueue"));hasTaskCompletedOption=s(()=>(this.systemInfo()?.APIExtensions??[]).includes("v1:subscribe:taskcompleted"));hasBackupListSubscribeOption=s(()=>(this.systemInfo()?.APIExtensions??[]).includes("v1:subscribe:backuplist"));hasWebSocketAuth=s(()=>(this.systemInfo()?.APIExtensions??[]).includes("v1:websocket:authenticate"));defaultOAuthUrl=s(()=>{let e=this.systemInfo()?.DefaultOAuthURL??"https://duplicati-oauth-handler.appspot.com/";return e.endsWith("/refresh")?e.slice(0,-8):e});defaultOAuthUrlV2=s(()=>{let e=this.systemInfo()?.DefaultOAuthURLv2??"https://oauth-service.duplicati.com/";return e.endsWith("/refresh")?e.slice(0,-8):e});resolveShorthandPath(e){if(!e.startsWith("%")||!e.endsWith("%"))return e;let t=this.systemInfo()?.SpecialFolders;return t?t.find(a=>a.ID?.startsWith(e))?.Path??e:e}preload(e=!1){let t=this.#s.getApiV1Systeminfo().pipe(d(o=>{this.systemInfo.set(o)}),u(()=>this.isLoaded.set(!0)));if(e)return t;t.subscribe()}preloadFilterGroups(e=!1){let t=this.#s.getApiV1SysteminfoFiltergroups().pipe(d(o=>{this.filterGroups.set(o)}),u(()=>this.isLoaded.set(!0)));if(e)return t;t.subscribe()}#e(e){return{name:e.Name,type:e.Type,shortDescription:e.ShortDescription??void 0,longDescription:e.LongDescription??void 0,deprecatedDescription:e.Deprecated??!1?e.DeprecationMessage??void 0:void 0,options:e.ValidValues,defaultValue:e.DefaultValue}}static \u0275fac=function(t){return new(t||r)};static \u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})};export{c as a};
1
+ import{d as c}from"./chunk-DSYNIXJF.js";import{F as u,N as d,Qc as s,V as p,_ as l,pa as i}from"./chunk-TQTOIWBK.js";var m=class r{#s=l(c);isLoaded=i(!1);systemInfo=i(null);filterGroups=i(null);backendModules=s(()=>this.systemInfo()?.BackendModules??[]);sourceProviderModules=s(()=>this.systemInfo()?.SourceProviderModules??[]);restoreDestinationProviderModules=s(()=>this.systemInfo()?.RestoreDestinationProviderModules??[]);allOptionsGrouped=s(()=>{let e={displayName:"Default",options:this.systemInfo()?.Options?.map(this.#e)??[]},t=this.systemInfo()?.GenericModules?.map(n=>({displayName:n.DisplayName??n.Key,options:n.Options?.map(this.#e)??[]}))??[],o=this.systemInfo()?.CompressionModules?.map(n=>({displayName:n.DisplayName??n.Key,options:n.Options?.map(this.#e)??[]}))??[],a=this.systemInfo()?.EncryptionModules?.map(n=>({displayName:n.DisplayName??n.Key,options:n.Options?.map(this.#e)??[]}))??[];return[e,...t,...o,...a]});allOptions=s(()=>this.allOptionsGrouped().reduce((e,t)=>[...e,...t.options],[]));hasWebSocket=s(()=>(this.systemInfo()?.APIExtensions??[]).includes("v1:websocket"));hasV2ListOperations=s(()=>{let e=this.systemInfo()?.APIExtensions??[];return e.includes("v2:backup:list-filesets")&&e.includes("v2:backup:list-folder")});hasV2TestOperations=s(()=>(this.systemInfo()?.APIExtensions??[]).includes("v2:destination:test"));hasProgressSubscribeOption=s(()=>(this.systemInfo()?.APIExtensions??[]).includes("v1:subscribe:progress"));hasTaskSubscribeOption=s(()=>(this.systemInfo()?.APIExtensions??[]).includes("v1:subscribe:taskqueue"));hasTaskCompletedOption=s(()=>(this.systemInfo()?.APIExtensions??[]).includes("v1:subscribe:taskcompleted"));hasBackupListSubscribeOption=s(()=>(this.systemInfo()?.APIExtensions??[]).includes("v1:subscribe:backuplist"));hasWebSocketAuth=s(()=>(this.systemInfo()?.APIExtensions??[]).includes("v1:websocket:authenticate"));hasWsRemoteControl=s(()=>(this.systemInfo()?.APIExtensions??[]).includes("v1:subscribe:remotecontrol"));hasWsNotifications=s(()=>(this.systemInfo()?.APIExtensions??[]).includes("v1:subscribe:notifications"));defaultOAuthUrl=s(()=>{let e=this.systemInfo()?.DefaultOAuthURL??"https://duplicati-oauth-handler.appspot.com/";return e.endsWith("/refresh")?e.slice(0,-8):e});defaultOAuthUrlV2=s(()=>{let e=this.systemInfo()?.DefaultOAuthURLv2??"https://oauth-service.duplicati.com/";return e.endsWith("/refresh")?e.slice(0,-8):e});resolveShorthandPath(e){if(!e.startsWith("%")||!e.endsWith("%"))return e;let t=this.systemInfo()?.SpecialFolders;return t?t.find(a=>a.ID?.startsWith(e))?.Path??e:e}preload(e=!1){let t=this.#s.getApiV1Systeminfo().pipe(d(o=>{this.systemInfo.set(o)}),u(()=>this.isLoaded.set(!0)));if(e)return t;t.subscribe()}preloadFilterGroups(e=!1){let t=this.#s.getApiV1SysteminfoFiltergroups().pipe(d(o=>{this.filterGroups.set(o)}),u(()=>this.isLoaded.set(!0)));if(e)return t;t.subscribe()}#e(e){return{name:e.Name,type:e.Type,shortDescription:e.ShortDescription??void 0,longDescription:e.LongDescription??void 0,deprecatedDescription:e.Deprecated??!1?e.DeprecationMessage??void 0:void 0,options:e.ValidValues,defaultValue:e.DefaultValue}}static \u0275fac=function(t){return new(t||r)};static \u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})};export{m as a};
package/index.html CHANGED
@@ -124,5 +124,5 @@
124
124
  <body>
125
125
  <app-root></app-root>
126
126
  <div class="loading">Connecting ...</div>
127
- <link rel="modulepreload" href="chunk-23SRH7FI.js"><link rel="modulepreload" href="chunk-EXMYBMGI.js"><link rel="modulepreload" href="chunk-EKVZKEQJ.js"><link rel="modulepreload" href="chunk-RJ2JM7C7.js"><link rel="modulepreload" href="chunk-WOKYULBU.js"><link rel="modulepreload" href="chunk-TCXCC5BM.js"><link rel="modulepreload" href="chunk-GKGMP6VF.js"><link rel="modulepreload" href="chunk-6Q6SSTBK.js"><link rel="modulepreload" href="chunk-YCJYEQF7.js"><link rel="modulepreload" href="chunk-IMQUTGIK.js"><script src="polyfills-7RKI4BGK.js" type="module"></script><script src="main-7J2QXC6H.js" type="module"></script></body>
127
+ <link rel="modulepreload" href="chunk-23SRH7FI.js"><link rel="modulepreload" href="chunk-LE24LKH7.js"><link rel="modulepreload" href="chunk-EKVZKEQJ.js"><link rel="modulepreload" href="chunk-F3JYPWPK.js"><link rel="modulepreload" href="chunk-736PM4LG.js"><link rel="modulepreload" href="chunk-TCXCC5BM.js"><link rel="modulepreload" href="chunk-GKGMP6VF.js"><link rel="modulepreload" href="chunk-6Q6SSTBK.js"><link rel="modulepreload" href="chunk-YCJYEQF7.js"><link rel="modulepreload" href="chunk-IMQUTGIK.js"><script src="polyfills-7RKI4BGK.js" type="module"></script><script src="main-IUT3IXX4.js" type="module"></script></body>
128
128
  </html>
@@ -1 +1 @@
1
- import{b as Ie,c as ke}from"./chunk-23SRH7FI.js";import{a as we}from"./chunk-EXMYBMGI.js";import{a as Ee}from"./chunk-EKVZKEQJ.js";import{b as I}from"./chunk-RJ2JM7C7.js";import"./chunk-WOKYULBU.js";import{a as Me}from"./chunk-TCXCC5BM.js";import{b as Te}from"./chunk-GKGMP6VF.js";import{a as V}from"./chunk-6Q6SSTBK.js";import{a as Se}from"./chunk-YCJYEQF7.js";import"./chunk-IMQUTGIK.js";import"./chunk-ANSV4G2K.js";import"./chunk-AIAUP7OE.js";import{a as H}from"./chunk-C6PICAXB.js";import{a as h,b as ye,c as v,d as Re,e as E}from"./chunk-6JS7B4FW.js";import{u as be,x as Ce}from"./chunk-VKQQDCUN.js";import{a as ge,e as ve}from"./chunk-DSYNIXJF.js";import{c as le,d as me,g as de,h as ue,i as he,j as fe}from"./chunk-NPFPMA4P.js";import{a as ne}from"./chunk-O2SMJYPC.js";import{a as re,b as se,c as ie,e as ae,f as pe,g as ce}from"./chunk-N2AU7VKX.js";import{ha as te,ma as oe}from"./chunk-ZC23RK4J.js";import"./chunk-OPHQNXYO.js";import{A as B,F as J,Fb as Y,L as T,Lc as Z,Mc as ee,N as K,V as C,Y as _,_ as s,f as F,g as W,gb as Q,ha as q,ia as z,l as $,m as G,pa as d,q as w,ra as X,z as P}from"./chunk-TQTOIWBK.js";import"./chunk-7CGTOI24.js";var k=class e{#e=s(h);#d=s(v);ngOnInit(){ye(),this.#d.fetchConfig(),this.#e.clearAllNotCurrentVersion()}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=Q({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(t,n){t&1&&Y(0,"router-outlet")},dependencies:[le],encapsulation:2})};var Ae={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var f=new _("ENVIRONMENT");var A=class e{#e=s(ve);isLoaded=d(!1);webmodules=d(null);preload(o=!1){let t=this.#e.getApiV1Webmodules().pipe(K(n=>this.webmodules.set(n)),J(()=>this.isLoaded.set(!0)));if(o)return t;t.subscribe()}static \u0275fac=function(t){return new(t||e)};static \u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"})};var Ue=()=>{let e=s(E);return e.token()?!0:e.checkProxyAuthed().pipe(T(o=>o?$(!0):e.refreshToken().pipe(w(()=>!0))))},je=()=>{let e=s(v),o=s(I),t=s(q),n=e.relayIsEnabled()?"longpoll":"websocket",i=[t.get(H).preload(!0),t.get(H).preloadFilterGroups(!0),t.get(A).preload(!0)];return e.configLoaded===null?P(i).pipe(w(()=>n)):e.configLoaded?.pipe(T(()=>P(i)))},Fe=()=>!0,Ne={path:"connect/:typeParam",loadComponent:()=>import("./chunk-BZXBH4CN.js")},We=()=>{let e=s(h);return!e.getItem("locale")&&navigator.language&&e.setItem("locale",navigator.language),!0},Oe=[{path:"",children:[{path:"login",canActivate:[],loadComponent:()=>import("./chunk-4E7D5F6K.js")},{path:"logout",loadComponent:()=>import("./chunk-FBU3EBFO.js")},{path:"",canActivate:[Ue],children:[{path:"",canActivate:[je,Fe,We],children:[{path:"welcome",loadComponent:()=>import("./chunk-JPCUISZG.js"),children:[{path:"",redirectTo:"select",pathMatch:"full"},{path:"select",loadComponent:()=>import("./chunk-X276XFCH.js")},Ne]},{path:"",loadComponent:()=>import("./chunk-5RNU5BNO.js"),children:[{path:"",loadComponent:()=>import("./chunk-QOWXL7ZL.js")},Ne,{path:"destinations",loadComponent:()=>import("./chunk-RRDLQLTM.js")},{path:"add-backup",loadComponent:()=>import("./chunk-EDLHTWBA.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-KDV2OE64.js")},{path:"backup/import",loadComponent:()=>import("./chunk-NX35OQ3V.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-EPIYGHPM.js"),loadChildren:()=>import("./chunk-DSZ644JT.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-EPIYGHPM.js"),loadChildren:()=>import("./chunk-DSZ644JT.js")},{path:"backup/:id/log",loadComponent:()=>import("./chunk-ZP3QZ43W.js")},{path:"backup/:id/database",loadComponent:()=>import("./chunk-RLWICOKH.js")},{path:"backup/:id/commandline",loadComponent:()=>import("./chunk-UCHK3SHH.js")},{path:"backup/:id/commandline/:runId",loadComponent:()=>import("./chunk-ZYRB2TUK.js")},{path:"backup/:id/delete",loadComponent:()=>import("./chunk-2J2554EV.js")},{path:"restore",children:[{path:"",loadComponent:()=>import("./chunk-PXI3UZ4R.js")},{path:"from-config",loadComponent:()=>import("./chunk-IG7XUEED.js")}]},{path:"restore-from-files",loadComponent:()=>import("./chunk-GN7AO4B6.js"),loadChildren:()=>import("./chunk-N3NJW75G.js")},{path:"restore-draft/:id",loadComponent:()=>import("./chunk-GN7AO4B6.js"),loadChildren:()=>import("./chunk-N3NJW75G.js")},{path:"restore/:id",loadComponent:()=>import("./chunk-GN7AO4B6.js"),loadChildren:()=>import("./chunk-N3NJW75G.js")},{path:"status",loadComponent:()=>import("./chunk-4OJPTRZJ.js")},{path:"settings",loadComponent:()=>import("./chunk-NKUA7I47.js")},{path:"about",loadComponent:()=>import("./chunk-22AR7ES3.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-P4R3ERID.js")},{path:"changelog",loadComponent:()=>import("./chunk-FD5CKX3J.js")},{path:"libraries",loadComponent:()=>import("./chunk-ACTJSKQZ.js")},{path:"system-info",loadComponent:()=>import("./chunk-37ODVJFS.js")},{path:"server-settings",loadComponent:()=>import("./chunk-NHS6CQO2.js")},{path:"logs",loadChildren:()=>import("./chunk-YWBZLU6M.js")},{path:"crashlogs",loadComponent:()=>import("./chunk-BKEJZADV.js")}]}]}]}]}]}];var xe=(e,o)=>{let t=s(E),n=s(me),i=s(h),p=s(f),m=i.getItem("locale"),a=s(Ce),g=Ie(m),r=ge.BASE||"",c=e.url===`${r}/api/v1/auth/login`,u=e.url===`${r}/api/v1/auth/logout`,S=e.url===`${r}/api/v1/auth/refresh`,y=e.url===`${r}/api/v1/progressstate`,x=e.url===`${r}/api/v1/remoteoperation/test`,M=e.url===`${r}/api/v1/filesystem/validate`,De=e.url.startsWith(`${r}/api/v2/`),L=t.token(),U=e,j=e.headers.has("custom-proxy-check")||L===Re;if(L&&e.url.startsWith(r+p.baseUrl)&&!j){let l=e.headers.set("Authorization",`Bearer ${L}`);m&&m!=="en-US"&&(l=l.set("X-Ui-Language",g)),U=e.clone({headers:l})}return o(U).pipe(w(l=>{if(l.type===4&&l.status===200&&De){let b=l.body;if(b?.Success===!1)throw{status:200,message:b?.Error??"Unknown error",error:{Error:b?.Error??"Unknown error"},requestBody:b}}return l}),B(l=>{let b=l.error?.Error||`Error Code: ${l.status}, Message: ${l.message}`;if(!j){let R=!0;if((y&&l.status===404||x||M)&&(R=!1),S&&l.status===401&&(R=!1,t.logout(),n.navigate(["/logout"])),!c&&!S&&!u&&l.status===401)return R=!1,t.refreshToken().pipe(T(()=>o(e.clone({headers:e.headers.set("Authorization",`Bearer ${t.token()}`)}))));R&&a.error(b)}return G(()=>({error:l,message:b}))}))};var N=class e{#e=s(z);showError(o){let t=this.#e.querySelector("body > .loading");if(!t)return;t.classList.add("has-error"),t.innerHTML="";let n=this.#e.createElement("div");n.classList.add("loading-title"),n.textContent="Unable to connect";let i=this.#e.createElement("div");i.classList.add("loading-error"),i.textContent=o||"Unknown error";let p=this.#e.createElement("button");p.type="button",p.classList.add("retry-button"),p.textContent="Retry",p.addEventListener("click",()=>{this.#e.defaultView?.location.reload()}),t.append(n,i,p)}static \u0275fac=function(t){return new(t||e)};static \u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"})};var $e="1.0.0",Le=`portal-proxy-client-${V()}`,Ge=1,O=class e{#e=1e3;#d=s(f);#u=s(N);#o=d("disconnected");#h=d(this.#e);#a=d(!1);#n=d(!1);#p=d(null);#c=d(null);#s=!1;isConnectedToMachineServer=this.#n.asReadonly();wsState=this.#o.asReadonly();#l=[];#r={};#t=null;#f=new TextDecoder("utf-8");#m=null;#y=X(()=>{let o=this.#a(),t=this.#h(),n=this.#p(),i=this.#c();if(!n||!i||!o||!t||t<this.#e){this.#m&&window.clearInterval(this.#m);return}this.#m=window.setInterval(()=>{this.connectToMachineServer(n,i)},t)});#i(o){this.#s||(this.#s=!0,this.#u.showError(o||"Unable to connect to the server."))}#g(){this.#s||(this.#s=!0)}utf8Atob(o){let t=Uint8Array.from(atob(o),i=>i.charCodeAt(0)),n=this.#f.decode(t);return n?JSON.parse(n):null}connectToMachineServer(o,t,n){let i=n?.reconnect??!1,p=this.wsState();(p==="disconnected"||p==="error"||i)&&(this.#t?.close(),this.#t=null),!this.#t&&(this.#s=!1,this.#t=new WebSocket(t),this.#o.set("connecting"),this.#t.onopen=()=>{this.#o.set("connect"),this.#n.set(!0),this.#a.set(!1),this.#p.set(null),this.#c.set(null)},this.#t.onclose=()=>{this.#o.set("disconnected"),this.#n.set(!1),this.#p.set(o),this.#c.set(t),this.#a.set(!0)},this.#t.onerror=()=>{this.#o.set("error")},this.#t.onmessage=m=>{let a=JSON.parse(m.data);if(this.wsState()==="connect"){if(a.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${a.type}'`);return}let r={token:o,publicKey:"",clientVersion:$e,protocolVersion:Ge},c=this.createResponse(a,"authportal",r);this.#o.set("welcome"),this.#t?.send(c)}else if(this.wsState()==="welcome"){if(a.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${a.type}'`);return}var g=JSON.parse(a.payload??"");if(g.accepted===!1){this.#i("Authentication failed"),this.disconnectFromMachineServer("Authentication failed");return}for(this.#o.set("authenticated"),this.#n.set(!0);this.#l.length>0;){let r=this.#l.pop();r&&this.#r[r.messageId]&&this.activateCommand(r)}}else if(this.wsState()==="authenticated"){if(a.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${a.type}'`);return}let r=this.#r[a.messageId];if(r){if(a.errorMessage)this.#i(a.errorMessage),r.reject(a.errorMessage);else{let c=JSON.parse(a.payload??"");c.statusCode>=400?this.#i(c.body||`Initial request failed with status code ${c.statusCode}`):this.#g(),c.body=c?.body==null?null:this.utf8Atob(c.body),r.resolve(c)}delete this.#r[a.messageId],window.clearTimeout(r.timer)}}})}disconnectFromMachineServer(o=null){o&&console.error(o),this.#t?.close(),this.#t=null,this.#o.set("disconnected"),this.#n.set(!1)}createResponse(o,t,n){let i={from:Le,to:o.from,type:t,messageId:o.messageId,payload:JSON.stringify(n)};return JSON.stringify(i)}sendCommand(o,t,n,i,p,m,a,g=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(o,n),new Promise((r,c)=>{let u=V(),y={from:Le,to:t,type:"command",messageId:u,payload:JSON.stringify({method:i,path:p,body:m,headers:a})},x={resolve:r,reject:c,timer:window.setTimeout(()=>{let M=this.#r[u];M&&(delete this.#r[u],this.#i("The request timed out before receiving a response."),M.reject("Timeout"))},g)};this.#r[u]=x,this.#n()?this.activateCommand(y):this.#l.push(y)})}activateCommand(o){this.#t?.send(JSON.stringify(o))}static \u0275fac=function(t){return new(t||e)};static \u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"})};function Be(e){if(typeof e!="string")return null;let t=new TextEncoder().encode(e);return window.btoa(String.fromCharCode(...t))}function Pe(e,o,t){let n=e.relayconfigState.config();if(n===null)return t(o);let i=Be(o.body),p={};o.headers.keys().forEach(r=>{p[r]=o.headers.get(r)??""});let m=o.headers.get("timeout"),a=m!==null?parseInt(m):e.defaultTimeout;o.url.startsWith("/api/v1/serverstate")&&o.url.includes("longpoll=true")&&(a=1e3*99);let g=e.relayWebsocket.sendCommand(n.accessToken,n.clientId,n.machineServerUrl,o.method,o.url,i,p,a);return new F(r=>{g.then(c=>{let u=new re;p!=null&&Object.keys(p).forEach(y=>{u.set(y,p[y])});let S=new se({body:c.body,status:c.statusCode,statusText:"OK",headers:u});r.next(S),r.complete()}).catch(c=>{r.error(new ie({error:c??"Unknown error",status:0,statusText:c??"Unknown error"}))})})}var He=(e,o)=>{let t={relayconfigState:s(v),defaultTimeout:s(f).defaultTimeout,relayWebsocket:s(O)},n=t.relayconfigState.config();if(t.relayconfigState.configLoaded!==null&&n===null){let i=new W;return t.relayconfigState.configLoaded.subscribe(p=>{p&&Pe(t,e,o).subscribe(i)}),i}return Pe(t,e,o)};var Ve={providers:[Z(),ue(Oe,fe(),he(de)),ae(ce(),pe([He,xe])),h,{provide:f,useValue:Ae},{provide:ee,useValue:ke()},{provide:be,useValue:{alertVariant:"simple"}},we,I,Te,oe,Se,te,Me,Ee]};ne(k,Ve);
1
+ import{b as Ie,c as ke}from"./chunk-23SRH7FI.js";import{a as we}from"./chunk-LE24LKH7.js";import{a as Ee}from"./chunk-EKVZKEQJ.js";import{b as I}from"./chunk-F3JYPWPK.js";import"./chunk-736PM4LG.js";import{a as Me}from"./chunk-TCXCC5BM.js";import{b as Te}from"./chunk-GKGMP6VF.js";import{a as V}from"./chunk-6Q6SSTBK.js";import{a as Se}from"./chunk-YCJYEQF7.js";import"./chunk-IMQUTGIK.js";import"./chunk-ANSV4G2K.js";import"./chunk-E4NQOMJX.js";import{a as H}from"./chunk-YYD2JU6T.js";import{a as h,b as ye,c as v,d as Re,e as E}from"./chunk-6JS7B4FW.js";import{u as be,x as Ce}from"./chunk-VKQQDCUN.js";import{a as ge,e as ve}from"./chunk-DSYNIXJF.js";import{c as le,d as me,g as de,h as ue,i as he,j as fe}from"./chunk-NPFPMA4P.js";import{a as ne}from"./chunk-O2SMJYPC.js";import{a as re,b as se,c as ie,e as ae,f as pe,g as ce}from"./chunk-N2AU7VKX.js";import{ha as te,ma as oe}from"./chunk-ZC23RK4J.js";import"./chunk-OPHQNXYO.js";import{A as B,F as J,Fb as Y,L as T,Lc as Z,Mc as ee,N as K,V as C,Y as _,_ as s,f as F,g as W,gb as Q,ha as q,ia as z,l as $,m as G,pa as d,q as w,ra as X,z as P}from"./chunk-TQTOIWBK.js";import"./chunk-7CGTOI24.js";var k=class e{#e=s(h);#d=s(v);ngOnInit(){ye(),this.#d.fetchConfig(),this.#e.clearAllNotCurrentVersion()}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=Q({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(t,n){t&1&&Y(0,"router-outlet")},dependencies:[le],encapsulation:2})};var Ae={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var f=new _("ENVIRONMENT");var A=class e{#e=s(ve);isLoaded=d(!1);webmodules=d(null);preload(o=!1){let t=this.#e.getApiV1Webmodules().pipe(K(n=>this.webmodules.set(n)),J(()=>this.isLoaded.set(!0)));if(o)return t;t.subscribe()}static \u0275fac=function(t){return new(t||e)};static \u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"})};var Ue=()=>{let e=s(E);return e.token()?!0:e.checkProxyAuthed().pipe(T(o=>o?$(!0):e.refreshToken().pipe(w(()=>!0))))},je=()=>{let e=s(v),o=s(I),t=s(q),n=e.relayIsEnabled()?"longpoll":"websocket",i=[t.get(H).preload(!0),t.get(H).preloadFilterGroups(!0),t.get(A).preload(!0)];return e.configLoaded===null?P(i).pipe(w(()=>n)):e.configLoaded?.pipe(T(()=>P(i)))},Fe=()=>!0,Ne={path:"connect/:typeParam",loadComponent:()=>import("./chunk-OJVUCHRP.js")},We=()=>{let e=s(h);return!e.getItem("locale")&&navigator.language&&e.setItem("locale",navigator.language),!0},Oe=[{path:"",children:[{path:"login",canActivate:[],loadComponent:()=>import("./chunk-4E7D5F6K.js")},{path:"logout",loadComponent:()=>import("./chunk-FBU3EBFO.js")},{path:"",canActivate:[Ue],children:[{path:"",canActivate:[je,Fe,We],children:[{path:"welcome",loadComponent:()=>import("./chunk-JPCUISZG.js"),children:[{path:"",redirectTo:"select",pathMatch:"full"},{path:"select",loadComponent:()=>import("./chunk-MTL3FBSM.js")},Ne]},{path:"",loadComponent:()=>import("./chunk-YMFI2Q2X.js"),children:[{path:"",loadComponent:()=>import("./chunk-APSPCDGV.js")},Ne,{path:"destinations",loadComponent:()=>import("./chunk-OCUE5GMT.js")},{path:"add-backup",loadComponent:()=>import("./chunk-JPMKWWZP.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-WJBMMY2Y.js")},{path:"backup/import",loadComponent:()=>import("./chunk-XBAZKJ47.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-XPVATEBM.js"),loadChildren:()=>import("./chunk-5YE4H57F.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-XPVATEBM.js"),loadChildren:()=>import("./chunk-5YE4H57F.js")},{path:"backup/:id/log",loadComponent:()=>import("./chunk-JSZIISFS.js")},{path:"backup/:id/database",loadComponent:()=>import("./chunk-CZVTBPNE.js")},{path:"backup/:id/commandline",loadComponent:()=>import("./chunk-PPSQGUOL.js")},{path:"backup/:id/commandline/:runId",loadComponent:()=>import("./chunk-RDLRXAJU.js")},{path:"backup/:id/delete",loadComponent:()=>import("./chunk-GW34KK5A.js")},{path:"restore",children:[{path:"",loadComponent:()=>import("./chunk-FR5RTIOE.js")},{path:"from-config",loadComponent:()=>import("./chunk-IG7XUEED.js")}]},{path:"restore-from-files",loadComponent:()=>import("./chunk-DE4JIJWO.js"),loadChildren:()=>import("./chunk-5JGSXUKD.js")},{path:"restore-draft/:id",loadComponent:()=>import("./chunk-DE4JIJWO.js"),loadChildren:()=>import("./chunk-5JGSXUKD.js")},{path:"restore/:id",loadComponent:()=>import("./chunk-DE4JIJWO.js"),loadChildren:()=>import("./chunk-5JGSXUKD.js")},{path:"status",loadComponent:()=>import("./chunk-FDYBIC4O.js")},{path:"settings",loadComponent:()=>import("./chunk-G2BDKU26.js")},{path:"about",loadComponent:()=>import("./chunk-I5DD3Q6J.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-OLWLWDXZ.js")},{path:"changelog",loadComponent:()=>import("./chunk-FD5CKX3J.js")},{path:"libraries",loadComponent:()=>import("./chunk-ACTJSKQZ.js")},{path:"system-info",loadComponent:()=>import("./chunk-N2GI5QYJ.js")},{path:"server-settings",loadComponent:()=>import("./chunk-JP2Z2HMH.js")},{path:"logs",loadChildren:()=>import("./chunk-YWBZLU6M.js")},{path:"crashlogs",loadComponent:()=>import("./chunk-BKEJZADV.js")}]}]}]}]}]}];var xe=(e,o)=>{let t=s(E),n=s(me),i=s(h),p=s(f),m=i.getItem("locale"),a=s(Ce),g=Ie(m),r=ge.BASE||"",c=e.url===`${r}/api/v1/auth/login`,u=e.url===`${r}/api/v1/auth/logout`,S=e.url===`${r}/api/v1/auth/refresh`,y=e.url===`${r}/api/v1/progressstate`,x=e.url===`${r}/api/v1/remoteoperation/test`,M=e.url===`${r}/api/v1/filesystem/validate`,De=e.url.startsWith(`${r}/api/v2/`),L=t.token(),U=e,j=e.headers.has("custom-proxy-check")||L===Re;if(L&&e.url.startsWith(r+p.baseUrl)&&!j){let l=e.headers.set("Authorization",`Bearer ${L}`);m&&m!=="en-US"&&(l=l.set("X-Ui-Language",g)),U=e.clone({headers:l})}return o(U).pipe(w(l=>{if(l.type===4&&l.status===200&&De){let b=l.body;if(b?.Success===!1)throw{status:200,message:b?.Error??"Unknown error",error:{Error:b?.Error??"Unknown error"},requestBody:b}}return l}),B(l=>{let b=l.error?.Error||`Error Code: ${l.status}, Message: ${l.message}`;if(!j){let R=!0;if((y&&l.status===404||x||M)&&(R=!1),S&&l.status===401&&(R=!1,t.logout(),n.navigate(["/logout"])),!c&&!S&&!u&&l.status===401)return R=!1,t.refreshToken().pipe(T(()=>o(e.clone({headers:e.headers.set("Authorization",`Bearer ${t.token()}`)}))));R&&a.error(b)}return G(()=>({error:l,message:b}))}))};var N=class e{#e=s(z);showError(o){let t=this.#e.querySelector("body > .loading");if(!t)return;t.classList.add("has-error"),t.innerHTML="";let n=this.#e.createElement("div");n.classList.add("loading-title"),n.textContent="Unable to connect";let i=this.#e.createElement("div");i.classList.add("loading-error"),i.textContent=o||"Unknown error";let p=this.#e.createElement("button");p.type="button",p.classList.add("retry-button"),p.textContent="Retry",p.addEventListener("click",()=>{this.#e.defaultView?.location.reload()}),t.append(n,i,p)}static \u0275fac=function(t){return new(t||e)};static \u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"})};var $e="1.0.0",Le=`portal-proxy-client-${V()}`,Ge=1,O=class e{#e=1e3;#d=s(f);#u=s(N);#o=d("disconnected");#h=d(this.#e);#a=d(!1);#n=d(!1);#p=d(null);#c=d(null);#s=!1;isConnectedToMachineServer=this.#n.asReadonly();wsState=this.#o.asReadonly();#l=[];#r={};#t=null;#f=new TextDecoder("utf-8");#m=null;#y=X(()=>{let o=this.#a(),t=this.#h(),n=this.#p(),i=this.#c();if(!n||!i||!o||!t||t<this.#e){this.#m&&window.clearInterval(this.#m);return}this.#m=window.setInterval(()=>{this.connectToMachineServer(n,i)},t)});#i(o){this.#s||(this.#s=!0,this.#u.showError(o||"Unable to connect to the server."))}#g(){this.#s||(this.#s=!0)}utf8Atob(o){let t=Uint8Array.from(atob(o),i=>i.charCodeAt(0)),n=this.#f.decode(t);return n?JSON.parse(n):null}connectToMachineServer(o,t,n){let i=n?.reconnect??!1,p=this.wsState();(p==="disconnected"||p==="error"||i)&&(this.#t?.close(),this.#t=null),!this.#t&&(this.#s=!1,this.#t=new WebSocket(t),this.#o.set("connecting"),this.#t.onopen=()=>{this.#o.set("connect"),this.#n.set(!0),this.#a.set(!1),this.#p.set(null),this.#c.set(null)},this.#t.onclose=()=>{this.#o.set("disconnected"),this.#n.set(!1),this.#p.set(o),this.#c.set(t),this.#a.set(!0)},this.#t.onerror=()=>{this.#o.set("error")},this.#t.onmessage=m=>{let a=JSON.parse(m.data);if(this.wsState()==="connect"){if(a.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${a.type}'`);return}let r={token:o,publicKey:"",clientVersion:$e,protocolVersion:Ge},c=this.createResponse(a,"authportal",r);this.#o.set("welcome"),this.#t?.send(c)}else if(this.wsState()==="welcome"){if(a.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${a.type}'`);return}var g=JSON.parse(a.payload??"");if(g.accepted===!1){this.#i("Authentication failed"),this.disconnectFromMachineServer("Authentication failed");return}for(this.#o.set("authenticated"),this.#n.set(!0);this.#l.length>0;){let r=this.#l.pop();r&&this.#r[r.messageId]&&this.activateCommand(r)}}else if(this.wsState()==="authenticated"){if(a.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${a.type}'`);return}let r=this.#r[a.messageId];if(r){if(a.errorMessage)this.#i(a.errorMessage),r.reject(a.errorMessage);else{let c=JSON.parse(a.payload??"");c.statusCode>=400?this.#i(c.body||`Initial request failed with status code ${c.statusCode}`):this.#g(),c.body=c?.body==null?null:this.utf8Atob(c.body),r.resolve(c)}delete this.#r[a.messageId],window.clearTimeout(r.timer)}}})}disconnectFromMachineServer(o=null){o&&console.error(o),this.#t?.close(),this.#t=null,this.#o.set("disconnected"),this.#n.set(!1)}createResponse(o,t,n){let i={from:Le,to:o.from,type:t,messageId:o.messageId,payload:JSON.stringify(n)};return JSON.stringify(i)}sendCommand(o,t,n,i,p,m,a,g=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(o,n),new Promise((r,c)=>{let u=V(),y={from:Le,to:t,type:"command",messageId:u,payload:JSON.stringify({method:i,path:p,body:m,headers:a})},x={resolve:r,reject:c,timer:window.setTimeout(()=>{let M=this.#r[u];M&&(delete this.#r[u],this.#i("The request timed out before receiving a response."),M.reject("Timeout"))},g)};this.#r[u]=x,this.#n()?this.activateCommand(y):this.#l.push(y)})}activateCommand(o){this.#t?.send(JSON.stringify(o))}static \u0275fac=function(t){return new(t||e)};static \u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"})};function Be(e){if(typeof e!="string")return null;let t=new TextEncoder().encode(e);return window.btoa(String.fromCharCode(...t))}function Pe(e,o,t){let n=e.relayconfigState.config();if(n===null)return t(o);let i=Be(o.body),p={};o.headers.keys().forEach(r=>{p[r]=o.headers.get(r)??""});let m=o.headers.get("timeout"),a=m!==null?parseInt(m):e.defaultTimeout;o.url.startsWith("/api/v1/serverstate")&&o.url.includes("longpoll=true")&&(a=1e3*99);let g=e.relayWebsocket.sendCommand(n.accessToken,n.clientId,n.machineServerUrl,o.method,o.url,i,p,a);return new F(r=>{g.then(c=>{let u=new re;p!=null&&Object.keys(p).forEach(y=>{u.set(y,p[y])});let S=new se({body:c.body,status:c.statusCode,statusText:"OK",headers:u});r.next(S),r.complete()}).catch(c=>{r.error(new ie({error:c??"Unknown error",status:0,statusText:c??"Unknown error"}))})})}var He=(e,o)=>{let t={relayconfigState:s(v),defaultTimeout:s(f).defaultTimeout,relayWebsocket:s(O)},n=t.relayconfigState.config();if(t.relayconfigState.configLoaded!==null&&n===null){let i=new W;return t.relayconfigState.configLoaded.subscribe(p=>{p&&Pe(t,e,o).subscribe(i)}),i}return Pe(t,e,o)};var Ve={providers:[Z(),ue(Oe,fe(),he(de)),ae(ce(),pe([He,xe])),h,{provide:f,useValue:Ae},{provide:ee,useValue:ke()},{provide:be,useValue:{alertVariant:"simple"}},we,I,Te,oe,Se,te,Me,Ee]};ne(k,Ve);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duplicati/ngclient",
3
- "version": "0.0.220",
3
+ "version": "0.0.221",
4
4
  "license": "MIT",
5
5
  "contributors": [
6
6
  "sp90",
package/chunk-4OA2FFS5.js DELETED
@@ -1 +0,0 @@
1
- import{g as a,h as b,i as c,j as d}from"./chunk-DJXLNIMV.js";import"./chunk-CAQ3XMFP.js";import"./chunk-VC55KFAX.js";import"./chunk-ZEFSBETQ.js";import"./chunk-6Q6SSTBK.js";import"./chunk-YCJYEQF7.js";import"./chunk-OHYENIPP.js";import"./chunk-UTXZPAY6.js";import"./chunk-IMQUTGIK.js";import"./chunk-BACKG7KA.js";import"./chunk-IQL3REGJ.js";import"./chunk-AIAUP7OE.js";import"./chunk-C6PICAXB.js";import"./chunk-6JS7B4FW.js";import"./chunk-VKQQDCUN.js";import"./chunk-DSYNIXJF.js";import"./chunk-NPFPMA4P.js";import"./chunk-O2SMJYPC.js";import"./chunk-N2AU7VKX.js";import"./chunk-ZC23RK4J.js";import"./chunk-OPHQNXYO.js";import"./chunk-TQTOIWBK.js";import"./chunk-7CGTOI24.js";export{a as SCHEDULE_DEFAULT_OPTIONS,c as SCHEDULE_FIELD_DEFAULTS,d as default,b as scheduleOptionToSchedule};
package/chunk-AIAUP7OE.js DELETED
@@ -1 +0,0 @@
1
- import{a as D}from"./chunk-C6PICAXB.js";import{c as j,e as q}from"./chunk-6JS7B4FW.js";import{z as b}from"./chunk-VKQQDCUN.js";import{a as x,d as v}from"./chunk-DSYNIXJF.js";import{ma as L}from"./chunk-ZC23RK4J.js";import{Fc as G,Gb as N,Hb as C,Hc as $,Ib as _,M as O,Qc as p,Sa as M,Tb as A,Ub as w,V as h,Vb as P,Wb as F,Xb as W,_ as c,f as m,g as y,gb as I,pa as n,ra as R}from"./chunk-TQTOIWBK.js";var S=class r{reconnectTimer=n(15e3);countdown=n(0);connectTimerEffect=R(()=>{let e=this.reconnectTimer();this.countdown.set(e/1e3)});interval=setInterval(()=>{if(this.countdown()<=1){this.countdown.set(this.reconnectTimer()/1e3);return}this.countdown.set(this.countdown()-1)},1e3);ngOnDestroy(){clearInterval(this.interval)}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=I({type:r,selectors:[["app-disconnected-dialog"]],decls:8,vars:4,consts:()=>{let e;e=$localize`Reconnecting...`;let t;return t=$localize` The connection to the server is lost, attempting again in ${"\uFFFD#6\uFFFD"}:START_TAG_STRONG:0:${"\uFFFD0\uFFFD"}:INTERPOLATION:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_STRONG:`,[e,t,["header",""],["content",""]]},template:function(t,s){t&1&&(N(0,"header",2)(1,"h3"),P(2,0),C()(),N(3,"div",3)(4,"p"),A(5,1),_(6,"strong"),G(7,"number"),w(),C()()),t&2&&(M(7),F($(7,1,s.countdown(),"2.0-0")),W(5))},dependencies:[L],styles:["[_nghost-%COMP%]{display:block;padding:1rem}"],changeDetection:0})};var T=class r{dialog=c(b);#e=c(v);#i=n("disconnected");#s=n(null);#t=n(-1);#r=n(0);#l=n(!1);#u=new y;connectionStatus=this.#i.asReadonly();serverState=this.#s.asReadonly();#o=void 0;duration=c(j).relayIsEnabled()?"94s":"299s";start(){this.#l.set(!0),this.#u=new y,this.#c()}stop(){this.#u.next(),this.#u.complete(),this.#l.set(!1)}reconnect(){this.stop(),this.start()}reconnectIfNeeded(){this.#l()||this.reconnect()}#c(){this.#i.set("connecting"),this.#e.getApiV1Serverstate({lastEventId:this.#t(),longpoll:this.#t()>=0,duration:this.duration}).pipe(O(this.#u)).subscribe({next:e=>{e&&this.#a(e),this.#n()},error:e=>{let s=this.#r()+1,l=Math.min(5e3*s,3e4);this.#r.set(s),s>3&&this.#i.set("disconnected"),this.#o||(this.#o=this.dialog.open(S,{closeOnButton:!1,closeOnEsc:!1,closeOnOutsideClick:!1})),this.#o.component.reconnectTimer.set(l),setTimeout(()=>{this.#c()},l)}})}#a(e){this.#i.set("connected"),this.#s.set(e),this.#t.set(e.LastEventID??-1),this.#r.set(0)}#n(){this.#l()&&this.#c()}static \u0275fac=function(t){return new(t||r)};static \u0275prov=h({token:r,factory:r.\u0275fac,providedIn:"root"})};var u=!1,k=class r{#e=c(q);#i=c(D);dialog=c(b);#s=null;#t=n("disconnected");#r=n(null);#l=n(null);#u=n(null);#o=n(null);#c=n(null);#a=void 0;#n=n({legacystatus:!0});shouldConnect=n(!0);connectionStatus=this.#t.asReadonly();serverState=this.#r.asReadonly();serverProgress=this.#l.asReadonly();serverSettings=this.#u.asReadonly();subscriptions=this.#n.asReadonly();serverTaskQueue=this.#o.asReadonly();backupListState=this.#c.asReadonly();#p=null;taskCompleted=new m(e=>{this.#p=e});#h=0;#d=null;start(){this.shouldConnect.set(!0),this.#g()}#g(){this.#d&&(clearTimeout(this.#d),this.#d=null);let e=this.#e.token();if(!e){console.error("No access token available");return}let t=window.location.protocol==="https:"?"wss:":"ws:",s=window.location.port?`:${window.location.port}`:"";window.location.port==="4200"&&(s=":8200");let l=window.location.hostname,g=x.BASE||"",f=this.#e.xsrfQueryParam(),Q=this.#i.hasWebSocketAuth()?`${t}//${l}${s}${g}/notifications${f?`?${f}`:""}`:`${t}//${l}${s}${g}/notifications?token=${e}${f?`&${f}`:""}`;this.#t.set("connecting"),this.#s=new WebSocket(Q),this.#s.onopen=()=>{u&&console.log("WebSocket connection established"),this.#i.hasWebSocketAuth()?(this.#t.set("authenticating"),this.#s?.send(JSON.stringify({Version:1,Token:e,Action:"auth"}))):this.#S()},this.#s.onmessage=d=>{if(this.#t()==="authenticating")try{let o=JSON.parse(d.data);if(o.Success){u&&console.log("WebSocket authentication successful"),this.#S();return}else if(o?.Type==="legacystatus")u&&console.log("WebSocket authentication successful"),this.#S();else{console.error("WebSocket authentication failed:",o.Message),this.#t.set("disconnected"),this.#e.refreshToken().subscribe({next:()=>{this.reconnect()},error:i=>{console.error("Error refreshing token after WebSocket auth failed",i)}});return}}catch(o){console.error("Error parsing WebSocket authentication reply",o),this.#t.set("disconnected");return}try{let o=JSON.parse(d.data),a=o?.Type;if(a==="legacystatus"||a==null)u&&console.log("Received legacy status update:",o),this.#r.set(o);else if(a==="reply"){let i=o;i.Success||console.error("WebSocket reply error:",i.Message)}else if(a==="progress"){let i=o;u&&console.log("Received progress update:",i.Data),this.#l.set(i.Data)}else if(a==="serversettings"){let i=o;u&&console.log("Received server settings update:",i.Data),this.#u.set(i.Data)}else if(a==="taskqueue"){let i=o;u&&console.log("Received task update:",i.Data),this.#o.set(i.Data)}else if(a==="taskcompleted"){let i=o;u&&console.log("Received task completed:",i.Data),this.#p?.next(i.Data)}else if(a==="backuplist"){let i=o;u&&console.log("Received backup list update:",i.Data),this.#c.set(i.Data)}else console.warn("Unknown WebSocket message type:",a)}catch(o){console.error("Error parsing WebSocket message",o)}},this.#s.onclose=d=>{u&&console.log("WebSocket connection closed",d),this.#t.set("disconnected");var o=d.code===4401;o&&this.#e.refreshToken().subscribe({next:()=>{this.reconnect()},error:a=>{console.error("Error refreshing token",a)}}),this.shouldConnect()&&(this.#a||(this.#a=this.dialog.open(S,{closeOnButton:!1,closeOnEsc:!1,closeOnOutsideClick:!1}),this.#a.component.reconnectTimer.set(15e3)),this.#d&&clearTimeout(this.#d),this.#d=setTimeout(()=>this.#g(),5e3))},this.#s.onerror=d=>{console.error("WebSocket error",d),this.#t.set("disconnected")}}#S(){this.#t.set("connected");let e=this.#n();Object.keys(e).length>0&&Object.entries(e).forEach(([t,s])=>{s!=null&&this.sendSubscribeRequest(t,s)}),this.#a&&this.#a.close()}stop(){this.shouldConnect.set(!1),this.#s?.close()}reconnect(){this.#s?.close(),this.start()}reconnectIfNeeded(){this.#s?.readyState!==WebSocket.OPEN&&this.reconnect()}sendSubscribeRequest(e,t){this.#s?.send(JSON.stringify({Version:1,Id:`req-${++this.#h}`,Action:"sub",Service:e,Data:t||null}))}subscribe(e,t=void 0){let s=this.#n(),l=s[e];(!l||JSON.stringify(l)!==JSON.stringify(t||!0))&&(s[e]=t||!0,this.#n.set(s),this.#t()=="connected"&&this.sendSubscribeRequest(e,t))}unsubscribe(e){let t=this.#n();t[e]&&(delete t[e],this.#n.set(t),this.#t()=="connected"&&this.#s?.send(JSON.stringify({Version:1,Id:`req-${++this.#h}`,Action:"unsub",Service:e})))}static \u0275fac=function(t){return new(t||r)};static \u0275prov=h({token:r,factory:r.\u0275fac,providedIn:"root"})};var V=10,J=class r{#e=c(k);#i=c(T);#s=c(v);#t=c(D);#r=n("longpoll");#l=n(!1);#u=p(()=>this.#t.hasTaskCompletedOption()&&this.#r()==="websocket");#o={};#c=null;#a=!1;#n=[];constructor(){this.#e.subscribe("taskcompleted"),this.#e.taskCompleted.subscribe(e=>{if(this.#n.unshift(e),this.#n.length>V&&this.#n.pop(),!e.ID)return;let t=this.#o[e.ID];t&&(t.forEach(s=>{s.next(e),s.complete()}),delete this.#o[e.ID])})}connectionStatus=p(()=>this.#r()==="websocket"?this.#e.connectionStatus():this.#i.connectionStatus());isConnectionMethodSet=this.#l.asReadonly();serverState=p(()=>this.#r()==="websocket"?this.#e.serverState():this.#i.serverState());progressState=this.#e.serverProgress;taskQueueState=this.#e.serverTaskQueue;activeTaskQueueState=p(()=>this.#r()==="websocket"?this.#e.serverTaskQueue()?.map(t=>t.ID).filter(t=>t)??[]:(this.#i.serverState()?.SchedulerQueueIds??[]).map(t=>t.Item1).filter(t=>t));backupListState=p(()=>this.#e.backupListState());setConnectionMethod(e){e==="websocket"?(this.#e.reconnectIfNeeded(),this.#i.stop()):(this.#i.reconnectIfNeeded(),this.#e.stop()),this.#r.set(e),this.#l.set(!0)}getConnectionMethod(){return this.#r()}subscribe(e,t=null){this.#e.subscribe(e,t)}unsubscribe(e){this.#e.unsubscribe(e)}waitForTaskToComplete(e){return new m(t=>{let s=this.#n.find(l=>l.ID===e);if(s){t.next(s),t.complete();return}this.#o[e]=this.#o[e]||[],this.#o[e].push(t),this.#p()})}#p(){this.#a||this.#u()||(this.#a=!0,this.#h())}#h(){let e=Object.keys(this.#o).map(s=>parseInt(s,10));if(e.length===0){this.#d();return}let t=Math.min(...e);this.#s.getApiV1TaskByTaskid({taskid:t}).subscribe({next:s=>{s.TaskFinished!=null&&(this.#n.unshift(s),this.#n.length>V&&this.#n.pop(),this.#o[t].forEach(g=>{g.next(s),g.complete()}),delete this.#o[t])},complete:()=>{this.#c=window.setTimeout(()=>{this.#h()},1e3)},error:s=>{this.#c=window.setTimeout(()=>{this.#h()},3e3)}})}#d(){this.#c!==null&&(clearTimeout(this.#c),this.#c=null),this.#a=!1}static \u0275fac=function(t){return new(t||r)};static \u0275prov=h({token:r,factory:r.\u0275fac,providedIn:"root"})};export{k as a,J as b};
package/chunk-C3PQFWVO.js DELETED
@@ -1 +0,0 @@
1
- import{a,b}from"./chunk-XXVDL5TR.js";import"./chunk-GRE6GKVP.js";import"./chunk-DJXLNIMV.js";import"./chunk-CAQ3XMFP.js";import"./chunk-VC55KFAX.js";import"./chunk-ZEFSBETQ.js";import"./chunk-6Q6SSTBK.js";import"./chunk-YCJYEQF7.js";import"./chunk-OHYENIPP.js";import"./chunk-UTXZPAY6.js";import"./chunk-IMQUTGIK.js";import"./chunk-BACKG7KA.js";import"./chunk-IQL3REGJ.js";import"./chunk-AIAUP7OE.js";import"./chunk-C6PICAXB.js";import"./chunk-6JS7B4FW.js";import"./chunk-VKQQDCUN.js";import"./chunk-DSYNIXJF.js";import"./chunk-NPFPMA4P.js";import"./chunk-O2SMJYPC.js";import"./chunk-N2AU7VKX.js";import"./chunk-ZC23RK4J.js";import"./chunk-OPHQNXYO.js";import"./chunk-TQTOIWBK.js";import"./chunk-7CGTOI24.js";export{a as createRestoreOptionsForm,b as default};
package/chunk-DSZ644JT.js DELETED
@@ -1 +0,0 @@
1
- import"./chunk-7CGTOI24.js";var o=[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-YWUUX3S6.js")},{path:"destination",loadComponent:()=>import("./chunk-EADZVBRA.js")},{path:"source-data",loadComponent:()=>import("./chunk-XEG3CP74.js")},{path:"schedule",loadComponent:()=>import("./chunk-4OA2FFS5.js")},{path:"options",loadComponent:()=>import("./chunk-ZNYRWXQR.js")}];export{o as default};